@mistriwork/mistri 1.0.0-rc.34 → 1.0.0-rc.35

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 (1137) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -1
  3. package/dist/adapters/commands/commandJournalSchema.js +9 -10
  4. package/dist/client/assets/AccountAdministration-k0lSg4L4.js +2 -0
  5. package/dist/client/assets/AccountAdministration-k0lSg4L4.js.br +0 -0
  6. package/dist/client/assets/AccountAdministration-k0lSg4L4.js.gz +0 -0
  7. package/dist/client/assets/AccountAdministration-k0lSg4L4.js.map +1 -0
  8. package/dist/client/assets/AccountControl-D3NSj9po.js +3 -0
  9. package/dist/client/assets/AccountControl-D3NSj9po.js.br +0 -0
  10. package/dist/client/assets/AccountControl-D3NSj9po.js.gz +0 -0
  11. package/dist/client/assets/AccountControl-D3NSj9po.js.map +1 -0
  12. package/dist/client/assets/AccountProfile-p8VcSKEt.js +2 -0
  13. package/dist/client/assets/AccountProfile-p8VcSKEt.js.br +0 -0
  14. package/dist/client/assets/AccountProfile-p8VcSKEt.js.gz +0 -0
  15. package/dist/client/assets/AccountProfile-p8VcSKEt.js.map +1 -0
  16. package/dist/client/assets/ApiOperations-DxA2PbUX.js +2 -0
  17. package/dist/client/assets/ApiOperations-DxA2PbUX.js.br +0 -0
  18. package/dist/client/assets/ApiOperations-DxA2PbUX.js.gz +0 -0
  19. package/dist/client/assets/ApiOperations-DxA2PbUX.js.map +1 -0
  20. package/dist/client/assets/AppColumnMenuPopups-CziyIHgG.js +2 -0
  21. package/dist/client/assets/AppColumnMenuPopups-CziyIHgG.js.br +0 -0
  22. package/dist/client/assets/AppColumnMenuPopups-CziyIHgG.js.gz +0 -0
  23. package/dist/client/assets/AppColumnMenuPopups-CziyIHgG.js.map +1 -0
  24. package/dist/client/assets/AsOfChip-DukzBdSi.js +2 -0
  25. package/dist/client/assets/AsOfChip-DukzBdSi.js.br +0 -0
  26. package/dist/client/assets/AsOfChip-DukzBdSi.js.gz +0 -0
  27. package/dist/client/assets/AsOfChip-DukzBdSi.js.map +1 -0
  28. package/dist/client/assets/AssistantPanel-CAag-yY1.js +3 -0
  29. package/dist/client/assets/AssistantPanel-CAag-yY1.js.br +0 -0
  30. package/dist/client/assets/AssistantPanel-CAag-yY1.js.gz +0 -0
  31. package/dist/client/assets/AssistantPanel-CAag-yY1.js.map +1 -0
  32. package/dist/client/assets/AttachmentList-Ciz3VvkG.js +3 -0
  33. package/dist/client/assets/AttachmentList-Ciz3VvkG.js.br +0 -0
  34. package/dist/client/assets/AttachmentList-Ciz3VvkG.js.gz +0 -0
  35. package/dist/client/assets/AttachmentList-Ciz3VvkG.js.map +1 -0
  36. package/dist/client/assets/BoardCardEditor-lUmO-a4K.js +2 -0
  37. package/dist/client/assets/BoardCardEditor-lUmO-a4K.js.br +0 -0
  38. package/dist/client/assets/BoardCardEditor-lUmO-a4K.js.gz +0 -0
  39. package/dist/client/assets/BoardCardEditor-lUmO-a4K.js.map +1 -0
  40. package/dist/client/assets/BoardList-DgG-HAof.js +5 -0
  41. package/dist/client/assets/BoardList-DgG-HAof.js.br +0 -0
  42. package/dist/client/assets/BoardList-DgG-HAof.js.gz +0 -0
  43. package/dist/client/assets/BoardList-DgG-HAof.js.map +1 -0
  44. package/dist/client/assets/BrandingForm-CZjkbPTS.js +2 -0
  45. package/dist/client/assets/BrandingForm-CZjkbPTS.js.br +0 -0
  46. package/dist/client/assets/BrandingForm-CZjkbPTS.js.gz +0 -0
  47. package/dist/client/assets/BrandingForm-CZjkbPTS.js.map +1 -0
  48. package/dist/client/assets/BreakdownRoom-CSMk1unC.js +2 -0
  49. package/dist/client/assets/BreakdownRoom-CSMk1unC.js.br +0 -0
  50. package/dist/client/assets/BreakdownRoom-CSMk1unC.js.gz +0 -0
  51. package/dist/client/assets/BreakdownRoom-CSMk1unC.js.map +1 -0
  52. package/dist/client/assets/CalendarList-BM1pMzq5.js +2 -0
  53. package/dist/client/assets/CalendarList-BM1pMzq5.js.br +0 -0
  54. package/dist/client/assets/CalendarList-BM1pMzq5.js.gz +0 -0
  55. package/dist/client/assets/CalendarList-BM1pMzq5.js.map +1 -0
  56. package/dist/client/assets/CardsList-DcGpJWQE.js +2 -0
  57. package/dist/client/assets/CardsList-DcGpJWQE.js.br +0 -0
  58. package/dist/client/assets/CardsList-DcGpJWQE.js.gz +0 -0
  59. package/dist/client/assets/CardsList-DcGpJWQE.js.map +1 -0
  60. package/dist/client/assets/Chart-BN1tUHmc.js +2 -0
  61. package/dist/client/assets/Chart-BN1tUHmc.js.br +0 -0
  62. package/dist/client/assets/Chart-BN1tUHmc.js.gz +0 -0
  63. package/dist/client/assets/Chart-BN1tUHmc.js.map +1 -0
  64. package/dist/client/assets/ChartFigure-CH_yWzQj.js +3 -0
  65. package/dist/client/assets/ChartFigure-CH_yWzQj.js.br +0 -0
  66. package/dist/client/assets/ChartFigure-CH_yWzQj.js.gz +0 -0
  67. package/dist/client/assets/ChartFigure-CH_yWzQj.js.map +1 -0
  68. package/dist/client/assets/ChartShapes-Dmzhpe0E.js +2 -0
  69. package/dist/client/assets/ChartShapes-Dmzhpe0E.js.br +0 -0
  70. package/dist/client/assets/ChartShapes-Dmzhpe0E.js.gz +0 -0
  71. package/dist/client/assets/ChartShapes-Dmzhpe0E.js.map +1 -0
  72. package/dist/client/assets/CheckedAppTargetAction-EIw2_GWj.js +2 -0
  73. package/dist/client/assets/CheckedAppTargetAction-EIw2_GWj.js.br +0 -0
  74. package/dist/client/assets/CheckedAppTargetAction-EIw2_GWj.js.gz +0 -0
  75. package/dist/client/assets/CheckedAppTargetAction-EIw2_GWj.js.map +1 -0
  76. package/dist/client/assets/Choices-jMLc3A6A.js +2 -0
  77. package/dist/client/assets/Choices-jMLc3A6A.js.br +0 -0
  78. package/dist/client/assets/Choices-jMLc3A6A.js.gz +0 -0
  79. package/dist/client/assets/Choices-jMLc3A6A.js.map +1 -0
  80. package/dist/client/assets/ClaimInvitation-CJ62rAFs.js +2 -0
  81. package/dist/client/assets/ClaimInvitation-CJ62rAFs.js.br +0 -0
  82. package/dist/client/assets/ClaimInvitation-CJ62rAFs.js.gz +0 -0
  83. package/dist/client/assets/ClaimInvitation-CJ62rAFs.js.map +1 -0
  84. package/dist/client/assets/CommandAnswers-BpDEMWHE.js +2 -0
  85. package/dist/client/assets/CommandAnswers-BpDEMWHE.js.br +0 -0
  86. package/dist/client/assets/CommandAnswers-BpDEMWHE.js.gz +0 -0
  87. package/dist/client/assets/CommandAnswers-BpDEMWHE.js.map +1 -0
  88. package/dist/client/assets/CommandForm-rwjHMxTQ.js +3 -0
  89. package/dist/client/assets/CommandForm-rwjHMxTQ.js.br +0 -0
  90. package/dist/client/assets/CommandForm-rwjHMxTQ.js.gz +0 -0
  91. package/dist/client/assets/CommandForm-rwjHMxTQ.js.map +1 -0
  92. package/dist/client/assets/CommandLines-B9zlmbIU.js +2 -0
  93. package/dist/client/assets/CommandLines-B9zlmbIU.js.br +0 -0
  94. package/dist/client/assets/CommandLines-B9zlmbIU.js.gz +0 -0
  95. package/dist/client/assets/CommandLines-B9zlmbIU.js.map +1 -0
  96. package/dist/client/assets/CommandLive-DOiH-UTF.js +2 -0
  97. package/dist/client/assets/CommandLive-DOiH-UTF.js.br +0 -0
  98. package/dist/client/assets/CommandLive-DOiH-UTF.js.gz +0 -0
  99. package/dist/client/assets/CommandLive-DOiH-UTF.js.map +1 -0
  100. package/dist/client/assets/CommandReference-CE8k_QvM.js +3 -0
  101. package/dist/client/assets/CommandReference-CE8k_QvM.js.br +0 -0
  102. package/dist/client/assets/CommandReference-CE8k_QvM.js.gz +0 -0
  103. package/dist/client/assets/CommandReference-CE8k_QvM.js.map +1 -0
  104. package/dist/client/assets/Composer-BMAbAbLT.js +5 -0
  105. package/dist/client/assets/Composer-BMAbAbLT.js.br +0 -0
  106. package/dist/client/assets/Composer-BMAbAbLT.js.gz +0 -0
  107. package/dist/client/assets/Composer-BMAbAbLT.js.map +1 -0
  108. package/dist/client/assets/CountedLabel-DOu4oXbO.js +2 -0
  109. package/dist/client/assets/CountedLabel-DOu4oXbO.js.br +0 -0
  110. package/dist/client/assets/CountedLabel-DOu4oXbO.js.gz +0 -0
  111. package/dist/client/assets/CountedLabel-DOu4oXbO.js.map +1 -0
  112. package/dist/client/assets/CustomList-C2p_IaMt.js +2 -0
  113. package/dist/client/assets/CustomList-C2p_IaMt.js.br +0 -0
  114. package/dist/client/assets/CustomList-C2p_IaMt.js.gz +0 -0
  115. package/dist/client/assets/CustomList-C2p_IaMt.js.map +1 -0
  116. package/dist/client/assets/CustomPage-CjC3cwhm.js +3 -0
  117. package/dist/client/assets/CustomPage-CjC3cwhm.js.br +0 -0
  118. package/dist/client/assets/CustomPage-CjC3cwhm.js.gz +0 -0
  119. package/dist/client/assets/CustomPage-CjC3cwhm.js.map +1 -0
  120. package/dist/client/assets/CustomSection-DA9Rw0A6.js +2 -0
  121. package/dist/client/assets/CustomSection-DA9Rw0A6.js.br +0 -0
  122. package/dist/client/assets/CustomSection-DA9Rw0A6.js.gz +0 -0
  123. package/dist/client/assets/CustomSection-DA9Rw0A6.js.map +1 -0
  124. package/dist/client/assets/Dashboard-CCohuQ7E.js +3 -0
  125. package/dist/client/assets/Dashboard-CCohuQ7E.js.br +0 -0
  126. package/dist/client/assets/Dashboard-CCohuQ7E.js.gz +0 -0
  127. package/dist/client/assets/Dashboard-CCohuQ7E.js.map +1 -0
  128. package/dist/client/assets/DashboardActivity-BAEuPuIh.js +2 -0
  129. package/dist/client/assets/DashboardActivity-BAEuPuIh.js.br +0 -0
  130. package/dist/client/assets/DashboardActivity-BAEuPuIh.js.gz +0 -0
  131. package/dist/client/assets/DashboardActivity-BAEuPuIh.js.map +1 -0
  132. package/dist/client/assets/DashboardFind-D31OVz3O.js +2 -0
  133. package/dist/client/assets/DashboardFind-D31OVz3O.js.br +0 -0
  134. package/dist/client/assets/DashboardFind-D31OVz3O.js.gz +0 -0
  135. package/dist/client/assets/DashboardFind-D31OVz3O.js.map +1 -0
  136. package/dist/client/assets/DashboardList-CcjnJXE3.js +2 -0
  137. package/dist/client/assets/DashboardList-CcjnJXE3.js.br +0 -0
  138. package/dist/client/assets/DashboardList-CcjnJXE3.js.gz +0 -0
  139. package/dist/client/assets/DashboardList-CcjnJXE3.js.map +1 -0
  140. package/dist/client/assets/DateTimeInput-DyeQR_Io.js +2 -0
  141. package/dist/client/assets/DateTimeInput-DyeQR_Io.js.br +0 -0
  142. package/dist/client/assets/DateTimeInput-DyeQR_Io.js.gz +0 -0
  143. package/dist/client/assets/DateTimeInput-DyeQR_Io.js.map +1 -0
  144. package/dist/client/assets/DecisionChip-BJPIwBEZ.js +2 -0
  145. package/dist/client/assets/DecisionChip-BJPIwBEZ.js.br +0 -0
  146. package/dist/client/assets/DecisionChip-BJPIwBEZ.js.gz +0 -0
  147. package/dist/client/assets/DecisionChip-BJPIwBEZ.js.map +1 -0
  148. package/dist/client/assets/DefinedFields-CvrHJbkw.js +2 -0
  149. package/dist/client/assets/DefinedFields-CvrHJbkw.js.br +0 -0
  150. package/dist/client/assets/DefinedFields-CvrHJbkw.js.gz +0 -0
  151. package/dist/client/assets/DefinedFields-CvrHJbkw.js.map +1 -0
  152. package/dist/client/assets/Diagram-CVvuVGWH.js +6 -0
  153. package/dist/client/assets/Diagram-CVvuVGWH.js.br +0 -0
  154. package/dist/client/assets/Diagram-CVvuVGWH.js.gz +0 -0
  155. package/dist/client/assets/Diagram-CVvuVGWH.js.map +1 -0
  156. package/dist/client/assets/Directory-Bb7sBoG6.js +2 -0
  157. package/dist/client/assets/Directory-Bb7sBoG6.js.br +0 -0
  158. package/dist/client/assets/Directory-Bb7sBoG6.js.gz +0 -0
  159. package/dist/client/assets/Directory-Bb7sBoG6.js.map +1 -0
  160. package/dist/client/assets/Document-C5NQUGNq.js +2 -0
  161. package/dist/client/assets/Document-C5NQUGNq.js.br +0 -0
  162. package/dist/client/assets/Document-C5NQUGNq.js.gz +0 -0
  163. package/dist/client/assets/Document-C5NQUGNq.js.map +1 -0
  164. package/dist/client/assets/Export-D60mLO5Y.js +2 -0
  165. package/dist/client/assets/Export-D60mLO5Y.js.br +0 -0
  166. package/dist/client/assets/Export-D60mLO5Y.js.gz +0 -0
  167. package/dist/client/assets/Export-D60mLO5Y.js.map +1 -0
  168. package/dist/client/assets/FilePreview-ev3RA_hJ.js +2 -0
  169. package/dist/client/assets/FilePreview-ev3RA_hJ.js.br +0 -0
  170. package/dist/client/assets/FilePreview-ev3RA_hJ.js.gz +0 -0
  171. package/dist/client/assets/FilePreview-ev3RA_hJ.js.map +1 -0
  172. package/dist/client/assets/FormClaimSurface-DIN4n3f7.js +2 -0
  173. package/dist/client/assets/FormClaimSurface-DIN4n3f7.js.br +0 -0
  174. package/dist/client/assets/FormClaimSurface-DIN4n3f7.js.gz +0 -0
  175. package/dist/client/assets/FormClaimSurface-DIN4n3f7.js.map +1 -0
  176. package/dist/client/assets/FormDialog-DAMN3zSr.js +3 -0
  177. package/dist/client/assets/FormDialog-DAMN3zSr.js.br +0 -0
  178. package/dist/client/assets/FormDialog-DAMN3zSr.js.gz +0 -0
  179. package/dist/client/assets/FormDialog-DAMN3zSr.js.map +1 -0
  180. package/dist/client/assets/FormLines-p068Zfxc.js +2 -0
  181. package/dist/client/assets/FormLines-p068Zfxc.js.br +0 -0
  182. package/dist/client/assets/FormLines-p068Zfxc.js.gz +0 -0
  183. package/dist/client/assets/FormLines-p068Zfxc.js.map +1 -0
  184. package/dist/client/assets/FormParts-BlDNZ0GG.js +2 -0
  185. package/dist/client/assets/FormParts-BlDNZ0GG.js.br +0 -0
  186. package/dist/client/assets/FormParts-BlDNZ0GG.js.gz +0 -0
  187. package/dist/client/assets/FormParts-BlDNZ0GG.js.map +1 -0
  188. package/dist/client/assets/FormStatusSurface-CbFBY8eV.js +2 -0
  189. package/dist/client/assets/FormStatusSurface-CbFBY8eV.js.br +0 -0
  190. package/dist/client/assets/FormStatusSurface-CbFBY8eV.js.gz +0 -0
  191. package/dist/client/assets/FormStatusSurface-CbFBY8eV.js.map +1 -0
  192. package/dist/client/assets/Gallery-CJ5yQ1_F.js +3 -0
  193. package/dist/client/assets/Gallery-CJ5yQ1_F.js.br +0 -0
  194. package/dist/client/assets/Gallery-CJ5yQ1_F.js.gz +0 -0
  195. package/dist/client/assets/Gallery-CJ5yQ1_F.js.map +1 -0
  196. package/dist/client/assets/GanttList-CFGbXQSC.js +2 -0
  197. package/dist/client/assets/GanttList-CFGbXQSC.js.br +0 -0
  198. package/dist/client/assets/GanttList-CFGbXQSC.js.gz +0 -0
  199. package/dist/client/assets/GanttList-CFGbXQSC.js.map +1 -0
  200. package/dist/client/assets/GridCellEditor-92Wh_5Mb.js +2 -0
  201. package/dist/client/assets/GridCellEditor-92Wh_5Mb.js.br +0 -0
  202. package/dist/client/assets/GridCellEditor-92Wh_5Mb.js.gz +0 -0
  203. package/dist/client/assets/GridCellEditor-92Wh_5Mb.js.map +1 -0
  204. package/dist/client/assets/HeldFiles-DZ7mPDxe.js +3 -0
  205. package/dist/client/assets/HeldFiles-DZ7mPDxe.js.br +0 -0
  206. package/dist/client/assets/HeldFiles-DZ7mPDxe.js.gz +0 -0
  207. package/dist/client/assets/HeldFiles-DZ7mPDxe.js.map +1 -0
  208. package/dist/client/assets/HelpPanel-CoMyHvBN.js +2 -0
  209. package/dist/client/assets/HelpPanel-CoMyHvBN.js.br +0 -0
  210. package/dist/client/assets/HelpPanel-CoMyHvBN.js.gz +0 -0
  211. package/dist/client/assets/HelpPanel-CoMyHvBN.js.map +1 -0
  212. package/dist/client/assets/ImportDialog-8O3i13PQ.js +9 -0
  213. package/dist/client/assets/ImportDialog-8O3i13PQ.js.br +0 -0
  214. package/dist/client/assets/ImportDialog-8O3i13PQ.js.gz +0 -0
  215. package/dist/client/assets/ImportDialog-8O3i13PQ.js.map +1 -0
  216. package/dist/client/assets/InboxList-CQ0CY4hT.js +2 -0
  217. package/dist/client/assets/InboxList-CQ0CY4hT.js.br +0 -0
  218. package/dist/client/assets/InboxList-CQ0CY4hT.js.gz +0 -0
  219. package/dist/client/assets/InboxList-CQ0CY4hT.js.map +1 -0
  220. package/dist/client/assets/IntakeControls-Dua2jgo0.js +2 -0
  221. package/dist/client/assets/IntakeControls-Dua2jgo0.js.br +0 -0
  222. package/dist/client/assets/IntakeControls-Dua2jgo0.js.gz +0 -0
  223. package/dist/client/assets/IntakeControls-Dua2jgo0.js.map +1 -0
  224. package/dist/client/assets/IntegrationsForm-pYtisdTi.js +2 -0
  225. package/dist/client/assets/IntegrationsForm-pYtisdTi.js.br +0 -0
  226. package/dist/client/assets/IntegrationsForm-pYtisdTi.js.gz +0 -0
  227. package/dist/client/assets/IntegrationsForm-pYtisdTi.js.map +1 -0
  228. package/dist/client/assets/JsonView-8Akr9Rgs.js +4 -0
  229. package/dist/client/assets/JsonView-8Akr9Rgs.js.br +0 -0
  230. package/dist/client/assets/JsonView-8Akr9Rgs.js.gz +0 -0
  231. package/dist/client/assets/JsonView-8Akr9Rgs.js.map +1 -0
  232. package/dist/client/assets/LayoutBuilder-ZHGY7v1J.js +2 -0
  233. package/dist/client/assets/LayoutBuilder-ZHGY7v1J.js.br +0 -0
  234. package/dist/client/assets/LayoutBuilder-ZHGY7v1J.js.gz +0 -0
  235. package/dist/client/assets/LayoutBuilder-ZHGY7v1J.js.map +1 -0
  236. package/dist/client/assets/Lightbox-DCP96tqR.js +2 -0
  237. package/dist/client/assets/Lightbox-DCP96tqR.js.br +0 -0
  238. package/dist/client/assets/Lightbox-DCP96tqR.js.gz +0 -0
  239. package/dist/client/assets/Lightbox-DCP96tqR.js.map +1 -0
  240. package/dist/client/assets/LiveNotices-CGP7wwTc.js +2 -0
  241. package/dist/client/assets/LiveNotices-CGP7wwTc.js.br +0 -0
  242. package/dist/client/assets/LiveNotices-CGP7wwTc.js.gz +0 -0
  243. package/dist/client/assets/LiveNotices-CGP7wwTc.js.map +1 -0
  244. package/dist/client/assets/MinorMoneyInput-DeVeS_jw.js +2 -0
  245. package/dist/client/assets/MinorMoneyInput-DeVeS_jw.js.br +0 -0
  246. package/dist/client/assets/MinorMoneyInput-DeVeS_jw.js.gz +0 -0
  247. package/dist/client/assets/MinorMoneyInput-DeVeS_jw.js.map +1 -0
  248. package/dist/client/assets/MultiStepForm-CxBVlxWj.js +3 -0
  249. package/dist/client/assets/MultiStepForm-CxBVlxWj.js.br +0 -0
  250. package/dist/client/assets/MultiStepForm-CxBVlxWj.js.gz +0 -0
  251. package/dist/client/assets/MultiStepForm-CxBVlxWj.js.map +1 -0
  252. package/dist/client/assets/NewMenu-BmoZPQKp.js +2 -0
  253. package/dist/client/assets/NewMenu-BmoZPQKp.js.br +0 -0
  254. package/dist/client/assets/NewMenu-BmoZPQKp.js.gz +0 -0
  255. package/dist/client/assets/NewMenu-BmoZPQKp.js.map +1 -0
  256. package/dist/client/assets/NewRecord-Dj7atwj6.js +3 -0
  257. package/dist/client/assets/NewRecord-Dj7atwj6.js.br +0 -0
  258. package/dist/client/assets/NewRecord-Dj7atwj6.js.gz +0 -0
  259. package/dist/client/assets/NewRecord-Dj7atwj6.js.map +1 -0
  260. package/dist/client/assets/PageFlowDiagram-BqOVsZmd.js +3 -0
  261. package/dist/client/assets/PageFlowDiagram-BqOVsZmd.js.br +0 -0
  262. package/dist/client/assets/PageFlowDiagram-BqOVsZmd.js.gz +0 -0
  263. package/dist/client/assets/PageFlowDiagram-BqOVsZmd.js.map +1 -0
  264. package/dist/client/assets/PageFlows-CG0HGKvh.js +2 -0
  265. package/dist/client/assets/PageFlows-CG0HGKvh.js.br +0 -0
  266. package/dist/client/assets/PageFlows-CG0HGKvh.js.gz +0 -0
  267. package/dist/client/assets/PageFlows-CG0HGKvh.js.map +1 -0
  268. package/dist/client/assets/PageGroups-DYKCYJr2.js +2 -0
  269. package/dist/client/assets/PageGroups-DYKCYJr2.js.br +0 -0
  270. package/dist/client/assets/PageGroups-DYKCYJr2.js.gz +0 -0
  271. package/dist/client/assets/PageGroups-DYKCYJr2.js.map +1 -0
  272. package/dist/client/assets/PageHistory-DyIdIPLr.js +2 -0
  273. package/dist/client/assets/PageHistory-DyIdIPLr.js.br +0 -0
  274. package/dist/client/assets/PageHistory-DyIdIPLr.js.gz +0 -0
  275. package/dist/client/assets/PageHistory-DyIdIPLr.js.map +1 -0
  276. package/dist/client/assets/PageSkeleton-qjnaRaGS.js +2 -0
  277. package/dist/client/assets/PageSkeleton-qjnaRaGS.js.br +2 -0
  278. package/dist/client/assets/PageSkeleton-qjnaRaGS.js.gz +0 -0
  279. package/dist/client/assets/PageSkeleton-qjnaRaGS.js.map +1 -0
  280. package/dist/client/assets/Palette-DUWwovvo.js +3 -0
  281. package/dist/client/assets/Palette-DUWwovvo.js.br +0 -0
  282. package/dist/client/assets/Palette-DUWwovvo.js.gz +0 -0
  283. package/dist/client/assets/Palette-DUWwovvo.js.map +1 -0
  284. package/dist/client/assets/PeekPanel-CYQXt5yf.js +2 -0
  285. package/dist/client/assets/PeekPanel-CYQXt5yf.js.br +0 -0
  286. package/dist/client/assets/PeekPanel-CYQXt5yf.js.gz +0 -0
  287. package/dist/client/assets/PeekPanel-CYQXt5yf.js.map +1 -0
  288. package/dist/client/assets/PlacedFormSurface-BONfJUC7.js +2 -0
  289. package/dist/client/assets/PlacedFormSurface-BONfJUC7.js.br +0 -0
  290. package/dist/client/assets/PlacedFormSurface-BONfJUC7.js.gz +0 -0
  291. package/dist/client/assets/PlacedFormSurface-BONfJUC7.js.map +1 -0
  292. package/dist/client/assets/Prefs-CDQo56nx.js +2 -0
  293. package/dist/client/assets/Prefs-CDQo56nx.js.br +0 -0
  294. package/dist/client/assets/Prefs-CDQo56nx.js.gz +0 -0
  295. package/dist/client/assets/Prefs-CDQo56nx.js.map +1 -0
  296. package/dist/client/assets/PresentedList-GQoSZyYr.js +2 -0
  297. package/dist/client/assets/PresentedList-GQoSZyYr.js.br +0 -0
  298. package/dist/client/assets/PresentedList-GQoSZyYr.js.gz +0 -0
  299. package/dist/client/assets/PresentedList-GQoSZyYr.js.map +1 -0
  300. package/dist/client/assets/PublicGuard-BI9ygPtS.js +2 -0
  301. package/dist/client/assets/PublicGuard-BI9ygPtS.js.br +0 -0
  302. package/dist/client/assets/PublicGuard-BI9ygPtS.js.gz +0 -0
  303. package/dist/client/assets/PublicGuard-BI9ygPtS.js.map +1 -0
  304. package/dist/client/assets/QrCode-CqxFbur1.js +4 -0
  305. package/dist/client/assets/QrCode-CqxFbur1.js.br +0 -0
  306. package/dist/client/assets/QrCode-CqxFbur1.js.gz +0 -0
  307. package/dist/client/assets/QrCode-CqxFbur1.js.map +1 -0
  308. package/dist/client/assets/QuickAdd-CpzEpoGq.js +2 -0
  309. package/dist/client/assets/QuickAdd-CpzEpoGq.js.br +0 -0
  310. package/dist/client/assets/QuickAdd-CpzEpoGq.js.gz +0 -0
  311. package/dist/client/assets/QuickAdd-CpzEpoGq.js.map +1 -0
  312. package/dist/client/assets/Record-QEjD9NcZ.js +2 -0
  313. package/dist/client/assets/Record-QEjD9NcZ.js.br +0 -0
  314. package/dist/client/assets/Record-QEjD9NcZ.js.gz +0 -0
  315. package/dist/client/assets/Record-QEjD9NcZ.js.map +1 -0
  316. package/dist/client/assets/RecordModal-DfFD8Qne.js +2 -0
  317. package/dist/client/assets/RecordModal-DfFD8Qne.js.br +0 -0
  318. package/dist/client/assets/RecordModal-DfFD8Qne.js.gz +0 -0
  319. package/dist/client/assets/RecordModal-DfFD8Qne.js.map +1 -0
  320. package/dist/client/assets/RichTextEditor--Am_WaHf.js +144 -0
  321. package/dist/client/assets/RichTextEditor--Am_WaHf.js.br +0 -0
  322. package/dist/client/assets/RichTextEditor--Am_WaHf.js.gz +0 -0
  323. package/dist/client/assets/RichTextEditor--Am_WaHf.js.map +1 -0
  324. package/dist/client/assets/SavedFormSurface-BmYGMR4d.js +2 -0
  325. package/dist/client/assets/SavedFormSurface-BmYGMR4d.js.br +0 -0
  326. package/dist/client/assets/SavedFormSurface-BmYGMR4d.js.gz +0 -0
  327. package/dist/client/assets/SavedFormSurface-BmYGMR4d.js.map +1 -0
  328. package/dist/client/assets/SectionPeriod-COF-FBe3.js +2 -0
  329. package/dist/client/assets/SectionPeriod-COF-FBe3.js.br +2 -0
  330. package/dist/client/assets/SectionPeriod-COF-FBe3.js.gz +0 -0
  331. package/dist/client/assets/SectionPeriod-COF-FBe3.js.map +1 -0
  332. package/dist/client/assets/SetFieldDialog-CAxQGIjG.js +2 -0
  333. package/dist/client/assets/SetFieldDialog-CAxQGIjG.js.br +0 -0
  334. package/dist/client/assets/SetFieldDialog-CAxQGIjG.js.gz +0 -0
  335. package/dist/client/assets/SetFieldDialog-CAxQGIjG.js.map +1 -0
  336. package/dist/client/assets/SignedInFormDialog-BGlB42Ww.js +2 -0
  337. package/dist/client/assets/SignedInFormDialog-BGlB42Ww.js.br +2 -0
  338. package/dist/client/assets/SignedInFormDialog-BGlB42Ww.js.gz +0 -0
  339. package/dist/client/assets/SignedInFormDialog-BGlB42Ww.js.map +1 -0
  340. package/dist/client/assets/SuggestBox-CjP-WGbG.js +2 -0
  341. package/dist/client/assets/SuggestBox-CjP-WGbG.js.br +0 -0
  342. package/dist/client/assets/SuggestBox-CjP-WGbG.js.gz +0 -0
  343. package/dist/client/assets/SuggestBox-CjP-WGbG.js.map +1 -0
  344. package/dist/client/assets/SuiteAppPreference-CXVvPO66.js +2 -0
  345. package/dist/client/assets/SuiteAppPreference-CXVvPO66.js.br +0 -0
  346. package/dist/client/assets/SuiteAppPreference-CXVvPO66.js.gz +0 -0
  347. package/dist/client/assets/SuiteAppPreference-CXVvPO66.js.map +1 -0
  348. package/dist/client/assets/SuiteAppSwitcher-Cmda8WA7.js +2 -0
  349. package/dist/client/assets/SuiteAppSwitcher-Cmda8WA7.js.br +0 -0
  350. package/dist/client/assets/SuiteAppSwitcher-Cmda8WA7.js.gz +0 -0
  351. package/dist/client/assets/SuiteAppSwitcher-Cmda8WA7.js.map +1 -0
  352. package/dist/client/assets/SupportLog-B8QZ3rvd.js +2 -0
  353. package/dist/client/assets/SupportLog-B8QZ3rvd.js.br +0 -0
  354. package/dist/client/assets/SupportLog-B8QZ3rvd.js.gz +0 -0
  355. package/dist/client/assets/SupportLog-B8QZ3rvd.js.map +1 -0
  356. package/dist/client/assets/SupportSessions-Cyn2I8G1.js +2 -0
  357. package/dist/client/assets/SupportSessions-Cyn2I8G1.js.br +0 -0
  358. package/dist/client/assets/SupportSessions-Cyn2I8G1.js.gz +0 -0
  359. package/dist/client/assets/SupportSessions-Cyn2I8G1.js.map +1 -0
  360. package/dist/client/assets/TenantAdministration-CXGMxfOu.js +4 -0
  361. package/dist/client/assets/TenantAdministration-CXGMxfOu.js.br +0 -0
  362. package/dist/client/assets/TenantAdministration-CXGMxfOu.js.gz +0 -0
  363. package/dist/client/assets/TenantAdministration-CXGMxfOu.js.map +1 -0
  364. package/dist/client/assets/TenantApiTokens-Cqyz0KaC.js +2 -0
  365. package/dist/client/assets/TenantApiTokens-Cqyz0KaC.js.br +0 -0
  366. package/dist/client/assets/TenantApiTokens-Cqyz0KaC.js.gz +0 -0
  367. package/dist/client/assets/TenantApiTokens-Cqyz0KaC.js.map +1 -0
  368. package/dist/client/assets/TenantInvitations-BKCQDdYs.js +2 -0
  369. package/dist/client/assets/TenantInvitations-BKCQDdYs.js.br +0 -0
  370. package/dist/client/assets/TenantInvitations-BKCQDdYs.js.gz +0 -0
  371. package/dist/client/assets/TenantInvitations-BKCQDdYs.js.map +1 -0
  372. package/dist/client/assets/ThemeLab-CUH3fjaa.js +4 -0
  373. package/dist/client/assets/ThemeLab-CUH3fjaa.js.br +0 -0
  374. package/dist/client/assets/ThemeLab-CUH3fjaa.js.gz +0 -0
  375. package/dist/client/assets/ThemeLab-CUH3fjaa.js.map +1 -0
  376. package/dist/client/assets/TimelineComposer-B8wN8pJv.js +2 -0
  377. package/dist/client/assets/TimelineComposer-B8wN8pJv.js.br +0 -0
  378. package/dist/client/assets/TimelineComposer-B8wN8pJv.js.gz +0 -0
  379. package/dist/client/assets/TimelineComposer-B8wN8pJv.js.map +1 -0
  380. package/dist/client/assets/TimelineReactions-Bar-Nn5E.js +2 -0
  381. package/dist/client/assets/TimelineReactions-Bar-Nn5E.js.br +0 -0
  382. package/dist/client/assets/TimelineReactions-Bar-Nn5E.js.gz +0 -0
  383. package/dist/client/assets/TimelineReactions-Bar-Nn5E.js.map +1 -0
  384. package/dist/client/assets/TopNav-CvEoPTNu.js +3 -0
  385. package/dist/client/assets/TopNav-CvEoPTNu.js.br +0 -0
  386. package/dist/client/assets/TopNav-CvEoPTNu.js.gz +0 -0
  387. package/dist/client/assets/TopNav-CvEoPTNu.js.map +1 -0
  388. package/dist/client/assets/Tour-BmYdtbXU.js +2 -0
  389. package/dist/client/assets/Tour-BmYdtbXU.js.br +0 -0
  390. package/dist/client/assets/Tour-BmYdtbXU.js.gz +0 -0
  391. package/dist/client/assets/Tour-BmYdtbXU.js.map +1 -0
  392. package/dist/client/assets/TreeList-tULtFXG6.js +2 -0
  393. package/dist/client/assets/TreeList-tULtFXG6.js.br +0 -0
  394. package/dist/client/assets/TreeList-tULtFXG6.js.gz +0 -0
  395. package/dist/client/assets/TreeList-tULtFXG6.js.map +1 -0
  396. package/dist/client/assets/TreePicker-DGj3Z6NC.js +2 -0
  397. package/dist/client/assets/TreePicker-DGj3Z6NC.js.br +0 -0
  398. package/dist/client/assets/TreePicker-DGj3Z6NC.js.gz +0 -0
  399. package/dist/client/assets/TreePicker-DGj3Z6NC.js.map +1 -0
  400. package/dist/client/assets/ViewFormDialog-CDLQyRTw.js +3 -0
  401. package/dist/client/assets/ViewFormDialog-CDLQyRTw.js.br +0 -0
  402. package/dist/client/assets/ViewFormDialog-CDLQyRTw.js.gz +0 -0
  403. package/dist/client/assets/ViewFormDialog-CDLQyRTw.js.map +1 -0
  404. package/dist/client/assets/appImport-DDwzxtP1.js +4 -0
  405. package/dist/client/assets/appImport-DDwzxtP1.js.br +0 -0
  406. package/dist/client/assets/appImport-DDwzxtP1.js.gz +0 -0
  407. package/dist/client/assets/appImport-DDwzxtP1.js.map +1 -0
  408. package/dist/client/assets/appLive-COIGDbj9.js +3 -0
  409. package/dist/client/assets/appLive-COIGDbj9.js.br +0 -0
  410. package/dist/client/assets/appLive-COIGDbj9.js.gz +0 -0
  411. package/dist/client/assets/appLive-COIGDbj9.js.map +1 -0
  412. package/dist/client/assets/assistantStream-B-SoxURv.js +7 -0
  413. package/dist/client/assets/assistantStream-B-SoxURv.js.br +0 -0
  414. package/dist/client/assets/assistantStream-B-SoxURv.js.gz +0 -0
  415. package/dist/client/assets/assistantStream-B-SoxURv.js.map +1 -0
  416. package/dist/client/assets/beacon-BuVZ8MDW.js +2 -0
  417. package/dist/client/assets/beacon-BuVZ8MDW.js.br +0 -0
  418. package/dist/client/assets/beacon-BuVZ8MDW.js.gz +0 -0
  419. package/dist/client/assets/beacon-BuVZ8MDW.js.map +1 -0
  420. package/dist/client/assets/blocks-CzUjFgm-.js +3 -0
  421. package/dist/client/assets/blocks-CzUjFgm-.js.br +0 -0
  422. package/dist/client/assets/blocks-CzUjFgm-.js.gz +0 -0
  423. package/dist/client/assets/blocks-CzUjFgm-.js.map +1 -0
  424. package/dist/client/assets/builtInInputs-C3j7d2uF.js +3 -0
  425. package/dist/client/assets/builtInInputs-C3j7d2uF.js.br +0 -0
  426. package/dist/client/assets/builtInInputs-C3j7d2uF.js.gz +0 -0
  427. package/dist/client/assets/builtInInputs-C3j7d2uF.js.map +1 -0
  428. package/dist/client/assets/commandDraft-Cdboj46f.js +2 -0
  429. package/dist/client/assets/commandDraft-Cdboj46f.js.br +0 -0
  430. package/dist/client/assets/commandDraft-Cdboj46f.js.gz +0 -0
  431. package/dist/client/assets/commandDraft-Cdboj46f.js.map +1 -0
  432. package/dist/client/assets/componentLoader-DX9U2BOa.js +3 -0
  433. package/dist/client/assets/componentLoader-DX9U2BOa.js.br +0 -0
  434. package/dist/client/assets/componentLoader-DX9U2BOa.js.gz +0 -0
  435. package/dist/client/assets/componentLoader-DX9U2BOa.js.map +1 -0
  436. package/dist/client/assets/composer-B3iveMnA.js +2 -0
  437. package/dist/client/assets/composer-B3iveMnA.js.br +0 -0
  438. package/dist/client/assets/composer-B3iveMnA.js.gz +0 -0
  439. package/dist/client/assets/composer-B3iveMnA.js.map +1 -0
  440. package/dist/client/assets/computedParse-qmXbLM0o.js +2 -0
  441. package/dist/client/assets/computedParse-qmXbLM0o.js.br +0 -0
  442. package/dist/client/assets/computedParse-qmXbLM0o.js.gz +0 -0
  443. package/dist/client/assets/computedParse-qmXbLM0o.js.map +1 -0
  444. package/dist/client/assets/computedValue-aBO9YPUl.js +2 -0
  445. package/dist/client/assets/computedValue-aBO9YPUl.js.br +0 -0
  446. package/dist/client/assets/computedValue-aBO9YPUl.js.gz +0 -0
  447. package/dist/client/assets/computedValue-aBO9YPUl.js.map +1 -0
  448. package/dist/client/assets/conditionWords-snEJReRe.js +2 -0
  449. package/dist/client/assets/conditionWords-snEJReRe.js.br +0 -0
  450. package/dist/client/assets/conditionWords-snEJReRe.js.gz +0 -0
  451. package/dist/client/assets/conditionWords-snEJReRe.js.map +1 -0
  452. package/dist/client/assets/definedValues-C1WEJErx.js +2 -0
  453. package/dist/client/assets/definedValues-C1WEJErx.js.br +0 -0
  454. package/dist/client/assets/definedValues-C1WEJErx.js.gz +0 -0
  455. package/dist/client/assets/definedValues-C1WEJErx.js.map +1 -0
  456. package/dist/client/assets/experimentExposure-CyKO0mH8.js +3 -0
  457. package/dist/client/assets/experimentExposure-CyKO0mH8.js.br +0 -0
  458. package/dist/client/assets/experimentExposure-CyKO0mH8.js.gz +0 -0
  459. package/dist/client/assets/experimentExposure-CyKO0mH8.js.map +1 -0
  460. package/dist/client/assets/export-Go_3Ncw6.js +4 -0
  461. package/dist/client/assets/export-Go_3Ncw6.js.br +0 -0
  462. package/dist/client/assets/export-Go_3Ncw6.js.gz +0 -0
  463. package/dist/client/assets/export-Go_3Ncw6.js.map +1 -0
  464. package/dist/client/assets/formCommandRun-BjvsJglU.js +2 -0
  465. package/dist/client/assets/formCommandRun-BjvsJglU.js.br +0 -0
  466. package/dist/client/assets/formCommandRun-BjvsJglU.js.gz +0 -0
  467. package/dist/client/assets/formCommandRun-BjvsJglU.js.map +1 -0
  468. package/dist/client/assets/formStepCheck-BYw7hGM7.js +2 -0
  469. package/dist/client/assets/formStepCheck-BYw7hGM7.js.br +0 -0
  470. package/dist/client/assets/formStepCheck-BYw7hGM7.js.gz +0 -0
  471. package/dist/client/assets/formStepCheck-BYw7hGM7.js.map +1 -0
  472. package/dist/client/assets/funnel-DOdqpCX6.js +2 -0
  473. package/dist/client/assets/funnel-DOdqpCX6.js.br +0 -0
  474. package/dist/client/assets/funnel-DOdqpCX6.js.gz +0 -0
  475. package/dist/client/assets/funnel-DOdqpCX6.js.map +1 -0
  476. package/dist/client/assets/handoff-DOjnNDsu.js +3 -0
  477. package/dist/client/assets/handoff-DOjnNDsu.js.br +0 -0
  478. package/dist/client/assets/handoff-DOjnNDsu.js.gz +0 -0
  479. package/dist/client/assets/handoff-DOjnNDsu.js.map +1 -0
  480. package/dist/client/assets/headlessLanding-B4ojD22g.js +2 -0
  481. package/dist/client/assets/headlessLanding-B4ojD22g.js.br +0 -0
  482. package/dist/client/assets/headlessLanding-B4ojD22g.js.gz +0 -0
  483. package/dist/client/assets/headlessLanding-B4ojD22g.js.map +1 -0
  484. package/dist/client/assets/index-YB5g6elu.js +16 -0
  485. package/dist/client/assets/index-YB5g6elu.js.br +0 -0
  486. package/dist/client/assets/index-YB5g6elu.js.gz +0 -0
  487. package/dist/client/assets/index-YB5g6elu.js.map +1 -0
  488. package/dist/client/assets/liveSync-CFuH_ghe.js +3 -0
  489. package/dist/client/assets/liveSync-CFuH_ghe.js.br +0 -0
  490. package/dist/client/assets/liveSync-CFuH_ghe.js.gz +0 -0
  491. package/dist/client/assets/liveSync-CFuH_ghe.js.map +1 -0
  492. package/dist/client/assets/mentionRows-CZHhEE1r.js +2 -0
  493. package/dist/client/assets/mentionRows-CZHhEE1r.js.br +0 -0
  494. package/dist/client/assets/mentionRows-CZHhEE1r.js.gz +0 -0
  495. package/dist/client/assets/mentionRows-CZHhEE1r.js.map +1 -0
  496. package/dist/client/assets/newMenuModel-n05Tjq2R.js +2 -0
  497. package/dist/client/assets/newMenuModel-n05Tjq2R.js.br +0 -0
  498. package/dist/client/assets/newMenuModel-n05Tjq2R.js.gz +0 -0
  499. package/dist/client/assets/newMenuModel-n05Tjq2R.js.map +1 -0
  500. package/dist/client/assets/newRecordModel-CrGTRDJS.js +2 -0
  501. package/dist/client/assets/newRecordModel-CrGTRDJS.js.br +0 -0
  502. package/dist/client/assets/newRecordModel-CrGTRDJS.js.gz +0 -0
  503. package/dist/client/assets/newRecordModel-CrGTRDJS.js.map +1 -0
  504. package/dist/client/assets/oauthConsent-CfwVbcv4.js +2 -0
  505. package/dist/client/assets/oauthConsent-CfwVbcv4.js.br +0 -0
  506. package/dist/client/assets/oauthConsent-CfwVbcv4.js.gz +0 -0
  507. package/dist/client/assets/oauthConsent-CfwVbcv4.js.map +1 -0
  508. package/dist/client/assets/pageControls-qQZ6u9zP.js +2 -0
  509. package/dist/client/assets/pageControls-qQZ6u9zP.js.br +0 -0
  510. package/dist/client/assets/pageControls-qQZ6u9zP.js.gz +0 -0
  511. package/dist/client/assets/pageControls-qQZ6u9zP.js.map +1 -0
  512. package/dist/client/assets/paramControls-Dq2DJhPP.js +2 -0
  513. package/dist/client/assets/paramControls-Dq2DJhPP.js.br +0 -0
  514. package/dist/client/assets/paramControls-Dq2DJhPP.js.gz +0 -0
  515. package/dist/client/assets/paramControls-Dq2DJhPP.js.map +1 -0
  516. package/dist/client/assets/public-DG__jqw_.js +3 -0
  517. package/dist/client/assets/public-DG__jqw_.js.br +0 -0
  518. package/dist/client/assets/public-DG__jqw_.js.gz +0 -0
  519. package/dist/client/assets/public-DG__jqw_.js.map +1 -0
  520. package/dist/client/assets/publicInputs-DQR-WRab.js +3 -0
  521. package/dist/client/assets/publicInputs-DQR-WRab.js.br +3 -0
  522. package/dist/client/assets/publicInputs-DQR-WRab.js.gz +0 -0
  523. package/dist/client/assets/publicInputs-DQR-WRab.js.map +1 -0
  524. package/dist/client/assets/publicPageCommand-CS8CtUqB.js +2 -0
  525. package/dist/client/assets/publicPageCommand-CS8CtUqB.js.br +0 -0
  526. package/dist/client/assets/publicPageCommand-CS8CtUqB.js.gz +0 -0
  527. package/dist/client/assets/publicPageCommand-CS8CtUqB.js.map +1 -0
  528. package/dist/client/assets/publicPlacement-fBdQWr1n.js +2 -0
  529. package/dist/client/assets/publicPlacement-fBdQWr1n.js.br +0 -0
  530. package/dist/client/assets/publicPlacement-fBdQWr1n.js.gz +0 -0
  531. package/dist/client/assets/publicPlacement-fBdQWr1n.js.map +1 -0
  532. package/dist/client/assets/recordSearch-GLSoUf-J.js +2 -0
  533. package/dist/client/assets/recordSearch-GLSoUf-J.js.br +0 -0
  534. package/dist/client/assets/recordSearch-GLSoUf-J.js.gz +0 -0
  535. package/dist/client/assets/recordSearch-GLSoUf-J.js.map +1 -0
  536. package/dist/client/assets/savedFormApi-C1SXvpih.js +2 -0
  537. package/dist/client/assets/savedFormApi-C1SXvpih.js.br +0 -0
  538. package/dist/client/assets/savedFormApi-C1SXvpih.js.gz +0 -0
  539. package/dist/client/assets/savedFormApi-C1SXvpih.js.map +1 -0
  540. package/dist/client/assets/shell-UOqMGfHm.js +13 -0
  541. package/dist/client/assets/shell-UOqMGfHm.js.br +0 -0
  542. package/dist/client/assets/shell-UOqMGfHm.js.gz +0 -0
  543. package/dist/client/assets/shell-UOqMGfHm.js.map +1 -0
  544. package/dist/client/assets/steps-BuMYsYrH.js +2 -0
  545. package/dist/client/assets/steps-BuMYsYrH.js.br +0 -0
  546. package/dist/client/assets/steps-BuMYsYrH.js.gz +0 -0
  547. package/dist/client/assets/steps-BuMYsYrH.js.map +1 -0
  548. package/dist/client/assets/tenant-CLmIa5pl.js +3 -0
  549. package/dist/client/assets/tenant-CLmIa5pl.js.br +0 -0
  550. package/dist/client/assets/tenant-CLmIa5pl.js.gz +0 -0
  551. package/dist/client/assets/tenant-CLmIa5pl.js.map +1 -0
  552. package/dist/client/assets/tenantInvitations-GiR5jiNd.js +2 -0
  553. package/dist/client/assets/tenantInvitations-GiR5jiNd.js.br +0 -0
  554. package/dist/client/assets/tenantInvitations-GiR5jiNd.js.gz +0 -0
  555. package/dist/client/assets/tenantInvitations-GiR5jiNd.js.map +1 -0
  556. package/dist/client/assets/tenantLive-m76CsKaK.js +2 -0
  557. package/dist/client/assets/tenantLive-m76CsKaK.js.br +0 -0
  558. package/dist/client/assets/tenantLive-m76CsKaK.js.gz +0 -0
  559. package/dist/client/assets/tenantLive-m76CsKaK.js.map +1 -0
  560. package/dist/client/assets/themeBench-CKLalHAb.js +2 -0
  561. package/dist/client/assets/themeBench-CKLalHAb.js.br +0 -0
  562. package/dist/client/assets/themeBench-CKLalHAb.js.gz +0 -0
  563. package/dist/client/assets/themeBench-CKLalHAb.js.map +1 -0
  564. package/dist/client/index.html +2 -2
  565. package/dist/client/index.html.br +0 -0
  566. package/dist/client/index.html.gz +0 -0
  567. package/dist/client/index.public.html +2 -2
  568. package/dist/client/index.public.html.br +0 -0
  569. package/dist/client/index.public.html.gz +0 -0
  570. package/dist/docs/status.md +4 -4
  571. package/dist/embed/react/headless.js +1 -1
  572. package/dist/embed/react/index.js +1 -1
  573. package/dist/server/tenant/tenantReadSource.js +18 -2
  574. package/dist/server/tenant/tenantStore.js +24 -7
  575. package/dist/server/tenant/tenantWriteSource.js +4 -6
  576. package/dist/ssr/render.js +1 -1
  577. package/package.json +4 -4
  578. package/dist/client/assets/AccountAdministration-DQYBsNEK.js +0 -2
  579. package/dist/client/assets/AccountAdministration-DQYBsNEK.js.br +0 -0
  580. package/dist/client/assets/AccountAdministration-DQYBsNEK.js.gz +0 -0
  581. package/dist/client/assets/AccountAdministration-DQYBsNEK.js.map +0 -1
  582. package/dist/client/assets/AccountControl-DMssHbjf.js +0 -3
  583. package/dist/client/assets/AccountControl-DMssHbjf.js.br +0 -0
  584. package/dist/client/assets/AccountControl-DMssHbjf.js.gz +0 -0
  585. package/dist/client/assets/AccountControl-DMssHbjf.js.map +0 -1
  586. package/dist/client/assets/AccountProfile-DSyGozq4.js +0 -2
  587. package/dist/client/assets/AccountProfile-DSyGozq4.js.br +0 -0
  588. package/dist/client/assets/AccountProfile-DSyGozq4.js.gz +0 -0
  589. package/dist/client/assets/AccountProfile-DSyGozq4.js.map +0 -1
  590. package/dist/client/assets/ApiOperations-DFrNeaiH.js +0 -2
  591. package/dist/client/assets/ApiOperations-DFrNeaiH.js.br +0 -0
  592. package/dist/client/assets/ApiOperations-DFrNeaiH.js.gz +0 -0
  593. package/dist/client/assets/ApiOperations-DFrNeaiH.js.map +0 -1
  594. package/dist/client/assets/AppColumnMenuPopups-B-rTJ2Bc.js +0 -2
  595. package/dist/client/assets/AppColumnMenuPopups-B-rTJ2Bc.js.br +0 -0
  596. package/dist/client/assets/AppColumnMenuPopups-B-rTJ2Bc.js.gz +0 -0
  597. package/dist/client/assets/AppColumnMenuPopups-B-rTJ2Bc.js.map +0 -1
  598. package/dist/client/assets/AsOfChip-B0nuxJ2t.js +0 -2
  599. package/dist/client/assets/AsOfChip-B0nuxJ2t.js.br +0 -0
  600. package/dist/client/assets/AsOfChip-B0nuxJ2t.js.gz +0 -0
  601. package/dist/client/assets/AsOfChip-B0nuxJ2t.js.map +0 -1
  602. package/dist/client/assets/AssistantPanel-CPb7MNin.js +0 -3
  603. package/dist/client/assets/AssistantPanel-CPb7MNin.js.br +0 -0
  604. package/dist/client/assets/AssistantPanel-CPb7MNin.js.gz +0 -0
  605. package/dist/client/assets/AssistantPanel-CPb7MNin.js.map +0 -1
  606. package/dist/client/assets/AttachmentList-BYvwjmkD.js +0 -3
  607. package/dist/client/assets/AttachmentList-BYvwjmkD.js.br +0 -0
  608. package/dist/client/assets/AttachmentList-BYvwjmkD.js.gz +0 -0
  609. package/dist/client/assets/AttachmentList-BYvwjmkD.js.map +0 -1
  610. package/dist/client/assets/BoardCardEditor-Cs26OrL9.js +0 -2
  611. package/dist/client/assets/BoardCardEditor-Cs26OrL9.js.br +0 -0
  612. package/dist/client/assets/BoardCardEditor-Cs26OrL9.js.gz +0 -0
  613. package/dist/client/assets/BoardCardEditor-Cs26OrL9.js.map +0 -1
  614. package/dist/client/assets/BoardList-C-lQ5BF-.js +0 -5
  615. package/dist/client/assets/BoardList-C-lQ5BF-.js.br +0 -0
  616. package/dist/client/assets/BoardList-C-lQ5BF-.js.gz +0 -0
  617. package/dist/client/assets/BoardList-C-lQ5BF-.js.map +0 -1
  618. package/dist/client/assets/BrandingForm-BAJiCMeC.js +0 -2
  619. package/dist/client/assets/BrandingForm-BAJiCMeC.js.br +0 -0
  620. package/dist/client/assets/BrandingForm-BAJiCMeC.js.gz +0 -0
  621. package/dist/client/assets/BrandingForm-BAJiCMeC.js.map +0 -1
  622. package/dist/client/assets/BreakdownRoom-h5GgdwTX.js +0 -2
  623. package/dist/client/assets/BreakdownRoom-h5GgdwTX.js.br +0 -0
  624. package/dist/client/assets/BreakdownRoom-h5GgdwTX.js.gz +0 -0
  625. package/dist/client/assets/BreakdownRoom-h5GgdwTX.js.map +0 -1
  626. package/dist/client/assets/CalendarList-DzYxxQtZ.js +0 -2
  627. package/dist/client/assets/CalendarList-DzYxxQtZ.js.br +0 -0
  628. package/dist/client/assets/CalendarList-DzYxxQtZ.js.gz +0 -0
  629. package/dist/client/assets/CalendarList-DzYxxQtZ.js.map +0 -1
  630. package/dist/client/assets/CardsList-C1w2EZBB.js +0 -2
  631. package/dist/client/assets/CardsList-C1w2EZBB.js.br +0 -0
  632. package/dist/client/assets/CardsList-C1w2EZBB.js.gz +0 -0
  633. package/dist/client/assets/CardsList-C1w2EZBB.js.map +0 -1
  634. package/dist/client/assets/Chart-D5NI5UBc.js +0 -2
  635. package/dist/client/assets/Chart-D5NI5UBc.js.br +0 -0
  636. package/dist/client/assets/Chart-D5NI5UBc.js.gz +0 -0
  637. package/dist/client/assets/Chart-D5NI5UBc.js.map +0 -1
  638. package/dist/client/assets/ChartFigure-CzEwHZY9.js +0 -3
  639. package/dist/client/assets/ChartFigure-CzEwHZY9.js.br +0 -0
  640. package/dist/client/assets/ChartFigure-CzEwHZY9.js.gz +0 -0
  641. package/dist/client/assets/ChartFigure-CzEwHZY9.js.map +0 -1
  642. package/dist/client/assets/ChartShapes-C_lwQ-IJ.js +0 -2
  643. package/dist/client/assets/ChartShapes-C_lwQ-IJ.js.br +0 -0
  644. package/dist/client/assets/ChartShapes-C_lwQ-IJ.js.gz +0 -0
  645. package/dist/client/assets/ChartShapes-C_lwQ-IJ.js.map +0 -1
  646. package/dist/client/assets/CheckedAppTargetAction-F66G8xCi.js +0 -2
  647. package/dist/client/assets/CheckedAppTargetAction-F66G8xCi.js.br +0 -0
  648. package/dist/client/assets/CheckedAppTargetAction-F66G8xCi.js.gz +0 -0
  649. package/dist/client/assets/CheckedAppTargetAction-F66G8xCi.js.map +0 -1
  650. package/dist/client/assets/Choices-D_ltQoA6.js +0 -2
  651. package/dist/client/assets/Choices-D_ltQoA6.js.br +0 -0
  652. package/dist/client/assets/Choices-D_ltQoA6.js.gz +0 -0
  653. package/dist/client/assets/Choices-D_ltQoA6.js.map +0 -1
  654. package/dist/client/assets/ClaimInvitation-D0HOoJB_.js +0 -2
  655. package/dist/client/assets/ClaimInvitation-D0HOoJB_.js.br +0 -0
  656. package/dist/client/assets/ClaimInvitation-D0HOoJB_.js.gz +0 -0
  657. package/dist/client/assets/ClaimInvitation-D0HOoJB_.js.map +0 -1
  658. package/dist/client/assets/CommandAnswers-DewG0nub.js +0 -2
  659. package/dist/client/assets/CommandAnswers-DewG0nub.js.br +0 -0
  660. package/dist/client/assets/CommandAnswers-DewG0nub.js.gz +0 -0
  661. package/dist/client/assets/CommandAnswers-DewG0nub.js.map +0 -1
  662. package/dist/client/assets/CommandForm-DDopegB7.js +0 -3
  663. package/dist/client/assets/CommandForm-DDopegB7.js.br +0 -0
  664. package/dist/client/assets/CommandForm-DDopegB7.js.gz +0 -0
  665. package/dist/client/assets/CommandForm-DDopegB7.js.map +0 -1
  666. package/dist/client/assets/CommandLines-WjJmO6mj.js +0 -2
  667. package/dist/client/assets/CommandLines-WjJmO6mj.js.br +0 -0
  668. package/dist/client/assets/CommandLines-WjJmO6mj.js.gz +0 -0
  669. package/dist/client/assets/CommandLines-WjJmO6mj.js.map +0 -1
  670. package/dist/client/assets/CommandLive-HCDtks_E.js +0 -2
  671. package/dist/client/assets/CommandLive-HCDtks_E.js.br +0 -0
  672. package/dist/client/assets/CommandLive-HCDtks_E.js.gz +0 -0
  673. package/dist/client/assets/CommandLive-HCDtks_E.js.map +0 -1
  674. package/dist/client/assets/CommandReference-z9DNMNI7.js +0 -3
  675. package/dist/client/assets/CommandReference-z9DNMNI7.js.br +0 -0
  676. package/dist/client/assets/CommandReference-z9DNMNI7.js.gz +0 -0
  677. package/dist/client/assets/CommandReference-z9DNMNI7.js.map +0 -1
  678. package/dist/client/assets/Composer-BZq7rP6h.js +0 -5
  679. package/dist/client/assets/Composer-BZq7rP6h.js.br +0 -0
  680. package/dist/client/assets/Composer-BZq7rP6h.js.gz +0 -0
  681. package/dist/client/assets/Composer-BZq7rP6h.js.map +0 -1
  682. package/dist/client/assets/CountedLabel-Bkhw171e.js +0 -2
  683. package/dist/client/assets/CountedLabel-Bkhw171e.js.br +0 -0
  684. package/dist/client/assets/CountedLabel-Bkhw171e.js.gz +0 -0
  685. package/dist/client/assets/CountedLabel-Bkhw171e.js.map +0 -1
  686. package/dist/client/assets/CustomList-eXqiBsfL.js +0 -2
  687. package/dist/client/assets/CustomList-eXqiBsfL.js.br +0 -0
  688. package/dist/client/assets/CustomList-eXqiBsfL.js.gz +0 -0
  689. package/dist/client/assets/CustomList-eXqiBsfL.js.map +0 -1
  690. package/dist/client/assets/CustomPage-Cf2UCree.js +0 -3
  691. package/dist/client/assets/CustomPage-Cf2UCree.js.br +0 -0
  692. package/dist/client/assets/CustomPage-Cf2UCree.js.gz +0 -0
  693. package/dist/client/assets/CustomPage-Cf2UCree.js.map +0 -1
  694. package/dist/client/assets/CustomSection-B3p69LEw.js +0 -2
  695. package/dist/client/assets/CustomSection-B3p69LEw.js.br +0 -0
  696. package/dist/client/assets/CustomSection-B3p69LEw.js.gz +0 -0
  697. package/dist/client/assets/CustomSection-B3p69LEw.js.map +0 -1
  698. package/dist/client/assets/Dashboard-D6oLLfIa.js +0 -3
  699. package/dist/client/assets/Dashboard-D6oLLfIa.js.br +0 -0
  700. package/dist/client/assets/Dashboard-D6oLLfIa.js.gz +0 -0
  701. package/dist/client/assets/Dashboard-D6oLLfIa.js.map +0 -1
  702. package/dist/client/assets/DashboardActivity-B8_MNq6v.js +0 -2
  703. package/dist/client/assets/DashboardActivity-B8_MNq6v.js.br +0 -0
  704. package/dist/client/assets/DashboardActivity-B8_MNq6v.js.gz +0 -0
  705. package/dist/client/assets/DashboardActivity-B8_MNq6v.js.map +0 -1
  706. package/dist/client/assets/DashboardFind-mIWh5Fkp.js +0 -2
  707. package/dist/client/assets/DashboardFind-mIWh5Fkp.js.br +0 -0
  708. package/dist/client/assets/DashboardFind-mIWh5Fkp.js.gz +0 -0
  709. package/dist/client/assets/DashboardFind-mIWh5Fkp.js.map +0 -1
  710. package/dist/client/assets/DashboardList-BpGbXMue.js +0 -2
  711. package/dist/client/assets/DashboardList-BpGbXMue.js.br +0 -0
  712. package/dist/client/assets/DashboardList-BpGbXMue.js.gz +0 -0
  713. package/dist/client/assets/DashboardList-BpGbXMue.js.map +0 -1
  714. package/dist/client/assets/DateTimeInput-7zFMo3La.js +0 -2
  715. package/dist/client/assets/DateTimeInput-7zFMo3La.js.br +0 -0
  716. package/dist/client/assets/DateTimeInput-7zFMo3La.js.gz +0 -0
  717. package/dist/client/assets/DateTimeInput-7zFMo3La.js.map +0 -1
  718. package/dist/client/assets/DecisionChip-SI0k8S9X.js +0 -2
  719. package/dist/client/assets/DecisionChip-SI0k8S9X.js.br +0 -0
  720. package/dist/client/assets/DecisionChip-SI0k8S9X.js.gz +0 -0
  721. package/dist/client/assets/DecisionChip-SI0k8S9X.js.map +0 -1
  722. package/dist/client/assets/DefinedFields-CFESpvWC.js +0 -2
  723. package/dist/client/assets/DefinedFields-CFESpvWC.js.br +0 -0
  724. package/dist/client/assets/DefinedFields-CFESpvWC.js.gz +0 -0
  725. package/dist/client/assets/DefinedFields-CFESpvWC.js.map +0 -1
  726. package/dist/client/assets/Diagram-z4DYLakX.js +0 -6
  727. package/dist/client/assets/Diagram-z4DYLakX.js.br +0 -0
  728. package/dist/client/assets/Diagram-z4DYLakX.js.gz +0 -0
  729. package/dist/client/assets/Diagram-z4DYLakX.js.map +0 -1
  730. package/dist/client/assets/Directory-BFLmBRFU.js +0 -2
  731. package/dist/client/assets/Directory-BFLmBRFU.js.br +0 -0
  732. package/dist/client/assets/Directory-BFLmBRFU.js.gz +0 -0
  733. package/dist/client/assets/Directory-BFLmBRFU.js.map +0 -1
  734. package/dist/client/assets/Document-CnDtqKmt.js +0 -2
  735. package/dist/client/assets/Document-CnDtqKmt.js.br +0 -0
  736. package/dist/client/assets/Document-CnDtqKmt.js.gz +0 -0
  737. package/dist/client/assets/Document-CnDtqKmt.js.map +0 -1
  738. package/dist/client/assets/Export-kr5d1z08.js +0 -2
  739. package/dist/client/assets/Export-kr5d1z08.js.br +0 -0
  740. package/dist/client/assets/Export-kr5d1z08.js.gz +0 -0
  741. package/dist/client/assets/Export-kr5d1z08.js.map +0 -1
  742. package/dist/client/assets/FilePreview-WR_cyL4x.js +0 -2
  743. package/dist/client/assets/FilePreview-WR_cyL4x.js.br +0 -0
  744. package/dist/client/assets/FilePreview-WR_cyL4x.js.gz +0 -0
  745. package/dist/client/assets/FilePreview-WR_cyL4x.js.map +0 -1
  746. package/dist/client/assets/FormClaimSurface-CoA2qciy.js +0 -2
  747. package/dist/client/assets/FormClaimSurface-CoA2qciy.js.br +0 -0
  748. package/dist/client/assets/FormClaimSurface-CoA2qciy.js.gz +0 -0
  749. package/dist/client/assets/FormClaimSurface-CoA2qciy.js.map +0 -1
  750. package/dist/client/assets/FormDialog-Br_gRw9C.js +0 -3
  751. package/dist/client/assets/FormDialog-Br_gRw9C.js.br +0 -0
  752. package/dist/client/assets/FormDialog-Br_gRw9C.js.gz +0 -0
  753. package/dist/client/assets/FormDialog-Br_gRw9C.js.map +0 -1
  754. package/dist/client/assets/FormLines-BLa5S_9c.js +0 -2
  755. package/dist/client/assets/FormLines-BLa5S_9c.js.br +0 -0
  756. package/dist/client/assets/FormLines-BLa5S_9c.js.gz +0 -0
  757. package/dist/client/assets/FormLines-BLa5S_9c.js.map +0 -1
  758. package/dist/client/assets/FormParts-CSw14gh3.js +0 -2
  759. package/dist/client/assets/FormParts-CSw14gh3.js.br +0 -0
  760. package/dist/client/assets/FormParts-CSw14gh3.js.gz +0 -0
  761. package/dist/client/assets/FormParts-CSw14gh3.js.map +0 -1
  762. package/dist/client/assets/FormStatusSurface-4oeqEU2L.js +0 -2
  763. package/dist/client/assets/FormStatusSurface-4oeqEU2L.js.br +0 -0
  764. package/dist/client/assets/FormStatusSurface-4oeqEU2L.js.gz +0 -0
  765. package/dist/client/assets/FormStatusSurface-4oeqEU2L.js.map +0 -1
  766. package/dist/client/assets/Gallery-DI_JVbvZ.js +0 -3
  767. package/dist/client/assets/Gallery-DI_JVbvZ.js.br +0 -0
  768. package/dist/client/assets/Gallery-DI_JVbvZ.js.gz +0 -0
  769. package/dist/client/assets/Gallery-DI_JVbvZ.js.map +0 -1
  770. package/dist/client/assets/GanttList-CYf9KqgI.js +0 -2
  771. package/dist/client/assets/GanttList-CYf9KqgI.js.br +0 -0
  772. package/dist/client/assets/GanttList-CYf9KqgI.js.gz +0 -0
  773. package/dist/client/assets/GanttList-CYf9KqgI.js.map +0 -1
  774. package/dist/client/assets/GridCellEditor-0Zdb-3q7.js +0 -2
  775. package/dist/client/assets/GridCellEditor-0Zdb-3q7.js.br +0 -0
  776. package/dist/client/assets/GridCellEditor-0Zdb-3q7.js.gz +0 -0
  777. package/dist/client/assets/GridCellEditor-0Zdb-3q7.js.map +0 -1
  778. package/dist/client/assets/HeldFiles-Ddp0STEh.js +0 -3
  779. package/dist/client/assets/HeldFiles-Ddp0STEh.js.br +0 -0
  780. package/dist/client/assets/HeldFiles-Ddp0STEh.js.gz +0 -0
  781. package/dist/client/assets/HeldFiles-Ddp0STEh.js.map +0 -1
  782. package/dist/client/assets/HelpPanel-YeWiL_LM.js +0 -2
  783. package/dist/client/assets/HelpPanel-YeWiL_LM.js.br +0 -0
  784. package/dist/client/assets/HelpPanel-YeWiL_LM.js.gz +0 -0
  785. package/dist/client/assets/HelpPanel-YeWiL_LM.js.map +0 -1
  786. package/dist/client/assets/ImportDialog-DKwlADLF.js +0 -9
  787. package/dist/client/assets/ImportDialog-DKwlADLF.js.br +0 -0
  788. package/dist/client/assets/ImportDialog-DKwlADLF.js.gz +0 -0
  789. package/dist/client/assets/ImportDialog-DKwlADLF.js.map +0 -1
  790. package/dist/client/assets/InboxList-DwG7hIcF.js +0 -2
  791. package/dist/client/assets/InboxList-DwG7hIcF.js.br +0 -0
  792. package/dist/client/assets/InboxList-DwG7hIcF.js.gz +0 -0
  793. package/dist/client/assets/InboxList-DwG7hIcF.js.map +0 -1
  794. package/dist/client/assets/IntakeControls-BdlBCXYe.js +0 -2
  795. package/dist/client/assets/IntakeControls-BdlBCXYe.js.br +0 -0
  796. package/dist/client/assets/IntakeControls-BdlBCXYe.js.gz +0 -0
  797. package/dist/client/assets/IntakeControls-BdlBCXYe.js.map +0 -1
  798. package/dist/client/assets/IntegrationsForm-BuhX6fIA.js +0 -2
  799. package/dist/client/assets/IntegrationsForm-BuhX6fIA.js.br +0 -0
  800. package/dist/client/assets/IntegrationsForm-BuhX6fIA.js.gz +0 -0
  801. package/dist/client/assets/IntegrationsForm-BuhX6fIA.js.map +0 -1
  802. package/dist/client/assets/JsonView-3kpHVB-6.js +0 -4
  803. package/dist/client/assets/JsonView-3kpHVB-6.js.br +0 -0
  804. package/dist/client/assets/JsonView-3kpHVB-6.js.gz +0 -0
  805. package/dist/client/assets/JsonView-3kpHVB-6.js.map +0 -1
  806. package/dist/client/assets/LayoutBuilder-BJiFK3uD.js +0 -2
  807. package/dist/client/assets/LayoutBuilder-BJiFK3uD.js.br +0 -0
  808. package/dist/client/assets/LayoutBuilder-BJiFK3uD.js.gz +0 -0
  809. package/dist/client/assets/LayoutBuilder-BJiFK3uD.js.map +0 -1
  810. package/dist/client/assets/Lightbox-DkU-Tlm6.js +0 -2
  811. package/dist/client/assets/Lightbox-DkU-Tlm6.js.br +0 -0
  812. package/dist/client/assets/Lightbox-DkU-Tlm6.js.gz +0 -0
  813. package/dist/client/assets/Lightbox-DkU-Tlm6.js.map +0 -1
  814. package/dist/client/assets/LiveNotices-CQiWoXHc.js +0 -2
  815. package/dist/client/assets/LiveNotices-CQiWoXHc.js.br +0 -0
  816. package/dist/client/assets/LiveNotices-CQiWoXHc.js.gz +0 -0
  817. package/dist/client/assets/LiveNotices-CQiWoXHc.js.map +0 -1
  818. package/dist/client/assets/MinorMoneyInput-cmVROgnp.js +0 -2
  819. package/dist/client/assets/MinorMoneyInput-cmVROgnp.js.br +0 -0
  820. package/dist/client/assets/MinorMoneyInput-cmVROgnp.js.gz +0 -0
  821. package/dist/client/assets/MinorMoneyInput-cmVROgnp.js.map +0 -1
  822. package/dist/client/assets/MultiStepForm-CRJo8q2V.js +0 -3
  823. package/dist/client/assets/MultiStepForm-CRJo8q2V.js.br +0 -0
  824. package/dist/client/assets/MultiStepForm-CRJo8q2V.js.gz +0 -0
  825. package/dist/client/assets/MultiStepForm-CRJo8q2V.js.map +0 -1
  826. package/dist/client/assets/NewMenu-Xy45Ndff.js +0 -2
  827. package/dist/client/assets/NewMenu-Xy45Ndff.js.br +0 -0
  828. package/dist/client/assets/NewMenu-Xy45Ndff.js.gz +0 -0
  829. package/dist/client/assets/NewMenu-Xy45Ndff.js.map +0 -1
  830. package/dist/client/assets/NewRecord-CtwCX_Us.js +0 -3
  831. package/dist/client/assets/NewRecord-CtwCX_Us.js.br +0 -0
  832. package/dist/client/assets/NewRecord-CtwCX_Us.js.gz +0 -0
  833. package/dist/client/assets/NewRecord-CtwCX_Us.js.map +0 -1
  834. package/dist/client/assets/PageFlowDiagram-Cb4cbCdY.js +0 -3
  835. package/dist/client/assets/PageFlowDiagram-Cb4cbCdY.js.br +0 -0
  836. package/dist/client/assets/PageFlowDiagram-Cb4cbCdY.js.gz +0 -0
  837. package/dist/client/assets/PageFlowDiagram-Cb4cbCdY.js.map +0 -1
  838. package/dist/client/assets/PageFlows-ActQTIr2.js +0 -2
  839. package/dist/client/assets/PageFlows-ActQTIr2.js.br +0 -0
  840. package/dist/client/assets/PageFlows-ActQTIr2.js.gz +0 -0
  841. package/dist/client/assets/PageFlows-ActQTIr2.js.map +0 -1
  842. package/dist/client/assets/PageGroups-B7OX0vQf.js +0 -2
  843. package/dist/client/assets/PageGroups-B7OX0vQf.js.br +0 -0
  844. package/dist/client/assets/PageGroups-B7OX0vQf.js.gz +0 -0
  845. package/dist/client/assets/PageGroups-B7OX0vQf.js.map +0 -1
  846. package/dist/client/assets/PageHistory--ZD3HI40.js +0 -2
  847. package/dist/client/assets/PageHistory--ZD3HI40.js.br +0 -0
  848. package/dist/client/assets/PageHistory--ZD3HI40.js.gz +0 -0
  849. package/dist/client/assets/PageHistory--ZD3HI40.js.map +0 -1
  850. package/dist/client/assets/PageSkeleton-DbJ4f46e.js +0 -2
  851. package/dist/client/assets/PageSkeleton-DbJ4f46e.js.br +0 -4
  852. package/dist/client/assets/PageSkeleton-DbJ4f46e.js.gz +0 -0
  853. package/dist/client/assets/PageSkeleton-DbJ4f46e.js.map +0 -1
  854. package/dist/client/assets/Palette-BAP4izWy.js +0 -3
  855. package/dist/client/assets/Palette-BAP4izWy.js.br +0 -0
  856. package/dist/client/assets/Palette-BAP4izWy.js.gz +0 -0
  857. package/dist/client/assets/Palette-BAP4izWy.js.map +0 -1
  858. package/dist/client/assets/PeekPanel-CptRpDPL.js +0 -2
  859. package/dist/client/assets/PeekPanel-CptRpDPL.js.br +0 -0
  860. package/dist/client/assets/PeekPanel-CptRpDPL.js.gz +0 -0
  861. package/dist/client/assets/PeekPanel-CptRpDPL.js.map +0 -1
  862. package/dist/client/assets/PlacedFormSurface-DNPtQGXy.js +0 -2
  863. package/dist/client/assets/PlacedFormSurface-DNPtQGXy.js.br +0 -0
  864. package/dist/client/assets/PlacedFormSurface-DNPtQGXy.js.gz +0 -0
  865. package/dist/client/assets/PlacedFormSurface-DNPtQGXy.js.map +0 -1
  866. package/dist/client/assets/Prefs-Cm9bMZ7p.js +0 -2
  867. package/dist/client/assets/Prefs-Cm9bMZ7p.js.br +0 -0
  868. package/dist/client/assets/Prefs-Cm9bMZ7p.js.gz +0 -0
  869. package/dist/client/assets/Prefs-Cm9bMZ7p.js.map +0 -1
  870. package/dist/client/assets/PresentedList-DhL7j-dU.js +0 -2
  871. package/dist/client/assets/PresentedList-DhL7j-dU.js.br +0 -0
  872. package/dist/client/assets/PresentedList-DhL7j-dU.js.gz +0 -0
  873. package/dist/client/assets/PresentedList-DhL7j-dU.js.map +0 -1
  874. package/dist/client/assets/PublicGuard-DKIHFfg8.js +0 -2
  875. package/dist/client/assets/PublicGuard-DKIHFfg8.js.br +0 -0
  876. package/dist/client/assets/PublicGuard-DKIHFfg8.js.gz +0 -0
  877. package/dist/client/assets/PublicGuard-DKIHFfg8.js.map +0 -1
  878. package/dist/client/assets/QrCode-qHy1Ejfv.js +0 -4
  879. package/dist/client/assets/QrCode-qHy1Ejfv.js.br +0 -0
  880. package/dist/client/assets/QrCode-qHy1Ejfv.js.gz +0 -0
  881. package/dist/client/assets/QrCode-qHy1Ejfv.js.map +0 -1
  882. package/dist/client/assets/QuickAdd-DYOu_Ghs.js +0 -2
  883. package/dist/client/assets/QuickAdd-DYOu_Ghs.js.br +0 -0
  884. package/dist/client/assets/QuickAdd-DYOu_Ghs.js.gz +0 -0
  885. package/dist/client/assets/QuickAdd-DYOu_Ghs.js.map +0 -1
  886. package/dist/client/assets/Record-CUrP8J6I.js +0 -2
  887. package/dist/client/assets/Record-CUrP8J6I.js.br +0 -0
  888. package/dist/client/assets/Record-CUrP8J6I.js.gz +0 -0
  889. package/dist/client/assets/Record-CUrP8J6I.js.map +0 -1
  890. package/dist/client/assets/RecordModal-Dk116VnI.js +0 -2
  891. package/dist/client/assets/RecordModal-Dk116VnI.js.br +0 -0
  892. package/dist/client/assets/RecordModal-Dk116VnI.js.gz +0 -0
  893. package/dist/client/assets/RecordModal-Dk116VnI.js.map +0 -1
  894. package/dist/client/assets/RichTextEditor-BQiIJE1m.js +0 -144
  895. package/dist/client/assets/RichTextEditor-BQiIJE1m.js.br +0 -0
  896. package/dist/client/assets/RichTextEditor-BQiIJE1m.js.gz +0 -0
  897. package/dist/client/assets/RichTextEditor-BQiIJE1m.js.map +0 -1
  898. package/dist/client/assets/SavedFormSurface-BQS-S75B.js +0 -2
  899. package/dist/client/assets/SavedFormSurface-BQS-S75B.js.br +0 -0
  900. package/dist/client/assets/SavedFormSurface-BQS-S75B.js.gz +0 -0
  901. package/dist/client/assets/SavedFormSurface-BQS-S75B.js.map +0 -1
  902. package/dist/client/assets/SectionPeriod-C766q1er.js +0 -2
  903. package/dist/client/assets/SectionPeriod-C766q1er.js.br +0 -0
  904. package/dist/client/assets/SectionPeriod-C766q1er.js.gz +0 -0
  905. package/dist/client/assets/SectionPeriod-C766q1er.js.map +0 -1
  906. package/dist/client/assets/SetFieldDialog-B_SJQVoj.js +0 -2
  907. package/dist/client/assets/SetFieldDialog-B_SJQVoj.js.br +0 -0
  908. package/dist/client/assets/SetFieldDialog-B_SJQVoj.js.gz +0 -0
  909. package/dist/client/assets/SetFieldDialog-B_SJQVoj.js.map +0 -1
  910. package/dist/client/assets/SignedInFormDialog-BZoEdk66.js +0 -2
  911. package/dist/client/assets/SignedInFormDialog-BZoEdk66.js.br +0 -4
  912. package/dist/client/assets/SignedInFormDialog-BZoEdk66.js.gz +0 -0
  913. package/dist/client/assets/SignedInFormDialog-BZoEdk66.js.map +0 -1
  914. package/dist/client/assets/SuggestBox-CeG1AvAE.js +0 -2
  915. package/dist/client/assets/SuggestBox-CeG1AvAE.js.br +0 -0
  916. package/dist/client/assets/SuggestBox-CeG1AvAE.js.gz +0 -0
  917. package/dist/client/assets/SuggestBox-CeG1AvAE.js.map +0 -1
  918. package/dist/client/assets/SuiteAppPreference-2taQpqdr.js +0 -2
  919. package/dist/client/assets/SuiteAppPreference-2taQpqdr.js.br +0 -0
  920. package/dist/client/assets/SuiteAppPreference-2taQpqdr.js.gz +0 -0
  921. package/dist/client/assets/SuiteAppPreference-2taQpqdr.js.map +0 -1
  922. package/dist/client/assets/SuiteAppSwitcher-CPoa4O9Q.js +0 -2
  923. package/dist/client/assets/SuiteAppSwitcher-CPoa4O9Q.js.br +0 -0
  924. package/dist/client/assets/SuiteAppSwitcher-CPoa4O9Q.js.gz +0 -0
  925. package/dist/client/assets/SuiteAppSwitcher-CPoa4O9Q.js.map +0 -1
  926. package/dist/client/assets/SupportLog-E7vZs1il.js +0 -2
  927. package/dist/client/assets/SupportLog-E7vZs1il.js.br +0 -0
  928. package/dist/client/assets/SupportLog-E7vZs1il.js.gz +0 -0
  929. package/dist/client/assets/SupportLog-E7vZs1il.js.map +0 -1
  930. package/dist/client/assets/SupportSessions-DWvX1D7N.js +0 -2
  931. package/dist/client/assets/SupportSessions-DWvX1D7N.js.br +0 -0
  932. package/dist/client/assets/SupportSessions-DWvX1D7N.js.gz +0 -0
  933. package/dist/client/assets/SupportSessions-DWvX1D7N.js.map +0 -1
  934. package/dist/client/assets/TenantAdministration-hACWZhYV.js +0 -4
  935. package/dist/client/assets/TenantAdministration-hACWZhYV.js.br +0 -0
  936. package/dist/client/assets/TenantAdministration-hACWZhYV.js.gz +0 -0
  937. package/dist/client/assets/TenantAdministration-hACWZhYV.js.map +0 -1
  938. package/dist/client/assets/TenantApiTokens-DSgY32Gk.js +0 -2
  939. package/dist/client/assets/TenantApiTokens-DSgY32Gk.js.br +0 -0
  940. package/dist/client/assets/TenantApiTokens-DSgY32Gk.js.gz +0 -0
  941. package/dist/client/assets/TenantApiTokens-DSgY32Gk.js.map +0 -1
  942. package/dist/client/assets/TenantInvitations-DBHp2ILL.js +0 -2
  943. package/dist/client/assets/TenantInvitations-DBHp2ILL.js.br +0 -0
  944. package/dist/client/assets/TenantInvitations-DBHp2ILL.js.gz +0 -0
  945. package/dist/client/assets/TenantInvitations-DBHp2ILL.js.map +0 -1
  946. package/dist/client/assets/ThemeLab-CJj-UgDy.js +0 -4
  947. package/dist/client/assets/ThemeLab-CJj-UgDy.js.br +0 -0
  948. package/dist/client/assets/ThemeLab-CJj-UgDy.js.gz +0 -0
  949. package/dist/client/assets/ThemeLab-CJj-UgDy.js.map +0 -1
  950. package/dist/client/assets/TimelineComposer-LO6tvAA5.js +0 -2
  951. package/dist/client/assets/TimelineComposer-LO6tvAA5.js.br +0 -0
  952. package/dist/client/assets/TimelineComposer-LO6tvAA5.js.gz +0 -0
  953. package/dist/client/assets/TimelineComposer-LO6tvAA5.js.map +0 -1
  954. package/dist/client/assets/TimelineReactions-DQmlxpN5.js +0 -2
  955. package/dist/client/assets/TimelineReactions-DQmlxpN5.js.br +0 -0
  956. package/dist/client/assets/TimelineReactions-DQmlxpN5.js.gz +0 -0
  957. package/dist/client/assets/TimelineReactions-DQmlxpN5.js.map +0 -1
  958. package/dist/client/assets/TopNav-ByNGt2HL.js +0 -3
  959. package/dist/client/assets/TopNav-ByNGt2HL.js.br +0 -0
  960. package/dist/client/assets/TopNav-ByNGt2HL.js.gz +0 -0
  961. package/dist/client/assets/TopNav-ByNGt2HL.js.map +0 -1
  962. package/dist/client/assets/Tour-BXsRjmcu.js +0 -2
  963. package/dist/client/assets/Tour-BXsRjmcu.js.br +0 -0
  964. package/dist/client/assets/Tour-BXsRjmcu.js.gz +0 -0
  965. package/dist/client/assets/Tour-BXsRjmcu.js.map +0 -1
  966. package/dist/client/assets/TreeList-DMQExu7J.js +0 -2
  967. package/dist/client/assets/TreeList-DMQExu7J.js.br +0 -0
  968. package/dist/client/assets/TreeList-DMQExu7J.js.gz +0 -0
  969. package/dist/client/assets/TreeList-DMQExu7J.js.map +0 -1
  970. package/dist/client/assets/TreePicker-SVTq4DWB.js +0 -2
  971. package/dist/client/assets/TreePicker-SVTq4DWB.js.br +0 -0
  972. package/dist/client/assets/TreePicker-SVTq4DWB.js.gz +0 -0
  973. package/dist/client/assets/TreePicker-SVTq4DWB.js.map +0 -1
  974. package/dist/client/assets/ViewFormDialog-CFOt9WOJ.js +0 -3
  975. package/dist/client/assets/ViewFormDialog-CFOt9WOJ.js.br +0 -0
  976. package/dist/client/assets/ViewFormDialog-CFOt9WOJ.js.gz +0 -0
  977. package/dist/client/assets/ViewFormDialog-CFOt9WOJ.js.map +0 -1
  978. package/dist/client/assets/appImport-IKZLMDe8.js +0 -4
  979. package/dist/client/assets/appImport-IKZLMDe8.js.br +0 -0
  980. package/dist/client/assets/appImport-IKZLMDe8.js.gz +0 -0
  981. package/dist/client/assets/appImport-IKZLMDe8.js.map +0 -1
  982. package/dist/client/assets/appLive-DJHYuIU8.js +0 -3
  983. package/dist/client/assets/appLive-DJHYuIU8.js.br +0 -0
  984. package/dist/client/assets/appLive-DJHYuIU8.js.gz +0 -0
  985. package/dist/client/assets/appLive-DJHYuIU8.js.map +0 -1
  986. package/dist/client/assets/assistantStream-PIix1prW.js +0 -7
  987. package/dist/client/assets/assistantStream-PIix1prW.js.br +0 -0
  988. package/dist/client/assets/assistantStream-PIix1prW.js.gz +0 -0
  989. package/dist/client/assets/assistantStream-PIix1prW.js.map +0 -1
  990. package/dist/client/assets/beacon-BZUg3lwf.js +0 -2
  991. package/dist/client/assets/beacon-BZUg3lwf.js.br +0 -0
  992. package/dist/client/assets/beacon-BZUg3lwf.js.gz +0 -0
  993. package/dist/client/assets/beacon-BZUg3lwf.js.map +0 -1
  994. package/dist/client/assets/blocks-CCFZikE-.js +0 -3
  995. package/dist/client/assets/blocks-CCFZikE-.js.br +0 -0
  996. package/dist/client/assets/blocks-CCFZikE-.js.gz +0 -0
  997. package/dist/client/assets/blocks-CCFZikE-.js.map +0 -1
  998. package/dist/client/assets/builtInInputs-CH_xYO6j.js +0 -3
  999. package/dist/client/assets/builtInInputs-CH_xYO6j.js.br +0 -0
  1000. package/dist/client/assets/builtInInputs-CH_xYO6j.js.gz +0 -0
  1001. package/dist/client/assets/builtInInputs-CH_xYO6j.js.map +0 -1
  1002. package/dist/client/assets/commandDraft-BDvPhSza.js +0 -2
  1003. package/dist/client/assets/commandDraft-BDvPhSza.js.br +0 -0
  1004. package/dist/client/assets/commandDraft-BDvPhSza.js.gz +0 -0
  1005. package/dist/client/assets/commandDraft-BDvPhSza.js.map +0 -1
  1006. package/dist/client/assets/componentLoader-BSp8wEAY.js +0 -3
  1007. package/dist/client/assets/componentLoader-BSp8wEAY.js.br +0 -0
  1008. package/dist/client/assets/componentLoader-BSp8wEAY.js.gz +0 -0
  1009. package/dist/client/assets/componentLoader-BSp8wEAY.js.map +0 -1
  1010. package/dist/client/assets/composer-BEJkvr0M.js +0 -2
  1011. package/dist/client/assets/composer-BEJkvr0M.js.br +0 -0
  1012. package/dist/client/assets/composer-BEJkvr0M.js.gz +0 -0
  1013. package/dist/client/assets/composer-BEJkvr0M.js.map +0 -1
  1014. package/dist/client/assets/computedParse-lgc6fG-v.js +0 -2
  1015. package/dist/client/assets/computedParse-lgc6fG-v.js.br +0 -0
  1016. package/dist/client/assets/computedParse-lgc6fG-v.js.gz +0 -0
  1017. package/dist/client/assets/computedParse-lgc6fG-v.js.map +0 -1
  1018. package/dist/client/assets/computedValue-BDfmNGZT.js +0 -2
  1019. package/dist/client/assets/computedValue-BDfmNGZT.js.br +0 -0
  1020. package/dist/client/assets/computedValue-BDfmNGZT.js.gz +0 -0
  1021. package/dist/client/assets/computedValue-BDfmNGZT.js.map +0 -1
  1022. package/dist/client/assets/conditionWords-CaRbP9G5.js +0 -2
  1023. package/dist/client/assets/conditionWords-CaRbP9G5.js.br +0 -0
  1024. package/dist/client/assets/conditionWords-CaRbP9G5.js.gz +0 -0
  1025. package/dist/client/assets/conditionWords-CaRbP9G5.js.map +0 -1
  1026. package/dist/client/assets/definedValues-Cb_0VeJ9.js +0 -2
  1027. package/dist/client/assets/definedValues-Cb_0VeJ9.js.br +0 -0
  1028. package/dist/client/assets/definedValues-Cb_0VeJ9.js.gz +0 -0
  1029. package/dist/client/assets/definedValues-Cb_0VeJ9.js.map +0 -1
  1030. package/dist/client/assets/experimentExposure-BOtTPeR9.js +0 -3
  1031. package/dist/client/assets/experimentExposure-BOtTPeR9.js.br +0 -0
  1032. package/dist/client/assets/experimentExposure-BOtTPeR9.js.gz +0 -0
  1033. package/dist/client/assets/experimentExposure-BOtTPeR9.js.map +0 -1
  1034. package/dist/client/assets/export-BkQcAhVr.js +0 -4
  1035. package/dist/client/assets/export-BkQcAhVr.js.br +0 -0
  1036. package/dist/client/assets/export-BkQcAhVr.js.gz +0 -0
  1037. package/dist/client/assets/export-BkQcAhVr.js.map +0 -1
  1038. package/dist/client/assets/formCommandRun-CPMaCLsm.js +0 -2
  1039. package/dist/client/assets/formCommandRun-CPMaCLsm.js.br +0 -0
  1040. package/dist/client/assets/formCommandRun-CPMaCLsm.js.gz +0 -0
  1041. package/dist/client/assets/formCommandRun-CPMaCLsm.js.map +0 -1
  1042. package/dist/client/assets/formStepCheck-CPvULv3d.js +0 -2
  1043. package/dist/client/assets/formStepCheck-CPvULv3d.js.br +0 -0
  1044. package/dist/client/assets/formStepCheck-CPvULv3d.js.gz +0 -0
  1045. package/dist/client/assets/formStepCheck-CPvULv3d.js.map +0 -1
  1046. package/dist/client/assets/funnel-DlQ9M3y2.js +0 -2
  1047. package/dist/client/assets/funnel-DlQ9M3y2.js.br +0 -0
  1048. package/dist/client/assets/funnel-DlQ9M3y2.js.gz +0 -0
  1049. package/dist/client/assets/funnel-DlQ9M3y2.js.map +0 -1
  1050. package/dist/client/assets/handoff-CugDDjyd.js +0 -3
  1051. package/dist/client/assets/handoff-CugDDjyd.js.br +0 -0
  1052. package/dist/client/assets/handoff-CugDDjyd.js.gz +0 -0
  1053. package/dist/client/assets/handoff-CugDDjyd.js.map +0 -1
  1054. package/dist/client/assets/headlessLanding-ClkGzcVt.js +0 -2
  1055. package/dist/client/assets/headlessLanding-ClkGzcVt.js.br +0 -0
  1056. package/dist/client/assets/headlessLanding-ClkGzcVt.js.gz +0 -0
  1057. package/dist/client/assets/headlessLanding-ClkGzcVt.js.map +0 -1
  1058. package/dist/client/assets/index-C42fyowY.js +0 -16
  1059. package/dist/client/assets/index-C42fyowY.js.br +0 -0
  1060. package/dist/client/assets/index-C42fyowY.js.gz +0 -0
  1061. package/dist/client/assets/index-C42fyowY.js.map +0 -1
  1062. package/dist/client/assets/liveSync-CLc2TyPv.js +0 -3
  1063. package/dist/client/assets/liveSync-CLc2TyPv.js.br +0 -0
  1064. package/dist/client/assets/liveSync-CLc2TyPv.js.gz +0 -0
  1065. package/dist/client/assets/liveSync-CLc2TyPv.js.map +0 -1
  1066. package/dist/client/assets/mentionRows-B4Zfo_1m.js +0 -2
  1067. package/dist/client/assets/mentionRows-B4Zfo_1m.js.br +0 -0
  1068. package/dist/client/assets/mentionRows-B4Zfo_1m.js.gz +0 -0
  1069. package/dist/client/assets/mentionRows-B4Zfo_1m.js.map +0 -1
  1070. package/dist/client/assets/newMenuModel-B6aB1Uqh.js +0 -2
  1071. package/dist/client/assets/newMenuModel-B6aB1Uqh.js.br +0 -0
  1072. package/dist/client/assets/newMenuModel-B6aB1Uqh.js.gz +0 -0
  1073. package/dist/client/assets/newMenuModel-B6aB1Uqh.js.map +0 -1
  1074. package/dist/client/assets/newRecordModel-BETkJR0e.js +0 -2
  1075. package/dist/client/assets/newRecordModel-BETkJR0e.js.br +0 -0
  1076. package/dist/client/assets/newRecordModel-BETkJR0e.js.gz +0 -0
  1077. package/dist/client/assets/newRecordModel-BETkJR0e.js.map +0 -1
  1078. package/dist/client/assets/oauthConsent-C6ffqFTR.js +0 -2
  1079. package/dist/client/assets/oauthConsent-C6ffqFTR.js.br +0 -0
  1080. package/dist/client/assets/oauthConsent-C6ffqFTR.js.gz +0 -0
  1081. package/dist/client/assets/oauthConsent-C6ffqFTR.js.map +0 -1
  1082. package/dist/client/assets/pageControls-B_PPm47V.js +0 -2
  1083. package/dist/client/assets/pageControls-B_PPm47V.js.br +0 -0
  1084. package/dist/client/assets/pageControls-B_PPm47V.js.gz +0 -0
  1085. package/dist/client/assets/pageControls-B_PPm47V.js.map +0 -1
  1086. package/dist/client/assets/paramControls-CNGbkkwd.js +0 -2
  1087. package/dist/client/assets/paramControls-CNGbkkwd.js.br +0 -0
  1088. package/dist/client/assets/paramControls-CNGbkkwd.js.gz +0 -0
  1089. package/dist/client/assets/paramControls-CNGbkkwd.js.map +0 -1
  1090. package/dist/client/assets/public-DPBH749j.js +0 -3
  1091. package/dist/client/assets/public-DPBH749j.js.br +0 -0
  1092. package/dist/client/assets/public-DPBH749j.js.gz +0 -0
  1093. package/dist/client/assets/public-DPBH749j.js.map +0 -1
  1094. package/dist/client/assets/publicInputs-xX0E1xHP.js +0 -3
  1095. package/dist/client/assets/publicInputs-xX0E1xHP.js.br +0 -0
  1096. package/dist/client/assets/publicInputs-xX0E1xHP.js.gz +0 -0
  1097. package/dist/client/assets/publicInputs-xX0E1xHP.js.map +0 -1
  1098. package/dist/client/assets/publicPageCommand-DaWvyZV2.js +0 -2
  1099. package/dist/client/assets/publicPageCommand-DaWvyZV2.js.br +0 -0
  1100. package/dist/client/assets/publicPageCommand-DaWvyZV2.js.gz +0 -0
  1101. package/dist/client/assets/publicPageCommand-DaWvyZV2.js.map +0 -1
  1102. package/dist/client/assets/publicPlacement-jiPqfzvs.js +0 -2
  1103. package/dist/client/assets/publicPlacement-jiPqfzvs.js.br +0 -0
  1104. package/dist/client/assets/publicPlacement-jiPqfzvs.js.gz +0 -0
  1105. package/dist/client/assets/publicPlacement-jiPqfzvs.js.map +0 -1
  1106. package/dist/client/assets/recordSearch-_Z6WiCS_.js +0 -2
  1107. package/dist/client/assets/recordSearch-_Z6WiCS_.js.br +0 -0
  1108. package/dist/client/assets/recordSearch-_Z6WiCS_.js.gz +0 -0
  1109. package/dist/client/assets/recordSearch-_Z6WiCS_.js.map +0 -1
  1110. package/dist/client/assets/savedFormApi-kZVNRpjg.js +0 -2
  1111. package/dist/client/assets/savedFormApi-kZVNRpjg.js.br +0 -0
  1112. package/dist/client/assets/savedFormApi-kZVNRpjg.js.gz +0 -0
  1113. package/dist/client/assets/savedFormApi-kZVNRpjg.js.map +0 -1
  1114. package/dist/client/assets/shell-091j_0M8.js +0 -13
  1115. package/dist/client/assets/shell-091j_0M8.js.br +0 -0
  1116. package/dist/client/assets/shell-091j_0M8.js.gz +0 -0
  1117. package/dist/client/assets/shell-091j_0M8.js.map +0 -1
  1118. package/dist/client/assets/steps-C1zq7_Wz.js +0 -2
  1119. package/dist/client/assets/steps-C1zq7_Wz.js.br +0 -0
  1120. package/dist/client/assets/steps-C1zq7_Wz.js.gz +0 -0
  1121. package/dist/client/assets/steps-C1zq7_Wz.js.map +0 -1
  1122. package/dist/client/assets/tenant-BZTQOqUF.js +0 -3
  1123. package/dist/client/assets/tenant-BZTQOqUF.js.br +0 -0
  1124. package/dist/client/assets/tenant-BZTQOqUF.js.gz +0 -0
  1125. package/dist/client/assets/tenant-BZTQOqUF.js.map +0 -1
  1126. package/dist/client/assets/tenantInvitations-Bqy9Yqgq.js +0 -2
  1127. package/dist/client/assets/tenantInvitations-Bqy9Yqgq.js.br +0 -0
  1128. package/dist/client/assets/tenantInvitations-Bqy9Yqgq.js.gz +0 -0
  1129. package/dist/client/assets/tenantInvitations-Bqy9Yqgq.js.map +0 -1
  1130. package/dist/client/assets/tenantLive-BIpf1ph1.js +0 -2
  1131. package/dist/client/assets/tenantLive-BIpf1ph1.js.br +0 -0
  1132. package/dist/client/assets/tenantLive-BIpf1ph1.js.gz +0 -0
  1133. package/dist/client/assets/tenantLive-BIpf1ph1.js.map +0 -1
  1134. package/dist/client/assets/themeBench-C2u8gJO2.js +0 -2
  1135. package/dist/client/assets/themeBench-C2u8gJO2.js.br +0 -0
  1136. package/dist/client/assets/themeBench-C2u8gJO2.js.gz +0 -0
  1137. package/dist/client/assets/themeBench-C2u8gJO2.js.map +0 -1
@@ -205,7 +205,7 @@ img.ProseMirror-separator {
205
205
  `).length,u=e.split(`
206
206
  `).slice(0,l).join(`
207
207
  `);return{...c,raw:u}}},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=hte(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(Yu.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>HO(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>UO(e,t),deleteColumn:()=>({state:e,dispatch:t})=>{let n=G_(e.selection.$from,e=>e.type.name===`table`);return GO(e,t&&(e=>{n&&cA(e,n.pos),t(e)}))},addRowBefore:()=>({state:e,dispatch:t})=>ate(e,t),addRowAfter:()=>({state:e,dispatch:t})=>ote(e,t),deleteRow:()=>({state:e,dispatch:t})=>{let n=G_(e.selection.$from,e=>e.type.name===`table`);return cte(e,t&&(e=>{n&&cA(e,n.pos),t(e)}))},deleteTable:()=>({state:e,dispatch:t})=>tk(e,t),mergeCells:()=>({state:e,dispatch:t})=>YO(e,t),splitCell:()=>({state:e,dispatch:t})=>XO(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>QO(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>QO(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>Hk(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>YO(e,t)?!0:XO(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>dte(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>ek(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>ek(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&RO(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=zk.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:hA,"Mod-Backspace":hA,Delete:hA,"Mod-Delete":hA}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[xk({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Pk({allowTableNodeSelection:this.options.allowTableNodeSelection}),Cte()]},addNodeView(){let e=this.options.resizable&&this.editor.isEditable,t=this.options.View;return e||!t?null:({node:e,view:n,HTMLAttributes:r})=>{let i=rv(this.options.HTMLAttributes,r);return new t(e,this.options.cellMinWidth,n,i)}},extendNodeSchema(e){return{tableRole:Z_(q_(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}}),_x.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(_A.configure(this.options.table)),this.options.tableCell!==!1&&e.push(dA.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(fA.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(pA.configure(this.options.tableRow)),e}})}));function yA(e,t,n){return LA(e,IA(t,n))}function bA(e,t){return typeof e==`function`?e(t):e}function xA(e){return e.split(`-`)[0]}function SA(e){return e.split(`-`)[1]}function CA(e){return e===`x`?`y`:`x`}function wA(e){return e===`y`?`height`:`width`}function TA(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function EA(e){return CA(TA(e))}function DA(e,t,n){n===void 0&&(n=!1);let r=SA(e),i=EA(e),a=wA(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=MA(o)),[o,MA(o)]}function OA(e){let t=MA(e);return[kA(e),t,kA(t)]}function kA(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}function AA(e,t,n){switch(e){case`top`:case`bottom`:return n?t?UA:HA:t?HA:UA;case`left`:case`right`:return t?WA:GA;default:return[]}}function jA(e,t,n,r){let i=SA(e),a=AA(xA(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(kA)))),a}function MA(e){let t=xA(e);return VA[t]+e.slice(t.length)}function NA(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function PA(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:NA(e)}function FA(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var IA,LA,RA,zA,BA,VA,HA,UA,WA,GA,KA=s((()=>{IA=Math.min,LA=Math.max,RA=Math.round,zA=Math.floor,BA=e=>({x:e,y:e}),VA={left:`right`,right:`left`,bottom:`top`,top:`bottom`},HA=[`left`,`right`],UA=[`right`,`left`],WA=[`top`,`bottom`],GA=[`bottom`,`top`]}));function qA(e,t,n){let{reference:r,floating:i}=e,a=TA(t),o=EA(t),s=wA(o),c=xA(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=SA(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function JA(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=bA(t,e),p=PA(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=FA(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=FA(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}async function YA(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=xA(n),s=SA(n),c=TA(n)===`y`,l=$A.has(o)?-1:1,u=a&&c?-1:1,d=bA(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var XA,ZA,QA,$A,ej,tj,nj,rj,ij=s((()=>{KA(),XA=50,ZA=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:JA},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=qA(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<XA&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=qA(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},QA=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=bA(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=xA(r),_=TA(o),v=xA(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[MA(o)]:OA(o)),x=p!==`none`;!d&&x&&b.push(...jA(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=DA(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===TA(t)||T.every(e=>TA(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=TA(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},$A=new Set([`left`,`top`]),ej=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await YA(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},tj=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=bA(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=TA(i),p=CA(f),m=u[p],h=u[f],g=(e,t)=>yA(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},nj=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=bA(e,t),u={x:n,y:r},d=TA(i),f=CA(d),p=u[f],m=u[d],h=bA(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=$A.has(xA(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},rj=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=bA(e,t),c=await i.detectOverflow(t,s),l=xA(n),u=SA(n),d=TA(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=IA(p-c[m],g),y=IA(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*LA(c.left,c.right):S=p-2*LA(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}}}));function aj(){return typeof window<`u`}function oj(e){return lj(e)?(e.nodeName||``).toLowerCase():`#document`}function sj(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cj(e){return((lj(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function lj(e){return aj()?e instanceof Node||e instanceof sj(e).Node:!1}function uj(e){return aj()?e instanceof Element||e instanceof sj(e).Element:!1}function dj(e){return aj()?e instanceof HTMLElement||e instanceof sj(e).HTMLElement:!1}function fj(e){return!aj()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof sj(e).ShadowRoot}function pj(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=bj(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function mj(e){return/^(table|td|th)$/.test(oj(e))}function hj(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}function gj(e){let t=uj(e)?bj(e):e;return Oj(t.transform)||Oj(t.translate)||Oj(t.scale)||Oj(t.rotate)||Oj(t.perspective)||!vj()&&(Oj(t.backdropFilter)||Oj(t.filter))||Ej.test(t.willChange||``)||Dj.test(t.contain||``)}function _j(e){let t=Sj(e);for(;dj(t)&&!yj(t);){if(gj(t))return t;if(hj(t))return null;t=Sj(t)}return null}function vj(){return kj??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),kj}function yj(e){return/^(html|body|#document)$/.test(oj(e))}function bj(e){return sj(e).getComputedStyle(e)}function xj(e){return uj(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Sj(e){if(oj(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||fj(e)&&e.host||cj(e);return fj(t)?t.host:t}function Cj(e){let t=Sj(e);return yj(t)?(e.ownerDocument||e).body:dj(t)&&pj(t)?t:Cj(t)}function wj(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Cj(e),i=r===e.ownerDocument?.body,a=sj(r);if(i){let e=Tj(a);return t.concat(a,a.visualViewport||[],pj(r)?r:[],e&&n?wj(e):[])}return t.concat(r,wj(r,[],n))}function Tj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Ej,Dj,Oj,kj,Aj=s((()=>{Ej=/transform|translate|scale|rotate|perspective|filter/,Dj=/paint|layout|strict|content/,Oj=e=>!!e&&e!==`none`}));function jj(e){let t=bj(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=dj(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=RA(n)!==a||RA(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Mj(e){return uj(e)?e:e.contextElement}function Nj(e){let t=Mj(e);if(!dj(t))return BA(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=jj(t),o=(a?RA(n.width):n.width)/r,s=(a?RA(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}function Pj(e){let t=sj(e);return!vj()||!t.visualViewport?nM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fj(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===sj(e)}function Ij(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Mj(e),o=BA(1);t&&(r?uj(r)&&(o=Nj(r)):o=Nj(e));let s=Fj(a,n,r)?Pj(a):BA(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=sj(a),t=uj(r)?sj(r):r,n=e,i=Tj(n);for(;i&&t!==n;){let e=Nj(i),t=i.getBoundingClientRect(),r=bj(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=sj(i),i=Tj(n)}}return FA({width:u,height:d,x:c,y:l})}function Lj(e,t){let n=xj(e).scrollLeft;return t?t.left+n:Ij(cj(e)).left+n}function Rj(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Lj(e,n),y:n.top+t.scrollTop}}function zj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=cj(r),s=t?hj(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=BA(1),u=BA(0),d=dj(r);if((d||!a)&&((oj(r)!==`body`||pj(o))&&(c=xj(r)),d)){let e=Ij(r);l=Nj(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Rj(o,c):BA(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Bj(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Vj(e){let t=xj(e),n=e.ownerDocument.body,r=LA(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=LA(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Lj(e),o=-t.scrollTop;return bj(n).direction===`rtl`&&(a+=LA(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}function Hj(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=sj(e),a=cj(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!vj()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Lj(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=rM&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Uj(e,t){let n=Ij(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Nj(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Wj(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Hj(e,n,t);else if(t===`document`)r=Vj(cj(e));else if(uj(t))r=Uj(t,n);else{let n=Pj(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return FA(r)}function Gj(e,t){let n=t.get(e);if(n)return n;let r=wj(e,[],!1).filter(e=>uj(e)&&oj(e)!==`body`),i=null,a=bj(e).position===`fixed`,o=a?Sj(e):e;for(;uj(o)&&!yj(o);){let e=bj(o),t=gj(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Sj(o)}return t.set(e,r),r}function Kj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?hj(t)?[]:Gj(t,this._c):[].concat(n),r],o=Wj(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Wj(t,a[e],i);s=LA(n.top,s),c=IA(n.right,c),l=IA(n.bottom,l),u=LA(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function qj(e){let{width:t,height:n}=jj(e);return{width:t,height:n}}function Jj(e,t,n){let r=dj(t),i=cj(t),a=n===`fixed`,o=Ij(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=BA(0);if((r||!a)&&((oj(t)!==`body`||pj(i))&&(s=xj(t)),r)){let e=Ij(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Lj(i));let l=i&&!r&&!a?Rj(i,s):BA(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Yj(e){return bj(e).position===`static`}function Xj(e,t){if(!dj(e)||bj(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return cj(e)===n&&(n=n.ownerDocument.body),n}function Zj(e,t){let n=sj(e);if(hj(e))return n;if(!dj(e)){let t=Sj(e);for(;t&&!yj(t);){if(uj(t)&&!Yj(t))return t;t=Sj(t)}return n}let r=Xj(e,t);for(;r&&mj(r)&&Yj(r);)r=Xj(r,t);return r&&yj(r)&&Yj(r)&&!gj(r)?n:r||_j(e)||n}function Qj(e){return bj(e).direction===`rtl`}function $j(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function eM(e,t,n){let r=null,i,a=cj(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=zA(d),h=zA(a.clientWidth-(u+f)),g=zA(a.clientHeight-(d+p)),_=zA(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:LA(0,IA(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!$j(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=sj(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function tM(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Mj(e),u=i||a?[...l?wj(l):[],...t?wj(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?eM(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Ij(e):null;c&&g();function g(){let t=Ij(e);h&&!$j(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var nM,rM,iM,aM,oM,sM,cM,lM,uM,dM,fM=s((()=>{ij(),KA(),Aj(),nM=BA(0),rM=25,iM=async function(e){let t=this.getOffsetParent||Zj,n=this.getDimensions,r=await n(e.floating);return{reference:Jj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},aM={convertOffsetParentRelativeRectToViewportRelativeRect:zj,getDocumentElement:cj,getClippingRect:Kj,getOffsetParent:Zj,getElementRects:iM,getClientRects:Bj,getDimensions:qj,getScale:Nj,isElement:uj,isRTL:Qj},oM=ej,sM=tj,cM=QA,lM=rj,uM=nj,dM=(e,t,n)=>{let r=new Map,i=n??{},a={...aM,...i.platform,_c:r};return ZA(e,t,{...i,platform:a})}}));function pM(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=Jv(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=RegExp(s?`${u}${c}.*?(?=\\s${d}|$)`:`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,h=Array.from(p.matchAll(f)).pop();if(!h||h.input===void 0||h.index===void 0)return null;let g=h.input.slice(Math.max(0,h.index-1),h.index),_=RegExp(`^[${i?.join(``)}\0]?$`).test(g);if(i!==null&&!_)return null;let v=m+h.index,y=v+h[0].length;return s&&l.test(p.slice(y-1,y+1))&&(h[0]+=` `,y+=1),v<o.pos&&y>=o.pos?{range:{from:v,to:y},query:h[0].slice(t.length),text:h[0]}:null}function mM(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,`
208
- `);return/\s/.test(n)}):!1}function hM(e){return()=>{let t=e.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=e.view.coordsAtPos(t);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}}}function gM(e,t,n,r){return n?()=>{let n=r.getState(e.state)?.decorationId;return t.dom.querySelector(`[data-decoration-id="${n}"]`)?.getBoundingClientRect()||null}:hM(e)}function _M({match:e,dismissedRange:t,state:n,transaction:r,editor:i,shouldResetDismissed:a,effectiveAllowSpaces:o}){return a?.({editor:i,state:n,range:t,match:e,transaction:r,allowSpaces:o})?!1:o?e.range.from===t.from:e.range.from===t.from&&!mM(r)}function vM({view:e,pluginKeyRef:t}){let n=e.state.tr.setMeta(t,{exit:!0});e.dispatch(n)}function yM({pluginKey:e,decorationTag:t,decorationClass:n,decorationContent:r,decorationEmptyClass:i,renderer:a,dispatchExit:o}){return{handleKeyDown(t,n){var r;let i=e.getState(t.state);if(!i.active)return!1;if(n.key===`Escape`||n.key===`Esc`){var s;return a==null||(s=a.onKeyDown)==null||s.call(a,{view:t,event:n,range:i.range}),o(t),!0}return(a==null||(r=a.onKeyDown)==null?void 0:r.call(a,{view:t,event:n,range:i.range}))||!1},decorations(a){let{active:o,range:s,decorationId:c,query:l}=e.getState(a);if(!o)return null;let u=!l?.length,d=[n];return u&&d.push(i),_g.create(a.doc,[mg.inline(s.from,s.to,{nodeName:t,class:d.join(` `),"data-decoration-id":c||void 0,"data-decoration-content":r})])}}}function bM({editor:e,char:t,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,findSuggestionMatch:o,allow:s,shouldShow:c,shouldKeepDismissed:l,pluginKey:u}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(d,f,p,m){let{isEditable:h}=e,{composing:g}=e.view,{selection:_}=d,{empty:v,from:y}=_,b={...f},x=d.getMeta(u);if(x&&x.exit)return b.active=!1,b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null,b.dismissedRange=f.active?{...f.range}:f.dismissedRange,b;if(b.composing=g,d.docChanged&&b.dismissedRange!==null&&(b.dismissedRange={from:d.mapping.map(b.dismissedRange.from),to:d.mapping.map(b.dismissedRange.to)}),h&&(v||e.view.composing)){(y<f.range.from||y>f.range.to)&&!g&&!f.composing&&(b.active=!1);let u=o({char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:_.$from}),p=`id_${Math.floor(Math.random()*4294967295)}`;u&&s({editor:e,state:m,range:u.range,isActive:f.active})&&(!c||c({editor:e,range:u.range,query:u.query,text:u.text,transaction:d}))?(b.dismissedRange!==null&&!l({match:u,dismissedRange:b.dismissedRange,state:m,transaction:d})&&(b.dismissedRange=null),b.dismissedRange===null?(b.active=!0,b.decorationId=f.decorationId||p,b.range=u.range,b.query=u.query,b.text=u.text):b.active=!1):(u||(b.dismissedRange=null),b.active=!1)}else b.active=!1;return b.active||(b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null),b}}}function xM({editor:e,items:t}){let n=null,r=null,i=null,a=()=>{r!==null&&(clearTimeout(r),r=null),i?.(),i=null},o=e=>new Promise(t=>{i=t,r=setTimeout(()=>{r=null;let e=i;i=null,e?.()},e)}),s=()=>{n?.abort(),a(),n=null};return{abort:s,fetch:async(r,i)=>{s(),n=new AbortController;let a=n;if(i>0&&await o(i),n!==a||a.signal.aborted)return{status:`aborted`};try{let i=await t({editor:e,query:r,signal:a.signal});return n!==a||a.signal.aborted?{status:`aborted`}:{status:`resolved`,items:i}}catch{return n!==a||a.signal.aborted?{status:`aborted`}:{status:`error`}}}}}function SM({placement:e,offset:t,flip:n,floatingUi:r}){var i;let a=[oM({mainAxis:t.mainAxis??4,crossAxis:t.crossAxis??0})];return n&&a.push(cM()),r!=null&&(i=r.middleware)!=null&&i.length&&a.push(...r.middleware),{placement:e,strategy:r?.strategy??`absolute`,middleware:a}}function wte(e){if(e instanceof HTMLElement)return e;if(typeof e==`string`)try{let t=document.querySelector(e);if(t)return t}catch{return document.body}return document.body}function Tte({getReferenceRect:e,contextElement:t,config:n,container:r,dismissOnOutsideClick:i,dismiss:a}){return(o,s={})=>{let c={getBoundingClientRect:()=>e()??new DOMRect,contextElement:t},l=!1,u=!o.isConnected;u&&wte(r).appendChild(o),s.onPosition||(o.style.visibility=`hidden`,o.style.width=`max-content`);let d=tM(c,o,()=>{dM(c,o,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:e,y:t,placement:n,strategy:r})=>{s.onPosition?s.onPosition({x:e,y:t,placement:n,strategy:r}):(Object.assign(o.style,{position:r,left:`${e}px`,top:`${t}px`}),l||(l=!0,o.style.visibility=``))})},s.autoUpdate),f;return i&&(f=e=>{let n=e.target;!(n instanceof Node)||o.contains(n)||t.contains(n)||a()},document.addEventListener(`pointerdown`,f,!0)),()=>{d(),f&&document.removeEventListener(`pointerdown`,f,!0),u&&o.remove()}}}function Ete({editor:e,pluginKey:t,items:n,renderer:r,minQueryLength:i,debounce:a,initialItems:o,placement:s,offset:c,container:l,flip:u,floatingUi:d,dismissOnOutsideClick:f,command:p,clientRectFor:m,dispatchExit:h}){let g,_=xM({editor:e,items:n}),v=SM({placement:s,offset:c,flip:u,floatingUi:d});function y(e,t){switch(e){case`started`:var n;r==null||(n=r.onStart)==null||n.call(r,t);break;case`updated`:var i;r==null||(i=r.onUpdate)==null||i.call(r,t);break;case`stopped`:var a;r==null||(a=r.onExit)==null||a.call(r,t)}}return{update:async(n,d)=>{let b=t.getState(d),x=t.getState(n.state);if(!b||!x)return;let S=null,C=b.query!==x.query,w=b.text!==x.text,T=b.range.from!==x.range.from||b.range.to!==x.range.to,E=C||w||T;if(!b.active&&x.active)S=`started`;else if(b.active&&!x.active)S=`stopped`;else if(x.active&&E)S=`updated`;else return;let D=S===`stopped`?b:x,O=n.dom.querySelector(`[data-decoration-id="${D.decorationId}"]`),k=m(n,O),A=i===0||(D.query?D.query.length>=i:!1),j=(S===`started`||S===`updated`)&&A;if(g={editor:e,range:D.range,query:D.query||``,text:D.text||``,items:o??[],command:t=>p({editor:e,range:D.range,props:t}),decorationNode:O,clientRect:k,loading:j,placement:s,offset:{mainAxis:c.mainAxis??4,crossAxis:c.crossAxis??0},container:l,flip:u,floatingUi:v,mount:Tte({getReferenceRect:k,contextElement:n.dom,config:v,container:l,dismissOnOutsideClick:f,dismiss:()=>h(e.view)})},S===`started`){var M;r==null||(M=r.onBeforeStart)==null||M.call(r,g)}if(S===`updated`){var N;r==null||(N=r.onBeforeUpdate)==null||N.call(r,g)}if(S===`started`&&y(S,g),S===`started`||S===`updated`){if(!j)_.abort(),g={...g,items:o??[],loading:!1};else{g={...g,items:o??[],loading:!0},S=`updated`,y(S,g);let e=await _.fetch(D.query||``,a);if(e.status===`aborted`)return;if(!t.getState(n.state)?.active){_.abort();return}g=e.status===`resolved`?{...g,items:e.items,loading:!1}:{...g,loading:!1}}}S===`stopped`?(_.abort(),y(S,g),g=void 0):S===`updated`&&y(S,g)},destroy:()=>{var e;_.abort(),g&&(r==null||(e=r.onExit)==null||e.call(r,g))}}}function Dte({pluginKey:e=CM,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],minQueryLength:p=0,debounce:m=0,initialItems:h,placement:g=`bottom-start`,offset:_={},container:v,flip:y=!0,floatingUi:b,dismissOnOutsideClick:x=!0,render:S=()=>({}),allow:C=()=>!0,findSuggestionMatch:w=pM,shouldShow:T,shouldResetDismissed:E}){let D=S?.(),O=r&&!i,k=(n,r)=>gM(t,n,r,e);function A(e){return _M({...e,editor:t,shouldResetDismissed:E,effectiveAllowSpaces:O})}let j=t=>vM({view:t,pluginKeyRef:e});return new ld({key:e,view:()=>Ete({editor:t,pluginKey:e,items:f,renderer:D,minQueryLength:p,debounce:m,initialItems:h,placement:g,offset:_,container:v,flip:y,floatingUi:b,dismissOnOutsideClick:x,command:d,clientRectFor:k,dispatchExit:j}),state:bM({editor:t,char:n,effectiveAllowSpaces:O,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,findSuggestionMatch:w,allow:C,shouldShow:T,shouldKeepDismissed:A,pluginKey:e}),props:yM({pluginKey:e,decorationTag:s,decorationClass:c,decorationContent:l,decorationEmptyClass:u,renderer:D,dispatchExit:j})})}var CM,Ote=s((()=>{pd(),Ix(),Ag(),fM(),CM=new dd(`suggestion`)}));function kte({editor:e,overrideSuggestionOptions:t,extensionName:n,char:r=`@`}){return{editor:e,char:r,pluginKey:new dd,command:({editor:e,range:t,props:i})=>{var a,o;let s=e.view.state.selection.$to.nodeAfter;s!=null&&(a=s.text)!=null&&a.startsWith(` `)&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:n,attrs:{...i,mentionSuggestionChar:r}},{type:`text`,text:` `}]).run(),(o=e.view.dom.ownerDocument.defaultView)==null||(o=o.getSelection())==null||o.collapseToEnd()},allow:({state:e,range:t})=>{let r=e.doc.resolve(t.from),i=e.schema.nodes[n];return!!r.parent.type.contentMatch.matchType(i)},...t}}function wM(e){return(e.options.suggestions.length?e.options.suggestions:[e.options.suggestion]).map(t=>kte({editor:e.editor,overrideSuggestionOptions:t,extensionName:e.name,char:t.char}))}function TM(e,t){let n=wM(e);return n.find(e=>e.char===t)||(n.length?n[0]:null)}var EM,DM,Ate=s((()=>{Ix(),of(),Ote(),pd(),EM=Fx.create({name:`mention`,priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:e,suggestion:t}){return`${t?.char??`@`}${e.attrs.label??e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:t,suggestion:n}){return[`span`,rv(this.HTMLAttributes,e.HTMLAttributes),`${n?.char??`@`}${t.attrs.label??t.attrs.id}`]},suggestions:[],suggestion:{}}},group:`inline`,inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute(`data-id`),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute(`data-label`),renderHTML:e=>e.label?{"data-label":e.label}:{}},mentionSuggestionChar:{default:`@`,parseHTML:e=>e.getAttribute(`data-mention-suggestion-char`),renderHTML:e=>({"data-mention-suggestion-char":e.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=TM(this,e.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn(`renderLabel is deprecated use renderText and renderHTML instead`),[`span`,rv({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e,suggestion:n})];let r={...this.options};r.HTMLAttributes=rv({"data-type":this.name},this.options.HTMLAttributes,t);let i=this.options.renderHTML({options:r,node:e,suggestion:n});return typeof i==`string`?[`span`,rv({"data-type":this.name},this.options.HTMLAttributes,t),i]:i},...py({nodeName:`mention`,name:`@`,selfClosing:!0,allowedAttributes:[`id`,`label`,{name:`mentionSuggestionChar`,skipIfDefault:`@`}],parseAttributes:e=>{let t={},n=/(?:^|\s)(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i===`char`?`mentionSuggestionChar`:i]=a??o,r=n.exec(e)}return t},serializeAttributes:e=>Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e===`mentionSuggestionChar`?`char`:e}="${t}"`).join(` `)}),renderText({node:e}){let t={options:this.options,node:e,suggestion:TM(this,e.attrs.mentionSuggestionChar)};return this.options.renderLabel===void 0?this.options.renderText(t):(console.warn(`renderLabel is deprecated use renderText and renderHTML instead`),this.options.renderLabel(t))},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1,{selection:r}=t,{empty:i,anchor:a}=r;if(!i)return!1;let o=new il,s=0;return t.doc.nodesBetween(a-1,a,(e,t)=>{if(e.type.name===this.name)return n=!0,o=e,s=t,!1}),n&&e.insertText(this.options.deleteTriggerWithBackspace?``:o.attrs.mentionSuggestionChar,s,s+o.nodeSize),n})}},addProseMirrorPlugins(){return wM(this).map(Dte)}}),DM=EM})),OM,kM,AM,jte=s((()=>{Ix(),OM=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,kM=Fx.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,rv(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize,i=new Set([`src`,`width`,`height`]);return({node:a,getPos:o,HTMLAttributes:s,editor:c})=>{let l=document.createElement(`img`);l.draggable=!1;let u=rv(this.options.HTMLAttributes,s);Object.entries(u).forEach(([e,t])=>{if(t!=null)switch(e){case`src`:case`width`:case`height`:break;default:l.setAttribute(e,t)}}),u.src!==null&&(l.src=u.src);let d={...s},f=e=>{typeof e==`string`&&e!==``?l.getAttribute(`src`)!==e&&(l.src=e):(l.hasAttribute(`src`)&&l.removeAttribute(`src`),l.src!==``&&(l.src=``))};f(s.src);let p=new Px({element:l,editor:c,node:a,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let n=o();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:e=>{if(e.type!==a.type)return!1;let t=iv(e,c.extensionManager.attributes.filter(t=>t.type===e.type.name));return Object.keys(d).forEach(e=>{!i.has(e)&&!(e in t)&&l.removeAttribute(e)}),Object.entries(t).forEach(([e,t])=>{i.has(e)||(t==null?l.removeAttribute(e):l.setAttribute(e,t))}),f(t.src),d=t,!0},options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),m=p.dom,h=()=>{m.style.visibility=``,m.style.pointerEvents=``};return m.style.visibility=`hidden`,m.style.pointerEvents=`none`,l.complete&&l.naturalWidth>0?h():(l.onload=h,l.onerror=h),p}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Oy({find:OM,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),AM=kM}));function jM(e,t){let n=MM.useRef(NM);return n.current===NM&&(n.current=e(t)),n}var MM,NM,PM=s((()=>{MM=d(m(),1),NM={}}));function Mte(){return zM}function Nte(e){RM.push(e)}function FM(e){let t=(t,n)=>{let r=jM(Pte).current,i;try{zM=r;for(let e of RM)e.before(r);i=e(t,n);for(let e of RM)e.after(r);r.didInitialize=!0}finally{zM=void 0}return i};return t.displayName=e.displayName||e.name,t}function IM(e){return LM.forwardRef(FM(e))}function Pte(){return{didInitialize:!1}}var LM,RM,zM,BM=s((()=>{LM=d(m(),1),PM(),RM=[],zM=void 0}));function VM(){}var HM,UM,WM=s((()=>{HM=Object.freeze([]),UM=Object.freeze({})}));function GM(e){KM.useEffect(e,HM)}var KM,qM=s((()=>{KM=d(m(),1),WM()}));function JM(){let e=jM(XM.create).current;return GM(e.disposeEffect),e}var YM,XM,ZM=s((()=>{PM(),qM(),YM=0,XM=class e{static create(){return new e}currentId=YM;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=YM,t()},e)}isStarted(){return this.currentId!==YM}clear=()=>{this.currentId!==YM&&(clearTimeout(this.currentId),this.currentId=YM)};disposeEffect=()=>this.clear}})),QM,$M,Q,eN=s((()=>{QM=d(m(),1),$M=()=>{},Q=typeof document<`u`?QM.useLayoutEffect:$M}));function tN(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var nN,rN,iN,aN,oN,sN=s((()=>{({userAgent:nN,platform:rN,maxTouchPoints:iN}=tN()),aN=nN.toLowerCase(),oN=rN.toLowerCase()})),cN,lN,uN,dN,fN,pN=s((()=>{sN(),cN=/^i(os$|p)/.test(oN)||oN===`macintel`&&iN>1,lN=`android`,uN=oN===lN||aN.includes(lN),dN=!cN&&oN.startsWith(`mac`),oN.startsWith(`win`),!uN&&/^(linux|chrome os)/.test(oN),fN=dN||cN})),mN,hN,gN=s((()=>{sN(),mN=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),hN=!mN&&aN.includes(`firefox`),!mN&&aN.includes(`chrom`)})),_N,vN=s((()=>{pN(),_N=fN})),yN,bN=s((()=>{sN(),yN=/jsdom|happydom/.test(aN)})),xN=s((()=>{pN(),gN(),vN(),bN()})),SN=s((()=>{xN()}));function CN(e){e.preventDefault(),e.stopPropagation()}function Fte(e){return`nativeEvent`in e}function wN(e){return e.pointerType===``&&e.isTrusted?!0:uN&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function TN(e){return yN?!1:!uN&&e.width===0&&e.height===0||uN&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function EN(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function DN(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var ON=s((()=>{SN()}));function kN(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function AN(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&fj(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function jN(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var MN=s((()=>{Aj()})),NN,PN,FN,IN,LN,RN,zN=s((()=>{NN=`data-base-ui-focusable`,PN=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,FN=`ArrowLeft`,IN=`ArrowRight`,LN=`ArrowUp`,RN=`ArrowDown`})),BN,VN,HN=s((()=>{BN=`data-starting-style`,VN=`data-ending-style`})),UN,WN,GN,KN=s((()=>{HN(),UN={[BN]:``},WN={[VN]:``},GN={transitionStatus(e){return e===`starting`?UN:e===`ending`?WN:null}}})),qN,JN,YN,XN=s((()=>{HN(),qN=`data-open`,JN=`data-closed`,YN=`data-anchor-hidden`})),ZN,QN,$N=s((()=>{ZN=`data-popup-open`,QN=`data-pressed`})),eP,tP,nP,rP,iP,aP,oP,sP,cP,lP=s((()=>{KN(),XN(),$N(),eP={[ZN]:``},tP={[ZN]:``,[QN]:``},nP={[qN]:``},rP={[JN]:``},iP={[YN]:``},aP={open(e){return e?eP:null}},oP={open(e){return e?tP:null}},sP={open(e){return e?nP:rP},anchorHidden(e){return e?iP:null}},cP={...sP,...GN}})),uP,Ite=s((()=>{lP(),uP=`data-trigger-disabled`}));function dP(e,t){if(!uj(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(uP);for(let[,e]of t.entries())if(AN(e,n))return!e.hasAttribute(uP);return!1}function fP(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Lte(e){return e.matches(`html,body`)}function pP(e){return dj(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function mP(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${PN}`)!=null}function hP(e){return e?e.getAttribute(`role`)===`combobox`&&pP(e):!1}function gP(e){if(!e||yN)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function _P(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}var vP=s((()=>{Aj(),SN(),MN(),zN(),Ite()}));function yP(e,t){return t!=null&&!EN(t)?0:typeof e==`function`?e():e}function bP(e,t,n){let r=yP(e,n);return typeof r==`number`?r:r?.[t]}function xP(e){return typeof e==`function`?e():e}function SP(e,t){return t||e===`click`||e===`mousedown`}function CP(e){return e?.includes(`mouse`)&&e!==`mousedown`}var wP=s((()=>{ON(),vP()})),TP,EP,DP,OP,kP,AP,jP,MP,NP,PP,FP,IP,LP,RP,zP,BP,VP,HP,UP,Rte=s((()=>{TP=`none`,EP=`trigger-press`,DP=`trigger-hover`,OP=`trigger-focus`,kP=`outside-press`,AP=`item-press`,jP=`close-press`,MP=`input-change`,NP=`input-clear`,PP=`input-press`,FP=`focus-out`,IP=`escape-key`,LP=`list-navigation`,RP=`keyboard`,zP=`pointer`,BP=`cancel-open`,VP=`sibling-open`,HP=`imperative-action`,UP=`window-resize`})),WP=s((()=>{Rte()}));function GP(e,t,n,r){let i=!1,a=!1,o=r??UM;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function zte(e,t,n){let r=n??UM;return{reason:e,event:t??new Event(`base-ui`),...r}}var KP=s((()=>{WM()}));function qP(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var JP=s((()=>{}));function YP(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var XP=s((()=>{}));function ZP(e,t,n,r){let i=jM($P).current;return eF(i,e,t,n,r)&&nF(i,[e,t,n,r]),i.callback}function QP(e){let t=jM($P).current;return tF(t,e)&&nF(t,e),t.callback}function $P(){return{callback:null,cleanup:null,refs:[]}}function eF(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function tF(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function nF(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var rF=s((()=>{PM()}));function iF(e){let t=jM(aF,e).current;return t.next=e,Q(t.effect),t}function aF(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var oF=s((()=>{eN(),PM()})),sF,cF,lF=s((()=>{sF=d(m(),1),cF={...sF}}));function $(e){let t=jM(uF).current;return t.next=e,pF(t.effect),t.trampoline}function uF(){let e={next:void 0,callback:dF,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function dF(){}var fF,pF,mF=s((()=>{lF(),PM(),fF=cF.useInsertionEffect,pF=fF&&fF!==cF.useLayoutEffect?fF:e=>e()}));function hF(){let e=jM(yF.create).current;return GM(e.disposeEffect),e}var gF,_F,vF,yF,bF=s((()=>{PM(),qM(),gF=null,globalThis.requestAnimationFrame,_F=class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},vF=new _F,yF=class e{static create(){return new e}static request(e){return vF.request(e)}static cancel(e){return vF.cancel(e)}currentId=gF;request(e){this.cancel(),this.currentId=vF.request(()=>{this.currentId=gF,e()})}cancel=()=>{this.currentId!==gF&&(vF.cancel(this.currentId),this.currentId=gF)};disposeEffect=()=>this.cancel}}));function xF(e){return e?.ownerDocument||document}var SF=s((()=>{Aj()})),CF,wF,TF,EF=s((()=>{CF={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},wF={...CF,position:`fixed`,top:0,left:0},TF={...CF,position:`absolute`}})),DF,OF,kF,AF=s((()=>{DF=d(m(),1),eN(),SN(),EF(),OF=d(O(),1),kF=DF.forwardRef(function(e,t){let[n,r]=DF.useState();Q(()=>{_N&&mN&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,OF.jsx)(`span`,{...e,ref:t,style:wF,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})})}));function jF(e,t,n){return Math.floor(e/t)!==n}function MF(e,t){return t<0||t>=e.length}function NF(e,t){return FF(e.current,{disabledIndices:t})}function PF(e,t){return FF(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function FF(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&LF(e,a,r));return a}function IF(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!LF(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=zA(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!LF(e,r,s))return r}};d&&CN(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=FF(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=FF(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}MF(e,f)&&(f=u)}if(n===`both`){let n=zA(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&CN(t),u%o===o-1?r&&(f=FF(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=FF(e,{startingIndex:u,disabledIndices:s}),r&&jF(f,o,n)&&(f=FF(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),jF(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&CN(t),u%o===0?r&&(f=FF(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=FF(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&jF(f,o,n)&&(f=FF(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),jF(f,o,n)&&(f=u));let c=zA(l/o)===n;MF(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:FF(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function LF(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!zF(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function RF(e){return e.visibility===`hidden`||e.visibility===`collapse`}function zF(e,t=e?bj(e):null){return!e||!e.isConnected||!t||RF(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var BF=s((()=>{KA(),Aj(),ON(),zN()}));function Bte(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return fj(n)?n.host:null}function VF(e){for(let t of Array.from(e.children))if(oj(t)===`summary`)return t;return null}function Vte(e,t){let n=VF(t);return!!n&&(e===n||AN(n,e))}function HF(e){let t=e?oj(e):``;return e!=null&&e.matches(sI)&&(t!==`summary`||e.parentElement!=null&&oj(e.parentElement)===`details`&&VF(e.parentElement)===e)&&(t!==`details`||VF(e)==null)&&(t!==`input`||e.type!==`hidden`)}function UF(e){if(!HF(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Bte(t)){let n=t!==e,r=oj(t)===`slot`;if(t.hasAttribute(`inert`)||n&&oj(t)===`details`&&!t.open&&!Vte(e,t)||t.hasAttribute(`hidden`)||!r&&!Hte(t,n))return!1}return!0}function Hte(e,t){let n=bj(e);return t?n.display!==`none`:zF(e,n)}function WF(e){let t=e.tabIndex;if(t<0){let t=oj(e);if(t===`details`||t===`audio`||t===`video`||dj(e)&&e.isContentEditable)return 0}return t}function GF(e){if(oj(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Ute(e,t){let n=GF(e);if(!n)return!0;let r=t.find(e=>{let t=GF(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=GF(e);return t?.name===n.name&&t.form===n.form})===n}function KF(e){if(dj(e)&&oj(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return dj(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function qF(e,t){KF(e).forEach(e=>{HF(e)&&t.push(e),qF(e,t)})}function JF(e,t,n){KF(e).forEach(e=>{dj(e)&&e.matches(t)&&n.push(e),JF(e,t,n)})}function YF(e){return UF(e)&&WF(e)>=0}function XF(e){let t=[];return qF(e,t),t.filter(UF)}function ZF(e){let t=XF(e);return t.filter(e=>WF(e)>=0&&Ute(e,t))}function QF(e,t){let n=ZF(e),r=n.length;if(r===0)return;let i=kN(xF(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function $F(e){return QF(xF(e).body,1)||e}function eI(e){return QF(xF(e).body,-1)||e}function tI(e,t){if(!e)return null;let n=ZF(xF(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function nI(e){return tI(e,1)}function rI(e){return tI(e,-1)}function iI(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!AN(n,r)}function aI(e){ZF(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function oI(e){let t=[];JF(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var sI,cI=s((()=>{Aj(),SF(),vP(),BF(),sI=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`}));function lI(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...lI(e,t.id,n)])}function uI(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}var dI=s((()=>{}));function fI(e){return`data-base-ui-${e}`}var pI=s((()=>{}));function mI(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(hI);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),VM;let o=requestAnimationFrame(a);return hI=o,()=>{hI===o&&(cancelAnimationFrame(o),hI=0)}}var hI,gI=s((()=>{WM(),hI=0}));function _I(e){return CI[e]}function vI(e){return e?fj(e)?e.host:vI(e.parentNode):null}function yI(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=EI(t,e),l=i?OI(t,DI(c),new Set(c)):[],u=[],d=[];if(a){let e=xI[a],n=_I(a);s=n,o=e;let r=EI(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);OI(t,DI(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(wI.get(e)||0)+1;wI.set(e,t),d.push(e),t===1&&e.setAttribute(SI,``)}),TI+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(wI.get(e)||0)-1;wI.set(e,t),t||e.removeAttribute(SI)}),--TI,TI||(xI.inert=new WeakMap,xI[`aria-hidden`]=new WeakMap,CI.inert=new WeakSet,CI[`aria-hidden`]=new WeakSet,wI=new WeakMap)}}function bI(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=xF(e[0]).body;return yI(e,a,n,r,{mark:i})}var xI,SI,CI,wI,TI,EI,DI,OI,kI=s((()=>{Aj(),SF(),xI={inert:new WeakMap,"aria-hidden":new WeakMap},SI=`data-base-ui-inert`,CI={inert:new WeakSet,"aria-hidden":new WeakSet},wI=new WeakMap,TI=0,EI=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=vI(t);return e.contains(n)?n:null}).filter(e=>e!=null),DI=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},OI=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{oj(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r}}));function AI(e,t=`mui`){let[n,r]=MI.useState(e),i=e||n;return MI.useEffect(()=>{n??(NI+=1,r(`${t}-${NI}`))},[n,t]),i}function jI(e,t){if(PI!==void 0){let n=PI();return e??(t?`${t}-${n}`:n)}return AI(e,t)}var MI,NI,PI,FI=s((()=>{MI=d(m(),1),lF(),NI=0,PI=cF.useId}));function II(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var LI,RI=s((()=>{LI=II(`https://base-ui.com/production-error`,`Base UI`)}));function zI(e){return BI>=e}var BI,VI=s((()=>{m(),BI=19}));function HI(e){if(!UI.isValidElement(e))return null;let t=e,n=t.props;return(zI(19)?n?.ref:t.ref)??null}var UI,WI=s((()=>{UI=d(m(),1),VI()}));function GI(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var KI=s((()=>{}));function qI(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}var JI=s((()=>{}));function YI(e,t){return typeof e==`function`?e(t):e}var XI=s((()=>{}));function ZI(e,t){return typeof e==`function`?e(t):e}var QI=s((()=>{}));function $I(e,t,n,r,i){if(!n&&!r&&!i&&!e)return tL(t);let a=tL(e);return t&&(a=nL(a,t)),n&&(a=nL(a,n)),r&&(a=nL(a,r)),i&&(a=nL(a,i)),a}function eL(e){if(e.length===0)return pL;if(e.length===1)return tL(e[0]);let t=tL(e[0]);for(let n=1;n<e.length;n+=1)t=nL(t,e[n]);return t}function tL(e){return oL(e)?{...sL(e,pL)}:rL(e)}function nL(e,t){return oL(t)?sL(t,e):iL(e,t)}function rL(e){let t={...e};for(let e in t){let n=t[e];aL(e,n)&&(t[e]=lL(n))}return t}function iL(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=GI(e.style,r);break;case`className`:e[n]=dL(e.className,r);break;default:e[n]=aL(n,r)?cL(e[n],r):r}}return e}function aL(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function oL(e){return typeof e==`function`}function sL(e,t){return oL(e)?e(t):e??pL}function cL(e,t){return t?e?(...n)=>{let r=n[0];if(fL(r)){let i=r;uL(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:lL(t):e}function lL(e){return e&&((...t)=>{let n=t[0];return fL(n)&&uL(n),e(...t)})}function uL(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function dL(e,t){return t?e?t+` `+e:t:e}function fL(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}var pL,mL=s((()=>{KI(),pL={}})),hL=s((()=>{mL()}));function gL(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=yL(r));let i=_L(t,n,r);if(n.enabled===!1)return null;let a=n.state??UM;return bL(e,r,i,a)}function _L(e,t,n){let{className:r,style:i}=e,{state:a=UM,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?YI(r,a):void 0,d=l?ZI(i,a):void 0,f=l?qI(a,c):UM,p=l&&s?vL(s):void 0,m=l?GI(f,p)??{}:UM;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?QP([m.ref,HI(n),...o]):ZP(m.ref,HI(n),o):ZP(null,null)),l?(u!==void 0&&(m.className=dL(m.className,u)),d!==void 0&&(m.style=GI(m.style,d)),m):UM}function vL(e){return Array.isArray(e)?eL(e):$I(void 0,e)}function yL(e){if(e?.$$typeof!==wL)return e;let t=SL.Children.toArray(e)[0];return SL.isValidElement(t)?t:e}function bL(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=$I(n,t.props);return e.ref=n.ref,SL.cloneElement(t,e)}if(e&&typeof e==`string`)return xL(e,n);throw Error(LI(8))}function xL(e,t){return e===`button`?(0,CL.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,CL.createElement)(`img`,{alt:``,...t,key:t.key}):SL.createElement(e,t)}var SL,CL,wL,TL=s((()=>{RI(),SL=d(m(),1),rF(),WI(),KI(),WM(),JI(),XI(),QI(),hL(),CL=d(m(),1),wL=Symbol.for(`react.lazy`)})),EL,DL,OL,kL,AL,jL=s((()=>{EL={style:{transition:`none`}},DL=`data-base-ui-click-trigger`,OL={fallbackAxisSide:`none`},kL={fallbackAxisSide:`end`},AL={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0}}));function ML(e={}){let{ref:t,container:n,componentProps:r=UM,elementProps:i}=e,a=jI(),o=LL()?.portalNode,[s,c]=NL.useState(null),[l,u]=NL.useState(null),d=$(e=>{e!==null&&u(e)}),f=NL.useRef(null);Q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(lj(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=gL(`div`,r,{ref:[t,d],props:[{id:a,[RL]:``},i]}),m=s&&p?PL.createPortal(p,s):null;return{node:l,nodeId:NL.isValidElement(p)?p.props.id:void 0,subtree:m}}var NL,PL,FL,IL,LL,RL,zL,BL=s((()=>{NL=d(m(),1),PL=d(g(),1),Aj(),JP(),XP(),FI(),eN(),mF(),WM(),AF(),cI(),KP(),WP(),pI(),TL(),jL(),FL=d(O(),1),IL=NL.createContext(null),LL=()=>NL.useContext(IL),RL=fI(`portal`),zL=NL.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=ML({container:o,ref:t,componentProps:e,elementProps:c}),f=NL.useRef(null),p=NL.useRef(null),m=NL.useRef(null),h=NL.useRef(null),[g,_]=NL.useState(null),v=NL.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;NL.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&iI(e)&&(e.type===`focusin`?v.current&&=(oI(l),!1):(aI(l),v.current=!0))}return YP(qP(l,`focusin`,e,!0),qP(l,`focusout`,e,!0))},[l,y]),Q(()=>{l&&b===!0&&v.current&&(oI(l),v.current=!1)},[b,l]);let S=NL.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,FL.jsxs)(NL.Fragment,{children:[d,(0,FL.jsxs)(IL.Provider,{value:S,children:[x&&l&&(0,FL.jsx)(kF,{"data-type":`outside`,ref:f,onFocus:e=>{iI(e,l)?m.current?.focus():eI(g?g.domReference:null)?.focus()}}),x&&l&&(0,FL.jsx)(`span`,{role:s,"aria-owns":u,style:AL}),l&&PL.createPortal(a,l),x&&l&&(0,FL.jsx)(kF,{"data-type":`outside`,ref:p,onFocus:e=>{iI(e,l)?h.current?.focus():($F(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,GP(`focus-out`,e.nativeEvent)))}})]})]})})}));function VL(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var HL=s((()=>{})),UL,WL=s((()=>{HL(),UL=class{nodesRef={current:[]};events=VL();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}}}));function GL(e){let t=jI(),n=$L(e),r=QL();return Q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function KL(e){let{children:t,id:n}=e,r=QL();return(0,YL.jsx)(XL.Provider,{value:JL.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function qL(e){let{children:t,externalTree:n}=e,r=jM(()=>n??new UL).current;return(0,YL.jsx)(ZL.Provider,{value:r,children:t})}var JL,YL,XL,ZL,QL,$L,eR=s((()=>{JL=d(m(),1),FI(),eN(),PM(),WL(),YL=d(O(),1),XL=JL.createContext(null),ZL=JL.createContext(null),QL=()=>JL.useContext(XL)?.id||null,$L=e=>{let t=JL.useContext(ZL);return e??t}}));function tR(e){return e==null?e:`current`in e?e.current:e}var nR=s((()=>{}));function Wte(e,t){let n=sj(jN(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}function rR(){dR=dR.filter(e=>e.deref()?.isConnected)}function iR(e){rR(),e&&oj(e)!==`body`&&(dR.push(new WeakRef(e)),dR.length>uR&&(dR=dR.slice(-20)))}function aR(){return rR(),dR[dR.length-1]?.deref()}function Gte(e){return e?YF(e)?e:ZF(e)[0]||e:null}function oR(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=XF(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return YF(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function sR(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=$(()=>b.current.floatingContext?.nodeId),S=i===!1,C=hP(_)&&S,w=iF(i),T=iF(a),E=iF(l),D=iF(g),O=$L(p),k=LL(),A=cR.useRef(!1),j=cR.useRef(!1),M=cR.useRef(!1),N=cR.useRef(null),P=cR.useRef(``),F=cR.useRef(``),I=cR.useRef(null),L=cR.useRef(null),R=ZP(I,f,k?.beforeInsideRef),z=ZP(L,k?.afterInsideRef),B=JM(),V=JM(),H=hF(),U=k!=null,W=_P(v),G=$((e=W)=>e?ZF(e):[]),ee=$(()=>m?.().filter(e=>e!=null)??[]);cR.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&AN(W,kN(xF(W)))&&G().length===0&&!C&&CN(e)}return qP(xF(W),`keydown`,e)},[r,W,s,C,G]),cR.useEffect(()=>{if(r||!g)return;let e=xF(W);function t(){M.current=!1}function n(e){let t=jN(e),n=ee(),r=AN(v,t)||AN(_,t)||AN(k?.portalNode,t)||n.some(e=>e===t||AN(e,t));M.current=!r,F.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0,V.start(0,()=>{j.current=!1}))}function i(){F.current=`keyboard`}return YP(qP(e,`pointerdown`,n,!0),qP(e,`pointerup`,t,!0),qP(e,`pointercancel`,t,!0),qP(e,`keydown`,i,!0),t)},[r,v,_,W,g,k,V,ee]),cR.useEffect(()=>{if(r||!c)return;let e=xF(W);function t(){j.current=!0,V.start(0,()=>{j.current=!1})}function n(e){let t=jN(e);YF(t)&&(N.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=jN(t);s&&n==null&&i!=null&&AN(v,i)&&iR(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=ee(),f=n?.hasAttribute(fI(`focus-guard`))&&[I.current,L.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,tR(d),tR(u)].includes(n),p=!(AN(_,n)||AN(v,n)||AN(n,v)||AN(k?.portalNode,n)||l.some(e=>e===n||AN(e,n))||c.hasMatchingElement(e=>AN(e,n))||f||O&&(lI(O.nodesRef.current,a).find(e=>AN(e.context?.elements.floating,n)||AN(e.context?.elements.domReference,n))||uI(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,_P(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&W&&oR(W),o&&r!==_&&!zF(i)&&kN(e)===e.body){if(dj(W)&&(W.focus(),o===`popup`)){H.request(()=>{W.focus()});return}let e=G(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;dj(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!s)&&n&&p&&!j.current&&(C||n!==aR())&&(A.current=!0,h.setOpen(!1,GP(FP,t)))})}function a(){M.current||(b.current.insideReactTree=!0,B.start(0,()=>{b.current.insideReactTree=!1}))}let l=dj(_)?_:null;if(v||l)return YP(l&&qP(l,`focusout`,i),l&&qP(l,`pointerdown`,t),v&&qP(v,`focusin`,n),v&&qP(v,`focusout`,i),v&&k&&qP(v,`focusout`,a,!0))},[r,_,v,W,s,O,k,h,c,o,G,C,x,b,B,V,H,u,d,ee]),cR.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${fI(`portal`)}]`)||[]),t=(O?uI(O.nodesRef.current,x()):[]).find(e=>hP(e.context?.elements.domReference||null))?.context?.elements.domReference,n=bI([v,...e,I.current,L.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...ee(),t,tR(d),tR(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=bI([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,k,C,O,x,u,d,ee]),Q(()=>{if(!g||r||!dj(W))return;P.current=``,F.current=``;let e=xF(W),t=kN(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(E.current||``):n;if(r===void 0||r===!1||AN(W,t))return;let i=null,a=()=>(i??=G(W),i[0]||W),o;o=r===!0||r===null?a():tR(r),o||=a();let s=AN(W,kN(e));mI(o,{preventScroll:o===W,shouldFocus(){if(!D.current)return!1;if(s)return!0;let t=kN(e);return!(t!==o&&AN(W,t))}})})},[r,g,W,G,w,E,D]),Q(()=>{if(r||!W)return;let e=xF(W),t=kN(e),n=E.current==null;iR(t);function i(e){if(e.open||(P.current=Wte(e.nativeEvent,F.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`){if(e.nested)A.current=!1;else if(wN(e.nativeEvent)||TN(e.nativeEvent))A.current=!1;else{let e=!1;xF(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&oj(t)!==`body`?t:null,s=n?o||a:a||o;return s||=aR()||null,typeof i==`boolean`?s:tR(i)||s||null}return()=>{y.off(`openchange`,i);let t=kN(e),n=ee(),r=AN(v,t)||n.some(e=>e===t||AN(e,t))||O&&lI(O.nodesRef.current,x(),!1).some(e=>AN(e.context?.elements.floating,t)),o=T.current,s=P.current,c=a(s);queueMicrotask(()=>{let n=Gte(c),i=typeof o!=`boolean`;if(o&&!A.current&&dj(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}A.current=!1})}},[r,v,W,T,E,y,O,_,x,ee]),Q(()=>{if(!mN||g||!v)return;let e=kN(xF(v));dj(e)&&pP(e)&&AN(v,e)&&e.blur()},[g,v]),Q(()=>{if(!r&&k)return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{k.setFocusManagerState(null)}},[r,k,s,g,h,c,_]),Q(()=>{if(!r&&W)return oR(W),()=>{queueMicrotask(rR)}},[r,W]);let te=!r&&(!s||!C)&&(U||s);return(0,lR.jsxs)(cR.Fragment,{children:[te&&(0,lR.jsx)(kF,{"data-type":`inside`,ref:R,onFocus:e=>{if(s){let e=G();mI(e[e.length-1])}else k?.portalNode&&(A.current=!1,iI(e,k.portalNode)?$F(_)?.focus():tR(d??k.beforeOutsideRef)?.focus())}}),n,te&&(0,lR.jsx)(kF,{"data-type":`inside`,ref:z,onFocus:e=>{s?mI(G()[0]):k?.portalNode&&(c&&(A.current=!0),iI(e,k.portalNode)?eI(_)?.focus():tR(u??k.afterOutsideRef)?.focus())}})]})}var cR,lR,uR,dR,Kte=s((()=>{cR=d(m(),1),Aj(),JP(),XP(),rF(),oF(),mF(),eN(),ZM(),SN(),bF(),SF(),AF(),vP(),ON(),cI(),dI(),BF(),KP(),WP(),pI(),gI(),kI(),BL(),eR(),jL(),nR(),lR=d(O(),1),uR=20,dR=[]}));function fR(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=EP}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=pR.useRef(void 0),f=hF(),p=JM(),m=pR.useMemo(()=>{function e(e,t,n,r){let i=GP(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=EN(e.pointerType,!0)&&TN(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||EN(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=jN(o);if(pP(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;r===`mousedown`&&i?d.current=void 0:EN(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return pR.useMemo(()=>n?{reference:m}:UM,[n,m])}var pR,qte=s((()=>{pR=d(m(),1),bF(),ZM(),WM(),vP(),ON(),KP(),WP()}));function Jte(){return!1}function Yte(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function mR(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Jte,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f,events:p}=l.context,m=$L(c),h=$(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=$(()=>a),{escapeKey:y,outsidePress:b}=Yte(s),x=hR.useRef(!1),S=hR.useRef(!1),C=hR.useRef(!1),w=hR.useRef(!1),T=hR.useRef(!1),E=hR.useRef(``),D=hR.useRef(null),O=JM(),k=JM(),A=$(()=>{k.clear(),f.current.insideReactTree=!1}),j=$(e=>{let t=f.current.floatingContext?.nodeId;return(m?lI(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=$(e=>fP(e,l.select(`floatingElement`))||fP(e,l.select(`domReferenceElement`))),N=$(e=>{o()&&l.setOpen(!1,GP(EP,e.nativeEvent))}),P=$(e=>{if(!u||!n||!r||e.key!==`Escape`||T.current||!y&&j(`__escapeKeyBubbles`))return;let t=Fte(e)?e.nativeEvent:e,i=GP(IP,t);l.setOpen(!1,i),i.isCanceled||e.preventDefault(),!y&&!i.isPropagationAllowed&&e.stopPropagation()}),F=$(()=>{f.current.insideReactTree=!0,k.start(0,A)}),I=$(e=>{if(!u||!n||e.button!==0)return;let t=jN(e.nativeEvent);AN(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),L=$(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});hR.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),hR.useEffect(()=>{if(!u||!n)return u||(w.current=!1),A;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new XM,t=new XM,i=xF(d);function a(){e.clear(),T.current=!0}function o(){e.start(mN?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function p(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function k(e){let t=f.current.floatingContext?.nodeId,n=m&&lI(m.nodesRef.current,t).some(t=>fP(e,t.context?.elements.floating));return M(e)||n}function N(e){if(h(e)){e.type!==`click`&&!M(e)&&(t.clear(),C.current=!1),A();return}if(f.current.insideReactTree){A();return}let n=jN(e),r=`[${fI(`inert`)}]`,i=uj(n)?n.getRootNode():null,a=Array.from((fj(i)?i:xF(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>AN(e,n))))return;let s=uj(n)?n:null;for(;s&&!yj(s);){let e=Sj(s);if(yj(e)||!uj(e))break;s=e}if(!(a.length&&uj(n)&&!Lte(n)&&!AN(n,l.select(`floatingElement`))&&a.every(e=>!AN(s,e)))){if(dj(n)&&!(`touches`in e)){let t=yj(n),r=bj(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!k(e)){if(p()===`intentional`){if(e.detail!==0&&!wN(e)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof g==`function`&&!g(e)||j(`__outsidePressBubbles`)||(l.setOpen(!1,GP(kP,e)),A())}}}function F(e){p()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!M(e)&&N(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||M(e))return;let t=e.touches[0];t&&(D.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=jN(e);if(!n)return;let r=qP(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),p()===`intentional`&&(e.type===`pointercancel`?n&&s():k(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,A())))}function V(e){if(p()!==`sloppy`||!D.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(N(e),O.clear(),D.current=null)}function H(e){L(e,V)}function U(e){p()===`sloppy`&&D.current&&!M(e)&&(D.current.dismissOnTouchEnd&&N(e),O.clear(),D.current=null)}function W(e){L(e,U)}let G=YP(r&&YP(qP(i,`keydown`,P),qP(i,`compositionstart`,a),qP(i,`compositionend`,o)),_&&YP(qP(i,`click`,z,!0),qP(i,`pointerdown`,z,!0),qP(i,`pointerup`,B,!0),qP(i,`pointercancel`,B,!0),qP(i,`mousedown`,z,!0),qP(i,`mouseup`,B,!0),qP(i,`touchstart`,R,{capture:!0,passive:!0}),qP(i,`touchmove`,H,{capture:!0,passive:!0}),qP(i,`touchend`,W,{capture:!0,passive:!0})));return()=>{G(),e.clear(),t.clear(),c(),C.current=!1,A()}},[f,d,r,_,g,u,n,y,b,P,A,v,j,M,m,l,O]);let R=hR.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),z=hR.useMemo(()=>({onKeyDown:P,onPointerDown:L,onMouseDown:L,onClickCapture:F,onMouseDownCapture(e){F(),I(e)},onPointerDownCapture(e){F(),I(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,I,L]);return hR.useMemo(()=>n?{reference:R,floating:z,trigger:R}:{},[n,R,z])}var hR,Xte=s((()=>{hR=d(m(),1),JP(),XP(),SF(),mF(),ZM(),Aj(),SN(),eR(),KP(),WP(),pI(),vP(),ON(),dI()}));function gR(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!gR(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!gR(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function _R(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vR(e,t){let n=_R(e);return Math.round(t*n)/n}function yR(e){let t=bR.useRef(e);return CR(()=>{t.current=e}),t}function Zte(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=bR.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=bR.useState(r);gR(f,r)||p(r);let[m,h]=bR.useState(null),[g,_]=bR.useState(null),v=bR.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=bR.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=bR.useRef(null),C=bR.useRef(null),w=bR.useRef(u),T=c!=null,E=yR(c),D=yR(i),O=yR(l),k=bR.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),dM(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!gR(w.current,t)&&(w.current=t,SR.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);CR(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=bR.useRef(!1);CR(()=>(A.current=!0,()=>{A.current=!1}),[]),CR(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=bR.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=bR.useMemo(()=>({reference:b,floating:x}),[b,x]),N=bR.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=vR(M.floating,u.x),r=vR(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,..._R(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return bR.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var bR,xR,SR,CR,wR,TR,ER,DR,OR,kR=s((()=>{fM(),bR=d(m(),1),xR=d(m(),1),SR=d(g(),1),CR=typeof document<`u`?xR.useLayoutEffect:function(){},wR=(e,t)=>{let n=oM(e);return{name:n.name,fn:n.fn,options:[e,t]}},TR=(e,t)=>{let n=sM(e);return{name:n.name,fn:n.fn,options:[e,t]}},ER=(e,t)=>({fn:uM(e).fn,options:[e,t]}),DR=(e,t)=>{let n=cM(e);return{name:n.name,fn:n.fn,options:[e,t]}},OR=(e,t)=>{let n=lM(e);return{name:n.name,fn:n.fn,options:[e,t]}}})),AR=s((()=>{})),jR=s((()=>{})),MR=s((()=>{})),NR=s((()=>{}));function PR(e,t,n,r,i){return VR(e,t,n,r,i)}function FR(e,t,n,r,i){let a=RR.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,zR.useSyncExternalStore)(e.subscribe,a,a)}function IR(e,t,n,r,i){let a=Mte();if(!a)return FR(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function LR(e,t,n,r,i){return(0,BR.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var RR,zR,BR,VR,HR=s((()=>{RR=d(m(),1),zR=hd(),BR=jS(),VI(),BM(),VR=zI(19)?IR:LR,Nte({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,zR.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}})})),UR,WR=s((()=>{HR(),UR=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return PR(this,e,t,n,r)}}})),GR,KR,qR=s((()=>{GR=d(m(),1),WR(),HR(),mF(),eN(),WM(),KR=class extends UR{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){GR.useDebugValue(e);let n=this;Q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);Q(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){GR.useDebugValue(e);let n=this,r=t!==void 0;Q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return GR.useDebugValue(e),PR(this,this.selectors[e],t,n,r)}useContextCallback(e,t){GR.useDebugValue(e);let n=$(t??VM);this.context[e]=n}useStateSetter(e){let t=GR.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}}})),JR=s((()=>{m(),g(),hd(),O()})),YR=s((()=>{MR(),NR(),HR(),WR(),qR(),JR()})),XR=s((()=>{vP(),dI(),ON(),BF(),cI()})),ZR,QR,$R=s((()=>{YR(),HL(),XR(),ZR={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},QR=class extends KR{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:VL(),nested:n,triggerElements:i},ZR),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&DN(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}}}));function ez(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=tz.useRef(null);r===void 0&&f.current===null&&(f.current=new QR({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),Q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};uj(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}var tz,nz=s((()=>{tz=d(m(),1),eN(),Aj(),$R()}));function rz(e,t=!1,n=!1,r=!1){let[i,a]=iz.useState(e&&t?`idle`:void 0),[o,s]=iz.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Q(()=>{if(!e&&o&&i!==`ending`&&n){let e=yF.request(()=>{a(`ending`)});return()=>{yF.cancel(e)}}},[e,o,i,n]),Q(()=>{if(!e||t)return;let n=yF.request(()=>{a(void 0)});return()=>{yF.cancel(n)}},[t,e]),Q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=yF.request(()=>{a(`idle`)});return()=>{yF.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var iz,az=s((()=>{iz=d(m(),1),eN(),bF()}));function oz(e){if(!lz){let e=[];lz=e,queueMicrotask(()=>{lz=null,cz.flushSync(()=>{for(let t of e)t()})})}lz.push(e)}function sz(e,t=!1,n=!1){let r=hF();return $((i,a=null)=>{r.cancel();let o=tR(e);if(o==null)return;let s=o,c=()=>{n?oz(()=>{a?.aborted||i()}):cz.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{a?.aborted||(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=BN;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}var cz,lz,uz=s((()=>{cz=d(g(),1),bF(),mF(),nR(),HN(),lz=null}));function dz(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=$(a),s=sz(r,n,i);fz.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var fz,pz=s((()=>{fz=d(m(),1),mF(),uz()}));function mz(e){return t=>t!==`touch`||e.current}function hz(e,t=!1){let n=jI(),r=QL()!=null,i=jM(()=>e(n,r)).current;return ez({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function gz({handle:e,store:t}){return Q(()=>e.attachStore(t),[e,t]),null}function _z(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function vz(e,t){let n=Ez.useRef(null);return $(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),_z(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),_z(t))})}function yz(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function bz(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function xz(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=vz(e,n),o=$(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=$(e=>{a(e),e&&o(e)});return Q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Sz(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=Ez.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);Q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=GP(TP);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Cz(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=rz(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=$(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return dz({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function wz(e,t){e.useSyncedValues(t),Q(()=>()=>{e.update({activeTriggerProps:UM,inactiveTriggerProps:UM,popupProps:UM})},[e])}function Tz(e,t){Q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Ez,Dz,Oz=s((()=>{Ez=d(m(),1),g(),WM(),FI(),mF(),eN(),PM(),zN(),eR(),nz(),az(),pz(),KP(),WP(),Dz={tabIndex:-1,[NN]:``}})),kz,Az=s((()=>{kz=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}}));function jz(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new QR({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:UM,inactiveTriggerProps:UM,popupProps:UM}}function Mz(e,t){return t!==void 0&&Fz(e)&&Pz(e)===t}function Nz(e,t){return Mz(e,t)?!0:t!==void 0&&Fz(e)&&Pz(e)==null&&e.triggerCount===1}var Pz,Fz,Iz,Lz,Rz=s((()=>{WM(),$R(),Pz=e=>e.triggerIdProp??e.activeTriggerId,Fz=e=>e.openProp??e.open,Iz=e=>(e.popupElement?.id??e.floatingId)||void 0,Lz={open:Fz,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Pz,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Iz,isTriggerActive:(e,t)=>t!==void 0&&Pz(e)===t,isOpenedByTrigger:(e,t)=>Mz(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Pz(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Nz(e,t)?Iz(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement}}));function zz(e){let t=Bz.useCallback(t=>e===void 0?VM:e.subscribeStore(t),[e]),n=Bz.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Vz.useSyncExternalStore)(t,n,()=>e?.serverStore)}var Bz,Vz,Hz=s((()=>{Bz=d(m(),1),Vz=hd(),WM()})),Uz=s((()=>{AR(),jR(),Oz(),Az(),Rz(),Hz()}));function Wz(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=jI(),a=QL()!=null,o=jM(()=>new QR({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new kz,floatingId:i,syncOnly:!1,nested:a})).current;return Q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=uj(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var Gz=s((()=>{Aj(),FI(),eN(),PM(),Uz(),eR(),$R()}));function Kz(e){return qz(e,e.rootContext)}function qz(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=Jz.useState(null),[d,f]=Jz.useState(void 0),[p,m]=Jz.useState(void 0),h=Jz.useRef(null),g=$L(r),_=Jz.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=Zte({...e,elements:{..._,...l&&{reference:l}}}),y=uj(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=Jz.useCallback(e=>{let t=uj(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=Jz.useCallback(e=>{(uj(e)||e===null)&&(h.current=e,f(e)),(uj(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!uj(e))&&v.refs.setReference(e)},[v.refs,f]),C=Jz.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=Jz.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=Jz.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=Jz.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return Q(()=>{o&&(h.current=o)},[o]),Q(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),Jz.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}var Jz,Yz=s((()=>{Jz=d(m(),1),eN(),kR(),Aj(),eR()}));function Xz(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=Zz.useRef(!1),c=Zz.useRef(null),l=Zz.useRef(!0),u=JM();Zz.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=sj(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&dj(e)&&e===kN(xF(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return YP(qP(t,`blur`,r),Qz&&qP(t,`keydown`,a,!0),Qz&&qP(t,`pointerdown`,o,!0))},[i,n]),Zz.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);uj(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=Zz.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=jN(t.nativeEvent);if(uj(a)){if(Qz&&!t.relatedTarget){if(!l.current&&!pP(a))return}else if(!gP(a))return}let o=dP(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;i.select(`open`)&&o||p===0||p===void 0?i.setOpen(!0,GP(OP,d,f)):u.start(p,()=>{s.current||i.setOpen(!0,GP(OP,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=uj(n)&&n.hasAttribute(fI(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=kN(xF(e));!n&&t===e||AN(o.current.floatingContext?.refs.floating.current,t)||AN(e,t)||a||dP(n??t,i.context.triggerElements)||i.setOpen(!1,GP(OP,r))})}}},[o,r,i,u]);return Zz.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var Zz,Qz,$z=s((()=>{Zz=d(m(),1),JP(),SN(),XP(),SF(),ZM(),Aj(),pI(),vP(),KP(),WP(),Qz=dN&&mN}));function eB(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&iB.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),iB.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function tB(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=iB.get(n);a&&a!==e&&eB(a),eB(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,iB.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function nB(e){let t=e.context.dataRef.current,n=jM(()=>t.hoverInteractionState??rB.create()).current;return t.hoverInteractionState||=n,GM(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}var rB,iB,aB=s((()=>{qM(),PM(),ZM(),XR(),rB=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new XM,this.restTimeout=new XM,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},iB=new WeakMap}));function oB(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=$L(),d=QL(),f=nB(a),p=JM(),m=$(()=>SP(l.current.openEvent?.type,f.interactedInside)),h=$(()=>CP(l.current.openEvent?.type)),g=$(()=>{eB(f)});Q(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),sB.useEffect(()=>g,[g]),Q(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&uj(c)&&s){let e=c,t=s,n=xF(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return tB(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),sB.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&lI(u.nodesRef.current,d).length>0)}function t(e){let t=bP(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,GP(DP,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=jN(e);mP(t)?f.interactedInside=t?.closest(`[aria-haspopup]`)!=null:f.interactedInside=!1}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(dP(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;u&&r&&uj(o)&&lI(u.nodesRef.current,r,!1).some(e=>AN(e.context?.elements.floating,o))||(f.handler?f.handler(n):(g(),h()&&!m()&&t(n)))}function v(t){u&&d&&!e()&&p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,GP(DP,t)),u.events.emit(`floating.closed`,t)})}let y=s;return YP(y&&qP(y,`mouseenter`,c),y&&qP(y,`mouseleave`,_),y&&qP(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var sB,cB=s((()=>{sB=d(m(),1),JP(),XP(),eN(),SF(),mF(),ZM(),Aj(),KP(),WP(),eR(),vP(),dI(),aB(),wP()}));function lB(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=fB,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=$L(l),y=nB(h),b=uB.useRef(!1),x=iF(i),S=iF(r),C=iF(o),w=iF(n),T=iF(p),E=iF(f),D=$(()=>SP(g.current.openEvent?.type,y.interactedInside)),O=$(()=>T.current?.()!==!1),k=$((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!AN(e,t);if(!uj(n))return!1;let i=n;return r.hasMatchingElement(e=>AN(e,i))&&(!e||!AN(e,i))}),A=$(()=>{y.handler&&=(xF(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=$(()=>{eB(y)});return u&&(y.handleCloseOptions=i?.__options),uB.useEffect(()=>A,[A]),uB.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===DP,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,A]),uB.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=bP(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,GP(DP,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,GP(DP,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!uj(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!EN(y.pointerType))return;let t=xP(C.current),n=bP(S.current,`open`,y.pointerType),r=jN(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(uj(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(AN(e,r)){s=e;break}}uj(i)&&uj(o)&&!h.context.triggerElements.hasElement(i)&&AN(i,o)&&(s=o);let c=s!=null&&k(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&uj(s)&&uj(o)&&AN(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;m?O()&&h.setOpen(!0,GP(DP,e,s)):p||(n?y.openChangeTimeout.start(n,()=>{g&&O()&&h.setOpen(!0,GP(DP,e,s))}):g&&O()&&h.setOpen(!0,GP(DP,e,s)))}function i(t){if(D()){j();return}A();let n=xF(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!dP(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){j(),A(),w.current&&!D()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t)}else y.pointerType===`touch`&&AN(h.select(`floatingElement`),t.relatedTarget)||e(t)}}function o(e){AN(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?qP(t,`mouseout`,o):void 0;return s?YP(qP(t,`mousemove`,r,{once:!0}),qP(t,`mouseenter`,r),qP(t,`mouseleave`,i),l):YP(qP(t,`mouseenter`,r),qP(t,`mouseleave`,i),l)},[A,j,g,S,h,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),uB.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=k(r,n,e.target);if(a&&!EN(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;tB(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=xP(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,D())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&O()&&h.setOpen(!0,GP(DP,t,n))}y.pointerType===`touch`?dB.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,D,k,a,h,C,O])}var uB,dB,fB,pB=s((()=>{uB=d(m(),1),dB=d(g(),1),JP(),XP(),SF(),mF(),oF(),Aj(),KP(),WP(),eR(),vP(),ON(),aB(),wP(),fB={current:null}}));function mB(e){return mN&&e.movementX===0&&e.movementY===0}function hB(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function gB(e,t){return hB(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function _B(e,t,n){return hB(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function vB(e,t,n){return hB(t,n?e===FN:e===IN,e===RN)}function yB(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===SB:hB(t,n?e===IN:e===FN,e===LN)}function bB(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),D=C.context.dataRef,O=_P(T),k=hP(E),A=iF(O),j=QL(),M=$L(b),N=xB.useRef(f),P=xB.useRef(o??-1),F=xB.useRef(null),I=xB.useRef(!0),L=$(e=>{i(P.current===-1?null:P.current,e)}),R=xB.useRef(!!T),z=xB.useRef(w),B=xB.useRef(!1),V=xB.useRef(!1),H=xB.useRef(null),U=iF(h),W=iF(w),G=iF(o),ee=iF(y),te=hF(),ne=hF(),K=$(()=>{function e(e){d?M?.events.emit(`virtualfocus`,e):H.current=mI(e,{sync:B.current,preventScroll:!0})}let t=n.current[P.current],r=V.current;t&&e(t),(B.current?e=>e():e=>te.request(e))(()=>{let i=n.current[P.current]||t;i&&(t||e(i),se&&(r||!I.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Q(()=>{D.current.orientation=g},[D,g]),Q(()=>{a&&(w&&T?(P.current=o??-1,N.current&&o!=null&&(V.current=!0,L())):R.current&&(P.current=-1,L()))},[a,w,T,o,L]),Q(()=>{if(a){if(!w)B.current=!1;else if(T){if(r==null){if(B.current=!1,G.current!=null)return;if(R.current&&(P.current=-1,K()),(!z.current||!R.current)&&N.current&&(F.current!=null||N.current===!0&&F.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ne.request(e):queueMicrotask)(t),e+=1):(P.current=F.current==null||_B(F.current,g,u)||l?NF(n):PF(n),F.current=null,L())};t()}}else MF(n.current,r)||(P.current=r,K(),V.current=!1)}}},[a,w,T,r,G,l,n,g,u,L,K,ne]),Q(()=>{if(!a||T||!M||d||!R.current)return;let e=M.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=kN(xF(E??t??null)),r=e.some(e=>e.context&&AN(e.context.elements.floating,n));t&&!r&&I.current&&t.focus({preventScroll:!0})},[a,T,E,M,j,d]),Q(()=>{z.current=w,R.current=!!T}),Q(()=>{w||(F.current=null,N.current=f)},[w,f]);let re=r!=null,q=$(e=>{if(!W.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(P.current!==t||r!==t)&&(P.current=t,L(e))}),ie=$(()=>_??M?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation),ae=$(()=>NF(n,U.current)),oe=$(e=>{if(I.current=!1,B.current=!0,e.which===229||!W.current&&e.currentTarget===A.current)return;if(l&&yB(e.key,g,u,S)){gB(e.key,ie())||CN(e),C.setOpen(!1,GP(LP,e.nativeEvent)),dj(E)&&(d?M?.events.emit(`virtualfocus`,E):E.focus());return}let t=P.current,r=NF(n,h),i=PF(n,h);if(k||(e.key===`Home`&&(CN(e),P.current=r,L(e)),e.key===`End`&&(CN(e),P.current=i,L(e))),x!=null){let t=x(e,P.current,n,g,c,u,h,r,i);if(t!=null&&(P.current=t,L(e)),g===`both`)return}if(gB(e.key,g)){if(CN(e),w&&!d&&kN(e.currentTarget.ownerDocument)===e.currentTarget){P.current=_B(e.key,g,u)?r:i,L(e);return}_B(e.key,g,u)?c?t>=i?s&&t!==n.current.length?P.current=-1:(B.current=!1,P.current=r):P.current=FF(n.current,{startingIndex:t,disabledIndices:h}):P.current=Math.min(i,FF(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?P.current=n.current.length:(B.current=!1,P.current=i):P.current=FF(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):P.current=Math.max(r,FF(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),MF(n.current,P.current)&&(P.current=-1),L(e)}}),se=xB.useMemo(()=>({onFocus(e){B.current=!0,q(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){mB(e)||(B.current=!0,V.current=!1,p&&q(e))},onPointerLeave(e){if(!W.current||!I.current||e.pointerType===`touch`)return;B.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ee.current&&(H.current?.(),H.current=null,P.current=-1,L(e),!d)){let e=A.current,t=kN(xF(e));e&&AN(e,t)&&e.focus({preventScroll:!0})}}}),[q,W,A,p,n,L,ee,d]),ce=xB.useMemo(()=>d&&w&&re&&{"aria-activedescendant":`${v}-${r}`},[d,w,re,v,r]),le=xB.useMemo(()=>({...k?{}:ce,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=jN(e.nativeEvent);if(t&&!AN(A.current,t))return;CN(e),C.setOpen(!1,GP(FP,e.nativeEvent)),dj(E)&&E.focus()}else oe(e)},onPointerMove(e){mB(e)||(I.current=!0)}}),[ce,oe,A,k,C,w,d,E]),ue=xB.useMemo(()=>{function e(e){C.setOpen(!0,GP(LP,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&wN(e.nativeEvent)&&(N.current=!d)}function n(e){N.current=f,f===`auto`&&TN(e.nativeEvent)&&(N.current=!0)}return{onKeyDown(t){let n=C.select(`open`);I.current=!1;let r=t.key.startsWith(`Arrow`),i=vB(t.key,ie(),u),a=gB(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return oe(t);if(n||m||!r){if(o){let e=gB(t.key,ie());F.current=l&&e?null:t.key}l?i&&(CN(t),n?(P.current=ae(),L(t)):e(t)):a&&(G.current!=null&&(P.current=G.current),CN(t),!n&&m?e(t):oe(t),n&&L(t))}},onFocus(e){C.select(`open`)&&!d&&(P.current=-1,L(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[oe,f,ae,l,L,C,m,g,ie,u,G,d]),de=xB.useMemo(()=>({...ce,...ue}),[ce,ue]);return xB.useMemo(()=>a?{reference:de,floating:le,item:se,trigger:ue}:{},[a,de,le,ue,se])}var xB,SB,CB=s((()=>{xB=d(m(),1),bF(),eN(),SF(),mF(),oF(),SN(),Aj(),KP(),WP(),eR(),BF(),zN(),vP(),gI(),ON(),SB=`Escape`}));function wB(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=JM(),m=TB.useRef(``),h=TB.useRef(u??i??-1),g=TB.useRef(null),_=$(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!zF(n)||n?.matches(`:disabled`)?!1:o==null||!LF(HM,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(CN(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(CN(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=$(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);AN(n,t)||AN(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});Q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=TB.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return TB.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var TB,EB=s((()=>{TB=d(m(),1),eN(),mF(),ZM(),WM(),BF(),vP(),ON()}));function DB(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function OB(e,t,n,r,i,a,o,s,c,l){let u=!1;return DB(e,t,n,r,i,a)&&(u=!u),DB(e,t,i,a,o,s)&&(u=!u),DB(e,t,o,s,c,l)&&(u=!u),DB(e,t,c,l,n,r)&&(u=!u),u}function kB(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function AB(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function jB(e={}){let{blockPointerEvents:t=!1}=e,n=new XM,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*NB;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=jN(r),g=r.type===`mouseleave`,_=AN(u,h),v=AN(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&uj(r.relatedTarget)&&AN(u,r.relatedTarget))return;function y(){return!!(s&&lI(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=AB(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=AB(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=AB(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=AB(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!kB(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?PB/2:PB*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+PB+1,o=C||T?S.bottom-PB:S.top,s=C?T?S.bottom-PB:S.top:S.bottom-PB;M=OB(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?PB/2:PB*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-PB,o=C||T?S.top+PB:S.bottom,s=C?T?S.top+PB:S.bottom:S.top+PB;M=OB(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?PB/2:PB*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+PB+1,o=w||E?S.right-PB:S.left,s=w?E?S.right-PB:S.left:S.right-PB;M=OB(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?PB/2:PB*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-PB,o=w||E?S.left+PB:S.right,s=w?E?S.left+PB:S.right:S.left+PB;M=OB(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var MB,NB,PB,FB=s((()=>{Aj(),ZM(),vP(),dI(),MB=.1,NB=MB*MB,PB=.5})),IB=s((()=>{ZM(),eN(),wP(),KP(),WP(),Kte(),BL(),eR(),WL(),qte(),mF(),Aj(),vP(),ON(),Xte(),Yz(),Gz(),nz(),$z(),cB(),pB(),SF(),oF(),CB(),EB(),FB(),kR()}));function LB(e){let t=RB.useContext(zB);if(t===void 0&&!e)throw Error(LI(47));return t}var RB,zB,BB=s((()=>{RI(),RB=d(m(),1),zB=RB.createContext(void 0)}));function VB(e,t,n,r=!1){let i={...jz(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function HB(e){return{popupRef:UB.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:UB.createRef(),beforeContentFocusGuardRef:UB.createRef(),stickIfOpenTimeout:new XM,triggerElements:e}}var UB,WB,GB,KB,qB=s((()=>{UB=d(m(),1),WB=d(g(),1),YR(),ZM(),WP(),Uz(),jL(),GB={...Lz,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},KB=class extends KR{constructor(e,t,n){let r=new kz;super(VB(e,r,t,n),HB(r),GB)}setOpen=(e,t)=>{let n=t.reason===DP,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=bz(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=yz(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),WB.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}}}));function JB(e){return LB(!0)?(0,QB.jsx)($B,{props:e}):(0,QB.jsx)(qL,{children:(0,QB.jsx)($B,{props:e})})}function YB(e,t){let n=hz((e,n)=>new KB(t,e,n));return ZB.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function XB({store:e,modal:t}){let n=mR(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return wz(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var ZB,QB,$B,eV=s((()=>{ZB=d(m(),1),BM(),IB(),BB(),qB(),KP(),WP(),Uz(),QB=d(O(),1),$B=FM(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=YB(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),Tz(u,d),Sz(u);let{forceUnmount:m}=Cz(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),ZB.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),ZB.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,GP(HP))}),[m,u]);let h=d||f;return(0,QB.jsxs)(zB.Provider,{value:u,children:[s&&(0,QB.jsx)(gz,{handle:s,store:u}),h&&(0,QB.jsx)(XB,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})})}));function tV(e=!1){let t=nV.useContext(rV);if(t===void 0&&!e)throw Error(LI(16));return t}var nV,rV,iV=s((()=>{RI(),nV=d(m(),1),rV=nV.createContext(void 0)}));function aV(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:oV.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}var oV,sV=s((()=>{oV=d(m(),1)}));function cV(e,t,{detail:n=0}={}){e.dispatchEvent(new(sj(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}var lV=s((()=>{SF()}));function uV(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=pV.useRef(null),s=tV(!0),c=a??s!==void 0,{props:l}=aV({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=pV.useCallback(()=>{let e=o.current;dV(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Q(u,[u]),{getButtonProps:pV.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return $I({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(uL(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=dV(r),s=!i&&fV(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),cV(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),cV(r,e)))},onKeyUp(e){t||(uL(e),a?.(e),e.target===e.currentTarget&&i&&c&&dV(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),cV(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:$(e=>{o.current=e,u()})}}function dV(e){return dj(e)&&e.tagName===`BUTTON`}function fV(e){return dj(e)&&e.tagName===`A`&&!!e.href}var pV,mV=s((()=>{pV=d(m(),1),Aj(),mF(),eN(),hL(),iV(),sV(),lV()})),hV=s((()=>{}));function gV(e){return jI(e,`base-ui`)}var _V=s((()=>{FI()}));function vV(e,t){let n=yV.useRef(null);function r(t){bV.flushSync(()=>{e.setOpen(!1,GP(FP,t.nativeEvent,t.currentTarget))}),rI(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&iI(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{bV.flushSync(()=>{e.setOpen(!1,GP(FP,n.nativeEvent,n.currentTarget))});let i=nI(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&AN(r,i);){let e=i;if(i=$F(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}var yV,bV,xV=s((()=>{yV=d(m(),1),bV=d(g(),1),XR(),KP(),WP()}));function SV(e){let t=CV.useRef(``),n=CV.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:CV.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}var CV,wV=s((()=>{CV=d(m(),1)}));function TV(e,t){let n=EV.useRef(e),r=$(t);Q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}var EV,DV=s((()=>{EV=d(m(),1),eN(),mF()}));function OV(e,t){let{onClick:n,onPointerDown:r}=SV($((n,r)=>{(typeof e==`function`?e():e)||t(r||(cN?`touch`:``))}));return AV.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function kV(e){let[t,n]=AV.useState(null),r=OV(e,n);return TV(e,t=>{t&&!e&&n(null)}),AV.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var AV,jV=s((()=>{AV=d(m(),1),mF(),wV(),SN(),DV()})),MV,NV,PV,FV=s((()=>{RI(),MV=d(m(),1),BM(),BB(),mV(),lP(),TL(),jL(),IB(),hV(),_V(),AF(),WP(),Uz(),xV(),jV(),NV=d(O(),1),PV=IM(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=LB(!0),h=zz(s)??m;if(!h)throw Error(LI(74));let g=gV(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=MV.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=xz(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`openChangeReason`),T=h.useState(`stickIfOpen`),E=h.useState(`openMethod`),D=h.useState(`focusManagerModal`),O=lB(v,{enabled:!a&&l&&(E!==`touch`||w!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:jB(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),k=fR(v,{stickIfOpen:T}),A=OV(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),j=h.useState(`triggerProps`,C),{getButtonProps:M,buttonRef:N}=uV({disabled:a,native:o}),P={open(e){return e&&w===`trigger-press`?oP.open(e):aP.open(e)}},{preFocusGuardRef:F,handlePreFocusGuardFocus:I,handleFocusTargetFocus:L}=vV(h,x),R=gL(`button`,e,{state:{disabled:a,open:y},ref:[N,t,S,x],props:[k.reference,O,j,A,{[DL]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,M],stateAttributesMapping:P}),z=(0,NV.jsx)(MV.Fragment,{children:R},g);return C&&!D?(0,NV.jsxs)(MV.Fragment,{children:[(0,NV.jsx)(kF,{ref:F,onFocus:I}),z,(0,NV.jsx)(kF,{ref:h.context.triggerFocusTargetRef,onFocus:L})]}):z})}));function IV(){let e=LV.useContext(RV);if(e===void 0)throw Error(LI(45));return e}var LV,RV,zV=s((()=>{RI(),LV=d(m(),1),RV=LV.createContext(void 0)})),BV,VV,HV,UV=s((()=>{BV=d(m(),1),IB(),BB(),zV(),VV=d(O(),1),HV=BV.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return LB().useState(`mounted`)||n?(0,VV.jsx)(RV.Provider,{value:n,children:(0,VV.jsx)(zL,{ref:t,...r})}):null})}));function WV(e){return zI(19)?e:e?`true`:void 0}var GV=s((()=>{VI()}));function KV(){let e=qV.useContext(JV);if(!e)throw Error(LI(46));return e}var qV,JV,YV=s((()=>{RI(),qV=d(m(),1),JV=qV.createContext(void 0)}));function XV(){return ZV.useContext(QV)?.direction??`ltr`}var ZV,QV,$V=s((()=>{ZV=d(m(),1),QV=ZV.createContext(void 0)})),eH,tH,nH=s((()=>{KA(),eH=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=bA(e,t)||{};if(l==null)return{};let f=PA(u),p={x:n,y:r},m=EA(i),h=wA(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];w&&await o.isElement?.(C)||(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=yA(k,j,A),N=!c.arrow&&SA(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),tH=(e,t)=>{let{name:n,fn:r}=eH(e);return{name:n,fn:r,options:[e,t]}}})),rH,iH=s((()=>{rH={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}}})),aH,oH=s((()=>{aH={sideX:`left`,sideY:`top`}})),sH,cH,lH,uH,dH,fH=s((()=>{sH=`--available-width`,cH=`--available-height`,lH=`--anchor-width`,uH=`--anchor-height`,dH=`--transform-origin`}));function pH(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function mH(e,t,n){let{rects:r,placement:i}=e;return{side:pH(t,xA(i),n),align:SA(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function hH(e){return Qte(e,Kz)}function Qte(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=_H.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,O=v?.crossAxis??!1,k=v?.rootBoundary,A=typeof n==`function`?n:void 0,j=$(A),M=A?j:n,N=iF(n),P=iF(g),F=XV()===`rtl`,I=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[i],L=o===`center`?I:`${I}-${o}`,R=l;typeof R==`number`?R={top:R,right:R,bottom:R,left:R}:R&&={top:R.top||0,right:R.right||0,bottom:R.bottom||0,left:R.left||0};let z=+(i===`bottom`),B=+(i===`top`),V=+(i===`right`),H=+(i===`left`),U={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:R},W=_H.useRef(null),G=iF(a),ee=iF(s),te=typeof a==`function`?0:a,ne=typeof s==`function`?0:s,K=[];p&&K.push(p),K.push(wR(e=>{let t=mH(e,i,F),n=typeof G.current==`function`?G.current(t):G.current,r=typeof ee.current==`function`?ee.current(t):ee.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[te,ne,F,i]));let re=E===`none`&&T!==`shift`,q=!re&&(u||O||T===`shift`),ie=T===`none`?null:DR({...U,padding:{top:R.top+1+z,right:R.right+1+H,bottom:R.bottom+1+B,left:R.left+1+V},mainAxis:!O&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),ae=re?null:TR({...U,rootBoundary:k,mainAxis:E!==`none`,crossAxis:q,limiter:u||O?void 0:ER(e=>{if(!W.current)return{};let{width:t,height:n}=W.current.getBoundingClientRect(),r=TA(xA(e.placement)),i=r===`y`?t:n,a=r===`y`?R.left+R.right:R.top+R.bottom;return{offset:i/2+a/2}})},[U,u,O,k,R,E]);T===`shift`||E===`shift`||o===`center`?K.push(ae,ie):K.push(ie,ae),K.push(OR({...U,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!P.current)return;let i=e.style;i.setProperty(vH,`${t}px`),i.setProperty(yH,`${n}px`);let a=sj(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(lH,`${u}px`),i.setProperty(uH,`${d}px`)}}),tH(e=>({element:W.current||xF(e.elements.floating).createElement(`div`),padding:W.current?d:0,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=xA(r),u=SA(r),d=TA(l)===`y`,f=W.current,p=typeof a==`function`?a(mH(e,i,F)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return q&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(dH,d?`${m} ${h}`:`${h} ${m}`),{}}},rH,b),Q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let oe=_H.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:se,elements:ce,x:le,y:ue,middlewareData:de,update:fe,placement:pe,context:me,isPositioned:J,floatingStyles:he}=t({rootContext:h,open:m?g:void 0,placement:L,middleware:K,strategy:r,whileElementsMounted:m?void 0:(...e)=>tM(...e,oe),nodeId:y,externalTree:S}),{sideX:ge,sideY:_e}=de.adaptiveOrigin||aH,ve=J?r:`fixed`,ye=_H.useMemo(()=>{let e;return e=J?b?{position:ve,[ge]:le,[_e]:ue}:{...he,position:ve}:{position:ve,top:0,left:0},e[vH]=`100vw`,e[yH]=`100vh`,J||(e.opacity=0),e},[b,ve,ge,le,_e,ue,he,J]),be=_H.useRef(null);Q(()=>{if(!g)return;let e=N.current,t=typeof e==`function`?e():e,n=(gH(t)?t.current:t)||null;n!==be.current&&(se.setPositionReference(n),be.current=n)},[g,se,M,N]),_H.useEffect(()=>{if(!g)return;let e=N.current;typeof e!=`function`&&gH(e)&&e.current!==be.current&&(se.setPositionReference(e.current),be.current=e.current)},[g,se,M,N]),_H.useEffect(()=>{if(m&&g&&ce.reference&&ce.floating)return tM(ce.reference,ce.floating,fe,oe)},[m,g,ce,fe,oe]);let xe=xA(pe),Se=pH(i,xe,F),Ce=SA(pe)||`center`,we=!!de.hide?.referenceHidden;Q(()=>{x&&g&&J&&xe!==I&&w(xe)},[x,g,J,xe,I]);let Te=_H.useMemo(()=>({position:`absolute`,top:de.arrow?.y,left:de.arrow?.x}),[de.arrow]),Ee=de.arrow?.centerOffset!==0;return _H.useMemo(()=>({positionerStyles:ye,arrowStyles:Te,arrowRef:W,arrowUncentered:Ee,side:Se,align:Ce,physicalSide:xe,anchorHidden:we,refs:se,context:me,isPositioned:J,update:fe}),[ye,Te,W,Ee,Se,Ce,xe,we,se,me,J,fe])}function gH(e){return e!=null&&`current`in e}var _H,vH,yH,bH=s((()=>{_H=d(m(),1),KA(),SF(),eN(),oF(),mF(),IB(),Yz(),$V(),nH(),iH(),oH(),fH(),vH=sH,yH=cH})),xH,SH,CH,wH=s((()=>{xH=d(m(),1),SH=d(O(),1),CH=xH.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,SH.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})})}));function TH(e){return e===`starting`?EL:UM}var EH=s((()=>{WM(),jL()}));function DH(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),gL(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},TH(r),i],stateAttributesMapping:sP})}var OH=s((()=>{lP(),TL(),EH()}));function kH(e,t){return pj(e)?e:t}function AH(e,t,n){return/hidden|clip/.test(e.getComputedStyle(kH(t,n)).overflowY)}function $te(e){if(typeof document>`u`)return!1;let t=xF(e);return sj(t).innerWidth-t.documentElement.clientWidth>0}function ene(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=xF(e),n=t.documentElement,r=t.body,i=kH(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function tne(e){let t=xF(e),n=t.documentElement,r=t.body,i=kH(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function nne(e){let t=xF(e),n=t.documentElement,r=t.body,i=sj(n),a=0,o=0,s=!1,c=yF.create();if(mN&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,MH={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},PH=n.style.scrollBehavior,NH={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=kH(n,r);s=ene(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,MH),Object.assign(r.style,NH),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=PH)}function d(){u(),c.request(l)}l();let f=qP(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}function jH(e=!0,t=null){Q(()=>{if(e)return IH.acquire(t)},[e,t])}var MH,NH,PH,FH,IH,LH=s((()=>{Aj(),JP(),SN(),SF(),eN(),ZM(),bF(),MH={},NH={},PH=``,FH=class{lockCount=0;restore=null;timeoutLock=XM.create();timeoutUnlock=XM.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=xF(e),n=t.documentElement,r=t.body,i=sj(n);if(AH(i,n,r)){let t=new i.MutationObserver(()=>{AH(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=cN||!$te(e);this.restore=a?tne(e):nne(e)}},IH=new FH}));function RH(e,t,n,r){let[i,a]=zH.useState(!1);Q(()=>{if(!e||!t||n==null){a(!1);return}let r=xF(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-BH)},[e,t,n]),jH(e&&(!t||i),r)}var zH,BH,VH=s((()=>{zH=d(m(),1),SF(),LH(),eN(),BH=20})),HH,UH,WH,rne=s((()=>{HH=d(m(),1),GV(),eN(),IB(),BB(),YV(),bH(),zV(),wH(),WP(),jL(),uz(),OH(),VH(),UH=d(O(),1),WH=HH.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=kL,..._}=e,v=LB(),y=IV(),b=GL(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=v.useState(`adaptiveOrigin`),M=HH.useRef(null),N=sz(O),P=hH({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:j}),F=x.useState(`domReferenceElement`);Q(()=>{let e=F,t=M.current;if(e&&(M.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return N(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[F,N,v]);let I=E===!0&&w!==`trigger-hover`;RH(C&&I,D===`touch`,O,T);let L=v.useStateSetter(`positionerElement`),R=DH(e,{open:C,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:k},{styles:P.positionerStyles,transitionStatus:A,props:_,refs:[t,L],hidden:!S,inert:!C});return(0,UH.jsxs)(JV.Provider,{value:P,children:[S&&I&&(0,UH.jsx)(CH,{inert:WV(!C),cutout:T}),(0,UH.jsx)(KL,{id:b,children:R})]})})})),GH,KH,qH,JH,YH,XH,ZH=s((()=>{XR(),GH=`ArrowUp`,KH=`ArrowDown`,qH=`ArrowLeft`,JH=`ArrowRight`,YH=`Home`,XH=new Set([GH,KH,qH,JH,YH,`End`])}));function QH(e){let t=$H.useContext(eU);if(t===void 0&&!e)throw Error(LI(69));return t}var $H,eU,tU=s((()=>{RI(),$H=d(m(),1),eU=$H.createContext(void 0)}));function nU(){let[e,t]=rU.useState(0),n=$(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:rU.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var rU,iU,aU=s((()=>{rU=d(m(),1),mF(),iU=rU.createContext(void 0)})),oU,sU,cU,lU=s((()=>{oU=d(m(),1),Aj(),IB(),BB(),YV(),lP(),pz(),TL(),WP(),ZH(),tU(),EH(),aU(),Uz(),sU=d(O(),1),cU=oU.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=LB(),l=KV(),u=QH(!0)!=null,{context:d,hasClosePart:f}=nU(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);dz({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),oB(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?mz(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=gL(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...Dz,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&XH.has(e.key)&&e.stopPropagation()}},TH(g),s],stateAttributesMapping:cP});return(0,sU.jsx)(sR,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:dj(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,sU.jsx)(iU.Provider,{value:d,children:M})})})})),uU=s((()=>{mV()}));function dU(e){let[t,n]=fU.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var fU,pU=s((()=>{fU=d(m(),1)})),mU=s((()=>{eV(),FV(),UV(),rne(),lU(),YV(),BB(),lP(),TL(),WP(),_V(),uU(),KP(),aU(),GV(),bF(),pU(),eN(),mF(),SF(),uz(),WM(),KA(),Aj(),fH(),$V(),oH(),qB(),jR()})),hU=s((()=>{mU()}));function gU(e){return{contextElement:e,getBoundingClientRect:()=>{let t=Jo(e);return{x:t.left,y:t.top,top:t.top,left:t.left,right:t.right,bottom:t.bottom,width:t.width,height:t.height,toJSON:()=>t}}}}function _U(){return{x:0,y:0,get width(){return Yo().width},get height(){return Yo().height}}}var vU=s((()=>{Qo()}));function yU(e){let t=bU.useContext(xU);if(t===void 0&&!e)throw Error(LI(33));return t}var bU,xU,SU=s((()=>{RI(),bU=d(m(),1),xU=bU.createContext(void 0)}));function CU(e){let t=wU.useContext(TU);if(t===void 0&&!e)throw Error(LI(36));return t}var wU,TU,EU=s((()=>{RI(),wU=d(m(),1),TU=wU.createContext(void 0)}));function DU(e=!0){let t=OU.useContext(kU);if(t===void 0&&!e)throw Error(LI(25));return t}var OU,kU,AU=s((()=>{RI(),OU=d(m(),1),kU=OU.createContext(void 0)}));function jU({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=MU.useRef(e!==void 0),[a,o]=MU.useState(t);return[i&&e!==void 0?e:a,MU.useCallback(e=>{i||o(e)},[])]}var MU,NU=s((()=>{MU=d(m(),1)}));function PU(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=DU(!0),f=d!==void 0;return FU.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:AP})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!dN&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&cV(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var FU,IU=s((()=>{FU=d(m(),1),SN(),WP(),AU(),lV()}));function LU(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=RU.useRef(null),{getButtonProps:d,buttonRef:f}=uV({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=PU({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=RU.useCallback(e=>$I(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=ZP(u,f);return RU.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var RU,zU,BU=s((()=>{RU=d(m(),1),rF(),uU(),hL(),IU(),zU={type:`regular-item`}}));function VU(){return HU.useContext(UU)}var HU,UU,WU=s((()=>{HU=d(m(),1),UU=HU.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}})}));function GU(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=VU(),u=KU.useRef(-1),[d,f]=KU.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=KU.useRef(null),h=KU.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Q(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var KU,qU=s((()=>{KU=d(m(),1),eN(),WU()})),JU,YU,XU=s((()=>{JU=d(m(),1),BU(),EU(),TL(),_V(),qU(),SU(),YU=JU.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=GU({guess:!0,label:a}),f=yU(!0),p=gV(i),{store:m}=CU(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=LU({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:zU});return gL(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})})})),ZU,QU,$U,eW=s((()=>{ZU=d(m(),1),IB(),EU(),SU(),TL(),lP(),pz(),KP(),WP(),tU(),ZH(),EH(),QU=d(O(),1),$U=ZU.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=CU(),{side:c,align:l}=yU(),u=QH(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`hoverEnabled`),w=s.useState(`disabled`),T=s.useState(`openMethod`),E=_.type===`context-menu`;dz({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),ZU.useEffect(()=>{function e(e){s.setOpen(!1,GP(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),oB(b,{enabled:C&&!w&&!E&&_.type!==`menubar`,closeDelay:S});let D=s.useStateSetter(`popupElement`),O=gL(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,D],stateAttributesMapping:cP,props:[p,{onKeyDown(e){u&&XH.has(e.key)&&e.stopPropagation()}},TH(f),o,{"data-rootownerid":y}]}),k=_.type===void 0||E;return(g||_.type===`menubar`&&v!==`outside-press`)&&(k=!0),(0,QU.jsx)(sR,{context:b,openInteractionType:T,modal:E,disabled:!m,returnFocus:a===void 0?k:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:O})})}));function tW(){let e=nW.useContext(rW);if(e===void 0)throw Error(LI(32));return e}var nW,rW,iW=s((()=>{RI(),nW=d(m(),1),rW=nW.createContext(void 0)})),aW,oW,sW,cW=s((()=>{aW=d(m(),1),IB(),EU(),iW(),oW=d(O(),1),sW=aW.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=CU();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,oW.jsx)(rW.Provider,{value:n,children:(0,oW.jsx)(zL,{ref:t,...r,portalOwnerRole:o})})})}));function lW(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=$(i),[,o]=gW.useState(!1),s=jM(dW).current,c=jM(uW).current,l=gW.useRef(0),u=gW.useRef(!0),d=gW.useRef(null),f=gW.useRef(null),p=$(()=>{u.current||(u.current=!0,o(e=>!e))}),m=$((e,t)=>{c.set(e,t),p()}),h=$(e=>{c.delete(e),p()}),g=$(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!mW(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&hW(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=pW(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=$(()=>{let[e,t]=fW(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Q(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Q(()=>{u.current&&v()}),Q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=$(e=>(s.add(e),()=>{s.delete(e)})),b=gW.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,_W.jsx)(UU.Provider,{value:b,children:t})}function uW(){return new Map}function dW(){return new Set}function fW(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>hW(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function pW(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function mW(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function hW(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var gW,_W,vW=s((()=>{gW=d(m(),1),PM(),mF(),eN(),WU(),_W=d(O(),1)})),yW,bW,xW,SW=s((()=>{yW=d(m(),1),GV(),eN(),ZM(),IB(),SU(),EU(),bH(),vW(),wH(),iW(),jL(),AU(),KP(),WP(),uz(),OH(),VH(),bW=d(O(),1),xW=yW.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=OL,style:g,..._}=e,{store:v}=CU(),y=tW(),b=DU(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`activeTriggerElement`),k=v.useState(`transitionStatus`),A=v.useState(`positionerElement`),j=v.useState(`instantType`),M=v.useState(`adaptiveOrigin`),N=v.useState(`lastOpenChangeReason`),P=v.useState(`floatingNodeId`),F=v.useState(`floatingParentNodeId`),I=S.useState(`domReferenceElement`),L=yW.useRef(null),R=sz(A),z=n,B=c,V=l,H=s,U=h;x.type===`context-menu`&&(z=n??x.context?.anchor,H??=`start`,!o&&H!==`center`&&(V=e.alignOffset??2,B=e.sideOffset??-5));let W=o,G=H;x.type===`menu`?(W??=`inline-end`,G??=`start`,U=e.collisionAvoidance??kL):x.type===`menubar`&&(W??=x.context.orientation===`vertical`?`inline-end`:`bottom`,G??=`start`);let ee=x.type===`context-menu`,te=hH({anchor:z,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:W,sideOffset:B,align:G,alignOffset:V,arrowPadding:ee?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:P,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:U,shift:ee?{crossAxis:!(`side`in U&&U.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:C,adaptiveOrigin:M});yW.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===P&&v.set(`hoverEnabled`,!1),e.nodeId!==P&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,GP(VP)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,P]),yW.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,GP(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let ne=JM();yW.useEffect(()=>{T||ne.clear()},[T,ne]),yW.useEffect(()=>{function e(e){if(T&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?ne.isStarted()||ne.start(e,()=>{v.setOpen(!1,GP(VP))}):v.setOpen(!1,GP(VP))}else ne.clear()}}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,O,v,ne]),yW.useEffect(()=>{let e={open:T,nodeId:P,parentNodeId:F,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,P,F]),Q(()=>{let e=I,t=L.current;if(e&&(L.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return R(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,R,v]);let K={open:T,side:te.side,align:te.align,anchorHidden:te.anchorHidden,nested:x.type===`menu`,instant:j},re=x.type===`menubar`&&x.context.modal;RH(T&&(re||E&&N!==`trigger-hover`),D===`touch`,A,O);let q=DH(e,K,{styles:te.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),ie=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&N!==`trigger-hover`||x.type===`menubar`&&x.context.modal),ae=null;return x.type===`menubar`?ae=x.context.contentElement:x.type===void 0&&(ae=O),(0,bW.jsxs)(xU.Provider,{value:te,children:[ie&&(0,bW.jsx)(CH,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:WV(!T),cutout:ae}),(0,bW.jsx)(KL,{id:P,children:(0,bW.jsx)(lW,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:q})})]})})}));function CW(e){let t=wW.useContext(TW);if(t===null&&!e)throw Error(LI(5));return t}var wW,TW,EW=s((()=>{RI(),wW=d(m(),1),TW=wW.createContext(null)}));function DW(e){return{positionerRef:kW.createRef(),popupRef:kW.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:kW.createRef(),beforeContentFocusGuardRef:kW.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function OW(e,t,n=!1,r){return{...jz(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new UL,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:UM,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var kW,AW,jW,MW=s((()=>{kW=d(m(),1),YR(),WM(),WL(),Uz(),AW={...Lz,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},jW=class extends KR{constructor(e,t,n=!1){let r=new kz,i=OW(r,t,n,e);super(i,DW(r),AW),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef}else e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null}}));function NW(){return PW.useContext(FW)}var PW,FW,IW=s((()=>{PW=d(m(),1),FW=PW.createContext(void 0)}));function LW(e,t,n){return jM(()=>new jW(e,t,n)).current}var RW,zW,BW,VW=s((()=>{RW=d(m(),1),ZM(),mF(),FI(),eN(),PM(),WM(),BM(),IB(),EU(),EW(),jL(),$V(),jV(),KP(),WP(),AU(),hL(),uz(),MW(),Uz(),IW(),zW=d(O(),1),BW=FM(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=DU(!0),_=CU(!0),v=CW(!0),y=NW(),b=RW.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=jI(),S=jI(),C=QL(),w=b.type===`menu`?b.store:void 0,T=(n??a)&&w?.state.transitionStatus===`starting`,E=jM(()=>T?w?.state.instantType:void 0).current,D=LW({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b,disabled:o,highlightItemOnHover:h,modal:b.type===void 0?s:void 0,rootId:x,instantType:E},S,C!=null);D.useControlledProp(`openProp`,n),D.useControlledProp(`triggerIdProp`,p),D.useContextCallback(`onOpenChangeComplete`,i);let O=D.useState(`floatingTreeRoot`),k=GL(O),A=D.useState(`open`),j=D.useState(`activeTriggerElement`),M=D.useState(`positionerElement`),N=D.useState(`hoverEnabled`),P=D.useState(`disabled`),F=D.useState(`lastOpenChangeReason`),I=D.useState(`parent`),L=D.useState(`activeIndex`),R=D.useState(`payload`),z=D.useState(`floatingParentNodeId`),B=RW.useRef(null),V=RW.useRef(I.type!==`context-menu`),H=JM(),U=RW.useRef(!0),W=JM(),G=z!=null,{openMethod:ee,triggerProps:te}=kV(A);D.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:I.type===void 0?s:void 0,openMethod:ee,rootId:x}),Sz(D);let{forceUnmount:ne,transitionStatus:K}=Cz(A,D,()=>{D.set(`allowMouseEnter`,!1)},T),re=sz(D.context.popupRef);RW.useEffect(()=>{if(E===void 0)return;let e=()=>{D.state.instantType===E&&D.set(`instantType`,void 0)};if(!A){e();return}if(K!==void 0)return;if(D.context.popupRef.current==null){e();return}let t=new AbortController;return re(e,t.signal),()=>{t.abort()}},[E,A,K,re,D]),Q(()=>{g&&!_?D.update({parent:{type:`context-menu`,context:g},floatingNodeId:k,floatingParentNodeId:C}):_&&D.update({floatingNodeId:k,floatingParentNodeId:C})},[g,_,k,C,D]),RW.useEffect(()=>{A||(B.current=null),I.type===`context-menu`&&(A?H.start(500,()=>{V.current=!0}):(H.clear(),V.current=!1))},[H,A,I.type]),Q(()=>{!A&&!N&&D.set(`hoverEnabled`,!0)},[A,N,D]);let q=$((e,t)=>{let n=t.reason;if(!e&&!D.select(`open`)||A===e&&t.trigger===j&&F===n)return;let i=bz(t);if(!e&&t.trigger==null&&(t.trigger=j??void 0),r?.(e,t),t.isCanceled)return;D.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!U.current)return;e&&n===`trigger-focus`?(U.current=!1,W.start(300,()=>{U.current=!0})):(U.current=!0,W.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);B.current=t.event;let c=yz(D.state,e,t.trigger,i());c.openChangeReason=n,c.instantType=I.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:o||s?o?`click`:`dismiss`:void 0,D.update(c)}),ie=ez({popupStore:D,floatingRootContext:D.state.floatingRootContext,floatingId:S,nested:C!=null,onOpenChange:q}),ae=ie.context.events;Q(()=>{let e=({open:e,eventDetails:t})=>q(e,t);return ae.on(`setOpen`,e),()=>{ae?.off(`setOpen`,e)}},[ae,q]);let oe=RW.useCallback(()=>{D.setOpen(!1,GP(HP))},[D]);RW.useImperativeHandle(u,()=>({unmount:ne,close:oe}),[ne,oe]);let se;I.type===`context-menu`&&(se=I.context),RW.useImperativeHandle(se?.positionerRef,()=>M,[M]),RW.useImperativeHandle(se?.actionsRef,()=>({setOpen:q}),[q]);let ce=mR(ie,{enabled:!P,bubbles:{escapeKey:d&&I.type===`menu`},outsidePress(){return I.type!==`context-menu`||B.current?.type===`contextmenu`||V.current},externalTree:G?O:void 0}),le=XV(),ue=RW.useCallback(e=>{D.select(`activeIndex`)!==e&&D.set(`activeIndex`,e)},[D]),de=bB(ie,{enabled:!P,listRef:D.context.itemDomElements,activeIndex:L,nested:I.type!==void 0,loopFocus:c,orientation:l,parentOrientation:I.type===`menubar`?I.context.orientation:void 0,rtl:le===`rtl`,disabledIndices:HM,onNavigate:ue,openOnArrowKeyDown:I.type!==`context-menu`,externalTree:G?O:void 0,focusItemOnHover:h}),fe=RW.useCallback(e=>{D.context.typingRef.current=e},[D]),pe=wB(ie,{enabled:!P,listRef:D.context.itemLabels,elementsRef:D.context.itemDomElements,activeIndex:L,resetMs:500,onMatch:e=>{A&&e!==L&&D.set(`activeIndex`,e)},onTyping:fe}),me=RW.useMemo(()=>{let e=$I(pe.reference,de.reference,ce.reference,{onMouseMove(){D.set(`allowMouseEnter`,!0)}},te);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=A,e},[D,pe.reference,de.reference,ce.reference,te,A]),J=RW.useMemo(()=>{let e=$I(de.trigger,ce.trigger,te);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[de.trigger,ce.trigger,te]);jM(()=>(D.update({inactiveTriggerProps:J}),null)),wz(D,{floatingRootContext:ie,activeTriggerProps:me,inactiveTriggerProps:J,popupProps:RW.useMemo(()=>$I(Dz,{id:S,role:`menu`,"aria-orientation":l===`horizontal`?`horizontal`:void 0,"aria-labelledby":j?.id,onMouseMove(){D.set(`allowMouseEnter`,!0),I.type===`menu`&&D.set(`hoverEnabled`,!1)},onClick(){D.select(`hoverEnabled`)&&D.set(`hoverEnabled`,!1)},onKeyDown(e){let t=D.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},pe.floating,de.floating,ce.floating),[j,S,l,I.type,D,pe.floating,de.floating,ce.floating]),itemProps:de.item??UM});let he=RW.useMemo(()=>({store:D,parent:b}),[D,b]),ge=(0,zW.jsxs)(TU.Provider,{value:he,children:[f&&(0,zW.jsx)(gz,{handle:f,store:D}),typeof t==`function`?t({payload:R}):t]});return I.type===void 0||I.type===`context-menu`?(0,zW.jsx)(qL,{externalTree:O,children:ge}):ge})}));function HW(e,t){let n=UW(t);return e.clientX>=n.left-WW&&e.clientX<=n.right+WW&&e.clientY>=n.top-WW&&e.clientY<=n.bottom+WW}function UW(e){let t=e.getBoundingClientRect(),n=sj(e);if(yN)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var WW,GW=s((()=>{SF(),SN(),WW=5}));function KW(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=tV(),{ref:i,index:a}=GU(e),o=n===a,s=qW.useRef(null),c=ZP(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}var qW,JW=s((()=>{qW=d(m(),1),rF(),iV(),qU()}));function YW(e){let{render:t,className:n,style:r,state:i=UM,props:a=HM,refs:o=HM,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=KW({metadata:s});return gL(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}var XW=s((()=>{WM(),TL(),JW()}));function ZW(e){if(dj(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!yj(e))return ZW(Sj(e))}var QW=s((()=>{Aj()}));function $W(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=eG.useRef(!1);return eG.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,xF(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:UM,[t,n,r])}var eG,tG=s((()=>{eG=d(m(),1),SF(),WM()}));function nG(e,t){let n=JM(),[r,i]=iG.useState(!1);return Q(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function rG(){let e=CW(!0);return iG.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var iG,aG,oG,sG=s((()=>{RI(),iG=d(m(),1),ZM(),SF(),BM(),mF(),eN(),WM(),IB(),WL(),XR(),EU(),lP(),TL(),mV(),GW(),XW(),iV(),QW(),Uz(),xV(),_V(),WP(),tG(),EW(),jL(),AF(),hL(),aG=d(O(),1),oG=IM(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=CU(!0),h=zz(d)??m?.store;if(!h)throw Error(LI(85));let g=gV(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=iG.useRef(null),S=rG(),C=tV(!0),w=$L(),T=iG.useMemo(()=>w??new UL,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=xz(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:GL(T),floatingParentNodeId:QL(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=uV({disabled:A,native:o});iG.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=iG.useRef(null),P=JM(),F=$(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;AN(N.current,t)||AN(h.select(`positionerElement`),t)||t===N.current||t!=null&&ZW(t)===h.select(`rootId`)||HW(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:BP})});iG.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&xF(N.current).addEventListener(`mouseup`,F,{once:!0})},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,L=lB(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:jB({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=nG(y,h.select(`lastOpenChangeReason`)),z=fR(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&R}),B=Xz(v,{enabled:!A&&I}),V=$W({open:y,enabled:O,mouseDownAction:`open`}),H=iG.useMemo(()=>$I(B.reference,z.reference),[B.reference,z.reference]),U=h.useState(`triggerProps`,D),{preFocusGuardRef:W,handlePreFocusGuardFocus:G,handleFocusTargetFocus:ee}=vV(h,x),te={disabled:A,open:y},ne=[N,t,M,E,x],K=[H,L??UM,U,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),xF(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},O?{role:`menuitem`}:{},V,p,j],re=gL(`button`,e,{enabled:!O,stateAttributesMapping:oP,state:te,ref:ne,props:K});return O?(0,aG.jsx)(YW,{tag:`button`,render:n,className:r,style:i,state:te,refs:ne,props:K,stateAttributesMapping:oP}):y?(0,aG.jsxs)(iG.Fragment,{children:[(0,aG.jsx)(kF,{ref:W,onFocus:G},`${g}-pre-focus-guard`),(0,aG.jsx)(iG.Fragment,{children:re},g),(0,aG.jsx)(kF,{ref:h.context.triggerFocusTargetRef,onFocus:ee},`${g}-post-focus-guard`)]}):(0,aG.jsx)(iG.Fragment,{children:re},g)})}));function cG(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var lG=s((()=>{})),uG=s((()=>{SU(),EU(),TL(),lP(),AU(),WP(),NU(),WM(),RI(),BU(),qU(),_V(),KN(),KP(),az(),pz(),eN(),XU(),IU(),uU(),hL(),eW(),cW(),SW(),mF(),VW(),IW(),sG(),GV(),bF(),pU(),SF(),uz(),KA(),Aj(),fH(),$V(),oH(),lF(),SN(),IB(),Uz(),MW(),jR()})),dG=s((()=>{uG()})),fG,pG,mG=s((()=>{m(),fG=()=>void 0,pG=()=>fG()}));function hG({intent:e=`secondary`,size:t=`default`,block:n=!1,className:r=``}={}){return[`btn`,vG[e],t==="default"?``:`btn-${t}`,n?`btn-block`:``,r].filter(Boolean).join(` `)}function gG({intent:e=`secondary`,size:t=`default`,busy:n=!1,busyLabel:r,block:i=!1,type:a=`button`,className:o,onClick:s,children:c,ref:l,...u}){let d=e=>{n?e.preventDefault():s?.(e)};return(0,_G.jsx)(`button`,{...u,ref:l,type:a,className:hG({intent:e,size:t,block:i,className:o}),"aria-disabled":n||u[`aria-disabled`]||void 0,"data-busy":n||void 0,onClick:d,children:n&&r!==void 0?r:c})}var _G,vG,yG=s((()=>{_G=d(O(),1),vG={primary:`primary btn-primary`,secondary:`ghost btn-secondary`,quiet:`btn-quiet`,danger:`danger btn-danger`}}));function bG({className:e,triggerClassName:t=hG(),triggerTitle:n,triggerLabel:r,label:i,popupClassName:a=`dd-list`,side:o=`bottom`,align:s=`end`,sideOffset:c=4,open:l,onOpenChange:u,finalFocus:d,children:f}){let p=(0,SG.useRef)(null),[m,h]=(0,SG.useState)(null);(0,SG.useEffect)(()=>{h(p.current?.closest(`dialog, [role="dialog"]`))},[]);let[g,_]=(0,SG.useState)(!1),v=l??g;return(0,CG.jsx)(`div`,{className:e||void 0,children:(0,CG.jsxs)(BW,{open:v,onOpenChange:(e,t)=>{!e&&t.reason===`escape-key`&&d===void 0&&p.current?.focus({preventScroll:!0}),_(e),u?.(e)},children:[(0,CG.jsx)(oG,{render:(0,CG.jsx)(`button`,{type:`button`,className:t,title:n,"aria-label":r,ref:p}),children:i}),(0,CG.jsx)(sW,{container:m??pG(),children:(0,CG.jsx)(xW,{anchor:()=>p.current?gU(p.current):null,positionMethod:`fixed`,side:o,align:s,sideOffset:c,collisionBoundary:_U(),collisionPadding:8,style:{zIndex:90},children:(0,CG.jsx)($U,{className:a,finalFocus:d,children:f})})})]})})}function xG({className:e=`dd-option`,disabled:t,closeOnClick:n,onClick:r,title:i,children:a,ref:o}){return(0,CG.jsx)(YU,{render:(0,CG.jsx)(`button`,{type:`button`,className:e,title:i,ref:o}),nativeButton:!0,disabled:t,closeOnClick:n,onClick:r,children:a})}var SG,CG,wG=s((()=>{SG=d(m(),1),dG(),vU(),mG(),yG(),CG=d(O(),1)})),TG,EG=s((()=>{ba(),TG=pa({formatting:`Formatting for {label}`,bold:`Bold`,boldMark:`B`,italicMark:`I`,strikeMark:`S`,italic:`Italic`,strike:`Strikethrough`,textStyle:`Text style`,paragraph:`Paragraph`,heading:`Heading {level}`,quote:`Quote`,codeBlock:`Code block`,inlineCode:`Code`,bulletList:`Bulleted list`,orderedList:`Numbered list`,taskList:`Checklist`,link:`Link`,linkAddress:`Link address`,linkPlaceholder:`https://`,linkApply:`Apply`,linkRemove:`Remove link`,linkInvalid:`A link is a web address (https://…) or mailto:.`,table:`Table`,tableInsert:`Insert table`,tableRowAfter:`Add row below`,tableColumnAfter:`Add column right`,tableRowDelete:`Delete row`,tableColumnDelete:`Delete column`,tableDelete:`Delete table`,picture:`Add picture`,pictureAdding:`Adding picture…`,noPeople:`No one by that name`,people:`People`,group:`Team`})})),DG=s((()=>{})),OG=l({RichTextEditor:()=>NG,cleanPastedHtml:()=>kG});function kG(e){return e.replace(/<!--\[if[\s\S]*?<!\[endif\]-->/gi,``).replace(/<!--[\s\S]*?-->/g,``).replace(/<\/?(?:o|w|m|v):[^>]*>/gi,``).replace(/<(style|xml|title)\b[\s\S]*?<\/\1\s*>/gi,``).replace(/<(?:meta|link)\b[^>]*>/gi,``).replace(/<b\b[^>]*id="docs-internal-guid[^"]*"[^>]*>([\s\S]*)<\/b>/i,`$1`)}function AG(e){let t=e.getHTML().replace(/(?:<p><\/p>)+$/,``);return yr(t)||/<img\b/i.test(t)?t:``}function jG(e){let t=(0,FG.useRef)(e);return t.current=e,t}function MG({label:e,active:t,disabled:n,onClick:r,children:i}){return(0,IG.jsx)(`button`,{type:`button`,className:`rich-tool${t?` is-active`:``}`,title:e,"aria-label":e,"aria-pressed":t,disabled:n,onMouseDown:e=>e.preventDefault(),onClick:r,children:i})}function NG({id:e,value:t,onChange:n,label:r,describedBy:i,invalid:a,disabled:o=!1,autoFocus:s,placeholder:c,mentions:l,pictures:u,onKey:d,onProblem:f,onPopupChange:p}){let[m,h]=(0,FG.useState)(),[g,_]=(0,FG.useState)(),[v,y]=(0,FG.useState)(!1),[b,x]=(0,FG.useState)(0),S=jG({onChange:n,mentions:l,pictures:u,onKey:d,onProblem:f,suggesting:m}),C=(0,FG.useRef)({query:``,count:1}),w=(0,FG.useRef)(null),T=(0,FG.useRef)(null),E=(0,FG.useRef)({html:``,edited:!1}),D=(e,t,n)=>{let r=S.current.pictures,i=t.filter(e=>e.type.startsWith(`image/`));if(!r||!i.length)return!1;for(let t of i)x(e=>e+1),r(t).then(r=>{let i=e.chain().focus();(n===void 0?i:i.setTextSelection(n)).setImage({src:r,alt:t.name}).run()}).catch(e=>S.current.onProblem?.(e.message)).finally(()=>x(e=>e-1));return!0},O=FS({immediatelyRender:!0,shouldRerenderOnTransaction:!0,editable:!o,autofocus:s?`end`:!1,content:t||``,extensions:[mO.configure({heading:{levels:[2,3,4]},horizontalRule:!1,link:{openOnClick:!1,autolink:!0,defaultProtocol:`https`,protocols:[`mailto`],isAllowedUri:e=>gr(e)!==void 0,HTMLAttributes:{rel:`noopener noreferrer`,target:`_blank`}}}),pD,fD.configure({nested:!0}),_A.configure({resizable:!1}),pA,fA,dA,AM.configure({inline:!1,allowBase64:!1}),...c?[lO.configure({placeholder:c})]:[],...l?[DM.extend({addAttributes(){return{...this.parent?.(),kind:{default:null,parseHTML:e=>e.getAttribute(`data-kind`)===`group`?`group`:null,renderHTML:()=>({})},label:{default:null,parseHTML:e=>(e.textContent??``).replace(/^@/,``)||null,renderHTML:()=>({})}}}}).configure({renderText:({node:e})=>`@${e.attrs.label??e.attrs.id}`,renderHTML:({node:e})=>[`span`,{"data-type":`mention`,"data-id":e.attrs.id,...e.attrs.kind===`group`?{"data-kind":`group`}:{}},`@${e.attrs.label??e.attrs.id}`],suggestion:{allowSpaces:!0,allow:({state:e,range:t})=>{if(!e.doc.resolve(t.from).parent.type.contentMatch.matchType(e.schema.nodes.mention))return!1;let n=e.doc.textBetween(t.from+1,t.to);if(!/\s/.test(n))return!0;if(/^\s|\s\s/.test(n)||n.trim().split(/\s+/).length+ +!!/\s$/.test(n)>2)return!1;let r=C.current;return r.count>0||!n.startsWith(r.query)},items:async({query:e})=>{try{return(await S.current.mentions?.(e)??[]).slice(0,8)}catch{return[]}},render:()=>{let e=e=>{if(e.loading||(C.current={query:e.query,count:e.items.length}),!e.loading&&!e.items.length&&/\s/.test(e.query))return h(void 0);h(t=>({items:e.items,index:t&&t.items===e.items?t.index:0,box:()=>e.clientRect?.()??null,pick:t=>e.command({id:t.id,label:t.label,kind:t.kind??null})}))};return{onStart:e,onUpdate:e,onExit:()=>h(void 0),onKeyDown:({event:e})=>{let t=S.current.suggesting;if(!t||!t.items.length)return e.key===`Escape`&&(h(void 0),!0);if(e.key===`ArrowDown`||e.key===`ArrowUp`){let n=e.key===`ArrowDown`?1:-1;return h({...t,index:(t.index+n+t.items.length)%t.items.length}),!0}return e.key===`Enter`||e.key===`Tab`?(t.pick(t.items[t.index]),!0):e.key===`Escape`&&(h(void 0),!0)}}}}})]:[]],editorProps:{attributes:{class:`rich-text rich-text-editable`,role:`textbox`,"aria-multiline":`true`,"aria-label":r,...e?{id:e}:{},...i?{"aria-describedby":i}:{},...a?{"aria-invalid":`true`}:{}},transformPastedHTML:kG,handleKeyDown:(e,t)=>S.current.onKey?.(t)??!1,handlePaste:(e,t)=>{let n=[...t.clipboardData?.files??[]];return n.length>0&&T.current?D(T.current,n):!1},handleDrop:(e,t)=>{let n=[...t.dataTransfer?.files??[]];if(!n.length||!T.current)return!1;let r=e.posAtCoords({left:t.clientX,top:t.clientY})?.pos;return D(T.current,n,r)}},onCreate:({editor:e})=>{E.current={html:AG(e),edited:!1}},onUpdate:({editor:e})=>{let t=AG(e);(E.current.edited||t!==E.current.html)&&(E.current.edited=!0,S.current.onChange(t))}});T.current=O;let k=!!m;if((0,FG.useEffect)(()=>{p?.(k)},[k]),(0,FG.useEffect)(()=>{O&&t!==AG(O)&&(O.commands.setContent(t||``,{emitUpdate:!1}),E.current={html:AG(O),edited:!1})},[O,t]),(0,FG.useEffect)(()=>{O?.setEditable(!o)},[O,o]),!O)return null;let A=e=>()=>e(O.chain().focus()).run(),j=O.isActive(`heading`,{level:2})?TG(`heading`,{level:2}):O.isActive(`heading`,{level:3})?TG(`heading`,{level:3}):O.isActive(`heading`,{level:4})?TG(`heading`,{level:4}):O.isActive(`codeBlock`)?TG(`codeBlock`):TG(`paragraph`),M=O.isActive(`table`),N=()=>{let e=(g??``).trim();e?gr(e)?(O.chain().focus().extendMarkRange(`link`).setLink({href:e}).run(),_(void 0)):y(!0):(O.chain().focus().extendMarkRange(`link`).unsetLink().run(),_(void 0))},P=()=>{y(!1),_(O.getAttributes(`link`).href??``)};return(0,IG.jsxs)(`div`,{className:`rich-editor${a?` is-invalid`:``}${o?` is-disabled`:``}`,children:[(0,IG.jsxs)(`div`,{className:`rich-toolbar`,role:`toolbar`,"aria-label":TG(`formatting`,{label:r}),children:[(0,IG.jsx)(MG,{label:TG(`bold`),active:O.isActive(`bold`),disabled:o,onClick:A(e=>e.toggleBold()),children:(0,IG.jsx)(`strong`,{children:TG(`boldMark`)})}),(0,IG.jsx)(MG,{label:TG(`italic`),active:O.isActive(`italic`),disabled:o,onClick:A(e=>e.toggleItalic()),children:(0,IG.jsx)(`em`,{children:TG(`italicMark`)})}),(0,IG.jsx)(MG,{label:TG(`strike`),active:O.isActive(`strike`),disabled:o,onClick:A(e=>e.toggleStrike()),children:(0,IG.jsx)(`s`,{children:TG(`strikeMark`)})}),(0,IG.jsx)(`span`,{className:`rich-tool-gap`,"aria-hidden":`true`}),(0,IG.jsxs)(bG,{className:`rich-tool-menu`,triggerClassName:`rich-tool rich-tool-wide`,triggerTitle:TG(`textStyle`),triggerLabel:`${TG(`textStyle`)}: ${j}`,label:(0,IG.jsxs)(IG.Fragment,{children:[j,(0,IG.jsx)(`span`,{className:`rich-tool-caret`,"aria-hidden":`true`,children:`▾`})]}),popupClassName:`page-actions-popup rich-menu`,align:`start`,children:[(0,IG.jsx)(xG,{className:`page-actions-item`,onClick:A(e=>e.setParagraph()),children:TG(`paragraph`)}),[2,3,4].map(e=>(0,IG.jsx)(xG,{className:`page-actions-item rich-menu-h${e}`,onClick:A(t=>t.setHeading({level:e})),children:TG(`heading`,{level:e})},e)),(0,IG.jsx)(xG,{className:`page-actions-item`,onClick:A(e=>e.toggleBlockquote()),children:TG(`quote`)}),(0,IG.jsx)(xG,{className:`page-actions-item`,onClick:A(e=>e.toggleCodeBlock()),children:TG(`codeBlock`)})]}),(0,IG.jsx)(`span`,{className:`rich-tool-gap`,"aria-hidden":`true`}),(0,IG.jsx)(MG,{label:TG(`bulletList`),active:O.isActive(`bulletList`),disabled:o,onClick:A(e=>e.toggleBulletList()),children:`•≡`}),(0,IG.jsx)(MG,{label:TG(`orderedList`),active:O.isActive(`orderedList`),disabled:o,onClick:A(e=>e.toggleOrderedList()),children:`1≡`}),(0,IG.jsx)(MG,{label:TG(`taskList`),active:O.isActive(`taskList`),disabled:o,onClick:A(e=>e.toggleTaskList()),children:`☑`}),(0,IG.jsx)(`span`,{className:`rich-tool-gap`,"aria-hidden":`true`}),(0,IG.jsx)(MG,{label:TG(`link`),active:O.isActive(`link`),disabled:o,onClick:P,children:`↗`}),(0,IG.jsx)(MG,{label:TG(`inlineCode`),active:O.isActive(`code`),disabled:o,onClick:A(e=>e.toggleCode()),children:`</>`}),(0,IG.jsxs)(bG,{className:`rich-tool-menu`,triggerClassName:`rich-tool`,triggerTitle:TG(`table`),triggerLabel:TG(`table`),label:`⊞`,popupClassName:`page-actions-popup rich-menu`,align:`start`,children:[(0,IG.jsx)(xG,{className:`page-actions-item`,disabled:M,onClick:A(e=>e.insertTable({rows:3,cols:3,withHeaderRow:!0})),children:TG(`tableInsert`)}),(0,IG.jsx)(xG,{className:`page-actions-item`,disabled:!M,onClick:A(e=>e.addRowAfter()),children:TG(`tableRowAfter`)}),(0,IG.jsx)(xG,{className:`page-actions-item`,disabled:!M,onClick:A(e=>e.addColumnAfter()),children:TG(`tableColumnAfter`)}),(0,IG.jsx)(xG,{className:`page-actions-item`,disabled:!M,onClick:A(e=>e.deleteRow()),children:TG(`tableRowDelete`)}),(0,IG.jsx)(xG,{className:`page-actions-item`,disabled:!M,onClick:A(e=>e.deleteColumn()),children:TG(`tableColumnDelete`)}),(0,IG.jsx)(xG,{className:`page-actions-item`,disabled:!M,onClick:A(e=>e.deleteTable()),children:TG(`tableDelete`)})]}),u&&(0,IG.jsxs)(IG.Fragment,{children:[(0,IG.jsx)(MG,{label:TG(b?`pictureAdding`:`picture`),disabled:o,onClick:()=>w.current?.click(),children:`▣`}),(0,IG.jsx)(`input`,{ref:w,type:`file`,accept:`image/*`,hidden:!0,onChange:e=>{let t=[...e.target.files??[]];e.target.value=``,D(O,t)}})]})]}),g!==void 0&&(0,IG.jsxs)(`div`,{className:`rich-link-bar`,children:[(0,IG.jsx)(`input`,{className:`field-control`,type:`url`,autoFocus:!0,"aria-label":TG(`linkAddress`),"aria-invalid":v||void 0,placeholder:TG(`linkPlaceholder`),value:g,onChange:e=>{_(e.target.value),y(!1)},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),N()):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),_(void 0),O.commands.focus())}}),(0,IG.jsx)(`button`,{type:`button`,className:`rich-tool rich-tool-wide`,onClick:N,children:TG(`linkApply`)}),O.isActive(`link`)&&(0,IG.jsx)(`button`,{type:`button`,className:`rich-tool rich-tool-wide`,onClick:()=>{O.chain().focus().extendMarkRange(`link`).unsetLink().run(),_(void 0)},children:TG(`linkRemove`)}),v&&(0,IG.jsx)(`span`,{className:`insert-missing`,role:`alert`,children:TG(`linkInvalid`)})]}),(0,IG.jsx)(JS,{editor:O,className:`rich-editor-body`,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),P())}}),m&&(0,IG.jsx)(PG,{suggesting:m,onPick:e=>m.pick(e)})]})}function PG({suggesting:e,onPick:t}){return(0,IG.jsx)(JB,{open:!0,modal:!1,children:(0,IG.jsx)(HV,{container:ia(),children:(0,IG.jsx)(WH,{anchor:{getBoundingClientRect:()=>{let t=e.box(),n=qo(),r=(t?.top??0)/n,i=(t?.left??0)/n,a=(t?.width??0)/n,o=(t?.height??0)/n;return{x:i,y:r,top:r,left:i,width:a,height:o,right:i+a,bottom:r+o,toJSON:()=>({})}}},positionMethod:`fixed`,side:`bottom`,align:`start`,sideOffset:4,collisionBoundary:_U(),collisionPadding:8,style:{zIndex:95},children:(0,IG.jsx)(cU,{className:`rich-mentions`,initialFocus:!1,finalFocus:!1,children:(0,IG.jsx)(`div`,{role:`listbox`,"aria-label":TG(`people`),children:e.items.length?e.items.map((n,r)=>(0,IG.jsxs)(`div`,{role:`option`,"aria-selected":r===e.index,className:`rich-mention-option${r===e.index?` is-active`:``}`,onMouseDown:e=>{e.preventDefault(),t(n)},children:[(0,IG.jsx)(`span`,{children:n.label}),n.kind===`group`?(0,IG.jsx)(`span`,{className:`rich-mention-kind`,children:TG(`group`)}):n.handle&&(0,IG.jsxs)(`span`,{className:`rich-mention-handle`,children:[`@`,n.handle]})]},`${n.kind??`person`}:${n.id}`)):(0,IG.jsx)(`div`,{className:`rich-mention-none`,children:TG(`noPeople`)})})})})})})}var FG,IG,LG=s((()=>{FG=d(m()),aC(),hO(),mD(),vA(),Ate(),jte(),fO(),hU(),Dr(),Es(),vU(),wG(),EG(),DG(),sa(),IG=d(O())}));function RG(e,t){let n=e.labelColumn??e.by,r=e=>e==null?``:String(e);if(!nt(n))return r(t[n]);let i=Ye(n);return`problem`in i?``:i.parts.map(e=>`text`in e?e.text:[e.path,...(e.or??[]).map(e=>e.path)].map(e=>r(t[e])).find(Boolean)??``).join(``).replace(/\s+/g,` `).trim()}function zG(e,t,n,r=[]){let i=Or(e.labelColumn??e.by),a=`problem`in i?[e.by]:i.columns,o=e=>n?.find(t=>t.name===e),s=[...new Set([...a,e.by])].filter(e=>BG(o(e))),c=t.trim().split(/\s+/).filter(Boolean).slice(0,s.length>4?1:VG),l=s.length?c.map(e=>`(${s.flatMap(t=>[`${t} startswith ${pn(e)}`,`${t} contains ${pn(` ${e}`)}`]).join(` or `)})`):[];return[e.from,l.join(` and `),`show ${[...new Set([e.by,...a,...r])].join(`, `)}`,`sort ${a.join(`, `)}`].filter(Boolean).join(` `)}var BG,VG,HG=s((()=>{St(),Yn(),ot(),kr(),Dr(),BG=e=>!e?.type||ht(e.type)===`text`&&!/uuid|json/i.test(e.type),VG=2})),UG=l({mentionRows:()=>KG});function WG(e){if(!e.through)return;let t=bs(e.from),n=(xs(e.through)??[]).find(e=>e.to.table===t?.id&&e.from.columns.length===1);return n&&{column:n.from.columns[0],team:n.to.columns[0]}}async function GG(e,t,n){let r=WG(e);if(!r)return t;let i=[...new Set(t.map(e=>e[r.team]).filter(e=>typeof e==`string`||typeof e==`number`))];if(!i.length)return[];let a=`${e.through} ${r.column} in (${i.map(pn).join(`, `)}) show ${r.column}`,o=await rs(`/api/run`,{...Aa(n??null),q:a,limit:500,offset:0,count:`none`}),s=new Set((o.rows??[]).map(e=>String(e[r.column])));return t.filter(e=>s.has(String(e[r.team])))}async function KG(e,t,n,r){let i=bs(e.from),a=r===`group`?WG(e):void 0,o=zG(e,t,i?.columns,a?[a.team]:[]),s=await rs(`/api/run`,{...Aa(n??null),q:o,limit:a?24:8,offset:0,count:`none`});return(a?(await GG(e,s.rows??[],n)).slice(0,8):s.rows??[]).flatMap(t=>{let n=t[e.by],i=typeof n==`string`&&Sr.test(n)?n:typeof n==`number`&&Number.isSafeInteger(n)?String(n):void 0;if(i===void 0)return[];let a=RG(e,t)||i;return[{id:i,label:a,...r||!qG(e,i,a)?{}:{handle:i},...r?{kind:r}:{}}]})}function qG(e,t,n){return!bs(e.from)?.columns?.some(t=>t.name===e.by&&t.primaryKey)&&t!==n&&!/^\d+$/.test(t)&&!JG.test(t)&&!t.includes(`@`)}var JG,YG=s((()=>{Es(),Fa(),Dr(),HG(),Yn(),JG=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i})),XG,ZG,QG,$G,eK,tK=s((()=>{XG=d(m(),1),ZG=d(O(),1),QG=XG.createContext(void 0),$G=e=>{let t=XG.useContext(QG);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},eK=({client:e,children:t})=>(XG.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,ZG.jsx)(QG.Provider,{value:e,children:t}))}));function nK(e){setTimeout(e,0)}var rK,iK,aK,oK=s((()=>{rK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},iK=class{#e=rK;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},aK=new iK}));function sK(){}function cK(e,t){return typeof e==`function`?e(t):e}function lK(e){return typeof e==`number`&&e>=0&&e!==1/0}function uK(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dK(e,t){return typeof e==`function`?e(t):e}function fK(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==mK(o,t.options))return!1}else if(!gK(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function pK(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(hK(t.options.mutationKey)!==hK(a))return!1}else if(!gK(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function mK(e,t){return(t?.queryKeyHashFn||hK)(e)}function hK(e){return JSON.stringify(e,(e,t)=>bK(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function gK(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!gK(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!gK(e[r],t[r]))return!1;return!0}return!1}function _K(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=yK(e)&&yK(t);if(!r&&!(bK(e)&&bK(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:AK.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=_K(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function vK(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function yK(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bK(e){if(!xK(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!xK(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function xK(e){return Object.prototype.toString.call(e)===`[object Object]`}function SK(e){return new Promise(t=>{aK.setTimeout(t,e)})}function CK(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:_K(e,t)}function wK(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function TK(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}function EK(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===jK?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function DK(e,t){return typeof e==`function`?e(...t):!!e}function OK(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var kK,AK,jK,MK=s((()=>{oK(),kK=typeof window>`u`||`Deno`in globalThis,AK=Object.prototype.hasOwnProperty,jK=Symbol()})),NK,PK,FK=s((()=>{MK(),NK=()=>kK,PK=()=>NK()})),IK,LK=s((()=>{IK=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}})),RK,zK,BK=s((()=>{LK(),RK=class extends IK{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},zK=new RK}));function VK(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=HK,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var HK,UK,WK=s((()=>{oK(),HK=nK,UK=VK()})),GK,KK,qK=s((()=>{LK(),GK=class extends IK{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}},KK=new GK}));function JK(e){return Math.min(1e3*2**e,3e4)}function YK(e){return(e??`online`)!==`online`||KK.isOnline()}function XK(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(sK);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new ZK(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>zK.isFocused()&&(e.networkMode===`always`||KK.isOnline())&&e.canRun(),p=()=>YK(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(PK()?0:3),a=e.retryDelay??JK,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),SK(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var ZK,QK=s((()=>{MK(),FK(),BK(),qK(),ZK=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}}})),$K,eq=s((()=>{oK(),MK(),FK(),$K=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lK(this.gcTime)&&(this.#e=aK.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(PK()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(aK.clearTimeout(this.#e),this.#e=void 0)}}}));function tq(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{OK(e,()=>t.signal,()=>n=!0)},u=EK(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?TK:wK;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?rq:nq,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:nq(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function nq(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function rq(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var iq=s((()=>{MK()}));function aq(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:YK(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function oq(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function sq(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var cq,lq=s((()=>{MK(),WK(),QK(),eq(),iq(),cq=class extends $K{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=sq(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=sq(this.options);e.data!==void 0&&(this.setState(oq(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=CK(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(sK).catch(sK):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>dK(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jK||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>dK(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!uK(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=EK(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?tq(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=XK({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ZK&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ZK){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...aq(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...oq(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),UK.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}}}));function uq(e,t){return dK(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||dK(t.retryOnMount,e)!==!1)}function dq(e,t){return uq(e,t)||e.state.data!==void 0&&fq(e,t,t.refetchOnMount)}function fq(e,t,n){if(dK(t.enabled,e)!==!1&&dK(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&mq(e,t)}return!1}function pq(e,t,n,r){return(e!==t||dK(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&mq(e,n)}function mq(e,t){return dK(t.enabled,e)!==!1&&e.isStaleByTime(dK(t.staleTime,e))}var hq,gq=s((()=>{oK(),MK(),FK(),LK(),BK(),WK(),lq(),hq=class extends IK{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),dq(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fq(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fq(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof dK(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!vK(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&pq(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||dK(this.options.enabled,this.#t)!==dK(t.enabled,this.#t)||dK(this.options.staleTime,this.#t)!==dK(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||dK(this.options.enabled,this.#t)!==dK(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return vK(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(sK)),t}#h(e){return!PK()&&dK(this.options.enabled,this.#t)!==!1&&lK(e)}#g(){this.#b();let e=dK(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=uK(this.#r.dataUpdatedAt,e)+1;this.#u=aK.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=aK.setInterval(()=>{(this.options.refetchIntervalInBackground||zK.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(aK.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(aK.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&dq(e,t),o=i&&pq(e,n,t,r);(a||o)&&(l={...l,...aq(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=CK(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=CK(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:mq(e,t),refetch:this.refetch,isEnabled:dK(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),vK(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();UK.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}}}));function _q(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var vq,yq=s((()=>{WK(),QK(),eq(),vq=class extends $K{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||_q(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=XK({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),UK.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}}}));function bq(e){return e.options.scope?.id}var xq,Sq=s((()=>{MK(),LK(),WK(),yq(),xq=class extends IK{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new vq({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=bq(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=bq(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=bq(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=bq(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){UK.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>pK(t,e))}findAll(e={}){return this.getAll().filter(t=>pK(e,t))}notify(e){UK.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return UK.batch(()=>Promise.all(e.map(e=>e.continue().catch(sK))))}}}));function Cq(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var wq,Tq=s((()=>{MK(),LK(),WK(),gq(),wq=class extends IK{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,UK.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!vK(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Cq(e,n).forEach(e=>{e.destroy()}),Cq(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=_K(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new hq(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&UK.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}}})),Eq,Dq=s((()=>{MK(),LK(),WK(),lq(),Eq=class extends IK{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??mK(r,t),a=this.get(i);return a||(a=new cq({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){UK.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>fK(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>fK(e,t)):t}notify(e){UK.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){UK.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){UK.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}}})),Oq,kq=s((()=>{MK(),BK(),WK(),qK(),Sq(),Dq(),Oq=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Eq,this.#t=e.mutationCache||new xq,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=zK.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=KK.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(dK(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=cK(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return UK.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;UK.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return UK.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=UK.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(sK).catch(sK)}invalidateQueries(e,t={}){return UK.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=UK.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(sK)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(sK)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(dK(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(dK(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(sK).catch(sK)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(sK).catch(sK)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return KK.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(hK(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{gK(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(hK(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{gK(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=mK(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===jK&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}}})),Aq=s((()=>{MK(),WK(),gq(),Tq(),Dq(),kq()})),jq,Mq,Nq,Pq=s((()=>{jq=d(m(),1),Mq=jq.createContext(!1),Nq=()=>jq.useContext(Mq),Mq.Provider}));function Fq(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Iq,Lq,Rq,zq=s((()=>{Iq=d(m(),1),O(),Lq=Iq.createContext(Fq()),Rq=()=>Iq.useContext(Lq)})),Bq,Vq,Hq,Uq,Wq=s((()=>{Bq=d(m(),1),Aq(),Vq=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?DK(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Hq=e=>{Bq.useEffect(()=>{e.clearReset()},[e])},Uq=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||DK(n,[e.error,r]))})),Gq,Kq,qq,Jq=s((()=>{Gq=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Kq=(e,t)=>e?.suspense&&t.isPending,qq=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()})}));function Yq({queries:e,...t},n){let r=$G(n),i=Nq(),a=Rq(),o=t.subscribed!==!1,s=Xq.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{Gq(e);let t=r.getQueryCache().get(e.queryHash);Vq(e,a,t)}),Hq(a);let[c]=Xq.useState(()=>new wq(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;Xq.useSyncExternalStore(Xq.useCallback(e=>f?c.subscribe(UK.batchCalls(e)):sK,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),Xq.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>Kq(s[t],e))?l.flatMap((e,t)=>{let n=s[t];if(n&&Kq(n,e)){let e=new hq(r,n);return qq(n,e,a)}return[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&Uq({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}var Xq,Zq=s((()=>{tK(),Pq(),zq(),Wq(),Jq(),Xq=d(m(),1),Aq()}));function ine(e,t,n){let r=Nq(),i=Rq(),a=$G(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Gq(o),Vq(o,i,s),Hq(i);let[l]=Qq.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(Qq.useSyncExternalStore(Qq.useCallback(e=>{let t=d?l.subscribe(UK.batchCalls(e)):sK;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Qq.useEffect(()=>{l.setOptions(o)},[o,l]),Kq(o,u))throw qq(o,l,i);if(Uq({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}var Qq,$q=s((()=>{tK(),Pq(),zq(),Wq(),Jq(),Qq=d(m(),1),Aq()}));function eJ(e,t){return ine(e,hq,t)}var tJ=s((()=>{$q(),Aq()})),nJ=s((()=>{tK(),Zq(),tJ(),Aq()}));function rJ(){return(0,iJ.useSyncExternalStore)(la,ca,ca)}var iJ,aJ=s((()=>{iJ=d(m()),ba()}));function oJ(e){return ea(window,`online`,e),ea(window,`offline`,e),()=>{ta(window,`online`,e),ta(window,`offline`,e)}}function sJ({text:e,retry:t,crashed:n=!1}){rJ();let r=(0,uJ.useSyncExternalStore)(oJ,pJ,()=>!0),i=(0,uJ.useContext)(QG),a=(0,uJ.useContext)(fJ),o=(0,uJ.useId)(),s=!n&&!r?fa(`problem.offline`):e;a&&!a.has(s)&&a.set(s,o);let c=!a||a.get(s)===o;if((0,uJ.useEffect)(()=>()=>{a?.get(s)===o&&a.delete(s)},[a,s,o]),!c&&!n)return(0,dJ.jsx)(`p`,{className:`problem problem-repeat`,children:fa(`problem.sameAbove`)});let l=()=>{t?.(),i?.refetchQueries({type:`active`,predicate:e=>e.state.status===`error`})};return(0,dJ.jsxs)(`div`,{className:`problem`,role:`alert`,...n?{"data-section-error":``}:{},children:[(0,dJ.jsx)(Pe,{name:`warning`,className:`problem-mark`}),(0,dJ.jsx)(`p`,{className:`problem-text`,children:s}),(0,dJ.jsx)(gG,{size:`compact`,className:`problem-retry`,onClick:l,children:fa(`problem.retry`)})]})}function cJ({mark:e,text:t,detail:n,action:r,className:i,role:a}){return(0,dJ.jsxs)(`div`,{className:i,...a?{role:a}:{},children:[e?(0,dJ.jsx)(Pe,{name:e,className:`empty-note-mark`}):null,(0,dJ.jsxs)(`p`,{className:`empty-note-text`,children:[t,n?(0,dJ.jsxs)(dJ.Fragment,{children:[` `,(0,dJ.jsx)(`span`,{className:`empty-note-detail`,children:n})]}):null]}),r?(0,dJ.jsx)(`div`,{className:`empty-note-action`,children:r}):null]})}function lJ({text:e,detail:t,action:n,className:r=``,mark:i=`tray`}){return(0,dJ.jsx)(cJ,{mark:i,text:e,detail:t,action:n,className:`empty-note${r?` ${r}`:``}`})}var uJ,dJ,fJ,pJ,mJ=s((()=>{uJ=d(m()),nJ(),ba(),yG(),Fe(),aJ(),sa(),dJ=d(O()),fJ=(0,uJ.createContext)(null),pJ=()=>typeof navigator>`u`||navigator.onLine!==!1}));function hJ({label:e,hint:t,problem:n,required:r=!1,id:i,group:a=!1,check:o=!1,size:s=`default`,kind:c,optional:l,labelAside:u,labelHidden:d=!1,reserve:f=!1,className:p=``,children:m}){let h=(0,_J.useId)(),g=i??`field-${h}`,_=t?`${g}-hint`:void 0,v=`${g}-problem`,y=n!=null&&n!==!1&&n!==``,b=`${g}-label`,x=d?`form-field-label form-field-label-hidden`:`form-field-label`,S=a?(0,vJ.jsx)(`span`,{id:b,className:x,children:e}):(0,vJ.jsx)(`label`,{id:b,htmlFor:g,className:x,children:e}),C=l&&!r?(0,vJ.jsx)(`span`,{className:`form-field-optional-word`,children:l}):null,w={id:g,..._||y?{"aria-describedby":[_,y?v:void 0].filter(Boolean).join(` `)}:{},...y?{"aria-invalid":!0}:{},...r?{"aria-required":!0}:{},...a?{"aria-labelledby":b}:{}},T=typeof m==`function`?m(w):(0,_J.isValidElement)(m)?(0,_J.cloneElement)(m,{...w,...gJ(m.props,w)}):m;return(0,vJ.jsxs)(`div`,{"data-kind":c,className:[`form-field`,s===`compact`?`form-field-compact`:``,o?`form-field-check`:``,f?`form-field-reserve`:``,r?`is-required`:``,y?`is-invalid`:``,p].filter(Boolean).join(` `),children:[o?(0,vJ.jsxs)(`div`,{className:`form-field-check-row`,children:[T,(0,vJ.jsx)(`label`,{id:b,htmlFor:g,className:`form-field-label`,children:e}),C]}):(0,vJ.jsxs)(vJ.Fragment,{children:[u||C?(0,vJ.jsxs)(`div`,{className:`form-field-label-row`,children:[S,C,u]}):S,T]}),t?(0,vJ.jsx)(`p`,{id:_,className:`form-field-hint`,children:t}):null,(0,vJ.jsx)(`p`,{id:v,className:`form-field-problem`,"aria-live":`polite`,hidden:!y&&!f,children:y?n:null})]})}function gJ(e,t){let n=[typeof e[`aria-describedby`]==`string`?e[`aria-describedby`]:``,t[`aria-describedby`]].filter(Boolean).join(` `);return n?{"aria-describedby":n}:{}}var _J,vJ,yJ=s((()=>{_J=d(m(),1),vJ=d(O(),1)})),bJ,xJ,SJ=s((()=>{bJ=d(m()),xJ=(0,bJ.createContext)(void 0)}));function CJ(e){let t=wJ.useContext(TJ);if(!e&&t===void 0)throw Error(LI(27));return t}var wJ,TJ,EJ=s((()=>{RI(),wJ=d(m(),1),TJ=wJ.createContext(void 0)})),DJ,OJ,kJ=s((()=>{DJ=d(m(),1),EJ(),TL(),lP(),OJ=DJ.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=CJ(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return gL(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:cP,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})})}));function AJ(){let e=jJ.useContext(MJ);if(e===void 0)throw Error(LI(26));return e}var jJ,MJ,NJ=s((()=>{RI(),jJ=d(m(),1),MJ=jJ.createContext(void 0)})),PJ,FJ=s((()=>{PJ=`--nested-dialogs`})),IJ,LJ=s((()=>{lP(),IJ=`data-nested-dialog-open`})),RJ,zJ=s((()=>{KN(),lP(),LJ(),RJ={...sP,...GN,nestedDialogOpen(e){return e?{[IJ]:``}:null}}})),BJ,VJ,HJ,UJ=s((()=>{BJ=d(m(),1),IB(),EJ(),TL(),NJ(),pz(),ZH(),Uz(),FJ(),zJ(),VJ=d(O(),1),HJ=BJ.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=CJ(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);AJ(),dz({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?mz(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=gL(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Dz,hidden:!m,onKeyDown(e){XH.has(e.key)&&e.stopPropagation()},style:{[PJ]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:RJ});return(0,VJ.jsx)(sR,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})})})),WJ,GJ,KJ,ane=s((()=>{WJ=d(m(),1),GV(),IB(),EJ(),NJ(),wH(),GJ=d(O(),1),KJ=WJ.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=CJ(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,GJ.jsx)(MJ.Provider,{value:n,children:(0,GJ.jsxs)(zL,{ref:t,...r,children:[a&&o===!0&&(0,GJ.jsx)(CH,{ref:i.context.internalBackdropRef,inert:WV(!s)}),e.children]})}):null})}));function one({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=qJ.useState(0),[u,d]=qJ.useState(0),f=c===0,p=mR(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=jN(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||AN(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return jH(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),Q(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),wz(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var qJ,sne=s((()=>{qJ=d(m(),1),eN(),LH(),IB(),XR(),Uz()}));function cne(e,t,n,r=!1){return{...jz(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function lne(e){return{popupRef:JJ.createRef(),backdropRef:JJ.createRef(),internalBackdropRef:JJ.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}var JJ,YJ,XJ,ZJ=s((()=>{JJ=d(m(),1),YR(),Uz(),YJ={...Lz,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},XJ=class extends KR{constructor(e,t,n){let r=new kz,i=cne(e,r,t,n);super(i,lne(r),YJ)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(yz(this.state,e,t.trigger)))}}}));function une(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=CJ(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=hz((e,t)=>new XJ({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);Tz(b,x),Sz(b);let{forceUnmount:w}=Cz(x,b);QJ.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,GP(HP))}),[w,b]);let T=x||S;return(0,$J.jsxs)(TJ.Provider,{value:b,children:[u&&(0,$J.jsx)(gz,{handle:u,store:b}),T&&(0,$J.jsx)(one,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var QJ,$J,dne=s((()=>{QJ=d(m(),1),sne(),EJ(),ZJ(),KP(),WP(),Uz(),$J=d(O(),1)})),eY,fne=s((()=>{BM(),dne(),eY=FM(function(e){return une(`dialog`,e)})})),pne=s((()=>{kJ(),EJ(),TL(),uU(),KP(),WP(),_V(),UJ(),ane(),fne(),NJ(),zJ(),RI(),BM(),mV(),lP(),jL(),Uz(),IB(),jV(),ZJ(),jR()})),mne=s((()=>{pne()}));function tY({className:e=``,onClose:t,closeDisabled:n=!1,beforeClose:r,children:i,initialFocus:a,finalFocus:o,ariaLabel:s,plain:c=!1,backdrop:l=!0,fullscreen:u=`mobile`,ref:d}){let f=(0,nY.useContext)(xJ),[p,m]=(0,nY.useState)(!0),h=(0,nY.useRef)(!1),g=()=>h.current||n||r?.()===!1?!1:(h.current=!0,m(!1),t(),!0);(0,nY.useImperativeHandle)(d,()=>({close:g}));let _=(0,nY.useId)(),[v,y]=(0,nY.useState)(),b=(0,nY.useCallback)(e=>{if(s||!e)return;let t=e.querySelector(`h1, h2, h3`);t&&(t.id||=_,y(t.id))},[s,_]),x=e.split(/\s+/)[0],S=x?`modal-backdrop ${x}-backdrop`:`modal-backdrop`,C=u?` modal-fullscreen${u===`mobile`?`-mobile`:``}`:``;return(0,rY.jsx)(eY,{modal:!0,open:p,onOpenChange:(e,t)=>{e||g()||t.cancel()},children:(0,rY.jsxs)(KJ,{container:pG(),children:[l?(0,rY.jsx)(OJ,{className:c?S.replace(`modal-backdrop `,``):S}):null,(0,rY.jsx)(HJ,{"data-component":f,className:`${c?e:`modal ${e}`.trim()}${C}`,initialFocus:a,...o?{finalFocus:o}:{},ref:b,"aria-label":s,"aria-labelledby":s?void 0:v,"aria-modal":`true`,children:i})]})})}var nY,rY,iY=s((()=>{nY=d(m(),1),SJ(),mne(),mG(),rY=d(O(),1)}));function aY(e,t){let n=e.lastIndexOf(`.`),r=n>0?e.slice(n+1).toLowerCase():``,i=(t??``).toLowerCase();if(oY.test(r)||/^image\/(png|jpeg|gif|webp|avif|bmp)$/.test(i))return`image`;if(r===`pdf`||i===`application/pdf`)return`pdf`;if(sY.test(r)||i.startsWith(`video/`))return`video`;if(cY.test(r)||i.startsWith(`audio/`))return`audio`;if(lY.test(r)||i.startsWith(`text/`)||i===`application/json`)return`text`}var oY,sY,cY,lY,uY=s((()=>{oY=/^(png|jpe?g|gif|webp|avif|bmp)$/,sY=/^(mp4|m4v|mov|webm|ogv)$/,cY=/^(mp3|m4a|wav|ogg|oga|opus|flac)$/,lY=/^(txt|text|md|markdown|csv|tsv|json|log|xml|ya?ml|ini|toml|sql|ts|js|css|html?)$/})),dY,hne=s((()=>{ba(),dY=pa({download:`Download`,isOverTheLimit:`“{name}” is over the {maxBytes} limit for a file.`,attached:`Attached “{attached}”`,attachedFiles:{one:`Attached {count} file`,other:`Attached {count} files`},attaching:`Attaching…`,orDropFilesHere:`or drop files here`,preview:`Preview {name}`,downloadName:`Download {name}`,more:`More for {name}`,detailsItem:`Details`,removeMore:`Remove…`,aFileNeedsAName:`A file needs a name.`,fileName:`File name`,removeName:`Remove {name}?`,removeQuotedNameQuestion:`Remove “{name}”?`,theFileIsDeleted:`The file is deleted for everyone who can see this record, and Undo cannot bring it back.`,keep:`Keep`,removing:`Removing…`})})),gne=s((()=>{})),fY,_ne=s((()=>{ba(),fY=pa({thisFileIsNoLonger:`This file is no longer here.`,thisFileCouldNotBeRead:`This file could not be read.`,thisFileIsNamed:`This file is named as a PDF, but it is not one.`,thisFileIsNotText:`This file is not text, so it can only be downloaded.`,thisFileIsNotPlayable:`This file is not a recording this browser can play, so it can only be downloaded.`,tooLargeToPlay:`Recordings over {size} are not played here. Download the file to play it.`,tooLargeToShow:`PDFs over {size} are not shown here. Download the file to open it.`,opening:`Opening {name}…`,showingTheFirstDownload:`Showing the first {size}. Download the file for the rest.`,previewOf:`Preview of {name}`,download:`Download`})})),pY=l({FilePreview:()=>bne,mediaType:()=>mY});function mY(e,t){if(!(e.length<12)){if(bY(e,4,4)===`ftyp`)return t===`video`?`video/mp4`:`audio/mp4`;if(e[0]===26&&e[1]===69&&e[2]===223&&e[3]===163)return`${t}/webm`;if(bY(e,0,4)===`OggS`)return`${t}/ogg`;if(t===`audio`){if(bY(e,0,4)===`RIFF`&&bY(e,8,4)===`WAVE`)return`audio/wav`;if(bY(e,0,4)===`fLaC`)return`audio/flac`;if(bY(e,0,3)===`ID3`||e[0]===255&&(e[1]&224)==224)return`audio/mpeg`}}}async function vne(e,t,n,r){if(!e.body){let r=new Uint8Array(await e.arrayBuffer());return r.length>t?{bytes:n?r.subarray(0,t):new Uint8Array,over:!0}:{bytes:r,over:!1}}let i=e.body.getReader(),a=()=>void i.cancel().catch(()=>void 0);r.addEventListener(`abort`,a,{once:!0});let o=[],s=0,c=!1;try{for(;;){let{done:e,value:r}=await i.read();if(e)break;let a=t-s;if(r.length>a){c=!0,n&&a>0&&o.push(r.subarray(0,a));break}o.push(r),s+=r.length}}finally{r.removeEventListener(`abort`,a),c?await i.cancel().catch(()=>void 0):i.releaseLock()}if(c&&!n)return{bytes:new Uint8Array,over:c};let l=new Uint8Array(o.reduce((e,t)=>e+t.length,0)),u=0;for(let e of o)l.set(e,u),u+=e.length;return{bytes:l,over:c}}async function yne(e,t){let n=await fetch(e.href,{credentials:`same-origin`,signal:t});if(!n.ok)return{state:`failed`,why:n.status===404?fY(`thisFileIsNoLonger`):fY(`thisFileCouldNotBeRead`)};let r=e.kind===`video`||e.kind===`audio`||e.kind===`pdf`,i=()=>({state:`refused`,why:fY(e.kind===`pdf`?`tooLargeToShow`:`tooLargeToPlay`,{size:Ti(_Y)})});if(r&&Number(n.headers.get(`content-length`))>_Y)return n.body?.cancel().catch(()=>void 0),i();let{bytes:a,over:o}=await vne(n,r?_Y:vY,!r,t);if(r&&o)return i();if(e.kind===`video`||e.kind===`audio`){let t=mY(a,e.kind);return t?{state:`media`,url:URL.createObjectURL(new Blob([a],{type:t}))}:{state:`refused`,why:fY(`thisFileIsNotPlayable`)}}return e.kind===`pdf`?yY(a)?{state:`pdf`,url:URL.createObjectURL(new Blob([a],{type:`application/pdf`}))}:{state:`refused`,why:fY(`thisFileIsNamed`)}:a.includes(0)?{state:`refused`,why:fY(`thisFileIsNotText`)}:{state:`text`,text:new TextDecoder(`utf-8`).decode(a),cut:o}}function bne({file:e,onClose:t,finalFocus:n}){let r=(0,hY.useRef)(null),i=(0,hY.useRef)(null),[a,o]=(0,hY.useState)({state:`loading`}),[s,c]=(0,hY.useState)(0);(0,hY.useEffect)(()=>{if(e.kind===`image`)return;let t=new AbortController,n;return o({state:`loading`}),yne(e,t.signal).then(e=>{(e.state===`pdf`||e.state===`media`)&&(n=e.url),t.signal.aborted?n&&URL.revokeObjectURL(n):o(e)},e=>{t.signal.aborted||o({state:`failed`,why:e.message||fY(`thisFileCouldNotBeRead`)})}),()=>{t.abort(),n&&URL.revokeObjectURL(n)}},[e.href,e.kind,s]);let l=e.kind===`image`?(0,gY.jsx)(`figure`,{className:`lightbox-figure`,children:(0,gY.jsx)(`img`,{className:`lightbox-image`,src:e.inline??e.href,alt:e.name,draggable:!1})}):a.state===`loading`?(0,gY.jsx)(`p`,{className:`file-preview-note`,role:`status`,children:fY(`opening`,{name:e.name})}):a.state===`pdf`?(0,gY.jsx)(`iframe`,{className:`file-preview-frame`,src:a.url,title:e.name}):a.state===`media`?e.kind===`video`?(0,gY.jsx)(`video`,{className:`file-preview-media`,src:a.url,controls:!0,"aria-label":e.name}):(0,gY.jsx)(`audio`,{className:`file-preview-media is-audio`,src:a.url,controls:!0,"aria-label":e.name}):a.state===`text`?(0,gY.jsxs)(`div`,{className:`file-preview-text`,children:[(0,gY.jsx)(`pre`,{tabIndex:0,"aria-label":e.name,children:a.text}),a.cut&&(0,gY.jsx)(`p`,{className:`file-preview-note`,children:fY(`showingTheFirstDownload`,{size:Ti(vY)})})]}):(0,gY.jsx)(`div`,{className:`file-preview-message`,children:a.state===`refused`?(0,gY.jsx)(lJ,{text:a.why}):(0,gY.jsx)(sJ,{text:a.why,retry:()=>c(e=>e+1)})});return(0,gY.jsx)(tY,{className:`lightbox file-preview`,plain:!0,ref:r,ariaLabel:fY(`previewOf`,{name:e.name}),initialFocus:i,onClose:t,...n?{finalFocus:n}:{},children:(0,gY.jsxs)(`div`,{className:`lightbox-body`,children:[(0,gY.jsxs)(`div`,{className:`lightbox-bar`,children:[(0,gY.jsx)(`span`,{className:`file-preview-name`,children:e.name}),(0,gY.jsxs)(`span`,{className:`file-preview-actions`,children:[(0,gY.jsx)(`a`,{className:`lightbox-close file-preview-download`,href:e.href,download:e.name,children:fY(`download`)}),(0,gY.jsx)(`button`,{type:`button`,ref:i,className:`lightbox-close`,onClick:()=>r.current?.close(),children:fY(`common.close`)})]})]}),(0,gY.jsx)(`div`,{className:`lightbox-stage file-preview-stage is-${e.kind}`,children:l})]})})}var hY,gY,_Y,vY,yY,bY,xY=s((()=>{hY=d(m()),gne(),iY(),mJ(),Yi(),_ne(),gY=d(O()),_Y=67108864,vY=262144,yY=e=>e.length>=5&&String.fromCharCode(...e.subarray(0,5))===`%PDF-`,bY=(e,t,n)=>String.fromCharCode(...e.subarray(t,t+n))})),xne=l({AttachmentList:()=>Cne,fileToBase64:()=>Sne});async function Sne(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}function Cne({items:e,emptyText:t,empty:n,upload:r}){let[i,a]=(0,SY.useState)(!1),[o,s]=(0,SY.useState)(!1),[c,l]=(0,SY.useState)(),u=(0,SY.useRef)(null),[d,f]=(0,SY.useState)(),[p,m]=(0,SY.useState)(),[h,g]=(0,SY.useState)(),_=(0,SY.useRef)(null),v=async e=>{if(!r||o||!e.length)return;s(!0),l(void 0);let t=[],n=[];for(let i of e){if(i.size>r.maxBytes){n.push(dY(`isOverTheLimit`,{name:i.name,maxBytes:Ti(r.maxBytes)}));continue}let e=await r.send(i);e?n.push(e):t.push(i.name)}s(!1),n.length?l({text:n.join(` `),error:!0}):l({text:t.length===1?dY(`attached`,{attached:t[0]}):dY(`attachedFiles`,{count:t.length}),error:!1})},y=e=>e.includes(`Files`),b=e=>{if(e.save)return;let t=aY(e.name,e.type);return t?{name:e.name,kind:t,href:e.href,...e.inline?{inline:e.inline}:{}}:void 0};return(0,CY.jsxs)(`div`,{className:`attachments${i?` is-over`:``}`,onDragOver:r?e=>{y([...e.dataTransfer.types])&&(e.preventDefault(),a(!0))}:void 0,onDragLeave:r?e=>{e.currentTarget.contains(e.relatedTarget)||a(!1)}:void 0,onDrop:r?e=>{e.preventDefault(),a(!1),v([...e.dataTransfer.files])}:void 0,children:[r&&(0,CY.jsxs)(`div`,{className:`attachments-add`,children:[(0,CY.jsx)(gG,{intent:`secondary`,size:`compact`,busy:o,busyLabel:dY(`attaching`),onClick:()=>u.current?.click(),children:`+ ${r.label}`}),(0,CY.jsx)(`input`,{ref:u,type:`file`,multiple:!0,hidden:!0,"aria-label":r.label,onChange:e=>{let t=[...e.target.files??[]];e.target.value=``,v(t)}}),(0,CY.jsx)(`span`,{className:`attachments-hint`,children:dY(`orDropFilesHere`)}),c&&(0,CY.jsx)(`span`,{role:c.error?`alert`:`status`,className:c.error?`attachments-error`:`attachments-said`,children:c.text})]}),e.length?(0,CY.jsx)(`ul`,{className:`attachments-list`,children:e.map(e=>{let t=b(e);return(0,CY.jsxs)(`li`,{className:`attachments-item`,children:[(0,CY.jsx)(`span`,{className:`attachments-badge`,"aria-hidden":`true`,children:EY(e.name)}),p===e.id&&e.rename?(0,CY.jsx)(wne,{item:e,onDone:()=>m(void 0)}):(0,CY.jsxs)(CY.Fragment,{children:[(0,CY.jsxs)(`span`,{className:`attachments-text`,children:[t?(0,CY.jsx)(`button`,{type:`button`,className:`attachments-name`,title:dY(`preview`,{name:e.name}),onClick:e=>{_.current=e.currentTarget,f(t)},children:e.name}):(0,CY.jsx)(`a`,{className:`attachments-name`,href:e.href,download:e.name,onClick:TY(e),children:e.name}),e.meta.length>0&&(0,CY.jsx)(`span`,{className:`attachments-meta`,children:e.meta.join(` · `)})]}),(0,CY.jsxs)(`span`,{className:`attachments-actions`,children:[(0,CY.jsx)(`a`,{className:hG({intent:`quiet`,size:`compact`,className:`attachments-download`}),href:e.href,download:e.name,onClick:TY(e),"aria-label":dY(`downloadName`,{name:e.name}),children:dY(`download`)}),(e.onOpen||e.rename||e.remove)&&(0,CY.jsxs)(bG,{className:`row-actions-menu`,triggerClassName:`ghost row-actions-trigger`,triggerTitle:dY(`more`,{name:e.name}),triggerLabel:dY(`more`,{name:e.name}),label:`⋯`,popupClassName:`page-actions-popup`,align:`end`,children:[e.onOpen&&(0,CY.jsx)(xG,{className:`page-actions-item`,onClick:e.onOpen,children:dY(`detailsItem`)}),e.rename&&(0,CY.jsx)(xG,{className:`page-actions-item`,onClick:()=>m(e.id),children:dY(`common.rename`)}),e.remove&&(0,CY.jsx)(xG,{className:`page-actions-item is-danger`,onClick:()=>g(e),children:dY(`removeMore`)})]})]})]})]},e.id)})}):n??(0,CY.jsx)(lJ,{className:`attachments-empty`,text:t}),d&&(0,CY.jsx)(wY,{file:d,onClose:()=>f(void 0),finalFocus:_}),h&&(0,CY.jsx)(Tne,{item:h,onClose:()=>g(void 0)})]})}function wne({item:e,onDone:t}){let[n,r]=(0,SY.useState)(e.name),[i,a]=(0,SY.useState)(!1),[o,s]=(0,SY.useState)(``),c=async()=>{let r=n.trim();if(!r){s(dY(`aFileNeedsAName`));return}if(r===e.name){t();return}a(!0);let i=await e.rename(r);a(!1),i?s(i):t()};return(0,CY.jsxs)(`form`,{className:`attachments-rename`,onSubmit:e=>{e.preventDefault(),c()},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),t())},children:[(0,CY.jsx)(hJ,{label:dY(`fileName`),size:`compact`,problem:o,children:(0,CY.jsx)(`input`,{type:`text`,value:n,autoFocus:!0,onChange:e=>{r(e.target.value),s(``)}})}),(0,CY.jsxs)(`span`,{className:`attachments-rename-actions`,children:[(0,CY.jsx)(gG,{intent:`primary`,size:`compact`,type:`submit`,busy:i,busyLabel:dY(`common.saving`),children:dY(`common.save`)}),(0,CY.jsx)(gG,{intent:`secondary`,size:`compact`,onClick:t,children:dY(`common.cancel`)})]})]})}function Tne({item:e,onClose:t}){let n=(0,SY.useRef)(null),r=(0,SY.useRef)(null),[i,a]=(0,SY.useState)(!1),[o,s]=(0,SY.useState)(``),c=async()=>{a(!0);let t=await e.remove();a(!1),t?s(t):n.current?.close()};return(0,CY.jsxs)(tY,{className:`confirm attachments-confirm`,ref:n,fullscreen:!1,initialFocus:r,closeDisabled:i,ariaLabel:dY(`removeName`,{name:e.name}),onClose:t,children:[(0,CY.jsx)(`h2`,{children:dY(`removeQuotedNameQuestion`,{name:e.name})}),(0,CY.jsx)(`p`,{children:dY(`theFileIsDeleted`)}),o&&(0,CY.jsx)(`p`,{className:`attachments-error`,role:`alert`,children:o}),(0,CY.jsxs)(`div`,{className:`confirm-actions`,children:[(0,CY.jsx)(gG,{ref:r,intent:`secondary`,disabled:i,onClick:()=>n.current?.close(),children:dY(`keep`)}),(0,CY.jsx)(gG,{intent:`danger`,busy:i,busyLabel:dY(`removing`),onClick:()=>void c(),children:dY(`common.remove`)})]})]})}var SY,CY,wY,TY,EY,Ene=s((()=>{SY=d(m()),Yi(),Es(),mJ(),yG(),yJ(),iY(),wG(),uY(),Ys(),hne(),CY=d(O()),wY=Us(()=>Promise.resolve().then(()=>(xY(),pY)),`FilePreview`,{quiet:!0}),TY=e=>e.save?t=>{t.preventDefault(),e.save().catch(e=>hs(e.message,`error`))}:void 0,EY=e=>{let t=e.lastIndexOf(`.`);return(t>0?e.slice(t+1).slice(0,4).toUpperCase():``)||`FILE`}}));function Dne(e){return(0,DY.jsx)(`div`,{className:`rich-field`,children:(0,DY.jsx)(OY,{...e})})}function One(e,t){return async n=>{let r=n.trim(),{mentionRows:i}=await Promise.resolve().then(()=>(YG(),UG)),[a,o]=await Promise.all([i(e,r,t),e.groups?i(e.groups,r,t,`group`).catch(()=>[]):Promise.resolve([])]);return o.length?[...a.slice(0,8-Math.min(o.length,3)),...o].slice(0,8):a}}function kne(e,t,n){if(!e||!t||!bs(e))return;let r=xs(e).find(e=>e.to.table===t.table&&e.from.columns.length===1&&Object.hasOwn(t.key,e.to.columns[0]));if(!r)return;let i={[r.from.columns[0]]:t.key[r.to.columns[0]]};return async t=>{let{fileToBase64:r}=await Promise.resolve().then(()=>(Ene(),xne)),a=await rs(`/api/file/upload`,{table:e,values:i,...Aa(n??null),file:{name:t.name||`picture`,type:t.type,data:await r(t)}});if(a.errors?.length)throw Error(a.errors[0].message);if(typeof a.error==`string`)throw Error(a.error);if(!a.key)throw Error(Xs(`pictureUnread`));return _r(e,a.key)}}var DY,OY,Ane=s((()=>{Es(),Fa(),Dr(),Ys(),Zs(),DY=d(O(),1),OY=Us(()=>Promise.resolve().then(()=>(LG(),OG)),`RichTextEditor`,{quiet:!0})}));function kY(e){let t=AY.useRef(!0);t.current&&(t.current=!1,e())}var AY,jY=s((()=>{AY=d(m(),1)}));function MY(){let e=FY.useContext(IY);if(e===void 0)throw Error(LI(60));return e}function NY(){let e=FY.useContext(LY);if(e===void 0)throw Error(LI(101));return e}function PY(){let e=FY.useContext(RY);if(e===void 0)throw Error(LI(61));return e}var FY,IY,LY,RY,zY=s((()=>{RI(),FY=d(m(),1),IY=FY.createContext(void 0),LY=FY.createContext(void 0),RY=FY.createContext(void 0)})),BY=s((()=>{WM()})),VY,HY,jne=s((()=>{VY=`data-valid`,HY=`data-invalid`})),UY,WY,GY,KY,qY=s((()=>{jne(),UY={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},WY={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},GY={disabled:!1,...WY},KY={valid(e){return e===null?null:e?{[VY]:``}:{[HY]:``}}}}));function JY(e=!0){let t=YY.useContext(ZY);if(t.setValidityData===VM&&!e)throw Error(LI(28));return t}var YY,XY,ZY,QY=s((()=>{RI(),YY=d(m(),1),WM(),BY(),qY(),XY={invalid:void 0,name:void 0,validityData:{state:UY,errors:[],error:``,value:``,initialValue:null},setValidityData:VM,disabled:void 0,setTouched:VM,setDirty:VM,setFilled:VM,setFocused:VM,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:GY,registerFieldControl:VM,validation:{getValidationProps:(e,t=UM)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:VM,getInputControl:()=>null,commit:async()=>{},change:VM}},ZY=YY.createContext(XY)}));function $Y(e,t,n,r,i=!0,a){let{registerFieldControl:o}=JY(),s=jM(()=>Symbol());Q(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),Q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var eX=s((()=>{eN(),PM(),QY()}));function tX(){return nX.useContext(rX)}var nX,rX,iX=s((()=>{nX=d(m(),1),BY(),rX=nX.createContext({controlId:void 0,registerControlId:VM,resetControlId:VM,labelId:void 0,setLabelId:VM,messageIds:[],setMessageIds:VM,getDescriptionProps:e=>e})}));function aX(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=tX(),o=gV(),s=jM(()=>Symbol()),c=oX.useRef(!1),l=oX.useRef(!1),u=$(()=>{c.current&&i!==VM&&(c.current=!1,i(s.current,void 0))});return Q(()=>{if(!n||i===VM){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),Q(()=>u,[u]),(n?r:void 0)??t??o}var oX,sX=s((()=>{oX=d(m(),1),eN(),mF(),PM(),BY(),_V(),iX()}));function Mne(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var Nne=s((()=>{}));function cX(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function lX(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Mne(e,t,(e,t)=>cX(e,t,n)):e!==t}function uX(e,t,n){return e?e.some(e=>e!==void 0&&cX(t,e,n)):!1}function dX(e,t,n){return e?e.findIndex(e=>e!==void 0&&cX(e,t,n)):-1}function fX(e,t){if(t!==gX)return n=>uX(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function pX(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(fX(t,n)):dX(e,t,n);return i===-1?null:i}function mX(e,t,n,r,i,a){return uX(r,t,i)?a!=null&&e>a&&uX(r,n[a],i)?a:e:e===a?pX(n,r,i,!0):a}function hX(e,t,n){return e.filter(e=>!cX(t,e,n))}var gX,_X=s((()=>{Nne(),gX=(e,t)=>Object.is(e,t)}));function vX(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var yX=s((()=>{}));function bX(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function xX(e){return bX(e?.[0])}function SX(e){return xX(e)?e.flatMap(e=>e.items):e}function CX(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(xX(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function wX(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return vX(e)}function TX(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?vX(e.value):vX(e)}var EX=s((()=>{m(),yX(),O()})),DX,OX=s((()=>{_X(),EX(),DX={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:TX(t,r)!==``},hasNullItemLabel:(e,t)=>t?CX(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>cX(t,e,n)):cX(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows}}));function kX(){return AX.useContext(jX)}var AX,jX,MX=s((()=>{AX=d(m(),1),BY(),jX=AX.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:VM,validationMode:`onSubmit`,submitCountRef:{current:0}})}));function NX(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var PX=s((()=>{}));function FX(e,t){return Math.max(0,e-t)}function IX(e,t){if(t<=0)return 0;let n=NX(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}var LX=s((()=>{PX()}));function RX(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=gX,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=kX(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=JY(),F=aX({id:t}),I=M||d,L=j??c,[R,z]=jU({controlled:n,default:y?r??HM:r,name:`Select`,state:`value`}),[B,V]=jU({controlled:a,default:o,name:`Select`,state:`open`}),H=zX.useRef([]),U=zX.useRef([]),W=zX.useRef(null),G=zX.useRef(null),ee=zX.useRef(0),te=zX.useRef(null),ne=zX.useRef([]),K=zX.useRef(!1),re=zX.useRef(null),q=zX.useRef(null),ie=zX.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ae=zX.useRef(!1),oe=zX.useRef(R),{mounted:se,setMounted:ce,transitionStatus:le}=rz(B),{openMethod:ue,triggerProps:de}=kV(B),fe=jM(()=>new KR({id:F,labelId:void 0,modal:m,multiple:y,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:R,open:B,mounted:se,transitionStatus:le,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:UM,triggerProps:UM,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:VM,setOpen:VM,handleScrollArrowVisibility:VM,onOpenChangeComplete:VM,listRef:H,popupRef:W,scrollHandlerRef:G,scrollArrowsMountedCountRef:ee,valueRef:te,valuesRef:ne,labelsRef:U,typingRef:K,selectionRef:ie,firstItemTextRef:re,selectedItemTextRef:q,alignItemWithTriggerActiveRef:ae,initialValueRef:oe},DX)).current,pe=fe.useState(`activeIndex`),me=fe.useState(`selectedIndex`),J=fe.useState(`triggerElement`),he=fe.useState(`positionerElement`),ge=dU(ue),_e=ue??ge,ve=zX.useMemo(()=>y?``:TX(R,x),[y,R,x]),ye=zX.useMemo(()=>y&&Array.isArray(R)?R.map(e=>TX(e,x)):TX(R,x),[y,R,x]);$Y(iF(J),F,R,$(()=>ye),!I,c);let be=y?Array.isArray(R)&&R.length>0:R!=null&&ve!==``;Q(()=>{A(be)},[be,A]),Q(function(){let e=pX(ne.current,R,S,y);e===null&&(q.current=null),!B&&fe.set(`selectedIndex`,e)},[y,B,R,S,fe]),TV(R,()=>{T(L),E(lX(R,k.initialValue,S)),N.change(R)});let xe=$((e,t)=>{s?.(e,t),!t.isCanceled&&(V(e),e||t.reason!==`focus-out`&&t.reason!==`outside-press`||(D(!0),O(!1),P===`onBlur`&&N.commit(R)))}),Se=$(()=>{ce(!1),fe.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});dz({enabled:!h,open:B,ref:W,onComplete(){B||Se()}}),zX.useImperativeHandle(h,()=>({unmount:Se}),[Se]);let Ce=$((e,t)=>{i?.(e,t),!t.isCanceled&&z(e)}),we=$(e=>{let t=FX(e.scrollHeight,e.clientHeight),n=IX(e.scrollTop,t),r=n>0,i=n<t;fe.set(`scrollUpArrowVisible`,r),fe.set(`scrollDownArrowVisible`,i)}),Te=Wz({open:B,onOpenChange:xe,elements:{reference:J,floating:he}}),Ee=fR(Te,{enabled:!I,event:`mousedown`}),De=mR(Te),Oe=bB(Te,{enabled:!I,listRef:H,activeIndex:pe,selectedIndex:me,disabledIndices:HM,onNavigate(e){(e!==null||B)&&fe.set(`activeIndex`,e)},focusItemOnHover:C}),ke=wB(Te,{enabled:!I&&(B||!f&&!y),listRef:U,activeIndex:pe,selectedIndex:me,disabledIndices:e=>cG(H.current[e]),onMatch(e){B?fe.set(`activeIndex`,e):Ce(ne.current[e],GP(TP))},onTyping(e){K.current=e}}),Ae=zX.useMemo(()=>$I(ke.reference,Oe.reference,De.reference,Ee.reference,de),[Ee.reference,ke.reference,Oe.reference,De.reference,de]),je=zX.useMemo(()=>$I(Dz,ke.floating,Oe.floating,De.floating),[ke.floating,Oe.floating,De.floating]),Me=Oe.item??UM;fe.useContextCallback(`setValue`,Ce),fe.useContextCallback(`setOpen`,xe),fe.useContextCallback(`handleScrollArrowVisibility`,we),fe.useContextCallback(`onOpenChangeComplete`,_),kY(()=>{fe.update({popupProps:je,triggerProps:Ae})}),fe.useSyncedValues({id:F,modal:m,multiple:y,value:R,open:B,mounted:se,transitionStatus:le,popupProps:je,triggerProps:Ae,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:_e});let Ne=zX.useMemo(()=>({disabled:I,readOnly:f,required:p,multiple:y,highlightItemOnHover:C,itemProps:Me}),[I,f,p,y,C,Me]),Pe=ZP(g,N.inputRef),Fe=y?void 0:L,Ie=zX.useMemo(()=>!y||!Array.isArray(R)||!L?null:R.map(e=>{let t=TX(e,x);return(0,BX.jsx)(`input`,{type:`hidden`,form:l,name:L,value:t,disabled:I},t)}),[y,R,l,L,x,I]);return(0,BX.jsxs)(IY.Provider,{value:fe,children:[(0,BX.jsx)(LY.Provider,{value:Ne,children:(0,BX.jsx)(RY.Provider,{value:Te,children:w})}),(0,BX.jsx)(`input`,{...N.getValidationProps(I,{onFocus(){fe.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||I||f)return;let t=e.currentTarget.value,n=GP(TP,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=ne.current.findIndex(t=>TX(t,x).toLowerCase()===e||wX(t,b).toLowerCase()===e);r===-1&&(r=ne.current.findIndex((t,n)=>{let r=U.current[n];return r!=null&&r.toLowerCase()===e}));let i=ne.current[r];i!=null&&Ce(i,n)}fe.set(`forceMount`,!0),queueMicrotask(r)}}),id:F&&Fe==null?`${F}-hidden-input`:void 0,form:l,name:Fe,autoComplete:u,value:ve,disabled:I,required:p&&!(y&&be),readOnly:f,ref:Pe,style:L?TF:wF,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ie]})}var zX,BX,VX=s((()=>{zX=d(m(),1),EF(),rF(),PM(),jY(),pU(),lG(),NU(),eN(),mF(),oF(),YR(),WM(),IB(),zY(),QY(),eX(),sX(),az(),OX(),KP(),WP(),pz(),MX(),EX(),_X(),DV(),jV(),LX(),Uz(),hL(),BY(),BX=d(O(),1)}));function HX(e,t){return e??t}var UX=s((()=>{})),WX,GX=s((()=>{lP(),WX=`data-popup-side`})),KX,qX,JX,YX,XX=s((()=>{KX=d(m(),1),SF(),ZM(),oF(),zY(),QY(),iX(),lP(),qY(),TL(),GW(),XR(),hL(),uU(),KP(),WP(),sX(),UX(),GX(),qX=400,JX={...oP,...KY,popupSide:e=>e?{[WX]:e}:null,value:()=>null},YX=KX.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,validation:f,state:p,disabled:m}=JY(),{labelId:h}=tX(),g=MY(),{readOnly:_,required:v,disabled:y}=NY(),b=m||y||a,x=g.useState(`open`),S=g.useState(`mounted`),C=g.useState(`value`),w=g.useState(`triggerProps`),T=g.useState(`positionerElement`),E=g.useState(`listElement`),D=g.useState(`popupSide`),O=g.useState(`id`),k=g.useState(`labelId`),A=g.useState(`hasSelectedValue`),j=S&&T?D:null,M=i??O,N=HX(h,k);aX({id:i});let P=iF(T),F=KX.useRef(null),{getButtonProps:I,buttonRef:L}=uV({disabled:b,native:o}),R=g.useStateSetter(`triggerElement`),z=JM(),B=JM(),V=JM();KX.useEffect(()=>{if(x)return V.start(qX,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{V.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},B.clear()},[x,g,B,V]);let H=$I(w,{id:M,role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-controls":x?E?.id??_P(T)?.id:void 0,"aria-labelledby":N,"aria-readonly":_||void 0,"aria-required":v||void 0,tabIndex:b?-1:0,onFocus(e){u(!0),x&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,GP(TP,e.nativeEvent)),z.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){AN(T,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&f.commit(C))},onMouseDown(e){if(x)return;let t=xF(e.currentTarget);function n(e){if(!F.current)return;let t=e.target;AN(F.current,t)||AN(P.current,t)||HW(e,F.current)||g.context.setOpen(!1,GP(BP,e))}B.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,I),U=f.getValidationProps(b,H);U.role=`combobox`;let W={...p,open:x,disabled:b,value:C,readOnly:_,popupSide:j,placeholder:!A};return gL(`button`,e,{ref:[t,F,L,R],state:W,stateAttributesMapping:JX,props:U})})})),ZX,QX,$X,eZ=s((()=>{ZX=d(m(),1),IB(),zY(),QX=d(O(),1),$X=ZX.forwardRef(function(e,t){let n=MY(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,QX.jsx)(zL,{ref:t,...e}):null})}));function tZ(){let e=nZ.useContext(rZ);if(!e)throw Error(LI(59));return e}var nZ,rZ,iZ=s((()=>{RI(),nZ=d(m(),1),rZ=nZ.createContext(void 0)}));function aZ(e,t){e&&Object.assign(e.style,t)}var oZ,sZ=s((()=>{oZ={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`}})),cZ,lZ,uZ,dZ,fZ=s((()=>{cZ=d(m(),1),GV(),eN(),mF(),zY(),vW(),bH(),iZ(),wH(),jL(),sZ(),KP(),WP(),_X(),OH(),VH(),lZ=d(O(),1),uZ={position:`fixed`},dZ=cZ.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=OL,style:_,...v}=e,y=MY(),b=PY(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`modal`),w=y.useState(`value`),T=y.useState(`openMethod`),E=y.useState(`positionerElement`),D=y.useState(`triggerElement`),O=y.useState(`isItemEqualToValue`),k=y.useState(`transitionStatus`),A=cZ.useRef(null),j=cZ.useRef(null),[M,N]=cZ.useState(h),P=S&&M&&T!==`touch`;!S&&M!==h&&N(h),cZ.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>P),RH((P||C)&&x,T===`touch`,E,D);let F=hH({anchor:n,floatingRootContext:b,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??P,collisionAvoidance:g,keepMounted:!0}),I=P?`none`:F.side,L=P?uZ:F.positionerStyles,R={open:x,side:I,align:F.align,anchorHidden:F.anchorHidden};Q(()=>{y.set(`popupSide`,F.side)},[y,F.side]);let z=DH(e,R,{styles:L,transitionStatus:k,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x}),B=cZ.useRef(0),V=$(e=>{if(y.context.valuesRef.current.length===0)return;let t=B.current;B.current=e.size;let n=GP(TP);if(t!==0&&!y.state.multiple&&w!==null&&dX(y.context.valuesRef.current,w,O)===-1){let e=y.context.initialValueRef.current,t=e!=null&&dX(y.context.valuesRef.current,e,O)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(w)){let e=w.filter(e=>dX(y.context.valuesRef.current,e,O)!==-1);e.length!==w.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&P){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};aZ(E,e),aZ(y.context.popupRef.current,e)}}),H=cZ.useMemo(()=>({...F,side:I,alignItemWithTriggerActive:P,setControlledAlignItemWithTrigger:N,scrollUpArrowRef:A,scrollDownArrowRef:j}),[F,I,P,N]);return(0,lZ.jsx)(lW,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:V,children:(0,lZ.jsxs)(rZ.Provider,{value:H,children:[S&&C&&(0,lZ.jsx)(CH,{inert:WV(!x),cutout:D}),z]})})})})),pZ,mZ,hZ,gZ=s((()=>{pZ=d(O(),1),mZ=`base-ui-disable-scrollbar`,hZ={className:mZ,getElement(e){return(0,pZ.jsx)(`style`,{nonce:e,href:mZ,precedence:`base-ui:low`,children:`.${mZ}{scrollbar-width:none}.${mZ}::-webkit-scrollbar{display:none}`})}}}));function _Z(){return vZ.useContext(yZ)??bZ}var vZ,yZ,bZ,xZ=s((()=>{vZ=d(m(),1),yZ=vZ.createContext(void 0),bZ={disableStyleElements:!1}})),SZ,CZ=s((()=>{SZ=`--transform-origin`}));function wZ(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function TZ(e){return FX(e.scrollHeight,e.clientHeight)}function EZ(e){return aM.getScale(e)}function DZ(e,t,n){return e/n[t]}function OZ(e,t){return FA({x:DZ(e.x,`x`,t),y:DZ(e.y,`y`,t),width:DZ(e.width,`x`,t),height:DZ(e.height,`y`,t)})}function kZ(e){let{style:t}=e,n={};for(let[e,r]of PZ)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of PZ){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var AZ,jZ,MZ,NZ,PZ,FZ=s((()=>{AZ=d(m(),1),KA(),JP(),SN(),mF(),SF(),eN(),bF(),PX(),IB(),zY(),lP(),iZ(),gZ(),KN(),pz(),TL(),sZ(),KP(),WP(),tU(),ZH(),EH(),LX(),xZ(),$V(),CZ(),jZ=d(O(),1),MZ={...sP,...GN},NZ=AZ.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=MY(),{multiple:c,readOnly:l,highlightItemOnHover:u}=NY(),d=PY(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=tZ(),_=QH(!0)!=null,v=XV(),{nonce:y,disableStyleElements:b}=_Z(),x=s.useState(`id`),S=s.useState(`open`),C=s.useState(`openMethod`),w=s.useState(`mounted`),T=s.useState(`popupProps`),E=s.useState(`transitionStatus`),D=s.useState(`triggerElement`),O=s.useState(`positionerElement`),k=s.useState(`listElement`),A=AZ.useRef(!1),j=AZ.useRef(!1),M=AZ.useRef({}),N=hF(),P=$(e=>{if(!O||!s.context.popupRef.current||!j.current)return;let t=O.style.top===`0px`,n=O.style.bottom===`0px`;if(A.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=EZ(O),i=DZ(O.getBoundingClientRect().height,`y`,r),a=xF(O),o=sj(O),c=o.getComputedStyle(O),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=wZ(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=TZ(e),g=null,_=e=>{O.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=NX(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(A.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=NX(g,0,TZ(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(A.current=!0),s.context.handleScrollArrowVisibility(e)});AZ.useImperativeHandle(s.context.scrollHandlerRef,()=>P,[P]),dz({open:S,ref:s.context.popupRef,onComplete(){S&&s.context.onOpenChangeComplete(!0)}});let F={open:S,transitionStatus:E,side:f,align:p};Q(()=>{O&&s.context.popupRef.current&&!Object.keys(M.current).length&&(M.current={top:O.style.top||`0`,left:O.style.left||`0`,right:O.style.right,height:O.style.height,bottom:O.style.bottom,minHeight:O.style.minHeight,maxHeight:O.style.maxHeight,marginTop:O.style.marginTop,marginBottom:O.style.marginBottom})},[s,O]),Q(()=>{S||m||(j.current=!1,A.current=!1,aZ(O,M.current))},[S,m,O]),Q(()=>{let e=s.context.popupRef.current;if(!S||!D||!O||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(j.current=!0,e.style.removeProperty(SZ),!m){N.request(()=>s.context.handleScrollArrowVisibility(k||e));return}let t=kZ(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=sj(O),i=r.getComputedStyle(O),a=r.getComputedStyle(e),o=xF(D),c=EZ(D),l=OZ(D.getBoundingClientRect(),c),d=OZ(O.getBoundingClientRect(),c),f=l.height,p=k||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=wZ(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,j=0;if(t&&n){let e=OZ(n.getBoundingClientRect(),c);T=OZ(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;j=T.top-d.top+T.height/2-r}let N=w+j+y+h,P=Math.min(S,N),F=S-_-y,I=N-P,L=C-5;O.style.left=`${NX(E,5,L-d.width)}px`,O.style.height=`${P}px`,O.style.maxHeight=`none`,O.style.marginTop=`${_}px`,O.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=TZ(p),z=I>=R-1;z&&(P=Math.min(S,d.height)-(I-R));let B=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),V=(r.visualViewport?.scale??1)!==1&&mN;if(B||V){aZ(O,M.current),g(!1);return}let H=Math.max(b,P);if(z){let e=Math.max(0,S-N);O.style.top=d.height>=F?`0`:`${e}px`,O.style.height=`${P}px`,p.scrollTop=TZ(p)}else O.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=NX(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(SZ,`50% ${i}%`)}(H===S||P>=x)&&(A.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,S,O,D,m,g,N,k,u,v,h]),AZ.useEffect(()=>{if(!m||!O||!S)return;let e=sj(O);function t(e){s.context.setOpen(!1,GP(UP,e))}return qP(e,`resize`,t)},[s,m,O,S]);let I={...k?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&XH.has(e.key)&&e.stopPropagation()},onScroll(e){k||P(e.currentTarget)},...m&&{style:k?{height:`100%`}:oZ},className:!k&&m?hZ.className:void 0},L=gL(`div`,e,{ref:[t,s.context.popupRef],state:F,stateAttributesMapping:MZ,props:[T,I,TH(E),o]});return(0,jZ.jsxs)(AZ.Fragment,{children:[!b&&hZ.getElement(y),(0,jZ.jsx)(sR,{context:d,modal:!1,disabled:!w,openInteractionType:C,returnFocus:a,restoreFocus:!0,children:L})]})}),PZ=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]]})),IZ,LZ,RZ=s((()=>{IZ=d(m(),1),zY(),iZ(),TL(),gZ(),sZ(),LZ=IZ.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=MY(),{multiple:s,readOnly:c}=NY(),{alignItemWithTriggerActive:l}=tZ(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:oZ},className:u&&d!==`touch`?hZ.className:void 0};return gL(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})})})),zZ,BZ,VZ=s((()=>{zZ=d(m(),1),BZ=zZ.createContext(void 0)})),HZ,UZ,WZ,GZ=s((()=>{HZ=d(m(),1),eN(),zY(),qU(),TL(),VZ(),uU(),KP(),WP(),_X(),ON(),UZ=d(O(),1),WZ=HZ.memo(HZ.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=HZ.useRef(null),d=GU({guess:!0,label:o,textRef:u}),f=MY(),{itemProps:p,multiple:m,disabled:h,readOnly:g}=NY(),_=h||s,v=f.useState(`isActive`,d.index),y=f.useState(`open`),b=f.useState(`isSelected`,a),x=f.useState(`isSelectedByFocus`,d.index),S=f.useState(`isItemEqualToValue`),C=d.index,w=HZ.useRef(null);Q(()=>{let e=f.context.valuesRef.current;return e[C]=a,()=>{delete e[C]}},[C,a,f]),Q(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=mX(C,a,f.context.valuesRef.current,e,S,t),r=n===C,C===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&cX(a,e,S),r&&(n=C)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[C,m,S,f,a]);let T=HZ.useRef(`mouse`),E=HZ.useRef(!1),{getButtonProps:D,buttonRef:O}=uV({disabled:_,focusableWhenDisabled:!0,native:c,composite:!0}),k={disabled:_,selected:b,highlighted:v};function A(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=b?hX(n,a,S):[...n,a];f.context.setValue(r,GP(AP,e))}else f.context.setValue(a,GP(AP,e)),f.context.setOpen(!1,GP(AP,e))}function j(){f.context.selectionRef.current.dragY=0}let M={role:`option`,"aria-selected":b,tabIndex:y&&v?0:-1,onKeyDown(e){f.set(`activeIndex`,C),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=T.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&wN(e.nativeEvent)&&(n!==void 0||v),i=t&&!r&&!E.current;E.current=!1,!(_||i)&&A(e.nativeEvent)},onPointerEnter(e){T.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){T.current=e.pointerType,E.current=!0,j()},onMouseUp(){if(j(),_||T.current===`touch`||E.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&b,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!b;e||t||(E.current=!0,w.current?.click(),E.current=!1)}},N=gL(`div`,e,{ref:[O,t,d.ref,w],state:k,props:[p,M,l,D]}),P=HZ.useMemo(()=>({selected:b,index:C,textRef:u,selectedByFocus:x}),[b,C,u,x]);return(0,UZ.jsx)(BZ.Provider,{value:P,children:N})}))})),KZ=s((()=>{VX(),TL(),QY(),qY(),Aj(),SF(),mF(),XR(),eN(),_V(),iX(),zY(),XX(),EX(),lP(),eZ(),KN(),fZ(),FZ(),RZ(),GZ(),VZ(),az(),pz(),iZ(),ZM(),LX(),RI()})),qZ=s((()=>{KZ()}));function JZ(e){return(0,ZZ.jsx)(YZ,{...e})}function YZ(e){let{items:t,ariaLabel:n,ariaInvalid:r,ariaDescribedBy:i,ariaLabelledBy:a,id:o,buttonRef:s,popupRef:c,onOpenChange:l,disabled:u,readOnly:d,valueClassName:f,actions:p=[],buttonClassName:m,listClassName:h,valueId:g,placeholder:_}=e,v=e.multiple===!0,y=(0,XZ.useId)(),b=(0,XZ.useId)(),x=o??y,S=e.multiple===!0?e.value:[e.value],C=t.find(e=>e.value===S[0]),w=v?t.filter(e=>S.includes(e.value)).map(e=>e.label).join(`, `):C?.label??``,T=(0,XZ.useRef)(null),[E,D]=(0,XZ.useState)(null);(0,XZ.useEffect)(()=>{D(T.current?.closest(`dialog, [role="dialog"]`))},[]);let O=(0,XZ.useRef)(null);return(0,ZZ.jsx)(`div`,{className:`dd`,ref:T,children:(0,ZZ.jsxs)(RX,{multiple:v||void 0,value:v?S:C?C.value:null,disabled:u,readOnly:d,onOpenChange:l,items:t.map(e=>({value:e.value,label:e.label})),onValueChange:n=>{if(e.multiple===!0){if(!Array.isArray(n))return;let r=n.find(e=>typeof e==`string`&&e.startsWith(QZ));r?p[Number(r.slice(9))]?.onSelect():e.onChange(t.map(e=>e.value).filter(e=>n.includes(e)))}else typeof n==`string`&&(n.startsWith(QZ)?p[Number(n.slice(9))]?.onSelect():n!==e.value&&e.onChange(n))},children:[(0,ZZ.jsxs)(YX,{render:(0,ZZ.jsx)(`button`,{type:`button`,role:`button`,id:x,className:m?`dd-button ${m}`:`dd-button`,ref:e=>{O.current=e,typeof s==`function`?s(e):s&&(s.current=e)},"aria-label":a?void 0:n,"aria-labelledby":a??(n?`${x} ${g??b}`:void 0),"aria-invalid":r||void 0,"aria-describedby":i,title:C?.detail??``}),children:[C?.swatches&&(0,ZZ.jsx)(`span`,{className:`dd-swatches`,"aria-hidden":`true`,children:C.swatches.map((e,t)=>(0,ZZ.jsx)(`span`,{style:{background:e}},t))}),(0,ZZ.jsx)(`span`,{id:g??b,className:`dd-value${f?` ${f}`:``}${w?``:` is-empty`}`,children:w||_||`—`}),(0,ZZ.jsx)(`span`,{className:`dd-caret`,"aria-hidden":`true`,children:`▾`})]}),(0,ZZ.jsx)($X,{container:E??pG(),children:(0,ZZ.jsx)(dZ,{anchor:()=>O.current?gU(O.current):null,alignItemWithTrigger:!1,positionMethod:`fixed`,side:`bottom`,align:`start`,sideOffset:4,collisionBoundary:_U(),collisionPadding:8,style:{zIndex:40},children:(0,ZZ.jsx)(NZ,{ref:c,className:`dd-popup`,children:(0,ZZ.jsxs)(LZ,{className:[`dd-list`,v?`dd-list-multi`:``,h].filter(Boolean).join(` `),"aria-label":n,"aria-labelledby":n?void 0:a?.split(` `)[0],children:[t.map(t=>(0,ZZ.jsxs)(WZ,{value:t.value,label:t.label,disabled:t.disabled,className:e=>`dd-option${e.selected?` selected`:``}${t.disabled?` disabled`:``}${t.tone?` dd-tone-${t.tone}`:``}${e.highlighted?` active`:``}`,children:[v?(0,ZZ.jsx)(`span`,{className:`dd-box`,"aria-hidden":`true`}):(0,ZZ.jsx)(`span`,{className:`dd-check`,"aria-hidden":`true`,children:t.value===e.value?`✓`:``}),t.swatches&&(0,ZZ.jsx)(`span`,{className:`dd-swatches`,"aria-hidden":`true`,children:t.swatches.map((e,t)=>(0,ZZ.jsx)(`span`,{style:{background:e}},t))}),(0,ZZ.jsxs)(`span`,{className:`dd-text`,children:[(0,ZZ.jsx)(`span`,{className:`dd-label`,children:t.label}),t.detail&&(0,ZZ.jsx)(`span`,{className:`dd-detail`,children:t.detail})]}),t.badge&&(0,ZZ.jsx)(`span`,{className:`dd-badge`,children:t.badge})]},t.value)),p.length?(0,ZZ.jsx)(`div`,{className:`dd-divider`,role:`presentation`}):null,p.map((e,t)=>(0,ZZ.jsxs)(WZ,{value:`${QZ}${t}`,label:e.label,className:e=>`dd-option dd-action${e.highlighted?` active`:``}`,children:[(0,ZZ.jsx)(`span`,{className:`dd-check`,"aria-hidden":`true`}),(0,ZZ.jsx)(`span`,{className:`dd-text`,children:(0,ZZ.jsx)(`span`,{className:`dd-label`,children:e.label})})]},e.label))]})})})})]})})}var XZ,ZZ,QZ,$Z=s((()=>{XZ=d(m(),1),qZ(),vU(),mG(),ZZ=d(O(),1),QZ=`~~action:`})),eQ,tQ=s((()=>{ba(),eQ=pa({select:`Select`})}));function nQ(e){return!/[??]/.test(e)&&e.trim().split(/\s+/).length<=2}function rQ(e){return(0,iQ.jsx)(JZ,{...e,ariaLabel:e.ariaLabel??eQ(`select`)})}var iQ,aQ=s((()=>{$Z(),tQ(),iQ=d(O(),1)}));function oQ(e){if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=new Date(`${e}T00:00:00Z`);return!Number.isNaN(t.getTime())&&t.toISOString().slice(0,10)===e}function sQ(e,t){let n=JSON.stringify([e??null,t]),r=jQ.get(n);return r||(r=new Intl.DateTimeFormat(e,t),jQ.set(n,r)),r}function cQ(e){return oQ(e)&&e>=`0001-01-01`&&e<=`9999-12-31`}function lQ(e){if(!cQ(e))throw RangeError(`Expected an existing ISO date from 0001-01-01 through 9999-12-31.`);return{year:Number(e.slice(0,4)),month:Number(e.slice(5,7)),day:Number(e.slice(8,10))}}function uQ({year:e,month:t,day:n}){let r=new Date(0);return r.setUTCFullYear(e,t-1,n),r}function dQ(e){return`${String(e.getUTCFullYear()).padStart(4,`0`)}-${String(e.getUTCMonth()+1).padStart(2,`0`)}-${String(e.getUTCDate()).padStart(2,`0`)}`}function fQ(e){if(!Number.isSafeInteger(e))throw RangeError(`Calendar steps must be safe integers.`)}function pQ(e,t){if(fQ(e),fQ(t),e<1||e>9999||t<1||t>12)throw RangeError(`Invalid calendar month.`);return[31,e%4==0&&(e%100!=0||e%400==0)?29:28,31,30,31,30,31,31,30,31,30,31][t-1]}function mQ(e,t){let n=uQ(lQ(e));fQ(t);let r=uQ(lQ(kQ)).getTime(),i=uQ(lQ(AQ)).getTime();return dQ(new Date(Math.min(i,Math.max(r,n.getTime()+t*864e5))))}function hQ(e,t){let n=lQ(e);fQ(t);let r=Math.min(119987,Math.max(0,(n.year-1)*12+n.month-1+t)),i=Math.floor(r/12)+1,a=r%12+1;return dQ(uQ({year:i,month:a,day:Math.min(n.day,pQ(i,a))}))}function gQ(e,t){let n=e&&oQ(e)&&e<`0001-01-01`?kQ:e||`0001-01-01`,r=t||`9999-12-31`;if(lQ(n),lQ(r),n>r)throw RangeError(`Minimum date must not exceed maximum date.`);return{min:n,max:r}}function _Q(e,t){return cQ(e)&&e>=t.min&&e<=t.max}function vQ(e,t){return lQ(e),e<t.min?t.min:e>t.max?t.max:e}function yQ(e,t=1,n=gQ()){if(fQ(t),t<0||t>6)throw RangeError(`First weekday must be between 0 (Sunday) and 6.`);let r=lQ(e),i=uQ({...r,day:1}),a=(i.getUTCDay()-t+7)%7;return Array.from({length:42},(e,t)=>{let o=new Date(i.getTime()+(t-a)*864e5);if(o.getUTCFullYear()<1||o.getUTCFullYear()>9999)return{date:null,inMonth:!1,disabled:!0};let s=dQ(o);return{date:s,inMonth:o.getUTCMonth()+1===r.month,disabled:!_Q(s,n)}})}function bQ(e,t){return sQ(t,{calendar:`gregory`,timeZone:`UTC`,month:`long`,year:`numeric`}).format(uQ(lQ(e)))}function xQ(e,t=1){if(fQ(t),t<0||t>6)throw RangeError(`First weekday must be between 0 (Sunday) and 6.`);let n=sQ(e,{calendar:`gregory`,timeZone:`UTC`,weekday:`short`}),r=sQ(e,{calendar:`gregory`,timeZone:`UTC`,weekday:`long`});return Array.from({length:7},(e,i)=>{let a=uQ({year:2023,month:1,day:1+(t+i)%7});return{short:n.format(a),long:r.format(a)}})}function SQ(e){return typeof e==`string`&&MQ.test(e)}function CQ(e){return e.search(/[T ]/)===10?{date:e.slice(0,10),time:e.slice(11)}:null}function wQ(e){let t=typeof e==`string`?CQ(e):null;return!!(t&&cQ(t.date)&&SQ(t.time))}function TQ(e,t){let n=CQ(e)?.time;return`${t} ${n&&SQ(n)?n:`00:00`}`}function EQ(e){if(!wQ(e))return null;let{date:t,time:n}=CQ(e),[r,i=`00`]=[n.slice(0,5),n.slice(6)],[a=`00`,o=``]=i.split(`.`);return`${t}T${r}:${a.padEnd(2,`0`)}.${o.padEnd(3,`0`)}`}function DQ(e,t,n){let r=EQ(e);if(r===null)return!1;let i=t?EQ(t):null,a=n?EQ(n):null;return(i===null||r>=i)&&(a===null||r<=a)}function OQ(e,t){let n=sQ(`en-US`,{calendar:`gregory`,numberingSystem:`latn`,timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`}).formatToParts(e),r=e=>n.find(t=>t.type===e).value,i=`${r(`year`).padStart(4,`0`)}-${r(`month`)}-${r(`day`)}`;return lQ(i),i}var kQ,AQ,jQ,MQ,NQ=s((()=>{kQ=`0001-01-01`,AQ=`9999-12-31`,jQ=new Map,MQ=/^([01]\d|2[0-3]):[0-5]\d(:[0-5]\d(\.\d{1,3})?)?$/}));function PQ(e){let t;try{t=sQ(e,{year:`numeric`,month:`2-digit`,day:`2-digit`,timeZone:`UTC`,calendar:`gregory`}).formatToParts(Date.UTC(2006,10,22))}catch{t=[]}let n=t.filter(e=>[`year`,`month`,`day`].includes(e.type)).map(e=>e.type);if(n.length!==3)return{order:[`year`,`month`,`day`],sep:`-`,hint:`YYYY-MM-DD`};let r=t.find(e=>e.type===`literal`)?.value.trim()||`/`,i={year:`YYYY`,month:`MM`,day:`DD`};return{order:n,sep:r,hint:n.map(e=>i[e]).join(r)}}function FQ(e,t){let{year:n,month:r,day:i}=lQ(e),a={year:String(n).padStart(4,`0`),month:String(r).padStart(2,`0`),day:String(i).padStart(2,`0`)};return t.order.map(e=>a[e]).join(t.sep)}function IQ(e,t){if(BQ(e))return e;let n=e.trim().match(/^(\d{1,4})\D(\d{1,2})\D(\d{1,4})$/);if(!n)return;let r={};if(t.order.forEach((e,t)=>r[e]=n[t+1]),r.year.length!==4)return;let i=`${r.year}-${r.month.padStart(2,`0`)}-${r.day.padStart(2,`0`)}`;return cQ(i)?i:void 0}function LQ({id:e,words:t,calendarIcon:n,value:r,onChange:i,onBlur:a,onKeyDown:o,disabled:s,required:c,min:l,max:u,locale:d,timezone:f,now:p,firstDay:m=1,className:h=``,name:g,inputRef:_,placeholder:v,withTime:y=!1,popupRef:b,onOpenChange:x,"aria-label":S,"aria-invalid":C,"aria-describedby":w}){let T=y?CQ(r)?.date??r.slice(0,10):r,E=(0,RQ.useMemo)(()=>{try{return gQ(y?l?.slice(0,10):l,y?u?.slice(0,10):u)}catch{return null}},[l,u,y]),D=E??gQ(),O=OQ(p??new Date,f),k=()=>vQ(cQ(T)?T:O,D),[A,j]=(0,RQ.useState)(k),[M,N]=(0,RQ.useState)(!1),P=(0,RQ.useRef)(x);(0,RQ.useLayoutEffect)(()=>{P.current=x});let F=e=>{N(e),P.current?.(e)},[I,L]=(0,RQ.useState)(null),R=(0,RQ.useRef)(null),z=(0,RQ.useRef)(null),B=(0,RQ.useRef)(null);(0,RQ.useImperativeHandle)(_,()=>B.current,[]);let V=(0,RQ.useRef)(null),H=(0,RQ.useCallback)(e=>{V.current=e,b?.(e)},[b]),U=(0,RQ.useRef)(!1),W=(0,RQ.useRef)(!1),G=(0,RQ.useRef)(void 0),ee=(0,RQ.useRef)(!1),te=(0,RQ.useRef)(a);(0,RQ.useLayoutEffect)(()=>{te.current=a});let ne=(0,RQ.useId)(),K=(0,RQ.useId)(),re=(0,RQ.useMemo)(()=>PQ(d),[d]),[q,ie]=(0,RQ.useState)(null),ae=y?r:q??(cQ(r)?FQ(r,re):r),oe=y?t.dateTimePattern:re.hint;(0,RQ.useEffect)(()=>{q!==null&&r!==(IQ(q,re)??q)&&ie(null)},[r]);let se=yQ(A,m,D),ce=xQ(d,m);(0,RQ.useEffect)(()=>(L(z.current?.closest(`dialog, [role="dialog"]`)),()=>{clearTimeout(G.current)}),[]);let le=!E||r!==``&&(y?!wQ(r)||!_Q(T,D)||!DQ(r,l,u):!_Q(r,D));(0,RQ.useEffect)(()=>{B.current?.setCustomValidity(le?y?t.enterDateAndTime:t.enterDate(re.hint):``)},[le,y,re]),(0,RQ.useLayoutEffect)(()=>{if(!M)return;if(!E||s){F(!1);return}let e=vQ(cQ(T)?T:A,E);e!==A&&(W.current=!!V.current?.querySelector(`[data-date]:focus`),j(e))},[r,l,u,s]),(0,RQ.useLayoutEffect)(()=>{M&&W.current&&(V.current?.querySelector(`[data-date="${A}"]`)?.focus(),W.current=!1)},[A,M]);let ue=e=>!!(e&&(R.current?.contains(e)||V.current?.contains(e))),de=()=>{U.current&&(U.current=!1,ie(null),te.current?.())},fe=()=>{clearTimeout(G.current),G.current=setTimeout(()=>{ue(document.activeElement)||de()},0)},pe=e=>{e.relatedTarget?(clearTimeout(G.current),ue(e.relatedTarget)||de()):fe()},me=e=>{e&&(ee.current=!1,j(k())),F(e),e||fe()},J=()=>{let e=z.current;e?.isConnected&&(!I||I.isConnected&&!I.hasAttribute(`data-closed`))&&e.focus({preventScroll:!0})},he=e=>{ee.current=!0,ie(null),J(),i(y&&e?TQ(r,e):e),me(!1)},ge=e=>{W.current=!0,j(vQ(e,D))},_e=e=>{let t=se.findIndex(e=>e.date===A)%7,n={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7,Home:-t,End:6-t};Object.hasOwn(n,e.key)?(e.preventDefault(),e.stopPropagation(),ge(mQ(A,n[e.key]))):(e.key===`PageUp`||e.key===`PageDown`)&&(e.preventDefault(),e.stopPropagation(),ge(hQ(A,(e.key===`PageUp`?-1:1)*(e.shiftKey?12:1))))},ve=e=>{let t=lQ(e),n=new Date(0);return n.setUTCFullYear(t.year,t.month-1,t.day),sQ(d,{calendar:`gregory`,timeZone:`UTC`,dateStyle:`full`}).format(n)},ye=hQ(A,-1),be=hQ(A,1);return(0,zQ.jsx)(JB,{open:M&&!s&&!!E,onOpenChange:(e,t)=>{ee.current=!e&&t.reason===`escape-key`,ee.current&&J(),me(e)},children:(0,zQ.jsxs)(`span`,{ref:R,className:y?`date-field with-time`:`date-field`,onFocus:()=>{U.current=!0},onBlur:pe,children:[(0,zQ.jsx)(`input`,{ref:B,id:e,name:g,type:`text`,value:ae,className:`date-field-input ${h}`,placeholder:v??(y?t.dateTimePattern:re.hint),autoComplete:`off`,spellCheck:!1,disabled:s,required:c,"aria-required":c,"aria-label":S,"aria-invalid":C||le||void 0,"aria-describedby":[w,K].filter(Boolean).join(` `),onChange:e=>{let t=e.target.value;if(y)return i(t);ie(t),i(IQ(t,re)??t)},onKeyDown:e=>{e.altKey&&e.key===`ArrowDown`?(e.preventDefault(),e.stopPropagation(),E&&me(!0)):o?.(e)}}),(0,zQ.jsxs)(`span`,{id:K,className:`date-field-hint`,children:[y?t.dateAndTimeFormat:t.dateFormat(oe),` `,t.openWithKeys]}),(0,zQ.jsx)(PV,{render:(0,zQ.jsx)(`button`,{ref:z,type:`button`,className:`date-field-trigger`,disabled:s||!E,"aria-label":t.chooseDate(S||void 0)}),children:n}),(0,zQ.jsx)(HV,{container:I??pG(),children:(0,zQ.jsx)(WH,{anchor:()=>z.current?gU(z.current):null,positionMethod:`fixed`,side:`bottom`,align:`end`,sideOffset:6,collisionBoundary:_U(),collisionPadding:8,style:{zIndex:45},children:(0,zQ.jsxs)(cU,{ref:H,finalFocus:()=>{let e=z.current,t=document.activeElement;return ee.current&&e?.isConnected&&(!I||I.isConnected&&!I.hasAttribute(`data-closed`))&&(t===e||t===document.body||t===I)?e:!1},className:`date-field-popup`,"aria-label":t.calendar(S||void 0),initialFocus:()=>V.current?.querySelector(`[data-date="${A}"]`)??!0,children:[(0,zQ.jsxs)(`div`,{className:`date-field-head`,children:[(0,zQ.jsx)(`button`,{type:`button`,"aria-label":t.previousMonth,disabled:ye.slice(0,7)===A.slice(0,7)||ye.slice(0,7)<D.min.slice(0,7),onClick:()=>j(vQ(ye,D)),children:`←`}),(0,zQ.jsx)(`span`,{id:ne,"aria-live":`polite`,"aria-atomic":`true`,children:bQ(A,d)}),(0,zQ.jsx)(`button`,{type:`button`,"aria-label":t.nextMonth,disabled:be.slice(0,7)===A.slice(0,7)||be.slice(0,7)>D.max.slice(0,7),onClick:()=>j(vQ(be,D)),children:`→`})]}),(0,zQ.jsxs)(`table`,{className:`date-field-calendar`,role:`grid`,"aria-labelledby":ne,children:[(0,zQ.jsx)(`thead`,{children:(0,zQ.jsx)(`tr`,{children:ce.map(e=>(0,zQ.jsx)(`th`,{scope:`col`,"aria-label":e.long,children:e.short},e.long))})}),(0,zQ.jsx)(`tbody`,{children:Array.from({length:6},(e,t)=>(0,zQ.jsx)(`tr`,{children:se.slice(t*7,t*7+7).map((e,t)=>(0,zQ.jsx)(`td`,{"aria-selected":e.date===T,children:e.date&&(0,zQ.jsx)(`button`,{type:`button`,"data-date":e.date,"data-outside":!e.inMonth||void 0,"data-selected":e.date===T||void 0,"aria-current":e.date===O?`date`:void 0,disabled:e.disabled,tabIndex:e.date===A?0:-1,"aria-label":ve(e.date),onKeyDown:_e,onClick:()=>he(e.date),children:Number(e.date.slice(8))})},e.date??t))},t))})]}),(0,zQ.jsxs)(`div`,{className:`date-field-foot`,children:[(0,zQ.jsx)(`button`,{type:`button`,onClick:()=>he(``),children:t.clear}),(0,zQ.jsx)(`button`,{type:`button`,disabled:!_Q(O,D),onClick:()=>he(O),children:t.today})]})]})})})]})})}var RQ,zQ,BQ,VQ=s((()=>{RQ=d(m(),1),hU(),vU(),NQ(),mG(),zQ=d(O(),1),BQ=e=>cQ(e)})),HQ,UQ=s((()=>{ba(),HQ=pa({enterADateAndTime:`Enter a date and time as YYYY-MM-DD HH:MM within the allowed range.`,enterADateInYyyy:`Enter a date as {format} within the allowed range.`,yyyyMmDdHh:`YYYY-MM-DD HH:MM`,dateAndTimeFormat:`Date and time format: YYYY-MM-DD HH:MM.`,dateFormatIs:`Date format: {format}.`,altAndDownArrow:`Alt and Down arrow opens the calendar.`,chooseDateFor:`Choose date for {label}`,chooseDate:`Choose date`,calendar:`Calendar for {label}`,previousMonth:`Previous month`,nextMonth:`Next month`})}));function WQ(e){return(0,GQ.jsx)(LQ,{...e,words:KQ(),calendarIcon:(0,GQ.jsx)(Pe,{name:`calendar-blank`,size:18})})}var GQ,KQ,qQ=s((()=>{VQ(),Fe(),UQ(),GQ=d(O(),1),KQ=()=>({dateTimePattern:HQ(`yyyyMmDdHh`),enterDateAndTime:HQ(`enterADateAndTime`),enterDate:e=>HQ(`enterADateInYyyy`,{format:e}),dateAndTimeFormat:HQ(`dateAndTimeFormat`),dateFormat:e=>HQ(`dateFormatIs`,{format:e}),openWithKeys:HQ(`altAndDownArrow`),chooseDate:e=>e?HQ(`chooseDateFor`,{label:e}):HQ(`chooseDate`),calendar:e=>e?HQ(`calendar`,{label:e}):HQ(`chooseDate`),previousMonth:HQ(`previousMonth`),nextMonth:HQ(`nextMonth`),clear:HQ(`common.clear`),today:HQ(`common.today`)})})),JQ,YQ,XQ=s((()=>{pi(),JQ={activeApp:()=>ci().app(),inAppMode:()=>ci().inApp()},YQ=JQ}));function ZQ({className:e,load:t,couldNotLoad:n,threw:r}){let i=new Map,a=new Set,o=new Set,s=0;function c(e,t){i.set(e,t),s+=1;for(let e of o)e()}function l(e,r){a.has(r)||(a.add(r),t(e).then(e=>c(r,e),t=>{n(e,t),c(r,null)}))}let u=e=>(o.add(e),()=>{o.delete(e)}),d=()=>s;class f extends QQ.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){i.get(this.props.slot)!==null&&(r(this.props.id,e),c(this.props.slot,null))}render(){return this.state.failed?this.props.fallback:this.props.children}}function p({id:t,fallback:n,props:r}){(0,QQ.useSyncExternalStore)(u,d,d);let a=ci().components.useKey(t);(0,QQ.useEffect)(()=>{l(t,a)},[t,a]);let o=i.get(a);return o?(0,$Q.jsx)(f,{id:t,slot:a,fallback:n,children:(0,$Q.jsx)(`span`,{className:e,"data-component":t,children:(0,QQ.createElement)(o,r)})}):(0,$Q.jsx)($Q.Fragment,{children:n})}return p}var QQ,$Q,e$=s((()=>{QQ=d(m()),pi(),$Q=d(O())}));function t$(e,t){let n=YQ.activeApp()?.resources,r=n?.[e]?.inputs;if(r&&Object.hasOwn(r,t))return r[t].id;let i=n?.[e]?.display,a=i&&Object.hasOwn(i,t)?i[t]:void 0;return a?.slider?`${i$}slider`:a?.scan?`${i$}scan`:a?.signature&&typeof a.signature==`object`?`${i$}signature`:a?.format&&s$.has(a.format)?`${i$}${a.format}`:void 0}function n$({component:e,fallback:t,...n}){return(0,r$.jsx)(o$,{id:e,fallback:t,props:n})}var r$,i$,a$,o$,s$,c$=s((()=>{XQ(),pi(),e$(),r$=d(O(),1),i$=`mistri:`,a$=e=>`${i$}${e}`,o$=ZQ({className:`custom-input`,load:e=>e.startsWith(i$)?ci().components.builtIn(e.slice(7)):ci().components.load(e),couldNotLoad:(e,t)=>console.error(`the input "${e}" could not be loaded; its field is the platform's control.`,t),threw:(e,t)=>console.error(`the input "${e}" threw; its field is the platform's control.`,t)}),s$=new Set([`rating`,`color`,`time`,`month`,`year`,`json`])})),l$,u$=s((()=>{ba(),l$=pa({addRow:`Add row`,anEmailAddress:`an email address`,aWebAddressStarting:`a web address, starting https://`,aPhoneNumber:`a phone number`,aColor:`a color, such as #1d6a5a`,theFormHasAnInput:`The form has an input it does not ask for.`,isRequired:`{label} is required.`,requiredWord:`(required)`,optionalWord:`(optional)`,checkThisBoxTo:`Check this box to continue.`,mustBeAtLeast:`{label} must be at least {minLength} characters.`,mustBeCharactersOrFewer:`{label} must be {maxLength} characters or fewer.`,must:`{label} must be {value}.`,isNotInTheForm:`{label} is not in the form it takes.`,mustBeBefore:`{label} must be before {other}.`,mustBeLessThan:`{label} must be less than {other}.`,mustBeAfter:`{label} must be after {other}.`,mustBeMoreThan:`{label} must be more than {other}.`,hasCharactersAForm:`{label} has characters a form does not take.`,mustBeASafe:`{label} must be a safe whole number.`,hasMoreDecimalsThanTheCurrency:`{label} has more decimal places than the currency takes.`,mustBeOnOrAfter:`{label} must be on or after {min}.`,labelMustBeAt:`{label} must be at least {min}.`,mustBeOnOrBefore:`{label} must be on or before {max}.`,mustBeAtMost:`{label} must be at most {max}.`,chooseLabel:`Choose {label}.`,takesAtMostRows:`{label} takes at most {max} rows.`,mustBeANumber:`{label} must be a number.`,mustBeYes:`{label} must be yes or no.`,mustBeADate:`{label} must be a date.`,mustBeADateAndTime:`{label} must be a date and time.`,mustBeATime:`{label} must be a time of day.`,isNotInAForm:`{label} is not in a form it takes.`,choosePlaceholder:`Choose {label}`,chooseOne:`Choose one`,groupRow:`{label}, row {index}`,rowLabel:`Row`,removeRow:`Remove row {index} of {label}`,addRowTo:`Add row to {label}`,needsAtLeastRows:{one:`{label} needs at least {count} row.`,other:`{label} needs at least {count} rows.`},rowMatch:`row {match}`,needsAtLeastFiles:{one:`{label} needs at least {count} file.`,other:`{label} needs at least {count} files.`},takesAtMostFiles:{one:`{label} takes at most {count} file.`,other:`{label} takes at most {count} files.`},inTheFormItTakes:`in the form it takes`,chooseAlone:`Choose {label} on its own, or another.`})}));function d$(e,t){let n=sQ(`en-US`,{...h$,timeZone:t}).formatToParts(new Date(e)),r=e=>Number(n.find(t=>t.type===e)?.value??0);return{year:r(`year`),month:r(`month`),day:r(`day`),hour:r(`hour`),minute:r(`minute`),second:r(`second`)}}function f$(e,t,n,r,i,a,o=0){let s=new Date(0);return s.setUTCFullYear(e,t-1,n),s.setUTCHours(r,i,a,o),s.getTime()}function p$(e,t){if(!wQ(e))return;let{date:n,time:r}=CQ(e),[i,a,o=`0`]=r.split(`:`),[s,c=``]=o.split(`.`),l=f$(Number(n.slice(0,4)),Number(n.slice(5,7)),Number(n.slice(8,10)),Number(i),Number(a),Number(s),Number(c.padEnd(3,`0`))),u=864e5,d=[l-g$(l-u,t),l-g$(l+u,t)],f=l-(l%1e3+1e3)%1e3,p=d.filter(e=>{let n=d$(e,t);return f$(n.year,n.month,n.day,n.hour,n.minute,n.second)===f});return new Date(p.length?Math.min(...p):Math.max(...d)).toISOString()}function m$(e,t){let n=Date.parse(e);if(!/[zZ]|[+-]\d{2}(?::?\d{2})?$/.test(e)||!Number.isFinite(n))return;let r=d$(n,t),i=e=>String(e).padStart(2,`0`),a=r.second?`:${i(r.second)}`:``;return`${String(r.year).padStart(4,`0`)}-${i(r.month)}-${i(r.day)} ${i(r.hour)}:${i(r.minute)}${a}`}var h$,g$,_$=s((()=>{NQ(),h$={calendar:`gregory`,numberingSystem:`latn`,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`},g$=(e,t)=>{let n=d$(e,t);return f$(n.year,n.month,n.day,n.hour,n.minute,n.second)-(e-(e%1e3+1e3)%1e3)}})),v$=l({DateTimeInput:()=>y$});function y$({value:e,onChange:t,min:n,max:r,...i}){let a=hi(),o=e=>e&&(m$(e,a)??e),[s,c]=(0,b$.useState)(()=>o(e)??``),[l,u]=(0,b$.useState)(e);return e!==l&&(u(e),c(o(e)??``)),(0,x$.jsx)(WQ,{...i,withTime:!0,min:o(n),max:o(r),locale:mi(),timezone:a,now:_i(),value:s,onChange:e=>{c(e);let n=e.trim(),r=n?p$(n,a)??e:``;u(r),t(r)}})}var b$,x$,S$=s((()=>{b$=d(m()),qQ(),Yi(),_$(),x$=d(O())})),C$=l({ActionBar:()=>D$,Columns:()=>O$,HelpTip:()=>w$,ProgressBar:()=>T$,ReviewList:()=>k$,StepHeader:()=>E$});function w$({text:e,label:t,icon:n}){let[r,i]=(0,A$.useState)(!1),a=(0,A$.useId)(),o=(0,A$.useRef)(null);return(0,A$.useEffect)(()=>{if(!r)return;let e=e=>{o.current&&!o.current.contains(e.target)&&i(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[r]),(0,j$.jsxs)(`span`,{className:`help-tip`,ref:o,children:[(0,j$.jsx)(`button`,{type:`button`,className:`help-tip-button`,"aria-label":t,"aria-expanded":r,"aria-describedby":r?a:void 0,onClick:()=>i(!r),onKeyDown:e=>{e.key===`Escape`&&r&&(e.stopPropagation(),i(!1))},children:n??(0,j$.jsx)(`span`,{"aria-hidden":`true`,children:`i`})}),r?(0,j$.jsx)(`span`,{role:`tooltip`,id:a,className:`help-tip-text`,children:e}):null]})}function T$({value:e,max:t,min:n=0,label:r,decorative:i}){return(0,j$.jsx)(`div`,{className:`progress-bar`,...i?{"aria-hidden":!0}:{role:`progressbar`,"aria-label":r,"aria-valuemin":n,"aria-valuemax":t,"aria-valuenow":e},children:(0,j$.jsx)(`span`,{className:`progress-bar-fill`,style:{width:`${t>0?Math.min(100,e/t*100):0}%`}})})}function E$({title:e,lead:t,mark:n,level:r=1,id:i}){return(0,j$.jsxs)(`header`,{className:`step-header`,children:[(0,j$.jsxs)(r===1?`h1`:`h2`,{className:`step-title`,id:i,tabIndex:-1,children:[n?(0,j$.jsx)(`span`,{className:`step-mark`,"aria-hidden":`true`,children:n}):null,e]}),t?(0,j$.jsx)(`p`,{className:`step-lead`,children:t}):null]})}function D$({back:e,primary:t,className:n}){return(0,j$.jsxs)(`footer`,{className:n?`action-bar ${n}`:`action-bar`,children:[e?(0,j$.jsxs)(gG,{intent:`quiet`,size:`large`,className:`action-bar-back`,onClick:e.onClick,children:[e.icon,e.label]}):null,(0,j$.jsxs)(gG,{intent:`primary`,size:`large`,className:`action-bar-primary`,disabled:t.disabled,busy:t.busy,busyLabel:t.busyLabel,onClick:t.onClick,children:[t.label,t.icon]})]})}function O$({cols:e,children:t}){return(0,j$.jsx)(`div`,{className:`form-columns`,style:e?{"--form-columns":e}:void 0,children:t})}function k$({label:e,children:t}){return(0,j$.jsx)(`div`,{className:`review-list`,role:`group`,"aria-label":e,children:t})}var A$,j$,M$=s((()=>{A$=d(m(),1),yG(),j$=d(O(),1)})),N$=s((()=>{M$(),O()}));function P$(e){let{cards:t}=e,[n,r]=(0,F$.useState)(void 0),i=(0,F$.useRef)([]),a=t.findIndex(e=>e.on),o=n!==void 0&&n<t.length?n:Math.max(a,0),s=e=>{let n=(e+t.length)%t.length;r(n),i.current[n]?.focus()},c=(n,r)=>{let i=n.key===`ArrowDown`||n.key===`ArrowRight`?r+1:n.key===`ArrowUp`||n.key===`ArrowLeft`?r-1:n.key===`Home`?0:n.key===`End`?t.length-1:void 0;i===void 0?n.key===` `&&(n.preventDefault(),e.disabled||e.onToggle(r,!t[r].on)):(n.preventDefault(),s(i))};return(0,I$.jsx)(`div`,{className:`choice-cards`,role:`group`,"data-fit":e.fit,id:e.id,"aria-labelledby":e[`aria-labelledby`],"aria-describedby":e[`aria-describedby`],"aria-invalid":e[`aria-invalid`],children:t.map((t,n)=>(0,I$.jsxs)(`div`,{ref:e=>{i.current[n]=e},role:`checkbox`,"aria-checked":t.on,"aria-disabled":e.disabled||void 0,tabIndex:n===o?0:-1,className:`choice-card${t.on?` is-on`:``}`,onClick:()=>{r(n),e.disabled||e.onToggle(n,!t.on)},onFocus:()=>r(n),onKeyDown:e=>c(e,n),children:[t.icon?(0,I$.jsx)(`span`,{className:`choice-card-icon`,"aria-hidden":`true`,children:t.icon}):null,(0,I$.jsxs)(`span`,{className:`choice-card-label`,children:[t.label,t.help?(0,I$.jsx)(`span`,{className:`choice-card-help`,children:t.help}):null]}),(0,I$.jsx)(`span`,{className:`choice-box`,"aria-hidden":`true`})]},t.key))})}var F$,I$,L$=s((()=>{F$=d(m(),1),yJ(),N$(),I$=d(O(),1)}));function R$(e,t,n,r,i,a,o,s,c,l=2){let u=IF(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return MF(n.current,u)?void 0:u}var z$=s((()=>{BF()}));function B$(){let e=G$.useContext(K$);if(!e)throw Error(LI(22));return e}function V$(){let e=G$.useContext(q$);if(!e)throw Error(LI(23));return e}function H$(){let e=G$.useContext(J$);if(!e)throw Error(LI(24));return e}function U$(){return G$.useContext(X$)}function W$(){return G$.useContext(Y$)}var G$,K$,q$,J$,Y$,X$,Z$=s((()=>{RI(),G$=d(m(),1),K$=G$.createContext(void 0),q$=G$.createContext(void 0),J$=G$.createContext(void 0),Y$=G$.createContext(!1),X$=G$.createContext(``)})),Q$,$$=s((()=>{_X(),EX(),Q$={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?CX(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>cX(t,e,n)):cX(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemProps:e=>e.itemProps,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight}}));function e1(e){return e==null?void 0:`${e}-popup`}function t1(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}var n1=s((()=>{}));function r1(e){return Array.isArray(e)?e.map(e=>r1(e)).join(`,`):e==null?``:String(e)}var i1=s((()=>{}));function a1(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${r1(e.locale)}|${JSON.stringify(t)}`,r=o1.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=wX(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=wX(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=wX(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return o1.set(n,a),a}var o1,s1=s((()=>{i1(),EX(),o1=new Map})),c1,l1=s((()=>{m(),s1(),c1=a1}));function u1(e,t=!1){let{overflowY:n}=bj(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var d1=s((()=>{Aj()})),f1,p1,m1=s((()=>{f1=Symbol(`none`),p1={value:f1,index:-1}}));function h1(e,t,n){let r=e.get(t);if(r!==void 0||n===gX)return r;for(let[r,i]of e)if(cX(r,t,n))return i}var g1=s((()=>{_X()}));function _1(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:l=!1,selectionMode:u,onItemHighlighted:d,name:f,form:p,disabled:m=!1,readOnly:h=!1,required:g=!1,inputRef:_,grid:v=!1,items:y,filteredItems:b,filter:x,filterQuery:S,openOnInputClick:C=!0,autoHighlight:w=!1,keepHighlight:T=!1,highlightItemOnHover:E=!0,loopFocus:D=!0,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:A=gX,virtualized:j=!1,inline:M=!1,fillInputOnItemPress:N=!0,modal:P=!1,limit:F=-1,autoComplete:I=`list`,formAutoComplete:L,locale:R,submitOnItemClick:z=!1}=e,{clearErrors:B}=kX(),{setDirty:V,validityData:H,setFilled:U,name:W,disabled:G,setTouched:ee,setFocused:te,validationMode:ne,validation:K}=JY(),re=XV(),q=aX({id:t}),ie=c1({locale:R}),ae=Array.isArray(y)?null:y;if(ae&&typeof ae.label!=`function`)throw Error(LI(100));let oe=ae?ae.data:y,se=ae?.value,ce=se?void 0:oe,le=v1.useMemo(()=>{if(!b||!se)return;let e=SX(b),t=e.map(se),n;return{values:t,findItem(r,i){if(!n){n=new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return h1(n,r,i)}}},[b,se]),ue=v1.useMemo(()=>ae?e=>ae.label(e,A,e=>{let t=le?.findItem(e,A);return t==null?wX(e,O):ae.itemLabel(t)}):O,[ae,O,le,A]),de=v1.useMemo(()=>ae?Object.assign(e=>ae.itemLabel(e),{selected:e=>wX(e,ue)}):O,[ae,ue,O]);function fe(e){return wX(e,ue)}let[pe,me]=v1.useState(!1),[J,he]=v1.useState(null),ge=v1.useRef(J),_e=v1.useRef([]),ve=v1.useRef([]),ye=v1.useRef(null),be=v1.useRef(null),xe=v1.useRef(null),Se=v1.useRef(null),Ce=v1.useRef(null),we=v1.useRef(!0),Te=v1.useRef(!1),Ee=v1.useRef(null),De=v1.useRef(null),Oe=v1.useRef(null),ke=v1.useRef(p1),Ae=v1.useRef(null),je=v1.useRef([]),Me=v1.useRef(null),Ne=G||m,Pe=W??f,Fe=u===`multiple`,Ie=u===`single`,Le=s!==void 0||o!==void 0,Re=oe!==void 0,ze=b!==void 0,Be;Be=w===`always`?`always`:w?`input-change`:!1;let[Ve,He]=jU({controlled:i,default:Fe?r??HM:r,name:`Combobox`,state:`selectedValue`}),Ue=v1.useMemo(()=>x===null?()=>!0:x===void 0?t1(ie,de):x,[x,ie,de]),We=jM(()=>Le?o??``:Ie?fe(Ve):``).current,[Ge,Ke]=jU({controlled:s,default:We,name:`Combobox`,state:`inputValue`}),[qe,Je]=jU({controlled:c,default:l,name:`Combobox`,state:`open`}),Ye=xX(oe),Xe=!qe&&J!==null?J:String(Ge).trim(),Ze=Ie?fe(Ve):``,Qe=Ie&&!pe&&Xe!==``&&Ze.length===Xe.length&&ie.contains(Ze,Xe),$e=Qe?``:S??Xe,et=Re&&ze&&Qe&&(!ae||ae.hasValue(Ve,A)),tt=v1.useMemo(()=>oe?SX(oe):HM,[oe]),nt=v1.useMemo(()=>{if(b&&!et)return b;if(!oe)return HM;if(Ye){let e=oe,t=[],n=0;for(let r of e){if(F>-1&&n>=F)break;let e=F>-1?F-n:1/0,i=$e===``?r.items.slice(0,e):[];if($e!==``)for(let t of r.items){if(i.length>=e)break;Ue(t,$e,de)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if($e===``)return F>-1?tt.slice(0,F):tt;let e=[];for(let t of tt){if(F>-1&&e.length>=F)break;Ue(t,$e,de)&&e.push(t)}return e},[b,et,oe,Ye,$e,F,Ue,de,tt]),rt=v1.useMemo(()=>{if(le&&nt===b)return le.values;let e=SX(nt);return se?e.map(e=>se(e)):e},[nt,b,le,se]),it=jM(()=>{let e=null;return M&&qe&&Re&&u!==`none`&&(e=pX(rt,Ve,A,Fe)),new KR({id:q,labelId:void 0,selectedValue:Ve,open:qe,items:ce,selectionMode:u,name:Pe,form:p,disabled:Ne,readOnly:h,required:g,grid:v,virtualized:j,openOnInputClick:C,itemToStringLabel:ue,isItemEqualToValue:A,modal:P,autoHighlight:Be,submitOnItemClick:z,hasInputValue:Le,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:M,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:UM,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:u===`none`},{onOpenChangeComplete:VM,setOpen:VM,setInputValue:VM,setSelectedValue:VM,setIndices:VM,handleSelection:VM,forceMount:VM,requestSubmit:VM,listRef:_e,labelsRef:ve,popupRef:ye,emptyRef:Ce,inputRef:be,startDismissRef:xe,endDismissRef:Se,keyboardActiveRef:we,chipsContainerRef:Ee,clearRef:De,valuesRef:je,pointerDownItemRef:Me,selectionEventRef:Oe},Q$)}).current,at=u===`none`?Ge:Ve,ot=v1.useMemo(()=>u===`none`?at:Array.isArray(Ve)?Ve.map(e=>TX(e,k)):TX(Ve,k),[at,k,u,Ve]),st=$(d),ct=$(n),lt=it.useState(`activeIndex`),ut=it.useState(`selectedIndex`),dt=it.useState(`positionerElement`),ft=it.useState(`listElement`),pt=it.useState(`triggerElement`),mt=it.useState(`inputElement`),ht=it.useState(`inputGroupElement`),gt=it.useState(`inline`),_t=it.useState(`inputInsidePopup`),vt=it.useState(`inputOwnsFormValue`),yt=Ie&&!_t&&Ge===Ze,bt=iF(pt),{mounted:xt,setMounted:St,transitionStatus:Ct}=rz(qe),{openMethod:wt,triggerProps:Tt}=kV(qe),Et=$(()=>ot);$Y(_t?bt:be,q,at,Et,!Ne,f);let Dt=$(()=>{oe?ve.current=rt.map(fe):it.set(`forceMounted`,!0)}),Ot=$((e,t,n)=>{if(t===-1){if(ke.current===p1)return;ke.current=p1}else ke.current={value:e,index:t};st(e,zte(n,void 0,{index:t}))}),kt=$(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),it.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?Ot(void 0,-1,r):Ot(je.current[n],n,r)}),At=$((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Te.current=n.reason===NP,n.reason===`input-change`){qe&&J!==null&&he(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&me(!0),Ae.current={hasQuery:e};let n=it.state.listElement;if(!it.state.virtualized&&n){let e=ye.current;for(let t of wj(n.firstElementChild??n)){if(!dj(t)||(e?!AN(e,t):t.getAttribute(`role`)===`dialog`))break;if(u1(t)){t.scrollTop=0;break}}}e&&Be&&it.state.activeIndex==null&&(qe||gt)&&it.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&it.state.inputInsidePopup&&(Ae.current={hasQuery:!1,selection:!0});Ke(t)}}),jt=$(e=>{let t=!e&&_t&&!gt&&Ge!==``&&(String(Ge).trim()===J||Ge===Ze);!e&&(t||Ge===``||yt)&&me(!1),he(null),t&&At(``,GP(NP))}),Mt=$((t,n)=>{if(qe!==t&&(n.reason===`escape-key`&&Re&&rt.length===0&&!Ce.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&J!==null&&jt(n.reason===MP),!t&&pe&&(Ie?(gt||he(Xe),Xe===``&&me(!1)):Fe&&(gt||he(Xe),_t&&kt({activeIndex:null}),(!_t||gt)&&At(``,GP(NP,n.event,void 0,{isItemPress:n.reason===AP})))),Je(t),!t&&_t&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(ee(!0),te(!1),ne===`onBlur`)))){let e=u===`none`?Ge:Ve;K.commit(e)}}),Nt=$((e,t)=>{a?.(e,t),!t.isCanceled&&(He(e),(u===`none`&&ye.current&&N||Ie&&!it.state.inputInsidePopup)&&At(fe(e),GP(t.reason,t.event)))}),Pt=$((e,t)=>{let n=jN(e),r=Oe.current??e;Oe.current=null;let i=GP(AP,r),a=n?.closest(`a`)?.getAttribute(`href`);if(a)a.startsWith(`#`)&&Mt(!1,i);else if(Fe){let e=Array.isArray(Ve)?Ve:[],n=uX(e,t,A),r=n?hX(e,t,A):[...e,t];if(Nt(r,i),i.isCanceled||!(be.current&&be.current.value.trim()!==``))return;if(it.state.inputInsidePopup){At(``,GP(NP,i.event,void 0,{isItemPress:!0}));let e=Ae.current;e&&!n&&(e.toggledValue=t)}else Mt(!1,i)}else{if(Nt(t,i),i.isCanceled)return;Mt(!1,i)}}),Ft=$(()=>{let e=K.inputRef.current?.form??it.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),It=$(()=>{if(St(!1),ct?.(!1),me(!1),he(null),kt(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Fe&&be.current&&be.current.value!==``&&!Te.current&&At(``,GP(NP)),Ie){if(it.state.inputInsidePopup)be.current&&be.current.value!==``&&At(``,GP(NP));else{let e=fe(Ve);be.current&&be.current.value!==e&&At(e,GP(e===``?NP:TP))}}}),Lt=v1.useMemo(()=>gt&&dt?{current:dt.closest(`[role="dialog"]`)}:ye,[gt,dt]);dz({enabled:!e.actionsRef,open:qe,ref:Lt,onComplete(){qe||It()}}),v1.useImperativeHandle(e.actionsRef,()=>({unmount:It}),[It]),Q(function(){let e=ge.current!==null&&J===null;if(ge.current=J,qe&&(!e||!Re)||(qe||(Me.current=null),u===`none`))return;let t=Re?rt:je.current;kt({selectedIndex:pX(t,Ve,A,Fe)})},[qe,J,Ve,u,Fe,Re,rt,A,kt]),Q(()=>{oe&&(je.current=rt,_e.current.length=rt.length)},[oe,rt]),Q(()=>{let e=Ae.current;if(e){let t=qe||gt||it.state.positionerElement?.hidden===!1;if(e.hasQuery)Be&&t&&it.set(`activeIndex`,0),Ae.current=null;else if(String(Ge).trim()===``&&(Ae.current=null,t)){let t=e.selection;Be===`always`&&!t&&it.state.selectionMode===`none`&&it.set(`activeIndex`,0),queueMicrotask(()=>{if(!it.state.open&&!it.state.inline||be.current&&be.current.value.trim()!==``)return;let n=it.state.selectedValue,r=it.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:it.state.selectionMode!==`none`&&n!=null){let t=Re||ze?rt:je.current,i=dX(t,e.toggledValue,it.state.isItemEqualToValue);it.set(`activeIndex`,i===-1?pX(t,n,it.state.isItemEqualToValue,r):i)}else t?it.set(`activeIndex`,null):Be===`always`&&it.set(`activeIndex`,0)})}}if(!qe&&!gt)return;let t=Re||ze?rt:je.current,n=it.state.activeIndex;if(n==null){if(Be===`always`&&t.length>0){it.set(`activeIndex`,0);return}Ot(void 0,-1,TP);return}if(n>=t.length){Ot(void 0,-1,TP),it.set(`activeIndex`,null);return}let r=t[n],i=ke.current.value,a=i!==f1&&cX(r,i,it.state.isItemEqualToValue);ke.current.index===n&&a||Ot(r,n,TP)},[lt,Be,Ot,ze,Re,rt,gt,qe,it,Ge]),Q(()=>{U(u===`none`?String(Ge)!==``:Fe?Array.isArray(Ve)&&Ve.length>0:Ve!=null)},[U,u,Ge,Ve,Fe]),v1.useEffect(()=>{Re&&Be&&rt.length===0&&kt({activeIndex:null})},[Re,Be,rt.length,kt]);function Rt(){qe&&Xe!==``&&Xe!==String(We)&&!yt&&me(!0)}function zt(){qe&&J!==null&&jt(!1)}let Bt=!1;function Vt(){!Bt&&Ge!==Ze&&(Bt=!0,At(Ze,GP(TP)))}function Ht(){u!==`none`&&(B(Pe),V(lX(Ve,H.initialValue,A)),K.change(Ve),Ie&&!Le&&!_t&&Vt())}function Ut(){Ie&&!Le&&!_t&&!pe&&Vt()}function Wt(){u===`none`&&(B(Pe),V(Ge!==H.initialValue),K.change(Ge))}TV(Xe,Rt),TV(qe,zt),TV(Ve,Ht),TV(Ze,Ut),TV(oe,Ut),TV(Ge,Wt);let Gt=Wz({open:gt?!0:qe,onOpenChange:Mt,elements:{reference:_t?pt:mt,floating:dt}}),Kt=v?`grid`:`listbox`,qt=qe||gt,Jt=qt?`true`:`false`,Yt=v1.useMemo(()=>{let e=mt?.tagName===`INPUT`,t=mt==null||e,n=t||qt,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=Jt,r[`aria-haspopup`]=Kt,r[`aria-controls`]=qt?ft?.id:void 0,r[`aria-autocomplete`]=h?`none`:I),{reference:r,floating:{role:`presentation`}}},[mt,qt,Jt,Kt,ft?.id,I,h]),Xt=fR(Gt,{enabled:!Ne&&C,event:`mousedown-only`,toggle:!1,touchOpenDelay:_t?0:100,reason:PP}),Zt=mR(Gt,{enabled:!Ne&&!gt,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:gt?!0:void 0,outsidePress(e){let t=jN(e);return!AN(pt,t)&&!AN(De.current,t)&&!AN(Ee.current,t)&&!AN(ht,t)}}),Qt=bB(Gt,{enabled:!Ne,id:q,listRef:_e,activeIndex:lt,selectedIndex:ut,virtual:!0,loopFocus:D,allowEscape:D&&!Be,focusItemOnOpen:pe||u===`none`&&!Be?!1:`auto`,focusItemOnHover:E,resetOnPointerLeave:!T,orientation:v?`horizontal`:void 0,rtl:re===`rtl`,disabledIndices:HM,grid:v?R$:void 0,onNavigate(e,t){(t||qe)&&Ct!==`ending`&&kt(t?{activeIndex:e,type:we.current?RP:zP}:{activeIndex:e})}}),$t=v1.useMemo(()=>$I(Qt.reference,{onKeyDown(e){v&&it.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},Zt.reference,Xt.reference,Yt.reference),[Qt.reference,Zt.reference,Xt.reference,Yt.reference,v,it]),en=v1.useMemo(()=>$I(Dz,Zt.floating),[Zt.floating]),tn=v1.useMemo(()=>$I(Qt.floating,Yt.floating),[Qt.floating,Yt.floating]),nn=v1.useMemo(()=>{let e=Qt.item;return e?{...e,onFocus:void 0}:UM},[Qt.item]);it.useContextCallback(`setOpen`,Mt),it.useContextCallback(`setInputValue`,At),it.useContextCallback(`setSelectedValue`,Nt),it.useContextCallback(`setIndices`,kt),it.useContextCallback(`handleSelection`,Pt),it.useContextCallback(`forceMount`,Dt),it.useContextCallback(`requestSubmit`,Ft),it.useContextCallback(`onOpenChangeComplete`,n),kY(()=>{it.update({inline:M,popupProps:en,listProps:tn,inputProps:$t,triggerProps:Tt,itemProps:nn})});let rn={id:q,selectedValue:Ve,open:qe,mounted:xt,transitionStatus:Ct,items:ce,inline:M,popupProps:en,listProps:tn,inputProps:$t,triggerProps:Tt,itemProps:nn,openMethod:wt,selectionMode:u,name:Pe,form:p,disabled:Ne,readOnly:h,required:g,grid:v,virtualized:j,openOnInputClick:C,itemToStringLabel:ue,modal:P,autoHighlight:Be,isItemEqualToValue:A,submitOnItemClick:z,hasInputValue:Le};Q(()=>{it.update({...rn,inputOwnsFormValue:u===`none`&&(M||!it.state.inputInsidePopup)})},[it,...Object.values(rn)]);let an=ZP(_,K.inputRef),on=v1.useMemo(()=>({query:Xe,hasItems:Re,filteredItems:nt,flatFilteredValues:rt}),[Xe,Re,nt,rt]),sn=v1.useMemo(()=>Array.isArray(at)?``:TX(at,k),[at,k]),cn=Fe&&Array.isArray(Ve)&&Ve.length>0,ln=Fe||u===`none`&&vt?void 0:Pe,un=v1.useMemo(()=>!Fe||!Array.isArray(Ve)||!Pe?null:Ve.map(e=>{let t=TX(e,k);return(0,y1.jsx)(`input`,{type:`hidden`,form:p,name:Pe,value:t,disabled:Ne},t)}),[Fe,Ve,p,Pe,k,Ne]),dn=(0,y1.jsxs)(v1.Fragment,{children:[e.children,(0,y1.jsx)(`input`,{...K.getValidationProps(Ne,{onFocus(){_t?pt?.focus():(be.current||pt)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Ne||h)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=GP(TP,e.nativeEvent),i=()=>je.current.findIndex(e=>TX(e,k).toLowerCase()===n||fe(e).toLowerCase()===n);function a(){if(Fe)return;if(u===`none`){At(t,r);return}let e=i();e===-1&&(e=je.current.findIndex((e,t)=>{let r=ve.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:je.current[e];a!=null&&Nt?.(a,r)}Ie&&(Dt(),oe&&i()===-1&&it.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:q&&ln==null?`${q}-hidden-input`:void 0,form:p,name:ln,autoComplete:L,disabled:Ne,required:g&&!cn,readOnly:h,value:sn,ref:an,style:ln?TF:wF,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),un]});return(0,y1.jsx)(K$.Provider,{value:it,children:(0,y1.jsx)(q$.Provider,{value:Gt,children:(0,y1.jsx)(Y$.Provider,{value:Re,children:(0,y1.jsx)(J$.Provider,{value:on,children:(0,y1.jsx)(X$.Provider,{value:Ge,children:dn})})})})})}var v1,y1,b1=s((()=>{RI(),v1=d(m(),1),NU(),eN(),jY(),mF(),rF(),oF(),EF(),PM(),YR(),WM(),Aj(),IB(),z$(),XR(),KP(),WP(),Z$(),$$(),pz(),QY(),eX(),MX(),sX(),n1(),l1(),az(),jV(),d1(),DV(),BY(),Uz(),hL(),EX(),_X(),m1(),$V(),g1(),y1=d(O(),1)}));function x1(e){let{openOnInputClick:t=!1,value:n,defaultValue:r,onValueChange:i,mode:a=`list`,itemToStringValue:o,...s}=e,c=(a===`inline`||a===`both`)&&!e.readOnly,l=a===`inline`||a===`none`,u=n!==void 0,[d,f]=S1.useState(r??``),[p,m]=S1.useState(``);S1.useEffect(()=>{(u||!c)&&m(``)},[n,u,c]);let h;h=c&&p!==``?p:u?n??``:d;let g=c1({locale:s.locale}),_=String((u?n:d)??``).trim(),v=l||s.filter===null?null:s.filter??g.contains;function y(e,t){m(``),u||f(e),i?.(e,t)}function b(t,n){e.onItemHighlighted?.(t,n),n.reason!==`pointer`&&m(c&&t!=null?wX(t,o):``)}return(0,C1.jsx)(_1,{...s,itemToStringLabel:o,openOnInputClick:t,selectionMode:`none`,fillInputOnItemPress:!0,filter:v,filterQuery:a===`both`?_:void 0,autoComplete:a,inputValue:h,defaultInputValue:r,onInputValueChange:y,onItemHighlighted:b})}var S1,C1,w1=s((()=>{S1=d(m(),1),b1(),l1(),EX(),WP(),C1=d(O(),1)})),T1,E1,D1=s((()=>{lP(),T1=`data-popup-side`,E1=`data-list-empty`})),O1,k1=s((()=>{lP(),qY(),D1(),O1={...oP,...KY,popupSide:e=>e?{[T1]:e}:null,listEmpty:e=>e?{[E1]:``}:null}}));function A1(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function j1(){return H$().filteredItems.length===0}function M1(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function N1(e,t){let n=e>=t-1?t-2:e;return n>=0?n:void 0}function P1(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}var F1=s((()=>{Z$()}));function I1(){return L1.useContext(R1)}var L1,R1,z1=s((()=>{L1=d(m(),1),R1=L1.createContext(void 0)}));function B1(e){let t=V1.useContext(H1);if(t===void 0&&!e)throw Error(LI(21));return t}var V1,H1,U1=s((()=>{RI(),V1=d(m(),1),H1=V1.createContext(void 0)})),W1,G1,K1,q1=s((()=>{W1=d(m(),1),rF(),EF(),uU(),KP(),WP(),Z$(),G1=d(O(),1),K1=W1.forwardRef(function(e,t){let n=B$(),{buttonRef:r,getButtonProps:i}=uV({native:!1}),a=ZP(t,r);function o(e){n.context.setOpen(!1,GP(jP,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,G1.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:TF})})})),J1,Y1,X1,Z1=s((()=>{J1=d(m(),1),mF(),SN(),_V(),TL(),Z$(),k1(),QY(),qY(),iX(),z1(),XR(),U1(),KP(),WP(),$V(),q1(),F1(),Y1=d(O(),1),X1=J1.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,setFocused:d,validationMode:f,validation:p}=JY(),{labelId:m}=tX(),h=I1(),g=!!B1(!0),_=B$(),v=U$(),y=XV(),b=_.useState(`required`),x=_.useState(`disabled`),S=_.useState(`readOnly`),C=_.useState(`name`),w=_.useState(`form`),T=_.useState(`selectionMode`),E=_.useState(`autoHighlight`),D=_.useState(`inputProps`),O=_.useState(`triggerProps`),k=_.useState(`open`),A=_.useState(`mounted`),j=_.useState(`selectedValue`),M=_.useState(`id`),N=_.useState(`inline`),P=_.useState(`modal`),F=!!E,I=A1(_),L=l||x||i,R=j1(),z=g||N,B=!z||P,V=gV(a??(z?void 0:M)),H=g?WY:c,[U,W]=J1.useState(null),G=J1.useRef(!1),ee=J1.useRef(null),te=J1.useRef(!1),ne=T===`none`&&!g,K=$(e=>{let t=g||_.state.inline;t&&!_.state.hasInputValue&&_.context.setInputValue(``,GP(TP)),_.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:ne})}),re=g?s:p.getValidationProps(L,s);function q(){_.context.setIndices({activeIndex:null,selectedIndex:null,type:_.context.keyboardActiveRef.current?RP:zP})}function ie(){_.context.keyboardActiveRef.current=!1}let ae={...H,open:k,disabled:L,readOnly:S,popupSide:I,listEmpty:R};function oe(e){if(!h)return;let t,{highlightedChipIndex:n}=h,r=h.chipsRef.current.length,[i,a]=M1(y);return n===void 0?(e.key===i&&(e.currentTarget.selectionStart??0)===0&&j.length>0&&(e.preventDefault(),t=r>0?r-1:void 0),t):(e.key===i?(e.preventDefault(),t=n>0?n-1:void 0):e.key===a?(e.preventDefault(),t=n<r-1?n+1:void 0):(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),t=N1(n,j.length),q()),t)}let se=gL(`input`,e,{state:ae,ref:[t,_.context.inputRef,K],props:[D,O,{value:U??v,"aria-readonly":S||void 0,"aria-required":b||void 0,"aria-labelledby":m,disabled:L,readOnly:S,required:T===`none`?b:void 0,form:w,...ne&&C&&{name:C},id:V,onFocus(){if(d(!0),!N||!te.current)return;te.current=!1;let e=ee.current;e!=null&&Object.hasOwn(_.context.valuesRef.current,e)&&_.context.setIndices({activeIndex:e})},onBlur(){u(!0),d(!1);let e=_.state.activeIndex;if(N&&e!==null&&E!==`always`&&(ee.current=e,te.current=!0,_.context.setIndices({activeIndex:null})),f===`onBlur`){let e=T===`none`?v:j;p.commit(e)}},onCompositionStart(e){uN||(G.current=!0,W(e.currentTarget.value))},onCompositionEnd(e){G.current=!1;let t=e.currentTarget.value;W(null),_.context.setInputValue(t,GP(MP,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=G.current||!r;function a(e){!S&&!L&&e&&i&&(_.context.setOpen(!0,GP(MP,t)),F||q())}if(G.current){let n=e.currentTarget.value;W(n),n===``&&!_.state.openOnInputClick&&!_.state.inputInsidePopup&&_.context.setOpen(!1,GP(NP,t));let r=n.trim(),i=F&&r!==``;a(r),k&&_.state.activeIndex!==null&&!i&&q();return}let o=GP(MP,t);if(_.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=GP(NP,t);s&&!_.state.inputInsidePopup&&(T===`single`&&_.context.setSelectedValue(null,c),_.state.openOnInputClick||_.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),k&&_.state.activeIndex!==null&&!F&&q()},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(_.context.keyboardActiveRef.current=!0,L||S){S&&e.key===`Enter`&&k&&_.state.activeIndex!==null&&CN(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=y===`rtl`;if(e.key===`Home`){CN(e);let n=hN&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){CN(e);let i=hN&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!A&&e.key===`Escape`){let t=T===`multiple`&&Array.isArray(j)?j.length===0:j===null,n=GP(IP,e.nativeEvent),r=T===`multiple`?[]:null;_.context.setInputValue(``,n),_.context.setSelectedValue(r,n),t||_.state.inline||n.isPropagationAllowed||e.stopPropagation();return}if(h&&e.key===`Backspace`&&t.value===``&&h.highlightedChipIndex===void 0&&Array.isArray(j)&&j.length>0){let t=h.chipsRef.current.length,n=t>0?t-1:j.length-1,r=j.filter((e,t)=>t!==n);q(),_.context.setSelectedValue(r,GP(TP,e.nativeEvent));return}let i=h?.highlightedChipIndex!==void 0,a=oe(e);if(h?.setHighlightedChipIndex(a),a===void 0?i&&_.context.inputRef.current?.focus():h?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&k){let t=_.state.activeIndex,n=e.nativeEvent;if(t===null){if(N)return;_.context.setOpen(!1,GP(TP,n));return}CN(e),P1(_,t,n)}},onPointerMove:ie,onPointerDown:ie},re],stateAttributesMapping:O1}),ce=g?(0,Y1.jsx)(ZY.Provider,{value:XY,children:se}):se;return(0,Y1.jsxs)(J1.Fragment,{children:[k&&B&&(0,Y1.jsx)(K1,{ref:_.context.startDismissRef}),ce]})})}));function Q1(){return $1.useContext(e0)}var $1,e0,t0=s((()=>{$1=d(m(),1),O(),e0=$1.createContext(null)}));function n0(e){let{children:t}=e,{filteredItems:n}=H$(),r=Q1(),i=r?r.items:n;return(0,i0.jsx)(r0.Fragment,{children:i.map(t)})}var r0,i0,a0=s((()=>{r0=d(m(),1),Z$(),t0(),i0=d(O(),1)})),o0,s0,c0,l0=s((()=>{o0=d(m(),1),mF(),TL(),Z$(),U1(),a0(),vW(),XR(),F1(),s0=d(O(),1),c0=o0.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=B$(),l=V$(),u=!!B1(!0),{filteredItems:d,hasItems:f}=H$(),p=c.useState(`selectionMode`),m=c.useState(`grid`),h=c.useState(`readOnly`),g=c.useState(`listProps`),_=c.useState(`virtualized`),v=c.useState(`forceMounted`),y=p===`multiple`,b=d.length===0,x=$(e=>{c.set(`positionerElement`,e)}),S=$(e=>{c.set(`listElement`,e)}),C=o0.useMemo(()=>typeof o==`function`?n||=(0,s0.jsx)(n0,{children:o}):o,[o]),w={empty:b},T=l.useState(`floatingId`),E=gL(`div`,e,{state:w,ref:[t,S,u?null:x],props:[g,{children:C,tabIndex:-1,id:T,role:m?`grid`:`listbox`,"aria-multiselectable":y?`true`:void 0,"aria-readonly":!m&&h?!0:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;CN(e),P1(c,t,e.nativeEvent)}},onKeyDownCapture(){c.context.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.context.keyboardActiveRef.current=!1}},s]});if(_)return E;let D=f&&!v?void 0:c.context.labelsRef;return(0,s0.jsx)(lW,{elementsRef:c.context.listRef,labelsRef:D,children:E})})}));function u0(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function d0(){let e=JM(),t=f0.useRef(null);return f0.useEffect(()=>{if(cN)return;let n=t.current;if(n==null)return;let r=u0(n);if(r==null)return;let i=r.data,a=`${i}${p0}`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}var f0,p0,m0=s((()=>{f0=d(m(),1),SN(),ZM(),p0=`⁠`}));function h0(){let e=g0.useContext(_0);if(e===void 0)throw Error(LI(20));return e}var g0,_0,v0=s((()=>{RI(),g0=d(m(),1),_0=g0.createContext(void 0)})),y0,b0,x0,S0=s((()=>{y0=d(m(),1),IB(),Z$(),v0(),b0=d(O(),1),x0=y0.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=B$(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,b0.jsx)(_0.Provider,{value:n,children:(0,b0.jsx)(zL,{ref:t,...r})}):null})})),C0,w0,T0,E0=s((()=>{C0=d(m(),1),eN(),mF(),GV(),Z$(),U1(),F1(),bH(),v0(),jL(),wH(),OH(),VH(),w0=d(O(),1),T0=C0.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=OL,style:g,..._}=e,v=B$(),y=V$(),b=h0(),x=v.useState(`modal`),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`openMethod`),T=v.useState(`positionerElement`),E=v.useState(`triggerElement`),D=v.useState(`inputElement`),O=v.useState(`inputGroupElement`),k=v.useState(`inputInsidePopup`),A=v.useState(`transitionStatus`),j=j1(),M=hH({anchor:i??(k?E:O??D),floatingRootContext:y,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});RH(S&&x,w===`touch`,T,E);let N={open:S,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:j};Q(()=>{v.set(`popupSide`,M.side)},[v,M.side]);let P=$(e=>{v.set(`positionerElement`,e)}),F=DH(e,N,{styles:M.positionerStyles,transitionStatus:A,props:_,refs:[t,P],hidden:!C,inert:!S});return(0,w0.jsxs)(H1.Provider,{value:M,children:[C&&x&&(0,w0.jsx)(CH,{inert:WV(!S),cutout:O??D??E}),F]})})})),D0,O0,k0,A0,j0=s((()=>{D0=d(m(),1),eN(),IB(),TL(),Z$(),lP(),U1(),pz(),KN(),XR(),EH(),q1(),n1(),F1(),O0=d(O(),1),k0={...sP,...GN},A0=D0.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=B$(),l=B1(),u=V$(),d=c.useState(`mounted`),f=c.useState(`open`),p=c.useState(`openMethod`),m=c.useState(`popupProps`),h=c.useState(`transitionStatus`),g=c.useState(`inputInsidePopup`),_=c.useState(`inputElement`),v=c.useState(`modal`),y=c.useState(`id`),b=j1(),x=s.id??(g?e1(y):void 0);Q(()=>(c.set(`popupId`,c.context.popupRef.current?.id||x),()=>{c.set(`popupId`,void 0)}),[c,x]),dz({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete(!0)}});let S=gL(`div`,e,{state:{open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:b},ref:[t,c.context.popupRef],props:[m,{id:x,role:g?`dialog`:`presentation`,onFocus(e){let t=jN(e.nativeEvent);p!==`touch`&&(AN(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},TH(h),s],stateAttributesMapping:k0}),C=a===void 0?g?e=>e===`touch`?c.context.popupRef.current:_:!1:a,w;w=o??(g?void 0:!1);let T=!g||v;return(0,O0.jsx)(sR,{context:u,disabled:!d,modal:T,openInteractionType:p,initialFocus:C,returnFocus:w,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:(0,O0.jsxs)(D0.Fragment,{children:[S,T&&(0,O0.jsx)(K1,{ref:c.context.endDismissRef})]})})})})),M0,N0,P0=s((()=>{M0=d(m(),1),N0=M0.createContext(void 0)}));function F0(){return I0.useContext(L0)}var I0,L0,R0=s((()=>{I0=d(m(),1),L0=I0.createContext(!1)}));function z0(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=V0.useRef(null),m=GU({guess:!0,index:l,textRef:p}),h=B$(),g=F0(),_=W$(),v=h.useState(`selectionMode`),y=h.useState(`disabled`),b=h.useState(`readOnly`),x=h.useState(`isItemEqualToValue`),S=y||u,C=v!==`none`,w=l??i??m.index,T=w!==-1,E=h.useState(`id`),D=h.useState(`isActive`,w),O=h.useState(`isSelected`,c),k=h.useState(`itemProps`),A=V0.useRef(null),j=E!=null&&T?`${E}-${w}`:void 0,M=O&&C;Q(()=>{if(!T||!r&&l==null)return;let e=h.context.listRef.current;return e[w]=A.current,()=>{delete e[w]}},[T,r,w,l,h]),Q(()=>{if(!T||_)return;let e=h.context.valuesRef.current;return e[w]=c,()=>{delete e[w]}},[T,_,w,c,h]),Q(()=>{if(!T||_)return;let e=h.state.selectedValue,t=h.state.selectedIndex;h.state.selectionMode===`multiple`&&Array.isArray(e)?t=mX(w,c,h.context.valuesRef.current,e,x,t):cX(c,e,x)&&(t=w),h.set(`selectedIndex`,t)},[T,_,h,w,c,x]);let{getButtonProps:N,buttonRef:P}=uV({disabled:S,focusableWhenDisabled:!0,native:d,composite:!0}),F={disabled:S,selected:M,highlighted:D};function I(e){function t(){h.context.handleSelection(e,c)}h.state.submitOnItemClick?(H0.flushSync(t),h.context.requestSubmit()):t()}let L={id:j,role:g?`gridcell`:`option`,"aria-selected":C?M:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){S||b||I(e.nativeEvent)},onMouseUp(e){let t=h.context.pointerDownItemRef.current===e.currentTarget;h.context.pointerDownItemRef.current=null,!(S||b||e.button!==0||t||!D)&&I(e.nativeEvent)}},R=gL(`div`,t,{ref:[P,n,m.ref,A],state:F,props:[k,L,f,N]}),z=V0.useMemo(()=>({selected:M,textRef:p}),[M,p]);return(0,U0.jsx)(N0.Provider,{value:z,children:R})}function B0(e){let{componentProps:t,forwardedRef:n}=e,r=B$().useState(`isItemEqualToValue`),{flatFilteredValues:i}=H$(),a=dX(i,t.value??null,r);return(0,U0.jsx)(z0,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}var V0,H0,U0,W0,G0=s((()=>{V0=d(m(),1),H0=d(g(),1),eN(),Z$(),qU(),TL(),P0(),uU(),R0(),_X(),U0=d(O(),1),W0=V0.memo(V0.forwardRef(function(e,t){let n=B$().useState(`virtualized`);return n&&e.index==null?(0,U0.jsx)(B0,{componentProps:e,forwardedRef:t}):(0,U0.jsx)(z0,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})}))})),K0,q0=s((()=>{G0(),K0=W0})),J0,Y0,X0=s((()=>{J0=d(m(),1),TL(),Z$(),m0(),Y0=J0.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=H$(),c=B$(),l=d0(),u=s.length===0?a:null;return gL(`div`,e,{ref:[t,c.context.emptyRef,l],props:[{children:u,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})})})),Z0=s((()=>{w1(),Z$(),mF(),ZM(),SF(),TL(),uU(),k1(),QY(),iX(),XR(),GW(),KP(),WP(),IB(),sX(),n1(),F1(),Z1(),Aj(),vP(),az(),KN(),pz(),lP(),l0(),m0(),S0(),E0(),j0(),U1(),RI(),t0(),eN(),_V(),q0(),R0(),a0(),X0(),l1()})),Q0=s((()=>{Z0()}));function $0({text:e,onText:t,items:n,itemKey:r,itemLabel:i,itemClassName:a,renderItem:o,onPick:s,open:c,onOpenChange:l,inputProps:u,inputRef:d,popupRef:f,anchorRef:p,fit:m=`min-width`,popupClassName:h,listClassName:g,empty:_,emptyClassName:v,portal:y=`dialog`,autoHighlight:b=!0,onHighlight:x}){let S=(0,e2.useRef)(null),[C,w]=(0,e2.useState)(null);(0,e2.useEffect)(()=>{w(y===`body`?null:S.current?.closest(`dialog, [role="dialog"]`))},[y]);let[T,E]=(0,e2.useState)(null);(0,e2.useLayoutEffect)(()=>{let e=p?.current??S.current;if(!c||m!==`width`||!e)return;let t=()=>{let t=Jo(e).width;E(t>0?t:null)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[c,m,p]);let D=e=>{S.current=e,typeof d==`function`?d(e):d&&(d.current=e)},{onKeyDown:O,onFocus:k,...A}=u;return(0,t2.jsxs)(x1,{items:n,filteredItems:n,itemToStringValue:i,value:e,onValueChange:(e,n)=>{n.reason!==`item-press`&&t(String(e??``))},open:c,onOpenChange:l,openOnInputClick:!0,autoHighlight:b,onItemHighlighted:x&&(e=>x(e)),children:[(0,t2.jsx)(X1,{...A,ref:D,onFocus:k,onKeyDown:e=>{O?.(e),!e.defaultPrevented&&e.key===`Escape`&&c&&(e.preventDefault(),e.stopPropagation(),l(!1))}}),(0,t2.jsx)(x0,{container:C??pG(),children:(0,t2.jsx)(T0,{anchor:()=>{let e=p?.current??S.current;return e?gU(e):null},positionMethod:`fixed`,side:`bottom`,align:`start`,sideOffset:4,collisionBoundary:_U(),collisionPadding:8,style:{zIndex:40,...m===`width`?{width:T===null?`var(--anchor-width)`:`${T}px`,maxWidth:`var(--available-width)`}:{}},children:(0,t2.jsx)(A0,{ref:f,className:h,style:{...m===`width`?{width:`100%`}:{minWidth:`var(--anchor-width)`,maxWidth:`var(--available-width)`}},children:(0,t2.jsxs)(c0,{className:g,children:[_===void 0?null:(0,t2.jsx)(Y0,{className:v,children:_}),n.map(e=>(0,t2.jsx)(K0,{value:e,className:t=>a(e,t.highlighted),onClick:()=>s(e),children:o(e)},r(e)))]})})})})]})}var e2,t2,n2=s((()=>{e2=d(m(),1),Q0(),Qo(),vU(),mG(),t2=d(O(),1)}));function r2({typed:e,asked:t,placeholder:n=!1,rows:r,label:i}){let a=e.trim(),o=t===a&&!n;if(o)return{choices:r??[],answered:o};let s=a.toLowerCase();return{choices:(r??[]).filter(e=>i(e).toLowerCase().includes(s)),answered:o}}var i2=s((()=>{})),a2,o2=s((()=>{ba(),a2=pa({choicesCouldNotBeLoaded:`Choices could not be loaded. Try again.`,loadingChoices:`Loading choices…`,noMatchingChoices:`No matching choices.`,loadingName:`Loading…`,nameCouldNotBeLoaded:`Its name could not be loaded.`,tryAgain:`Try again`,noLongerAvailable:`No longer available. Change this answer.`})}));function s2(e){throw Error(`${e}: invalid form declaration.`)}function c2(e,t){return e===null?null:typeof e==`boolean`||typeof e==`string`&&e.length<=T2||typeof e==`number`&&Number.isFinite(e)&&Math.abs(e)<=2**53-1?e:s2(t)}function l2(e){return Object.freeze(e)}function u2(e,t){return{label:``,dialect:`sqlite`,readAt:``,foreignKeys:[],tables:[{name:e,schema:``,id:e,isView:!1,columns:[...t]}]}}function d2(e){let[t,n,...r]=e.split(`.`);return!r.length&&n!==void 0&&[t,n].every(e=>E2.test(e)&&!D2.has(e))}function f2(e,t,n){if((!E2.test(e.column)||D2.has(e.column))&&(!n||!d2(e.column)))throw Error(n?`${t}: "${e.column}" goes past one reference; a validation reads the record's own columns and, through one reference, that record's (order_id.status).`:`${t}: "${e.column}" is a path; a condition here reads the record's own columns.`);let r=e=>(Array.isArray(e)?e:[e]).map(e=>c2(e,t));if(e.other!==void 0){let n=O2[e.op];return n&&E2.test(e.other)&&!D2.has(e.other)||s2(t),{field:e.column,operator:n,values:[],other:e.other}}if(e.op===`isNull`)return{field:e.column,operator:`eq`,values:[null]};if(e.op===`isNotNull`)return{field:e.column,operator:`ne`,values:[null]};if(e.op===`in`)return{field:e.column,operator:`eq`,values:r(e.value)};let i=O2[e.op];if(!i)throw Error(`${t}: "${e.op}" matches text, which a condition here cannot; compare with =, !=, <, <=, >, >=, in or is empty.`);return{field:e.column,operator:i,values:r(e.value)}}function p2(e,t,n,r=`record`,i=!1){if(typeof e!=`string`||!e.trim()||e.length>2e3)throw Error(`${t}: a condition is query-language text, like "status = shipped".`);let a=Dn(`${r} ${e}`,n?{schema:u2(r,n),columnValues:!0}:{});if(a.errors[0]?.message===`me is the signed-in person, and nobody is named here to be it. Quote it ("me") to mean the text.`)throw Error(`${t} compares with me. A form's conditions and a validation read the record's own values, where the session is not; show the field always, or narrow who may write it with roles.`);if(a.errors.length)throw Error(`${t}: ${a.errors[0].message}`);let o=a.query;if(o.orderBy.length||o.columns.length||o.limit!==void 0)throw Error(`${t}: a condition is only a condition — no sort, show or limit.`);if(!o.filter.groups.length)throw Error(`${t}: a condition is query-language text, like "status = shipped".`);let s=o.filter.groups.map(e=>l2(e.map(e=>l2(f2(e,t,i)))));if(s.flat().length>16)throw Error(`${t}: a condition compares at most 16 times.`);return l2(s)}function m2(e){let t=e.type.trim().toLowerCase();if(/^(?:bool|boolean)$/.test(t))return`boolean`;if(/^(?:(?:tiny|small|medium|big)?int(?:eger)?|int[248]|(?:small|big)?serial|numeric|decimal|real|double(?: precision)?|float[48]?)(?:\s*\(\s*\d+(?:\s*,\s*\d+)?\s*\))?(?: unsigned)?$/.test(t))return`number`;if(/^(?:date)$/.test(t))return`date`;if(/^(?:timestamptz(?:\(\d+\))?|timestamp(?:\(\d+\))? with time zone)$/.test(t))return`instant`;if(/^(?:datetime|timestamp)(?:\(\d+\))?(?: without time zone)?$/.test(t))return`datetime`;if(e.allowed||/^(?:text|(?:tiny|medium|long)text|n?varchar|(?:character varying)|n?char|character|uuid|clob)(?:\(\d+\))?$/.test(t)||t.startsWith(`enum(`))return`text`}function h2(e){if(typeof e==`bigint`&&(e=e.toString()),typeof e==`number`){if(!Number.isFinite(e)||Math.abs(e)>2**53-1)return;e=String(e)}if(typeof e!=`string`||e.length>T2)return;let t=/^([+-]?)(?:(\d+)(?:\.(\d*))?|\.(\d+))(?:[eE]([+-]?\d{1,4}))?$/.exec(e.trim());if(!t)return;let n=Number(t[5]??0);if(Math.abs(n)>T2)return;let r=t[3]??t[4]??``,i=((t[2]??`0`)+r).replace(/^0+/,``)||`0`,a=r.length-n;for(;i.endsWith(`0`)&&i!==`0`;)i=i.slice(0,-1),a--;return{coefficient:BigInt((t[1]===`-`?`-`:``)+i),scale:i===`0`?0:a}}function g2(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return!1;let[,n,r,i]=t,a=Number(n),o=Number(r),s=Number(i),c=[31,a%4==0&&(a%100!=0||a%400==0)?29:28,31,30,31,30,31,31,30,31,30,31];return a>=1&&o>=1&&o<=12&&s>=1&&s<=c[o-1]}function _2(e,t){if(e instanceof Date&&t===`instant`){let t=Date.prototype.getTime.call(e);if(!Number.isFinite(t))return;e=new Date(t).toISOString()}if(typeof e!=`string`||e.length>64)return;if(t===`date`)return g2(e)?e:void 0;let n=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|[+-]\d{2}(?::?\d{2})?)?$/.exec(e);if(!n||!g2(n[1])||Number(n[2])>23||Number(n[3])>59||Number(n[4]??0)>59)return;let[,r,i,a,o=`00`,s=``,c]=n;if(t===`datetime`)return c?void 0:`${r}T${i}:${a}:${o}.${s.padEnd(9,`0`)}`;if(!c)return;let l=0;if(c!==`Z`){let e=/^([+-])(\d{2})(?::?(\d{2}))?$/.exec(c),t=Number(e[2]),n=Number(e[3]??0);if(t>14||n>59||t===14&&n!==0)return;l=(t*60+n)*(e[1]===`-`?-1:1)}let u=Date.parse(`${r}T${i}:${a}:${o}Z`)-l*6e4;return String(BigInt(u)*1000000n+BigInt(s.padEnd(9,`0`)))}function v2(e,t){let n=m2(e);if(!n)return;if(t===null)return{kind:`null`};if(n===`number`){let r=h2(t);return!r||/int|serial/i.test(e.type)&&r.scale>0?void 0:{kind:n,value:r}}if(n===`boolean`)return t===!0||t===1||t===1n||typeof t==`string`&&/^(true|yes|1|t)$/i.test(t.trim())?{kind:n,value:!0}:t===!1||t===0||t===0n||typeof t==`string`&&/^(false|no|0|f)$/i.test(t.trim())?{kind:n,value:!1}:void 0;if(n===`text`)return typeof t==`string`&&t.length<=T2?{kind:n,value:t}:void 0;let r=_2(t,n);return r===void 0?void 0:{kind:n,value:r}}function y2(e,t,n){if(!e||!n)return`unknown`;if(e.kind===`null`||n.kind===`null`){if(t!==`eq`&&t!==`ne`)return`unknown`;let r=e.kind===n.kind;return t===`eq`?r:!r}if(e.kind!==n.kind)return`unknown`;let r;if(e.kind===`number`&&n.kind===`number`){let t=Math.max(e.value.scale,n.value.scale),i=e.value.coefficient*10n**BigInt(t-e.value.scale),a=n.value.coefficient*10n**BigInt(t-n.value.scale);r=i<a?-1:+(i>a)}else if(e.kind===`instant`&&n.kind===`instant`){let t=BigInt(e.value),i=BigInt(n.value);r=t<i?-1:+(t>i)}else if(e.kind===`boolean`&&n.kind===`boolean`){if(t!==`eq`&&t!==`ne`)return`unknown`;r=e.value===n.value?0:1}else if(typeof e.value==`string`&&typeof n.value==`string`){if(e.kind===`text`&&t!==`eq`&&t!==`ne`)return`unknown`;r=e.value<n.value?-1:+(e.value>n.value)}else return`unknown`;switch(t){case`eq`:return r===0;case`ne`:return r!==0;case`lt`:return r<0;case`lte`:return r<=0;case`gt`:return r>0;case`gte`:return r>=0}}function b2(e,t){let n=e.filter(e=>e.name===t);return n.length===1?n[0]:void 0}function x2(e,t){let n=Object.getOwnPropertyDescriptor(e,t);return n&&Object.hasOwn(n,`value`)?n.value:void 0}function S2(e,t,n){let r=b2(n,e.field);if(!r)return`unknown`;if(e.other!==void 0){let i=b2(n,e.other);return!i||m2(r)!==m2(i)?`unknown`:y2(v2(r,x2(t,e.field)),e.operator,v2(i,x2(t,e.other)))}let i=e.values.map(n=>y2(v2(r,x2(t,e.field)),e.operator,v2(r,n)));return i.includes(`unknown`)?`unknown`:i.some(e=>e===!0)}function C2(e,t,n){let r=e.map(e=>e.map(e=>S2(e,t,n)));return r.flat().includes(`unknown`)?`unknown`:r.some(e=>e.every(e=>e===!0))}function w2(e,t,n){if(n==null||n===``)return null;let r=e.columns.find(e=>e.name===t);if(!r)return null;if(gt(r))return n===!0||n===1||/^(1|true|t|yes|y)$/i.test(String(n));let i=ht(r.type);if(i===`number`){let e=Number(n);return Number.isFinite(e)?e:null}if(i===`date`){let e=String(n);return/^\d{4}-\d{2}-\d{2}$/.test(e)?{day:e}:Number.isNaN(Date.parse(e))?null:{instant:new Date(e)}}return String(n)}var T2,E2,D2,O2,k2=s((()=>{St(),Yn(),T2=4096,E2=/^[^\s.\x00-\x1f\x7f]{1,256}$/u,D2=new Set([`__proto__`,`prototype`,`constructor`]),O2={"=":`eq`,"!=":`ne`,"<":`lt`,"<=":`lte`,">":`gt`,">=":`gte`}})),A2=s((()=>{cr()})),j2=s((()=>{Yn()})),M2=s((()=>{cr(),A2(),j2()})),N2=s((()=>{cr(),k2(),M2()})),P2,F2=s((()=>{N2(),cr(),P2=/^(number|code|sku|ref|reference|stock_ref)$|_(number|code|no|ref|reference)$/i}));function I2(e,t){let n=t.references?ct(e,t.references.table):void 0,r=n&&ft(n);return n&&r&&!pt(n).includes(r)?r:void 0}function L2(e,t,n,r){let i=e=>t.columns.find(t=>t.name===e),a=n?r?.[n]?.subtitle:void 0;if(typeof a==`string`&&a!==n&&i(a))return{path:a,declared:!0};let o=t.columns.filter(e=>e.name!==n&&!e.primaryKey&&!e.references),s=o.find(e=>H2(e)&&P2.test(e.name)&&(t.unique??[]).includes(e.name));if(s)return{path:s.name,declared:!1};let c=o.find(e=>H2(e)&&B2.test(e.name));if(c)return{path:c.name,declared:!1};let l=e?t.columns.find(t=>t.name!==n&&t.references&&!t.nullable&&I2(e,t)):void 0;if(l)return{path:`${l.name}.${I2(e,l)}`,declared:!1};let u=o.find(e=>ht(e.type)===`date`&&V2.test(e.name));return u?{path:u.name,declared:!1}:void 0}function R2(e){if(e==null||e===``)return;let t=String(e);return/^\d{4}-\d{2}-\d{2}[T ]\d{2}:/.test(t)?t.slice(0,10):t}function z2(e){let t=new Set,n=new Set;for(let r of e)(t.has(r)?n:t).add(r);return n}var B2,V2,H2,U2=s((()=>{F2(),St(),B2=/(^|_)e?mail(_address)?$/i,V2=/^(created|opened|started|joined|hired|registered)(_at|_on|_date)?$|^(date_)?(created|opened)$/i,H2=e=>ht(e.type)===`text`}));function W2(e,t,n,r,i){let a=J2(e,t,n,r);q2.delete(a),q2.set(a,i),q2.size>K2&&q2.delete(q2.keys().next().value)}function G2(e,t,n,r){return q2.get(J2(e,t,n,r))}var K2,q2,J2,Y2=s((()=>{K2=500,q2=new Map,J2=(e,t,n,r)=>JSON.stringify([n,typeof t==`string`?t:[t.visitor.app,t.visitor.via??``],e.from,e.by,e.labelColumn,e.query??``,typeof r,String(r)])})),X2,Z2=s((()=>{ba(),X2=pa({aFile:`A file`,signed:`Signed`})}));function Q2(e,t){let n=``,r=0;for(let i of e){if(r>=t.length)break;t4.test(i)?n+=t[r++]:n+=i}return n}function $2(e,t,n,r){let i=Number.isInteger(e)?0:r?void 0:n===void 0||Number.isInteger(n)?0:2;try{return new Intl.NumberFormat(mi(),{style:`currency`,currency:t||vi(),currencyDisplay:`narrowSymbol`,minimumFractionDigits:i,maximumFractionDigits:i}).format(e)}catch{return e.toLocaleString(mi())}}function e4(e){let t=e||vi();try{return new Intl.NumberFormat(mi(),{style:`currency`,currency:t,currencyDisplay:`narrowSymbol`}).formatToParts(0).find(e=>e.type===`currency`)?.value??t}catch{return t}}var t4,n4=s((()=>{Yi(),t4=/[0a*]/}));function r4(e,t){a4.set(e,t)}function i4(e){let t=a4.get(e);t?.url&&URL.revokeObjectURL(t.url),a4.delete(e)}var a4,o4,s4=s((()=>{a4=new Map,o4=e=>a4.get(e)}));function c4(e){return(e.type===`text`||e.type===`textarea`)&&`sensitive`in e&&!!e.sensitive}function l4(e,t){let n=new Set,r=[...e];for(let e=Math.max(r.length-4,r.length>4?0:r.length);e<r.length;e++)n.add(e);let i=r.map((e,t)=>n.has(t)?e:`•`);if(!t)return i.join(``);let a=0,o=``;for(let e of t){if(a>=i.length)break;o+=e===`0`||e===`a`||e===`*`?i[a++]:e}return o+i.slice(a).join(``)}function u4(e,t,n){if(t==null||t===``)return`—`;if(e.type===`reference`&&n)return(typeof t==`string`||typeof t==`number`?n(e,t):void 0)??`…`;let r=`mask`in e&&typeof e.mask==`string`?e.mask:void 0;if(c4(e))return l4(String(t),e.mask);if(e.type===`boolean`)return X2(t?`common.yes`:`common.no`);if(e.type===`files`){let e=Array.isArray(t)?t:[t];return e.length?e.map(e=>o4(String(e))?.name??X2(`aFile`)).join(`, `):`—`}if(e.type===`signature`)return X2(`signed`);if(e.type===`date`&&/^\d{4}-\d{2}-\d{2}$/.test(String(t)))return new Date(`${String(t)}T00:00:00Z`).toLocaleDateString(mi(),{timeZone:`UTC`,dateStyle:`medium`});if(e.type===`money`&&Number.isFinite(Number(t)))return $2(Number(t),e.currency,e.step,e.minor);if(r&&typeof t==`string`)return Q2(r,t);if(e.type===`choice`)return e.options.find(e=>e.value===t)?.label??String(t);if(e.type===`choices`){let n=Array.isArray(t)?t:[t];return n.length?n.map(t=>e.options.find(e=>e.value===t)?.label??String(t)).join(`, `):`—`}if(e.type===`group`){let r=f4(e,t,n);return r.length?r.join(`; `):`—`}return String(t)}function d4(e,t,n){let r=e.flatMap(e=>{let r=t[e.name];if(!p4(r))return[];if(e.type===`boolean`)return r?[e.label]:[];if(e.type===`reference`){let t=(typeof r==`string`||typeof r==`number`)&&n?n(e,r):void 0;return t===void 0?[]:[t]}return[u4(e,r,n)]});return r.length?r.join(`, `):void 0}function f4(e,t,n){let r=t=>e.fields.flatMap(r=>{let i=t?.[r.name];return p4(i)?[e.fields.length>1?`${r.label}: ${u4(r,i,n)}`:u4(r,i,n)]:[]});return e.repeat?(Array.isArray(t)?t:[]).map(e=>r(e).join(`, `)).filter(Boolean):r(t)}var p4,m4=s((()=>{Yi(),Z2(),n4(),s4(),p4=e=>e!=null&&e!==``&&!(Array.isArray(e)&&!e.length)})),h4=s((()=>{})),g4,_4=s((()=>{ba(),g4=pa({choose:`Choose…`,loading:`Loading…`,couldNotLoad:`The choices could not be loaded.`,nothingToChoose:`Nothing to choose from.`,noMatches:`Nothing matches.`,firstOnly:`The first {count} only. Type to search.`,path:`Path`})})),v4=l({TreePicker:()=>y4});function y4({from:e,by:t,labelColumn:n,parent:r,where:i,ask:a,scope:o,value:s,onChange:c,known:l,id:u,ariaLabel:d,listLabel:f,describedBy:p,invalid:m,required:h,disabled:g,placeholder:_,inputRef:v}){let y=$G(),b=(0,b4.useId)(),x=`${b}-tree`,S=`${b}-trail`,[C,w]=(0,b4.useState)(new Map),[T,E]=(0,b4.useState)(new Map),[D,O]=(0,b4.useState)(new Set),[k,A]=(0,b4.useState)(new Map),[j,M]=(0,b4.useState)(new Set),[N,P]=(0,b4.useState)(!1),[F,I]=(0,b4.useState)(``),[L,R]=(0,b4.useState)(!1),[z,B]=(0,b4.useState)(``),[V,H]=(0,b4.useState)(),[U,W]=(0,b4.useState)(),G=(0,b4.useRef)(C);G.current=C;let ee=(0,b4.useRef)(new Set),te=JSON.stringify([o,e,t,n,r,i??``]),[ne,K]=(0,b4.useState)(te);ne!==te&&(K(te),w(new Map),E(new Map),O(new Set),A(new Map),M(new Set),H(void 0),ee.current=new Set);let re=`show ${[...new Set([t,n,r])].join(`, `)}`,q=e=>{let i=e?.[t];if(!(typeof i==`string`||typeof i==`number`&&Number.isSafeInteger(i)))return null;let a=e[r];return{key:String(i),value:i,label:String(e[n]??i),parent:T4(a)?null:String(a)}},ie=e=>{if(!e.length)return;let t=new Map(G.current);for(let n of e)t.set(n.key,n);G.current=t,w(t)},ae=(e,t)=>y.fetchQuery({queryKey:[`tree-picker`,o,e,t],staleTime:3e4,queryFn:async()=>{let n=await a(`/api/run`,{q:e,limit:t,offset:0,count:`none`});if(n.errors?.length||!Array.isArray(n.rows))throw Error(g4(`couldNotLoad`));return n.rows}}),oe=t=>y.fetchQuery({queryKey:[`tree-picker`,o,`branches`,e,r,i??``,t],staleTime:3e4,queryFn:async()=>{let n=await a(`/api/breakdown`,{text:`${e} ${sn(i,`${r} in (${t.map(pn).join(`, `)})`)} count as children by ${r}`,limit:t.length});if(n.errors?.length||!Array.isArray(n.rows))throw Error(g4(`couldNotLoad`));return new Set(n.rows.filter(e=>Number(e.children)>0).map(e=>String(e[r])))}}),se=async t=>{if(ee.current.has(t))return;ee.current.add(t),E(e=>new Map(e).set(t,`loading`));let a=G.current.get(t),o=t===``?`${r} is empty`:`${r} = ${pn(a?a.value:t)}`;try{let r=await ae(`${e} ${sn(i,o)} ${re} sort ${n}`,201),a=r.slice(0,S4).map(q).filter(e=>e!==null);if(ie(a),E(e=>new Map(e).set(t,a.map(e=>e.key))),r.length>S4&&O(e=>new Set(e).add(t)),t!==``&&A(e=>new Map(e).set(t,a.length>0)),!a.length)return;let s=await oe(a.map(e=>e.value)).catch(()=>void 0);s&&A(e=>{let t=new Map(e);for(let e of a)t.has(e.key)&&t.get(e.key)===!1||t.set(e.key,s.has(e.key));return t})}catch{ee.current.delete(t),E(e=>new Map(e).set(t,`error`))}},ce=(e,t=C)=>{let n=[],r=new Set;for(let i=t.get(e);i&&!r.has(i.key)&&n.length<=w4;i=i.parent===null?void 0:t.get(i.parent))r.add(i.key),n.unshift(i);return n},le=async n=>{let r=e=>[...new Set(e.flatMap(e=>e.parent===null||G.current.has(e.parent)?[]:[e.parent]))],i=r(n);for(let n=0;n<w4&&i.length;n++){let n=(await ae(`${e} ${t} in (${i.map(pn).join(`, `)}) ${re}`,i.length)).map(q).filter(e=>e!==null);ie(n),i=r(n)}},ue=T4(s)?void 0:String(s);(0,b4.useEffect)(()=>{if(s===void 0||s===``)return;let n=!0,r=G.current.get(String(s));return(r?Promise.resolve(r):ae(`${e} ${sn(i,`${t} = ${pn(s)}`)} ${re}`,1).then(e=>{let t=q(e[0]);return t&&n&&ie([t]),t})).then(e=>e&&n?le([e]):void 0).catch(()=>{}),()=>{n=!1}},[s,te]);let de=L&&F.trim()!==``;(0,b4.useEffect)(()=>{let e=setTimeout(()=>B(F.trim()),150);return()=>clearTimeout(e)},[F]),(0,b4.useEffect)(()=>{if(!N||!de||!z)return;let t=!0,r=`${n} contains ${JSON.stringify(z)}`;return ae(`${e} ${sn(i,r)} ${re} sort ${n}`,C4).then(async e=>{let n=e.map(q).filter(e=>e!==null);ie(n),await le(n).catch(()=>{}),t&&H({for:z,keys:n.map(e=>e.key)})}).catch(()=>t&&H({for:z,error:!0})),()=>{t=!1}},[N,de,z,te]);let fe=(0,b4.useRef)(!1);(0,b4.useEffect)(()=>{if(!N||de){N||(fe.current=!1);return}if(se(``),fe.current||!ue)return;let e=ce(ue);if(!e.length||e[0].parent!==null)return;fe.current=!0;let t=e.slice(0,-1);M(e=>new Set([...e,...t.map(e=>e.key)]));for(let e of t)se(e.key);W(ue)},[N,de,ue,C]);let pe=e=>k.get(e)!==!1,me=[];if(de){let e=V?.for===F.trim()?V:void 0;if(!e)me.push({key:`note:`,depth:1,note:g4(`loading`)});else if(`error`in e)me.push({key:`note:`,depth:1,note:g4(`couldNotLoad`)});else if(!e.keys.length)me.push({key:`note:`,depth:1,note:g4(`noMatches`)});else for(let t of e.keys){let e=C.get(t);e&&me.push({key:t,depth:1,node:e,path:ce(t).slice(0,-1).map(e=>e.label)})}}else{let e=(t,n,r)=>{let i=T.get(t);if(i===void 0||i===`loading`)return void me.push({key:`note:${t}`,depth:n,note:g4(`loading`)});if(i===`error`)return void me.push({key:`note:${t}`,depth:n,note:g4(`couldNotLoad`)});!i.length&&t===``&&me.push({key:`note:`,depth:n,note:g4(`nothingToChoose`)});for(let t of i){let i=C.get(t);i&&!r.has(t)&&(me.push({key:t,depth:n,node:i}),j.has(t)&&pe(t)&&e(t,n+1,new Set(r).add(t)))}D.has(t)&&me.push({key:`more:${t}`,depth:n,note:g4(`firstOnly`,{count:bi(S4)})})};N&&e(``,1,new Set)}let J=me.filter(e=>e.node),he=J.find(e=>e.key===U)??(de?J[0]:void 0),ge=e=>`${b}-${me.indexOf(e)}`;(0,b4.useEffect)(()=>{N&&he&&aa(ge(he))?.scrollIntoView?.({block:`nearest`})},[N,he?.key]);let _e=e=>{M(t=>new Set(t).add(e)),se(e)},ve=e=>M(t=>{let n=new Set(t);return n.delete(e),n}),ye=()=>{P(!1),ue!==void 0&&(R(!1),I(``))},be=e=>{c(e.value,e.label),R(!1),I(``),W(e.key),P(!1)},xe=e=>{let t=he?J.indexOf(he):-1,n=e=>e&&W(e.key),r=N&&!de&&he?.node,i={ArrowDown:()=>N?n(J[Math.min(t+1,J.length-1)]):P(!0),ArrowUp:()=>N?n(J[Math.max(t-1,0)]):P(!0),Home:N&&!de?()=>n(J[0]):void 0,End:N&&!de?()=>n(J[J.length-1]):void 0,ArrowRight:r?()=>{let e=he.key,t=T.get(e);j.has(e)?Array.isArray(t)&&t.length&&W(t[0]):pe(e)&&_e(e)}:void 0,ArrowLeft:r?()=>{let e=he.node;j.has(e.key)&&pe(e.key)?ve(e.key):e.parent!==null&&J.some(t=>t.key===e.parent)&&W(e.parent)}:void 0,Enter:N&&he?.node?()=>be(he.node):void 0,Escape:N?()=>{e.stopPropagation(),ye()}:void 0}[e.key];i&&(e.preventDefault(),i())},Se=(0,b4.useRef)(null),[Ce,we]=(0,b4.useState)(null),[Te,Ee]=(0,b4.useState)(null);(0,b4.useLayoutEffect)(()=>{if(!N||!Se.current)return;let e=Se.current;Ee(e.closest(`dialog, [role="dialog"]`));let t=()=>{let t=Jo(e).width;we(t>0?t:null)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[N]);let De=L?F:ue===void 0?``:C.get(ue)?.label??l??ue,Oe=ue===void 0||L?[]:ce(ue),ke=Oe.length>1;return(0,x4.jsxs)(`div`,{className:`tree-picker`,children:[(0,x4.jsxs)(`div`,{className:`picker`,ref:Se,children:[(0,x4.jsx)(`input`,{ref:v,id:u,className:`picker-input`,role:`combobox`,"aria-label":d,"aria-expanded":N,"aria-controls":x,"aria-haspopup":de?`listbox`:`tree`,"aria-autocomplete":`list`,"aria-activedescendant":N&&he?ge(he):void 0,"aria-describedby":[p,ke?S:void 0].filter(Boolean).join(` `)||void 0,"aria-invalid":m||void 0,required:h,disabled:g,placeholder:_??g4(`choose`),autoComplete:`off`,value:De,onChange:e=>{I(e.target.value),R(!0),W(void 0),P(!0),ue!==void 0&&c(``)},onClick:()=>!g&&P(!0),onBlur:ye,onKeyDown:xe}),(0,x4.jsx)(JB,{open:N&&!g,modal:!1,onOpenChange:()=>{},children:(0,x4.jsx)(HV,{container:Te??ia(),children:(0,x4.jsx)(WH,{anchor:()=>Se.current?gU(Se.current):null,positionMethod:`fixed`,side:`bottom`,align:`start`,sideOffset:4,collisionBoundary:_U(),collisionPadding:8,style:{zIndex:40,width:Ce===null?`var(--anchor-width)`:`${Ce}px`,maxWidth:`var(--available-width)`},children:(0,x4.jsx)(cU,{role:`presentation`,initialFocus:!1,finalFocus:!1,className:`picker-popup tree-picker-popup`,onMouseDown:e=>e.preventDefault(),children:(0,x4.jsx)(`ul`,{id:x,role:de?`listbox`:`tree`,"aria-label":d??f,className:`picker-list`,children:me.map(e=>{let t=e.node;if(!t)return(0,x4.jsx)(`li`,{role:`presentation`,className:`picker-empty`,style:{paddingInlineStart:E4(e.depth)},children:e.note},e.key);let n=e===he,r=!de&&pe(t.key);return(0,x4.jsxs)(`li`,{id:ge(e),role:de?`option`:`treeitem`,"aria-level":de?void 0:e.depth,"aria-expanded":r?j.has(t.key):void 0,"aria-selected":n,className:`picker-option tree-picker-option${n?` active`:``}${t.key===ue?` chosen`:``}`,style:de?void 0:{paddingInlineStart:E4(e.depth)},onClick:()=>be(t),children:[!de&&(0,x4.jsx)(`span`,{className:`tree-picker-caret${r?``:` is-leaf`}`,"aria-hidden":`true`,onClick:e=>{e.stopPropagation(),W(t.key),r&&(j.has(t.key)?ve(t.key):_e(t.key))},children:r&&(0,x4.jsx)(Pe,{name:j.has(t.key)?`caret-down`:`caret-right`,size:12})}),(0,x4.jsx)(`span`,{className:`picker-option-label`,children:t.label}),e.path&&e.path.length>0&&(0,x4.jsx)(`span`,{className:`picker-option-detail tree-picker-path`,children:e.path.join(` › `)})]},e.key)})})})})})})]}),ke&&(0,x4.jsx)(`p`,{id:S,className:`tree-picker-trail`,"aria-label":g4(`path`),children:Oe.map((e,t)=>(0,x4.jsxs)(b4.Fragment,{children:[t>0&&(0,x4.jsx)(`span`,{className:`tree-picker-sep`,"aria-hidden":`true`,children:`›`}),(0,x4.jsx)(`span`,{children:e.label})]},e.key))})]})}var b4,x4,S4,C4,w4,T4,E4,D4=s((()=>{h4(),b4=d(m(),1),nJ(),hU(),vU(),Qo(),sa(),Yn(),Fe(),Yi(),_4(),x4=d(O(),1),S4=200,C4=20,w4=12,T4=e=>e==null||e===``,E4=e=>`calc(var(--space-2) + ${(e-1)*18}px)`})),O4=l({CommandReferenceField:()=>I4,ReferenceName:()=>N4,ReviewNamed:()=>F4,commandChoicePage:()=>B4,commandChoices:()=>z4,readReferenceName:()=>M4,run:()=>k4});async function k4(e,t){return A4(e,`/api/run`,t)}async function A4(e,t,n){if(typeof e==`string`)return is(t,{...Aa(e),...n});let{app:r,via:i}=e.visitor,a=new URLSearchParams({app:r,...i?{via:i}:{}}),o=await Xa(`${t}?${a}`,{method:`POST`,credentials:`same-origin`,signal:AbortSignal.timeout(15e3),headers:{"content-type":`application/json`,"x-mistri-read":`picker`},body:JSON.stringify(n)});if(!o.ok)throw Error(a2(`choicesCouldNotBeLoaded`));return o.json()}function j4(e,t){if(typeof t!=`string`||!gs.schema)return;let n=gs.schema,r=lt(n,e.from);if(!r)return;let i={[e.labelColumn]:ps(r.id,e.labelColumn)},a=L2(n,r,e.labelColumn,i);return a&&a.path!==e.by?a:void 0}async function M4(e,t,n){let r=j4(e,n),i=r?.declared?r:void 0,a=`${e.by} = ${typeof t==`number`?t:JSON.stringify(t)}`,o=await k4(n,{q:[e.from,sn(cn(e.query??``).head,a),G4(e,i)].join(` `),limit:1,offset:0,count:`none`});if(o.errors?.length||!Array.isArray(o.rows))throw Error(a2(`choicesCouldNotBeLoaded`));let s=o.rows[0],c=K4(s?.[e.labelColumn]);if(!s||c===void 0)return null;let l=i?R2(s[i.path]):void 0;return{label:c,...l?{detail:l}:{}}}function N4({field:e,value:t,source:n,identityEpoch:r}){let i=eJ({queryKey:[`reference-review-name`,r,n,e.from,e.by,e.labelColumn,e.query??``,t],retry:!1,gcTime:0,staleTime:0,refetchOnMount:`always`,queryFn:()=>M4(e,t,n)});return i.isPending?(0,U4.jsx)(`span`,{"aria-busy":`true`,children:a2(`loadingName`)}):i.isError?(0,U4.jsxs)(`span`,{children:[a2(`nameCouldNotBeLoaded`),` `,(0,U4.jsx)(gG,{intent:`quiet`,size:`compact`,onClick:()=>void i.refetch(),children:a2(`tryAgain`)})]}):i.data?(0,U4.jsxs)(U4.Fragment,{children:[i.data.label,i.data.detail&&(0,U4.jsxs)(`span`,{className:`review-detail`,children:[` · `,i.data.detail]})]}):(0,U4.jsx)(`span`,{children:a2(`noLongerAvailable`)})}function P4({field:e,value:t,from:n}){return e.type===`reference`&&(typeof t==`string`||typeof t==`number`)&&t!==``?(0,U4.jsx)(N4,{field:e,value:t,source:n.source,identityEpoch:n.identityEpoch}):(0,U4.jsx)(U4.Fragment,{children:u4(e,t)})}function F4({field:e,value:t,from:n}){if(e.type!==`group`)return(0,U4.jsx)(P4,{field:e,value:t,from:n});let r=t=>e.fields.map(e=>({member:e,held:t?.[e.name]})).filter(({held:e})=>p4(e)),i=e.repeat?(Array.isArray(t)?t:[]).map(r).filter(e=>e.length):r(t).map(e=>[e]);if(!i.length)return(0,U4.jsx)(U4.Fragment,{children:`—`});let a=t=>t.map(({member:t,held:r},i)=>(0,U4.jsxs)(H4.Fragment,{children:[i>0&&`, `,e.fields.length>1&&`${t.label}: `,(0,U4.jsx)(P4,{field:t,value:r,from:n})]},t.name));return i.length===1?(0,U4.jsx)(U4.Fragment,{children:a(i[0])}):(0,U4.jsx)(`ul`,{className:`review-lines`,children:i.map((e,t)=>(0,U4.jsx)(`li`,{children:a(e)},t))})}function I4(e){return e.field.tree?(0,U4.jsx)(L4,{...e}):(0,U4.jsx)(R4,{...e})}function L4({field:e,id:t,describedBy:n,invalid:r,connection:i,identityEpoch:a,value:o,disabled:s,onChange:c,isCurrent:l}){let u=typeof o==`string`||typeof o==`number`?o:``;return(0,U4.jsx)(W4,{from:e.from,by:e.by,labelColumn:e.labelColumn,parent:e.tree,where:cn(e.query??``).head||void 0,ask:(e,t)=>A4(i,e,t),scope:JSON.stringify([a,i]),value:u,known:u===``?void 0:G2(e,i,a,u),onChange:(t,n)=>{l()&&(t!==``&&n!==void 0&&W2(e,i,a,t,n),c(t))},id:t,listLabel:e.label,describedBy:n,invalid:r,required:e.required,disabled:s,placeholder:nQ(e.label)?l$(`choosePlaceholder`,{label:e.label.toLowerCase()}):l$(`chooseOne`)})}function R4({field:e,id:t,describedBy:n,invalid:r,connection:i,identityEpoch:a,value:o,disabled:s,onChange:c,isCurrent:l}){let u=t=>typeof t==`string`||typeof t==`number`?G2(e,i,a,t):void 0,[d,f]=(0,H4.useState)(o===void 0?``:u(o)??String(o)),[p,m]=(0,H4.useState)(o),h=(0,H4.useRef)(o);o!==p&&(m(o),o!==h.current&&f(o===void 0||o===``?``:u(o)??String(o)),h.current=o);let[g,_]=(0,H4.useState)(``),[v,y]=(0,H4.useState)(!1);(0,H4.useEffect)(()=>{let e=setTimeout(()=>_(d.trim()),150);return()=>clearTimeout(e)},[d]);let b=typeof o==`string`||typeof o==`number`?o:void 0,x=eJ({queryKey:[`command-choice-label`,a,i,e.from,e.by,e.labelColumn,e.query??``,b],retry:!1,enabled:b!==void 0&&b!==``&&l(),queryFn:async()=>{let t=await M4(e,b,i);return t&&W2(e,i,a,b,t.label),t?.label??null}});(0,H4.useEffect)(()=>{x.data&&b!==void 0&&d===String(b)&&f(x.data)},[x.data,b,d]);let S=eJ({queryKey:[`command-choices`,a,i,e,g],retry:!1,enabled:v&&!s&&l(),queryFn:async()=>{if(!l())throw Error(l$(`common.thisCommandFormIsNoLonger`));let t=await z4(e,g,i);if(!l())throw Error(l$(`common.thisCommandFormIsNoLonger`));return t}}),{choices:C,answered:w}=r2({typed:d,asked:g,placeholder:S.isPlaceholderData,rows:S.data,label:e=>e.label}),T=z2(C.map(e=>e.label));return(0,U4.jsx)(`div`,{className:`picker`,children:(0,U4.jsx)($0,{text:d,onText:e=>{f(e),h.current=``,c(``)},open:v&&!s,onOpenChange:y,items:C,itemKey:e=>`${typeof e.value}:${e.value}`,itemLabel:e=>e.label,itemClassName:(e,t)=>`picker-option${t?` active`:``}`,renderItem:e=>(0,U4.jsxs)(U4.Fragment,{children:[(0,U4.jsx)(`span`,{className:`picker-option-label`,children:e.label}),e.detail&&(e.declared||T.has(e.label))&&(0,U4.jsx)(`span`,{className:`picker-option-detail`,children:e.detail})]}),onPick:t=>{l()&&(W2(e,i,a,t.value,t.label),h.current=t.value,c(t.value),f(t.label),y(!1))},inputProps:{id:t,"aria-describedby":n,"aria-invalid":r||void 0,required:e.required,disabled:s,className:`picker-input`,placeholder:nQ(e.label)?l$(`choosePlaceholder`,{label:e.label.toLowerCase()}):l$(`chooseOne`)},fit:`width`,popupClassName:`picker-popup`,listClassName:`picker-list`,emptyClassName:`picker-empty`,empty:S.isError?a2(`choicesCouldNotBeLoaded`):S.isFetching||!w?a2(`loadingChoices`):a2(`noMatchingChoices`)})})}async function z4(e,t,n){return(await V4(e,t,n,20,0)).choices}async function B4(e,t,n,r,i){let a=await V4(e,t,n,i+1,r);return{choices:a.choices.slice(0,i),more:a.rows>i}}async function V4(e,t,n,r,i){let a=sn(cn(e.query??``).head,t?`${e.labelColumn} contains ${JSON.stringify(t)}`:``),o=j4(e,n),s=await k4(n,{q:[e.from,a,G4(e,o),`sort ${e.labelColumn}`].filter(Boolean).join(` `),limit:r,offset:i,count:`none`});if(s.errors?.length||!Array.isArray(s.rows))throw Error(a2(`choicesCouldNotBeLoaded`));return{choices:s.rows.slice(0,r).flatMap(t=>{let n=t[e.by];return typeof n==`string`||typeof n==`number`&&Number.isSafeInteger(n)?[{value:n,label:String(t[e.labelColumn]??n),...o&&R2(t[o.path])?{detail:R2(t[o.path]),declared:o.declared}:{}}]:[]}),rows:s.rows.length}}var H4,U4,W4,G4,K4,q4=s((()=>{H4=d(m()),nJ(),Es(),Za(),Fa(),n2(),yG(),i2(),aQ(),Ys(),u$(),o2(),Yn(),St(),U2(),Y2(),m4(),U4=d(O()),W4=Us(()=>Promise.resolve().then(()=>(D4(),v4)),`TreePicker`,{quiet:!0}),G4=(e,t)=>`show ${[...new Set([e.by,e.labelColumn,...t?[t.path]:[]])].join(`, `)}`,K4=e=>e==null||e===``?void 0:String(e)})),J4=s((()=>{})),Y4=s((()=>{}));function X4(e){let t=e.toUpperCase(),n=t3.get(t);if(n===void 0){try{n=new Intl.NumberFormat(`en`,{style:`currency`,currency:t}).resolvedOptions().maximumFractionDigits??2}catch{n=2}t3.set(t,n)}return n}function Z4(e,t){let n=/^(-?)0*(\d+)$/.exec(typeof e==`number`?Number.isSafeInteger(e)?String(e):``:typeof e==`string`||typeof e==`bigint`?String(e).trim():``);if(!n)return;let r=X4(t),i=n[2].padStart(r+1,`0`);return(/[1-9]/.test(i)?n[1]:``)+(r?`${i.slice(0,-r)}.${i.slice(-r)}`:i)}function Q4(e,t){let n=Z4(e,t);if(n!==void 0)return n;let r=typeof e==`number`?e:typeof e==`string`&&e.trim()?Number(e):NaN;return Number.isFinite(r)?r/10**X4(t):void 0}function $4(e,t){if(!e?.currencyColumn)return;let n=t.lastIndexOf(`.`);return n<0?e.currencyColumn:`${t.slice(0,n+1)}${e.currencyColumn}`}function e3(e,t,n,r=``){let i=$4(e,r),a=i&&t?t[i]:void 0;return typeof a==`string`&&/^[A-Za-z]{3}$/.test(a.trim())?a.trim().toUpperCase():e?.currency??n}var t3,n3=s((()=>{t3=new Map})),r3,i3,a3,o3=s((()=>{r3=`house.tray.list.list-checks.kanban.table.calendar.calendar-check.clock.chart-bar.chart-line.chart-pie.gauge.target.flag.user.users.user-circle.address-book.handshake.buildings.storefront.briefcase.package.truck.car.shopping-cart.receipt.currency-dollar.credit-card.wallet.bank.file.file-text.folder.clipboard-text.note.archive.tag.ticket.star.bookmark-simple.bell.envelope.chat-circle.phone.headset.megaphone.globe.map-pin.magnifying-glass.gear.sliders.wrench.bug.shield-check.lock.key.database.stack.lightning.check-circle.warning.info.cell-signal-low.cell-signal-medium.cell-signal-high.cell-signal-full.fire.hourglass.circle-dashed.x-circle.plus-circle.pencil-simple.paper-plane-tilt.arrows-left-right.arrow-circle-down.arrow-circle-up.laptop.monitor.device-mobile.printer.stethoscope.heartbeat.heart.pill.syringe.first-aid-kit.thermometer.flask.test-tube.microscope.bed.hospital.ambulance.tooth.eyeglasses.wheelchair.baby.dna.brain.bandaids.hand-heart.graduation-cap.book-open.student.chalkboard-teacher.factory.warehouse.house-line.plant.leaf.sun.cloud.drop.airplane.bicycle.bus.train.boat.hammer.toolbox.plug.lightbulb.cube.camera.image.trophy.gift.coffee.fork-knife.shopping-bag.basket.barcode.qr-code.scales.gavel.certificate.identification-card.fingerprint.eye.link.paperclip.scissors.palette.code.terminal.users-three.user-plus.caret-left.caret-right.caret-up.caret-down.arrow-left.arrow-right.x.plus.dots-three`.split(`.`),i3=new Set(r3),a3=e=>typeof e==`string`&&i3.has(e)})),s3,c3=s((()=>{ba(),s3=pa({choosePlaceholder:`Choose {label}`,chooseOne:`Choose one`,showValue:`Show`,hideValue:`Hide`,yesWord:`Yes`,noWord:`No`,monthPlaceholder:`MM/YYYY`})})),l3=l({IntakeControl:()=>y3,drawnHere:()=>d3});function u3(e,t){let n=(e.type===`choice`||e.type===`choices`)&&e.source?e.source:void 0,r=n&&(e.type===`choice`||e.type===`choices`)&&(n.served||e.options.length)?e.options:void 0,i=eJ({queryKey:[`command-choices`,typeof t==`string`?t:t?.visitor,n?.from,n?.by,n?.labelColumn],enabled:n!==void 0&&t!==void 0&&r===void 0,staleTime:6e4,queryFn:async()=>{let e=[...new Set([n.by,n.labelColumn])].join(`, `),r=await k4(t,{q:`${n.from} show ${e} sort ${n.labelColumn}`,limit:S3,offset:0,count:`none`});return(Array.isArray(r.rows)?r.rows:[]).flatMap(e=>{let t=e[n.by];return typeof t==`string`||typeof t==`number`?[{value:t,label:String(e[n.labelColumn]??t)}]:[]})}});return n?r??i.data:void 0}function d3(e){switch(e.type){case`money`:case`month`:case`choices`:return!0;case`number`:return e.as===`slider`;case`text`:return e.mask!==void 0||e.sensitive!==void 0;case`boolean`:return e.as===`buttons`||e.statement!==void 0;case`choice`:return e.as===`cards`||e.as===`buttons`||e.source!==void 0;default:return!1}}function f3(e,t){let n=[...e].filter(e=>t4.test(e)),r=``;for(let e of t){let t=n[r.length];if(!t)break;(t===`0`?/\d/.test(e):t===`a`?/[A-Za-z]/.test(e):/[A-Za-z0-9]/.test(e))&&(r+=e)}return r}function p3(e){let t=e.replace(/\D/g,``).slice(0,6);return t.length===6?`${t.slice(2)}-${t.slice(0,2)}`:t}function m3(e){if(!(e.length<3||e.some(e=>e.label.length>O3)))return e.every(e=>!e.help&&e.label.length<=D3)?`short`:e.every(e=>(e.help?.length??0)<=k3)?`brief`:void 0}function h3(e){let t=u3(e.field,e.source),{field:n,id:r,value:i,disabled:a,onChange:o}=e;if(n.type!==`choice`&&n.type!==`choices`||!t)return null;let s=t,c={...n,options:s,source:void 0};if(n.type===`choice`&&n.as!==`cards`&&n.as!==`buttons`&&(n.as===`select`||s.length>C3)){let t=s.findIndex(e=>e.value===i);return(0,x3.jsx)(rQ,{id:r,ariaLabelledBy:`${r}-label`,ariaInvalid:e[`aria-invalid`]===!0||e[`aria-invalid`]===`true`,ariaDescribedBy:e[`aria-describedby`],disabled:a,value:t<0?``:String(t),valueClassName:t<0?`is-empty`:void 0,items:[...t<0?[{value:``,label:nQ(n.label)?s3(`choosePlaceholder`,{label:n.label.toLowerCase()}):s3(`chooseOne`)}]:[],...s.map((e,t)=>({value:String(t),label:e.label}))],onChange:e=>{e!==``&&o(s[Number(e)].value)}})}return(0,x3.jsx)(y3,{...e,field:c})}function g3(e){let t=String(e??``),n=Number(t);return t.trim()&&Number.isFinite(n)?n.toLocaleString(mi(),{maximumFractionDigits:20}):t}function _3(e,t){let n=String(e??``);if(!/^-?\d*\.?\d*$/.test(n.trim())||!/\d/.test(n))return n;try{return new Intl.NumberFormat(mi(),{minimumFractionDigits:t,maximumFractionDigits:t}).format(n.trim())}catch{return n}}function v3(e,t){let[n,...r]=e.replace(/[^\d.-]/g,``).split(`.`);return t&&r.length?`${n}.${r.join(``).slice(0,t)}`:n}function y3(e){let{field:t,id:n,value:r,disabled:i,onChange:a}=e,o={"aria-describedby":e[`aria-describedby`],"aria-invalid":e[`aria-invalid`]},[s,c]=(0,b3.useState)(!1),[l,u]=(0,b3.useState)(!1);if(t.type===`money`&&t.as!==`slider`){let s=(t.currency||e.currency)??void 0,c=e4(s),d=t.minor?X4(s||vi()):void 0;return(0,x3.jsxs)(`div`,{className:`intake-money`,children:[(0,x3.jsx)(`span`,{className:`intake-money-symbol`,"aria-hidden":`true`,children:c}),(0,x3.jsx)(`input`,{...o,id:n,className:`field-control`,style:{paddingInlineStart:`calc(var(--money-pad) + ${c.length}ch + var(--space-2))`},type:`text`,inputMode:(d===void 0?t.step!==void 0&&Number.isInteger(t.step):d===0)?`numeric`:`decimal`,enterKeyHint:`next`,autoComplete:`off`,disabled:i,required:t.required,value:l?String(r??``):d===void 0?g3(r):_3(r,d),onFocus:()=>u(!0),onBlur:()=>u(!1),onChange:e=>a(d===void 0?e.target.value.replace(/[^\d.-]/g,``):v3(e.target.value,d))})]})}if(t.type===`month`)return(0,x3.jsx)(`input`,{...o,id:n,className:`field-control intake-month`,type:`text`,inputMode:`numeric`,enterKeyHint:`next`,autoComplete:`off`,placeholder:s3(`monthPlaceholder`),disabled:i,required:t.required,value:T3(typeof r==`string`?r:``),onChange:e=>a(p3(e.target.value))});if((t.type===`number`||t.type===`money`)&&t.as===`slider`){let s=t.min??0,c=t.max??100,l=typeof r==`number`?r:r===void 0||r===``?s:Number(r),u=c>s?(l-s)/(c-s)*100:0,d=n=>t.type===`money`?$2(n,e.currency,t.step):n.toLocaleString(mi()),f=d(l);return(0,x3.jsxs)(`div`,{className:`intake-slider`,children:[(0,x3.jsx)(`output`,{className:`field-control field-readout`,htmlFor:n,"aria-hidden":`true`,children:f}),(0,x3.jsx)(`input`,{...o,id:n,type:`range`,className:`field-range`,min:s,max:c,step:t.step??(t.type===`money`||t.integer?1:`any`),value:l,disabled:i,"aria-valuetext":f,style:{"--range-share":`${u}%`},onChange:e=>a(Number(e.target.value))}),(0,x3.jsxs)(`div`,{className:`intake-slider-ends`,"aria-hidden":`true`,children:[(0,x3.jsx)(`span`,{children:d(s)}),(0,x3.jsx)(`span`,{children:d(c)})]})]})}if(t.type===`text`&&t.sensitive){let e=typeof r==`string`?r:``,l=t.mask?Q2(t.mask,e):e;return(0,x3.jsxs)(`div`,{className:`field-with-action`,children:[(0,x3.jsx)(`input`,{...o,id:n,className:`field-control${s?``:` field-hidden`}`,type:s?`text`:`password`,inputMode:t.mask?w3(t.mask):`text`,enterKeyHint:`next`,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":`true`,disabled:i,required:t.required,value:l,onChange:e=>a(t.mask?f3(t.mask,e.target.value):e.target.value)}),(0,x3.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,"aria-controls":n,"aria-pressed":s,onClick:()=>c(!s),children:s3(s?`hideValue`:`showValue`)})]})}if(t.type===`text`&&t.mask){let e=t.mask;return(0,x3.jsx)(`input`,{...o,id:n,className:`field-control`,type:`text`,inputMode:w3(e),enterKeyHint:`next`,autoComplete:`off`,placeholder:e.replace(/[0a*]/g,`_`),disabled:i,required:t.required,value:Q2(e,typeof r==`string`?r:``),onChange:t=>a(f3(e,t.target.value))})}if(t.type===`boolean`)return t.as===`buttons`?(0,x3.jsx)(`div`,{className:`choice-pair`,role:`radiogroup`,id:n,"aria-labelledby":`${n}-label`,...o,children:[!0,!1].map(e=>(0,x3.jsxs)(`label`,{className:`choice-pick${r===e?` is-on`:``}`,children:[(0,x3.jsx)(`input`,{type:`radio`,name:n,className:`choice-input`,checked:r===e,disabled:i,onChange:()=>a(e)}),s3(e?`yesWord`:`noWord`)]},String(e)))}):(0,x3.jsxs)(`span`,{className:`intake-consent`,children:[(0,x3.jsx)(`input`,{...o,id:n,type:`checkbox`,className:`command-check field-check`,required:t.accept===!0,checked:r===!0,disabled:i,onChange:e=>a(e.target.checked)}),(0,x3.jsx)(`span`,{className:`intake-statement`,children:t.statement})]});if((t.type===`choice`||t.type===`choices`)&&t.source)return(0,x3.jsx)(h3,{...e});if(t.type===`choice`||t.type===`choices`){let s=t.type===`choices`,c=s?Array.isArray(r)?r:[]:r===void 0?[]:[r],l=t.type===`choices`?t.exclusive??[]:[],u=(e,n)=>{if(!s)return a(e.value);if(l.includes(e.value))return a(n?[e.value]:[]);let r=c.filter(t=>t!==e.value&&!l.includes(t));a(t.options.map(e=>e.value).filter(t=>n&&t===e.value||r.includes(t)))},d=t.as===`buttons`;return s?(0,x3.jsx)(P$,{id:n,"aria-labelledby":`${n}-label`,"aria-describedby":e[`aria-describedby`],"aria-invalid":e[`aria-invalid`],disabled:i,fit:m3(t.options),cards:t.options.map(e=>({key:E3(e),label:e.label,icon:e.icon&&a3(e.icon)?(0,x3.jsx)(Pe,{name:e.icon}):void 0,help:e.help,on:c.includes(e.value)})),onToggle:(e,n)=>u(t.options[e],n)}):(0,x3.jsx)(`div`,{className:d?`choice-pair intake-buttons`:`choice-cards`,"data-fit":d?void 0:m3(t.options),role:s?`group`:`radiogroup`,id:n,"aria-labelledby":`${n}-label`,"aria-required":!s&&t.required||void 0,...o,children:t.options.map(e=>{let t=c.includes(e.value);return(0,x3.jsxs)(`label`,{className:`${d?`choice-pick`:`choice-card`}${t?` is-on`:``}`,children:[e.icon&&!d&&a3(e.icon)?(0,x3.jsx)(`span`,{className:`choice-card-icon`,"aria-hidden":`true`,children:(0,x3.jsx)(Pe,{name:e.icon})}):null,(0,x3.jsxs)(`span`,{className:`choice-card-label`,children:[e.label,e.help&&!d?(0,x3.jsx)(`span`,{className:`intake-choice-help`,children:e.help}):null]}),(0,x3.jsx)(`input`,{type:s?`checkbox`:`radio`,name:s?void 0:n,className:`choice-input`,checked:t,disabled:i,onChange:t=>u(e,t.target.checked)}),d?null:(0,x3.jsx)(`span`,{className:`choice-box`,"aria-hidden":`true`})]},E3(e))})})}return null}var b3,x3,S3,C3,w3,T3,E3,D3,O3,k3,A3=s((()=>{b3=d(m()),nJ(),aQ(),L$(),q4(),J4(),Y4(),Yi(),n3(),Fe(),o3(),c3(),n4(),x3=d(O()),S3=200,C3=6,w3=e=>[...e].every(e=>!t4.test(e)||e===`0`)?`numeric`:`text`,T3=e=>{let t=/^(\d{4})-(\d{2})$/.exec(e),n=t?`${t[2]}${t[1]}`:e.replace(/\D/g,``);return n.length>2?`${n.slice(0,2)}/${n.slice(2)}`:n},E3=e=>`${typeof e.value}:${e.value}`,D3=14,O3=24,k3=40}));function j3(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(/\s/.test(r)){n++;continue}if(/\d/.test(r)){let r=/\d+(?:\.\d+)?/y;r.lastIndex=n;let i=r.exec(e)[0];t.push({t:`number`,v:i,at:n}),n+=i.length;continue}if(r===`'`){let r=n+1,i=``;for(;;){if(r>=e.length)throw new Zn(`a quoted text is not closed.`,n);if(e[r]===`'`){if(e[r+1]===`'`){i+=`'`,r+=2;continue}break}i+=e[r++]}if([...i].some(e=>e===`\\`||e.charCodeAt(0)<32||e.charCodeAt(0)===127))throw new Zn(`a quoted text holds a backslash or a control character, which engines read differently.`,n);t.push({t:`text`,v:i,at:n}),n=r+1;continue}let i=e.slice(n,n+2);if([`!=`,`<>`,`<=`,`>=`].includes(i)){t.push({t:`op`,v:i===`<>`?`!=`:i,at:n}),n+=2;continue}if(`=<>+-*/(),`.includes(r)){t.push({t:`op`,v:r,at:n}),n++;continue}R3.lastIndex=n;let a=R3.exec(e);if(a)t.push({t:`word`,v:a[0],at:n}),n+=a[0].length;else throw new Zn(`"${r}" is not part of an expression.`,n)}return t.push({t:`end`,v:``,at:e.length}),t}function M3(e,t){let n=j3(e),r=0,i=()=>n[r],a=e=>i().t===`word`&&i().v.toLowerCase()===e,o=()=>n[r++],s=e=>{if(i().t!==`op`||i().v!==e)throw new Zn(`expected "${e}"${i().t===`end`?` before the end`:` at "${i().v}"`}.`,i().at);o()},c=()=>{let e=l();for(;a(`or`);)o(),e={k:`op`,op:`or`,left:e,right:l()};return e},l=()=>{let e=u();for(;a(`and`);)o(),e={k:`op`,op:`and`,left:e,right:u()};return e},u=()=>a(`not`)?(o(),{k:`not`,of:u()}):d(),d=()=>{let e=f();if(a(`is`)){o();let t=a(`not`);if(t&&o(),!a(`empty`))throw new Zn(`say "is empty" or "is not empty".`,i().at);return o(),{k:`empty`,of:e,negate:t}}let c=a(`not`)&&n[r+1].t===`word`&&n[r+1].v.toLowerCase()===`in`;if(c||a(`in`)){c&&o(),o(),s(`(`);let a=[];for(;;){let c=i(),l=n[r+1];if(a.push(e.k===`path`&&c.t===`word`&&!I3.has(c.v.toLowerCase())&&!c.v.includes(`.`)&&!t(c.v)&&l.t===`op`&&(l.v===`,`||l.v===`)`)?(o(),{k:`text`,value:c.v}):f()),i().t===`op`&&i().v===`,`)o();else{s(`)`);break}}let l=a.map(t=>({k:`op`,op:`=`,left:e,right:t})).reduce((e,t)=>({k:`op`,op:`or`,left:e,right:t}));return c?{k:`not`,of:l}:l}let l=i();if(l.t===`op`&&[`=`,`!=`,`<`,`<=`,`>`,`>=`].includes(l.v)){o();let a=i(),s=(l.v===`=`||l.v===`!=`)&&e.k===`path`&&a.t===`word`&&!I3.has(a.v.toLowerCase())&&!a.v.includes(`.`)&&!t(a.v)&&(n[r+1].t===`end`||n[r+1].t===`word`||n[r+1].t===`op`&&n[r+1].v===`)`)?(o(),{k:`text`,value:a.v}):f();if(l.v===`=`&&s.k===`path`&&/^null$/i.test(s.path))throw new Zn(`"= null" is never true; say "is empty".`,a.at);return{k:`op`,op:l.v,left:e,right:s}}return e},f=()=>{let e=p();for(;i().t===`op`&&(i().v===`+`||i().v===`-`);)e={k:`op`,op:o().v,left:e,right:p()};return e},p=()=>{let e=m();for(;i().t===`op`&&(i().v===`*`||i().v===`/`);)e={k:`op`,op:o().v,left:e,right:m()};return e},m=()=>{if(i().t===`op`&&i().v===`-`)return o(),{k:`neg`,of:m()};let e=h();return i().t===`word`&&Object.hasOwn(L3,i().v.toLowerCase())?{k:`span`,of:e,unit:L3[o().v.toLowerCase()]}:e},h=()=>{let e=o();if(e.t===`number`)return{k:`number`,value:Number(e.v)};if(e.t===`text`)return{k:`text`,value:e.v};if(e.t===`op`&&e.v===`(`){let e=c();return s(`)`),e}if(e.t===`word`){let t=e.v.toLowerCase();if(i().t===`op`&&i().v===`(`){if(!P3(t))throw new Zn(`"${e.v}" is not a function; an expression calls ${N3.join(`, `)}.`,e.at);o();let n=[];if(i().t!==`op`||i().v!==`)`)for(;n.push(c()),i().t===`op`&&i().v===`,`;)o();s(`)`);let r=t,a=r===`coalesce`||r===`min`||r===`max`;if(a?n.length<2:r===`round`?n.length<1||n.length>2:n.length!==1)throw new Zn(a?`${r}(…) takes two values or more: ${r}(a, b).`:r===`round`?`round(…) takes a number and, if you like, how many places: round(total) or round(total, 2).`:`${r}(…) takes one number.`,e.at);if(r===`round`&&n[1]&&!(n[1].k===`number`&&Number.isInteger(n[1].value)&&n[1].value<=F3))throw new Zn(`round(…)'s places are a whole number from 0 to ${F3}, written out: round(total, 2).`,e.at);return{k:`call`,fn:r,args:n}}if(t===`true`||t===`false`)return{k:`bool`,value:t===`true`};if(t===`today`||t===`now`||t===`me`)return{k:t};if([`and`,`or`,`not`,`is`,`empty`,`in`].includes(t)||Object.hasOwn(L3,t))throw new Zn(`"${e.v}" stands where a value goes.`,e.at);return{k:`path`,path:e.v}}throw new Zn(e.t===`end`?`the expression ends where a value goes.`:`"${e.v}" stands where a value goes.`,e.at)},g=c();if(i().t!==`end`)throw new Zn(`"${i().v}" follows a complete expression; join two with "and" or "or".`,i().at);return g}var N3,P3,F3,I3,L3,R3,z3=s((()=>{Qn(),N3=[`coalesce`,`round`,`min`,`max`,`abs`],P3=e=>N3.includes(e),F3=10,I3=new Set([`today`,`now`,`me`,`true`,`false`]),L3={minute:`minute`,minutes:`minute`,hour:`hour`,hours:`hour`,day:`day`,days:`day`,week:`week`,weeks:`week`,month:`month`,months:`month`,year:`year`,years:`year`},R3=/[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_$][A-Za-z0-9_$]*)*/y}));function B3(e,t){let n=10**t,r=Number((Math.abs(e)*n).toPrecision(15)),i=Math.round(r)/n;return i===0?0:Math.sign(e)*i}function V3(e,t,n=e=>{throw new Zn(`"${e}" is a column, and this expression reads none.`,0)}){let r=e=>({count:Number(l(e.of)),unit:e.unit}),i=(e,t,n)=>{let r=`day`in e?new Date(`${e.day}T00:00:00Z`):new Date(e.instant),i=t.count*n;if(t.unit===`hour`||t.unit===`minute`)return{instant:new Date(r.getTime()+i*(t.unit===`hour`?36e5:6e4))};if(t.unit===`day`||t.unit===`week`)r.setTime(r.getTime()+i*(t.unit===`week`?7:1)*U3);else{let e=t.unit===`year`?i*12:i,n=r.getUTCDate();r.setUTCDate(1),r.setUTCMonth(r.getUTCMonth()+e);let a=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth()+1,0)).getUTCDate();r.setUTCDate(Math.min(n,a))}return`day`in e?{day:W3(r)}:{instant:r}},a=e=>typeof e==`object`&&!!e,o=e=>`day`in e?Date.parse(`${e.day}T00:00:00Z`):e.instant.getTime(),s=e=>a(e)?o(e):e,c=e=>e===null?null:!!e,l=e=>{switch(e.k){case`number`:return e.value;case`text`:return e.value;case`bool`:return e.value;case`today`:return{day:t.today};case`date`:return{day:e.value};case`now`:return{instant:t.now};case`instant`:return{instant:new Date(e.value)};case`me`:return t.me;case`nobody`:return null;case`not`:{let t=c(l(e.of));return t===null?null:!t}case`neg`:{let t=l(e.of);return t===null?null:-Number(t)}case`empty`:{let t=l(e.of);return(t===null||t===``)!==e.negate}case`span`:return Number(l(e.of));case`call`:{let t=e.args.map(l);if(e.fn===`coalesce`)return t.find(e=>e!==null)??null;if(t.some(e=>e===null))return null;if(e.fn===`abs`)return Math.abs(Number(t[0]));if(e.fn===`round`)return B3(Number(t[0]),t[1]===void 0?0:Number(t[1]));let n=t[0];for(let r of t.slice(1)){let[t,i]=[s(r),s(n)];(e.fn===`min`?t<i:t>i)&&(n=r)}return n}case`path`:{let t=n(e.path);return t===void 0||t===``?null:t}case`json`:return H3(n(e.column),e.keys);case`op`:{if(e.op===`and`||e.op===`or`){let t=c(l(e.left)),n=c(l(e.right));return e.op===`and`?t===!1||n===!1?!1:t===null||n===null?null:!0:t===!0||n===!0?!0:t===null||n===null?null:!1}let t=l(e.left),n=l(e.right);if(G3.has(e.op)){if(t===null||n===null)return null;let r=s(t),i=s(n);switch(e.op){case`=`:return r===i;case`!=`:return r!==i;case`<`:return r<i;case`<=`:return r<=i;case`>`:return r>i;default:return r>=i}}if(t===null||n===null)return null;if(e.op===`+`||e.op===`-`){let s=e.op===`+`?1:-1;return a(t)&&a(n)&&e.op===`-`?Math.round((o(t)-o(n))/U3):a(t)&&!a(n)?i(t,e.right.k===`span`?r(e.right):{count:Number(n),unit:`day`},s):a(n)&&!a(t)&&e.op===`+`?i(n,e.left.k===`span`?r(e.left):{count:Number(t),unit:`day`},1):Number(t)+s*Number(n)}return e.op===`*`?Number(t)*Number(n):Number(n)===0?null:Number(t)/Number(n)}}},u=l(e);return u===null&&K3(e)?!1:u}function H3(e,t){let n=e;if(typeof n==`string`)try{n=JSON.parse(n)}catch{return null}for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n)||!Object.hasOwn(n,e))return null;n=n[e]}return n==null?null:typeof n==`object`?JSON.stringify(n):String(n)}var U3,W3,G3,K3,q3=s((()=>{Qn(),U3=864e5,W3=e=>e.toISOString().slice(0,10),G3=new Set([`=`,`!=`,`<`,`<=`,`>`,`>=`]),K3=e=>e.k===`not`||e.k===`empty`||e.k===`bool`||e.k===`op`&&(e.op===`and`||e.op===`or`||G3.has(e.op))})),J3=s((()=>{})),Y3=l({CommandLive:()=>Q3,liveFigures:()=>Z3});function X3(e,t){let n=`${[...t].join(`,`)}|${e}`;if(!t6.has(n))try{t6.set(n,M3(e,e=>t.has(e)))}catch{t6.set(n,null)}return t6.get(n)}function Z3(e,t,n){let r=new Set(t.filter(e=>e.type===`number`||e.type===`money`).map(e=>e.name)),i=[];for(let[t,a]of Object.entries(e.live??{})){let e=X3(a,r);if(!e)continue;let o=!1,s=V3(e,{today:``,now:new Date,me:null},e=>{let t=n6(n[e]);return t===null&&(o=!0),t});!o&&typeof s==`number`&&Number.isFinite(s)&&i.push([t,s])}return i}function Q3({field:e,fields:t,values:n,id:r,currency:i=`USD`}){let a=(0,$3.useMemo)(()=>Z3(e,t,n),[e,t,n]),o=t=>new Intl.NumberFormat(mi(),e.type===`money`?{style:`currency`,currency:i,maximumFractionDigits:Math.abs(t)>=1e3?0:2}:{maximumFractionDigits:2}).format(t);return(0,e6.jsx)(`p`,{id:r,className:`command-live`,"aria-live":`polite`,children:a.map(([e,t],n)=>(0,e6.jsxs)(`span`,{children:[n>0&&` · `,o(t),` `,e]},e))})}var $3,e6,t6,n6,r6=s((()=>{Qn(),z3(),q3(),Yi(),$3=d(m()),J3(),e6=d(O()),t6=new Map,n6=e=>{if(typeof e==`number`)return Number.isFinite(e)?e:null;if(typeof e!=`string`||!e.trim())return null;let t=Number(e.replace(/[,\s]/g,``));return Number.isFinite(t)?t:null}})),i6=l({bindRecord:()=>p6,boundText:()=>m6,brokenRules:()=>g6,draftHolds:()=>h6,draftNames:()=>u6,readsRecord:()=>S6,recordComparisons:()=>x6});function a6(e,t,n,r){let[i,a,o]=e.split(`-`).map(Number),s=(t===`-`?-1:1)*n*(r.startsWith(`week`)?7:1),c=v6[r.toLowerCase()];if(c===`day`)return new Date(Date.UTC(i,a-1,o+s)).toISOString().slice(0,10);let l=c===`year`?s*12:s,u=new Date(Date.UTC(i,a-1+l,1)),d=new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth()+1,0)).getUTCDate();return new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth(),Math.min(o,d))).toISOString().slice(0,10)}function o6(e,t){return e.replace(y6,(e,n,r,i)=>a6(t,n,Number(r),i))}function s6(e){switch(e.type){case`number`:case`money`:return`NUMERIC`;case`boolean`:return`BOOLEAN`;case`date`:return`DATE`;case`datetime`:return`TIMESTAMPTZ`;case`choice`:return e.options.length&&e.options.every(e=>typeof e.value==`number`)?`NUMERIC`:`TEXT`;case`text`:case`textarea`:case`month`:case`time`:case`reference`:return`TEXT`;default:return}}function c6(e){return e.flatMap(e=>{let t=s6(e);return!t||e.type===`text`&&e.sensitive?[]:[{name:e.name,type:t,nullable:!0,primaryKey:!1}]})}function l6(e,t,n=new Date,r){let i=o6(e,b6(n)),a=p2(i,t,void 0,`record`,!0);if(!r)return a;let o=c6(r),s=new Set(o.map(e=>e.name));for(let e of a.flat())for(let t of[e.field,...e.other===void 0?[]:[e.other]])s.has(t)||(s.add(t),o.push({name:t,type:``,nullable:!0,primaryKey:!1}));try{return p2(i,t,o,`record`,!0)}catch{return a}}function u6(e,t){let n=new Set,r=new Set;for(let i of l6(e,t).flat())for(let e of[i.field,...i.other===void 0?[]:[i.other]])if(e.startsWith(_6))r.add(e.slice(7));else if(e.includes(`.`))throw Error(`${t}: "${e}" is a path; a condition here names a field of the input, or record.<column> for the record's own.`);else n.add(e);return{fields:[...n],record:[...r]}}function d6(e,t){return e.map(e=>e.map(e=>e.other===void 0&&e.values.length===1&&typeof e.values[0]==`string`&&t.has(e.values[0])&&e.values[0]!==e.field?{field:e.field,operator:e.operator,values:[],other:e.values[0]}:e))}function f6(e){let t=e.field.startsWith(_6)?e.field.slice(7):e.field;return e.other===void 0?e.values.length===1&&e.values[0]===null?`${t} ${e.operator===`ne`?`is not empty`:`is empty`}`:e.values.length>1?`${t} in (${e.values.map(e=>pn(e)).join(`, `)})`:`${t} ${{eq:`=`,ne:`!=`,lt:`<`,lte:`<=`,gt:`>`,gte:`>=`}[e.operator]} ${pn(e.values[0])}`:`${t} ${{eq:`=`,ne:`!=`,lt:`<`,lte:`<=`,gt:`>`,gte:`>=`}[e.operator]} ${e.other}`}async function p6(e,t,n,r=new Date,i){let a=[];for(let o of l6(e,t,r,i)){let e=[],t=!0;for(let r of o)if(!r.field.startsWith(_6))e.push(r);else if(!await n(f6(r))){t=!1;break}t&&a.push(e)}return a}function m6(e){return e.length?e.some(e=>!e.length)?!0:e.map(e=>e.map(f6).join(` and `)).join(` or `):!1}function h6(e,t,n,r=new Date){let i=c6(n),a=new Set(i.map(e=>e.name)),o=d6(typeof e==`string`?l6(e,`Condition`,r,n):e,a);if(!o.length)return!1;if(o.some(e=>!e.length))return!0;let s=Object.fromEntries(i.map(e=>[e.name,C6(t[e.name])?null:t[e.name]])),c=e=>!w6(e)&&[e.field,...e.other===void 0?[]:[e.other]].some(e=>s[e]===null)?!1:C2([[e]],s,i)===!0;return o.some(e=>e.every(c))}function g6(e,t,n,r=new Date){let i=[];for(let a of e)u6(a.must,`Rule`).fields.some(e=>t[e]===void 0||t[e]===null||t[e]===``)||a.when!==void 0&&!h6(a.when,t,n,r)||h6(a.must,t,n,r)||i.push({field:T6(a),message:a.message});return i}var _6,v6,y6,b6,x6,S6,C6,w6,T6,E6=s((()=>{k2(),Yn(),_6=`record.`,v6={day:`day`,days:`day`,week:`day`,weeks:`day`,month:`month`,months:`month`,year:`year`,years:`year`},y6=/\btoday\s*([+-])\s*(\d{1,4})\s*(days?|weeks?|months?|years?)\b/gi,b6=e=>e.toISOString().slice(0,10),x6=e=>l6(e,`Condition`).flat().filter(e=>e.field.startsWith(_6)).map(f6),S6=e=>l6(e,`Condition`).flat().some(e=>e.field.startsWith(_6)),C6=e=>e==null||e===``,w6=e=>e.other===void 0&&e.values.length===1&&e.values[0]===null,T6=e=>u6(e.must,`Rule`).fields[0]}));function D6(e,t,n){let r=e.columns.find(e=>e.name===t);if(!r)return`shape`;let i=typeof n==`string`?n.trim():n;if(gt(r))return typeof i==`boolean`?{value:i}:i===1||i===`true`||i===`1`?{value:!0}:i===0||i===`false`||i===`0`?{value:!1}:`type`;if(r.allowed?.length)return r.allowed.includes(String(i))?{value:String(i)}:`choice`;let a=ht(r.type);if(a===`number`){let e=typeof i==`number`?i:typeof i==`string`&&/^-?\d+(\.\d+)?$/.test(i)?Number(i):NaN;return Number.isFinite(e)?{value:e}:`type`}return typeof i==`string`?a===`date`?Ar(i)||Mr(i)!==void 0?{value:i}:`type`:{value:i}:`type`}var O6=s((()=>{Vr(),St()}));function k6(e){let t=e.via.lastIndexOf(`.`),n=e.via.slice(t+1);return t<0||n.includes(`+`)?void 0:{table:e.via.slice(0,t),column:n}}function A6(e,t,n,r,i){let a={today:new Date().toISOString().slice(0,10),now:new Date,me:null},o=new Map,s=(e,t,n,r)=>r?V3(r.expr,a,n=>w2(e,n,t[n])):w2(e,n,t[n]),c=n=>{if(o.has(n))return o.get(n);o.set(n,null);let l=null,u=t.rollups?.[n],d=t.computed?.[n];if(u){let t=k6(u),n=t&&lt(e,t.table),r=(n&&i[n.id])??[];if(n&&!u.of&&!u.filter&&u.fn!==`latest`){let e=r.map(e=>s(n,e,u.column??``,u.expression)).filter(e=>typeof e==`number`&&Number.isFinite(e));l=u.fn===`count`?r.length:u.fn===`sum`?e.reduce((e,t)=>e+t,0):e.length?u.fn===`avg`?e.reduce((e,t)=>e+t,0)/e.length:u.fn===`min`?Math.min(...e):Math.max(...e):null}}else d&&(l=V3(d.expr,a,e=>t.rollups?.[e]||t.computed?.[e]?c(e):w2(t,e,r[e])));return o.set(n,l),l};return Object.fromEntries(n.filter(e=>t.rollups?.[e]||t.computed?.[e]).map(e=>[e,c(e)]))}var j6=s((()=>{Qn(),q3(),St(),k2()}));function M6(e,t){return!!(e?.primaryKey||e?.references||e?.identifier||L6.test(e?.sourceName??t))}function N6(e,t,n){let r=n.map(e=>e[t]).filter(e=>e!=null),i=ht(e?.type),a={align:`left`,kind:i,mono:!1},o=r.length>0&&r.every(e=>typeof e==`number`);if(i===`boolean`||e?.flag===!0||o&&F6.test(e?.sourceName??t)&&r.every(e=>e===0||e===1))return{...a,kind:`boolean`,align:`center`};if(i===`number`||o){let t=!!(e?.primaryKey||e?.references||e?.identifier),n=t?0:Math.max(0,...r.map(P6)),i=!t&&r.some(e=>Math.abs(Number(e))>=1e4);return{...a,kind:`number`,align:`right`,decimals:n,group:i,identifier:t}}if(i===`date`||r.length&&r.every(e=>typeof e==`string`&&I6.test(e))){let e=r.some(e=>/[ T]\d{2}:\d{2}/.test(String(e))&&!/[ T]00:00:00(\.0+)?$/.test(String(e)));return{...a,kind:`date`,mono:!0,showTime:e}}let s=Math.max(0,...r.map(e=>String(e).length));return{...a,kind:`text`,mono:s<=12&&r.length>0,idLike:M6(e,t)}}function P6(e){let t=String(e),n=t.indexOf(`.`);return n===-1?0:Math.min(6,t.length-n-1)}var F6,I6,L6,R6=s((()=>{St(),F6=/^(is|has|can|should|was)_|_(flag|enabled|disabled)$|^(active|enabled|disabled|deleted|archived|verified|published|visible|locked|hidden|default|primary|required|readonly)$/i,I6=/^\d{4}-\d{2}-\d{2}([ T]\d{2}:\d{2}(:\d{2})?)?/,L6=/(^|_)(id|uuid|code|sku|vin|ref|key|token|serial|number|no|hash|slug)$/i}));function z6(e,t){return N6(e,e?.name??``,t?[t]:[]).kind===`boolean`?/bool/i.test(e?.type??``)?{yes:`true`,no:`false`}:{yes:`1`,no:`0`}:null}var B6=s((()=>{Es(),R6(),XQ()}));function V6(e){let t=new Set;return e.flatMap(e=>[...typeof e?.field==`string`?[{field:e.field,message:e.message}]:[],...Array.isArray(e?.fields)?e.fields:[]]).flatMap(e=>typeof e?.field!=`string`||!/^[^\s.\x00-\x1f\x7f]{1,256}(?:\.[A-Za-z_][A-Za-z0-9_]{0,127})?$/u.test(e.field)||typeof e.message!=`string`||!e.message.trim()||e.message.length>256||t.has(e.field)?[]:(t.add(e.field),[{field:e.field,message:e.message}]))}var H6=s((()=>{})),U6,W6=s((()=>{ba(),U6=pa({updateNotConfirmedTheRecord:`Update not confirmed. The record may already have changed. Check the stored values before editing again.`,anUpdateIsAlready:`An update is already pending for this record.`,theRequestMayStill:`The request may still complete.`,theServerDidNotAcknowledge:`The server did not acknowledge exactly the requested fields on one record.`})}));function G6(e,t){if(!Y6(e)||e.affected!==1||!Y6(e.applied)||e.outcome!==void 0&&e.outcome!==`applied`)return;let n=e.applied;if(Object.keys(t).every(e=>Object.hasOwn(n,e))&&Object.values(n).every(e=>e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&Number.isFinite(e)))return n}function K6(e=()=>!1){let t=new Map,n=new Set,r=0,i=0,a=()=>{r++;for(let e of n)e()},o=e=>t.get(J6(e));return{get:o,run:async(n,r,s)=>{let c=i,l=e(),u=J6(n);if(t.has(u))return{kind:`blocked`,message:o(n).message||U6(`anUpdateIsAlready`)};let d={...r},f=l?ci().mutations.start(`update`):void 0;t.set(u,{phase:`pending`,values:d,message:``}),a();let p=e=>{ci().mutations.unknown(f);let n=q6;return c===i&&(t.set(u,{phase:`uncertain`,values:d,message:n,detail:e}),a()),{kind:`uncertain`,message:n}},m=(e,n=[])=>(ci().mutations.settle(f),c===i&&(t.delete(u),a()),{kind:`rejected`,message:e,...n.length?{fields:n}:{}}),h=setTimeout(()=>p(U6(`theRequestMayStill`)),3e4),g;try{g=await s()}catch(e){let t=Y6(e)?e.status:void 0,n=Y6(e)?e.outcome:void 0,r=e instanceof Error?e.message:String(e);return n!==`unknown`&&(n===`rejected`||n===`not_applied`||!l&&typeof t==`number`&&[400,401,403,404,409,422,501].includes(t))?m(r):p(r)}finally{clearTimeout(h)}if(Y6(g)&&Array.isArray(g.errors)){let e=Y6(g.errors[0])&&typeof g.errors[0].message==`string`?g.errors[0].message:``;return e&&g.outcome===`rejected`?m(e,V6(g.errors.filter(Y6))):p(e)}let _=G6(g,d);if(!_)return p(U6(`theServerDidNotAcknowledge`));ci().mutations.settle(f),c===i&&(t.delete(u),a());let v=Y6(g)?io(g.undoId,l):void 0;return{kind:`applied`,applied:_,...v===void 0?{}:{undoId:v}}},reset:()=>{i++,t.clear(),a()},hasUnresolved:()=>t.size>0,version:()=>r,subscribe:e=>(n.add(e),()=>{n.delete(e)})}}var q6,J6,Y6,X6,Z6=s((()=>{Ja(),ao(),pi(),H6(),W6(),sa(),q6=U6(`updateNotConfirmedTheRecord`),J6=e=>JSON.stringify([e.connection,e.table,Object.keys(e.key).sort().map(t=>[t,String(e.key[t])])]),Y6=e=>!!e&&typeof e==`object`&&!Array.isArray(e),X6=K6(()=>Ka().tenantRequired===!0),Ra(()=>X6.reset()),ea(window,`beforeunload`,e=>{X6.hasUnresolved()&&(e.preventDefault(),e.returnValue=``)})})),Q6=s((()=>{ba()})),$6=s((()=>{Q6()})),e8=s((()=>{ba()})),t8=s((()=>{e8()}));function n8(e,t){let n=typeof e==`number`?Number.isFinite(e)?String(e):``:e.trim(),r=/^([-+]?)(\d*)(?:\.(\d*))?$/.exec(n);if(!r||!r[2]&&!r[3])return;let i=X4(t),a=(r[3]??``).replace(/0+$/,``);if(a.length>i)return;let o=`${r[2]}${a.padEnd(i,`0`)}`.replace(/^0+(?=\d)/,``)||`0`;return r[1]===`-`&&o!==`0`?`-${o}`:o}function r8(e,t){let n=n8(e,t);if(n===void 0)return;let r=Number(n);return Number.isSafeInteger(r)?r:void 0}var i8=s((()=>{n3()})),a8=s((()=>{ba()}));function o8(e,t){return e==null||e===``?``:Z4(e,t)??e}function s8(e,t){if(e.trim()===``)return``;let n=r8(e,t);return n===void 0?e:String(n)}function c8({value:e,currency:t,onChange:n,children:r}){let[i,a]=(0,l8.useState)(()=>o8(e,t));return(0,l8.useEffect)(()=>{s8(i,t)!==e&&a(o8(e,t))},[e,t]),(0,u8.jsx)(u8.Fragment,{children:r(i,e=>{a(e),n(s8(e,t))})})}var l8,u8,d8=s((()=>{l8=d(m(),1),n3(),i8(),a8(),u8=d(O(),1)})),f8=s((()=>{ba()}));function p8(e,t){return e&&Object.hasOwn(e.resources,t)?e.resources[t]:void 0}var m8=s((()=>{f8()})),h8,g8=s((()=>{ba(),h8=pa({remove:`Remove {shownLabel}`,choose:`Choose {name}`,search:`Search {name}…`,nothingToChoose:`Nothing to choose from.`})}));function _8(e){let t=Ss(e);if(t?.startsWith(`$`))return;let n=p8(ci().app(),e.id)?.display;return L2(gs.schema??void 0,e,t,n)}async function v8(e,t,n=pt(e)[0],r=gs.activeConnection,i=``,a=[],o){let s=Ss(e)??n,c=n;if(!c)return[];let l=o&&o.path!==c?[o.path]:[],u=[i,t?`${s} contains ${JSON.stringify(t)}`:``].filter(Boolean).join(` and `);return((await rs(`/api/run`,{q:[e.id,u,`show ${[...new Set([s,c,...pt(e),...a,...l])].join(`, `)}`,`sort ${s}`].filter(Boolean).join(` `),limit:w8,offset:0,count:`none`,...Aa(r)})).rows??[]).map(t=>({value:String(t[c]),label:Cs(e)===void 0?String(t[s]??t[c]):cs(e,t),...a.length?{row:t}:{},...l.length&&R2(t[l[0]])?{sub:R2(t[l[0]])}:{}}))}function y8(e){return e.editing?(0,C8.jsx)(b8,{...e}):(0,C8.jsx)(x8,{...e})}function b8(e){let t=(0,S8.useSyncExternalStore)(Ra,Ka,Ka),n=JSON.stringify([t.epoch,gs.activeConnection,e.table.id,e.valueColumn??pt(e.table)[0],Ss(e.table)]);return(0,C8.jsx)(x8,{...e,scope:n},n)}function x8(e){let{table:t,ariaLabel:n,placeholder:r,app:i,inputRef:a}=e,o=e.editing,s=gs.activeConnection,c=e.valueColumn??pt(t)[0],l=e.face?void 0:_8(t),u=e.multiple===!0?e.value:e.value?[e.value]:[],[d,f]=(0,S8.useState)(new Map),[p,m]=(0,S8.useState)(new Map),h=e.multiple===!0?void 0:e.known,g=e=>d.get(e)??(h?.value===e?h.label:void 0)??e,[_,v]=(0,S8.useState)(()=>e.multiple!==!0&&e.value?g(e.value):``),[y,b]=(0,S8.useState)(null),x=o&&typeof e.value==`string`?y??(e.value?g(e.value):``):_,S=o&&typeof e.value==`string`?y??``:_,[C,w]=(0,S8.useState)(``),[T,E]=(0,S8.useState)(!1),D=JSON.stringify(u),O=(0,S8.useRef)(D),k=(0,S8.useRef)(null),[A,j]=(0,S8.useState)(D);o&&A!==D&&(j(D),k.current!==D&&(b(null),E(!1),w(``),f(new Map)),k.current=null);let M=!!(o&&y!==null),N=(0,S8.useRef)(null);(0,S8.useLayoutEffect)(()=>{o&&(N.current?.unresolvedReference!==M||N.current?.open!==T)&&(N.current={unresolvedReference:M,open:T},o.onStateChange(N.current))});let P=(0,S8.useRef)(null),F=(0,S8.useRef)(null);(0,S8.useEffect)(()=>{f(new Map)},[s,t.id,c]);let I=e=>{F.current=e,typeof a==`function`?a(e):a&&(a.current=e)};(0,S8.useEffect)(()=>{let e=setTimeout(()=>w(x.trim()),150);return()=>clearTimeout(e)},[x]);let L=eJ({queryKey:[`picker`,s,t.id,c,C,e.scope,o?D:void 0,Ss(t),Cs(t),e.where??``,e.face?.columns.join(),l?.path],queryFn:()=>v8(t,C,c,s,e.where,e.face?.columns,e.face?void 0:l),enabled:T&&!e.disabled,placeholderData:(n,r)=>r&&r.queryKey[1]===s&&r.queryKey[2]===t.id&&r.queryKey[3]===c&&r.queryKey[5]===e.scope&&(!o||r.queryKey[6]===D)&&r.queryKey[7]===Ss(t)&&r.queryKey[8]===Cs(t)&&r.queryKey[9]===(e.where??``)?n:void 0}),{choices:R,answered:z}=r2({typed:S,asked:C,placeholder:L.isPlaceholderData,rows:L.data,label:e=>e.label}),B=eJ({queryKey:[`picker-labels`,s,t.id,c,u,e.scope,Ss(t),Cs(t),l?.path],enabled:!!(c&&u.length),queryFn:async()=>{let n=Ss(t)??c,r=[...new Set([c,n,...pt(t),...e.multiple&&l?[l.path]:[]])];return((r.some(e=>e.includes(`.`))||n.startsWith(`$`)?await rs(`/api/view/run`,{...Aa(s),view:{id:`picker:${t.id}`,name:``,base:t.id,columns:r.map(e=>({path:e})),filter:{groups:[[{path:c,op:`in`,value:u}]]},limit:u.length}}):await rs(`/api/query`,{...Aa(s),table:t.id,columns:r,filter:{groups:[[{column:c,op:`in`,value:u}]]},limit:u.length,offset:0})).rows??[]).map(r=>({value:String(r[c]),label:Cs(t)===void 0?String(r[n]??r[c]):cs(t,r),...e.multiple&&l&&R2(r[l.path])?{sub:R2(r[l.path])}:{}}))}});(0,S8.useEffect)(()=>{B.data&&f(e=>new Map([...e,...B.data.map(e=>[e.value,e.label])])),B.data?.some(e=>e.sub)&&m(e=>new Map([...e,...B.data.flatMap(e=>e.sub?[[e.value,e.sub]]:[])]))},[B.data]),(0,S8.useEffect)(()=>{if(o)return;let t=O.current!==D;O.current=D;let n=k.current===D;n&&(k.current=null),e.multiple!==!0&&(!T&&!n||t&&!n)&&v(e.value?g(e.value):``)},[D,d,T]);let V=t=>{k.current=JSON.stringify(t),e.multiple===!0?e.onChange(t):e.onChange(t[0]??``)},H=t=>{f(e=>new Map(e).set(t.value,t.label)),t.sub&&m(e=>new Map(e).set(t.value,t.sub)),e.multiple?(V(u.includes(t.value)?u.filter(e=>e!==t.value):[...u,t.value]),v(``)):(b(null),V([t.value]),v(t.label),E(!1))},U=e=>{V(u.filter(t=>t!==e)),F.current?.focus()},W=()=>{b(null),V([]),v(``),F.current?.focus()},G=e=>d.get(e)??e,ee=z2(R.map(e=>e.label)),te=e=>e.sub&&(l?.declared||ee.has(e.label))?e.sub:void 0,ne=z2(u.map(G)),K=e=>ne.has(G(e))&&p.get(e)?`${G(e)} · ${p.get(e)}`:G(e);return(0,C8.jsxs)(`div`,{className:`picker${e.multiple?` picker-multi`:``}`,ref:P,onKeyDownCapture:e=>{o&&T&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),o.onCancel?.(),b(null),E(!1))},children:[(0,C8.jsx)(`span`,{className:`picker-chips`,children:e.multiple&&u.map(e=>(0,C8.jsxs)(`span`,{className:`picker-chip`,children:[(0,C8.jsx)(`span`,{children:K(e)}),(0,C8.jsx)(`button`,{type:`button`,className:`picker-chip-x`,"aria-label":h8(`remove`,{shownLabel:K(e)}),onClick:()=>U(e),children:`×`})]},e))}),(0,C8.jsx)($0,{text:x,onText:t=>{o?b(t):v(t),E(!0),!o&&!e.multiple&&u.length&&V([])},open:T,onOpenChange:E,items:R,itemKey:e=>e.value,itemLabel:e=>e.label,itemClassName:(e,t)=>`picker-option${t?` active`:``}${u.includes(e.value)?` chosen`:``}`,renderItem:t=>e.face&&t.row?e.face.draw(t.row,t.label,R.flatMap(e=>e.row?[e.row]:[])):(0,C8.jsxs)(C8.Fragment,{children:[te(t)?(0,C8.jsxs)(`span`,{className:`picker-option-name`,children:[(0,C8.jsx)(`span`,{className:`picker-option-label`,children:t.label}),(0,C8.jsx)(`span`,{className:`picker-option-sub`,children:te(t)})]}):(0,C8.jsx)(`span`,{className:`picker-option-label`,children:t.label}),!e.hideKey&&t.label!==t.value&&(0,C8.jsx)(`span`,{className:`picker-option-detail`,children:t.value})]}),onPick:H,inputRef:I,popupRef:o?.popupRef,anchorRef:P,fit:`width`,inputProps:{type:`text`,className:`picker-input`,"aria-label":n??h8(`choose`,{name:nr(t.name)}),placeholder:r??(i?h8(`search`,{name:(p8(ci().app(),t.id)?.noun?.one??nr(t.name)).toLowerCase()}):`→ ${t.name}`),autoComplete:`off`,spellCheck:!1,...e.disabled?{disabled:!0}:{},...e.invalid?{"aria-invalid":!0}:{},...e.describedBy?{"aria-describedby":e.describedBy}:{},onKeyDown:t=>{o&&t.key===`Escape`&&t.preventBaseUIHandler?.(),t.key===`Backspace`&&e.multiple&&!x&&u.length&&V(u.slice(0,-1))}},popupClassName:`picker-popup`,listClassName:`picker-list`,empty:L.isPending||!z?void 0:h8(x?`common.nothingMatches`:`nothingToChoose`),emptyClassName:`picker-empty`}),(0,C8.jsx)(`button`,{type:`button`,className:`picker-clear`,"aria-label":h8(`common.clear`),hidden:u.length===0&&!M,onClick:W,children:`×`})]})}var S8,C8,w8,T8=s((()=>{Fa(),S8=d(m(),1),nJ(),Es(),n2(),i2(),St(),cr(),pi(),m8(),U2(),Ja(),g8(),C8=d(O(),1),w8=20}));function E8(e){return/[^aeiou]ies$/i.test(e)?`${e.slice(0,-3)}${e.at(-3)===`I`?`Y`:`y`}`:/(x|ch|sh|ss|z)es$/i.test(e)?e.slice(0,-2):e.slice(0,-1)}function D8(e){if(A8.test(e))return e.slice(0,-1);if(j8.test(e)&&!/(ss|us|is)$/i.test(e)&&/[aeiouy]/i.test(e.slice(0,-1)))return E8(e)}function O8(e,t){return k8.test(e)?D8(t)??t:t}var k8,A8,j8,M8=s((()=>{k8=/^[-−]?1$/,A8=/^(second|minute|hour|day|night|week|month|year)s$/i,j8=/^(?=[a-z]*[aeiouy][a-z]*s$)[a-z]{3,}s$/i})),N8,P8=s((()=>{ba(),N8=pa({textOfMax:`{text} of {max}`,starsOf:`{stars} of {outOf} stars`,signed:`Signed`})}));function F8(e,t){return e.whole?Si(t,e.currency):xi(t,e.currency)}function I8(e,t){return ir(e,t)}function L8(e,t){let n=(t,n)=>[t,...n].map(t=>e?.values&&Object.hasOwn(e.values,t)?e.values[t]:void 0).find(Boolean);return{yes:n(t.yes,Q8.yes),no:n(t.no,Q8.no)}}function R8(e,t){return t?t===`%`?wi(e):t.startsWith(`/`)?`${e}${t}`:`${e} ${O8(e,t)}`:e}function z8(e,t,n){if(!e.tone)return null;let r=Object.hasOwn(e.tone,n)?e.tone[n]:void 0;if(r)return r;let i=Object.hasOwn(e.tone,`*`)?e.tone[`*`]:n.trim()?`neutral`:null,a=Number(t);if(!Number.isFinite(a))return B8(e.tone,n)??i;for(let[t,n]of Object.entries(e.tone)){let e=/^(>=|<=|>|<)\s*(-?\d+(?:\.\d+)?)$/.exec(t);if(!e)continue;let r=Number(e[2]);if(e[1]===`>=`?a>=r:e[1]===`<=`?a<=r:e[1]===`>`?a>r:a<r)return n}return i}function B8(e,t){let n=Object.keys(e).filter(e=>/^[<>]/.test(e));if(!n.length)return null;let r=Li(t);if(r===null)return null;let i=Ii();for(let t of n){let n=zt(t);if(n&&Bt(n,r,i))return e[t]}return null}function V8(e,t){if(!e||t==null||t===``)return;if(e.masked===!0)return sr;let n=e.masked?.prefix;return n&&String(t).startsWith(n)?`${n}${sr}`:void 0}function H8(e){return e.trim().split(/[\s._-]+/).filter(e=>/[\p{L}\p{N}]/u.test(e)).slice(0,2).map(e=>[...e.replace(/[^\p{L}\p{N}]/gu,``)][0]??``).join(``).toUpperCase()||`?`}function U8(e,t){let n=e<0?`−`:``,r=Math.round(Math.abs(e)),i=[];for(let[e,t,n]of $8){let a=Math.floor(r/t);if(r-=a*t,a&&i.length<2)i.push({unit:e,count:a,mark:n});else if(i.length)break}i.length||i.push({unit:`seconds`,count:0,mark:`s`});let a=Intl.DurationFormat;if(a)try{return n+new a(t,{style:`narrow`}).format(Object.fromEntries(i.map(({unit:e,count:t})=>[e,t])))}catch{}return n+i.map(({count:e,mark:t})=>`${e}${t}`).join(` `)}function W8(e){let t=0;for(let n of e)t=t*31+(n.codePointAt(0)??0)>>>0;return t%8}function G8(e){let t=e;if(typeof e==`string`&&e.trim().startsWith(`[`))try{t=JSON.parse(e)}catch{t=e}return(Array.isArray(t)?t.map(e=>e==null?``:String(e)):String(t).split(/\r?\n|,/)).map(e=>e.trim()).filter(Boolean)}function K8(e,t){let n=Object.keys(e.values??{}).find(e=>e.trim()!==``&&Number(e)===t);return n===void 0?void 0:e.values?.[n]}function q8(e,t){return e.icons&&Object.hasOwn(e.icons,t)?e.icons[t]:void 0}function J8(e,t){if(!e||t==null)return null;let n=V8(e,t);if(n!==void 0)return{kind:`masked`,text:n};if(e.format===`avatars`){let e=G8(t);return e.length?{kind:`avatars`,names:e.slice(0,e5),more:Math.max(0,e.length-e5),text:e.join(`, `)}:null}e.minor&&e.format===`money`&&(t=Q4(t,e.currency||vi())??t);let r=String(t);if(e.signature&&typeof e.signature==`object`&&r.trim())return{kind:`signature`,src:_r(e.signature.table,{[e.signature.key]:r}),text:N8(`signed`)};let i=Y8(e,t,r);if(i!==void 0)return i;let a=z8(e,t,r),o=Number(t);if(e.bar&&e.max!==void 0&&e.format!==`percent`&&Number.isFinite(o)&&Number.isSafeInteger(Math.trunc(o)))return{kind:`meter`,text:e.format===`money`?F8(e,o):bi(o),fill:Math.max(0,Math.min(100,o/e.max*100)),tone:a,title:N8(`textOfMax`,{text:r,max:e.max})};let s=Number.isFinite(o)&&Number.isSafeInteger(Math.trunc(o))||e.format===`money`&&Z8(t),c=a?!s||r.trim()===``?!1:e.format===`money`||e.format===`percent`||e.format===`number`||!!e.unit:!1;if(a&&!(c&&a===`neutral`)){let n=!s||r.trim()===``?null:e.format===`money`?R8(F8(e,typeof t==`string`?r:o),e.unit):e.format===`percent`?Ci(o):e.format===`number`||e.unit?R8(bi(o),e.unit):null,i=q8(e,r);return{kind:`tone`,tone:a,text:r,label:n??I8(e,r)??rr(r),...i?{icon:i}:{},...n===null?{}:{figure:!0}}}let l=q8(e,r);if(l)return{kind:`mark`,icon:l,text:r,label:I8(e,r)??rr(r)};let u=e.format===void 0&&!e.bar&&!e.avatar?I8(e,r):void 0;if(u!==void 0)return{kind:`word`,text:r,label:u};let d=(e.format===`money`||e.format===`number`||e.format===`percent`)&&s&&r.trim()?K8(e,o):void 0;if(d!==void 0)return{kind:`word`,text:r,label:d};if(e.format===`money`&&s)return{kind:`money`,text:R8(F8(e,typeof t==`string`?r:o),e.unit),title:r};if(e.format===`percent`&&s){let t=Ci(o),n=Math.max(0,Math.min(100,o));return e.bar?{kind:`percent`,text:t,bar:n}:e.ring?{kind:`percent`,text:t,ring:n}:{kind:`percent`,text:t}}if((e.format===`number`||e.format===void 0&&e.unit)&&s&&r.trim()!==``)return{kind:`number`,text:R8(bi(o),e.unit),title:r};if(e.format===`duration`&&s)return{kind:`number`,text:U8(o,mi()),title:`${r} s`};if(e.format===`richText`)return{kind:`richText`,html:r,text:br(r)};if(e.format===`items`){let e=r.split(/\r?\n/).map(e=>e.trim()).filter(Boolean);if(e.length)return{kind:`items`,items:e,text:e.join(`, `)}}if(e.format===`relative`){let t=Fi(r),n=Li(r),i=e.open===!0&&n!==null&&n<0?{overdue:!0}:{};if(t&&n!==null&&(e.absolute||Math.abs(n)>14))return{kind:`relative`,text:Oi(r),title:t,...i};if(t)return{kind:`relative`,text:t,title:r,...i}}return e.avatar&&r.trim()?{kind:`avatar`,text:r,initials:H8(r),hue:W8(r)}:null}function Y8(e,t,n){switch(e.format){case`rating`:{let r=e.outOf??5,i=Number(t);if(n.trim()===``||!Number.isFinite(i))return null;let a=Math.max(0,Math.min(r,Math.round(i)));return{kind:`rating`,value:a,outOf:r,tone:z8(e,t,n),text:N8(`starsOf`,{stars:a,outOf:r})}}case`color`:return t5.test(n.trim())?{kind:`color`,hex:n.trim().toLowerCase(),text:n.trim()}:null;case`time`:{let e=n5.exec(n.trim());return!e||Number(e[1])>23||Number(e[2])>59?null:{kind:`number`,text:new Intl.DateTimeFormat(mi(),{hour:`numeric`,minute:`2-digit`,timeZone:`UTC`}).format(Date.UTC(2e3,0,1,Number(e[1]),Number(e[2]))),title:n}}case`month`:{let e=r5.exec(n.trim());return!e||Number(e[2])<1||Number(e[2])>12?null:{kind:`number`,text:new Intl.DateTimeFormat(mi(),{month:`short`,year:`numeric`,timeZone:`UTC`}).format(Date.UTC(Number(e[1]),Number(e[2])-1,1)),title:n}}case`date`:case`datetime`:{if(typeof t!=`string`||!n.trim())return null;let r=Ni(n,{time:e.format===`datetime`,zone:e.timezone});if(r===n)return null;let i=e.tone?z8(e,t,n):null;return i&&i!==`neutral`?{kind:`tone`,tone:i,text:n,label:r}:{kind:`date`,text:r,title:n}}case`year`:return/^\d{1,4}$/.test(n.trim())?{kind:`number`,text:n.trim(),title:n}:null;case`json`:{let e=typeof t==`string`?n:JSON.stringify(t),r;try{r=JSON.parse(e)}catch{return null}return!r||typeof r!=`object`?null:{kind:`json`,text:e,excerpt:e.replace(/\s+/g,` `).slice(0,120)}}case`qr`:return n.trim()?{kind:`qr`,text:n}:null;case`address`:{let e=X8(n);return e.length?{kind:`address`,lines:e,text:e.join(`, `)}:null}}}function X8(e){return e.split(/\r?\n/).map(e=>e.trim().replace(/\s+/g,` `)).filter(Boolean)}var Z8,Q8,$8,e5,t5,n5,r5,i5=s((()=>{Dr(),cr(),Yi(),n3(),Vt(),M8(),P8(),Z8=e=>typeof e==`number`&&Number.isFinite(e)||typeof e==`string`&&/^\s*[+-]?\d+(\.\d+)?\s*$/.test(e),Q8={yes:[`true`,`1`,`t`],no:[`false`,`0`,`f`]},$8=[[`days`,86400,`d`],[`hours`,3600,`h`],[`minutes`,60,`m`],[`seconds`,1,`s`]],e5=3,t5=/^#[0-9a-f]{6}$|^#[0-9a-f]{3}$/i,n5=/^(\d{1,2}):(\d{2})(?::\d{2}(?:\.\d+)?)?$/,r5=/^(\d{4})-(\d{2})(?:-\d{2})?/}));function a5(e,t){return!!t.references&&!xs(e.id).some(e=>e.from.columns.length>1&&e.from.columns.includes(t.name))}var o5=s((()=>{Es()})),s5,c5=s((()=>{ba(),s5=pa({one:`one of: {allowed}`,saved:`Saved {label}.`,edit:`Edit {label}`})}));function l5(e){let t=(0,d5.useId)(),n=t$(e.table.id,e.column.name);return n?(0,f5.jsx)(n$,{component:n,fallback:(0,f5.jsx)(u5,{...e}),value:e.value,onChange:t=>e.onChange(t===null||t===``?e.column.nullable?null:``:String(t)),id:e.id??t,describedBy:e.describedBy,invalid:e.invalid===!0,disabled:!1,required:e.column.nullable===!1,label:e.label,field:{name:e.column.name,resource:e.table.id},context:`edit`}):(0,f5.jsx)(u5,{...e})}function u5({table:e,column:t,value:n,onChange:r,label:i,id:a,row:o,onPickerState:s,describedBy:c,invalid:l,valueLabel:u}){let d=(0,d5.useId)(),f=e=>r(e===``&&t.nullable?null:e),p=t.references&&a5(e,t)?bs(t.references.table):void 0;if(p)return(0,f5.jsx)(y8,{table:p,valueColumn:t.references.column,value:n??``,onChange:f,ariaLabel:i,app:!0,...u&&n?{known:{value:n,label:u}}:{},editing:{onStateChange:e=>s?.(e)}});let m=z6(t,o);if(t.allowed?.length||m){let r=m?L8(ps(e.id,t.name),m):{},o=t.allowed?.length?t.allowed.map(e=>({value:e,label:rr(e)||nr(e)})):[{value:m.yes,label:r.yes??s5(`common.yes`)},{value:m.no,label:r.no??s5(`common.no`)}];return n!==null&&!o.some(e=>e.value===n)&&o.unshift({value:n,label:n}),(0,f5.jsx)(rQ,{ariaLabel:i,id:a,value:n??``,ariaInvalid:l,ariaDescribedBy:c,items:[...t.nullable?[{value:``,label:s5(`common.noValue`)}]:[],...o],onChange:f})}if(ht(t.type)===`date`&&!/time/i.test(t.type))return(0,f5.jsx)(WQ,{id:a??d,value:n??``,onChange:f,"aria-label":i,"aria-invalid":l||void 0,"aria-describedby":c,locale:mi(),timezone:hi(),now:_i()});let h=ps(e.id,t.name);return h?.format===`money`&&h.minor?(0,f5.jsx)(c8,{value:n??``,currency:e3(h,o,h.currency||vi()),onChange:f,children:(e,t)=>(0,f5.jsx)(`input`,{id:a,type:`text`,inputMode:`decimal`,className:`cell-edit`,"aria-label":i,"aria-invalid":l||void 0,"aria-describedby":c,value:e,"data-null":String(n===null),onChange:e=>t(e.target.value)})}):(0,f5.jsx)(`input`,{id:a,type:`text`,className:`cell-edit`,"aria-label":i,"aria-invalid":l||void 0,"aria-describedby":c,value:n??``,"data-null":String(n===null),onChange:e=>f(e.target.value),title:t.allowed?.length?s5(`one`,{allowed:t.allowed.join(`, `)}):void 0})}var d5,f5,p5=s((()=>{d5=d(m(),1),Es(),Fa(),St(),cr(),B6(),Z6(),$6(),t8(),pi(),Ja(),Yi(),n3(),d8(),aQ(),T8(),qQ(),i5(),o5(),c$(),c5(),f5=d(O(),1)})),m5=s((()=>{cr(),A2()}));function h5(e,t,n,r){return U(`/api/file?${new URLSearchParams({...Aa(n??null),table:e,key:JSON.stringify(t),inline:`1`,...r?{variant:r}:{}})}`)}var g5=s((()=>{W(),Fa(),m5()}));function _5(e,t){let n=gs.activeConnection??null,r=e.flatMap(e=>{let n=y5(e.display),r=n&&e.photoOwner?bs(n.from):void 0,i=r?pt(r):[];if(!n||!r||!i.length||!e.photoOwner)return[];let a=[...new Set(t.map(t=>t[e.photoOwner]).filter(e=>e!=null))];if(!a.length)return[];let[o,s=`asc`]=(n.sort??``).split(/\s+/),c=`${r.id} ${n.whose} in (${a.map(b5).join(`, `)}) sort ${n.whose}${o?`, ${o} ${s}`:``} show ${[...new Set([...i,n.whose])].join(`, `)}`;return[{column:e.name,from:r,key:i,whose:n.whose,text:c}]}),i=Yq({queries:r.map(e=>({queryKey:[`run`,n??``,`avatar-photos`,e.text],staleTime:6e4,queryFn:async()=>{let t=await rs(`/api/run`,{q:e.text,limit:500,offset:0,count:`none`,...Aa(n)});return t.errors?.length?[]:t.rows??[]}}))}),a=r.map((e,t)=>`${e.text}@${i[t]?.dataUpdatedAt??0}`).join(`
208
+ `);return/\s/.test(n)}):!1}function hM(e){return()=>{let t=e.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=e.view.coordsAtPos(t);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}}}function gM(e,t,n,r){return n?()=>{let n=r.getState(e.state)?.decorationId;return t.dom.querySelector(`[data-decoration-id="${n}"]`)?.getBoundingClientRect()||null}:hM(e)}function _M({match:e,dismissedRange:t,state:n,transaction:r,editor:i,shouldResetDismissed:a,effectiveAllowSpaces:o}){return a?.({editor:i,state:n,range:t,match:e,transaction:r,allowSpaces:o})?!1:o?e.range.from===t.from:e.range.from===t.from&&!mM(r)}function vM({view:e,pluginKeyRef:t}){let n=e.state.tr.setMeta(t,{exit:!0});e.dispatch(n)}function yM({pluginKey:e,decorationTag:t,decorationClass:n,decorationContent:r,decorationEmptyClass:i,renderer:a,dispatchExit:o}){return{handleKeyDown(t,n){var r;let i=e.getState(t.state);if(!i.active)return!1;if(n.key===`Escape`||n.key===`Esc`){var s;return a==null||(s=a.onKeyDown)==null||s.call(a,{view:t,event:n,range:i.range}),o(t),!0}return(a==null||(r=a.onKeyDown)==null?void 0:r.call(a,{view:t,event:n,range:i.range}))||!1},decorations(a){let{active:o,range:s,decorationId:c,query:l}=e.getState(a);if(!o)return null;let u=!l?.length,d=[n];return u&&d.push(i),_g.create(a.doc,[mg.inline(s.from,s.to,{nodeName:t,class:d.join(` `),"data-decoration-id":c||void 0,"data-decoration-content":r})])}}}function bM({editor:e,char:t,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,findSuggestionMatch:o,allow:s,shouldShow:c,shouldKeepDismissed:l,pluginKey:u}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(d,f,p,m){let{isEditable:h}=e,{composing:g}=e.view,{selection:_}=d,{empty:v,from:y}=_,b={...f},x=d.getMeta(u);if(x&&x.exit)return b.active=!1,b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null,b.dismissedRange=f.active?{...f.range}:f.dismissedRange,b;if(b.composing=g,d.docChanged&&b.dismissedRange!==null&&(b.dismissedRange={from:d.mapping.map(b.dismissedRange.from),to:d.mapping.map(b.dismissedRange.to)}),h&&(v||e.view.composing)){(y<f.range.from||y>f.range.to)&&!g&&!f.composing&&(b.active=!1);let u=o({char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:_.$from}),p=`id_${Math.floor(Math.random()*4294967295)}`;u&&s({editor:e,state:m,range:u.range,isActive:f.active})&&(!c||c({editor:e,range:u.range,query:u.query,text:u.text,transaction:d}))?(b.dismissedRange!==null&&!l({match:u,dismissedRange:b.dismissedRange,state:m,transaction:d})&&(b.dismissedRange=null),b.dismissedRange===null?(b.active=!0,b.decorationId=f.decorationId||p,b.range=u.range,b.query=u.query,b.text=u.text):b.active=!1):(u||(b.dismissedRange=null),b.active=!1)}else b.active=!1;return b.active||(b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null),b}}}function xM({editor:e,items:t}){let n=null,r=null,i=null,a=()=>{r!==null&&(clearTimeout(r),r=null),i?.(),i=null},o=e=>new Promise(t=>{i=t,r=setTimeout(()=>{r=null;let e=i;i=null,e?.()},e)}),s=()=>{n?.abort(),a(),n=null};return{abort:s,fetch:async(r,i)=>{s(),n=new AbortController;let a=n;if(i>0&&await o(i),n!==a||a.signal.aborted)return{status:`aborted`};try{let i=await t({editor:e,query:r,signal:a.signal});return n!==a||a.signal.aborted?{status:`aborted`}:{status:`resolved`,items:i}}catch{return n!==a||a.signal.aborted?{status:`aborted`}:{status:`error`}}}}}function SM({placement:e,offset:t,flip:n,floatingUi:r}){var i;let a=[oM({mainAxis:t.mainAxis??4,crossAxis:t.crossAxis??0})];return n&&a.push(cM()),r!=null&&(i=r.middleware)!=null&&i.length&&a.push(...r.middleware),{placement:e,strategy:r?.strategy??`absolute`,middleware:a}}function wte(e){if(e instanceof HTMLElement)return e;if(typeof e==`string`)try{let t=document.querySelector(e);if(t)return t}catch{return document.body}return document.body}function Tte({getReferenceRect:e,contextElement:t,config:n,container:r,dismissOnOutsideClick:i,dismiss:a}){return(o,s={})=>{let c={getBoundingClientRect:()=>e()??new DOMRect,contextElement:t},l=!1,u=!o.isConnected;u&&wte(r).appendChild(o),s.onPosition||(o.style.visibility=`hidden`,o.style.width=`max-content`);let d=tM(c,o,()=>{dM(c,o,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:e,y:t,placement:n,strategy:r})=>{s.onPosition?s.onPosition({x:e,y:t,placement:n,strategy:r}):(Object.assign(o.style,{position:r,left:`${e}px`,top:`${t}px`}),l||(l=!0,o.style.visibility=``))})},s.autoUpdate),f;return i&&(f=e=>{let n=e.target;!(n instanceof Node)||o.contains(n)||t.contains(n)||a()},document.addEventListener(`pointerdown`,f,!0)),()=>{d(),f&&document.removeEventListener(`pointerdown`,f,!0),u&&o.remove()}}}function Ete({editor:e,pluginKey:t,items:n,renderer:r,minQueryLength:i,debounce:a,initialItems:o,placement:s,offset:c,container:l,flip:u,floatingUi:d,dismissOnOutsideClick:f,command:p,clientRectFor:m,dispatchExit:h}){let g,_=xM({editor:e,items:n}),v=SM({placement:s,offset:c,flip:u,floatingUi:d});function y(e,t){switch(e){case`started`:var n;r==null||(n=r.onStart)==null||n.call(r,t);break;case`updated`:var i;r==null||(i=r.onUpdate)==null||i.call(r,t);break;case`stopped`:var a;r==null||(a=r.onExit)==null||a.call(r,t)}}return{update:async(n,d)=>{let b=t.getState(d),x=t.getState(n.state);if(!b||!x)return;let S=null,C=b.query!==x.query,w=b.text!==x.text,T=b.range.from!==x.range.from||b.range.to!==x.range.to,E=C||w||T;if(!b.active&&x.active)S=`started`;else if(b.active&&!x.active)S=`stopped`;else if(x.active&&E)S=`updated`;else return;let D=S===`stopped`?b:x,O=n.dom.querySelector(`[data-decoration-id="${D.decorationId}"]`),k=m(n,O),A=i===0||(D.query?D.query.length>=i:!1),j=(S===`started`||S===`updated`)&&A;if(g={editor:e,range:D.range,query:D.query||``,text:D.text||``,items:o??[],command:t=>p({editor:e,range:D.range,props:t}),decorationNode:O,clientRect:k,loading:j,placement:s,offset:{mainAxis:c.mainAxis??4,crossAxis:c.crossAxis??0},container:l,flip:u,floatingUi:v,mount:Tte({getReferenceRect:k,contextElement:n.dom,config:v,container:l,dismissOnOutsideClick:f,dismiss:()=>h(e.view)})},S===`started`){var M;r==null||(M=r.onBeforeStart)==null||M.call(r,g)}if(S===`updated`){var N;r==null||(N=r.onBeforeUpdate)==null||N.call(r,g)}if(S===`started`&&y(S,g),S===`started`||S===`updated`){if(!j)_.abort(),g={...g,items:o??[],loading:!1};else{g={...g,items:o??[],loading:!0},S=`updated`,y(S,g);let e=await _.fetch(D.query||``,a);if(e.status===`aborted`)return;if(!t.getState(n.state)?.active){_.abort();return}g=e.status===`resolved`?{...g,items:e.items,loading:!1}:{...g,loading:!1}}}S===`stopped`?(_.abort(),y(S,g),g=void 0):S===`updated`&&y(S,g)},destroy:()=>{var e;_.abort(),g&&(r==null||(e=r.onExit)==null||e.call(r,g))}}}function Dte({pluginKey:e=CM,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],minQueryLength:p=0,debounce:m=0,initialItems:h,placement:g=`bottom-start`,offset:_={},container:v,flip:y=!0,floatingUi:b,dismissOnOutsideClick:x=!0,render:S=()=>({}),allow:C=()=>!0,findSuggestionMatch:w=pM,shouldShow:T,shouldResetDismissed:E}){let D=S?.(),O=r&&!i,k=(n,r)=>gM(t,n,r,e);function A(e){return _M({...e,editor:t,shouldResetDismissed:E,effectiveAllowSpaces:O})}let j=t=>vM({view:t,pluginKeyRef:e});return new ld({key:e,view:()=>Ete({editor:t,pluginKey:e,items:f,renderer:D,minQueryLength:p,debounce:m,initialItems:h,placement:g,offset:_,container:v,flip:y,floatingUi:b,dismissOnOutsideClick:x,command:d,clientRectFor:k,dispatchExit:j}),state:bM({editor:t,char:n,effectiveAllowSpaces:O,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,findSuggestionMatch:w,allow:C,shouldShow:T,shouldKeepDismissed:A,pluginKey:e}),props:yM({pluginKey:e,decorationTag:s,decorationClass:c,decorationContent:l,decorationEmptyClass:u,renderer:D,dispatchExit:j})})}var CM,Ote=s((()=>{pd(),Ix(),Ag(),fM(),CM=new dd(`suggestion`)}));function kte({editor:e,overrideSuggestionOptions:t,extensionName:n,char:r=`@`}){return{editor:e,char:r,pluginKey:new dd,command:({editor:e,range:t,props:i})=>{var a,o;let s=e.view.state.selection.$to.nodeAfter;s!=null&&(a=s.text)!=null&&a.startsWith(` `)&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:n,attrs:{...i,mentionSuggestionChar:r}},{type:`text`,text:` `}]).run(),(o=e.view.dom.ownerDocument.defaultView)==null||(o=o.getSelection())==null||o.collapseToEnd()},allow:({state:e,range:t})=>{let r=e.doc.resolve(t.from),i=e.schema.nodes[n];return!!r.parent.type.contentMatch.matchType(i)},...t}}function wM(e){return(e.options.suggestions.length?e.options.suggestions:[e.options.suggestion]).map(t=>kte({editor:e.editor,overrideSuggestionOptions:t,extensionName:e.name,char:t.char}))}function TM(e,t){let n=wM(e);return n.find(e=>e.char===t)||(n.length?n[0]:null)}var EM,DM,Ate=s((()=>{Ix(),of(),Ote(),pd(),EM=Fx.create({name:`mention`,priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:e,suggestion:t}){return`${t?.char??`@`}${e.attrs.label??e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:t,suggestion:n}){return[`span`,rv(this.HTMLAttributes,e.HTMLAttributes),`${n?.char??`@`}${t.attrs.label??t.attrs.id}`]},suggestions:[],suggestion:{}}},group:`inline`,inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute(`data-id`),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute(`data-label`),renderHTML:e=>e.label?{"data-label":e.label}:{}},mentionSuggestionChar:{default:`@`,parseHTML:e=>e.getAttribute(`data-mention-suggestion-char`),renderHTML:e=>({"data-mention-suggestion-char":e.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=TM(this,e.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn(`renderLabel is deprecated use renderText and renderHTML instead`),[`span`,rv({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e,suggestion:n})];let r={...this.options};r.HTMLAttributes=rv({"data-type":this.name},this.options.HTMLAttributes,t);let i=this.options.renderHTML({options:r,node:e,suggestion:n});return typeof i==`string`?[`span`,rv({"data-type":this.name},this.options.HTMLAttributes,t),i]:i},...py({nodeName:`mention`,name:`@`,selfClosing:!0,allowedAttributes:[`id`,`label`,{name:`mentionSuggestionChar`,skipIfDefault:`@`}],parseAttributes:e=>{let t={},n=/(?:^|\s)(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i===`char`?`mentionSuggestionChar`:i]=a??o,r=n.exec(e)}return t},serializeAttributes:e=>Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e===`mentionSuggestionChar`?`char`:e}="${t}"`).join(` `)}),renderText({node:e}){let t={options:this.options,node:e,suggestion:TM(this,e.attrs.mentionSuggestionChar)};return this.options.renderLabel===void 0?this.options.renderText(t):(console.warn(`renderLabel is deprecated use renderText and renderHTML instead`),this.options.renderLabel(t))},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1,{selection:r}=t,{empty:i,anchor:a}=r;if(!i)return!1;let o=new il,s=0;return t.doc.nodesBetween(a-1,a,(e,t)=>{if(e.type.name===this.name)return n=!0,o=e,s=t,!1}),n&&e.insertText(this.options.deleteTriggerWithBackspace?``:o.attrs.mentionSuggestionChar,s,s+o.nodeSize),n})}},addProseMirrorPlugins(){return wM(this).map(Dte)}}),DM=EM})),OM,kM,AM,jte=s((()=>{Ix(),OM=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,kM=Fx.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,rv(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize,i=new Set([`src`,`width`,`height`]);return({node:a,getPos:o,HTMLAttributes:s,editor:c})=>{let l=document.createElement(`img`);l.draggable=!1;let u=rv(this.options.HTMLAttributes,s);Object.entries(u).forEach(([e,t])=>{if(t!=null)switch(e){case`src`:case`width`:case`height`:break;default:l.setAttribute(e,t)}}),u.src!==null&&(l.src=u.src);let d={...s},f=e=>{typeof e==`string`&&e!==``?l.getAttribute(`src`)!==e&&(l.src=e):(l.hasAttribute(`src`)&&l.removeAttribute(`src`),l.src!==``&&(l.src=``))};f(s.src);let p=new Px({element:l,editor:c,node:a,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let n=o();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:e=>{if(e.type!==a.type)return!1;let t=iv(e,c.extensionManager.attributes.filter(t=>t.type===e.type.name));return Object.keys(d).forEach(e=>{!i.has(e)&&!(e in t)&&l.removeAttribute(e)}),Object.entries(t).forEach(([e,t])=>{i.has(e)||(t==null?l.removeAttribute(e):l.setAttribute(e,t))}),f(t.src),d=t,!0},options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),m=p.dom,h=()=>{m.style.visibility=``,m.style.pointerEvents=``};return m.style.visibility=`hidden`,m.style.pointerEvents=`none`,l.complete&&l.naturalWidth>0?h():(l.onload=h,l.onerror=h),p}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Oy({find:OM,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),AM=kM}));function jM(e,t){let n=MM.useRef(NM);return n.current===NM&&(n.current=e(t)),n}var MM,NM,PM=s((()=>{MM=d(m(),1),NM={}}));function Mte(){return zM}function Nte(e){RM.push(e)}function FM(e){let t=(t,n)=>{let r=jM(Pte).current,i;try{zM=r;for(let e of RM)e.before(r);i=e(t,n);for(let e of RM)e.after(r);r.didInitialize=!0}finally{zM=void 0}return i};return t.displayName=e.displayName||e.name,t}function IM(e){return LM.forwardRef(FM(e))}function Pte(){return{didInitialize:!1}}var LM,RM,zM,BM=s((()=>{LM=d(m(),1),PM(),RM=[],zM=void 0}));function VM(){}var HM,UM,WM=s((()=>{HM=Object.freeze([]),UM=Object.freeze({})}));function GM(e){KM.useEffect(e,HM)}var KM,qM=s((()=>{KM=d(m(),1),WM()}));function JM(){let e=jM(XM.create).current;return GM(e.disposeEffect),e}var YM,XM,ZM=s((()=>{PM(),qM(),YM=0,XM=class e{static create(){return new e}currentId=YM;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=YM,t()},e)}isStarted(){return this.currentId!==YM}clear=()=>{this.currentId!==YM&&(clearTimeout(this.currentId),this.currentId=YM)};disposeEffect=()=>this.clear}})),QM,$M,Q,eN=s((()=>{QM=d(m(),1),$M=()=>{},Q=typeof document<`u`?QM.useLayoutEffect:$M}));function tN(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var nN,rN,iN,aN,oN,sN=s((()=>{({userAgent:nN,platform:rN,maxTouchPoints:iN}=tN()),aN=nN.toLowerCase(),oN=rN.toLowerCase()})),cN,lN,uN,dN,fN,pN=s((()=>{sN(),cN=/^i(os$|p)/.test(oN)||oN===`macintel`&&iN>1,lN=`android`,uN=oN===lN||aN.includes(lN),dN=!cN&&oN.startsWith(`mac`),oN.startsWith(`win`),!uN&&/^(linux|chrome os)/.test(oN),fN=dN||cN})),mN,hN,gN=s((()=>{sN(),mN=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),hN=!mN&&aN.includes(`firefox`),!mN&&aN.includes(`chrom`)})),_N,vN=s((()=>{pN(),_N=fN})),yN,bN=s((()=>{sN(),yN=/jsdom|happydom/.test(aN)})),xN=s((()=>{pN(),gN(),vN(),bN()})),SN=s((()=>{xN()}));function CN(e){e.preventDefault(),e.stopPropagation()}function Fte(e){return`nativeEvent`in e}function wN(e){return e.pointerType===``&&e.isTrusted?!0:uN&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function TN(e){return yN?!1:!uN&&e.width===0&&e.height===0||uN&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function EN(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function DN(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var ON=s((()=>{SN()}));function kN(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function AN(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&fj(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function jN(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var MN=s((()=>{Aj()})),NN,PN,FN,IN,LN,RN,zN=s((()=>{NN=`data-base-ui-focusable`,PN=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,FN=`ArrowLeft`,IN=`ArrowRight`,LN=`ArrowUp`,RN=`ArrowDown`})),BN,VN,HN=s((()=>{BN=`data-starting-style`,VN=`data-ending-style`})),UN,WN,GN,KN=s((()=>{HN(),UN={[BN]:``},WN={[VN]:``},GN={transitionStatus(e){return e===`starting`?UN:e===`ending`?WN:null}}})),qN,JN,YN,XN=s((()=>{HN(),qN=`data-open`,JN=`data-closed`,YN=`data-anchor-hidden`})),ZN,QN,$N=s((()=>{ZN=`data-popup-open`,QN=`data-pressed`})),eP,tP,nP,rP,iP,aP,oP,sP,cP,lP=s((()=>{KN(),XN(),$N(),eP={[ZN]:``},tP={[ZN]:``,[QN]:``},nP={[qN]:``},rP={[JN]:``},iP={[YN]:``},aP={open(e){return e?eP:null}},oP={open(e){return e?tP:null}},sP={open(e){return e?nP:rP},anchorHidden(e){return e?iP:null}},cP={...sP,...GN}})),uP,Ite=s((()=>{lP(),uP=`data-trigger-disabled`}));function dP(e,t){if(!uj(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(uP);for(let[,e]of t.entries())if(AN(e,n))return!e.hasAttribute(uP);return!1}function fP(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Lte(e){return e.matches(`html,body`)}function pP(e){return dj(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function mP(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${PN}`)!=null}function hP(e){return e?e.getAttribute(`role`)===`combobox`&&pP(e):!1}function gP(e){if(!e||yN)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function _P(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}var vP=s((()=>{Aj(),SN(),MN(),zN(),Ite()}));function yP(e,t){return t!=null&&!EN(t)?0:typeof e==`function`?e():e}function bP(e,t,n){let r=yP(e,n);return typeof r==`number`?r:r?.[t]}function xP(e){return typeof e==`function`?e():e}function SP(e,t){return t||e===`click`||e===`mousedown`}function CP(e){return e?.includes(`mouse`)&&e!==`mousedown`}var wP=s((()=>{ON(),vP()})),TP,EP,DP,OP,kP,AP,jP,MP,NP,PP,FP,IP,LP,RP,zP,BP,VP,HP,UP,Rte=s((()=>{TP=`none`,EP=`trigger-press`,DP=`trigger-hover`,OP=`trigger-focus`,kP=`outside-press`,AP=`item-press`,jP=`close-press`,MP=`input-change`,NP=`input-clear`,PP=`input-press`,FP=`focus-out`,IP=`escape-key`,LP=`list-navigation`,RP=`keyboard`,zP=`pointer`,BP=`cancel-open`,VP=`sibling-open`,HP=`imperative-action`,UP=`window-resize`})),WP=s((()=>{Rte()}));function GP(e,t,n,r){let i=!1,a=!1,o=r??UM;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function zte(e,t,n){let r=n??UM;return{reason:e,event:t??new Event(`base-ui`),...r}}var KP=s((()=>{WM()}));function qP(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var JP=s((()=>{}));function YP(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var XP=s((()=>{}));function ZP(e,t,n,r){let i=jM($P).current;return eF(i,e,t,n,r)&&nF(i,[e,t,n,r]),i.callback}function QP(e){let t=jM($P).current;return tF(t,e)&&nF(t,e),t.callback}function $P(){return{callback:null,cleanup:null,refs:[]}}function eF(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function tF(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function nF(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var rF=s((()=>{PM()}));function iF(e){let t=jM(aF,e).current;return t.next=e,Q(t.effect),t}function aF(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var oF=s((()=>{eN(),PM()})),sF,cF,lF=s((()=>{sF=d(m(),1),cF={...sF}}));function $(e){let t=jM(uF).current;return t.next=e,pF(t.effect),t.trampoline}function uF(){let e={next:void 0,callback:dF,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function dF(){}var fF,pF,mF=s((()=>{lF(),PM(),fF=cF.useInsertionEffect,pF=fF&&fF!==cF.useLayoutEffect?fF:e=>e()}));function hF(){let e=jM(yF.create).current;return GM(e.disposeEffect),e}var gF,_F,vF,yF,bF=s((()=>{PM(),qM(),gF=null,globalThis.requestAnimationFrame,_F=class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},vF=new _F,yF=class e{static create(){return new e}static request(e){return vF.request(e)}static cancel(e){return vF.cancel(e)}currentId=gF;request(e){this.cancel(),this.currentId=vF.request(()=>{this.currentId=gF,e()})}cancel=()=>{this.currentId!==gF&&(vF.cancel(this.currentId),this.currentId=gF)};disposeEffect=()=>this.cancel}}));function xF(e){return e?.ownerDocument||document}var SF=s((()=>{Aj()})),CF,wF,TF,EF=s((()=>{CF={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},wF={...CF,position:`fixed`,top:0,left:0},TF={...CF,position:`absolute`}})),DF,OF,kF,AF=s((()=>{DF=d(m(),1),eN(),SN(),EF(),OF=d(O(),1),kF=DF.forwardRef(function(e,t){let[n,r]=DF.useState();Q(()=>{_N&&mN&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,OF.jsx)(`span`,{...e,ref:t,style:wF,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})})}));function jF(e,t,n){return Math.floor(e/t)!==n}function MF(e,t){return t<0||t>=e.length}function NF(e,t){return FF(e.current,{disabledIndices:t})}function PF(e,t){return FF(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function FF(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&LF(e,a,r));return a}function IF(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!LF(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=zA(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!LF(e,r,s))return r}};d&&CN(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=FF(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=FF(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}MF(e,f)&&(f=u)}if(n===`both`){let n=zA(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&CN(t),u%o===o-1?r&&(f=FF(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=FF(e,{startingIndex:u,disabledIndices:s}),r&&jF(f,o,n)&&(f=FF(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),jF(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&CN(t),u%o===0?r&&(f=FF(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=FF(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&jF(f,o,n)&&(f=FF(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),jF(f,o,n)&&(f=u));let c=zA(l/o)===n;MF(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:FF(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function LF(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!zF(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function RF(e){return e.visibility===`hidden`||e.visibility===`collapse`}function zF(e,t=e?bj(e):null){return!e||!e.isConnected||!t||RF(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var BF=s((()=>{KA(),Aj(),ON(),zN()}));function Bte(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return fj(n)?n.host:null}function VF(e){for(let t of Array.from(e.children))if(oj(t)===`summary`)return t;return null}function Vte(e,t){let n=VF(t);return!!n&&(e===n||AN(n,e))}function HF(e){let t=e?oj(e):``;return e!=null&&e.matches(sI)&&(t!==`summary`||e.parentElement!=null&&oj(e.parentElement)===`details`&&VF(e.parentElement)===e)&&(t!==`details`||VF(e)==null)&&(t!==`input`||e.type!==`hidden`)}function UF(e){if(!HF(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Bte(t)){let n=t!==e,r=oj(t)===`slot`;if(t.hasAttribute(`inert`)||n&&oj(t)===`details`&&!t.open&&!Vte(e,t)||t.hasAttribute(`hidden`)||!r&&!Hte(t,n))return!1}return!0}function Hte(e,t){let n=bj(e);return t?n.display!==`none`:zF(e,n)}function WF(e){let t=e.tabIndex;if(t<0){let t=oj(e);if(t===`details`||t===`audio`||t===`video`||dj(e)&&e.isContentEditable)return 0}return t}function GF(e){if(oj(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Ute(e,t){let n=GF(e);if(!n)return!0;let r=t.find(e=>{let t=GF(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=GF(e);return t?.name===n.name&&t.form===n.form})===n}function KF(e){if(dj(e)&&oj(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return dj(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function qF(e,t){KF(e).forEach(e=>{HF(e)&&t.push(e),qF(e,t)})}function JF(e,t,n){KF(e).forEach(e=>{dj(e)&&e.matches(t)&&n.push(e),JF(e,t,n)})}function YF(e){return UF(e)&&WF(e)>=0}function XF(e){let t=[];return qF(e,t),t.filter(UF)}function ZF(e){let t=XF(e);return t.filter(e=>WF(e)>=0&&Ute(e,t))}function QF(e,t){let n=ZF(e),r=n.length;if(r===0)return;let i=kN(xF(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function $F(e){return QF(xF(e).body,1)||e}function eI(e){return QF(xF(e).body,-1)||e}function tI(e,t){if(!e)return null;let n=ZF(xF(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function nI(e){return tI(e,1)}function rI(e){return tI(e,-1)}function iI(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!AN(n,r)}function aI(e){ZF(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function oI(e){let t=[];JF(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var sI,cI=s((()=>{Aj(),SF(),vP(),BF(),sI=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`}));function lI(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...lI(e,t.id,n)])}function uI(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}var dI=s((()=>{}));function fI(e){return`data-base-ui-${e}`}var pI=s((()=>{}));function mI(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(hI);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),VM;let o=requestAnimationFrame(a);return hI=o,()=>{hI===o&&(cancelAnimationFrame(o),hI=0)}}var hI,gI=s((()=>{WM(),hI=0}));function _I(e){return CI[e]}function vI(e){return e?fj(e)?e.host:vI(e.parentNode):null}function yI(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=EI(t,e),l=i?OI(t,DI(c),new Set(c)):[],u=[],d=[];if(a){let e=xI[a],n=_I(a);s=n,o=e;let r=EI(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);OI(t,DI(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(wI.get(e)||0)+1;wI.set(e,t),d.push(e),t===1&&e.setAttribute(SI,``)}),TI+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(wI.get(e)||0)-1;wI.set(e,t),t||e.removeAttribute(SI)}),--TI,TI||(xI.inert=new WeakMap,xI[`aria-hidden`]=new WeakMap,CI.inert=new WeakSet,CI[`aria-hidden`]=new WeakSet,wI=new WeakMap)}}function bI(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=xF(e[0]).body;return yI(e,a,n,r,{mark:i})}var xI,SI,CI,wI,TI,EI,DI,OI,kI=s((()=>{Aj(),SF(),xI={inert:new WeakMap,"aria-hidden":new WeakMap},SI=`data-base-ui-inert`,CI={inert:new WeakSet,"aria-hidden":new WeakSet},wI=new WeakMap,TI=0,EI=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=vI(t);return e.contains(n)?n:null}).filter(e=>e!=null),DI=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},OI=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{oj(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r}}));function AI(e,t=`mui`){let[n,r]=MI.useState(e),i=e||n;return MI.useEffect(()=>{n??(NI+=1,r(`${t}-${NI}`))},[n,t]),i}function jI(e,t){if(PI!==void 0){let n=PI();return e??(t?`${t}-${n}`:n)}return AI(e,t)}var MI,NI,PI,FI=s((()=>{MI=d(m(),1),lF(),NI=0,PI=cF.useId}));function II(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var LI,RI=s((()=>{LI=II(`https://base-ui.com/production-error`,`Base UI`)}));function zI(e){return BI>=e}var BI,VI=s((()=>{m(),BI=19}));function HI(e){if(!UI.isValidElement(e))return null;let t=e,n=t.props;return(zI(19)?n?.ref:t.ref)??null}var UI,WI=s((()=>{UI=d(m(),1),VI()}));function GI(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var KI=s((()=>{}));function qI(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}var JI=s((()=>{}));function YI(e,t){return typeof e==`function`?e(t):e}var XI=s((()=>{}));function ZI(e,t){return typeof e==`function`?e(t):e}var QI=s((()=>{}));function $I(e,t,n,r,i){if(!n&&!r&&!i&&!e)return tL(t);let a=tL(e);return t&&(a=nL(a,t)),n&&(a=nL(a,n)),r&&(a=nL(a,r)),i&&(a=nL(a,i)),a}function eL(e){if(e.length===0)return pL;if(e.length===1)return tL(e[0]);let t=tL(e[0]);for(let n=1;n<e.length;n+=1)t=nL(t,e[n]);return t}function tL(e){return oL(e)?{...sL(e,pL)}:rL(e)}function nL(e,t){return oL(t)?sL(t,e):iL(e,t)}function rL(e){let t={...e};for(let e in t){let n=t[e];aL(e,n)&&(t[e]=lL(n))}return t}function iL(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=GI(e.style,r);break;case`className`:e[n]=dL(e.className,r);break;default:e[n]=aL(n,r)?cL(e[n],r):r}}return e}function aL(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function oL(e){return typeof e==`function`}function sL(e,t){return oL(e)?e(t):e??pL}function cL(e,t){return t?e?(...n)=>{let r=n[0];if(fL(r)){let i=r;uL(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:lL(t):e}function lL(e){return e&&((...t)=>{let n=t[0];return fL(n)&&uL(n),e(...t)})}function uL(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function dL(e,t){return t?e?t+` `+e:t:e}function fL(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}var pL,mL=s((()=>{KI(),pL={}})),hL=s((()=>{mL()}));function gL(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=yL(r));let i=_L(t,n,r);if(n.enabled===!1)return null;let a=n.state??UM;return bL(e,r,i,a)}function _L(e,t,n){let{className:r,style:i}=e,{state:a=UM,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?YI(r,a):void 0,d=l?ZI(i,a):void 0,f=l?qI(a,c):UM,p=l&&s?vL(s):void 0,m=l?GI(f,p)??{}:UM;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?QP([m.ref,HI(n),...o]):ZP(m.ref,HI(n),o):ZP(null,null)),l?(u!==void 0&&(m.className=dL(m.className,u)),d!==void 0&&(m.style=GI(m.style,d)),m):UM}function vL(e){return Array.isArray(e)?eL(e):$I(void 0,e)}function yL(e){if(e?.$$typeof!==wL)return e;let t=SL.Children.toArray(e)[0];return SL.isValidElement(t)?t:e}function bL(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=$I(n,t.props);return e.ref=n.ref,SL.cloneElement(t,e)}if(e&&typeof e==`string`)return xL(e,n);throw Error(LI(8))}function xL(e,t){return e===`button`?(0,CL.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,CL.createElement)(`img`,{alt:``,...t,key:t.key}):SL.createElement(e,t)}var SL,CL,wL,TL=s((()=>{RI(),SL=d(m(),1),rF(),WI(),KI(),WM(),JI(),XI(),QI(),hL(),CL=d(m(),1),wL=Symbol.for(`react.lazy`)})),EL,DL,OL,kL,AL,jL=s((()=>{EL={style:{transition:`none`}},DL=`data-base-ui-click-trigger`,OL={fallbackAxisSide:`none`},kL={fallbackAxisSide:`end`},AL={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0}}));function ML(e={}){let{ref:t,container:n,componentProps:r=UM,elementProps:i}=e,a=jI(),o=LL()?.portalNode,[s,c]=NL.useState(null),[l,u]=NL.useState(null),d=$(e=>{e!==null&&u(e)}),f=NL.useRef(null);Q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(lj(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=gL(`div`,r,{ref:[t,d],props:[{id:a,[RL]:``},i]}),m=s&&p?PL.createPortal(p,s):null;return{node:l,nodeId:NL.isValidElement(p)?p.props.id:void 0,subtree:m}}var NL,PL,FL,IL,LL,RL,zL,BL=s((()=>{NL=d(m(),1),PL=d(g(),1),Aj(),JP(),XP(),FI(),eN(),mF(),WM(),AF(),cI(),KP(),WP(),pI(),TL(),jL(),FL=d(O(),1),IL=NL.createContext(null),LL=()=>NL.useContext(IL),RL=fI(`portal`),zL=NL.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=ML({container:o,ref:t,componentProps:e,elementProps:c}),f=NL.useRef(null),p=NL.useRef(null),m=NL.useRef(null),h=NL.useRef(null),[g,_]=NL.useState(null),v=NL.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;NL.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&iI(e)&&(e.type===`focusin`?v.current&&=(oI(l),!1):(aI(l),v.current=!0))}return YP(qP(l,`focusin`,e,!0),qP(l,`focusout`,e,!0))},[l,y]),Q(()=>{l&&b===!0&&v.current&&(oI(l),v.current=!1)},[b,l]);let S=NL.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,FL.jsxs)(NL.Fragment,{children:[d,(0,FL.jsxs)(IL.Provider,{value:S,children:[x&&l&&(0,FL.jsx)(kF,{"data-type":`outside`,ref:f,onFocus:e=>{iI(e,l)?m.current?.focus():eI(g?g.domReference:null)?.focus()}}),x&&l&&(0,FL.jsx)(`span`,{role:s,"aria-owns":u,style:AL}),l&&PL.createPortal(a,l),x&&l&&(0,FL.jsx)(kF,{"data-type":`outside`,ref:p,onFocus:e=>{iI(e,l)?h.current?.focus():($F(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,GP(`focus-out`,e.nativeEvent)))}})]})]})})}));function VL(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var HL=s((()=>{})),UL,WL=s((()=>{HL(),UL=class{nodesRef={current:[]};events=VL();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}}}));function GL(e){let t=jI(),n=$L(e),r=QL();return Q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function KL(e){let{children:t,id:n}=e,r=QL();return(0,YL.jsx)(XL.Provider,{value:JL.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function qL(e){let{children:t,externalTree:n}=e,r=jM(()=>n??new UL).current;return(0,YL.jsx)(ZL.Provider,{value:r,children:t})}var JL,YL,XL,ZL,QL,$L,eR=s((()=>{JL=d(m(),1),FI(),eN(),PM(),WL(),YL=d(O(),1),XL=JL.createContext(null),ZL=JL.createContext(null),QL=()=>JL.useContext(XL)?.id||null,$L=e=>{let t=JL.useContext(ZL);return e??t}}));function tR(e){return e==null?e:`current`in e?e.current:e}var nR=s((()=>{}));function Wte(e,t){let n=sj(jN(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}function rR(){dR=dR.filter(e=>e.deref()?.isConnected)}function iR(e){rR(),e&&oj(e)!==`body`&&(dR.push(new WeakRef(e)),dR.length>uR&&(dR=dR.slice(-20)))}function aR(){return rR(),dR[dR.length-1]?.deref()}function Gte(e){return e?YF(e)?e:ZF(e)[0]||e:null}function oR(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=XF(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return YF(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function sR(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=$(()=>b.current.floatingContext?.nodeId),S=i===!1,C=hP(_)&&S,w=iF(i),T=iF(a),E=iF(l),D=iF(g),O=$L(p),k=LL(),A=cR.useRef(!1),j=cR.useRef(!1),M=cR.useRef(!1),N=cR.useRef(null),P=cR.useRef(``),F=cR.useRef(``),I=cR.useRef(null),L=cR.useRef(null),R=ZP(I,f,k?.beforeInsideRef),z=ZP(L,k?.afterInsideRef),B=JM(),V=JM(),H=hF(),U=k!=null,W=_P(v),G=$((e=W)=>e?ZF(e):[]),ee=$(()=>m?.().filter(e=>e!=null)??[]);cR.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&AN(W,kN(xF(W)))&&G().length===0&&!C&&CN(e)}return qP(xF(W),`keydown`,e)},[r,W,s,C,G]),cR.useEffect(()=>{if(r||!g)return;let e=xF(W);function t(){M.current=!1}function n(e){let t=jN(e),n=ee(),r=AN(v,t)||AN(_,t)||AN(k?.portalNode,t)||n.some(e=>e===t||AN(e,t));M.current=!r,F.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0,V.start(0,()=>{j.current=!1}))}function i(){F.current=`keyboard`}return YP(qP(e,`pointerdown`,n,!0),qP(e,`pointerup`,t,!0),qP(e,`pointercancel`,t,!0),qP(e,`keydown`,i,!0),t)},[r,v,_,W,g,k,V,ee]),cR.useEffect(()=>{if(r||!c)return;let e=xF(W);function t(){j.current=!0,V.start(0,()=>{j.current=!1})}function n(e){let t=jN(e);YF(t)&&(N.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=jN(t);s&&n==null&&i!=null&&AN(v,i)&&iR(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=ee(),f=n?.hasAttribute(fI(`focus-guard`))&&[I.current,L.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,tR(d),tR(u)].includes(n),p=!(AN(_,n)||AN(v,n)||AN(n,v)||AN(k?.portalNode,n)||l.some(e=>e===n||AN(e,n))||c.hasMatchingElement(e=>AN(e,n))||f||O&&(lI(O.nodesRef.current,a).find(e=>AN(e.context?.elements.floating,n)||AN(e.context?.elements.domReference,n))||uI(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,_P(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&W&&oR(W),o&&r!==_&&!zF(i)&&kN(e)===e.body){if(dj(W)&&(W.focus(),o===`popup`)){H.request(()=>{W.focus()});return}let e=G(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;dj(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!s)&&n&&p&&!j.current&&(C||n!==aR())&&(A.current=!0,h.setOpen(!1,GP(FP,t)))})}function a(){M.current||(b.current.insideReactTree=!0,B.start(0,()=>{b.current.insideReactTree=!1}))}let l=dj(_)?_:null;if(v||l)return YP(l&&qP(l,`focusout`,i),l&&qP(l,`pointerdown`,t),v&&qP(v,`focusin`,n),v&&qP(v,`focusout`,i),v&&k&&qP(v,`focusout`,a,!0))},[r,_,v,W,s,O,k,h,c,o,G,C,x,b,B,V,H,u,d,ee]),cR.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${fI(`portal`)}]`)||[]),t=(O?uI(O.nodesRef.current,x()):[]).find(e=>hP(e.context?.elements.domReference||null))?.context?.elements.domReference,n=bI([v,...e,I.current,L.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...ee(),t,tR(d),tR(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=bI([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,k,C,O,x,u,d,ee]),Q(()=>{if(!g||r||!dj(W))return;P.current=``,F.current=``;let e=xF(W),t=kN(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(E.current||``):n;if(r===void 0||r===!1||AN(W,t))return;let i=null,a=()=>(i??=G(W),i[0]||W),o;o=r===!0||r===null?a():tR(r),o||=a();let s=AN(W,kN(e));mI(o,{preventScroll:o===W,shouldFocus(){if(!D.current)return!1;if(s)return!0;let t=kN(e);return!(t!==o&&AN(W,t))}})})},[r,g,W,G,w,E,D]),Q(()=>{if(r||!W)return;let e=xF(W),t=kN(e),n=E.current==null;iR(t);function i(e){if(e.open||(P.current=Wte(e.nativeEvent,F.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`){if(e.nested)A.current=!1;else if(wN(e.nativeEvent)||TN(e.nativeEvent))A.current=!1;else{let e=!1;xF(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&oj(t)!==`body`?t:null,s=n?o||a:a||o;return s||=aR()||null,typeof i==`boolean`?s:tR(i)||s||null}return()=>{y.off(`openchange`,i);let t=kN(e),n=ee(),r=AN(v,t)||n.some(e=>e===t||AN(e,t))||O&&lI(O.nodesRef.current,x(),!1).some(e=>AN(e.context?.elements.floating,t)),o=T.current,s=P.current,c=a(s);queueMicrotask(()=>{let n=Gte(c),i=typeof o!=`boolean`;if(o&&!A.current&&dj(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}A.current=!1})}},[r,v,W,T,E,y,O,_,x,ee]),Q(()=>{if(!mN||g||!v)return;let e=kN(xF(v));dj(e)&&pP(e)&&AN(v,e)&&e.blur()},[g,v]),Q(()=>{if(!r&&k)return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{k.setFocusManagerState(null)}},[r,k,s,g,h,c,_]),Q(()=>{if(!r&&W)return oR(W),()=>{queueMicrotask(rR)}},[r,W]);let te=!r&&(!s||!C)&&(U||s);return(0,lR.jsxs)(cR.Fragment,{children:[te&&(0,lR.jsx)(kF,{"data-type":`inside`,ref:R,onFocus:e=>{if(s){let e=G();mI(e[e.length-1])}else k?.portalNode&&(A.current=!1,iI(e,k.portalNode)?$F(_)?.focus():tR(d??k.beforeOutsideRef)?.focus())}}),n,te&&(0,lR.jsx)(kF,{"data-type":`inside`,ref:z,onFocus:e=>{s?mI(G()[0]):k?.portalNode&&(c&&(A.current=!0),iI(e,k.portalNode)?eI(_)?.focus():tR(u??k.afterOutsideRef)?.focus())}})]})}var cR,lR,uR,dR,Kte=s((()=>{cR=d(m(),1),Aj(),JP(),XP(),rF(),oF(),mF(),eN(),ZM(),SN(),bF(),SF(),AF(),vP(),ON(),cI(),dI(),BF(),KP(),WP(),pI(),gI(),kI(),BL(),eR(),jL(),nR(),lR=d(O(),1),uR=20,dR=[]}));function fR(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=EP}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=pR.useRef(void 0),f=hF(),p=JM(),m=pR.useMemo(()=>{function e(e,t,n,r){let i=GP(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=EN(e.pointerType,!0)&&TN(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||EN(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=jN(o);if(pP(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;r===`mousedown`&&i?d.current=void 0:EN(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return pR.useMemo(()=>n?{reference:m}:UM,[n,m])}var pR,qte=s((()=>{pR=d(m(),1),bF(),ZM(),WM(),vP(),ON(),KP(),WP()}));function Jte(){return!1}function Yte(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function mR(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Jte,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f,events:p}=l.context,m=$L(c),h=$(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=$(()=>a),{escapeKey:y,outsidePress:b}=Yte(s),x=hR.useRef(!1),S=hR.useRef(!1),C=hR.useRef(!1),w=hR.useRef(!1),T=hR.useRef(!1),E=hR.useRef(``),D=hR.useRef(null),O=JM(),k=JM(),A=$(()=>{k.clear(),f.current.insideReactTree=!1}),j=$(e=>{let t=f.current.floatingContext?.nodeId;return(m?lI(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=$(e=>fP(e,l.select(`floatingElement`))||fP(e,l.select(`domReferenceElement`))),N=$(e=>{o()&&l.setOpen(!1,GP(EP,e.nativeEvent))}),P=$(e=>{if(!u||!n||!r||e.key!==`Escape`||T.current||!y&&j(`__escapeKeyBubbles`))return;let t=Fte(e)?e.nativeEvent:e,i=GP(IP,t);l.setOpen(!1,i),i.isCanceled||e.preventDefault(),!y&&!i.isPropagationAllowed&&e.stopPropagation()}),F=$(()=>{f.current.insideReactTree=!0,k.start(0,A)}),I=$(e=>{if(!u||!n||e.button!==0)return;let t=jN(e.nativeEvent);AN(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),L=$(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});hR.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),hR.useEffect(()=>{if(!u||!n)return u||(w.current=!1),A;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new XM,t=new XM,i=xF(d);function a(){e.clear(),T.current=!0}function o(){e.start(mN?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function p(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function k(e){let t=f.current.floatingContext?.nodeId,n=m&&lI(m.nodesRef.current,t).some(t=>fP(e,t.context?.elements.floating));return M(e)||n}function N(e){if(h(e)){e.type!==`click`&&!M(e)&&(t.clear(),C.current=!1),A();return}if(f.current.insideReactTree){A();return}let n=jN(e),r=`[${fI(`inert`)}]`,i=uj(n)?n.getRootNode():null,a=Array.from((fj(i)?i:xF(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>AN(e,n))))return;let s=uj(n)?n:null;for(;s&&!yj(s);){let e=Sj(s);if(yj(e)||!uj(e))break;s=e}if(!(a.length&&uj(n)&&!Lte(n)&&!AN(n,l.select(`floatingElement`))&&a.every(e=>!AN(s,e)))){if(dj(n)&&!(`touches`in e)){let t=yj(n),r=bj(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!k(e)){if(p()===`intentional`){if(e.detail!==0&&!wN(e)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof g==`function`&&!g(e)||j(`__outsidePressBubbles`)||(l.setOpen(!1,GP(kP,e)),A())}}}function F(e){p()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!M(e)&&N(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||M(e))return;let t=e.touches[0];t&&(D.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=jN(e);if(!n)return;let r=qP(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),p()===`intentional`&&(e.type===`pointercancel`?n&&s():k(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,A())))}function V(e){if(p()!==`sloppy`||!D.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(N(e),O.clear(),D.current=null)}function H(e){L(e,V)}function U(e){p()===`sloppy`&&D.current&&!M(e)&&(D.current.dismissOnTouchEnd&&N(e),O.clear(),D.current=null)}function W(e){L(e,U)}let G=YP(r&&YP(qP(i,`keydown`,P),qP(i,`compositionstart`,a),qP(i,`compositionend`,o)),_&&YP(qP(i,`click`,z,!0),qP(i,`pointerdown`,z,!0),qP(i,`pointerup`,B,!0),qP(i,`pointercancel`,B,!0),qP(i,`mousedown`,z,!0),qP(i,`mouseup`,B,!0),qP(i,`touchstart`,R,{capture:!0,passive:!0}),qP(i,`touchmove`,H,{capture:!0,passive:!0}),qP(i,`touchend`,W,{capture:!0,passive:!0})));return()=>{G(),e.clear(),t.clear(),c(),C.current=!1,A()}},[f,d,r,_,g,u,n,y,b,P,A,v,j,M,m,l,O]);let R=hR.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),z=hR.useMemo(()=>({onKeyDown:P,onPointerDown:L,onMouseDown:L,onClickCapture:F,onMouseDownCapture(e){F(),I(e)},onPointerDownCapture(e){F(),I(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,I,L]);return hR.useMemo(()=>n?{reference:R,floating:z,trigger:R}:{},[n,R,z])}var hR,Xte=s((()=>{hR=d(m(),1),JP(),XP(),SF(),mF(),ZM(),Aj(),SN(),eR(),KP(),WP(),pI(),vP(),ON(),dI()}));function gR(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!gR(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!gR(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function _R(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vR(e,t){let n=_R(e);return Math.round(t*n)/n}function yR(e){let t=bR.useRef(e);return CR(()=>{t.current=e}),t}function Zte(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=bR.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=bR.useState(r);gR(f,r)||p(r);let[m,h]=bR.useState(null),[g,_]=bR.useState(null),v=bR.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=bR.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=bR.useRef(null),C=bR.useRef(null),w=bR.useRef(u),T=c!=null,E=yR(c),D=yR(i),O=yR(l),k=bR.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),dM(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!gR(w.current,t)&&(w.current=t,SR.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);CR(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=bR.useRef(!1);CR(()=>(A.current=!0,()=>{A.current=!1}),[]),CR(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=bR.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=bR.useMemo(()=>({reference:b,floating:x}),[b,x]),N=bR.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=vR(M.floating,u.x),r=vR(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,..._R(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return bR.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var bR,xR,SR,CR,wR,TR,ER,DR,OR,kR=s((()=>{fM(),bR=d(m(),1),xR=d(m(),1),SR=d(g(),1),CR=typeof document<`u`?xR.useLayoutEffect:function(){},wR=(e,t)=>{let n=oM(e);return{name:n.name,fn:n.fn,options:[e,t]}},TR=(e,t)=>{let n=sM(e);return{name:n.name,fn:n.fn,options:[e,t]}},ER=(e,t)=>({fn:uM(e).fn,options:[e,t]}),DR=(e,t)=>{let n=cM(e);return{name:n.name,fn:n.fn,options:[e,t]}},OR=(e,t)=>{let n=lM(e);return{name:n.name,fn:n.fn,options:[e,t]}}})),AR=s((()=>{})),jR=s((()=>{})),MR=s((()=>{})),NR=s((()=>{}));function PR(e,t,n,r,i){return VR(e,t,n,r,i)}function FR(e,t,n,r,i){let a=RR.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,zR.useSyncExternalStore)(e.subscribe,a,a)}function IR(e,t,n,r,i){let a=Mte();if(!a)return FR(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function LR(e,t,n,r,i){return(0,BR.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var RR,zR,BR,VR,HR=s((()=>{RR=d(m(),1),zR=hd(),BR=jS(),VI(),BM(),VR=zI(19)?IR:LR,Nte({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,zR.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}})})),UR,WR=s((()=>{HR(),UR=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return PR(this,e,t,n,r)}}})),GR,KR,qR=s((()=>{GR=d(m(),1),WR(),HR(),mF(),eN(),WM(),KR=class extends UR{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){GR.useDebugValue(e);let n=this;Q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);Q(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){GR.useDebugValue(e);let n=this,r=t!==void 0;Q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return GR.useDebugValue(e),PR(this,this.selectors[e],t,n,r)}useContextCallback(e,t){GR.useDebugValue(e);let n=$(t??VM);this.context[e]=n}useStateSetter(e){let t=GR.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}}})),JR=s((()=>{m(),g(),hd(),O()})),YR=s((()=>{MR(),NR(),HR(),WR(),qR(),JR()})),XR=s((()=>{vP(),dI(),ON(),BF(),cI()})),ZR,QR,$R=s((()=>{YR(),HL(),XR(),ZR={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},QR=class extends KR{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:VL(),nested:n,triggerElements:i},ZR),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&DN(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}}}));function ez(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=tz.useRef(null);r===void 0&&f.current===null&&(f.current=new QR({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),Q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};uj(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}var tz,nz=s((()=>{tz=d(m(),1),eN(),Aj(),$R()}));function rz(e,t=!1,n=!1,r=!1){let[i,a]=iz.useState(e&&t?`idle`:void 0),[o,s]=iz.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Q(()=>{if(!e&&o&&i!==`ending`&&n){let e=yF.request(()=>{a(`ending`)});return()=>{yF.cancel(e)}}},[e,o,i,n]),Q(()=>{if(!e||t)return;let n=yF.request(()=>{a(void 0)});return()=>{yF.cancel(n)}},[t,e]),Q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=yF.request(()=>{a(`idle`)});return()=>{yF.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var iz,az=s((()=>{iz=d(m(),1),eN(),bF()}));function oz(e){if(!lz){let e=[];lz=e,queueMicrotask(()=>{lz=null,cz.flushSync(()=>{for(let t of e)t()})})}lz.push(e)}function sz(e,t=!1,n=!1){let r=hF();return $((i,a=null)=>{r.cancel();let o=tR(e);if(o==null)return;let s=o,c=()=>{n?oz(()=>{a?.aborted||i()}):cz.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{a?.aborted||(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=BN;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}var cz,lz,uz=s((()=>{cz=d(g(),1),bF(),mF(),nR(),HN(),lz=null}));function dz(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=$(a),s=sz(r,n,i);fz.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var fz,pz=s((()=>{fz=d(m(),1),mF(),uz()}));function mz(e){return t=>t!==`touch`||e.current}function hz(e,t=!1){let n=jI(),r=QL()!=null,i=jM(()=>e(n,r)).current;return ez({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function gz({handle:e,store:t}){return Q(()=>e.attachStore(t),[e,t]),null}function _z(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function vz(e,t){let n=Ez.useRef(null);return $(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),_z(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),_z(t))})}function yz(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function bz(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function xz(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=vz(e,n),o=$(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=$(e=>{a(e),e&&o(e)});return Q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Sz(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=Ez.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);Q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=GP(TP);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Cz(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=rz(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=$(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return dz({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function wz(e,t){e.useSyncedValues(t),Q(()=>()=>{e.update({activeTriggerProps:UM,inactiveTriggerProps:UM,popupProps:UM})},[e])}function Tz(e,t){Q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Ez,Dz,Oz=s((()=>{Ez=d(m(),1),g(),WM(),FI(),mF(),eN(),PM(),zN(),eR(),nz(),az(),pz(),KP(),WP(),Dz={tabIndex:-1,[NN]:``}})),kz,Az=s((()=>{kz=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}}));function jz(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new QR({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:UM,inactiveTriggerProps:UM,popupProps:UM}}function Mz(e,t){return t!==void 0&&Fz(e)&&Pz(e)===t}function Nz(e,t){return Mz(e,t)?!0:t!==void 0&&Fz(e)&&Pz(e)==null&&e.triggerCount===1}var Pz,Fz,Iz,Lz,Rz=s((()=>{WM(),$R(),Pz=e=>e.triggerIdProp??e.activeTriggerId,Fz=e=>e.openProp??e.open,Iz=e=>(e.popupElement?.id??e.floatingId)||void 0,Lz={open:Fz,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Pz,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Iz,isTriggerActive:(e,t)=>t!==void 0&&Pz(e)===t,isOpenedByTrigger:(e,t)=>Mz(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Pz(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Nz(e,t)?Iz(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement}}));function zz(e){let t=Bz.useCallback(t=>e===void 0?VM:e.subscribeStore(t),[e]),n=Bz.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Vz.useSyncExternalStore)(t,n,()=>e?.serverStore)}var Bz,Vz,Hz=s((()=>{Bz=d(m(),1),Vz=hd(),WM()})),Uz=s((()=>{AR(),jR(),Oz(),Az(),Rz(),Hz()}));function Wz(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=jI(),a=QL()!=null,o=jM(()=>new QR({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new kz,floatingId:i,syncOnly:!1,nested:a})).current;return Q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=uj(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var Gz=s((()=>{Aj(),FI(),eN(),PM(),Uz(),eR(),$R()}));function Kz(e){return qz(e,e.rootContext)}function qz(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=Jz.useState(null),[d,f]=Jz.useState(void 0),[p,m]=Jz.useState(void 0),h=Jz.useRef(null),g=$L(r),_=Jz.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=Zte({...e,elements:{..._,...l&&{reference:l}}}),y=uj(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=Jz.useCallback(e=>{let t=uj(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=Jz.useCallback(e=>{(uj(e)||e===null)&&(h.current=e,f(e)),(uj(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!uj(e))&&v.refs.setReference(e)},[v.refs,f]),C=Jz.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=Jz.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=Jz.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=Jz.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return Q(()=>{o&&(h.current=o)},[o]),Q(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),Jz.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}var Jz,Yz=s((()=>{Jz=d(m(),1),eN(),kR(),Aj(),eR()}));function Xz(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=Zz.useRef(!1),c=Zz.useRef(null),l=Zz.useRef(!0),u=JM();Zz.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=sj(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&dj(e)&&e===kN(xF(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return YP(qP(t,`blur`,r),Qz&&qP(t,`keydown`,a,!0),Qz&&qP(t,`pointerdown`,o,!0))},[i,n]),Zz.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);uj(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=Zz.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=jN(t.nativeEvent);if(uj(a)){if(Qz&&!t.relatedTarget){if(!l.current&&!pP(a))return}else if(!gP(a))return}let o=dP(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;i.select(`open`)&&o||p===0||p===void 0?i.setOpen(!0,GP(OP,d,f)):u.start(p,()=>{s.current||i.setOpen(!0,GP(OP,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=uj(n)&&n.hasAttribute(fI(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=kN(xF(e));!n&&t===e||AN(o.current.floatingContext?.refs.floating.current,t)||AN(e,t)||a||dP(n??t,i.context.triggerElements)||i.setOpen(!1,GP(OP,r))})}}},[o,r,i,u]);return Zz.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var Zz,Qz,$z=s((()=>{Zz=d(m(),1),JP(),SN(),XP(),SF(),ZM(),Aj(),pI(),vP(),KP(),WP(),Qz=dN&&mN}));function eB(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&iB.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),iB.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function tB(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=iB.get(n);a&&a!==e&&eB(a),eB(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,iB.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function nB(e){let t=e.context.dataRef.current,n=jM(()=>t.hoverInteractionState??rB.create()).current;return t.hoverInteractionState||=n,GM(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}var rB,iB,aB=s((()=>{qM(),PM(),ZM(),XR(),rB=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new XM,this.restTimeout=new XM,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},iB=new WeakMap}));function oB(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=$L(),d=QL(),f=nB(a),p=JM(),m=$(()=>SP(l.current.openEvent?.type,f.interactedInside)),h=$(()=>CP(l.current.openEvent?.type)),g=$(()=>{eB(f)});Q(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),sB.useEffect(()=>g,[g]),Q(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&uj(c)&&s){let e=c,t=s,n=xF(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return tB(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),sB.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&lI(u.nodesRef.current,d).length>0)}function t(e){let t=bP(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,GP(DP,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=jN(e);mP(t)?f.interactedInside=t?.closest(`[aria-haspopup]`)!=null:f.interactedInside=!1}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(dP(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;u&&r&&uj(o)&&lI(u.nodesRef.current,r,!1).some(e=>AN(e.context?.elements.floating,o))||(f.handler?f.handler(n):(g(),h()&&!m()&&t(n)))}function v(t){u&&d&&!e()&&p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,GP(DP,t)),u.events.emit(`floating.closed`,t)})}let y=s;return YP(y&&qP(y,`mouseenter`,c),y&&qP(y,`mouseleave`,_),y&&qP(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var sB,cB=s((()=>{sB=d(m(),1),JP(),XP(),eN(),SF(),mF(),ZM(),Aj(),KP(),WP(),eR(),vP(),dI(),aB(),wP()}));function lB(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=fB,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=$L(l),y=nB(h),b=uB.useRef(!1),x=iF(i),S=iF(r),C=iF(o),w=iF(n),T=iF(p),E=iF(f),D=$(()=>SP(g.current.openEvent?.type,y.interactedInside)),O=$(()=>T.current?.()!==!1),k=$((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!AN(e,t);if(!uj(n))return!1;let i=n;return r.hasMatchingElement(e=>AN(e,i))&&(!e||!AN(e,i))}),A=$(()=>{y.handler&&=(xF(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=$(()=>{eB(y)});return u&&(y.handleCloseOptions=i?.__options),uB.useEffect(()=>A,[A]),uB.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===DP,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,A]),uB.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=bP(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,GP(DP,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,GP(DP,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!uj(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!EN(y.pointerType))return;let t=xP(C.current),n=bP(S.current,`open`,y.pointerType),r=jN(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(uj(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(AN(e,r)){s=e;break}}uj(i)&&uj(o)&&!h.context.triggerElements.hasElement(i)&&AN(i,o)&&(s=o);let c=s!=null&&k(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&uj(s)&&uj(o)&&AN(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;m?O()&&h.setOpen(!0,GP(DP,e,s)):p||(n?y.openChangeTimeout.start(n,()=>{g&&O()&&h.setOpen(!0,GP(DP,e,s))}):g&&O()&&h.setOpen(!0,GP(DP,e,s)))}function i(t){if(D()){j();return}A();let n=xF(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!dP(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){j(),A(),w.current&&!D()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t)}else y.pointerType===`touch`&&AN(h.select(`floatingElement`),t.relatedTarget)||e(t)}}function o(e){AN(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?qP(t,`mouseout`,o):void 0;return s?YP(qP(t,`mousemove`,r,{once:!0}),qP(t,`mouseenter`,r),qP(t,`mouseleave`,i),l):YP(qP(t,`mouseenter`,r),qP(t,`mouseleave`,i),l)},[A,j,g,S,h,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),uB.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=k(r,n,e.target);if(a&&!EN(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;tB(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=xP(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,D())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&O()&&h.setOpen(!0,GP(DP,t,n))}y.pointerType===`touch`?dB.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,D,k,a,h,C,O])}var uB,dB,fB,pB=s((()=>{uB=d(m(),1),dB=d(g(),1),JP(),XP(),SF(),mF(),oF(),Aj(),KP(),WP(),eR(),vP(),ON(),aB(),wP(),fB={current:null}}));function mB(e){return mN&&e.movementX===0&&e.movementY===0}function hB(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function gB(e,t){return hB(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function _B(e,t,n){return hB(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function vB(e,t,n){return hB(t,n?e===FN:e===IN,e===RN)}function yB(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===SB:hB(t,n?e===IN:e===FN,e===LN)}function bB(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),D=C.context.dataRef,O=_P(T),k=hP(E),A=iF(O),j=QL(),M=$L(b),N=xB.useRef(f),P=xB.useRef(o??-1),F=xB.useRef(null),I=xB.useRef(!0),L=$(e=>{i(P.current===-1?null:P.current,e)}),R=xB.useRef(!!T),z=xB.useRef(w),B=xB.useRef(!1),V=xB.useRef(!1),H=xB.useRef(null),U=iF(h),W=iF(w),G=iF(o),ee=iF(y),te=hF(),ne=hF(),K=$(()=>{function e(e){d?M?.events.emit(`virtualfocus`,e):H.current=mI(e,{sync:B.current,preventScroll:!0})}let t=n.current[P.current],r=V.current;t&&e(t),(B.current?e=>e():e=>te.request(e))(()=>{let i=n.current[P.current]||t;i&&(t||e(i),se&&(r||!I.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Q(()=>{D.current.orientation=g},[D,g]),Q(()=>{a&&(w&&T?(P.current=o??-1,N.current&&o!=null&&(V.current=!0,L())):R.current&&(P.current=-1,L()))},[a,w,T,o,L]),Q(()=>{if(a){if(!w)B.current=!1;else if(T){if(r==null){if(B.current=!1,G.current!=null)return;if(R.current&&(P.current=-1,K()),(!z.current||!R.current)&&N.current&&(F.current!=null||N.current===!0&&F.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ne.request(e):queueMicrotask)(t),e+=1):(P.current=F.current==null||_B(F.current,g,u)||l?NF(n):PF(n),F.current=null,L())};t()}}else MF(n.current,r)||(P.current=r,K(),V.current=!1)}}},[a,w,T,r,G,l,n,g,u,L,K,ne]),Q(()=>{if(!a||T||!M||d||!R.current)return;let e=M.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=kN(xF(E??t??null)),r=e.some(e=>e.context&&AN(e.context.elements.floating,n));t&&!r&&I.current&&t.focus({preventScroll:!0})},[a,T,E,M,j,d]),Q(()=>{z.current=w,R.current=!!T}),Q(()=>{w||(F.current=null,N.current=f)},[w,f]);let re=r!=null,q=$(e=>{if(!W.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(P.current!==t||r!==t)&&(P.current=t,L(e))}),ie=$(()=>_??M?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation),ae=$(()=>NF(n,U.current)),oe=$(e=>{if(I.current=!1,B.current=!0,e.which===229||!W.current&&e.currentTarget===A.current)return;if(l&&yB(e.key,g,u,S)){gB(e.key,ie())||CN(e),C.setOpen(!1,GP(LP,e.nativeEvent)),dj(E)&&(d?M?.events.emit(`virtualfocus`,E):E.focus());return}let t=P.current,r=NF(n,h),i=PF(n,h);if(k||(e.key===`Home`&&(CN(e),P.current=r,L(e)),e.key===`End`&&(CN(e),P.current=i,L(e))),x!=null){let t=x(e,P.current,n,g,c,u,h,r,i);if(t!=null&&(P.current=t,L(e)),g===`both`)return}if(gB(e.key,g)){if(CN(e),w&&!d&&kN(e.currentTarget.ownerDocument)===e.currentTarget){P.current=_B(e.key,g,u)?r:i,L(e);return}_B(e.key,g,u)?c?t>=i?s&&t!==n.current.length?P.current=-1:(B.current=!1,P.current=r):P.current=FF(n.current,{startingIndex:t,disabledIndices:h}):P.current=Math.min(i,FF(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?P.current=n.current.length:(B.current=!1,P.current=i):P.current=FF(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):P.current=Math.max(r,FF(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),MF(n.current,P.current)&&(P.current=-1),L(e)}}),se=xB.useMemo(()=>({onFocus(e){B.current=!0,q(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){mB(e)||(B.current=!0,V.current=!1,p&&q(e))},onPointerLeave(e){if(!W.current||!I.current||e.pointerType===`touch`)return;B.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ee.current&&(H.current?.(),H.current=null,P.current=-1,L(e),!d)){let e=A.current,t=kN(xF(e));e&&AN(e,t)&&e.focus({preventScroll:!0})}}}),[q,W,A,p,n,L,ee,d]),ce=xB.useMemo(()=>d&&w&&re&&{"aria-activedescendant":`${v}-${r}`},[d,w,re,v,r]),le=xB.useMemo(()=>({...k?{}:ce,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=jN(e.nativeEvent);if(t&&!AN(A.current,t))return;CN(e),C.setOpen(!1,GP(FP,e.nativeEvent)),dj(E)&&E.focus()}else oe(e)},onPointerMove(e){mB(e)||(I.current=!0)}}),[ce,oe,A,k,C,w,d,E]),ue=xB.useMemo(()=>{function e(e){C.setOpen(!0,GP(LP,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&wN(e.nativeEvent)&&(N.current=!d)}function n(e){N.current=f,f===`auto`&&TN(e.nativeEvent)&&(N.current=!0)}return{onKeyDown(t){let n=C.select(`open`);I.current=!1;let r=t.key.startsWith(`Arrow`),i=vB(t.key,ie(),u),a=gB(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return oe(t);if(n||m||!r){if(o){let e=gB(t.key,ie());F.current=l&&e?null:t.key}l?i&&(CN(t),n?(P.current=ae(),L(t)):e(t)):a&&(G.current!=null&&(P.current=G.current),CN(t),!n&&m?e(t):oe(t),n&&L(t))}},onFocus(e){C.select(`open`)&&!d&&(P.current=-1,L(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[oe,f,ae,l,L,C,m,g,ie,u,G,d]),de=xB.useMemo(()=>({...ce,...ue}),[ce,ue]);return xB.useMemo(()=>a?{reference:de,floating:le,item:se,trigger:ue}:{},[a,de,le,ue,se])}var xB,SB,CB=s((()=>{xB=d(m(),1),bF(),eN(),SF(),mF(),oF(),SN(),Aj(),KP(),WP(),eR(),BF(),zN(),vP(),gI(),ON(),SB=`Escape`}));function wB(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=JM(),m=TB.useRef(``),h=TB.useRef(u??i??-1),g=TB.useRef(null),_=$(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!zF(n)||n?.matches(`:disabled`)?!1:o==null||!LF(HM,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(CN(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(CN(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=$(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);AN(n,t)||AN(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});Q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=TB.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return TB.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var TB,EB=s((()=>{TB=d(m(),1),eN(),mF(),ZM(),WM(),BF(),vP(),ON()}));function DB(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function OB(e,t,n,r,i,a,o,s,c,l){let u=!1;return DB(e,t,n,r,i,a)&&(u=!u),DB(e,t,i,a,o,s)&&(u=!u),DB(e,t,o,s,c,l)&&(u=!u),DB(e,t,c,l,n,r)&&(u=!u),u}function kB(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function AB(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function jB(e={}){let{blockPointerEvents:t=!1}=e,n=new XM,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*NB;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=jN(r),g=r.type===`mouseleave`,_=AN(u,h),v=AN(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&uj(r.relatedTarget)&&AN(u,r.relatedTarget))return;function y(){return!!(s&&lI(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=AB(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=AB(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=AB(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=AB(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!kB(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?PB/2:PB*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+PB+1,o=C||T?S.bottom-PB:S.top,s=C?T?S.bottom-PB:S.top:S.bottom-PB;M=OB(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?PB/2:PB*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-PB,o=C||T?S.top+PB:S.bottom,s=C?T?S.top+PB:S.bottom:S.top+PB;M=OB(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?PB/2:PB*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+PB+1,o=w||E?S.right-PB:S.left,s=w?E?S.right-PB:S.left:S.right-PB;M=OB(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?PB/2:PB*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-PB,o=w||E?S.left+PB:S.right,s=w?E?S.left+PB:S.right:S.left+PB;M=OB(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var MB,NB,PB,FB=s((()=>{Aj(),ZM(),vP(),dI(),MB=.1,NB=MB*MB,PB=.5})),IB=s((()=>{ZM(),eN(),wP(),KP(),WP(),Kte(),BL(),eR(),WL(),qte(),mF(),Aj(),vP(),ON(),Xte(),Yz(),Gz(),nz(),$z(),cB(),pB(),SF(),oF(),CB(),EB(),FB(),kR()}));function LB(e){let t=RB.useContext(zB);if(t===void 0&&!e)throw Error(LI(47));return t}var RB,zB,BB=s((()=>{RI(),RB=d(m(),1),zB=RB.createContext(void 0)}));function VB(e,t,n,r=!1){let i={...jz(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function HB(e){return{popupRef:UB.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:UB.createRef(),beforeContentFocusGuardRef:UB.createRef(),stickIfOpenTimeout:new XM,triggerElements:e}}var UB,WB,GB,KB,qB=s((()=>{UB=d(m(),1),WB=d(g(),1),YR(),ZM(),WP(),Uz(),jL(),GB={...Lz,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},KB=class extends KR{constructor(e,t,n){let r=new kz;super(VB(e,r,t,n),HB(r),GB)}setOpen=(e,t)=>{let n=t.reason===DP,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=bz(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=yz(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),WB.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}}}));function JB(e){return LB(!0)?(0,QB.jsx)($B,{props:e}):(0,QB.jsx)(qL,{children:(0,QB.jsx)($B,{props:e})})}function YB(e,t){let n=hz((e,n)=>new KB(t,e,n));return ZB.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function XB({store:e,modal:t}){let n=mR(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return wz(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var ZB,QB,$B,eV=s((()=>{ZB=d(m(),1),BM(),IB(),BB(),qB(),KP(),WP(),Uz(),QB=d(O(),1),$B=FM(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=YB(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),Tz(u,d),Sz(u);let{forceUnmount:m}=Cz(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),ZB.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),ZB.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,GP(HP))}),[m,u]);let h=d||f;return(0,QB.jsxs)(zB.Provider,{value:u,children:[s&&(0,QB.jsx)(gz,{handle:s,store:u}),h&&(0,QB.jsx)(XB,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})})}));function tV(e=!1){let t=nV.useContext(rV);if(t===void 0&&!e)throw Error(LI(16));return t}var nV,rV,iV=s((()=>{RI(),nV=d(m(),1),rV=nV.createContext(void 0)}));function aV(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:oV.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}var oV,sV=s((()=>{oV=d(m(),1)}));function cV(e,t,{detail:n=0}={}){e.dispatchEvent(new(sj(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}var lV=s((()=>{SF()}));function uV(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=pV.useRef(null),s=tV(!0),c=a??s!==void 0,{props:l}=aV({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=pV.useCallback(()=>{let e=o.current;dV(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Q(u,[u]),{getButtonProps:pV.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return $I({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(uL(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=dV(r),s=!i&&fV(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),cV(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),cV(r,e)))},onKeyUp(e){t||(uL(e),a?.(e),e.target===e.currentTarget&&i&&c&&dV(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),cV(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:$(e=>{o.current=e,u()})}}function dV(e){return dj(e)&&e.tagName===`BUTTON`}function fV(e){return dj(e)&&e.tagName===`A`&&!!e.href}var pV,mV=s((()=>{pV=d(m(),1),Aj(),mF(),eN(),hL(),iV(),sV(),lV()})),hV=s((()=>{}));function gV(e){return jI(e,`base-ui`)}var _V=s((()=>{FI()}));function vV(e,t){let n=yV.useRef(null);function r(t){bV.flushSync(()=>{e.setOpen(!1,GP(FP,t.nativeEvent,t.currentTarget))}),rI(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&iI(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{bV.flushSync(()=>{e.setOpen(!1,GP(FP,n.nativeEvent,n.currentTarget))});let i=nI(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&AN(r,i);){let e=i;if(i=$F(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}var yV,bV,xV=s((()=>{yV=d(m(),1),bV=d(g(),1),XR(),KP(),WP()}));function SV(e){let t=CV.useRef(``),n=CV.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:CV.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}var CV,wV=s((()=>{CV=d(m(),1)}));function TV(e,t){let n=EV.useRef(e),r=$(t);Q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}var EV,DV=s((()=>{EV=d(m(),1),eN(),mF()}));function OV(e,t){let{onClick:n,onPointerDown:r}=SV($((n,r)=>{(typeof e==`function`?e():e)||t(r||(cN?`touch`:``))}));return AV.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function kV(e){let[t,n]=AV.useState(null),r=OV(e,n);return TV(e,t=>{t&&!e&&n(null)}),AV.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var AV,jV=s((()=>{AV=d(m(),1),mF(),wV(),SN(),DV()})),MV,NV,PV,FV=s((()=>{RI(),MV=d(m(),1),BM(),BB(),mV(),lP(),TL(),jL(),IB(),hV(),_V(),AF(),WP(),Uz(),xV(),jV(),NV=d(O(),1),PV=IM(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=LB(!0),h=zz(s)??m;if(!h)throw Error(LI(74));let g=gV(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=MV.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=xz(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`openChangeReason`),T=h.useState(`stickIfOpen`),E=h.useState(`openMethod`),D=h.useState(`focusManagerModal`),O=lB(v,{enabled:!a&&l&&(E!==`touch`||w!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:jB(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),k=fR(v,{stickIfOpen:T}),A=OV(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),j=h.useState(`triggerProps`,C),{getButtonProps:M,buttonRef:N}=uV({disabled:a,native:o}),P={open(e){return e&&w===`trigger-press`?oP.open(e):aP.open(e)}},{preFocusGuardRef:F,handlePreFocusGuardFocus:I,handleFocusTargetFocus:L}=vV(h,x),R=gL(`button`,e,{state:{disabled:a,open:y},ref:[N,t,S,x],props:[k.reference,O,j,A,{[DL]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,M],stateAttributesMapping:P}),z=(0,NV.jsx)(MV.Fragment,{children:R},g);return C&&!D?(0,NV.jsxs)(MV.Fragment,{children:[(0,NV.jsx)(kF,{ref:F,onFocus:I}),z,(0,NV.jsx)(kF,{ref:h.context.triggerFocusTargetRef,onFocus:L})]}):z})}));function IV(){let e=LV.useContext(RV);if(e===void 0)throw Error(LI(45));return e}var LV,RV,zV=s((()=>{RI(),LV=d(m(),1),RV=LV.createContext(void 0)})),BV,VV,HV,UV=s((()=>{BV=d(m(),1),IB(),BB(),zV(),VV=d(O(),1),HV=BV.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return LB().useState(`mounted`)||n?(0,VV.jsx)(RV.Provider,{value:n,children:(0,VV.jsx)(zL,{ref:t,...r})}):null})}));function WV(e){return zI(19)?e:e?`true`:void 0}var GV=s((()=>{VI()}));function KV(){let e=qV.useContext(JV);if(!e)throw Error(LI(46));return e}var qV,JV,YV=s((()=>{RI(),qV=d(m(),1),JV=qV.createContext(void 0)}));function XV(){return ZV.useContext(QV)?.direction??`ltr`}var ZV,QV,$V=s((()=>{ZV=d(m(),1),QV=ZV.createContext(void 0)})),eH,tH,nH=s((()=>{KA(),eH=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=bA(e,t)||{};if(l==null)return{};let f=PA(u),p={x:n,y:r},m=EA(i),h=wA(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];w&&await o.isElement?.(C)||(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=yA(k,j,A),N=!c.arrow&&SA(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),tH=(e,t)=>{let{name:n,fn:r}=eH(e);return{name:n,fn:r,options:[e,t]}}})),rH,iH=s((()=>{rH={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}}})),aH,oH=s((()=>{aH={sideX:`left`,sideY:`top`}})),sH,cH,lH,uH,dH,fH=s((()=>{sH=`--available-width`,cH=`--available-height`,lH=`--anchor-width`,uH=`--anchor-height`,dH=`--transform-origin`}));function pH(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function mH(e,t,n){let{rects:r,placement:i}=e;return{side:pH(t,xA(i),n),align:SA(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function hH(e){return Qte(e,Kz)}function Qte(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=_H.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,O=v?.crossAxis??!1,k=v?.rootBoundary,A=typeof n==`function`?n:void 0,j=$(A),M=A?j:n,N=iF(n),P=iF(g),F=XV()===`rtl`,I=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[i],L=o===`center`?I:`${I}-${o}`,R=l;typeof R==`number`?R={top:R,right:R,bottom:R,left:R}:R&&={top:R.top||0,right:R.right||0,bottom:R.bottom||0,left:R.left||0};let z=+(i===`bottom`),B=+(i===`top`),V=+(i===`right`),H=+(i===`left`),U={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:R},W=_H.useRef(null),G=iF(a),ee=iF(s),te=typeof a==`function`?0:a,ne=typeof s==`function`?0:s,K=[];p&&K.push(p),K.push(wR(e=>{let t=mH(e,i,F),n=typeof G.current==`function`?G.current(t):G.current,r=typeof ee.current==`function`?ee.current(t):ee.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[te,ne,F,i]));let re=E===`none`&&T!==`shift`,q=!re&&(u||O||T===`shift`),ie=T===`none`?null:DR({...U,padding:{top:R.top+1+z,right:R.right+1+H,bottom:R.bottom+1+B,left:R.left+1+V},mainAxis:!O&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),ae=re?null:TR({...U,rootBoundary:k,mainAxis:E!==`none`,crossAxis:q,limiter:u||O?void 0:ER(e=>{if(!W.current)return{};let{width:t,height:n}=W.current.getBoundingClientRect(),r=TA(xA(e.placement)),i=r===`y`?t:n,a=r===`y`?R.left+R.right:R.top+R.bottom;return{offset:i/2+a/2}})},[U,u,O,k,R,E]);T===`shift`||E===`shift`||o===`center`?K.push(ae,ie):K.push(ie,ae),K.push(OR({...U,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!P.current)return;let i=e.style;i.setProperty(vH,`${t}px`),i.setProperty(yH,`${n}px`);let a=sj(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(lH,`${u}px`),i.setProperty(uH,`${d}px`)}}),tH(e=>({element:W.current||xF(e.elements.floating).createElement(`div`),padding:W.current?d:0,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=xA(r),u=SA(r),d=TA(l)===`y`,f=W.current,p=typeof a==`function`?a(mH(e,i,F)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return q&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(dH,d?`${m} ${h}`:`${h} ${m}`),{}}},rH,b),Q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let oe=_H.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:se,elements:ce,x:le,y:ue,middlewareData:de,update:fe,placement:pe,context:me,isPositioned:J,floatingStyles:he}=t({rootContext:h,open:m?g:void 0,placement:L,middleware:K,strategy:r,whileElementsMounted:m?void 0:(...e)=>tM(...e,oe),nodeId:y,externalTree:S}),{sideX:ge,sideY:_e}=de.adaptiveOrigin||aH,ve=J?r:`fixed`,ye=_H.useMemo(()=>{let e;return e=J?b?{position:ve,[ge]:le,[_e]:ue}:{...he,position:ve}:{position:ve,top:0,left:0},e[vH]=`100vw`,e[yH]=`100vh`,J||(e.opacity=0),e},[b,ve,ge,le,_e,ue,he,J]),be=_H.useRef(null);Q(()=>{if(!g)return;let e=N.current,t=typeof e==`function`?e():e,n=(gH(t)?t.current:t)||null;n!==be.current&&(se.setPositionReference(n),be.current=n)},[g,se,M,N]),_H.useEffect(()=>{if(!g)return;let e=N.current;typeof e!=`function`&&gH(e)&&e.current!==be.current&&(se.setPositionReference(e.current),be.current=e.current)},[g,se,M,N]),_H.useEffect(()=>{if(m&&g&&ce.reference&&ce.floating)return tM(ce.reference,ce.floating,fe,oe)},[m,g,ce,fe,oe]);let xe=xA(pe),Se=pH(i,xe,F),Ce=SA(pe)||`center`,we=!!de.hide?.referenceHidden;Q(()=>{x&&g&&J&&xe!==I&&w(xe)},[x,g,J,xe,I]);let Te=_H.useMemo(()=>({position:`absolute`,top:de.arrow?.y,left:de.arrow?.x}),[de.arrow]),Ee=de.arrow?.centerOffset!==0;return _H.useMemo(()=>({positionerStyles:ye,arrowStyles:Te,arrowRef:W,arrowUncentered:Ee,side:Se,align:Ce,physicalSide:xe,anchorHidden:we,refs:se,context:me,isPositioned:J,update:fe}),[ye,Te,W,Ee,Se,Ce,xe,we,se,me,J,fe])}function gH(e){return e!=null&&`current`in e}var _H,vH,yH,bH=s((()=>{_H=d(m(),1),KA(),SF(),eN(),oF(),mF(),IB(),Yz(),$V(),nH(),iH(),oH(),fH(),vH=sH,yH=cH})),xH,SH,CH,wH=s((()=>{xH=d(m(),1),SH=d(O(),1),CH=xH.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,SH.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})})}));function TH(e){return e===`starting`?EL:UM}var EH=s((()=>{WM(),jL()}));function DH(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),gL(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},TH(r),i],stateAttributesMapping:sP})}var OH=s((()=>{lP(),TL(),EH()}));function kH(e,t){return pj(e)?e:t}function AH(e,t,n){return/hidden|clip/.test(e.getComputedStyle(kH(t,n)).overflowY)}function $te(e){if(typeof document>`u`)return!1;let t=xF(e);return sj(t).innerWidth-t.documentElement.clientWidth>0}function ene(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=xF(e),n=t.documentElement,r=t.body,i=kH(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function tne(e){let t=xF(e),n=t.documentElement,r=t.body,i=kH(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function nne(e){let t=xF(e),n=t.documentElement,r=t.body,i=sj(n),a=0,o=0,s=!1,c=yF.create();if(mN&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,MH={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},PH=n.style.scrollBehavior,NH={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=kH(n,r);s=ene(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,MH),Object.assign(r.style,NH),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=PH)}function d(){u(),c.request(l)}l();let f=qP(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}function jH(e=!0,t=null){Q(()=>{if(e)return IH.acquire(t)},[e,t])}var MH,NH,PH,FH,IH,LH=s((()=>{Aj(),JP(),SN(),SF(),eN(),ZM(),bF(),MH={},NH={},PH=``,FH=class{lockCount=0;restore=null;timeoutLock=XM.create();timeoutUnlock=XM.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=xF(e),n=t.documentElement,r=t.body,i=sj(n);if(AH(i,n,r)){let t=new i.MutationObserver(()=>{AH(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=cN||!$te(e);this.restore=a?tne(e):nne(e)}},IH=new FH}));function RH(e,t,n,r){let[i,a]=zH.useState(!1);Q(()=>{if(!e||!t||n==null){a(!1);return}let r=xF(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-BH)},[e,t,n]),jH(e&&(!t||i),r)}var zH,BH,VH=s((()=>{zH=d(m(),1),SF(),LH(),eN(),BH=20})),HH,UH,WH,rne=s((()=>{HH=d(m(),1),GV(),eN(),IB(),BB(),YV(),bH(),zV(),wH(),WP(),jL(),uz(),OH(),VH(),UH=d(O(),1),WH=HH.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=kL,..._}=e,v=LB(),y=IV(),b=GL(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=v.useState(`adaptiveOrigin`),M=HH.useRef(null),N=sz(O),P=hH({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:j}),F=x.useState(`domReferenceElement`);Q(()=>{let e=F,t=M.current;if(e&&(M.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return N(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[F,N,v]);let I=E===!0&&w!==`trigger-hover`;RH(C&&I,D===`touch`,O,T);let L=v.useStateSetter(`positionerElement`),R=DH(e,{open:C,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:k},{styles:P.positionerStyles,transitionStatus:A,props:_,refs:[t,L],hidden:!S,inert:!C});return(0,UH.jsxs)(JV.Provider,{value:P,children:[S&&I&&(0,UH.jsx)(CH,{inert:WV(!C),cutout:T}),(0,UH.jsx)(KL,{id:b,children:R})]})})})),GH,KH,qH,JH,YH,XH,ZH=s((()=>{XR(),GH=`ArrowUp`,KH=`ArrowDown`,qH=`ArrowLeft`,JH=`ArrowRight`,YH=`Home`,XH=new Set([GH,KH,qH,JH,YH,`End`])}));function QH(e){let t=$H.useContext(eU);if(t===void 0&&!e)throw Error(LI(69));return t}var $H,eU,tU=s((()=>{RI(),$H=d(m(),1),eU=$H.createContext(void 0)}));function nU(){let[e,t]=rU.useState(0),n=$(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:rU.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var rU,iU,aU=s((()=>{rU=d(m(),1),mF(),iU=rU.createContext(void 0)})),oU,sU,cU,lU=s((()=>{oU=d(m(),1),Aj(),IB(),BB(),YV(),lP(),pz(),TL(),WP(),ZH(),tU(),EH(),aU(),Uz(),sU=d(O(),1),cU=oU.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=LB(),l=KV(),u=QH(!0)!=null,{context:d,hasClosePart:f}=nU(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);dz({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),oB(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?mz(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=gL(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...Dz,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&XH.has(e.key)&&e.stopPropagation()}},TH(g),s],stateAttributesMapping:cP});return(0,sU.jsx)(sR,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:dj(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,sU.jsx)(iU.Provider,{value:d,children:M})})})})),uU=s((()=>{mV()}));function dU(e){let[t,n]=fU.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var fU,pU=s((()=>{fU=d(m(),1)})),mU=s((()=>{eV(),FV(),UV(),rne(),lU(),YV(),BB(),lP(),TL(),WP(),_V(),uU(),KP(),aU(),GV(),bF(),pU(),eN(),mF(),SF(),uz(),WM(),KA(),Aj(),fH(),$V(),oH(),qB(),jR()})),hU=s((()=>{mU()}));function gU(e){return{contextElement:e,getBoundingClientRect:()=>{let t=Jo(e);return{x:t.left,y:t.top,top:t.top,left:t.left,right:t.right,bottom:t.bottom,width:t.width,height:t.height,toJSON:()=>t}}}}function _U(){return{x:0,y:0,get width(){return Yo().width},get height(){return Yo().height}}}var vU=s((()=>{Qo()}));function yU(e){let t=bU.useContext(xU);if(t===void 0&&!e)throw Error(LI(33));return t}var bU,xU,SU=s((()=>{RI(),bU=d(m(),1),xU=bU.createContext(void 0)}));function CU(e){let t=wU.useContext(TU);if(t===void 0&&!e)throw Error(LI(36));return t}var wU,TU,EU=s((()=>{RI(),wU=d(m(),1),TU=wU.createContext(void 0)}));function DU(e=!0){let t=OU.useContext(kU);if(t===void 0&&!e)throw Error(LI(25));return t}var OU,kU,AU=s((()=>{RI(),OU=d(m(),1),kU=OU.createContext(void 0)}));function jU({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=MU.useRef(e!==void 0),[a,o]=MU.useState(t);return[i&&e!==void 0?e:a,MU.useCallback(e=>{i||o(e)},[])]}var MU,NU=s((()=>{MU=d(m(),1)}));function PU(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=DU(!0),f=d!==void 0;return FU.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:AP})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!dN&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&cV(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var FU,IU=s((()=>{FU=d(m(),1),SN(),WP(),AU(),lV()}));function LU(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=RU.useRef(null),{getButtonProps:d,buttonRef:f}=uV({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=PU({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=RU.useCallback(e=>$I(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=ZP(u,f);return RU.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var RU,zU,BU=s((()=>{RU=d(m(),1),rF(),uU(),hL(),IU(),zU={type:`regular-item`}}));function VU(){return HU.useContext(UU)}var HU,UU,WU=s((()=>{HU=d(m(),1),UU=HU.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}})}));function GU(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=VU(),u=KU.useRef(-1),[d,f]=KU.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=KU.useRef(null),h=KU.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Q(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var KU,qU=s((()=>{KU=d(m(),1),eN(),WU()})),JU,YU,XU=s((()=>{JU=d(m(),1),BU(),EU(),TL(),_V(),qU(),SU(),YU=JU.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=GU({guess:!0,label:a}),f=yU(!0),p=gV(i),{store:m}=CU(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=LU({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:zU});return gL(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})})})),ZU,QU,$U,eW=s((()=>{ZU=d(m(),1),IB(),EU(),SU(),TL(),lP(),pz(),KP(),WP(),tU(),ZH(),EH(),QU=d(O(),1),$U=ZU.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=CU(),{side:c,align:l}=yU(),u=QH(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`hoverEnabled`),w=s.useState(`disabled`),T=s.useState(`openMethod`),E=_.type===`context-menu`;dz({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),ZU.useEffect(()=>{function e(e){s.setOpen(!1,GP(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),oB(b,{enabled:C&&!w&&!E&&_.type!==`menubar`,closeDelay:S});let D=s.useStateSetter(`popupElement`),O=gL(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,D],stateAttributesMapping:cP,props:[p,{onKeyDown(e){u&&XH.has(e.key)&&e.stopPropagation()}},TH(f),o,{"data-rootownerid":y}]}),k=_.type===void 0||E;return(g||_.type===`menubar`&&v!==`outside-press`)&&(k=!0),(0,QU.jsx)(sR,{context:b,openInteractionType:T,modal:E,disabled:!m,returnFocus:a===void 0?k:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:O})})}));function tW(){let e=nW.useContext(rW);if(e===void 0)throw Error(LI(32));return e}var nW,rW,iW=s((()=>{RI(),nW=d(m(),1),rW=nW.createContext(void 0)})),aW,oW,sW,cW=s((()=>{aW=d(m(),1),IB(),EU(),iW(),oW=d(O(),1),sW=aW.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=CU();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,oW.jsx)(rW.Provider,{value:n,children:(0,oW.jsx)(zL,{ref:t,...r,portalOwnerRole:o})})})}));function lW(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=$(i),[,o]=gW.useState(!1),s=jM(dW).current,c=jM(uW).current,l=gW.useRef(0),u=gW.useRef(!0),d=gW.useRef(null),f=gW.useRef(null),p=$(()=>{u.current||(u.current=!0,o(e=>!e))}),m=$((e,t)=>{c.set(e,t),p()}),h=$(e=>{c.delete(e),p()}),g=$(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!mW(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&hW(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=pW(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=$(()=>{let[e,t]=fW(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Q(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Q(()=>{u.current&&v()}),Q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=$(e=>(s.add(e),()=>{s.delete(e)})),b=gW.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,_W.jsx)(UU.Provider,{value:b,children:t})}function uW(){return new Map}function dW(){return new Set}function fW(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>hW(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function pW(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function mW(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function hW(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var gW,_W,vW=s((()=>{gW=d(m(),1),PM(),mF(),eN(),WU(),_W=d(O(),1)})),yW,bW,xW,SW=s((()=>{yW=d(m(),1),GV(),eN(),ZM(),IB(),SU(),EU(),bH(),vW(),wH(),iW(),jL(),AU(),KP(),WP(),uz(),OH(),VH(),bW=d(O(),1),xW=yW.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=OL,style:g,..._}=e,{store:v}=CU(),y=tW(),b=DU(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`activeTriggerElement`),k=v.useState(`transitionStatus`),A=v.useState(`positionerElement`),j=v.useState(`instantType`),M=v.useState(`adaptiveOrigin`),N=v.useState(`lastOpenChangeReason`),P=v.useState(`floatingNodeId`),F=v.useState(`floatingParentNodeId`),I=S.useState(`domReferenceElement`),L=yW.useRef(null),R=sz(A),z=n,B=c,V=l,H=s,U=h;x.type===`context-menu`&&(z=n??x.context?.anchor,H??=`start`,!o&&H!==`center`&&(V=e.alignOffset??2,B=e.sideOffset??-5));let W=o,G=H;x.type===`menu`?(W??=`inline-end`,G??=`start`,U=e.collisionAvoidance??kL):x.type===`menubar`&&(W??=x.context.orientation===`vertical`?`inline-end`:`bottom`,G??=`start`);let ee=x.type===`context-menu`,te=hH({anchor:z,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:W,sideOffset:B,align:G,alignOffset:V,arrowPadding:ee?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:P,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:U,shift:ee?{crossAxis:!(`side`in U&&U.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:C,adaptiveOrigin:M});yW.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===P&&v.set(`hoverEnabled`,!1),e.nodeId!==P&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,GP(VP)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,P]),yW.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,GP(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let ne=JM();yW.useEffect(()=>{T||ne.clear()},[T,ne]),yW.useEffect(()=>{function e(e){if(T&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?ne.isStarted()||ne.start(e,()=>{v.setOpen(!1,GP(VP))}):v.setOpen(!1,GP(VP))}else ne.clear()}}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,O,v,ne]),yW.useEffect(()=>{let e={open:T,nodeId:P,parentNodeId:F,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,P,F]),Q(()=>{let e=I,t=L.current;if(e&&(L.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return R(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,R,v]);let K={open:T,side:te.side,align:te.align,anchorHidden:te.anchorHidden,nested:x.type===`menu`,instant:j},re=x.type===`menubar`&&x.context.modal;RH(T&&(re||E&&N!==`trigger-hover`),D===`touch`,A,O);let q=DH(e,K,{styles:te.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),ie=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&N!==`trigger-hover`||x.type===`menubar`&&x.context.modal),ae=null;return x.type===`menubar`?ae=x.context.contentElement:x.type===void 0&&(ae=O),(0,bW.jsxs)(xU.Provider,{value:te,children:[ie&&(0,bW.jsx)(CH,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:WV(!T),cutout:ae}),(0,bW.jsx)(KL,{id:P,children:(0,bW.jsx)(lW,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:q})})]})})}));function CW(e){let t=wW.useContext(TW);if(t===null&&!e)throw Error(LI(5));return t}var wW,TW,EW=s((()=>{RI(),wW=d(m(),1),TW=wW.createContext(null)}));function DW(e){return{positionerRef:kW.createRef(),popupRef:kW.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:kW.createRef(),beforeContentFocusGuardRef:kW.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function OW(e,t,n=!1,r){return{...jz(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new UL,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:UM,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var kW,AW,jW,MW=s((()=>{kW=d(m(),1),YR(),WM(),WL(),Uz(),AW={...Lz,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},jW=class extends KR{constructor(e,t,n=!1){let r=new kz,i=OW(r,t,n,e);super(i,DW(r),AW),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef}else e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null}}));function NW(){return PW.useContext(FW)}var PW,FW,IW=s((()=>{PW=d(m(),1),FW=PW.createContext(void 0)}));function LW(e,t,n){return jM(()=>new jW(e,t,n)).current}var RW,zW,BW,VW=s((()=>{RW=d(m(),1),ZM(),mF(),FI(),eN(),PM(),WM(),BM(),IB(),EU(),EW(),jL(),$V(),jV(),KP(),WP(),AU(),hL(),uz(),MW(),Uz(),IW(),zW=d(O(),1),BW=FM(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=DU(!0),_=CU(!0),v=CW(!0),y=NW(),b=RW.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=jI(),S=jI(),C=QL(),w=b.type===`menu`?b.store:void 0,T=(n??a)&&w?.state.transitionStatus===`starting`,E=jM(()=>T?w?.state.instantType:void 0).current,D=LW({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b,disabled:o,highlightItemOnHover:h,modal:b.type===void 0?s:void 0,rootId:x,instantType:E},S,C!=null);D.useControlledProp(`openProp`,n),D.useControlledProp(`triggerIdProp`,p),D.useContextCallback(`onOpenChangeComplete`,i);let O=D.useState(`floatingTreeRoot`),k=GL(O),A=D.useState(`open`),j=D.useState(`activeTriggerElement`),M=D.useState(`positionerElement`),N=D.useState(`hoverEnabled`),P=D.useState(`disabled`),F=D.useState(`lastOpenChangeReason`),I=D.useState(`parent`),L=D.useState(`activeIndex`),R=D.useState(`payload`),z=D.useState(`floatingParentNodeId`),B=RW.useRef(null),V=RW.useRef(I.type!==`context-menu`),H=JM(),U=RW.useRef(!0),W=JM(),G=z!=null,{openMethod:ee,triggerProps:te}=kV(A);D.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:I.type===void 0?s:void 0,openMethod:ee,rootId:x}),Sz(D);let{forceUnmount:ne,transitionStatus:K}=Cz(A,D,()=>{D.set(`allowMouseEnter`,!1)},T),re=sz(D.context.popupRef);RW.useEffect(()=>{if(E===void 0)return;let e=()=>{D.state.instantType===E&&D.set(`instantType`,void 0)};if(!A){e();return}if(K!==void 0)return;if(D.context.popupRef.current==null){e();return}let t=new AbortController;return re(e,t.signal),()=>{t.abort()}},[E,A,K,re,D]),Q(()=>{g&&!_?D.update({parent:{type:`context-menu`,context:g},floatingNodeId:k,floatingParentNodeId:C}):_&&D.update({floatingNodeId:k,floatingParentNodeId:C})},[g,_,k,C,D]),RW.useEffect(()=>{A||(B.current=null),I.type===`context-menu`&&(A?H.start(500,()=>{V.current=!0}):(H.clear(),V.current=!1))},[H,A,I.type]),Q(()=>{!A&&!N&&D.set(`hoverEnabled`,!0)},[A,N,D]);let q=$((e,t)=>{let n=t.reason;if(!e&&!D.select(`open`)||A===e&&t.trigger===j&&F===n)return;let i=bz(t);if(!e&&t.trigger==null&&(t.trigger=j??void 0),r?.(e,t),t.isCanceled)return;D.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!U.current)return;e&&n===`trigger-focus`?(U.current=!1,W.start(300,()=>{U.current=!0})):(U.current=!0,W.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);B.current=t.event;let c=yz(D.state,e,t.trigger,i());c.openChangeReason=n,c.instantType=I.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:o||s?o?`click`:`dismiss`:void 0,D.update(c)}),ie=ez({popupStore:D,floatingRootContext:D.state.floatingRootContext,floatingId:S,nested:C!=null,onOpenChange:q}),ae=ie.context.events;Q(()=>{let e=({open:e,eventDetails:t})=>q(e,t);return ae.on(`setOpen`,e),()=>{ae?.off(`setOpen`,e)}},[ae,q]);let oe=RW.useCallback(()=>{D.setOpen(!1,GP(HP))},[D]);RW.useImperativeHandle(u,()=>({unmount:ne,close:oe}),[ne,oe]);let se;I.type===`context-menu`&&(se=I.context),RW.useImperativeHandle(se?.positionerRef,()=>M,[M]),RW.useImperativeHandle(se?.actionsRef,()=>({setOpen:q}),[q]);let ce=mR(ie,{enabled:!P,bubbles:{escapeKey:d&&I.type===`menu`},outsidePress(){return I.type!==`context-menu`||B.current?.type===`contextmenu`||V.current},externalTree:G?O:void 0}),le=XV(),ue=RW.useCallback(e=>{D.select(`activeIndex`)!==e&&D.set(`activeIndex`,e)},[D]),de=bB(ie,{enabled:!P,listRef:D.context.itemDomElements,activeIndex:L,nested:I.type!==void 0,loopFocus:c,orientation:l,parentOrientation:I.type===`menubar`?I.context.orientation:void 0,rtl:le===`rtl`,disabledIndices:HM,onNavigate:ue,openOnArrowKeyDown:I.type!==`context-menu`,externalTree:G?O:void 0,focusItemOnHover:h}),fe=RW.useCallback(e=>{D.context.typingRef.current=e},[D]),pe=wB(ie,{enabled:!P,listRef:D.context.itemLabels,elementsRef:D.context.itemDomElements,activeIndex:L,resetMs:500,onMatch:e=>{A&&e!==L&&D.set(`activeIndex`,e)},onTyping:fe}),me=RW.useMemo(()=>{let e=$I(pe.reference,de.reference,ce.reference,{onMouseMove(){D.set(`allowMouseEnter`,!0)}},te);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=A,e},[D,pe.reference,de.reference,ce.reference,te,A]),J=RW.useMemo(()=>{let e=$I(de.trigger,ce.trigger,te);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[de.trigger,ce.trigger,te]);jM(()=>(D.update({inactiveTriggerProps:J}),null)),wz(D,{floatingRootContext:ie,activeTriggerProps:me,inactiveTriggerProps:J,popupProps:RW.useMemo(()=>$I(Dz,{id:S,role:`menu`,"aria-orientation":l===`horizontal`?`horizontal`:void 0,"aria-labelledby":j?.id,onMouseMove(){D.set(`allowMouseEnter`,!0),I.type===`menu`&&D.set(`hoverEnabled`,!1)},onClick(){D.select(`hoverEnabled`)&&D.set(`hoverEnabled`,!1)},onKeyDown(e){let t=D.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},pe.floating,de.floating,ce.floating),[j,S,l,I.type,D,pe.floating,de.floating,ce.floating]),itemProps:de.item??UM});let he=RW.useMemo(()=>({store:D,parent:b}),[D,b]),ge=(0,zW.jsxs)(TU.Provider,{value:he,children:[f&&(0,zW.jsx)(gz,{handle:f,store:D}),typeof t==`function`?t({payload:R}):t]});return I.type===void 0||I.type===`context-menu`?(0,zW.jsx)(qL,{externalTree:O,children:ge}):ge})}));function HW(e,t){let n=UW(t);return e.clientX>=n.left-WW&&e.clientX<=n.right+WW&&e.clientY>=n.top-WW&&e.clientY<=n.bottom+WW}function UW(e){let t=e.getBoundingClientRect(),n=sj(e);if(yN)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var WW,GW=s((()=>{SF(),SN(),WW=5}));function KW(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=tV(),{ref:i,index:a}=GU(e),o=n===a,s=qW.useRef(null),c=ZP(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}var qW,JW=s((()=>{qW=d(m(),1),rF(),iV(),qU()}));function YW(e){let{render:t,className:n,style:r,state:i=UM,props:a=HM,refs:o=HM,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=KW({metadata:s});return gL(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}var XW=s((()=>{WM(),TL(),JW()}));function ZW(e){if(dj(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!yj(e))return ZW(Sj(e))}var QW=s((()=>{Aj()}));function $W(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=eG.useRef(!1);return eG.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,xF(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:UM,[t,n,r])}var eG,tG=s((()=>{eG=d(m(),1),SF(),WM()}));function nG(e,t){let n=JM(),[r,i]=iG.useState(!1);return Q(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function rG(){let e=CW(!0);return iG.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var iG,aG,oG,sG=s((()=>{RI(),iG=d(m(),1),ZM(),SF(),BM(),mF(),eN(),WM(),IB(),WL(),XR(),EU(),lP(),TL(),mV(),GW(),XW(),iV(),QW(),Uz(),xV(),_V(),WP(),tG(),EW(),jL(),AF(),hL(),aG=d(O(),1),oG=IM(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=CU(!0),h=zz(d)??m?.store;if(!h)throw Error(LI(85));let g=gV(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=iG.useRef(null),S=rG(),C=tV(!0),w=$L(),T=iG.useMemo(()=>w??new UL,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=xz(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:GL(T),floatingParentNodeId:QL(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=uV({disabled:A,native:o});iG.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=iG.useRef(null),P=JM(),F=$(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;AN(N.current,t)||AN(h.select(`positionerElement`),t)||t===N.current||t!=null&&ZW(t)===h.select(`rootId`)||HW(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:BP})});iG.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&xF(N.current).addEventListener(`mouseup`,F,{once:!0})},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,L=lB(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:jB({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=nG(y,h.select(`lastOpenChangeReason`)),z=fR(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&R}),B=Xz(v,{enabled:!A&&I}),V=$W({open:y,enabled:O,mouseDownAction:`open`}),H=iG.useMemo(()=>$I(B.reference,z.reference),[B.reference,z.reference]),U=h.useState(`triggerProps`,D),{preFocusGuardRef:W,handlePreFocusGuardFocus:G,handleFocusTargetFocus:ee}=vV(h,x),te={disabled:A,open:y},ne=[N,t,M,E,x],K=[H,L??UM,U,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),xF(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},O?{role:`menuitem`}:{},V,p,j],re=gL(`button`,e,{enabled:!O,stateAttributesMapping:oP,state:te,ref:ne,props:K});return O?(0,aG.jsx)(YW,{tag:`button`,render:n,className:r,style:i,state:te,refs:ne,props:K,stateAttributesMapping:oP}):y?(0,aG.jsxs)(iG.Fragment,{children:[(0,aG.jsx)(kF,{ref:W,onFocus:G},`${g}-pre-focus-guard`),(0,aG.jsx)(iG.Fragment,{children:re},g),(0,aG.jsx)(kF,{ref:h.context.triggerFocusTargetRef,onFocus:ee},`${g}-post-focus-guard`)]}):(0,aG.jsx)(iG.Fragment,{children:re},g)})}));function cG(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var lG=s((()=>{})),uG=s((()=>{SU(),EU(),TL(),lP(),AU(),WP(),NU(),WM(),RI(),BU(),qU(),_V(),KN(),KP(),az(),pz(),eN(),XU(),IU(),uU(),hL(),eW(),cW(),SW(),mF(),VW(),IW(),sG(),GV(),bF(),pU(),SF(),uz(),KA(),Aj(),fH(),$V(),oH(),lF(),SN(),IB(),Uz(),MW(),jR()})),dG=s((()=>{uG()})),fG,pG,mG=s((()=>{m(),fG=()=>void 0,pG=()=>fG()}));function hG({intent:e=`secondary`,size:t=`default`,block:n=!1,className:r=``}={}){return[`btn`,vG[e],t==="default"?``:`btn-${t}`,n?`btn-block`:``,r].filter(Boolean).join(` `)}function gG({intent:e=`secondary`,size:t=`default`,busy:n=!1,busyLabel:r,block:i=!1,type:a=`button`,className:o,onClick:s,children:c,ref:l,...u}){let d=e=>{n?e.preventDefault():s?.(e)};return(0,_G.jsx)(`button`,{...u,ref:l,type:a,className:hG({intent:e,size:t,block:i,className:o}),"aria-disabled":n||u[`aria-disabled`]||void 0,"data-busy":n||void 0,onClick:d,children:n&&r!==void 0?r:c})}var _G,vG,yG=s((()=>{_G=d(O(),1),vG={primary:`primary btn-primary`,secondary:`ghost btn-secondary`,quiet:`btn-quiet`,danger:`danger btn-danger`}}));function bG({className:e,triggerClassName:t=hG(),triggerTitle:n,triggerLabel:r,label:i,popupClassName:a=`dd-list`,side:o=`bottom`,align:s=`end`,sideOffset:c=4,open:l,onOpenChange:u,finalFocus:d,children:f}){let p=(0,SG.useRef)(null),[m,h]=(0,SG.useState)(null);(0,SG.useEffect)(()=>{h(p.current?.closest(`dialog, [role="dialog"]`))},[]);let[g,_]=(0,SG.useState)(!1),v=l??g;return(0,CG.jsx)(`div`,{className:e||void 0,children:(0,CG.jsxs)(BW,{open:v,onOpenChange:(e,t)=>{!e&&t.reason===`escape-key`&&d===void 0&&p.current?.focus({preventScroll:!0}),_(e),u?.(e)},children:[(0,CG.jsx)(oG,{render:(0,CG.jsx)(`button`,{type:`button`,className:t,title:n,"aria-label":r,ref:p}),children:i}),(0,CG.jsx)(sW,{container:m??pG(),children:(0,CG.jsx)(xW,{anchor:()=>p.current?gU(p.current):null,positionMethod:`fixed`,side:o,align:s,sideOffset:c,collisionBoundary:_U(),collisionPadding:8,style:{zIndex:90},children:(0,CG.jsx)($U,{className:a,finalFocus:d,children:f})})})]})})}function xG({className:e=`dd-option`,disabled:t,closeOnClick:n,onClick:r,title:i,children:a,ref:o}){return(0,CG.jsx)(YU,{render:(0,CG.jsx)(`button`,{type:`button`,className:e,title:i,ref:o}),nativeButton:!0,disabled:t,closeOnClick:n,onClick:r,children:a})}var SG,CG,wG=s((()=>{SG=d(m(),1),dG(),vU(),mG(),yG(),CG=d(O(),1)})),TG,EG=s((()=>{ba(),TG=pa({formatting:`Formatting for {label}`,bold:`Bold`,boldMark:`B`,italicMark:`I`,strikeMark:`S`,italic:`Italic`,strike:`Strikethrough`,textStyle:`Text style`,paragraph:`Paragraph`,heading:`Heading {level}`,quote:`Quote`,codeBlock:`Code block`,inlineCode:`Code`,bulletList:`Bulleted list`,orderedList:`Numbered list`,taskList:`Checklist`,link:`Link`,linkAddress:`Link address`,linkPlaceholder:`https://`,linkApply:`Apply`,linkRemove:`Remove link`,linkInvalid:`A link is a web address (https://…) or mailto:.`,table:`Table`,tableInsert:`Insert table`,tableRowAfter:`Add row below`,tableColumnAfter:`Add column right`,tableRowDelete:`Delete row`,tableColumnDelete:`Delete column`,tableDelete:`Delete table`,picture:`Add picture`,pictureAdding:`Adding picture…`,noPeople:`No one by that name`,people:`People`,group:`Team`})})),DG=s((()=>{})),OG=l({RichTextEditor:()=>NG,cleanPastedHtml:()=>kG});function kG(e){return e.replace(/<!--\[if[\s\S]*?<!\[endif\]-->/gi,``).replace(/<!--[\s\S]*?-->/g,``).replace(/<\/?(?:o|w|m|v):[^>]*>/gi,``).replace(/<(style|xml|title)\b[\s\S]*?<\/\1\s*>/gi,``).replace(/<(?:meta|link)\b[^>]*>/gi,``).replace(/<b\b[^>]*id="docs-internal-guid[^"]*"[^>]*>([\s\S]*)<\/b>/i,`$1`)}function AG(e){let t=e.getHTML().replace(/(?:<p><\/p>)+$/,``);return yr(t)||/<img\b/i.test(t)?t:``}function jG(e){let t=(0,FG.useRef)(e);return t.current=e,t}function MG({label:e,active:t,disabled:n,onClick:r,children:i}){return(0,IG.jsx)(`button`,{type:`button`,className:`rich-tool${t?` is-active`:``}`,title:e,"aria-label":e,"aria-pressed":t,disabled:n,onMouseDown:e=>e.preventDefault(),onClick:r,children:i})}function NG({id:e,value:t,onChange:n,label:r,describedBy:i,invalid:a,disabled:o=!1,autoFocus:s,placeholder:c,mentions:l,pictures:u,onKey:d,onProblem:f,onPopupChange:p}){let[m,h]=(0,FG.useState)(),[g,_]=(0,FG.useState)(),[v,y]=(0,FG.useState)(!1),[b,x]=(0,FG.useState)(0),S=jG({onChange:n,mentions:l,pictures:u,onKey:d,onProblem:f,suggesting:m}),C=(0,FG.useRef)({query:``,count:1}),w=(0,FG.useRef)(null),T=(0,FG.useRef)(null),E=(0,FG.useRef)({html:``,edited:!1}),D=(e,t,n)=>{let r=S.current.pictures,i=t.filter(e=>e.type.startsWith(`image/`));if(!r||!i.length)return!1;for(let t of i)x(e=>e+1),r(t).then(r=>{let i=e.chain().focus();(n===void 0?i:i.setTextSelection(n)).setImage({src:r,alt:t.name}).run()}).catch(e=>S.current.onProblem?.(e.message)).finally(()=>x(e=>e-1));return!0},O=FS({immediatelyRender:!0,shouldRerenderOnTransaction:!0,editable:!o,autofocus:s?`end`:!1,content:t||``,extensions:[mO.configure({heading:{levels:[2,3,4]},horizontalRule:!1,link:{openOnClick:!1,autolink:!0,defaultProtocol:`https`,protocols:[`mailto`],isAllowedUri:e=>gr(e)!==void 0,HTMLAttributes:{rel:`noopener noreferrer`,target:`_blank`}}}),pD,fD.configure({nested:!0}),_A.configure({resizable:!1}),pA,fA,dA,AM.configure({inline:!1,allowBase64:!1}),...c?[lO.configure({placeholder:c})]:[],...l?[DM.extend({addAttributes(){return{...this.parent?.(),kind:{default:null,parseHTML:e=>e.getAttribute(`data-kind`)===`group`?`group`:null,renderHTML:()=>({})},label:{default:null,parseHTML:e=>(e.textContent??``).replace(/^@/,``)||null,renderHTML:()=>({})}}}}).configure({renderText:({node:e})=>`@${e.attrs.label??e.attrs.id}`,renderHTML:({node:e})=>[`span`,{"data-type":`mention`,"data-id":e.attrs.id,...e.attrs.kind===`group`?{"data-kind":`group`}:{}},`@${e.attrs.label??e.attrs.id}`],suggestion:{allowSpaces:!0,allow:({state:e,range:t})=>{if(!e.doc.resolve(t.from).parent.type.contentMatch.matchType(e.schema.nodes.mention))return!1;let n=e.doc.textBetween(t.from+1,t.to);if(!/\s/.test(n))return!0;if(/^\s|\s\s/.test(n)||n.trim().split(/\s+/).length+ +!!/\s$/.test(n)>2)return!1;let r=C.current;return r.count>0||!n.startsWith(r.query)},items:async({query:e})=>{try{return(await S.current.mentions?.(e)??[]).slice(0,8)}catch{return[]}},render:()=>{let e=e=>{if(e.loading||(C.current={query:e.query,count:e.items.length}),!e.loading&&!e.items.length&&/\s/.test(e.query))return h(void 0);h(t=>({items:e.items,index:t&&t.items===e.items?t.index:0,box:()=>e.clientRect?.()??null,pick:t=>e.command({id:t.id,label:t.label,kind:t.kind??null})}))};return{onStart:e,onUpdate:e,onExit:()=>h(void 0),onKeyDown:({event:e})=>{let t=S.current.suggesting;if(!t||!t.items.length)return e.key===`Escape`&&(h(void 0),!0);if(e.key===`ArrowDown`||e.key===`ArrowUp`){let n=e.key===`ArrowDown`?1:-1;return h({...t,index:(t.index+n+t.items.length)%t.items.length}),!0}return e.key===`Enter`||e.key===`Tab`?(t.pick(t.items[t.index]),!0):e.key===`Escape`&&(h(void 0),!0)}}}}})]:[]],editorProps:{attributes:{class:`rich-text rich-text-editable`,role:`textbox`,"aria-multiline":`true`,"aria-label":r,...e?{id:e}:{},...i?{"aria-describedby":i}:{},...a?{"aria-invalid":`true`}:{}},transformPastedHTML:kG,handleKeyDown:(e,t)=>S.current.onKey?.(t)??!1,handlePaste:(e,t)=>{let n=[...t.clipboardData?.files??[]];return n.length>0&&T.current?D(T.current,n):!1},handleDrop:(e,t)=>{let n=[...t.dataTransfer?.files??[]];if(!n.length||!T.current)return!1;let r=e.posAtCoords({left:t.clientX,top:t.clientY})?.pos;return D(T.current,n,r)}},onCreate:({editor:e})=>{E.current={html:AG(e),edited:!1}},onUpdate:({editor:e})=>{let t=AG(e);(E.current.edited||t!==E.current.html)&&(E.current.edited=!0,S.current.onChange(t))}});T.current=O;let k=!!m;if((0,FG.useEffect)(()=>{p?.(k)},[k]),(0,FG.useEffect)(()=>{O&&t!==AG(O)&&(O.commands.setContent(t||``,{emitUpdate:!1}),E.current={html:AG(O),edited:!1})},[O,t]),(0,FG.useEffect)(()=>{O?.setEditable(!o)},[O,o]),!O)return null;let A=e=>()=>e(O.chain().focus()).run(),j=O.isActive(`heading`,{level:2})?TG(`heading`,{level:2}):O.isActive(`heading`,{level:3})?TG(`heading`,{level:3}):O.isActive(`heading`,{level:4})?TG(`heading`,{level:4}):O.isActive(`codeBlock`)?TG(`codeBlock`):TG(`paragraph`),M=O.isActive(`table`),N=()=>{let e=(g??``).trim();e?gr(e)?(O.chain().focus().extendMarkRange(`link`).setLink({href:e}).run(),_(void 0)):y(!0):(O.chain().focus().extendMarkRange(`link`).unsetLink().run(),_(void 0))},P=()=>{y(!1),_(O.getAttributes(`link`).href??``)};return(0,IG.jsxs)(`div`,{className:`rich-editor${a?` is-invalid`:``}${o?` is-disabled`:``}`,children:[(0,IG.jsxs)(`div`,{className:`rich-toolbar`,role:`toolbar`,"aria-label":TG(`formatting`,{label:r}),children:[(0,IG.jsx)(MG,{label:TG(`bold`),active:O.isActive(`bold`),disabled:o,onClick:A(e=>e.toggleBold()),children:(0,IG.jsx)(`strong`,{children:TG(`boldMark`)})}),(0,IG.jsx)(MG,{label:TG(`italic`),active:O.isActive(`italic`),disabled:o,onClick:A(e=>e.toggleItalic()),children:(0,IG.jsx)(`em`,{children:TG(`italicMark`)})}),(0,IG.jsx)(MG,{label:TG(`strike`),active:O.isActive(`strike`),disabled:o,onClick:A(e=>e.toggleStrike()),children:(0,IG.jsx)(`s`,{children:TG(`strikeMark`)})}),(0,IG.jsx)(`span`,{className:`rich-tool-gap`,"aria-hidden":`true`}),(0,IG.jsxs)(bG,{className:`rich-tool-menu`,triggerClassName:`rich-tool rich-tool-wide`,triggerTitle:TG(`textStyle`),triggerLabel:`${TG(`textStyle`)}: ${j}`,label:(0,IG.jsxs)(IG.Fragment,{children:[j,(0,IG.jsx)(`span`,{className:`rich-tool-caret`,"aria-hidden":`true`,children:`▾`})]}),popupClassName:`page-actions-popup rich-menu`,align:`start`,children:[(0,IG.jsx)(xG,{className:`page-actions-item`,onClick:A(e=>e.setParagraph()),children:TG(`paragraph`)}),[2,3,4].map(e=>(0,IG.jsx)(xG,{className:`page-actions-item rich-menu-h${e}`,onClick:A(t=>t.setHeading({level:e})),children:TG(`heading`,{level:e})},e)),(0,IG.jsx)(xG,{className:`page-actions-item`,onClick:A(e=>e.toggleBlockquote()),children:TG(`quote`)}),(0,IG.jsx)(xG,{className:`page-actions-item`,onClick:A(e=>e.toggleCodeBlock()),children:TG(`codeBlock`)})]}),(0,IG.jsx)(`span`,{className:`rich-tool-gap`,"aria-hidden":`true`}),(0,IG.jsx)(MG,{label:TG(`bulletList`),active:O.isActive(`bulletList`),disabled:o,onClick:A(e=>e.toggleBulletList()),children:`•≡`}),(0,IG.jsx)(MG,{label:TG(`orderedList`),active:O.isActive(`orderedList`),disabled:o,onClick:A(e=>e.toggleOrderedList()),children:`1≡`}),(0,IG.jsx)(MG,{label:TG(`taskList`),active:O.isActive(`taskList`),disabled:o,onClick:A(e=>e.toggleTaskList()),children:`☑`}),(0,IG.jsx)(`span`,{className:`rich-tool-gap`,"aria-hidden":`true`}),(0,IG.jsx)(MG,{label:TG(`link`),active:O.isActive(`link`),disabled:o,onClick:P,children:`↗`}),(0,IG.jsx)(MG,{label:TG(`inlineCode`),active:O.isActive(`code`),disabled:o,onClick:A(e=>e.toggleCode()),children:`</>`}),(0,IG.jsxs)(bG,{className:`rich-tool-menu`,triggerClassName:`rich-tool`,triggerTitle:TG(`table`),triggerLabel:TG(`table`),label:`⊞`,popupClassName:`page-actions-popup rich-menu`,align:`start`,children:[(0,IG.jsx)(xG,{className:`page-actions-item`,disabled:M,onClick:A(e=>e.insertTable({rows:3,cols:3,withHeaderRow:!0})),children:TG(`tableInsert`)}),(0,IG.jsx)(xG,{className:`page-actions-item`,disabled:!M,onClick:A(e=>e.addRowAfter()),children:TG(`tableRowAfter`)}),(0,IG.jsx)(xG,{className:`page-actions-item`,disabled:!M,onClick:A(e=>e.addColumnAfter()),children:TG(`tableColumnAfter`)}),(0,IG.jsx)(xG,{className:`page-actions-item`,disabled:!M,onClick:A(e=>e.deleteRow()),children:TG(`tableRowDelete`)}),(0,IG.jsx)(xG,{className:`page-actions-item`,disabled:!M,onClick:A(e=>e.deleteColumn()),children:TG(`tableColumnDelete`)}),(0,IG.jsx)(xG,{className:`page-actions-item`,disabled:!M,onClick:A(e=>e.deleteTable()),children:TG(`tableDelete`)})]}),u&&(0,IG.jsxs)(IG.Fragment,{children:[(0,IG.jsx)(MG,{label:TG(b?`pictureAdding`:`picture`),disabled:o,onClick:()=>w.current?.click(),children:`▣`}),(0,IG.jsx)(`input`,{ref:w,type:`file`,accept:`image/*`,hidden:!0,onChange:e=>{let t=[...e.target.files??[]];e.target.value=``,D(O,t)}})]})]}),g!==void 0&&(0,IG.jsxs)(`div`,{className:`rich-link-bar`,children:[(0,IG.jsx)(`input`,{className:`field-control`,type:`url`,autoFocus:!0,"aria-label":TG(`linkAddress`),"aria-invalid":v||void 0,placeholder:TG(`linkPlaceholder`),value:g,onChange:e=>{_(e.target.value),y(!1)},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),N()):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),_(void 0),O.commands.focus())}}),(0,IG.jsx)(`button`,{type:`button`,className:`rich-tool rich-tool-wide`,onClick:N,children:TG(`linkApply`)}),O.isActive(`link`)&&(0,IG.jsx)(`button`,{type:`button`,className:`rich-tool rich-tool-wide`,onClick:()=>{O.chain().focus().extendMarkRange(`link`).unsetLink().run(),_(void 0)},children:TG(`linkRemove`)}),v&&(0,IG.jsx)(`span`,{className:`insert-missing`,role:`alert`,children:TG(`linkInvalid`)})]}),(0,IG.jsx)(JS,{editor:O,className:`rich-editor-body`,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),P())}}),m&&(0,IG.jsx)(PG,{suggesting:m,onPick:e=>m.pick(e)})]})}function PG({suggesting:e,onPick:t}){return(0,IG.jsx)(JB,{open:!0,modal:!1,children:(0,IG.jsx)(HV,{container:ia(),children:(0,IG.jsx)(WH,{anchor:{getBoundingClientRect:()=>{let t=e.box(),n=qo(),r=(t?.top??0)/n,i=(t?.left??0)/n,a=(t?.width??0)/n,o=(t?.height??0)/n;return{x:i,y:r,top:r,left:i,width:a,height:o,right:i+a,bottom:r+o,toJSON:()=>({})}}},positionMethod:`fixed`,side:`bottom`,align:`start`,sideOffset:4,collisionBoundary:_U(),collisionPadding:8,style:{zIndex:95},children:(0,IG.jsx)(cU,{className:`rich-mentions`,initialFocus:!1,finalFocus:!1,children:(0,IG.jsx)(`div`,{role:`listbox`,"aria-label":TG(`people`),children:e.items.length?e.items.map((n,r)=>(0,IG.jsxs)(`div`,{role:`option`,"aria-selected":r===e.index,className:`rich-mention-option${r===e.index?` is-active`:``}`,onMouseDown:e=>{e.preventDefault(),t(n)},children:[(0,IG.jsx)(`span`,{children:n.label}),n.kind===`group`?(0,IG.jsx)(`span`,{className:`rich-mention-kind`,children:TG(`group`)}):n.handle&&(0,IG.jsxs)(`span`,{className:`rich-mention-handle`,children:[`@`,n.handle]})]},`${n.kind??`person`}:${n.id}`)):(0,IG.jsx)(`div`,{className:`rich-mention-none`,children:TG(`noPeople`)})})})})})})}var FG,IG,LG=s((()=>{FG=d(m()),aC(),hO(),mD(),vA(),Ate(),jte(),fO(),hU(),Dr(),Es(),vU(),wG(),EG(),DG(),sa(),IG=d(O())}));function RG(e,t){let n=e.labelColumn??e.by,r=e=>e==null?``:String(e);if(!nt(n))return r(t[n]);let i=Ye(n);return`problem`in i?``:i.parts.map(e=>`text`in e?e.text:[e.path,...(e.or??[]).map(e=>e.path)].map(e=>r(t[e])).find(Boolean)??``).join(``).replace(/\s+/g,` `).trim()}function zG(e,t,n,r=[]){let i=Or(e.labelColumn??e.by),a=`problem`in i?[e.by]:i.columns,o=e=>n?.find(t=>t.name===e),s=[...new Set([...a,e.by])].filter(e=>BG(o(e))),c=t.trim().split(/\s+/).filter(Boolean).slice(0,s.length>4?1:VG),l=s.length?c.map(e=>`(${s.flatMap(t=>[`${t} startswith ${pn(e)}`,`${t} contains ${pn(` ${e}`)}`]).join(` or `)})`):[];return[e.from,l.join(` and `),`show ${[...new Set([e.by,...a,...r])].join(`, `)}`,`sort ${a.join(`, `)}`].filter(Boolean).join(` `)}var BG,VG,HG=s((()=>{St(),Yn(),ot(),kr(),Dr(),BG=e=>!e?.type||ht(e.type)===`text`&&!/uuid|json/i.test(e.type),VG=2})),UG=l({mentionRows:()=>KG});function WG(e){if(!e.through)return;let t=bs(e.from),n=(xs(e.through)??[]).find(e=>e.to.table===t?.id&&e.from.columns.length===1);return n&&{column:n.from.columns[0],team:n.to.columns[0]}}async function GG(e,t,n){let r=WG(e);if(!r)return t;let i=[...new Set(t.map(e=>e[r.team]).filter(e=>typeof e==`string`||typeof e==`number`))];if(!i.length)return[];let a=`${e.through} ${r.column} in (${i.map(pn).join(`, `)}) show ${r.column}`,o=await rs(`/api/run`,{...Aa(n??null),q:a,limit:500,offset:0,count:`none`}),s=new Set((o.rows??[]).map(e=>String(e[r.column])));return t.filter(e=>s.has(String(e[r.team])))}async function KG(e,t,n,r){let i=bs(e.from),a=r===`group`?WG(e):void 0,o=zG(e,t,i?.columns,a?[a.team]:[]),s=await rs(`/api/run`,{...Aa(n??null),q:o,limit:a?24:8,offset:0,count:`none`});return(a?(await GG(e,s.rows??[],n)).slice(0,8):s.rows??[]).flatMap(t=>{let n=t[e.by],i=typeof n==`string`&&Sr.test(n)?n:typeof n==`number`&&Number.isSafeInteger(n)?String(n):void 0;if(i===void 0)return[];let a=RG(e,t)||i;return[{id:i,label:a,...r||!qG(e,i,a)?{}:{handle:i},...r?{kind:r}:{}}]})}function qG(e,t,n){return!bs(e.from)?.columns?.some(t=>t.name===e.by&&t.primaryKey)&&t!==n&&!/^\d+$/.test(t)&&!JG.test(t)&&!t.includes(`@`)}var JG,YG=s((()=>{Es(),Fa(),Dr(),HG(),Yn(),JG=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i})),XG,ZG,QG,$G,eK,tK=s((()=>{XG=d(m(),1),ZG=d(O(),1),QG=XG.createContext(void 0),$G=e=>{let t=XG.useContext(QG);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},eK=({client:e,children:t})=>(XG.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,ZG.jsx)(QG.Provider,{value:e,children:t}))}));function nK(e){setTimeout(e,0)}var rK,iK,aK,oK=s((()=>{rK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},iK=class{#e=rK;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},aK=new iK}));function sK(){}function cK(e,t){return typeof e==`function`?e(t):e}function lK(e){return typeof e==`number`&&e>=0&&e!==1/0}function uK(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dK(e,t){return typeof e==`function`?e(t):e}function fK(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==mK(o,t.options))return!1}else if(!gK(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function pK(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(hK(t.options.mutationKey)!==hK(a))return!1}else if(!gK(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function mK(e,t){return(t?.queryKeyHashFn||hK)(e)}function hK(e){return JSON.stringify(e,(e,t)=>bK(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function gK(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!gK(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!gK(e[r],t[r]))return!1;return!0}return!1}function _K(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=yK(e)&&yK(t);if(!r&&!(bK(e)&&bK(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:AK.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=_K(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function vK(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function yK(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bK(e){if(!xK(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!xK(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function xK(e){return Object.prototype.toString.call(e)===`[object Object]`}function SK(e){return new Promise(t=>{aK.setTimeout(t,e)})}function CK(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:_K(e,t)}function wK(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function TK(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}function EK(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===jK?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function DK(e,t){return typeof e==`function`?e(...t):!!e}function OK(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var kK,AK,jK,MK=s((()=>{oK(),kK=typeof window>`u`||`Deno`in globalThis,AK=Object.prototype.hasOwnProperty,jK=Symbol()})),NK,PK,FK=s((()=>{MK(),NK=()=>kK,PK=()=>NK()})),IK,LK=s((()=>{IK=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}})),RK,zK,BK=s((()=>{LK(),RK=class extends IK{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},zK=new RK}));function VK(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=HK,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var HK,UK,WK=s((()=>{oK(),HK=nK,UK=VK()})),GK,KK,qK=s((()=>{LK(),GK=class extends IK{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}},KK=new GK}));function JK(e){return Math.min(1e3*2**e,3e4)}function YK(e){return(e??`online`)!==`online`||KK.isOnline()}function XK(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(sK);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new ZK(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>zK.isFocused()&&(e.networkMode===`always`||KK.isOnline())&&e.canRun(),p=()=>YK(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(PK()?0:3),a=e.retryDelay??JK,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),SK(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var ZK,QK=s((()=>{MK(),FK(),BK(),qK(),ZK=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}}})),$K,eq=s((()=>{oK(),MK(),FK(),$K=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lK(this.gcTime)&&(this.#e=aK.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(PK()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(aK.clearTimeout(this.#e),this.#e=void 0)}}}));function tq(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{OK(e,()=>t.signal,()=>n=!0)},u=EK(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?TK:wK;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?rq:nq,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:nq(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function nq(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function rq(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var iq=s((()=>{MK()}));function aq(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:YK(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function oq(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function sq(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var cq,lq=s((()=>{MK(),WK(),QK(),eq(),iq(),cq=class extends $K{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=sq(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=sq(this.options);e.data!==void 0&&(this.setState(oq(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=CK(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(sK).catch(sK):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>dK(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jK||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>dK(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!uK(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=EK(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?tq(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=XK({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ZK&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ZK){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...aq(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...oq(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),UK.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}}}));function uq(e,t){return dK(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||dK(t.retryOnMount,e)!==!1)}function dq(e,t){return uq(e,t)||e.state.data!==void 0&&fq(e,t,t.refetchOnMount)}function fq(e,t,n){if(dK(t.enabled,e)!==!1&&dK(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&mq(e,t)}return!1}function pq(e,t,n,r){return(e!==t||dK(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&mq(e,n)}function mq(e,t){return dK(t.enabled,e)!==!1&&e.isStaleByTime(dK(t.staleTime,e))}var hq,gq=s((()=>{oK(),MK(),FK(),LK(),BK(),WK(),lq(),hq=class extends IK{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),dq(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fq(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fq(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof dK(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!vK(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&pq(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||dK(this.options.enabled,this.#t)!==dK(t.enabled,this.#t)||dK(this.options.staleTime,this.#t)!==dK(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||dK(this.options.enabled,this.#t)!==dK(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return vK(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(sK)),t}#h(e){return!PK()&&dK(this.options.enabled,this.#t)!==!1&&lK(e)}#g(){this.#b();let e=dK(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=uK(this.#r.dataUpdatedAt,e)+1;this.#u=aK.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=aK.setInterval(()=>{(this.options.refetchIntervalInBackground||zK.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(aK.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(aK.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&dq(e,t),o=i&&pq(e,n,t,r);(a||o)&&(l={...l,...aq(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=CK(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=CK(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:mq(e,t),refetch:this.refetch,isEnabled:dK(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),vK(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();UK.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}}}));function _q(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var vq,yq=s((()=>{WK(),QK(),eq(),vq=class extends $K{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||_q(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=XK({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),UK.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}}}));function bq(e){return e.options.scope?.id}var xq,Sq=s((()=>{MK(),LK(),WK(),yq(),xq=class extends IK{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new vq({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=bq(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=bq(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=bq(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=bq(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){UK.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>pK(t,e))}findAll(e={}){return this.getAll().filter(t=>pK(e,t))}notify(e){UK.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return UK.batch(()=>Promise.all(e.map(e=>e.continue().catch(sK))))}}}));function Cq(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var wq,Tq=s((()=>{MK(),LK(),WK(),gq(),wq=class extends IK{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,UK.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!vK(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Cq(e,n).forEach(e=>{e.destroy()}),Cq(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=_K(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new hq(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&UK.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}}})),Eq,Dq=s((()=>{MK(),LK(),WK(),lq(),Eq=class extends IK{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??mK(r,t),a=this.get(i);return a||(a=new cq({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){UK.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>fK(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>fK(e,t)):t}notify(e){UK.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){UK.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){UK.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}}})),Oq,kq=s((()=>{MK(),BK(),WK(),qK(),Sq(),Dq(),Oq=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Eq,this.#t=e.mutationCache||new xq,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=zK.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=KK.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(dK(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=cK(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return UK.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;UK.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return UK.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=UK.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(sK).catch(sK)}invalidateQueries(e,t={}){return UK.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=UK.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(sK)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(sK)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(dK(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(dK(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(sK).catch(sK)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(sK).catch(sK)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return KK.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(hK(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{gK(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(hK(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{gK(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=mK(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===jK&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}}})),Aq=s((()=>{MK(),WK(),gq(),Tq(),Dq(),kq()})),jq,Mq,Nq,Pq=s((()=>{jq=d(m(),1),Mq=jq.createContext(!1),Nq=()=>jq.useContext(Mq),Mq.Provider}));function Fq(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Iq,Lq,Rq,zq=s((()=>{Iq=d(m(),1),O(),Lq=Iq.createContext(Fq()),Rq=()=>Iq.useContext(Lq)})),Bq,Vq,Hq,Uq,Wq=s((()=>{Bq=d(m(),1),Aq(),Vq=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?DK(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Hq=e=>{Bq.useEffect(()=>{e.clearReset()},[e])},Uq=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||DK(n,[e.error,r]))})),Gq,Kq,qq,Jq=s((()=>{Gq=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Kq=(e,t)=>e?.suspense&&t.isPending,qq=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()})}));function Yq({queries:e,...t},n){let r=$G(n),i=Nq(),a=Rq(),o=t.subscribed!==!1,s=Xq.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{Gq(e);let t=r.getQueryCache().get(e.queryHash);Vq(e,a,t)}),Hq(a);let[c]=Xq.useState(()=>new wq(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;Xq.useSyncExternalStore(Xq.useCallback(e=>f?c.subscribe(UK.batchCalls(e)):sK,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),Xq.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>Kq(s[t],e))?l.flatMap((e,t)=>{let n=s[t];if(n&&Kq(n,e)){let e=new hq(r,n);return qq(n,e,a)}return[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&Uq({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}var Xq,Zq=s((()=>{tK(),Pq(),zq(),Wq(),Jq(),Xq=d(m(),1),Aq()}));function ine(e,t,n){let r=Nq(),i=Rq(),a=$G(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Gq(o),Vq(o,i,s),Hq(i);let[l]=Qq.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(Qq.useSyncExternalStore(Qq.useCallback(e=>{let t=d?l.subscribe(UK.batchCalls(e)):sK;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Qq.useEffect(()=>{l.setOptions(o)},[o,l]),Kq(o,u))throw qq(o,l,i);if(Uq({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}var Qq,$q=s((()=>{tK(),Pq(),zq(),Wq(),Jq(),Qq=d(m(),1),Aq()}));function eJ(e,t){return ine(e,hq,t)}var tJ=s((()=>{$q(),Aq()})),nJ=s((()=>{tK(),Zq(),tJ(),Aq()}));function rJ(){return(0,iJ.useSyncExternalStore)(la,ca,ca)}var iJ,aJ=s((()=>{iJ=d(m()),ba()}));function oJ(e){return ea(window,`online`,e),ea(window,`offline`,e),()=>{ta(window,`online`,e),ta(window,`offline`,e)}}function sJ({text:e,retry:t,crashed:n=!1}){rJ();let r=(0,uJ.useSyncExternalStore)(oJ,pJ,()=>!0),i=(0,uJ.useContext)(QG),a=(0,uJ.useContext)(fJ),o=(0,uJ.useId)(),s=!n&&!r?fa(`problem.offline`):e;a&&!a.has(s)&&a.set(s,o);let c=!a||a.get(s)===o;if((0,uJ.useEffect)(()=>()=>{a?.get(s)===o&&a.delete(s)},[a,s,o]),!c&&!n)return(0,dJ.jsx)(`p`,{className:`problem problem-repeat`,children:fa(`problem.sameAbove`)});let l=()=>{t?.(),i?.refetchQueries({type:`active`,predicate:e=>e.state.status===`error`})};return(0,dJ.jsxs)(`div`,{className:`problem`,role:`alert`,...n?{"data-section-error":``}:{},children:[(0,dJ.jsx)(Pe,{name:`warning`,className:`problem-mark`}),(0,dJ.jsx)(`p`,{className:`problem-text`,children:s}),(0,dJ.jsx)(gG,{size:`compact`,className:`problem-retry`,onClick:l,children:fa(`problem.retry`)})]})}function cJ({mark:e,text:t,detail:n,action:r,className:i,role:a}){return(0,dJ.jsxs)(`div`,{className:i,...a?{role:a}:{},children:[e?(0,dJ.jsx)(Pe,{name:e,className:`empty-note-mark`}):null,(0,dJ.jsxs)(`p`,{className:`empty-note-text`,children:[t,n?(0,dJ.jsxs)(dJ.Fragment,{children:[` `,(0,dJ.jsx)(`span`,{className:`empty-note-detail`,children:n})]}):null]}),r?(0,dJ.jsx)(`div`,{className:`empty-note-action`,children:r}):null]})}function lJ({text:e,detail:t,action:n,className:r=``,mark:i=`tray`}){return(0,dJ.jsx)(cJ,{mark:i,text:e,detail:t,action:n,className:`empty-note${r?` ${r}`:``}`})}var uJ,dJ,fJ,pJ,mJ=s((()=>{uJ=d(m()),nJ(),ba(),yG(),Fe(),aJ(),sa(),dJ=d(O()),fJ=(0,uJ.createContext)(null),pJ=()=>typeof navigator>`u`||navigator.onLine!==!1}));function hJ({label:e,hint:t,problem:n,required:r=!1,id:i,group:a=!1,check:o=!1,size:s=`default`,kind:c,optional:l,labelAside:u,labelHidden:d=!1,reserve:f=!1,className:p=``,children:m}){let h=(0,_J.useId)(),g=i??`field-${h}`,_=t?`${g}-hint`:void 0,v=`${g}-problem`,y=n!=null&&n!==!1&&n!==``,b=`${g}-label`,x=d?`form-field-label form-field-label-hidden`:`form-field-label`,S=a?(0,vJ.jsx)(`span`,{id:b,className:x,children:e}):(0,vJ.jsx)(`label`,{id:b,htmlFor:g,className:x,children:e}),C=l&&!r?(0,vJ.jsx)(`span`,{className:`form-field-optional-word`,children:l}):null,w={id:g,..._||y?{"aria-describedby":[_,y?v:void 0].filter(Boolean).join(` `)}:{},...y?{"aria-invalid":!0}:{},...r?{"aria-required":!0}:{},...a?{"aria-labelledby":b}:{}},T=typeof m==`function`?m(w):(0,_J.isValidElement)(m)?(0,_J.cloneElement)(m,{...w,...gJ(m.props,w)}):m;return(0,vJ.jsxs)(`div`,{"data-kind":c,className:[`form-field`,s===`compact`?`form-field-compact`:``,o?`form-field-check`:``,f?`form-field-reserve`:``,r?`is-required`:``,y?`is-invalid`:``,p].filter(Boolean).join(` `),children:[o?(0,vJ.jsxs)(`div`,{className:`form-field-check-row`,children:[T,(0,vJ.jsx)(`label`,{id:b,htmlFor:g,className:`form-field-label`,children:e}),C]}):(0,vJ.jsxs)(vJ.Fragment,{children:[u||C?(0,vJ.jsxs)(`div`,{className:`form-field-label-row`,children:[S,C,u]}):S,T]}),t?(0,vJ.jsx)(`p`,{id:_,className:`form-field-hint`,children:t}):null,(0,vJ.jsx)(`p`,{id:v,className:`form-field-problem`,"aria-live":`polite`,hidden:!y&&!f,children:y?n:null})]})}function gJ(e,t){let n=[typeof e[`aria-describedby`]==`string`?e[`aria-describedby`]:``,t[`aria-describedby`]].filter(Boolean).join(` `);return n?{"aria-describedby":n}:{}}var _J,vJ,yJ=s((()=>{_J=d(m(),1),vJ=d(O(),1)})),bJ,xJ,SJ=s((()=>{bJ=d(m()),xJ=(0,bJ.createContext)(void 0)}));function CJ(e){let t=wJ.useContext(TJ);if(!e&&t===void 0)throw Error(LI(27));return t}var wJ,TJ,EJ=s((()=>{RI(),wJ=d(m(),1),TJ=wJ.createContext(void 0)})),DJ,OJ,kJ=s((()=>{DJ=d(m(),1),EJ(),TL(),lP(),OJ=DJ.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=CJ(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return gL(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:cP,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})})}));function AJ(){let e=jJ.useContext(MJ);if(e===void 0)throw Error(LI(26));return e}var jJ,MJ,NJ=s((()=>{RI(),jJ=d(m(),1),MJ=jJ.createContext(void 0)})),PJ,FJ=s((()=>{PJ=`--nested-dialogs`})),IJ,LJ=s((()=>{lP(),IJ=`data-nested-dialog-open`})),RJ,zJ=s((()=>{KN(),lP(),LJ(),RJ={...sP,...GN,nestedDialogOpen(e){return e?{[IJ]:``}:null}}})),BJ,VJ,HJ,UJ=s((()=>{BJ=d(m(),1),IB(),EJ(),TL(),NJ(),pz(),ZH(),Uz(),FJ(),zJ(),VJ=d(O(),1),HJ=BJ.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=CJ(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);AJ(),dz({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?mz(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=gL(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Dz,hidden:!m,onKeyDown(e){XH.has(e.key)&&e.stopPropagation()},style:{[PJ]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:RJ});return(0,VJ.jsx)(sR,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})})})),WJ,GJ,KJ,ane=s((()=>{WJ=d(m(),1),GV(),IB(),EJ(),NJ(),wH(),GJ=d(O(),1),KJ=WJ.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=CJ(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,GJ.jsx)(MJ.Provider,{value:n,children:(0,GJ.jsxs)(zL,{ref:t,...r,children:[a&&o===!0&&(0,GJ.jsx)(CH,{ref:i.context.internalBackdropRef,inert:WV(!s)}),e.children]})}):null})}));function one({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=qJ.useState(0),[u,d]=qJ.useState(0),f=c===0,p=mR(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=jN(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||AN(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return jH(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),Q(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),wz(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var qJ,sne=s((()=>{qJ=d(m(),1),eN(),LH(),IB(),XR(),Uz()}));function cne(e,t,n,r=!1){return{...jz(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function lne(e){return{popupRef:JJ.createRef(),backdropRef:JJ.createRef(),internalBackdropRef:JJ.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}var JJ,YJ,XJ,ZJ=s((()=>{JJ=d(m(),1),YR(),Uz(),YJ={...Lz,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},XJ=class extends KR{constructor(e,t,n){let r=new kz,i=cne(e,r,t,n);super(i,lne(r),YJ)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(yz(this.state,e,t.trigger)))}}}));function une(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=CJ(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=hz((e,t)=>new XJ({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);Tz(b,x),Sz(b);let{forceUnmount:w}=Cz(x,b);QJ.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,GP(HP))}),[w,b]);let T=x||S;return(0,$J.jsxs)(TJ.Provider,{value:b,children:[u&&(0,$J.jsx)(gz,{handle:u,store:b}),T&&(0,$J.jsx)(one,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var QJ,$J,dne=s((()=>{QJ=d(m(),1),sne(),EJ(),ZJ(),KP(),WP(),Uz(),$J=d(O(),1)})),eY,fne=s((()=>{BM(),dne(),eY=FM(function(e){return une(`dialog`,e)})})),pne=s((()=>{kJ(),EJ(),TL(),uU(),KP(),WP(),_V(),UJ(),ane(),fne(),NJ(),zJ(),RI(),BM(),mV(),lP(),jL(),Uz(),IB(),jV(),ZJ(),jR()})),mne=s((()=>{pne()}));function tY({className:e=``,onClose:t,closeDisabled:n=!1,beforeClose:r,children:i,initialFocus:a,finalFocus:o,ariaLabel:s,plain:c=!1,backdrop:l=!0,fullscreen:u=`mobile`,ref:d}){let f=(0,nY.useContext)(xJ),[p,m]=(0,nY.useState)(!0),h=(0,nY.useRef)(!1),g=()=>h.current||n||r?.()===!1?!1:(h.current=!0,m(!1),t(),!0);(0,nY.useImperativeHandle)(d,()=>({close:g}));let _=(0,nY.useId)(),[v,y]=(0,nY.useState)(),b=(0,nY.useCallback)(e=>{if(s||!e)return;let t=e.querySelector(`h1, h2, h3`);t&&(t.id||=_,y(t.id))},[s,_]),x=e.split(/\s+/)[0],S=x?`modal-backdrop ${x}-backdrop`:`modal-backdrop`,C=u?` modal-fullscreen${u===`mobile`?`-mobile`:``}`:``;return(0,rY.jsx)(eY,{modal:!0,open:p,onOpenChange:(e,t)=>{e||g()||t.cancel()},children:(0,rY.jsxs)(KJ,{container:pG(),children:[l?(0,rY.jsx)(OJ,{className:c?S.replace(`modal-backdrop `,``):S}):null,(0,rY.jsx)(HJ,{"data-component":f,className:`${c?e:`modal ${e}`.trim()}${C}`,initialFocus:a,...o?{finalFocus:o}:{},ref:b,"aria-label":s,"aria-labelledby":s?void 0:v,"aria-modal":`true`,children:i})]})})}var nY,rY,iY=s((()=>{nY=d(m(),1),SJ(),mne(),mG(),rY=d(O(),1)}));function aY(e,t){let n=e.lastIndexOf(`.`),r=n>0?e.slice(n+1).toLowerCase():``,i=(t??``).toLowerCase();if(oY.test(r)||/^image\/(png|jpeg|gif|webp|avif|bmp)$/.test(i))return`image`;if(r===`pdf`||i===`application/pdf`)return`pdf`;if(sY.test(r)||i.startsWith(`video/`))return`video`;if(cY.test(r)||i.startsWith(`audio/`))return`audio`;if(lY.test(r)||i.startsWith(`text/`)||i===`application/json`)return`text`}var oY,sY,cY,lY,uY=s((()=>{oY=/^(png|jpe?g|gif|webp|avif|bmp)$/,sY=/^(mp4|m4v|mov|webm|ogv)$/,cY=/^(mp3|m4a|wav|ogg|oga|opus|flac)$/,lY=/^(txt|text|md|markdown|csv|tsv|json|log|xml|ya?ml|ini|toml|sql|ts|js|css|html?)$/})),dY,hne=s((()=>{ba(),dY=pa({download:`Download`,isOverTheLimit:`“{name}” is over the {maxBytes} limit for a file.`,attached:`Attached “{attached}”`,attachedFiles:{one:`Attached {count} file`,other:`Attached {count} files`},attaching:`Attaching…`,orDropFilesHere:`or drop files here`,preview:`Preview {name}`,downloadName:`Download {name}`,more:`More for {name}`,detailsItem:`Details`,removeMore:`Remove…`,aFileNeedsAName:`A file needs a name.`,fileName:`File name`,removeName:`Remove {name}?`,removeQuotedNameQuestion:`Remove “{name}”?`,theFileIsDeleted:`The file is deleted for everyone who can see this record, and Undo cannot bring it back.`,keep:`Keep`,removing:`Removing…`})})),gne=s((()=>{})),fY,_ne=s((()=>{ba(),fY=pa({thisFileIsNoLonger:`This file is no longer here.`,thisFileCouldNotBeRead:`This file could not be read.`,thisFileIsNamed:`This file is named as a PDF, but it is not one.`,thisFileIsNotText:`This file is not text, so it can only be downloaded.`,thisFileIsNotPlayable:`This file is not a recording this browser can play, so it can only be downloaded.`,tooLargeToPlay:`Recordings over {size} are not played here. Download the file to play it.`,tooLargeToShow:`PDFs over {size} are not shown here. Download the file to open it.`,opening:`Opening {name}…`,showingTheFirstDownload:`Showing the first {size}. Download the file for the rest.`,previewOf:`Preview of {name}`,download:`Download`})})),pY=l({FilePreview:()=>bne,mediaType:()=>mY});function mY(e,t){if(!(e.length<12)){if(bY(e,4,4)===`ftyp`)return t===`video`?`video/mp4`:`audio/mp4`;if(e[0]===26&&e[1]===69&&e[2]===223&&e[3]===163)return`${t}/webm`;if(bY(e,0,4)===`OggS`)return`${t}/ogg`;if(t===`audio`){if(bY(e,0,4)===`RIFF`&&bY(e,8,4)===`WAVE`)return`audio/wav`;if(bY(e,0,4)===`fLaC`)return`audio/flac`;if(bY(e,0,3)===`ID3`||e[0]===255&&(e[1]&224)==224)return`audio/mpeg`}}}async function vne(e,t,n,r){if(!e.body){let r=new Uint8Array(await e.arrayBuffer());return r.length>t?{bytes:n?r.subarray(0,t):new Uint8Array,over:!0}:{bytes:r,over:!1}}let i=e.body.getReader(),a=()=>void i.cancel().catch(()=>void 0);r.addEventListener(`abort`,a,{once:!0});let o=[],s=0,c=!1;try{for(;;){let{done:e,value:r}=await i.read();if(e)break;let a=t-s;if(r.length>a){c=!0,n&&a>0&&o.push(r.subarray(0,a));break}o.push(r),s+=r.length}}finally{r.removeEventListener(`abort`,a),c?await i.cancel().catch(()=>void 0):i.releaseLock()}if(c&&!n)return{bytes:new Uint8Array,over:c};let l=new Uint8Array(o.reduce((e,t)=>e+t.length,0)),u=0;for(let e of o)l.set(e,u),u+=e.length;return{bytes:l,over:c}}async function yne(e,t){let n=await fetch(e.href,{credentials:`same-origin`,signal:t});if(!n.ok)return{state:`failed`,why:n.status===404?fY(`thisFileIsNoLonger`):fY(`thisFileCouldNotBeRead`)};let r=e.kind===`video`||e.kind===`audio`||e.kind===`pdf`,i=()=>({state:`refused`,why:fY(e.kind===`pdf`?`tooLargeToShow`:`tooLargeToPlay`,{size:Ti(_Y)})});if(r&&Number(n.headers.get(`content-length`))>_Y)return n.body?.cancel().catch(()=>void 0),i();let{bytes:a,over:o}=await vne(n,r?_Y:vY,!r,t);if(r&&o)return i();if(e.kind===`video`||e.kind===`audio`){let t=mY(a,e.kind);return t?{state:`media`,url:URL.createObjectURL(new Blob([a],{type:t}))}:{state:`refused`,why:fY(`thisFileIsNotPlayable`)}}return e.kind===`pdf`?yY(a)?{state:`pdf`,url:URL.createObjectURL(new Blob([a],{type:`application/pdf`}))}:{state:`refused`,why:fY(`thisFileIsNamed`)}:a.includes(0)?{state:`refused`,why:fY(`thisFileIsNotText`)}:{state:`text`,text:new TextDecoder(`utf-8`).decode(a),cut:o}}function bne({file:e,onClose:t,finalFocus:n}){let r=(0,hY.useRef)(null),i=(0,hY.useRef)(null),[a,o]=(0,hY.useState)({state:`loading`}),[s,c]=(0,hY.useState)(0);(0,hY.useEffect)(()=>{if(e.kind===`image`)return;let t=new AbortController,n;return o({state:`loading`}),yne(e,t.signal).then(e=>{(e.state===`pdf`||e.state===`media`)&&(n=e.url),t.signal.aborted?n&&URL.revokeObjectURL(n):o(e)},e=>{t.signal.aborted||o({state:`failed`,why:e.message||fY(`thisFileCouldNotBeRead`)})}),()=>{t.abort(),n&&URL.revokeObjectURL(n)}},[e.href,e.kind,s]);let l=e.kind===`image`?(0,gY.jsx)(`figure`,{className:`lightbox-figure`,children:(0,gY.jsx)(`img`,{className:`lightbox-image`,src:e.inline??e.href,alt:e.name,draggable:!1})}):a.state===`loading`?(0,gY.jsx)(`p`,{className:`file-preview-note`,role:`status`,children:fY(`opening`,{name:e.name})}):a.state===`pdf`?(0,gY.jsx)(`iframe`,{className:`file-preview-frame`,src:a.url,title:e.name}):a.state===`media`?e.kind===`video`?(0,gY.jsx)(`video`,{className:`file-preview-media`,src:a.url,controls:!0,"aria-label":e.name}):(0,gY.jsx)(`audio`,{className:`file-preview-media is-audio`,src:a.url,controls:!0,"aria-label":e.name}):a.state===`text`?(0,gY.jsxs)(`div`,{className:`file-preview-text`,children:[(0,gY.jsx)(`pre`,{tabIndex:0,"aria-label":e.name,children:a.text}),a.cut&&(0,gY.jsx)(`p`,{className:`file-preview-note`,children:fY(`showingTheFirstDownload`,{size:Ti(vY)})})]}):(0,gY.jsx)(`div`,{className:`file-preview-message`,children:a.state===`refused`?(0,gY.jsx)(lJ,{text:a.why}):(0,gY.jsx)(sJ,{text:a.why,retry:()=>c(e=>e+1)})});return(0,gY.jsx)(tY,{className:`lightbox file-preview`,plain:!0,ref:r,ariaLabel:fY(`previewOf`,{name:e.name}),initialFocus:i,onClose:t,...n?{finalFocus:n}:{},children:(0,gY.jsxs)(`div`,{className:`lightbox-body`,children:[(0,gY.jsxs)(`div`,{className:`lightbox-bar`,children:[(0,gY.jsx)(`span`,{className:`file-preview-name`,children:e.name}),(0,gY.jsxs)(`span`,{className:`file-preview-actions`,children:[(0,gY.jsx)(`a`,{className:`lightbox-close file-preview-download`,href:e.href,download:e.name,children:fY(`download`)}),(0,gY.jsx)(`button`,{type:`button`,ref:i,className:`lightbox-close`,onClick:()=>r.current?.close(),children:fY(`common.close`)})]})]}),(0,gY.jsx)(`div`,{className:`lightbox-stage file-preview-stage is-${e.kind}`,children:l})]})})}var hY,gY,_Y,vY,yY,bY,xY=s((()=>{hY=d(m(),1),gne(),iY(),mJ(),Yi(),_ne(),gY=d(O(),1),_Y=67108864,vY=262144,yY=e=>e.length>=5&&String.fromCharCode(...e.subarray(0,5))===`%PDF-`,bY=(e,t,n)=>String.fromCharCode(...e.subarray(t,t+n))})),xne=l({AttachmentList:()=>Cne,fileToBase64:()=>Sne});async function Sne(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}function Cne({items:e,emptyText:t,empty:n,upload:r}){let[i,a]=(0,SY.useState)(!1),[o,s]=(0,SY.useState)(!1),[c,l]=(0,SY.useState)(),u=(0,SY.useRef)(null),[d,f]=(0,SY.useState)(),[p,m]=(0,SY.useState)(),[h,g]=(0,SY.useState)(),_=(0,SY.useRef)(null),v=async e=>{if(!r||o||!e.length)return;s(!0),l(void 0);let t=[],n=[];for(let i of e){if(i.size>r.maxBytes){n.push(dY(`isOverTheLimit`,{name:i.name,maxBytes:Ti(r.maxBytes)}));continue}let e=await r.send(i);e?n.push(e):t.push(i.name)}s(!1),n.length?l({text:n.join(` `),error:!0}):l({text:t.length===1?dY(`attached`,{attached:t[0]}):dY(`attachedFiles`,{count:t.length}),error:!1})},y=e=>e.includes(`Files`),b=e=>{if(e.save)return;let t=aY(e.name,e.type);return t?{name:e.name,kind:t,href:e.href,...e.inline?{inline:e.inline}:{}}:void 0};return(0,CY.jsxs)(`div`,{className:`attachments${i?` is-over`:``}`,onDragOver:r?e=>{y([...e.dataTransfer.types])&&(e.preventDefault(),a(!0))}:void 0,onDragLeave:r?e=>{e.currentTarget.contains(e.relatedTarget)||a(!1)}:void 0,onDrop:r?e=>{e.preventDefault(),a(!1),v([...e.dataTransfer.files])}:void 0,children:[r&&(0,CY.jsxs)(`div`,{className:`attachments-add`,children:[(0,CY.jsx)(gG,{intent:`secondary`,size:`compact`,busy:o,busyLabel:dY(`attaching`),onClick:()=>u.current?.click(),children:`+ ${r.label}`}),(0,CY.jsx)(`input`,{ref:u,type:`file`,multiple:!0,hidden:!0,"aria-label":r.label,onChange:e=>{let t=[...e.target.files??[]];e.target.value=``,v(t)}}),(0,CY.jsx)(`span`,{className:`attachments-hint`,children:dY(`orDropFilesHere`)}),c&&(0,CY.jsx)(`span`,{role:c.error?`alert`:`status`,className:c.error?`attachments-error`:`attachments-said`,children:c.text})]}),e.length?(0,CY.jsx)(`ul`,{className:`attachments-list`,children:e.map(e=>{let t=b(e);return(0,CY.jsxs)(`li`,{className:`attachments-item`,children:[(0,CY.jsx)(`span`,{className:`attachments-badge`,"aria-hidden":`true`,children:EY(e.name)}),p===e.id&&e.rename?(0,CY.jsx)(wne,{item:e,onDone:()=>m(void 0)}):(0,CY.jsxs)(CY.Fragment,{children:[(0,CY.jsxs)(`span`,{className:`attachments-text`,children:[t?(0,CY.jsx)(`button`,{type:`button`,className:`attachments-name`,title:dY(`preview`,{name:e.name}),onClick:e=>{_.current=e.currentTarget,f(t)},children:e.name}):(0,CY.jsx)(`a`,{className:`attachments-name`,href:e.href,download:e.name,onClick:TY(e),children:e.name}),e.meta.length>0&&(0,CY.jsx)(`span`,{className:`attachments-meta`,children:e.meta.join(` · `)})]}),(0,CY.jsxs)(`span`,{className:`attachments-actions`,children:[(0,CY.jsx)(`a`,{className:hG({intent:`quiet`,size:`compact`,className:`attachments-download`}),href:e.href,download:e.name,onClick:TY(e),"aria-label":dY(`downloadName`,{name:e.name}),children:dY(`download`)}),(e.onOpen||e.rename||e.remove)&&(0,CY.jsxs)(bG,{className:`row-actions-menu`,triggerClassName:`ghost row-actions-trigger`,triggerTitle:dY(`more`,{name:e.name}),triggerLabel:dY(`more`,{name:e.name}),label:`⋯`,popupClassName:`page-actions-popup`,align:`end`,children:[e.onOpen&&(0,CY.jsx)(xG,{className:`page-actions-item`,onClick:e.onOpen,children:dY(`detailsItem`)}),e.rename&&(0,CY.jsx)(xG,{className:`page-actions-item`,onClick:()=>m(e.id),children:dY(`common.rename`)}),e.remove&&(0,CY.jsx)(xG,{className:`page-actions-item is-danger`,onClick:()=>g(e),children:dY(`removeMore`)})]})]})]})]},e.id)})}):n??(0,CY.jsx)(lJ,{className:`attachments-empty`,text:t}),d&&(0,CY.jsx)(wY,{file:d,onClose:()=>f(void 0),finalFocus:_}),h&&(0,CY.jsx)(Tne,{item:h,onClose:()=>g(void 0)})]})}function wne({item:e,onDone:t}){let[n,r]=(0,SY.useState)(e.name),[i,a]=(0,SY.useState)(!1),[o,s]=(0,SY.useState)(``),c=async()=>{let r=n.trim();if(!r){s(dY(`aFileNeedsAName`));return}if(r===e.name){t();return}a(!0);let i=await e.rename(r);a(!1),i?s(i):t()};return(0,CY.jsxs)(`form`,{className:`attachments-rename`,onSubmit:e=>{e.preventDefault(),c()},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),t())},children:[(0,CY.jsx)(hJ,{label:dY(`fileName`),size:`compact`,problem:o,children:(0,CY.jsx)(`input`,{type:`text`,value:n,autoFocus:!0,onChange:e=>{r(e.target.value),s(``)}})}),(0,CY.jsxs)(`span`,{className:`attachments-rename-actions`,children:[(0,CY.jsx)(gG,{intent:`primary`,size:`compact`,type:`submit`,busy:i,busyLabel:dY(`common.saving`),children:dY(`common.save`)}),(0,CY.jsx)(gG,{intent:`secondary`,size:`compact`,onClick:t,children:dY(`common.cancel`)})]})]})}function Tne({item:e,onClose:t}){let n=(0,SY.useRef)(null),r=(0,SY.useRef)(null),[i,a]=(0,SY.useState)(!1),[o,s]=(0,SY.useState)(``),c=async()=>{a(!0);let t=await e.remove();a(!1),t?s(t):n.current?.close()};return(0,CY.jsxs)(tY,{className:`confirm attachments-confirm`,ref:n,fullscreen:!1,initialFocus:r,closeDisabled:i,ariaLabel:dY(`removeName`,{name:e.name}),onClose:t,children:[(0,CY.jsx)(`h2`,{children:dY(`removeQuotedNameQuestion`,{name:e.name})}),(0,CY.jsx)(`p`,{children:dY(`theFileIsDeleted`)}),o&&(0,CY.jsx)(`p`,{className:`attachments-error`,role:`alert`,children:o}),(0,CY.jsxs)(`div`,{className:`confirm-actions`,children:[(0,CY.jsx)(gG,{ref:r,intent:`secondary`,disabled:i,onClick:()=>n.current?.close(),children:dY(`keep`)}),(0,CY.jsx)(gG,{intent:`danger`,busy:i,busyLabel:dY(`removing`),onClick:()=>void c(),children:dY(`common.remove`)})]})]})}var SY,CY,wY,TY,EY,Ene=s((()=>{SY=d(m()),Yi(),Es(),mJ(),yG(),yJ(),iY(),wG(),uY(),Ys(),hne(),CY=d(O()),wY=Us(()=>Promise.resolve().then(()=>(xY(),pY)),`FilePreview`,{quiet:!0}),TY=e=>e.save?t=>{t.preventDefault(),e.save().catch(e=>hs(e.message,`error`))}:void 0,EY=e=>{let t=e.lastIndexOf(`.`);return(t>0?e.slice(t+1).slice(0,4).toUpperCase():``)||`FILE`}}));function Dne(e){return(0,DY.jsx)(`div`,{className:`rich-field`,children:(0,DY.jsx)(OY,{...e})})}function One(e,t){return async n=>{let r=n.trim(),{mentionRows:i}=await Promise.resolve().then(()=>(YG(),UG)),[a,o]=await Promise.all([i(e,r,t),e.groups?i(e.groups,r,t,`group`).catch(()=>[]):Promise.resolve([])]);return o.length?[...a.slice(0,8-Math.min(o.length,3)),...o].slice(0,8):a}}function kne(e,t,n){if(!e||!t||!bs(e))return;let r=xs(e).find(e=>e.to.table===t.table&&e.from.columns.length===1&&Object.hasOwn(t.key,e.to.columns[0]));if(!r)return;let i={[r.from.columns[0]]:t.key[r.to.columns[0]]};return async t=>{let{fileToBase64:r}=await Promise.resolve().then(()=>(Ene(),xne)),a=await rs(`/api/file/upload`,{table:e,values:i,...Aa(n??null),file:{name:t.name||`picture`,type:t.type,data:await r(t)}});if(a.errors?.length)throw Error(a.errors[0].message);if(typeof a.error==`string`)throw Error(a.error);if(!a.key)throw Error(Xs(`pictureUnread`));return _r(e,a.key)}}var DY,OY,Ane=s((()=>{Es(),Fa(),Dr(),Ys(),Zs(),DY=d(O(),1),OY=Us(()=>Promise.resolve().then(()=>(LG(),OG)),`RichTextEditor`,{quiet:!0})}));function kY(e){let t=AY.useRef(!0);t.current&&(t.current=!1,e())}var AY,jY=s((()=>{AY=d(m(),1)}));function MY(){let e=FY.useContext(IY);if(e===void 0)throw Error(LI(60));return e}function NY(){let e=FY.useContext(LY);if(e===void 0)throw Error(LI(101));return e}function PY(){let e=FY.useContext(RY);if(e===void 0)throw Error(LI(61));return e}var FY,IY,LY,RY,zY=s((()=>{RI(),FY=d(m(),1),IY=FY.createContext(void 0),LY=FY.createContext(void 0),RY=FY.createContext(void 0)})),BY=s((()=>{WM()})),VY,HY,jne=s((()=>{VY=`data-valid`,HY=`data-invalid`})),UY,WY,GY,KY,qY=s((()=>{jne(),UY={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},WY={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},GY={disabled:!1,...WY},KY={valid(e){return e===null?null:e?{[VY]:``}:{[HY]:``}}}}));function JY(e=!0){let t=YY.useContext(ZY);if(t.setValidityData===VM&&!e)throw Error(LI(28));return t}var YY,XY,ZY,QY=s((()=>{RI(),YY=d(m(),1),WM(),BY(),qY(),XY={invalid:void 0,name:void 0,validityData:{state:UY,errors:[],error:``,value:``,initialValue:null},setValidityData:VM,disabled:void 0,setTouched:VM,setDirty:VM,setFilled:VM,setFocused:VM,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:GY,registerFieldControl:VM,validation:{getValidationProps:(e,t=UM)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:VM,getInputControl:()=>null,commit:async()=>{},change:VM}},ZY=YY.createContext(XY)}));function $Y(e,t,n,r,i=!0,a){let{registerFieldControl:o}=JY(),s=jM(()=>Symbol());Q(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),Q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var eX=s((()=>{eN(),PM(),QY()}));function tX(){return nX.useContext(rX)}var nX,rX,iX=s((()=>{nX=d(m(),1),BY(),rX=nX.createContext({controlId:void 0,registerControlId:VM,resetControlId:VM,labelId:void 0,setLabelId:VM,messageIds:[],setMessageIds:VM,getDescriptionProps:e=>e})}));function aX(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=tX(),o=gV(),s=jM(()=>Symbol()),c=oX.useRef(!1),l=oX.useRef(!1),u=$(()=>{c.current&&i!==VM&&(c.current=!1,i(s.current,void 0))});return Q(()=>{if(!n||i===VM){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),Q(()=>u,[u]),(n?r:void 0)??t??o}var oX,sX=s((()=>{oX=d(m(),1),eN(),mF(),PM(),BY(),_V(),iX()}));function Mne(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var Nne=s((()=>{}));function cX(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function lX(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Mne(e,t,(e,t)=>cX(e,t,n)):e!==t}function uX(e,t,n){return e?e.some(e=>e!==void 0&&cX(t,e,n)):!1}function dX(e,t,n){return e?e.findIndex(e=>e!==void 0&&cX(e,t,n)):-1}function fX(e,t){if(t!==gX)return n=>uX(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function pX(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(fX(t,n)):dX(e,t,n);return i===-1?null:i}function mX(e,t,n,r,i,a){return uX(r,t,i)?a!=null&&e>a&&uX(r,n[a],i)?a:e:e===a?pX(n,r,i,!0):a}function hX(e,t,n){return e.filter(e=>!cX(t,e,n))}var gX,_X=s((()=>{Nne(),gX=(e,t)=>Object.is(e,t)}));function vX(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var yX=s((()=>{}));function bX(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function xX(e){return bX(e?.[0])}function SX(e){return xX(e)?e.flatMap(e=>e.items):e}function CX(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(xX(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function wX(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return vX(e)}function TX(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?vX(e.value):vX(e)}var EX=s((()=>{m(),yX(),O()})),DX,OX=s((()=>{_X(),EX(),DX={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:TX(t,r)!==``},hasNullItemLabel:(e,t)=>t?CX(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>cX(t,e,n)):cX(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows}}));function kX(){return AX.useContext(jX)}var AX,jX,MX=s((()=>{AX=d(m(),1),BY(),jX=AX.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:VM,validationMode:`onSubmit`,submitCountRef:{current:0}})}));function NX(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var PX=s((()=>{}));function FX(e,t){return Math.max(0,e-t)}function IX(e,t){if(t<=0)return 0;let n=NX(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}var LX=s((()=>{PX()}));function RX(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=gX,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=kX(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=JY(),F=aX({id:t}),I=M||d,L=j??c,[R,z]=jU({controlled:n,default:y?r??HM:r,name:`Select`,state:`value`}),[B,V]=jU({controlled:a,default:o,name:`Select`,state:`open`}),H=zX.useRef([]),U=zX.useRef([]),W=zX.useRef(null),G=zX.useRef(null),ee=zX.useRef(0),te=zX.useRef(null),ne=zX.useRef([]),K=zX.useRef(!1),re=zX.useRef(null),q=zX.useRef(null),ie=zX.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ae=zX.useRef(!1),oe=zX.useRef(R),{mounted:se,setMounted:ce,transitionStatus:le}=rz(B),{openMethod:ue,triggerProps:de}=kV(B),fe=jM(()=>new KR({id:F,labelId:void 0,modal:m,multiple:y,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:R,open:B,mounted:se,transitionStatus:le,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:UM,triggerProps:UM,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:VM,setOpen:VM,handleScrollArrowVisibility:VM,onOpenChangeComplete:VM,listRef:H,popupRef:W,scrollHandlerRef:G,scrollArrowsMountedCountRef:ee,valueRef:te,valuesRef:ne,labelsRef:U,typingRef:K,selectionRef:ie,firstItemTextRef:re,selectedItemTextRef:q,alignItemWithTriggerActiveRef:ae,initialValueRef:oe},DX)).current,pe=fe.useState(`activeIndex`),me=fe.useState(`selectedIndex`),J=fe.useState(`triggerElement`),he=fe.useState(`positionerElement`),ge=dU(ue),_e=ue??ge,ve=zX.useMemo(()=>y?``:TX(R,x),[y,R,x]),ye=zX.useMemo(()=>y&&Array.isArray(R)?R.map(e=>TX(e,x)):TX(R,x),[y,R,x]);$Y(iF(J),F,R,$(()=>ye),!I,c);let be=y?Array.isArray(R)&&R.length>0:R!=null&&ve!==``;Q(()=>{A(be)},[be,A]),Q(function(){let e=pX(ne.current,R,S,y);e===null&&(q.current=null),!B&&fe.set(`selectedIndex`,e)},[y,B,R,S,fe]),TV(R,()=>{T(L),E(lX(R,k.initialValue,S)),N.change(R)});let xe=$((e,t)=>{s?.(e,t),!t.isCanceled&&(V(e),e||t.reason!==`focus-out`&&t.reason!==`outside-press`||(D(!0),O(!1),P===`onBlur`&&N.commit(R)))}),Se=$(()=>{ce(!1),fe.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});dz({enabled:!h,open:B,ref:W,onComplete(){B||Se()}}),zX.useImperativeHandle(h,()=>({unmount:Se}),[Se]);let Ce=$((e,t)=>{i?.(e,t),!t.isCanceled&&z(e)}),we=$(e=>{let t=FX(e.scrollHeight,e.clientHeight),n=IX(e.scrollTop,t),r=n>0,i=n<t;fe.set(`scrollUpArrowVisible`,r),fe.set(`scrollDownArrowVisible`,i)}),Te=Wz({open:B,onOpenChange:xe,elements:{reference:J,floating:he}}),Ee=fR(Te,{enabled:!I,event:`mousedown`}),De=mR(Te),Oe=bB(Te,{enabled:!I,listRef:H,activeIndex:pe,selectedIndex:me,disabledIndices:HM,onNavigate(e){(e!==null||B)&&fe.set(`activeIndex`,e)},focusItemOnHover:C}),ke=wB(Te,{enabled:!I&&(B||!f&&!y),listRef:U,activeIndex:pe,selectedIndex:me,disabledIndices:e=>cG(H.current[e]),onMatch(e){B?fe.set(`activeIndex`,e):Ce(ne.current[e],GP(TP))},onTyping(e){K.current=e}}),Ae=zX.useMemo(()=>$I(ke.reference,Oe.reference,De.reference,Ee.reference,de),[Ee.reference,ke.reference,Oe.reference,De.reference,de]),je=zX.useMemo(()=>$I(Dz,ke.floating,Oe.floating,De.floating),[ke.floating,Oe.floating,De.floating]),Me=Oe.item??UM;fe.useContextCallback(`setValue`,Ce),fe.useContextCallback(`setOpen`,xe),fe.useContextCallback(`handleScrollArrowVisibility`,we),fe.useContextCallback(`onOpenChangeComplete`,_),kY(()=>{fe.update({popupProps:je,triggerProps:Ae})}),fe.useSyncedValues({id:F,modal:m,multiple:y,value:R,open:B,mounted:se,transitionStatus:le,popupProps:je,triggerProps:Ae,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:_e});let Ne=zX.useMemo(()=>({disabled:I,readOnly:f,required:p,multiple:y,highlightItemOnHover:C,itemProps:Me}),[I,f,p,y,C,Me]),Pe=ZP(g,N.inputRef),Fe=y?void 0:L,Ie=zX.useMemo(()=>!y||!Array.isArray(R)||!L?null:R.map(e=>{let t=TX(e,x);return(0,BX.jsx)(`input`,{type:`hidden`,form:l,name:L,value:t,disabled:I},t)}),[y,R,l,L,x,I]);return(0,BX.jsxs)(IY.Provider,{value:fe,children:[(0,BX.jsx)(LY.Provider,{value:Ne,children:(0,BX.jsx)(RY.Provider,{value:Te,children:w})}),(0,BX.jsx)(`input`,{...N.getValidationProps(I,{onFocus(){fe.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||I||f)return;let t=e.currentTarget.value,n=GP(TP,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=ne.current.findIndex(t=>TX(t,x).toLowerCase()===e||wX(t,b).toLowerCase()===e);r===-1&&(r=ne.current.findIndex((t,n)=>{let r=U.current[n];return r!=null&&r.toLowerCase()===e}));let i=ne.current[r];i!=null&&Ce(i,n)}fe.set(`forceMount`,!0),queueMicrotask(r)}}),id:F&&Fe==null?`${F}-hidden-input`:void 0,form:l,name:Fe,autoComplete:u,value:ve,disabled:I,required:p&&!(y&&be),readOnly:f,ref:Pe,style:L?TF:wF,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ie]})}var zX,BX,VX=s((()=>{zX=d(m(),1),EF(),rF(),PM(),jY(),pU(),lG(),NU(),eN(),mF(),oF(),YR(),WM(),IB(),zY(),QY(),eX(),sX(),az(),OX(),KP(),WP(),pz(),MX(),EX(),_X(),DV(),jV(),LX(),Uz(),hL(),BY(),BX=d(O(),1)}));function HX(e,t){return e??t}var UX=s((()=>{})),WX,GX=s((()=>{lP(),WX=`data-popup-side`})),KX,qX,JX,YX,XX=s((()=>{KX=d(m(),1),SF(),ZM(),oF(),zY(),QY(),iX(),lP(),qY(),TL(),GW(),XR(),hL(),uU(),KP(),WP(),sX(),UX(),GX(),qX=400,JX={...oP,...KY,popupSide:e=>e?{[WX]:e}:null,value:()=>null},YX=KX.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,validation:f,state:p,disabled:m}=JY(),{labelId:h}=tX(),g=MY(),{readOnly:_,required:v,disabled:y}=NY(),b=m||y||a,x=g.useState(`open`),S=g.useState(`mounted`),C=g.useState(`value`),w=g.useState(`triggerProps`),T=g.useState(`positionerElement`),E=g.useState(`listElement`),D=g.useState(`popupSide`),O=g.useState(`id`),k=g.useState(`labelId`),A=g.useState(`hasSelectedValue`),j=S&&T?D:null,M=i??O,N=HX(h,k);aX({id:i});let P=iF(T),F=KX.useRef(null),{getButtonProps:I,buttonRef:L}=uV({disabled:b,native:o}),R=g.useStateSetter(`triggerElement`),z=JM(),B=JM(),V=JM();KX.useEffect(()=>{if(x)return V.start(qX,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{V.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},B.clear()},[x,g,B,V]);let H=$I(w,{id:M,role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-controls":x?E?.id??_P(T)?.id:void 0,"aria-labelledby":N,"aria-readonly":_||void 0,"aria-required":v||void 0,tabIndex:b?-1:0,onFocus(e){u(!0),x&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,GP(TP,e.nativeEvent)),z.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){AN(T,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&f.commit(C))},onMouseDown(e){if(x)return;let t=xF(e.currentTarget);function n(e){if(!F.current)return;let t=e.target;AN(F.current,t)||AN(P.current,t)||HW(e,F.current)||g.context.setOpen(!1,GP(BP,e))}B.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,I),U=f.getValidationProps(b,H);U.role=`combobox`;let W={...p,open:x,disabled:b,value:C,readOnly:_,popupSide:j,placeholder:!A};return gL(`button`,e,{ref:[t,F,L,R],state:W,stateAttributesMapping:JX,props:U})})})),ZX,QX,$X,eZ=s((()=>{ZX=d(m(),1),IB(),zY(),QX=d(O(),1),$X=ZX.forwardRef(function(e,t){let n=MY(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,QX.jsx)(zL,{ref:t,...e}):null})}));function tZ(){let e=nZ.useContext(rZ);if(!e)throw Error(LI(59));return e}var nZ,rZ,iZ=s((()=>{RI(),nZ=d(m(),1),rZ=nZ.createContext(void 0)}));function aZ(e,t){e&&Object.assign(e.style,t)}var oZ,sZ=s((()=>{oZ={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`}})),cZ,lZ,uZ,dZ,fZ=s((()=>{cZ=d(m(),1),GV(),eN(),mF(),zY(),vW(),bH(),iZ(),wH(),jL(),sZ(),KP(),WP(),_X(),OH(),VH(),lZ=d(O(),1),uZ={position:`fixed`},dZ=cZ.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=OL,style:_,...v}=e,y=MY(),b=PY(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`modal`),w=y.useState(`value`),T=y.useState(`openMethod`),E=y.useState(`positionerElement`),D=y.useState(`triggerElement`),O=y.useState(`isItemEqualToValue`),k=y.useState(`transitionStatus`),A=cZ.useRef(null),j=cZ.useRef(null),[M,N]=cZ.useState(h),P=S&&M&&T!==`touch`;!S&&M!==h&&N(h),cZ.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>P),RH((P||C)&&x,T===`touch`,E,D);let F=hH({anchor:n,floatingRootContext:b,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??P,collisionAvoidance:g,keepMounted:!0}),I=P?`none`:F.side,L=P?uZ:F.positionerStyles,R={open:x,side:I,align:F.align,anchorHidden:F.anchorHidden};Q(()=>{y.set(`popupSide`,F.side)},[y,F.side]);let z=DH(e,R,{styles:L,transitionStatus:k,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x}),B=cZ.useRef(0),V=$(e=>{if(y.context.valuesRef.current.length===0)return;let t=B.current;B.current=e.size;let n=GP(TP);if(t!==0&&!y.state.multiple&&w!==null&&dX(y.context.valuesRef.current,w,O)===-1){let e=y.context.initialValueRef.current,t=e!=null&&dX(y.context.valuesRef.current,e,O)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(w)){let e=w.filter(e=>dX(y.context.valuesRef.current,e,O)!==-1);e.length!==w.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&P){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};aZ(E,e),aZ(y.context.popupRef.current,e)}}),H=cZ.useMemo(()=>({...F,side:I,alignItemWithTriggerActive:P,setControlledAlignItemWithTrigger:N,scrollUpArrowRef:A,scrollDownArrowRef:j}),[F,I,P,N]);return(0,lZ.jsx)(lW,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:V,children:(0,lZ.jsxs)(rZ.Provider,{value:H,children:[S&&C&&(0,lZ.jsx)(CH,{inert:WV(!x),cutout:D}),z]})})})})),pZ,mZ,hZ,gZ=s((()=>{pZ=d(O(),1),mZ=`base-ui-disable-scrollbar`,hZ={className:mZ,getElement(e){return(0,pZ.jsx)(`style`,{nonce:e,href:mZ,precedence:`base-ui:low`,children:`.${mZ}{scrollbar-width:none}.${mZ}::-webkit-scrollbar{display:none}`})}}}));function _Z(){return vZ.useContext(yZ)??bZ}var vZ,yZ,bZ,xZ=s((()=>{vZ=d(m(),1),yZ=vZ.createContext(void 0),bZ={disableStyleElements:!1}})),SZ,CZ=s((()=>{SZ=`--transform-origin`}));function wZ(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function TZ(e){return FX(e.scrollHeight,e.clientHeight)}function EZ(e){return aM.getScale(e)}function DZ(e,t,n){return e/n[t]}function OZ(e,t){return FA({x:DZ(e.x,`x`,t),y:DZ(e.y,`y`,t),width:DZ(e.width,`x`,t),height:DZ(e.height,`y`,t)})}function kZ(e){let{style:t}=e,n={};for(let[e,r]of PZ)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of PZ){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var AZ,jZ,MZ,NZ,PZ,FZ=s((()=>{AZ=d(m(),1),KA(),JP(),SN(),mF(),SF(),eN(),bF(),PX(),IB(),zY(),lP(),iZ(),gZ(),KN(),pz(),TL(),sZ(),KP(),WP(),tU(),ZH(),EH(),LX(),xZ(),$V(),CZ(),jZ=d(O(),1),MZ={...sP,...GN},NZ=AZ.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=MY(),{multiple:c,readOnly:l,highlightItemOnHover:u}=NY(),d=PY(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=tZ(),_=QH(!0)!=null,v=XV(),{nonce:y,disableStyleElements:b}=_Z(),x=s.useState(`id`),S=s.useState(`open`),C=s.useState(`openMethod`),w=s.useState(`mounted`),T=s.useState(`popupProps`),E=s.useState(`transitionStatus`),D=s.useState(`triggerElement`),O=s.useState(`positionerElement`),k=s.useState(`listElement`),A=AZ.useRef(!1),j=AZ.useRef(!1),M=AZ.useRef({}),N=hF(),P=$(e=>{if(!O||!s.context.popupRef.current||!j.current)return;let t=O.style.top===`0px`,n=O.style.bottom===`0px`;if(A.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=EZ(O),i=DZ(O.getBoundingClientRect().height,`y`,r),a=xF(O),o=sj(O),c=o.getComputedStyle(O),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=wZ(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=TZ(e),g=null,_=e=>{O.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=NX(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(A.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=NX(g,0,TZ(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(A.current=!0),s.context.handleScrollArrowVisibility(e)});AZ.useImperativeHandle(s.context.scrollHandlerRef,()=>P,[P]),dz({open:S,ref:s.context.popupRef,onComplete(){S&&s.context.onOpenChangeComplete(!0)}});let F={open:S,transitionStatus:E,side:f,align:p};Q(()=>{O&&s.context.popupRef.current&&!Object.keys(M.current).length&&(M.current={top:O.style.top||`0`,left:O.style.left||`0`,right:O.style.right,height:O.style.height,bottom:O.style.bottom,minHeight:O.style.minHeight,maxHeight:O.style.maxHeight,marginTop:O.style.marginTop,marginBottom:O.style.marginBottom})},[s,O]),Q(()=>{S||m||(j.current=!1,A.current=!1,aZ(O,M.current))},[S,m,O]),Q(()=>{let e=s.context.popupRef.current;if(!S||!D||!O||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(j.current=!0,e.style.removeProperty(SZ),!m){N.request(()=>s.context.handleScrollArrowVisibility(k||e));return}let t=kZ(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=sj(O),i=r.getComputedStyle(O),a=r.getComputedStyle(e),o=xF(D),c=EZ(D),l=OZ(D.getBoundingClientRect(),c),d=OZ(O.getBoundingClientRect(),c),f=l.height,p=k||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=wZ(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,j=0;if(t&&n){let e=OZ(n.getBoundingClientRect(),c);T=OZ(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;j=T.top-d.top+T.height/2-r}let N=w+j+y+h,P=Math.min(S,N),F=S-_-y,I=N-P,L=C-5;O.style.left=`${NX(E,5,L-d.width)}px`,O.style.height=`${P}px`,O.style.maxHeight=`none`,O.style.marginTop=`${_}px`,O.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=TZ(p),z=I>=R-1;z&&(P=Math.min(S,d.height)-(I-R));let B=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),V=(r.visualViewport?.scale??1)!==1&&mN;if(B||V){aZ(O,M.current),g(!1);return}let H=Math.max(b,P);if(z){let e=Math.max(0,S-N);O.style.top=d.height>=F?`0`:`${e}px`,O.style.height=`${P}px`,p.scrollTop=TZ(p)}else O.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=NX(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(SZ,`50% ${i}%`)}(H===S||P>=x)&&(A.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,S,O,D,m,g,N,k,u,v,h]),AZ.useEffect(()=>{if(!m||!O||!S)return;let e=sj(O);function t(e){s.context.setOpen(!1,GP(UP,e))}return qP(e,`resize`,t)},[s,m,O,S]);let I={...k?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&XH.has(e.key)&&e.stopPropagation()},onScroll(e){k||P(e.currentTarget)},...m&&{style:k?{height:`100%`}:oZ},className:!k&&m?hZ.className:void 0},L=gL(`div`,e,{ref:[t,s.context.popupRef],state:F,stateAttributesMapping:MZ,props:[T,I,TH(E),o]});return(0,jZ.jsxs)(AZ.Fragment,{children:[!b&&hZ.getElement(y),(0,jZ.jsx)(sR,{context:d,modal:!1,disabled:!w,openInteractionType:C,returnFocus:a,restoreFocus:!0,children:L})]})}),PZ=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]]})),IZ,LZ,RZ=s((()=>{IZ=d(m(),1),zY(),iZ(),TL(),gZ(),sZ(),LZ=IZ.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=MY(),{multiple:s,readOnly:c}=NY(),{alignItemWithTriggerActive:l}=tZ(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:oZ},className:u&&d!==`touch`?hZ.className:void 0};return gL(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})})})),zZ,BZ,VZ=s((()=>{zZ=d(m(),1),BZ=zZ.createContext(void 0)})),HZ,UZ,WZ,GZ=s((()=>{HZ=d(m(),1),eN(),zY(),qU(),TL(),VZ(),uU(),KP(),WP(),_X(),ON(),UZ=d(O(),1),WZ=HZ.memo(HZ.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=HZ.useRef(null),d=GU({guess:!0,label:o,textRef:u}),f=MY(),{itemProps:p,multiple:m,disabled:h,readOnly:g}=NY(),_=h||s,v=f.useState(`isActive`,d.index),y=f.useState(`open`),b=f.useState(`isSelected`,a),x=f.useState(`isSelectedByFocus`,d.index),S=f.useState(`isItemEqualToValue`),C=d.index,w=HZ.useRef(null);Q(()=>{let e=f.context.valuesRef.current;return e[C]=a,()=>{delete e[C]}},[C,a,f]),Q(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=mX(C,a,f.context.valuesRef.current,e,S,t),r=n===C,C===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&cX(a,e,S),r&&(n=C)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[C,m,S,f,a]);let T=HZ.useRef(`mouse`),E=HZ.useRef(!1),{getButtonProps:D,buttonRef:O}=uV({disabled:_,focusableWhenDisabled:!0,native:c,composite:!0}),k={disabled:_,selected:b,highlighted:v};function A(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=b?hX(n,a,S):[...n,a];f.context.setValue(r,GP(AP,e))}else f.context.setValue(a,GP(AP,e)),f.context.setOpen(!1,GP(AP,e))}function j(){f.context.selectionRef.current.dragY=0}let M={role:`option`,"aria-selected":b,tabIndex:y&&v?0:-1,onKeyDown(e){f.set(`activeIndex`,C),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=T.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&wN(e.nativeEvent)&&(n!==void 0||v),i=t&&!r&&!E.current;E.current=!1,!(_||i)&&A(e.nativeEvent)},onPointerEnter(e){T.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){T.current=e.pointerType,E.current=!0,j()},onMouseUp(){if(j(),_||T.current===`touch`||E.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&b,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!b;e||t||(E.current=!0,w.current?.click(),E.current=!1)}},N=gL(`div`,e,{ref:[O,t,d.ref,w],state:k,props:[p,M,l,D]}),P=HZ.useMemo(()=>({selected:b,index:C,textRef:u,selectedByFocus:x}),[b,C,u,x]);return(0,UZ.jsx)(BZ.Provider,{value:P,children:N})}))})),KZ=s((()=>{VX(),TL(),QY(),qY(),Aj(),SF(),mF(),XR(),eN(),_V(),iX(),zY(),XX(),EX(),lP(),eZ(),KN(),fZ(),FZ(),RZ(),GZ(),VZ(),az(),pz(),iZ(),ZM(),LX(),RI()})),qZ=s((()=>{KZ()}));function JZ(e){return(0,ZZ.jsx)(YZ,{...e})}function YZ(e){let{items:t,ariaLabel:n,ariaInvalid:r,ariaDescribedBy:i,ariaLabelledBy:a,id:o,buttonRef:s,popupRef:c,onOpenChange:l,disabled:u,readOnly:d,valueClassName:f,actions:p=[],buttonClassName:m,listClassName:h,valueId:g,placeholder:_}=e,v=e.multiple===!0,y=(0,XZ.useId)(),b=(0,XZ.useId)(),x=o??y,S=e.multiple===!0?e.value:[e.value],C=t.find(e=>e.value===S[0]),w=v?t.filter(e=>S.includes(e.value)).map(e=>e.label).join(`, `):C?.label??``,T=(0,XZ.useRef)(null),[E,D]=(0,XZ.useState)(null);(0,XZ.useEffect)(()=>{D(T.current?.closest(`dialog, [role="dialog"]`))},[]);let O=(0,XZ.useRef)(null);return(0,ZZ.jsx)(`div`,{className:`dd`,ref:T,children:(0,ZZ.jsxs)(RX,{multiple:v||void 0,value:v?S:C?C.value:null,disabled:u,readOnly:d,onOpenChange:l,items:t.map(e=>({value:e.value,label:e.label})),onValueChange:n=>{if(e.multiple===!0){if(!Array.isArray(n))return;let r=n.find(e=>typeof e==`string`&&e.startsWith(QZ));r?p[Number(r.slice(9))]?.onSelect():e.onChange(t.map(e=>e.value).filter(e=>n.includes(e)))}else typeof n==`string`&&(n.startsWith(QZ)?p[Number(n.slice(9))]?.onSelect():n!==e.value&&e.onChange(n))},children:[(0,ZZ.jsxs)(YX,{render:(0,ZZ.jsx)(`button`,{type:`button`,role:`button`,id:x,className:m?`dd-button ${m}`:`dd-button`,ref:e=>{O.current=e,typeof s==`function`?s(e):s&&(s.current=e)},"aria-label":a?void 0:n,"aria-labelledby":a??(n?`${x} ${g??b}`:void 0),"aria-invalid":r||void 0,"aria-describedby":i,title:C?.detail??``}),children:[C?.swatches&&(0,ZZ.jsx)(`span`,{className:`dd-swatches`,"aria-hidden":`true`,children:C.swatches.map((e,t)=>(0,ZZ.jsx)(`span`,{style:{background:e}},t))}),(0,ZZ.jsx)(`span`,{id:g??b,className:`dd-value${f?` ${f}`:``}${w?``:` is-empty`}`,children:w||_||`—`}),(0,ZZ.jsx)(`span`,{className:`dd-caret`,"aria-hidden":`true`,children:`▾`})]}),(0,ZZ.jsx)($X,{container:E??pG(),children:(0,ZZ.jsx)(dZ,{anchor:()=>O.current?gU(O.current):null,alignItemWithTrigger:!1,positionMethod:`fixed`,side:`bottom`,align:`start`,sideOffset:4,collisionBoundary:_U(),collisionPadding:8,style:{zIndex:40},children:(0,ZZ.jsx)(NZ,{ref:c,className:`dd-popup`,children:(0,ZZ.jsxs)(LZ,{className:[`dd-list`,v?`dd-list-multi`:``,h].filter(Boolean).join(` `),"aria-label":n,"aria-labelledby":n?void 0:a?.split(` `)[0],children:[t.map(t=>(0,ZZ.jsxs)(WZ,{value:t.value,label:t.label,disabled:t.disabled,className:e=>`dd-option${e.selected?` selected`:``}${t.disabled?` disabled`:``}${t.tone?` dd-tone-${t.tone}`:``}${e.highlighted?` active`:``}`,children:[v?(0,ZZ.jsx)(`span`,{className:`dd-box`,"aria-hidden":`true`}):(0,ZZ.jsx)(`span`,{className:`dd-check`,"aria-hidden":`true`,children:t.value===e.value?`✓`:``}),t.swatches&&(0,ZZ.jsx)(`span`,{className:`dd-swatches`,"aria-hidden":`true`,children:t.swatches.map((e,t)=>(0,ZZ.jsx)(`span`,{style:{background:e}},t))}),(0,ZZ.jsxs)(`span`,{className:`dd-text`,children:[(0,ZZ.jsx)(`span`,{className:`dd-label`,children:t.label}),t.detail&&(0,ZZ.jsx)(`span`,{className:`dd-detail`,children:t.detail})]}),t.badge&&(0,ZZ.jsx)(`span`,{className:`dd-badge`,children:t.badge})]},t.value)),p.length?(0,ZZ.jsx)(`div`,{className:`dd-divider`,role:`presentation`}):null,p.map((e,t)=>(0,ZZ.jsxs)(WZ,{value:`${QZ}${t}`,label:e.label,className:e=>`dd-option dd-action${e.highlighted?` active`:``}`,children:[(0,ZZ.jsx)(`span`,{className:`dd-check`,"aria-hidden":`true`}),(0,ZZ.jsx)(`span`,{className:`dd-text`,children:(0,ZZ.jsx)(`span`,{className:`dd-label`,children:e.label})})]},e.label))]})})})})]})})}var XZ,ZZ,QZ,$Z=s((()=>{XZ=d(m(),1),qZ(),vU(),mG(),ZZ=d(O(),1),QZ=`~~action:`})),eQ,tQ=s((()=>{ba(),eQ=pa({select:`Select`})}));function nQ(e){return!/[??]/.test(e)&&e.trim().split(/\s+/).length<=2}function rQ(e){return(0,iQ.jsx)(JZ,{...e,ariaLabel:e.ariaLabel??eQ(`select`)})}var iQ,aQ=s((()=>{$Z(),tQ(),iQ=d(O(),1)}));function oQ(e){if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=new Date(`${e}T00:00:00Z`);return!Number.isNaN(t.getTime())&&t.toISOString().slice(0,10)===e}function sQ(e,t){let n=JSON.stringify([e??null,t]),r=jQ.get(n);return r||(r=new Intl.DateTimeFormat(e,t),jQ.set(n,r)),r}function cQ(e){return oQ(e)&&e>=`0001-01-01`&&e<=`9999-12-31`}function lQ(e){if(!cQ(e))throw RangeError(`Expected an existing ISO date from 0001-01-01 through 9999-12-31.`);return{year:Number(e.slice(0,4)),month:Number(e.slice(5,7)),day:Number(e.slice(8,10))}}function uQ({year:e,month:t,day:n}){let r=new Date(0);return r.setUTCFullYear(e,t-1,n),r}function dQ(e){return`${String(e.getUTCFullYear()).padStart(4,`0`)}-${String(e.getUTCMonth()+1).padStart(2,`0`)}-${String(e.getUTCDate()).padStart(2,`0`)}`}function fQ(e){if(!Number.isSafeInteger(e))throw RangeError(`Calendar steps must be safe integers.`)}function pQ(e,t){if(fQ(e),fQ(t),e<1||e>9999||t<1||t>12)throw RangeError(`Invalid calendar month.`);return[31,e%4==0&&(e%100!=0||e%400==0)?29:28,31,30,31,30,31,31,30,31,30,31][t-1]}function mQ(e,t){let n=uQ(lQ(e));fQ(t);let r=uQ(lQ(kQ)).getTime(),i=uQ(lQ(AQ)).getTime();return dQ(new Date(Math.min(i,Math.max(r,n.getTime()+t*864e5))))}function hQ(e,t){let n=lQ(e);fQ(t);let r=Math.min(119987,Math.max(0,(n.year-1)*12+n.month-1+t)),i=Math.floor(r/12)+1,a=r%12+1;return dQ(uQ({year:i,month:a,day:Math.min(n.day,pQ(i,a))}))}function gQ(e,t){let n=e&&oQ(e)&&e<`0001-01-01`?kQ:e||`0001-01-01`,r=t||`9999-12-31`;if(lQ(n),lQ(r),n>r)throw RangeError(`Minimum date must not exceed maximum date.`);return{min:n,max:r}}function _Q(e,t){return cQ(e)&&e>=t.min&&e<=t.max}function vQ(e,t){return lQ(e),e<t.min?t.min:e>t.max?t.max:e}function yQ(e,t=1,n=gQ()){if(fQ(t),t<0||t>6)throw RangeError(`First weekday must be between 0 (Sunday) and 6.`);let r=lQ(e),i=uQ({...r,day:1}),a=(i.getUTCDay()-t+7)%7;return Array.from({length:42},(e,t)=>{let o=new Date(i.getTime()+(t-a)*864e5);if(o.getUTCFullYear()<1||o.getUTCFullYear()>9999)return{date:null,inMonth:!1,disabled:!0};let s=dQ(o);return{date:s,inMonth:o.getUTCMonth()+1===r.month,disabled:!_Q(s,n)}})}function bQ(e,t){return sQ(t,{calendar:`gregory`,timeZone:`UTC`,month:`long`,year:`numeric`}).format(uQ(lQ(e)))}function xQ(e,t=1){if(fQ(t),t<0||t>6)throw RangeError(`First weekday must be between 0 (Sunday) and 6.`);let n=sQ(e,{calendar:`gregory`,timeZone:`UTC`,weekday:`short`}),r=sQ(e,{calendar:`gregory`,timeZone:`UTC`,weekday:`long`});return Array.from({length:7},(e,i)=>{let a=uQ({year:2023,month:1,day:1+(t+i)%7});return{short:n.format(a),long:r.format(a)}})}function SQ(e){return typeof e==`string`&&MQ.test(e)}function CQ(e){return e.search(/[T ]/)===10?{date:e.slice(0,10),time:e.slice(11)}:null}function wQ(e){let t=typeof e==`string`?CQ(e):null;return!!(t&&cQ(t.date)&&SQ(t.time))}function TQ(e,t){let n=CQ(e)?.time;return`${t} ${n&&SQ(n)?n:`00:00`}`}function EQ(e){if(!wQ(e))return null;let{date:t,time:n}=CQ(e),[r,i=`00`]=[n.slice(0,5),n.slice(6)],[a=`00`,o=``]=i.split(`.`);return`${t}T${r}:${a.padEnd(2,`0`)}.${o.padEnd(3,`0`)}`}function DQ(e,t,n){let r=EQ(e);if(r===null)return!1;let i=t?EQ(t):null,a=n?EQ(n):null;return(i===null||r>=i)&&(a===null||r<=a)}function OQ(e,t){let n=sQ(`en-US`,{calendar:`gregory`,numberingSystem:`latn`,timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`}).formatToParts(e),r=e=>n.find(t=>t.type===e).value,i=`${r(`year`).padStart(4,`0`)}-${r(`month`)}-${r(`day`)}`;return lQ(i),i}var kQ,AQ,jQ,MQ,NQ=s((()=>{kQ=`0001-01-01`,AQ=`9999-12-31`,jQ=new Map,MQ=/^([01]\d|2[0-3]):[0-5]\d(:[0-5]\d(\.\d{1,3})?)?$/}));function PQ(e){let t;try{t=sQ(e,{year:`numeric`,month:`2-digit`,day:`2-digit`,timeZone:`UTC`,calendar:`gregory`}).formatToParts(Date.UTC(2006,10,22))}catch{t=[]}let n=t.filter(e=>[`year`,`month`,`day`].includes(e.type)).map(e=>e.type);if(n.length!==3)return{order:[`year`,`month`,`day`],sep:`-`,hint:`YYYY-MM-DD`};let r=t.find(e=>e.type===`literal`)?.value.trim()||`/`,i={year:`YYYY`,month:`MM`,day:`DD`};return{order:n,sep:r,hint:n.map(e=>i[e]).join(r)}}function FQ(e,t){let{year:n,month:r,day:i}=lQ(e),a={year:String(n).padStart(4,`0`),month:String(r).padStart(2,`0`),day:String(i).padStart(2,`0`)};return t.order.map(e=>a[e]).join(t.sep)}function IQ(e,t){if(BQ(e))return e;let n=e.trim().match(/^(\d{1,4})\D(\d{1,2})\D(\d{1,4})$/);if(!n)return;let r={};if(t.order.forEach((e,t)=>r[e]=n[t+1]),r.year.length!==4)return;let i=`${r.year}-${r.month.padStart(2,`0`)}-${r.day.padStart(2,`0`)}`;return cQ(i)?i:void 0}function LQ({id:e,words:t,calendarIcon:n,value:r,onChange:i,onBlur:a,onKeyDown:o,disabled:s,required:c,min:l,max:u,locale:d,timezone:f,now:p,firstDay:m=1,className:h=``,name:g,inputRef:_,placeholder:v,withTime:y=!1,popupRef:b,onOpenChange:x,"aria-label":S,"aria-invalid":C,"aria-describedby":w}){let T=y?CQ(r)?.date??r.slice(0,10):r,E=(0,RQ.useMemo)(()=>{try{return gQ(y?l?.slice(0,10):l,y?u?.slice(0,10):u)}catch{return null}},[l,u,y]),D=E??gQ(),O=OQ(p??new Date,f),k=()=>vQ(cQ(T)?T:O,D),[A,j]=(0,RQ.useState)(k),[M,N]=(0,RQ.useState)(!1),P=(0,RQ.useRef)(x);(0,RQ.useLayoutEffect)(()=>{P.current=x});let F=e=>{N(e),P.current?.(e)},[I,L]=(0,RQ.useState)(null),R=(0,RQ.useRef)(null),z=(0,RQ.useRef)(null),B=(0,RQ.useRef)(null);(0,RQ.useImperativeHandle)(_,()=>B.current,[]);let V=(0,RQ.useRef)(null),H=(0,RQ.useCallback)(e=>{V.current=e,b?.(e)},[b]),U=(0,RQ.useRef)(!1),W=(0,RQ.useRef)(!1),G=(0,RQ.useRef)(void 0),ee=(0,RQ.useRef)(!1),te=(0,RQ.useRef)(a);(0,RQ.useLayoutEffect)(()=>{te.current=a});let ne=(0,RQ.useId)(),K=(0,RQ.useId)(),re=(0,RQ.useMemo)(()=>PQ(d),[d]),[q,ie]=(0,RQ.useState)(null),ae=y?r:q??(cQ(r)?FQ(r,re):r),oe=y?t.dateTimePattern:re.hint;(0,RQ.useEffect)(()=>{q!==null&&r!==(IQ(q,re)??q)&&ie(null)},[r]);let se=yQ(A,m,D),ce=xQ(d,m);(0,RQ.useEffect)(()=>(L(z.current?.closest(`dialog, [role="dialog"]`)),()=>{clearTimeout(G.current)}),[]);let le=!E||r!==``&&(y?!wQ(r)||!_Q(T,D)||!DQ(r,l,u):!_Q(r,D));(0,RQ.useEffect)(()=>{B.current?.setCustomValidity(le?y?t.enterDateAndTime:t.enterDate(re.hint):``)},[le,y,re]),(0,RQ.useLayoutEffect)(()=>{if(!M)return;if(!E||s){F(!1);return}let e=vQ(cQ(T)?T:A,E);e!==A&&(W.current=!!V.current?.querySelector(`[data-date]:focus`),j(e))},[r,l,u,s]),(0,RQ.useLayoutEffect)(()=>{M&&W.current&&(V.current?.querySelector(`[data-date="${A}"]`)?.focus(),W.current=!1)},[A,M]);let ue=e=>!!(e&&(R.current?.contains(e)||V.current?.contains(e))),de=()=>{U.current&&(U.current=!1,ie(null),te.current?.())},fe=()=>{clearTimeout(G.current),G.current=setTimeout(()=>{ue(document.activeElement)||de()},0)},pe=e=>{e.relatedTarget?(clearTimeout(G.current),ue(e.relatedTarget)||de()):fe()},me=e=>{e&&(ee.current=!1,j(k())),F(e),e||fe()},J=()=>{let e=z.current;e?.isConnected&&(!I||I.isConnected&&!I.hasAttribute(`data-closed`))&&e.focus({preventScroll:!0})},he=e=>{ee.current=!0,ie(null),J(),i(y&&e?TQ(r,e):e),me(!1)},ge=e=>{W.current=!0,j(vQ(e,D))},_e=e=>{let t=se.findIndex(e=>e.date===A)%7,n={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7,Home:-t,End:6-t};Object.hasOwn(n,e.key)?(e.preventDefault(),e.stopPropagation(),ge(mQ(A,n[e.key]))):(e.key===`PageUp`||e.key===`PageDown`)&&(e.preventDefault(),e.stopPropagation(),ge(hQ(A,(e.key===`PageUp`?-1:1)*(e.shiftKey?12:1))))},ve=e=>{let t=lQ(e),n=new Date(0);return n.setUTCFullYear(t.year,t.month-1,t.day),sQ(d,{calendar:`gregory`,timeZone:`UTC`,dateStyle:`full`}).format(n)},ye=hQ(A,-1),be=hQ(A,1);return(0,zQ.jsx)(JB,{open:M&&!s&&!!E,onOpenChange:(e,t)=>{ee.current=!e&&t.reason===`escape-key`,ee.current&&J(),me(e)},children:(0,zQ.jsxs)(`span`,{ref:R,className:y?`date-field with-time`:`date-field`,onFocus:()=>{U.current=!0},onBlur:pe,children:[(0,zQ.jsx)(`input`,{ref:B,id:e,name:g,type:`text`,value:ae,className:`date-field-input ${h}`,placeholder:v??(y?t.dateTimePattern:re.hint),autoComplete:`off`,spellCheck:!1,disabled:s,required:c,"aria-required":c,"aria-label":S,"aria-invalid":C||le||void 0,"aria-describedby":[w,K].filter(Boolean).join(` `),onChange:e=>{let t=e.target.value;if(y)return i(t);ie(t),i(IQ(t,re)??t)},onKeyDown:e=>{e.altKey&&e.key===`ArrowDown`?(e.preventDefault(),e.stopPropagation(),E&&me(!0)):o?.(e)}}),(0,zQ.jsxs)(`span`,{id:K,className:`date-field-hint`,children:[y?t.dateAndTimeFormat:t.dateFormat(oe),` `,t.openWithKeys]}),(0,zQ.jsx)(PV,{render:(0,zQ.jsx)(`button`,{ref:z,type:`button`,className:`date-field-trigger`,disabled:s||!E,"aria-label":t.chooseDate(S||void 0)}),children:n}),(0,zQ.jsx)(HV,{container:I??pG(),children:(0,zQ.jsx)(WH,{anchor:()=>z.current?gU(z.current):null,positionMethod:`fixed`,side:`bottom`,align:`end`,sideOffset:6,collisionBoundary:_U(),collisionPadding:8,style:{zIndex:45},children:(0,zQ.jsxs)(cU,{ref:H,finalFocus:()=>{let e=z.current,t=document.activeElement;return ee.current&&e?.isConnected&&(!I||I.isConnected&&!I.hasAttribute(`data-closed`))&&(t===e||t===document.body||t===I)?e:!1},className:`date-field-popup`,"aria-label":t.calendar(S||void 0),initialFocus:()=>V.current?.querySelector(`[data-date="${A}"]`)??!0,children:[(0,zQ.jsxs)(`div`,{className:`date-field-head`,children:[(0,zQ.jsx)(`button`,{type:`button`,"aria-label":t.previousMonth,disabled:ye.slice(0,7)===A.slice(0,7)||ye.slice(0,7)<D.min.slice(0,7),onClick:()=>j(vQ(ye,D)),children:`←`}),(0,zQ.jsx)(`span`,{id:ne,"aria-live":`polite`,"aria-atomic":`true`,children:bQ(A,d)}),(0,zQ.jsx)(`button`,{type:`button`,"aria-label":t.nextMonth,disabled:be.slice(0,7)===A.slice(0,7)||be.slice(0,7)>D.max.slice(0,7),onClick:()=>j(vQ(be,D)),children:`→`})]}),(0,zQ.jsxs)(`table`,{className:`date-field-calendar`,role:`grid`,"aria-labelledby":ne,children:[(0,zQ.jsx)(`thead`,{children:(0,zQ.jsx)(`tr`,{children:ce.map(e=>(0,zQ.jsx)(`th`,{scope:`col`,"aria-label":e.long,children:e.short},e.long))})}),(0,zQ.jsx)(`tbody`,{children:Array.from({length:6},(e,t)=>(0,zQ.jsx)(`tr`,{children:se.slice(t*7,t*7+7).map((e,t)=>(0,zQ.jsx)(`td`,{"aria-selected":e.date===T,children:e.date&&(0,zQ.jsx)(`button`,{type:`button`,"data-date":e.date,"data-outside":!e.inMonth||void 0,"data-selected":e.date===T||void 0,"aria-current":e.date===O?`date`:void 0,disabled:e.disabled,tabIndex:e.date===A?0:-1,"aria-label":ve(e.date),onKeyDown:_e,onClick:()=>he(e.date),children:Number(e.date.slice(8))})},e.date??t))},t))})]}),(0,zQ.jsxs)(`div`,{className:`date-field-foot`,children:[(0,zQ.jsx)(`button`,{type:`button`,onClick:()=>he(``),children:t.clear}),(0,zQ.jsx)(`button`,{type:`button`,disabled:!_Q(O,D),onClick:()=>he(O),children:t.today})]})]})})})]})})}var RQ,zQ,BQ,VQ=s((()=>{RQ=d(m(),1),hU(),vU(),NQ(),mG(),zQ=d(O(),1),BQ=e=>cQ(e)})),HQ,UQ=s((()=>{ba(),HQ=pa({enterADateAndTime:`Enter a date and time as YYYY-MM-DD HH:MM within the allowed range.`,enterADateInYyyy:`Enter a date as {format} within the allowed range.`,yyyyMmDdHh:`YYYY-MM-DD HH:MM`,dateAndTimeFormat:`Date and time format: YYYY-MM-DD HH:MM.`,dateFormatIs:`Date format: {format}.`,altAndDownArrow:`Alt and Down arrow opens the calendar.`,chooseDateFor:`Choose date for {label}`,chooseDate:`Choose date`,calendar:`Calendar for {label}`,previousMonth:`Previous month`,nextMonth:`Next month`})}));function WQ(e){return(0,GQ.jsx)(LQ,{...e,words:KQ(),calendarIcon:(0,GQ.jsx)(Pe,{name:`calendar-blank`,size:18})})}var GQ,KQ,qQ=s((()=>{VQ(),Fe(),UQ(),GQ=d(O(),1),KQ=()=>({dateTimePattern:HQ(`yyyyMmDdHh`),enterDateAndTime:HQ(`enterADateAndTime`),enterDate:e=>HQ(`enterADateInYyyy`,{format:e}),dateAndTimeFormat:HQ(`dateAndTimeFormat`),dateFormat:e=>HQ(`dateFormatIs`,{format:e}),openWithKeys:HQ(`altAndDownArrow`),chooseDate:e=>e?HQ(`chooseDateFor`,{label:e}):HQ(`chooseDate`),calendar:e=>e?HQ(`calendar`,{label:e}):HQ(`chooseDate`),previousMonth:HQ(`previousMonth`),nextMonth:HQ(`nextMonth`),clear:HQ(`common.clear`),today:HQ(`common.today`)})})),JQ,YQ,XQ=s((()=>{pi(),JQ={activeApp:()=>ci().app(),inAppMode:()=>ci().inApp()},YQ=JQ}));function ZQ({className:e,load:t,couldNotLoad:n,threw:r}){let i=new Map,a=new Set,o=new Set,s=0;function c(e,t){i.set(e,t),s+=1;for(let e of o)e()}function l(e,r){a.has(r)||(a.add(r),t(e).then(e=>c(r,e),t=>{n(e,t),c(r,null)}))}let u=e=>(o.add(e),()=>{o.delete(e)}),d=()=>s;class f extends QQ.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){i.get(this.props.slot)!==null&&(r(this.props.id,e),c(this.props.slot,null))}render(){return this.state.failed?this.props.fallback:this.props.children}}function p({id:t,fallback:n,props:r}){(0,QQ.useSyncExternalStore)(u,d,d);let a=ci().components.useKey(t);(0,QQ.useEffect)(()=>{l(t,a)},[t,a]);let o=i.get(a);return o?(0,$Q.jsx)(f,{id:t,slot:a,fallback:n,children:(0,$Q.jsx)(`span`,{className:e,"data-component":t,children:(0,QQ.createElement)(o,r)})}):(0,$Q.jsx)($Q.Fragment,{children:n})}return p}var QQ,$Q,e$=s((()=>{QQ=d(m()),pi(),$Q=d(O())}));function t$(e,t){let n=YQ.activeApp()?.resources,r=n?.[e]?.inputs;if(r&&Object.hasOwn(r,t))return r[t].id;let i=n?.[e]?.display,a=i&&Object.hasOwn(i,t)?i[t]:void 0;return a?.slider?`${i$}slider`:a?.scan?`${i$}scan`:a?.signature&&typeof a.signature==`object`?`${i$}signature`:a?.format&&s$.has(a.format)?`${i$}${a.format}`:void 0}function n$({component:e,fallback:t,...n}){return(0,r$.jsx)(o$,{id:e,fallback:t,props:n})}var r$,i$,a$,o$,s$,c$=s((()=>{XQ(),pi(),e$(),r$=d(O(),1),i$=`mistri:`,a$=e=>`${i$}${e}`,o$=ZQ({className:`custom-input`,load:e=>e.startsWith(i$)?ci().components.builtIn(e.slice(7)):ci().components.load(e),couldNotLoad:(e,t)=>console.error(`the input "${e}" could not be loaded; its field is the platform's control.`,t),threw:(e,t)=>console.error(`the input "${e}" threw; its field is the platform's control.`,t)}),s$=new Set([`rating`,`color`,`time`,`month`,`year`,`json`])})),l$,u$=s((()=>{ba(),l$=pa({addRow:`Add row`,anEmailAddress:`an email address`,aWebAddressStarting:`a web address, starting https://`,aPhoneNumber:`a phone number`,aColor:`a color, such as #1d6a5a`,theFormHasAnInput:`The form has an input it does not ask for.`,isRequired:`{label} is required.`,requiredWord:`(required)`,optionalWord:`(optional)`,checkThisBoxTo:`Check this box to continue.`,mustBeAtLeast:`{label} must be at least {minLength} characters.`,mustBeCharactersOrFewer:`{label} must be {maxLength} characters or fewer.`,must:`{label} must be {value}.`,isNotInTheForm:`{label} is not in the form it takes.`,mustBeBefore:`{label} must be before {other}.`,mustBeLessThan:`{label} must be less than {other}.`,mustBeAfter:`{label} must be after {other}.`,mustBeMoreThan:`{label} must be more than {other}.`,hasCharactersAForm:`{label} has characters a form does not take.`,mustBeASafe:`{label} must be a safe whole number.`,hasMoreDecimalsThanTheCurrency:`{label} has more decimal places than the currency takes.`,mustBeOnOrAfter:`{label} must be on or after {min}.`,labelMustBeAt:`{label} must be at least {min}.`,mustBeOnOrBefore:`{label} must be on or before {max}.`,mustBeAtMost:`{label} must be at most {max}.`,chooseLabel:`Choose {label}.`,takesAtMostRows:`{label} takes at most {max} rows.`,mustBeANumber:`{label} must be a number.`,mustBeYes:`{label} must be yes or no.`,mustBeADate:`{label} must be a date.`,mustBeADateAndTime:`{label} must be a date and time.`,mustBeATime:`{label} must be a time of day.`,isNotInAForm:`{label} is not in a form it takes.`,choosePlaceholder:`Choose {label}`,chooseOne:`Choose one`,groupRow:`{label}, row {index}`,rowLabel:`Row`,removeRow:`Remove row {index} of {label}`,addRowTo:`Add row to {label}`,needsAtLeastRows:{one:`{label} needs at least {count} row.`,other:`{label} needs at least {count} rows.`},rowMatch:`row {match}`,needsAtLeastFiles:{one:`{label} needs at least {count} file.`,other:`{label} needs at least {count} files.`},takesAtMostFiles:{one:`{label} takes at most {count} file.`,other:`{label} takes at most {count} files.`},inTheFormItTakes:`in the form it takes`,chooseAlone:`Choose {label} on its own, or another.`})}));function d$(e,t){let n=sQ(`en-US`,{...h$,timeZone:t}).formatToParts(new Date(e)),r=e=>Number(n.find(t=>t.type===e)?.value??0);return{year:r(`year`),month:r(`month`),day:r(`day`),hour:r(`hour`),minute:r(`minute`),second:r(`second`)}}function f$(e,t,n,r,i,a,o=0){let s=new Date(0);return s.setUTCFullYear(e,t-1,n),s.setUTCHours(r,i,a,o),s.getTime()}function p$(e,t){if(!wQ(e))return;let{date:n,time:r}=CQ(e),[i,a,o=`0`]=r.split(`:`),[s,c=``]=o.split(`.`),l=f$(Number(n.slice(0,4)),Number(n.slice(5,7)),Number(n.slice(8,10)),Number(i),Number(a),Number(s),Number(c.padEnd(3,`0`))),u=864e5,d=[l-g$(l-u,t),l-g$(l+u,t)],f=l-(l%1e3+1e3)%1e3,p=d.filter(e=>{let n=d$(e,t);return f$(n.year,n.month,n.day,n.hour,n.minute,n.second)===f});return new Date(p.length?Math.min(...p):Math.max(...d)).toISOString()}function m$(e,t){let n=Date.parse(e);if(!/[zZ]|[+-]\d{2}(?::?\d{2})?$/.test(e)||!Number.isFinite(n))return;let r=d$(n,t),i=e=>String(e).padStart(2,`0`),a=r.second?`:${i(r.second)}`:``;return`${String(r.year).padStart(4,`0`)}-${i(r.month)}-${i(r.day)} ${i(r.hour)}:${i(r.minute)}${a}`}var h$,g$,_$=s((()=>{NQ(),h$={calendar:`gregory`,numberingSystem:`latn`,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`},g$=(e,t)=>{let n=d$(e,t);return f$(n.year,n.month,n.day,n.hour,n.minute,n.second)-(e-(e%1e3+1e3)%1e3)}})),v$=l({DateTimeInput:()=>y$});function y$({value:e,onChange:t,min:n,max:r,...i}){let a=hi(),o=e=>e&&(m$(e,a)??e),[s,c]=(0,b$.useState)(()=>o(e)??``),[l,u]=(0,b$.useState)(e);return e!==l&&(u(e),c(o(e)??``)),(0,x$.jsx)(WQ,{...i,withTime:!0,min:o(n),max:o(r),locale:mi(),timezone:a,now:_i(),value:s,onChange:e=>{c(e);let n=e.trim(),r=n?p$(n,a)??e:``;u(r),t(r)}})}var b$,x$,S$=s((()=>{b$=d(m()),qQ(),Yi(),_$(),x$=d(O())})),C$=l({ActionBar:()=>D$,Columns:()=>O$,HelpTip:()=>w$,ProgressBar:()=>T$,ReviewList:()=>k$,StepHeader:()=>E$});function w$({text:e,label:t,icon:n}){let[r,i]=(0,A$.useState)(!1),a=(0,A$.useId)(),o=(0,A$.useRef)(null);return(0,A$.useEffect)(()=>{if(!r)return;let e=e=>{o.current&&!o.current.contains(e.target)&&i(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[r]),(0,j$.jsxs)(`span`,{className:`help-tip`,ref:o,children:[(0,j$.jsx)(`button`,{type:`button`,className:`help-tip-button`,"aria-label":t,"aria-expanded":r,"aria-describedby":r?a:void 0,onClick:()=>i(!r),onKeyDown:e=>{e.key===`Escape`&&r&&(e.stopPropagation(),i(!1))},children:n??(0,j$.jsx)(`span`,{"aria-hidden":`true`,children:`i`})}),r?(0,j$.jsx)(`span`,{role:`tooltip`,id:a,className:`help-tip-text`,children:e}):null]})}function T$({value:e,max:t,min:n=0,label:r,decorative:i}){return(0,j$.jsx)(`div`,{className:`progress-bar`,...i?{"aria-hidden":!0}:{role:`progressbar`,"aria-label":r,"aria-valuemin":n,"aria-valuemax":t,"aria-valuenow":e},children:(0,j$.jsx)(`span`,{className:`progress-bar-fill`,style:{width:`${t>0?Math.min(100,e/t*100):0}%`}})})}function E$({title:e,lead:t,mark:n,level:r=1,id:i}){return(0,j$.jsxs)(`header`,{className:`step-header`,children:[(0,j$.jsxs)(r===1?`h1`:`h2`,{className:`step-title`,id:i,tabIndex:-1,children:[n?(0,j$.jsx)(`span`,{className:`step-mark`,"aria-hidden":`true`,children:n}):null,e]}),t?(0,j$.jsx)(`p`,{className:`step-lead`,children:t}):null]})}function D$({back:e,primary:t,className:n}){return(0,j$.jsxs)(`footer`,{className:n?`action-bar ${n}`:`action-bar`,children:[e?(0,j$.jsxs)(gG,{intent:`quiet`,size:`large`,className:`action-bar-back`,onClick:e.onClick,children:[e.icon,e.label]}):null,(0,j$.jsxs)(gG,{intent:`primary`,size:`large`,className:`action-bar-primary`,disabled:t.disabled,busy:t.busy,busyLabel:t.busyLabel,onClick:t.onClick,children:[t.label,t.icon]})]})}function O$({cols:e,children:t}){return(0,j$.jsx)(`div`,{className:`form-columns`,style:e?{"--form-columns":e}:void 0,children:t})}function k$({label:e,children:t}){return(0,j$.jsx)(`div`,{className:`review-list`,role:`group`,"aria-label":e,children:t})}var A$,j$,M$=s((()=>{A$=d(m(),1),yG(),j$=d(O(),1)})),N$=s((()=>{M$(),O()}));function P$(e){let{cards:t}=e,[n,r]=(0,F$.useState)(void 0),i=(0,F$.useRef)([]),a=t.findIndex(e=>e.on),o=n!==void 0&&n<t.length?n:Math.max(a,0),s=e=>{let n=(e+t.length)%t.length;r(n),i.current[n]?.focus()},c=(n,r)=>{let i=n.key===`ArrowDown`||n.key===`ArrowRight`?r+1:n.key===`ArrowUp`||n.key===`ArrowLeft`?r-1:n.key===`Home`?0:n.key===`End`?t.length-1:void 0;i===void 0?n.key===` `&&(n.preventDefault(),e.disabled||e.onToggle(r,!t[r].on)):(n.preventDefault(),s(i))};return(0,I$.jsx)(`div`,{className:`choice-cards`,role:`group`,"data-fit":e.fit,id:e.id,"aria-labelledby":e[`aria-labelledby`],"aria-describedby":e[`aria-describedby`],"aria-invalid":e[`aria-invalid`],children:t.map((t,n)=>(0,I$.jsxs)(`div`,{ref:e=>{i.current[n]=e},role:`checkbox`,"aria-checked":t.on,"aria-disabled":e.disabled||void 0,tabIndex:n===o?0:-1,className:`choice-card${t.on?` is-on`:``}`,onClick:()=>{r(n),e.disabled||e.onToggle(n,!t.on)},onFocus:()=>r(n),onKeyDown:e=>c(e,n),children:[t.icon?(0,I$.jsx)(`span`,{className:`choice-card-icon`,"aria-hidden":`true`,children:t.icon}):null,(0,I$.jsxs)(`span`,{className:`choice-card-label`,children:[t.label,t.help?(0,I$.jsx)(`span`,{className:`choice-card-help`,children:t.help}):null]}),(0,I$.jsx)(`span`,{className:`choice-box`,"aria-hidden":`true`})]},t.key))})}var F$,I$,L$=s((()=>{F$=d(m(),1),yJ(),N$(),I$=d(O(),1)}));function R$(e,t,n,r,i,a,o,s,c,l=2){let u=IF(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return MF(n.current,u)?void 0:u}var z$=s((()=>{BF()}));function B$(){let e=G$.useContext(K$);if(!e)throw Error(LI(22));return e}function V$(){let e=G$.useContext(q$);if(!e)throw Error(LI(23));return e}function H$(){let e=G$.useContext(J$);if(!e)throw Error(LI(24));return e}function U$(){return G$.useContext(X$)}function W$(){return G$.useContext(Y$)}var G$,K$,q$,J$,Y$,X$,Z$=s((()=>{RI(),G$=d(m(),1),K$=G$.createContext(void 0),q$=G$.createContext(void 0),J$=G$.createContext(void 0),Y$=G$.createContext(!1),X$=G$.createContext(``)})),Q$,$$=s((()=>{_X(),EX(),Q$={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?CX(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>cX(t,e,n)):cX(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemProps:e=>e.itemProps,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight}}));function e1(e){return e==null?void 0:`${e}-popup`}function t1(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}var n1=s((()=>{}));function r1(e){return Array.isArray(e)?e.map(e=>r1(e)).join(`,`):e==null?``:String(e)}var i1=s((()=>{}));function a1(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${r1(e.locale)}|${JSON.stringify(t)}`,r=o1.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=wX(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=wX(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=wX(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return o1.set(n,a),a}var o1,s1=s((()=>{i1(),EX(),o1=new Map})),c1,l1=s((()=>{m(),s1(),c1=a1}));function u1(e,t=!1){let{overflowY:n}=bj(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var d1=s((()=>{Aj()})),f1,p1,m1=s((()=>{f1=Symbol(`none`),p1={value:f1,index:-1}}));function h1(e,t,n){let r=e.get(t);if(r!==void 0||n===gX)return r;for(let[r,i]of e)if(cX(r,t,n))return i}var g1=s((()=>{_X()}));function _1(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:l=!1,selectionMode:u,onItemHighlighted:d,name:f,form:p,disabled:m=!1,readOnly:h=!1,required:g=!1,inputRef:_,grid:v=!1,items:y,filteredItems:b,filter:x,filterQuery:S,openOnInputClick:C=!0,autoHighlight:w=!1,keepHighlight:T=!1,highlightItemOnHover:E=!0,loopFocus:D=!0,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:A=gX,virtualized:j=!1,inline:M=!1,fillInputOnItemPress:N=!0,modal:P=!1,limit:F=-1,autoComplete:I=`list`,formAutoComplete:L,locale:R,submitOnItemClick:z=!1}=e,{clearErrors:B}=kX(),{setDirty:V,validityData:H,setFilled:U,name:W,disabled:G,setTouched:ee,setFocused:te,validationMode:ne,validation:K}=JY(),re=XV(),q=aX({id:t}),ie=c1({locale:R}),ae=Array.isArray(y)?null:y;if(ae&&typeof ae.label!=`function`)throw Error(LI(100));let oe=ae?ae.data:y,se=ae?.value,ce=se?void 0:oe,le=v1.useMemo(()=>{if(!b||!se)return;let e=SX(b),t=e.map(se),n;return{values:t,findItem(r,i){if(!n){n=new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return h1(n,r,i)}}},[b,se]),ue=v1.useMemo(()=>ae?e=>ae.label(e,A,e=>{let t=le?.findItem(e,A);return t==null?wX(e,O):ae.itemLabel(t)}):O,[ae,O,le,A]),de=v1.useMemo(()=>ae?Object.assign(e=>ae.itemLabel(e),{selected:e=>wX(e,ue)}):O,[ae,ue,O]);function fe(e){return wX(e,ue)}let[pe,me]=v1.useState(!1),[J,he]=v1.useState(null),ge=v1.useRef(J),_e=v1.useRef([]),ve=v1.useRef([]),ye=v1.useRef(null),be=v1.useRef(null),xe=v1.useRef(null),Se=v1.useRef(null),Ce=v1.useRef(null),we=v1.useRef(!0),Te=v1.useRef(!1),Ee=v1.useRef(null),De=v1.useRef(null),Oe=v1.useRef(null),ke=v1.useRef(p1),Ae=v1.useRef(null),je=v1.useRef([]),Me=v1.useRef(null),Ne=G||m,Pe=W??f,Fe=u===`multiple`,Ie=u===`single`,Le=s!==void 0||o!==void 0,Re=oe!==void 0,ze=b!==void 0,Be;Be=w===`always`?`always`:w?`input-change`:!1;let[Ve,He]=jU({controlled:i,default:Fe?r??HM:r,name:`Combobox`,state:`selectedValue`}),Ue=v1.useMemo(()=>x===null?()=>!0:x===void 0?t1(ie,de):x,[x,ie,de]),We=jM(()=>Le?o??``:Ie?fe(Ve):``).current,[Ge,Ke]=jU({controlled:s,default:We,name:`Combobox`,state:`inputValue`}),[qe,Je]=jU({controlled:c,default:l,name:`Combobox`,state:`open`}),Ye=xX(oe),Xe=!qe&&J!==null?J:String(Ge).trim(),Ze=Ie?fe(Ve):``,Qe=Ie&&!pe&&Xe!==``&&Ze.length===Xe.length&&ie.contains(Ze,Xe),$e=Qe?``:S??Xe,et=Re&&ze&&Qe&&(!ae||ae.hasValue(Ve,A)),tt=v1.useMemo(()=>oe?SX(oe):HM,[oe]),nt=v1.useMemo(()=>{if(b&&!et)return b;if(!oe)return HM;if(Ye){let e=oe,t=[],n=0;for(let r of e){if(F>-1&&n>=F)break;let e=F>-1?F-n:1/0,i=$e===``?r.items.slice(0,e):[];if($e!==``)for(let t of r.items){if(i.length>=e)break;Ue(t,$e,de)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if($e===``)return F>-1?tt.slice(0,F):tt;let e=[];for(let t of tt){if(F>-1&&e.length>=F)break;Ue(t,$e,de)&&e.push(t)}return e},[b,et,oe,Ye,$e,F,Ue,de,tt]),rt=v1.useMemo(()=>{if(le&&nt===b)return le.values;let e=SX(nt);return se?e.map(e=>se(e)):e},[nt,b,le,se]),it=jM(()=>{let e=null;return M&&qe&&Re&&u!==`none`&&(e=pX(rt,Ve,A,Fe)),new KR({id:q,labelId:void 0,selectedValue:Ve,open:qe,items:ce,selectionMode:u,name:Pe,form:p,disabled:Ne,readOnly:h,required:g,grid:v,virtualized:j,openOnInputClick:C,itemToStringLabel:ue,isItemEqualToValue:A,modal:P,autoHighlight:Be,submitOnItemClick:z,hasInputValue:Le,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:M,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:UM,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:u===`none`},{onOpenChangeComplete:VM,setOpen:VM,setInputValue:VM,setSelectedValue:VM,setIndices:VM,handleSelection:VM,forceMount:VM,requestSubmit:VM,listRef:_e,labelsRef:ve,popupRef:ye,emptyRef:Ce,inputRef:be,startDismissRef:xe,endDismissRef:Se,keyboardActiveRef:we,chipsContainerRef:Ee,clearRef:De,valuesRef:je,pointerDownItemRef:Me,selectionEventRef:Oe},Q$)}).current,at=u===`none`?Ge:Ve,ot=v1.useMemo(()=>u===`none`?at:Array.isArray(Ve)?Ve.map(e=>TX(e,k)):TX(Ve,k),[at,k,u,Ve]),st=$(d),ct=$(n),lt=it.useState(`activeIndex`),ut=it.useState(`selectedIndex`),dt=it.useState(`positionerElement`),ft=it.useState(`listElement`),pt=it.useState(`triggerElement`),mt=it.useState(`inputElement`),ht=it.useState(`inputGroupElement`),gt=it.useState(`inline`),_t=it.useState(`inputInsidePopup`),vt=it.useState(`inputOwnsFormValue`),yt=Ie&&!_t&&Ge===Ze,bt=iF(pt),{mounted:xt,setMounted:St,transitionStatus:Ct}=rz(qe),{openMethod:wt,triggerProps:Tt}=kV(qe),Et=$(()=>ot);$Y(_t?bt:be,q,at,Et,!Ne,f);let Dt=$(()=>{oe?ve.current=rt.map(fe):it.set(`forceMounted`,!0)}),Ot=$((e,t,n)=>{if(t===-1){if(ke.current===p1)return;ke.current=p1}else ke.current={value:e,index:t};st(e,zte(n,void 0,{index:t}))}),kt=$(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),it.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?Ot(void 0,-1,r):Ot(je.current[n],n,r)}),At=$((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Te.current=n.reason===NP,n.reason===`input-change`){qe&&J!==null&&he(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&me(!0),Ae.current={hasQuery:e};let n=it.state.listElement;if(!it.state.virtualized&&n){let e=ye.current;for(let t of wj(n.firstElementChild??n)){if(!dj(t)||(e?!AN(e,t):t.getAttribute(`role`)===`dialog`))break;if(u1(t)){t.scrollTop=0;break}}}e&&Be&&it.state.activeIndex==null&&(qe||gt)&&it.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&it.state.inputInsidePopup&&(Ae.current={hasQuery:!1,selection:!0});Ke(t)}}),jt=$(e=>{let t=!e&&_t&&!gt&&Ge!==``&&(String(Ge).trim()===J||Ge===Ze);!e&&(t||Ge===``||yt)&&me(!1),he(null),t&&At(``,GP(NP))}),Mt=$((t,n)=>{if(qe!==t&&(n.reason===`escape-key`&&Re&&rt.length===0&&!Ce.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&J!==null&&jt(n.reason===MP),!t&&pe&&(Ie?(gt||he(Xe),Xe===``&&me(!1)):Fe&&(gt||he(Xe),_t&&kt({activeIndex:null}),(!_t||gt)&&At(``,GP(NP,n.event,void 0,{isItemPress:n.reason===AP})))),Je(t),!t&&_t&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(ee(!0),te(!1),ne===`onBlur`)))){let e=u===`none`?Ge:Ve;K.commit(e)}}),Nt=$((e,t)=>{a?.(e,t),!t.isCanceled&&(He(e),(u===`none`&&ye.current&&N||Ie&&!it.state.inputInsidePopup)&&At(fe(e),GP(t.reason,t.event)))}),Pt=$((e,t)=>{let n=jN(e),r=Oe.current??e;Oe.current=null;let i=GP(AP,r),a=n?.closest(`a`)?.getAttribute(`href`);if(a)a.startsWith(`#`)&&Mt(!1,i);else if(Fe){let e=Array.isArray(Ve)?Ve:[],n=uX(e,t,A),r=n?hX(e,t,A):[...e,t];if(Nt(r,i),i.isCanceled||!(be.current&&be.current.value.trim()!==``))return;if(it.state.inputInsidePopup){At(``,GP(NP,i.event,void 0,{isItemPress:!0}));let e=Ae.current;e&&!n&&(e.toggledValue=t)}else Mt(!1,i)}else{if(Nt(t,i),i.isCanceled)return;Mt(!1,i)}}),Ft=$(()=>{let e=K.inputRef.current?.form??it.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),It=$(()=>{if(St(!1),ct?.(!1),me(!1),he(null),kt(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Fe&&be.current&&be.current.value!==``&&!Te.current&&At(``,GP(NP)),Ie){if(it.state.inputInsidePopup)be.current&&be.current.value!==``&&At(``,GP(NP));else{let e=fe(Ve);be.current&&be.current.value!==e&&At(e,GP(e===``?NP:TP))}}}),Lt=v1.useMemo(()=>gt&&dt?{current:dt.closest(`[role="dialog"]`)}:ye,[gt,dt]);dz({enabled:!e.actionsRef,open:qe,ref:Lt,onComplete(){qe||It()}}),v1.useImperativeHandle(e.actionsRef,()=>({unmount:It}),[It]),Q(function(){let e=ge.current!==null&&J===null;if(ge.current=J,qe&&(!e||!Re)||(qe||(Me.current=null),u===`none`))return;let t=Re?rt:je.current;kt({selectedIndex:pX(t,Ve,A,Fe)})},[qe,J,Ve,u,Fe,Re,rt,A,kt]),Q(()=>{oe&&(je.current=rt,_e.current.length=rt.length)},[oe,rt]),Q(()=>{let e=Ae.current;if(e){let t=qe||gt||it.state.positionerElement?.hidden===!1;if(e.hasQuery)Be&&t&&it.set(`activeIndex`,0),Ae.current=null;else if(String(Ge).trim()===``&&(Ae.current=null,t)){let t=e.selection;Be===`always`&&!t&&it.state.selectionMode===`none`&&it.set(`activeIndex`,0),queueMicrotask(()=>{if(!it.state.open&&!it.state.inline||be.current&&be.current.value.trim()!==``)return;let n=it.state.selectedValue,r=it.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:it.state.selectionMode!==`none`&&n!=null){let t=Re||ze?rt:je.current,i=dX(t,e.toggledValue,it.state.isItemEqualToValue);it.set(`activeIndex`,i===-1?pX(t,n,it.state.isItemEqualToValue,r):i)}else t?it.set(`activeIndex`,null):Be===`always`&&it.set(`activeIndex`,0)})}}if(!qe&&!gt)return;let t=Re||ze?rt:je.current,n=it.state.activeIndex;if(n==null){if(Be===`always`&&t.length>0){it.set(`activeIndex`,0);return}Ot(void 0,-1,TP);return}if(n>=t.length){Ot(void 0,-1,TP),it.set(`activeIndex`,null);return}let r=t[n],i=ke.current.value,a=i!==f1&&cX(r,i,it.state.isItemEqualToValue);ke.current.index===n&&a||Ot(r,n,TP)},[lt,Be,Ot,ze,Re,rt,gt,qe,it,Ge]),Q(()=>{U(u===`none`?String(Ge)!==``:Fe?Array.isArray(Ve)&&Ve.length>0:Ve!=null)},[U,u,Ge,Ve,Fe]),v1.useEffect(()=>{Re&&Be&&rt.length===0&&kt({activeIndex:null})},[Re,Be,rt.length,kt]);function Rt(){qe&&Xe!==``&&Xe!==String(We)&&!yt&&me(!0)}function zt(){qe&&J!==null&&jt(!1)}let Bt=!1;function Vt(){!Bt&&Ge!==Ze&&(Bt=!0,At(Ze,GP(TP)))}function Ht(){u!==`none`&&(B(Pe),V(lX(Ve,H.initialValue,A)),K.change(Ve),Ie&&!Le&&!_t&&Vt())}function Ut(){Ie&&!Le&&!_t&&!pe&&Vt()}function Wt(){u===`none`&&(B(Pe),V(Ge!==H.initialValue),K.change(Ge))}TV(Xe,Rt),TV(qe,zt),TV(Ve,Ht),TV(Ze,Ut),TV(oe,Ut),TV(Ge,Wt);let Gt=Wz({open:gt?!0:qe,onOpenChange:Mt,elements:{reference:_t?pt:mt,floating:dt}}),Kt=v?`grid`:`listbox`,qt=qe||gt,Jt=qt?`true`:`false`,Yt=v1.useMemo(()=>{let e=mt?.tagName===`INPUT`,t=mt==null||e,n=t||qt,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=Jt,r[`aria-haspopup`]=Kt,r[`aria-controls`]=qt?ft?.id:void 0,r[`aria-autocomplete`]=h?`none`:I),{reference:r,floating:{role:`presentation`}}},[mt,qt,Jt,Kt,ft?.id,I,h]),Xt=fR(Gt,{enabled:!Ne&&C,event:`mousedown-only`,toggle:!1,touchOpenDelay:_t?0:100,reason:PP}),Zt=mR(Gt,{enabled:!Ne&&!gt,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:gt?!0:void 0,outsidePress(e){let t=jN(e);return!AN(pt,t)&&!AN(De.current,t)&&!AN(Ee.current,t)&&!AN(ht,t)}}),Qt=bB(Gt,{enabled:!Ne,id:q,listRef:_e,activeIndex:lt,selectedIndex:ut,virtual:!0,loopFocus:D,allowEscape:D&&!Be,focusItemOnOpen:pe||u===`none`&&!Be?!1:`auto`,focusItemOnHover:E,resetOnPointerLeave:!T,orientation:v?`horizontal`:void 0,rtl:re===`rtl`,disabledIndices:HM,grid:v?R$:void 0,onNavigate(e,t){(t||qe)&&Ct!==`ending`&&kt(t?{activeIndex:e,type:we.current?RP:zP}:{activeIndex:e})}}),$t=v1.useMemo(()=>$I(Qt.reference,{onKeyDown(e){v&&it.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},Zt.reference,Xt.reference,Yt.reference),[Qt.reference,Zt.reference,Xt.reference,Yt.reference,v,it]),en=v1.useMemo(()=>$I(Dz,Zt.floating),[Zt.floating]),tn=v1.useMemo(()=>$I(Qt.floating,Yt.floating),[Qt.floating,Yt.floating]),nn=v1.useMemo(()=>{let e=Qt.item;return e?{...e,onFocus:void 0}:UM},[Qt.item]);it.useContextCallback(`setOpen`,Mt),it.useContextCallback(`setInputValue`,At),it.useContextCallback(`setSelectedValue`,Nt),it.useContextCallback(`setIndices`,kt),it.useContextCallback(`handleSelection`,Pt),it.useContextCallback(`forceMount`,Dt),it.useContextCallback(`requestSubmit`,Ft),it.useContextCallback(`onOpenChangeComplete`,n),kY(()=>{it.update({inline:M,popupProps:en,listProps:tn,inputProps:$t,triggerProps:Tt,itemProps:nn})});let rn={id:q,selectedValue:Ve,open:qe,mounted:xt,transitionStatus:Ct,items:ce,inline:M,popupProps:en,listProps:tn,inputProps:$t,triggerProps:Tt,itemProps:nn,openMethod:wt,selectionMode:u,name:Pe,form:p,disabled:Ne,readOnly:h,required:g,grid:v,virtualized:j,openOnInputClick:C,itemToStringLabel:ue,modal:P,autoHighlight:Be,isItemEqualToValue:A,submitOnItemClick:z,hasInputValue:Le};Q(()=>{it.update({...rn,inputOwnsFormValue:u===`none`&&(M||!it.state.inputInsidePopup)})},[it,...Object.values(rn)]);let an=ZP(_,K.inputRef),on=v1.useMemo(()=>({query:Xe,hasItems:Re,filteredItems:nt,flatFilteredValues:rt}),[Xe,Re,nt,rt]),sn=v1.useMemo(()=>Array.isArray(at)?``:TX(at,k),[at,k]),cn=Fe&&Array.isArray(Ve)&&Ve.length>0,ln=Fe||u===`none`&&vt?void 0:Pe,un=v1.useMemo(()=>!Fe||!Array.isArray(Ve)||!Pe?null:Ve.map(e=>{let t=TX(e,k);return(0,y1.jsx)(`input`,{type:`hidden`,form:p,name:Pe,value:t,disabled:Ne},t)}),[Fe,Ve,p,Pe,k,Ne]),dn=(0,y1.jsxs)(v1.Fragment,{children:[e.children,(0,y1.jsx)(`input`,{...K.getValidationProps(Ne,{onFocus(){_t?pt?.focus():(be.current||pt)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Ne||h)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=GP(TP,e.nativeEvent),i=()=>je.current.findIndex(e=>TX(e,k).toLowerCase()===n||fe(e).toLowerCase()===n);function a(){if(Fe)return;if(u===`none`){At(t,r);return}let e=i();e===-1&&(e=je.current.findIndex((e,t)=>{let r=ve.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:je.current[e];a!=null&&Nt?.(a,r)}Ie&&(Dt(),oe&&i()===-1&&it.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:q&&ln==null?`${q}-hidden-input`:void 0,form:p,name:ln,autoComplete:L,disabled:Ne,required:g&&!cn,readOnly:h,value:sn,ref:an,style:ln?TF:wF,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),un]});return(0,y1.jsx)(K$.Provider,{value:it,children:(0,y1.jsx)(q$.Provider,{value:Gt,children:(0,y1.jsx)(Y$.Provider,{value:Re,children:(0,y1.jsx)(J$.Provider,{value:on,children:(0,y1.jsx)(X$.Provider,{value:Ge,children:dn})})})})})}var v1,y1,b1=s((()=>{RI(),v1=d(m(),1),NU(),eN(),jY(),mF(),rF(),oF(),EF(),PM(),YR(),WM(),Aj(),IB(),z$(),XR(),KP(),WP(),Z$(),$$(),pz(),QY(),eX(),MX(),sX(),n1(),l1(),az(),jV(),d1(),DV(),BY(),Uz(),hL(),EX(),_X(),m1(),$V(),g1(),y1=d(O(),1)}));function x1(e){let{openOnInputClick:t=!1,value:n,defaultValue:r,onValueChange:i,mode:a=`list`,itemToStringValue:o,...s}=e,c=(a===`inline`||a===`both`)&&!e.readOnly,l=a===`inline`||a===`none`,u=n!==void 0,[d,f]=S1.useState(r??``),[p,m]=S1.useState(``);S1.useEffect(()=>{(u||!c)&&m(``)},[n,u,c]);let h;h=c&&p!==``?p:u?n??``:d;let g=c1({locale:s.locale}),_=String((u?n:d)??``).trim(),v=l||s.filter===null?null:s.filter??g.contains;function y(e,t){m(``),u||f(e),i?.(e,t)}function b(t,n){e.onItemHighlighted?.(t,n),n.reason!==`pointer`&&m(c&&t!=null?wX(t,o):``)}return(0,C1.jsx)(_1,{...s,itemToStringLabel:o,openOnInputClick:t,selectionMode:`none`,fillInputOnItemPress:!0,filter:v,filterQuery:a===`both`?_:void 0,autoComplete:a,inputValue:h,defaultInputValue:r,onInputValueChange:y,onItemHighlighted:b})}var S1,C1,w1=s((()=>{S1=d(m(),1),b1(),l1(),EX(),WP(),C1=d(O(),1)})),T1,E1,D1=s((()=>{lP(),T1=`data-popup-side`,E1=`data-list-empty`})),O1,k1=s((()=>{lP(),qY(),D1(),O1={...oP,...KY,popupSide:e=>e?{[T1]:e}:null,listEmpty:e=>e?{[E1]:``}:null}}));function A1(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function j1(){return H$().filteredItems.length===0}function M1(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function N1(e,t){let n=e>=t-1?t-2:e;return n>=0?n:void 0}function P1(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}var F1=s((()=>{Z$()}));function I1(){return L1.useContext(R1)}var L1,R1,z1=s((()=>{L1=d(m(),1),R1=L1.createContext(void 0)}));function B1(e){let t=V1.useContext(H1);if(t===void 0&&!e)throw Error(LI(21));return t}var V1,H1,U1=s((()=>{RI(),V1=d(m(),1),H1=V1.createContext(void 0)})),W1,G1,K1,q1=s((()=>{W1=d(m(),1),rF(),EF(),uU(),KP(),WP(),Z$(),G1=d(O(),1),K1=W1.forwardRef(function(e,t){let n=B$(),{buttonRef:r,getButtonProps:i}=uV({native:!1}),a=ZP(t,r);function o(e){n.context.setOpen(!1,GP(jP,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,G1.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:TF})})})),J1,Y1,X1,Z1=s((()=>{J1=d(m(),1),mF(),SN(),_V(),TL(),Z$(),k1(),QY(),qY(),iX(),z1(),XR(),U1(),KP(),WP(),$V(),q1(),F1(),Y1=d(O(),1),X1=J1.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,setFocused:d,validationMode:f,validation:p}=JY(),{labelId:m}=tX(),h=I1(),g=!!B1(!0),_=B$(),v=U$(),y=XV(),b=_.useState(`required`),x=_.useState(`disabled`),S=_.useState(`readOnly`),C=_.useState(`name`),w=_.useState(`form`),T=_.useState(`selectionMode`),E=_.useState(`autoHighlight`),D=_.useState(`inputProps`),O=_.useState(`triggerProps`),k=_.useState(`open`),A=_.useState(`mounted`),j=_.useState(`selectedValue`),M=_.useState(`id`),N=_.useState(`inline`),P=_.useState(`modal`),F=!!E,I=A1(_),L=l||x||i,R=j1(),z=g||N,B=!z||P,V=gV(a??(z?void 0:M)),H=g?WY:c,[U,W]=J1.useState(null),G=J1.useRef(!1),ee=J1.useRef(null),te=J1.useRef(!1),ne=T===`none`&&!g,K=$(e=>{let t=g||_.state.inline;t&&!_.state.hasInputValue&&_.context.setInputValue(``,GP(TP)),_.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:ne})}),re=g?s:p.getValidationProps(L,s);function q(){_.context.setIndices({activeIndex:null,selectedIndex:null,type:_.context.keyboardActiveRef.current?RP:zP})}function ie(){_.context.keyboardActiveRef.current=!1}let ae={...H,open:k,disabled:L,readOnly:S,popupSide:I,listEmpty:R};function oe(e){if(!h)return;let t,{highlightedChipIndex:n}=h,r=h.chipsRef.current.length,[i,a]=M1(y);return n===void 0?(e.key===i&&(e.currentTarget.selectionStart??0)===0&&j.length>0&&(e.preventDefault(),t=r>0?r-1:void 0),t):(e.key===i?(e.preventDefault(),t=n>0?n-1:void 0):e.key===a?(e.preventDefault(),t=n<r-1?n+1:void 0):(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),t=N1(n,j.length),q()),t)}let se=gL(`input`,e,{state:ae,ref:[t,_.context.inputRef,K],props:[D,O,{value:U??v,"aria-readonly":S||void 0,"aria-required":b||void 0,"aria-labelledby":m,disabled:L,readOnly:S,required:T===`none`?b:void 0,form:w,...ne&&C&&{name:C},id:V,onFocus(){if(d(!0),!N||!te.current)return;te.current=!1;let e=ee.current;e!=null&&Object.hasOwn(_.context.valuesRef.current,e)&&_.context.setIndices({activeIndex:e})},onBlur(){u(!0),d(!1);let e=_.state.activeIndex;if(N&&e!==null&&E!==`always`&&(ee.current=e,te.current=!0,_.context.setIndices({activeIndex:null})),f===`onBlur`){let e=T===`none`?v:j;p.commit(e)}},onCompositionStart(e){uN||(G.current=!0,W(e.currentTarget.value))},onCompositionEnd(e){G.current=!1;let t=e.currentTarget.value;W(null),_.context.setInputValue(t,GP(MP,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=G.current||!r;function a(e){!S&&!L&&e&&i&&(_.context.setOpen(!0,GP(MP,t)),F||q())}if(G.current){let n=e.currentTarget.value;W(n),n===``&&!_.state.openOnInputClick&&!_.state.inputInsidePopup&&_.context.setOpen(!1,GP(NP,t));let r=n.trim(),i=F&&r!==``;a(r),k&&_.state.activeIndex!==null&&!i&&q();return}let o=GP(MP,t);if(_.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=GP(NP,t);s&&!_.state.inputInsidePopup&&(T===`single`&&_.context.setSelectedValue(null,c),_.state.openOnInputClick||_.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),k&&_.state.activeIndex!==null&&!F&&q()},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(_.context.keyboardActiveRef.current=!0,L||S){S&&e.key===`Enter`&&k&&_.state.activeIndex!==null&&CN(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=y===`rtl`;if(e.key===`Home`){CN(e);let n=hN&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){CN(e);let i=hN&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!A&&e.key===`Escape`){let t=T===`multiple`&&Array.isArray(j)?j.length===0:j===null,n=GP(IP,e.nativeEvent),r=T===`multiple`?[]:null;_.context.setInputValue(``,n),_.context.setSelectedValue(r,n),t||_.state.inline||n.isPropagationAllowed||e.stopPropagation();return}if(h&&e.key===`Backspace`&&t.value===``&&h.highlightedChipIndex===void 0&&Array.isArray(j)&&j.length>0){let t=h.chipsRef.current.length,n=t>0?t-1:j.length-1,r=j.filter((e,t)=>t!==n);q(),_.context.setSelectedValue(r,GP(TP,e.nativeEvent));return}let i=h?.highlightedChipIndex!==void 0,a=oe(e);if(h?.setHighlightedChipIndex(a),a===void 0?i&&_.context.inputRef.current?.focus():h?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&k){let t=_.state.activeIndex,n=e.nativeEvent;if(t===null){if(N)return;_.context.setOpen(!1,GP(TP,n));return}CN(e),P1(_,t,n)}},onPointerMove:ie,onPointerDown:ie},re],stateAttributesMapping:O1}),ce=g?(0,Y1.jsx)(ZY.Provider,{value:XY,children:se}):se;return(0,Y1.jsxs)(J1.Fragment,{children:[k&&B&&(0,Y1.jsx)(K1,{ref:_.context.startDismissRef}),ce]})})}));function Q1(){return $1.useContext(e0)}var $1,e0,t0=s((()=>{$1=d(m(),1),O(),e0=$1.createContext(null)}));function n0(e){let{children:t}=e,{filteredItems:n}=H$(),r=Q1(),i=r?r.items:n;return(0,i0.jsx)(r0.Fragment,{children:i.map(t)})}var r0,i0,a0=s((()=>{r0=d(m(),1),Z$(),t0(),i0=d(O(),1)})),o0,s0,c0,l0=s((()=>{o0=d(m(),1),mF(),TL(),Z$(),U1(),a0(),vW(),XR(),F1(),s0=d(O(),1),c0=o0.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=B$(),l=V$(),u=!!B1(!0),{filteredItems:d,hasItems:f}=H$(),p=c.useState(`selectionMode`),m=c.useState(`grid`),h=c.useState(`readOnly`),g=c.useState(`listProps`),_=c.useState(`virtualized`),v=c.useState(`forceMounted`),y=p===`multiple`,b=d.length===0,x=$(e=>{c.set(`positionerElement`,e)}),S=$(e=>{c.set(`listElement`,e)}),C=o0.useMemo(()=>typeof o==`function`?n||=(0,s0.jsx)(n0,{children:o}):o,[o]),w={empty:b},T=l.useState(`floatingId`),E=gL(`div`,e,{state:w,ref:[t,S,u?null:x],props:[g,{children:C,tabIndex:-1,id:T,role:m?`grid`:`listbox`,"aria-multiselectable":y?`true`:void 0,"aria-readonly":!m&&h?!0:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;CN(e),P1(c,t,e.nativeEvent)}},onKeyDownCapture(){c.context.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.context.keyboardActiveRef.current=!1}},s]});if(_)return E;let D=f&&!v?void 0:c.context.labelsRef;return(0,s0.jsx)(lW,{elementsRef:c.context.listRef,labelsRef:D,children:E})})}));function u0(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function d0(){let e=JM(),t=f0.useRef(null);return f0.useEffect(()=>{if(cN)return;let n=t.current;if(n==null)return;let r=u0(n);if(r==null)return;let i=r.data,a=`${i}${p0}`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}var f0,p0,m0=s((()=>{f0=d(m(),1),SN(),ZM(),p0=`⁠`}));function h0(){let e=g0.useContext(_0);if(e===void 0)throw Error(LI(20));return e}var g0,_0,v0=s((()=>{RI(),g0=d(m(),1),_0=g0.createContext(void 0)})),y0,b0,x0,S0=s((()=>{y0=d(m(),1),IB(),Z$(),v0(),b0=d(O(),1),x0=y0.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=B$(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,b0.jsx)(_0.Provider,{value:n,children:(0,b0.jsx)(zL,{ref:t,...r})}):null})})),C0,w0,T0,E0=s((()=>{C0=d(m(),1),eN(),mF(),GV(),Z$(),U1(),F1(),bH(),v0(),jL(),wH(),OH(),VH(),w0=d(O(),1),T0=C0.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=OL,style:g,..._}=e,v=B$(),y=V$(),b=h0(),x=v.useState(`modal`),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`openMethod`),T=v.useState(`positionerElement`),E=v.useState(`triggerElement`),D=v.useState(`inputElement`),O=v.useState(`inputGroupElement`),k=v.useState(`inputInsidePopup`),A=v.useState(`transitionStatus`),j=j1(),M=hH({anchor:i??(k?E:O??D),floatingRootContext:y,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});RH(S&&x,w===`touch`,T,E);let N={open:S,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:j};Q(()=>{v.set(`popupSide`,M.side)},[v,M.side]);let P=$(e=>{v.set(`positionerElement`,e)}),F=DH(e,N,{styles:M.positionerStyles,transitionStatus:A,props:_,refs:[t,P],hidden:!C,inert:!S});return(0,w0.jsxs)(H1.Provider,{value:M,children:[C&&x&&(0,w0.jsx)(CH,{inert:WV(!S),cutout:O??D??E}),F]})})})),D0,O0,k0,A0,j0=s((()=>{D0=d(m(),1),eN(),IB(),TL(),Z$(),lP(),U1(),pz(),KN(),XR(),EH(),q1(),n1(),F1(),O0=d(O(),1),k0={...sP,...GN},A0=D0.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=B$(),l=B1(),u=V$(),d=c.useState(`mounted`),f=c.useState(`open`),p=c.useState(`openMethod`),m=c.useState(`popupProps`),h=c.useState(`transitionStatus`),g=c.useState(`inputInsidePopup`),_=c.useState(`inputElement`),v=c.useState(`modal`),y=c.useState(`id`),b=j1(),x=s.id??(g?e1(y):void 0);Q(()=>(c.set(`popupId`,c.context.popupRef.current?.id||x),()=>{c.set(`popupId`,void 0)}),[c,x]),dz({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete(!0)}});let S=gL(`div`,e,{state:{open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:b},ref:[t,c.context.popupRef],props:[m,{id:x,role:g?`dialog`:`presentation`,onFocus(e){let t=jN(e.nativeEvent);p!==`touch`&&(AN(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},TH(h),s],stateAttributesMapping:k0}),C=a===void 0?g?e=>e===`touch`?c.context.popupRef.current:_:!1:a,w;w=o??(g?void 0:!1);let T=!g||v;return(0,O0.jsx)(sR,{context:u,disabled:!d,modal:T,openInteractionType:p,initialFocus:C,returnFocus:w,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:(0,O0.jsxs)(D0.Fragment,{children:[S,T&&(0,O0.jsx)(K1,{ref:c.context.endDismissRef})]})})})})),M0,N0,P0=s((()=>{M0=d(m(),1),N0=M0.createContext(void 0)}));function F0(){return I0.useContext(L0)}var I0,L0,R0=s((()=>{I0=d(m(),1),L0=I0.createContext(!1)}));function z0(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=V0.useRef(null),m=GU({guess:!0,index:l,textRef:p}),h=B$(),g=F0(),_=W$(),v=h.useState(`selectionMode`),y=h.useState(`disabled`),b=h.useState(`readOnly`),x=h.useState(`isItemEqualToValue`),S=y||u,C=v!==`none`,w=l??i??m.index,T=w!==-1,E=h.useState(`id`),D=h.useState(`isActive`,w),O=h.useState(`isSelected`,c),k=h.useState(`itemProps`),A=V0.useRef(null),j=E!=null&&T?`${E}-${w}`:void 0,M=O&&C;Q(()=>{if(!T||!r&&l==null)return;let e=h.context.listRef.current;return e[w]=A.current,()=>{delete e[w]}},[T,r,w,l,h]),Q(()=>{if(!T||_)return;let e=h.context.valuesRef.current;return e[w]=c,()=>{delete e[w]}},[T,_,w,c,h]),Q(()=>{if(!T||_)return;let e=h.state.selectedValue,t=h.state.selectedIndex;h.state.selectionMode===`multiple`&&Array.isArray(e)?t=mX(w,c,h.context.valuesRef.current,e,x,t):cX(c,e,x)&&(t=w),h.set(`selectedIndex`,t)},[T,_,h,w,c,x]);let{getButtonProps:N,buttonRef:P}=uV({disabled:S,focusableWhenDisabled:!0,native:d,composite:!0}),F={disabled:S,selected:M,highlighted:D};function I(e){function t(){h.context.handleSelection(e,c)}h.state.submitOnItemClick?(H0.flushSync(t),h.context.requestSubmit()):t()}let L={id:j,role:g?`gridcell`:`option`,"aria-selected":C?M:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){S||b||I(e.nativeEvent)},onMouseUp(e){let t=h.context.pointerDownItemRef.current===e.currentTarget;h.context.pointerDownItemRef.current=null,!(S||b||e.button!==0||t||!D)&&I(e.nativeEvent)}},R=gL(`div`,t,{ref:[P,n,m.ref,A],state:F,props:[k,L,f,N]}),z=V0.useMemo(()=>({selected:M,textRef:p}),[M,p]);return(0,U0.jsx)(N0.Provider,{value:z,children:R})}function B0(e){let{componentProps:t,forwardedRef:n}=e,r=B$().useState(`isItemEqualToValue`),{flatFilteredValues:i}=H$(),a=dX(i,t.value??null,r);return(0,U0.jsx)(z0,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}var V0,H0,U0,W0,G0=s((()=>{V0=d(m(),1),H0=d(g(),1),eN(),Z$(),qU(),TL(),P0(),uU(),R0(),_X(),U0=d(O(),1),W0=V0.memo(V0.forwardRef(function(e,t){let n=B$().useState(`virtualized`);return n&&e.index==null?(0,U0.jsx)(B0,{componentProps:e,forwardedRef:t}):(0,U0.jsx)(z0,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})}))})),K0,q0=s((()=>{G0(),K0=W0})),J0,Y0,X0=s((()=>{J0=d(m(),1),TL(),Z$(),m0(),Y0=J0.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=H$(),c=B$(),l=d0(),u=s.length===0?a:null;return gL(`div`,e,{ref:[t,c.context.emptyRef,l],props:[{children:u,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})})})),Z0=s((()=>{w1(),Z$(),mF(),ZM(),SF(),TL(),uU(),k1(),QY(),iX(),XR(),GW(),KP(),WP(),IB(),sX(),n1(),F1(),Z1(),Aj(),vP(),az(),KN(),pz(),lP(),l0(),m0(),S0(),E0(),j0(),U1(),RI(),t0(),eN(),_V(),q0(),R0(),a0(),X0(),l1()})),Q0=s((()=>{Z0()}));function $0({text:e,onText:t,items:n,itemKey:r,itemLabel:i,itemClassName:a,renderItem:o,onPick:s,open:c,onOpenChange:l,inputProps:u,inputRef:d,popupRef:f,anchorRef:p,fit:m=`min-width`,popupClassName:h,listClassName:g,empty:_,emptyClassName:v,portal:y=`dialog`,autoHighlight:b=!0,onHighlight:x}){let S=(0,e2.useRef)(null),[C,w]=(0,e2.useState)(null);(0,e2.useEffect)(()=>{w(y===`body`?null:S.current?.closest(`dialog, [role="dialog"]`))},[y]);let[T,E]=(0,e2.useState)(null);(0,e2.useLayoutEffect)(()=>{let e=p?.current??S.current;if(!c||m!==`width`||!e)return;let t=()=>{let t=Jo(e).width;E(t>0?t:null)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[c,m,p]);let D=e=>{S.current=e,typeof d==`function`?d(e):d&&(d.current=e)},{onKeyDown:O,onFocus:k,...A}=u;return(0,t2.jsxs)(x1,{items:n,filteredItems:n,itemToStringValue:i,value:e,onValueChange:(e,n)=>{n.reason!==`item-press`&&t(String(e??``))},open:c,onOpenChange:l,openOnInputClick:!0,autoHighlight:b,onItemHighlighted:x&&(e=>x(e)),children:[(0,t2.jsx)(X1,{...A,ref:D,onFocus:k,onKeyDown:e=>{O?.(e),!e.defaultPrevented&&e.key===`Escape`&&c&&(e.preventDefault(),e.stopPropagation(),l(!1))}}),(0,t2.jsx)(x0,{container:C??pG(),children:(0,t2.jsx)(T0,{anchor:()=>{let e=p?.current??S.current;return e?gU(e):null},positionMethod:`fixed`,side:`bottom`,align:`start`,sideOffset:4,collisionBoundary:_U(),collisionPadding:8,style:{zIndex:40,...m===`width`?{width:T===null?`var(--anchor-width)`:`${T}px`,maxWidth:`var(--available-width)`}:{}},children:(0,t2.jsx)(A0,{ref:f,className:h,style:{...m===`width`?{width:`100%`}:{minWidth:`var(--anchor-width)`,maxWidth:`var(--available-width)`}},children:(0,t2.jsxs)(c0,{className:g,children:[_===void 0?null:(0,t2.jsx)(Y0,{className:v,children:_}),n.map(e=>(0,t2.jsx)(K0,{value:e,className:t=>a(e,t.highlighted),onClick:()=>s(e),children:o(e)},r(e)))]})})})})]})}var e2,t2,n2=s((()=>{e2=d(m(),1),Q0(),Qo(),vU(),mG(),t2=d(O(),1)}));function r2({typed:e,asked:t,placeholder:n=!1,rows:r,label:i}){let a=e.trim(),o=t===a&&!n;if(o)return{choices:r??[],answered:o};let s=a.toLowerCase();return{choices:(r??[]).filter(e=>i(e).toLowerCase().includes(s)),answered:o}}var i2=s((()=>{})),a2,o2=s((()=>{ba(),a2=pa({choicesCouldNotBeLoaded:`Choices could not be loaded. Try again.`,loadingChoices:`Loading choices…`,noMatchingChoices:`No matching choices.`,loadingName:`Loading…`,nameCouldNotBeLoaded:`Its name could not be loaded.`,tryAgain:`Try again`,noLongerAvailable:`No longer available. Change this answer.`})}));function s2(e){throw Error(`${e}: invalid form declaration.`)}function c2(e,t){return e===null?null:typeof e==`boolean`||typeof e==`string`&&e.length<=T2||typeof e==`number`&&Number.isFinite(e)&&Math.abs(e)<=2**53-1?e:s2(t)}function l2(e){return Object.freeze(e)}function u2(e,t){return{label:``,dialect:`sqlite`,readAt:``,foreignKeys:[],tables:[{name:e,schema:``,id:e,isView:!1,columns:[...t]}]}}function d2(e){let[t,n,...r]=e.split(`.`);return!r.length&&n!==void 0&&[t,n].every(e=>E2.test(e)&&!D2.has(e))}function f2(e,t,n){if((!E2.test(e.column)||D2.has(e.column))&&(!n||!d2(e.column)))throw Error(n?`${t}: "${e.column}" goes past one reference; a validation reads the record's own columns and, through one reference, that record's (order_id.status).`:`${t}: "${e.column}" is a path; a condition here reads the record's own columns.`);let r=e=>(Array.isArray(e)?e:[e]).map(e=>c2(e,t));if(e.other!==void 0){let n=O2[e.op];return n&&E2.test(e.other)&&!D2.has(e.other)||s2(t),{field:e.column,operator:n,values:[],other:e.other}}if(e.op===`isNull`)return{field:e.column,operator:`eq`,values:[null]};if(e.op===`isNotNull`)return{field:e.column,operator:`ne`,values:[null]};if(e.op===`in`)return{field:e.column,operator:`eq`,values:r(e.value)};let i=O2[e.op];if(!i)throw Error(`${t}: "${e.op}" matches text, which a condition here cannot; compare with =, !=, <, <=, >, >=, in or is empty.`);return{field:e.column,operator:i,values:r(e.value)}}function p2(e,t,n,r=`record`,i=!1){if(typeof e!=`string`||!e.trim()||e.length>2e3)throw Error(`${t}: a condition is query-language text, like "status = shipped".`);let a=Dn(`${r} ${e}`,n?{schema:u2(r,n),columnValues:!0}:{});if(a.errors[0]?.message===`me is the signed-in person, and nobody is named here to be it. Quote it ("me") to mean the text.`)throw Error(`${t} compares with me. A form's conditions and a validation read the record's own values, where the session is not; show the field always, or narrow who may write it with roles.`);if(a.errors.length)throw Error(`${t}: ${a.errors[0].message}`);let o=a.query;if(o.orderBy.length||o.columns.length||o.limit!==void 0)throw Error(`${t}: a condition is only a condition — no sort, show or limit.`);if(!o.filter.groups.length)throw Error(`${t}: a condition is query-language text, like "status = shipped".`);let s=o.filter.groups.map(e=>l2(e.map(e=>l2(f2(e,t,i)))));if(s.flat().length>16)throw Error(`${t}: a condition compares at most 16 times.`);return l2(s)}function m2(e){let t=e.type.trim().toLowerCase();if(/^(?:bool|boolean)$/.test(t))return`boolean`;if(/^(?:(?:tiny|small|medium|big)?int(?:eger)?|int[248]|(?:small|big)?serial|numeric|decimal|real|double(?: precision)?|float[48]?)(?:\s*\(\s*\d+(?:\s*,\s*\d+)?\s*\))?(?: unsigned)?$/.test(t))return`number`;if(/^(?:date)$/.test(t))return`date`;if(/^(?:timestamptz(?:\(\d+\))?|timestamp(?:\(\d+\))? with time zone)$/.test(t))return`instant`;if(/^(?:datetime|timestamp)(?:\(\d+\))?(?: without time zone)?$/.test(t))return`datetime`;if(e.allowed||/^(?:text|(?:tiny|medium|long)text|n?varchar|(?:character varying)|n?char|character|uuid|clob)(?:\(\d+\))?$/.test(t)||t.startsWith(`enum(`))return`text`}function h2(e){if(typeof e==`bigint`&&(e=e.toString()),typeof e==`number`){if(!Number.isFinite(e)||Math.abs(e)>2**53-1)return;e=String(e)}if(typeof e!=`string`||e.length>T2)return;let t=/^([+-]?)(?:(\d+)(?:\.(\d*))?|\.(\d+))(?:[eE]([+-]?\d{1,4}))?$/.exec(e.trim());if(!t)return;let n=Number(t[5]??0);if(Math.abs(n)>T2)return;let r=t[3]??t[4]??``,i=((t[2]??`0`)+r).replace(/^0+/,``)||`0`,a=r.length-n;for(;i.endsWith(`0`)&&i!==`0`;)i=i.slice(0,-1),a--;return{coefficient:BigInt((t[1]===`-`?`-`:``)+i),scale:i===`0`?0:a}}function g2(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return!1;let[,n,r,i]=t,a=Number(n),o=Number(r),s=Number(i),c=[31,a%4==0&&(a%100!=0||a%400==0)?29:28,31,30,31,30,31,31,30,31,30,31];return a>=1&&o>=1&&o<=12&&s>=1&&s<=c[o-1]}function _2(e,t){if(e instanceof Date&&t===`instant`){let t=Date.prototype.getTime.call(e);if(!Number.isFinite(t))return;e=new Date(t).toISOString()}if(typeof e!=`string`||e.length>64)return;if(t===`date`)return g2(e)?e:void 0;let n=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|[+-]\d{2}(?::?\d{2})?)?$/.exec(e);if(!n||!g2(n[1])||Number(n[2])>23||Number(n[3])>59||Number(n[4]??0)>59)return;let[,r,i,a,o=`00`,s=``,c]=n;if(t===`datetime`)return c?void 0:`${r}T${i}:${a}:${o}.${s.padEnd(9,`0`)}`;if(!c)return;let l=0;if(c!==`Z`){let e=/^([+-])(\d{2})(?::?(\d{2}))?$/.exec(c),t=Number(e[2]),n=Number(e[3]??0);if(t>14||n>59||t===14&&n!==0)return;l=(t*60+n)*(e[1]===`-`?-1:1)}let u=Date.parse(`${r}T${i}:${a}:${o}Z`)-l*6e4;return String(BigInt(u)*1000000n+BigInt(s.padEnd(9,`0`)))}function v2(e,t){let n=m2(e);if(!n)return;if(t===null)return{kind:`null`};if(n===`number`){let r=h2(t);return!r||/int|serial/i.test(e.type)&&r.scale>0?void 0:{kind:n,value:r}}if(n===`boolean`)return t===!0||t===1||t===1n||typeof t==`string`&&/^(true|yes|1|t)$/i.test(t.trim())?{kind:n,value:!0}:t===!1||t===0||t===0n||typeof t==`string`&&/^(false|no|0|f)$/i.test(t.trim())?{kind:n,value:!1}:void 0;if(n===`text`)return typeof t==`string`&&t.length<=T2?{kind:n,value:t}:void 0;let r=_2(t,n);return r===void 0?void 0:{kind:n,value:r}}function y2(e,t,n){if(!e||!n)return`unknown`;if(e.kind===`null`||n.kind===`null`){if(t!==`eq`&&t!==`ne`)return`unknown`;let r=e.kind===n.kind;return t===`eq`?r:!r}if(e.kind!==n.kind)return`unknown`;let r;if(e.kind===`number`&&n.kind===`number`){let t=Math.max(e.value.scale,n.value.scale),i=e.value.coefficient*10n**BigInt(t-e.value.scale),a=n.value.coefficient*10n**BigInt(t-n.value.scale);r=i<a?-1:+(i>a)}else if(e.kind===`instant`&&n.kind===`instant`){let t=BigInt(e.value),i=BigInt(n.value);r=t<i?-1:+(t>i)}else if(e.kind===`boolean`&&n.kind===`boolean`){if(t!==`eq`&&t!==`ne`)return`unknown`;r=e.value===n.value?0:1}else if(typeof e.value==`string`&&typeof n.value==`string`){if(e.kind===`text`&&t!==`eq`&&t!==`ne`)return`unknown`;r=e.value<n.value?-1:+(e.value>n.value)}else return`unknown`;switch(t){case`eq`:return r===0;case`ne`:return r!==0;case`lt`:return r<0;case`lte`:return r<=0;case`gt`:return r>0;case`gte`:return r>=0}}function b2(e,t){let n=e.filter(e=>e.name===t);return n.length===1?n[0]:void 0}function x2(e,t){let n=Object.getOwnPropertyDescriptor(e,t);return n&&Object.hasOwn(n,`value`)?n.value:void 0}function S2(e,t,n){let r=b2(n,e.field);if(!r)return`unknown`;if(e.other!==void 0){let i=b2(n,e.other);return!i||m2(r)!==m2(i)?`unknown`:y2(v2(r,x2(t,e.field)),e.operator,v2(i,x2(t,e.other)))}let i=e.values.map(n=>y2(v2(r,x2(t,e.field)),e.operator,v2(r,n)));return i.includes(`unknown`)?`unknown`:i.some(e=>e===!0)}function C2(e,t,n){let r=e.map(e=>e.map(e=>S2(e,t,n)));return r.flat().includes(`unknown`)?`unknown`:r.some(e=>e.every(e=>e===!0))}function w2(e,t,n){if(n==null||n===``)return null;let r=e.columns.find(e=>e.name===t);if(!r)return null;if(gt(r))return n===!0||n===1||/^(1|true|t|yes|y)$/i.test(String(n));let i=ht(r.type);if(i===`number`){let e=Number(n);return Number.isFinite(e)?e:null}if(i===`date`){let e=String(n);return/^\d{4}-\d{2}-\d{2}$/.test(e)?{day:e}:Number.isNaN(Date.parse(e))?null:{instant:new Date(e)}}return String(n)}var T2,E2,D2,O2,k2=s((()=>{St(),Yn(),T2=4096,E2=/^[^\s.\x00-\x1f\x7f]{1,256}$/u,D2=new Set([`__proto__`,`prototype`,`constructor`]),O2={"=":`eq`,"!=":`ne`,"<":`lt`,"<=":`lte`,">":`gt`,">=":`gte`}})),A2=s((()=>{cr()})),j2=s((()=>{Yn()})),M2=s((()=>{cr(),A2(),j2()})),N2=s((()=>{cr(),k2(),M2()})),P2,F2=s((()=>{N2(),cr(),P2=/^(number|code|sku|ref|reference|stock_ref)$|_(number|code|no|ref|reference)$/i}));function I2(e,t){let n=t.references?ct(e,t.references.table):void 0,r=n&&ft(n);return n&&r&&!pt(n).includes(r)?r:void 0}function L2(e,t,n,r){let i=e=>t.columns.find(t=>t.name===e),a=n?r?.[n]?.subtitle:void 0;if(typeof a==`string`&&a!==n&&i(a))return{path:a,declared:!0};let o=t.columns.filter(e=>e.name!==n&&!e.primaryKey&&!e.references),s=o.find(e=>H2(e)&&P2.test(e.name)&&(t.unique??[]).includes(e.name));if(s)return{path:s.name,declared:!1};let c=o.find(e=>H2(e)&&B2.test(e.name));if(c)return{path:c.name,declared:!1};let l=e?t.columns.find(t=>t.name!==n&&t.references&&!t.nullable&&I2(e,t)):void 0;if(l)return{path:`${l.name}.${I2(e,l)}`,declared:!1};let u=o.find(e=>ht(e.type)===`date`&&V2.test(e.name));return u?{path:u.name,declared:!1}:void 0}function R2(e){if(e==null||e===``)return;let t=String(e);return/^\d{4}-\d{2}-\d{2}[T ]\d{2}:/.test(t)?t.slice(0,10):t}function z2(e){let t=new Set,n=new Set;for(let r of e)(t.has(r)?n:t).add(r);return n}var B2,V2,H2,U2=s((()=>{F2(),St(),B2=/(^|_)e?mail(_address)?$/i,V2=/^(created|opened|started|joined|hired|registered)(_at|_on|_date)?$|^(date_)?(created|opened)$/i,H2=e=>ht(e.type)===`text`}));function W2(e,t,n,r,i){let a=J2(e,t,n,r);q2.delete(a),q2.set(a,i),q2.size>K2&&q2.delete(q2.keys().next().value)}function G2(e,t,n,r){return q2.get(J2(e,t,n,r))}var K2,q2,J2,Y2=s((()=>{K2=500,q2=new Map,J2=(e,t,n,r)=>JSON.stringify([n,typeof t==`string`?t:[t.visitor.app,t.visitor.via??``],e.from,e.by,e.labelColumn,e.query??``,typeof r,String(r)])})),X2,Z2=s((()=>{ba(),X2=pa({aFile:`A file`,signed:`Signed`})}));function Q2(e,t){let n=``,r=0;for(let i of e){if(r>=t.length)break;t4.test(i)?n+=t[r++]:n+=i}return n}function $2(e,t,n,r){let i=Number.isInteger(e)?0:r?void 0:n===void 0||Number.isInteger(n)?0:2;try{return new Intl.NumberFormat(mi(),{style:`currency`,currency:t||vi(),currencyDisplay:`narrowSymbol`,minimumFractionDigits:i,maximumFractionDigits:i}).format(e)}catch{return e.toLocaleString(mi())}}function e4(e){let t=e||vi();try{return new Intl.NumberFormat(mi(),{style:`currency`,currency:t,currencyDisplay:`narrowSymbol`}).formatToParts(0).find(e=>e.type===`currency`)?.value??t}catch{return t}}var t4,n4=s((()=>{Yi(),t4=/[0a*]/}));function r4(e,t){a4.set(e,t)}function i4(e){let t=a4.get(e);t?.url&&URL.revokeObjectURL(t.url),a4.delete(e)}var a4,o4,s4=s((()=>{a4=new Map,o4=e=>a4.get(e)}));function c4(e){return(e.type===`text`||e.type===`textarea`)&&`sensitive`in e&&!!e.sensitive}function l4(e,t){let n=new Set,r=[...e];for(let e=Math.max(r.length-4,r.length>4?0:r.length);e<r.length;e++)n.add(e);let i=r.map((e,t)=>n.has(t)?e:`•`);if(!t)return i.join(``);let a=0,o=``;for(let e of t){if(a>=i.length)break;o+=e===`0`||e===`a`||e===`*`?i[a++]:e}return o+i.slice(a).join(``)}function u4(e,t,n){if(t==null||t===``)return`—`;if(e.type===`reference`&&n)return(typeof t==`string`||typeof t==`number`?n(e,t):void 0)??`…`;let r=`mask`in e&&typeof e.mask==`string`?e.mask:void 0;if(c4(e))return l4(String(t),e.mask);if(e.type===`boolean`)return X2(t?`common.yes`:`common.no`);if(e.type===`files`){let e=Array.isArray(t)?t:[t];return e.length?e.map(e=>o4(String(e))?.name??X2(`aFile`)).join(`, `):`—`}if(e.type===`signature`)return X2(`signed`);if(e.type===`date`&&/^\d{4}-\d{2}-\d{2}$/.test(String(t)))return new Date(`${String(t)}T00:00:00Z`).toLocaleDateString(mi(),{timeZone:`UTC`,dateStyle:`medium`});if(e.type===`money`&&Number.isFinite(Number(t)))return $2(Number(t),e.currency,e.step,e.minor);if(r&&typeof t==`string`)return Q2(r,t);if(e.type===`choice`)return e.options.find(e=>e.value===t)?.label??String(t);if(e.type===`choices`){let n=Array.isArray(t)?t:[t];return n.length?n.map(t=>e.options.find(e=>e.value===t)?.label??String(t)).join(`, `):`—`}if(e.type===`group`){let r=f4(e,t,n);return r.length?r.join(`; `):`—`}return String(t)}function d4(e,t,n){let r=e.flatMap(e=>{let r=t[e.name];if(!p4(r))return[];if(e.type===`boolean`)return r?[e.label]:[];if(e.type===`reference`){let t=(typeof r==`string`||typeof r==`number`)&&n?n(e,r):void 0;return t===void 0?[]:[t]}return[u4(e,r,n)]});return r.length?r.join(`, `):void 0}function f4(e,t,n){let r=t=>e.fields.flatMap(r=>{let i=t?.[r.name];return p4(i)?[e.fields.length>1?`${r.label}: ${u4(r,i,n)}`:u4(r,i,n)]:[]});return e.repeat?(Array.isArray(t)?t:[]).map(e=>r(e).join(`, `)).filter(Boolean):r(t)}var p4,m4=s((()=>{Yi(),Z2(),n4(),s4(),p4=e=>e!=null&&e!==``&&!(Array.isArray(e)&&!e.length)})),h4=s((()=>{})),g4,_4=s((()=>{ba(),g4=pa({choose:`Choose…`,loading:`Loading…`,couldNotLoad:`The choices could not be loaded.`,nothingToChoose:`Nothing to choose from.`,noMatches:`Nothing matches.`,firstOnly:`The first {count} only. Type to search.`,path:`Path`})})),v4=l({TreePicker:()=>y4});function y4({from:e,by:t,labelColumn:n,parent:r,where:i,ask:a,scope:o,value:s,onChange:c,known:l,id:u,ariaLabel:d,listLabel:f,describedBy:p,invalid:m,required:h,disabled:g,placeholder:_,inputRef:v}){let y=$G(),b=(0,b4.useId)(),x=`${b}-tree`,S=`${b}-trail`,[C,w]=(0,b4.useState)(new Map),[T,E]=(0,b4.useState)(new Map),[D,O]=(0,b4.useState)(new Set),[k,A]=(0,b4.useState)(new Map),[j,M]=(0,b4.useState)(new Set),[N,P]=(0,b4.useState)(!1),[F,I]=(0,b4.useState)(``),[L,R]=(0,b4.useState)(!1),[z,B]=(0,b4.useState)(``),[V,H]=(0,b4.useState)(),[U,W]=(0,b4.useState)(),G=(0,b4.useRef)(C);G.current=C;let ee=(0,b4.useRef)(new Set),te=JSON.stringify([o,e,t,n,r,i??``]),[ne,K]=(0,b4.useState)(te);ne!==te&&(K(te),w(new Map),E(new Map),O(new Set),A(new Map),M(new Set),H(void 0),ee.current=new Set);let re=`show ${[...new Set([t,n,r])].join(`, `)}`,q=e=>{let i=e?.[t];if(!(typeof i==`string`||typeof i==`number`&&Number.isSafeInteger(i)))return null;let a=e[r];return{key:String(i),value:i,label:String(e[n]??i),parent:T4(a)?null:String(a)}},ie=e=>{if(!e.length)return;let t=new Map(G.current);for(let n of e)t.set(n.key,n);G.current=t,w(t)},ae=(e,t)=>y.fetchQuery({queryKey:[`tree-picker`,o,e,t],staleTime:3e4,queryFn:async()=>{let n=await a(`/api/run`,{q:e,limit:t,offset:0,count:`none`});if(n.errors?.length||!Array.isArray(n.rows))throw Error(g4(`couldNotLoad`));return n.rows}}),oe=t=>y.fetchQuery({queryKey:[`tree-picker`,o,`branches`,e,r,i??``,t],staleTime:3e4,queryFn:async()=>{let n=await a(`/api/breakdown`,{text:`${e} ${sn(i,`${r} in (${t.map(pn).join(`, `)})`)} count as children by ${r}`,limit:t.length});if(n.errors?.length||!Array.isArray(n.rows))throw Error(g4(`couldNotLoad`));return new Set(n.rows.filter(e=>Number(e.children)>0).map(e=>String(e[r])))}}),se=async t=>{if(ee.current.has(t))return;ee.current.add(t),E(e=>new Map(e).set(t,`loading`));let a=G.current.get(t),o=t===``?`${r} is empty`:`${r} = ${pn(a?a.value:t)}`;try{let r=await ae(`${e} ${sn(i,o)} ${re} sort ${n}`,201),a=r.slice(0,S4).map(q).filter(e=>e!==null);if(ie(a),E(e=>new Map(e).set(t,a.map(e=>e.key))),r.length>S4&&O(e=>new Set(e).add(t)),t!==``&&A(e=>new Map(e).set(t,a.length>0)),!a.length)return;let s=await oe(a.map(e=>e.value)).catch(()=>void 0);s&&A(e=>{let t=new Map(e);for(let e of a)t.has(e.key)&&t.get(e.key)===!1||t.set(e.key,s.has(e.key));return t})}catch{ee.current.delete(t),E(e=>new Map(e).set(t,`error`))}},ce=(e,t=C)=>{let n=[],r=new Set;for(let i=t.get(e);i&&!r.has(i.key)&&n.length<=w4;i=i.parent===null?void 0:t.get(i.parent))r.add(i.key),n.unshift(i);return n},le=async n=>{let r=e=>[...new Set(e.flatMap(e=>e.parent===null||G.current.has(e.parent)?[]:[e.parent]))],i=r(n);for(let n=0;n<w4&&i.length;n++){let n=(await ae(`${e} ${t} in (${i.map(pn).join(`, `)}) ${re}`,i.length)).map(q).filter(e=>e!==null);ie(n),i=r(n)}},ue=T4(s)?void 0:String(s);(0,b4.useEffect)(()=>{if(s===void 0||s===``)return;let n=!0,r=G.current.get(String(s));return(r?Promise.resolve(r):ae(`${e} ${sn(i,`${t} = ${pn(s)}`)} ${re}`,1).then(e=>{let t=q(e[0]);return t&&n&&ie([t]),t})).then(e=>e&&n?le([e]):void 0).catch(()=>{}),()=>{n=!1}},[s,te]);let de=L&&F.trim()!==``;(0,b4.useEffect)(()=>{let e=setTimeout(()=>B(F.trim()),150);return()=>clearTimeout(e)},[F]),(0,b4.useEffect)(()=>{if(!N||!de||!z)return;let t=!0,r=`${n} contains ${JSON.stringify(z)}`;return ae(`${e} ${sn(i,r)} ${re} sort ${n}`,C4).then(async e=>{let n=e.map(q).filter(e=>e!==null);ie(n),await le(n).catch(()=>{}),t&&H({for:z,keys:n.map(e=>e.key)})}).catch(()=>t&&H({for:z,error:!0})),()=>{t=!1}},[N,de,z,te]);let fe=(0,b4.useRef)(!1);(0,b4.useEffect)(()=>{if(!N||de){N||(fe.current=!1);return}if(se(``),fe.current||!ue)return;let e=ce(ue);if(!e.length||e[0].parent!==null)return;fe.current=!0;let t=e.slice(0,-1);M(e=>new Set([...e,...t.map(e=>e.key)]));for(let e of t)se(e.key);W(ue)},[N,de,ue,C]);let pe=e=>k.get(e)!==!1,me=[];if(de){let e=V?.for===F.trim()?V:void 0;if(!e)me.push({key:`note:`,depth:1,note:g4(`loading`)});else if(`error`in e)me.push({key:`note:`,depth:1,note:g4(`couldNotLoad`)});else if(!e.keys.length)me.push({key:`note:`,depth:1,note:g4(`noMatches`)});else for(let t of e.keys){let e=C.get(t);e&&me.push({key:t,depth:1,node:e,path:ce(t).slice(0,-1).map(e=>e.label)})}}else{let e=(t,n,r)=>{let i=T.get(t);if(i===void 0||i===`loading`)return void me.push({key:`note:${t}`,depth:n,note:g4(`loading`)});if(i===`error`)return void me.push({key:`note:${t}`,depth:n,note:g4(`couldNotLoad`)});!i.length&&t===``&&me.push({key:`note:`,depth:n,note:g4(`nothingToChoose`)});for(let t of i){let i=C.get(t);i&&!r.has(t)&&(me.push({key:t,depth:n,node:i}),j.has(t)&&pe(t)&&e(t,n+1,new Set(r).add(t)))}D.has(t)&&me.push({key:`more:${t}`,depth:n,note:g4(`firstOnly`,{count:bi(S4)})})};N&&e(``,1,new Set)}let J=me.filter(e=>e.node),he=J.find(e=>e.key===U)??(de?J[0]:void 0),ge=e=>`${b}-${me.indexOf(e)}`;(0,b4.useEffect)(()=>{N&&he&&aa(ge(he))?.scrollIntoView?.({block:`nearest`})},[N,he?.key]);let _e=e=>{M(t=>new Set(t).add(e)),se(e)},ve=e=>M(t=>{let n=new Set(t);return n.delete(e),n}),ye=()=>{P(!1),ue!==void 0&&(R(!1),I(``))},be=e=>{c(e.value,e.label),R(!1),I(``),W(e.key),P(!1)},xe=e=>{let t=he?J.indexOf(he):-1,n=e=>e&&W(e.key),r=N&&!de&&he?.node,i={ArrowDown:()=>N?n(J[Math.min(t+1,J.length-1)]):P(!0),ArrowUp:()=>N?n(J[Math.max(t-1,0)]):P(!0),Home:N&&!de?()=>n(J[0]):void 0,End:N&&!de?()=>n(J[J.length-1]):void 0,ArrowRight:r?()=>{let e=he.key,t=T.get(e);j.has(e)?Array.isArray(t)&&t.length&&W(t[0]):pe(e)&&_e(e)}:void 0,ArrowLeft:r?()=>{let e=he.node;j.has(e.key)&&pe(e.key)?ve(e.key):e.parent!==null&&J.some(t=>t.key===e.parent)&&W(e.parent)}:void 0,Enter:N&&he?.node?()=>be(he.node):void 0,Escape:N?()=>{e.stopPropagation(),ye()}:void 0}[e.key];i&&(e.preventDefault(),i())},Se=(0,b4.useRef)(null),[Ce,we]=(0,b4.useState)(null),[Te,Ee]=(0,b4.useState)(null);(0,b4.useLayoutEffect)(()=>{if(!N||!Se.current)return;let e=Se.current;Ee(e.closest(`dialog, [role="dialog"]`));let t=()=>{let t=Jo(e).width;we(t>0?t:null)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[N]);let De=L?F:ue===void 0?``:C.get(ue)?.label??l??ue,Oe=ue===void 0||L?[]:ce(ue),ke=Oe.length>1;return(0,x4.jsxs)(`div`,{className:`tree-picker`,children:[(0,x4.jsxs)(`div`,{className:`picker`,ref:Se,children:[(0,x4.jsx)(`input`,{ref:v,id:u,className:`picker-input`,role:`combobox`,"aria-label":d,"aria-expanded":N,"aria-controls":x,"aria-haspopup":de?`listbox`:`tree`,"aria-autocomplete":`list`,"aria-activedescendant":N&&he?ge(he):void 0,"aria-describedby":[p,ke?S:void 0].filter(Boolean).join(` `)||void 0,"aria-invalid":m||void 0,required:h,disabled:g,placeholder:_??g4(`choose`),autoComplete:`off`,value:De,onChange:e=>{I(e.target.value),R(!0),W(void 0),P(!0),ue!==void 0&&c(``)},onClick:()=>!g&&P(!0),onBlur:ye,onKeyDown:xe}),(0,x4.jsx)(JB,{open:N&&!g,modal:!1,onOpenChange:()=>{},children:(0,x4.jsx)(HV,{container:Te??ia(),children:(0,x4.jsx)(WH,{anchor:()=>Se.current?gU(Se.current):null,positionMethod:`fixed`,side:`bottom`,align:`start`,sideOffset:4,collisionBoundary:_U(),collisionPadding:8,style:{zIndex:40,width:Ce===null?`var(--anchor-width)`:`${Ce}px`,maxWidth:`var(--available-width)`},children:(0,x4.jsx)(cU,{role:`presentation`,initialFocus:!1,finalFocus:!1,className:`picker-popup tree-picker-popup`,onMouseDown:e=>e.preventDefault(),children:(0,x4.jsx)(`ul`,{id:x,role:de?`listbox`:`tree`,"aria-label":d??f,className:`picker-list`,children:me.map(e=>{let t=e.node;if(!t)return(0,x4.jsx)(`li`,{role:`presentation`,className:`picker-empty`,style:{paddingInlineStart:E4(e.depth)},children:e.note},e.key);let n=e===he,r=!de&&pe(t.key);return(0,x4.jsxs)(`li`,{id:ge(e),role:de?`option`:`treeitem`,"aria-level":de?void 0:e.depth,"aria-expanded":r?j.has(t.key):void 0,"aria-selected":n,className:`picker-option tree-picker-option${n?` active`:``}${t.key===ue?` chosen`:``}`,style:de?void 0:{paddingInlineStart:E4(e.depth)},onClick:()=>be(t),children:[!de&&(0,x4.jsx)(`span`,{className:`tree-picker-caret${r?``:` is-leaf`}`,"aria-hidden":`true`,onClick:e=>{e.stopPropagation(),W(t.key),r&&(j.has(t.key)?ve(t.key):_e(t.key))},children:r&&(0,x4.jsx)(Pe,{name:j.has(t.key)?`caret-down`:`caret-right`,size:12})}),(0,x4.jsx)(`span`,{className:`picker-option-label`,children:t.label}),e.path&&e.path.length>0&&(0,x4.jsx)(`span`,{className:`picker-option-detail tree-picker-path`,children:e.path.join(` › `)})]},e.key)})})})})})})]}),ke&&(0,x4.jsx)(`p`,{id:S,className:`tree-picker-trail`,"aria-label":g4(`path`),children:Oe.map((e,t)=>(0,x4.jsxs)(b4.Fragment,{children:[t>0&&(0,x4.jsx)(`span`,{className:`tree-picker-sep`,"aria-hidden":`true`,children:`›`}),(0,x4.jsx)(`span`,{children:e.label})]},e.key))})]})}var b4,x4,S4,C4,w4,T4,E4,D4=s((()=>{h4(),b4=d(m(),1),nJ(),hU(),vU(),Qo(),sa(),Yn(),Fe(),Yi(),_4(),x4=d(O(),1),S4=200,C4=20,w4=12,T4=e=>e==null||e===``,E4=e=>`calc(var(--space-2) + ${(e-1)*18}px)`})),O4=l({CommandReferenceField:()=>I4,ReferenceName:()=>N4,ReviewNamed:()=>F4,commandChoicePage:()=>B4,commandChoices:()=>z4,readReferenceName:()=>M4,run:()=>k4});async function k4(e,t){return A4(e,`/api/run`,t)}async function A4(e,t,n){if(typeof e==`string`)return is(t,{...Aa(e),...n});let{app:r,via:i}=e.visitor,a=new URLSearchParams({app:r,...i?{via:i}:{}}),o=await Xa(`${t}?${a}`,{method:`POST`,credentials:`same-origin`,signal:AbortSignal.timeout(15e3),headers:{"content-type":`application/json`,"x-mistri-read":`picker`},body:JSON.stringify(n)});if(!o.ok)throw Error(a2(`choicesCouldNotBeLoaded`));return o.json()}function j4(e,t){if(typeof t!=`string`||!gs.schema)return;let n=gs.schema,r=lt(n,e.from);if(!r)return;let i={[e.labelColumn]:ps(r.id,e.labelColumn)},a=L2(n,r,e.labelColumn,i);return a&&a.path!==e.by?a:void 0}async function M4(e,t,n){let r=j4(e,n),i=r?.declared?r:void 0,a=`${e.by} = ${typeof t==`number`?t:JSON.stringify(t)}`,o=await k4(n,{q:[e.from,sn(cn(e.query??``).head,a),G4(e,i)].join(` `),limit:1,offset:0,count:`none`});if(o.errors?.length||!Array.isArray(o.rows))throw Error(a2(`choicesCouldNotBeLoaded`));let s=o.rows[0],c=K4(s?.[e.labelColumn]);if(!s||c===void 0)return null;let l=i?R2(s[i.path]):void 0;return{label:c,...l?{detail:l}:{}}}function N4({field:e,value:t,source:n,identityEpoch:r}){let i=eJ({queryKey:[`reference-review-name`,r,n,e.from,e.by,e.labelColumn,e.query??``,t],retry:!1,gcTime:0,staleTime:0,refetchOnMount:`always`,queryFn:()=>M4(e,t,n)});return i.isPending?(0,U4.jsx)(`span`,{"aria-busy":`true`,children:a2(`loadingName`)}):i.isError?(0,U4.jsxs)(`span`,{children:[a2(`nameCouldNotBeLoaded`),` `,(0,U4.jsx)(gG,{intent:`quiet`,size:`compact`,onClick:()=>void i.refetch(),children:a2(`tryAgain`)})]}):i.data?(0,U4.jsxs)(U4.Fragment,{children:[i.data.label,i.data.detail&&(0,U4.jsxs)(`span`,{className:`review-detail`,children:[` · `,i.data.detail]})]}):(0,U4.jsx)(`span`,{children:a2(`noLongerAvailable`)})}function P4({field:e,value:t,from:n}){return e.type===`reference`&&(typeof t==`string`||typeof t==`number`)&&t!==``?(0,U4.jsx)(N4,{field:e,value:t,source:n.source,identityEpoch:n.identityEpoch}):(0,U4.jsx)(U4.Fragment,{children:u4(e,t)})}function F4({field:e,value:t,from:n}){if(e.type!==`group`)return(0,U4.jsx)(P4,{field:e,value:t,from:n});let r=t=>e.fields.map(e=>({member:e,held:t?.[e.name]})).filter(({held:e})=>p4(e)),i=e.repeat?(Array.isArray(t)?t:[]).map(r).filter(e=>e.length):r(t).map(e=>[e]);if(!i.length)return(0,U4.jsx)(U4.Fragment,{children:`—`});let a=t=>t.map(({member:t,held:r},i)=>(0,U4.jsxs)(H4.Fragment,{children:[i>0&&`, `,e.fields.length>1&&`${t.label}: `,(0,U4.jsx)(P4,{field:t,value:r,from:n})]},t.name));return i.length===1?(0,U4.jsx)(U4.Fragment,{children:a(i[0])}):(0,U4.jsx)(`ul`,{className:`review-lines`,children:i.map((e,t)=>(0,U4.jsx)(`li`,{children:a(e)},t))})}function I4(e){return e.field.tree?(0,U4.jsx)(L4,{...e}):(0,U4.jsx)(R4,{...e})}function L4({field:e,id:t,describedBy:n,invalid:r,connection:i,identityEpoch:a,value:o,disabled:s,onChange:c,isCurrent:l}){let u=typeof o==`string`||typeof o==`number`?o:``;return(0,U4.jsx)(W4,{from:e.from,by:e.by,labelColumn:e.labelColumn,parent:e.tree,where:cn(e.query??``).head||void 0,ask:(e,t)=>A4(i,e,t),scope:JSON.stringify([a,i]),value:u,known:u===``?void 0:G2(e,i,a,u),onChange:(t,n)=>{l()&&(t!==``&&n!==void 0&&W2(e,i,a,t,n),c(t))},id:t,listLabel:e.label,describedBy:n,invalid:r,required:e.required,disabled:s,placeholder:nQ(e.label)?l$(`choosePlaceholder`,{label:e.label.toLowerCase()}):l$(`chooseOne`)})}function R4({field:e,id:t,describedBy:n,invalid:r,connection:i,identityEpoch:a,value:o,disabled:s,onChange:c,isCurrent:l}){let u=t=>typeof t==`string`||typeof t==`number`?G2(e,i,a,t):void 0,[d,f]=(0,H4.useState)(o===void 0?``:u(o)??String(o)),[p,m]=(0,H4.useState)(o),h=(0,H4.useRef)(o);o!==p&&(m(o),o!==h.current&&f(o===void 0||o===``?``:u(o)??String(o)),h.current=o);let[g,_]=(0,H4.useState)(``),[v,y]=(0,H4.useState)(!1);(0,H4.useEffect)(()=>{let e=setTimeout(()=>_(d.trim()),150);return()=>clearTimeout(e)},[d]);let b=typeof o==`string`||typeof o==`number`?o:void 0,x=eJ({queryKey:[`command-choice-label`,a,i,e.from,e.by,e.labelColumn,e.query??``,b],retry:!1,enabled:b!==void 0&&b!==``&&l(),queryFn:async()=>{let t=await M4(e,b,i);return t&&W2(e,i,a,b,t.label),t?.label??null}});(0,H4.useEffect)(()=>{x.data&&b!==void 0&&d===String(b)&&f(x.data)},[x.data,b,d]);let S=eJ({queryKey:[`command-choices`,a,i,e,g],retry:!1,enabled:v&&!s&&l(),queryFn:async()=>{if(!l())throw Error(l$(`common.thisCommandFormIsNoLonger`));let t=await z4(e,g,i);if(!l())throw Error(l$(`common.thisCommandFormIsNoLonger`));return t}}),{choices:C,answered:w}=r2({typed:d,asked:g,placeholder:S.isPlaceholderData,rows:S.data,label:e=>e.label}),T=z2(C.map(e=>e.label));return(0,U4.jsx)(`div`,{className:`picker`,children:(0,U4.jsx)($0,{text:d,onText:e=>{f(e),h.current=``,c(``)},open:v&&!s,onOpenChange:y,items:C,itemKey:e=>`${typeof e.value}:${e.value}`,itemLabel:e=>e.label,itemClassName:(e,t)=>`picker-option${t?` active`:``}`,renderItem:e=>(0,U4.jsxs)(U4.Fragment,{children:[(0,U4.jsx)(`span`,{className:`picker-option-label`,children:e.label}),e.detail&&(e.declared||T.has(e.label))&&(0,U4.jsx)(`span`,{className:`picker-option-detail`,children:e.detail})]}),onPick:t=>{l()&&(W2(e,i,a,t.value,t.label),h.current=t.value,c(t.value),f(t.label),y(!1))},inputProps:{id:t,"aria-describedby":n,"aria-invalid":r||void 0,required:e.required,disabled:s,className:`picker-input`,placeholder:nQ(e.label)?l$(`choosePlaceholder`,{label:e.label.toLowerCase()}):l$(`chooseOne`)},fit:`width`,popupClassName:`picker-popup`,listClassName:`picker-list`,emptyClassName:`picker-empty`,empty:S.isError?a2(`choicesCouldNotBeLoaded`):S.isFetching||!w?a2(`loadingChoices`):a2(`noMatchingChoices`)})})}async function z4(e,t,n){return(await V4(e,t,n,20,0)).choices}async function B4(e,t,n,r,i){let a=await V4(e,t,n,i+1,r);return{choices:a.choices.slice(0,i),more:a.rows>i}}async function V4(e,t,n,r,i){let a=sn(cn(e.query??``).head,t?`${e.labelColumn} contains ${JSON.stringify(t)}`:``),o=j4(e,n),s=await k4(n,{q:[e.from,a,G4(e,o),`sort ${e.labelColumn}`].filter(Boolean).join(` `),limit:r,offset:i,count:`none`});if(s.errors?.length||!Array.isArray(s.rows))throw Error(a2(`choicesCouldNotBeLoaded`));return{choices:s.rows.slice(0,r).flatMap(t=>{let n=t[e.by];return typeof n==`string`||typeof n==`number`&&Number.isSafeInteger(n)?[{value:n,label:String(t[e.labelColumn]??n),...o&&R2(t[o.path])?{detail:R2(t[o.path]),declared:o.declared}:{}}]:[]}),rows:s.rows.length}}var H4,U4,W4,G4,K4,q4=s((()=>{H4=d(m()),nJ(),Es(),Za(),Fa(),n2(),yG(),i2(),aQ(),Ys(),u$(),o2(),Yn(),St(),U2(),Y2(),m4(),U4=d(O()),W4=Us(()=>Promise.resolve().then(()=>(D4(),v4)),`TreePicker`,{quiet:!0}),G4=(e,t)=>`show ${[...new Set([e.by,e.labelColumn,...t?[t.path]:[]])].join(`, `)}`,K4=e=>e==null||e===``?void 0:String(e)})),J4=s((()=>{})),Y4=s((()=>{}));function X4(e){let t=e.toUpperCase(),n=t3.get(t);if(n===void 0){try{n=new Intl.NumberFormat(`en`,{style:`currency`,currency:t}).resolvedOptions().maximumFractionDigits??2}catch{n=2}t3.set(t,n)}return n}function Z4(e,t){let n=/^(-?)0*(\d+)$/.exec(typeof e==`number`?Number.isSafeInteger(e)?String(e):``:typeof e==`string`||typeof e==`bigint`?String(e).trim():``);if(!n)return;let r=X4(t),i=n[2].padStart(r+1,`0`);return(/[1-9]/.test(i)?n[1]:``)+(r?`${i.slice(0,-r)}.${i.slice(-r)}`:i)}function Q4(e,t){let n=Z4(e,t);if(n!==void 0)return n;let r=typeof e==`number`?e:typeof e==`string`&&e.trim()?Number(e):NaN;return Number.isFinite(r)?r/10**X4(t):void 0}function $4(e,t){if(!e?.currencyColumn)return;let n=t.lastIndexOf(`.`);return n<0?e.currencyColumn:`${t.slice(0,n+1)}${e.currencyColumn}`}function e3(e,t,n,r=``){let i=$4(e,r),a=i&&t?t[i]:void 0;return typeof a==`string`&&/^[A-Za-z]{3}$/.test(a.trim())?a.trim().toUpperCase():e?.currency??n}var t3,n3=s((()=>{t3=new Map})),r3,i3,a3,o3=s((()=>{r3=`house.tray.list.list-checks.kanban.table.calendar.calendar-check.clock.chart-bar.chart-line.chart-pie.gauge.target.flag.user.users.user-circle.address-book.handshake.buildings.storefront.briefcase.package.truck.car.shopping-cart.receipt.currency-dollar.credit-card.wallet.bank.file.file-text.folder.clipboard-text.note.archive.tag.ticket.star.bookmark-simple.bell.envelope.chat-circle.phone.headset.megaphone.globe.map-pin.magnifying-glass.gear.sliders.wrench.bug.shield-check.lock.key.database.stack.lightning.check-circle.warning.info.cell-signal-low.cell-signal-medium.cell-signal-high.cell-signal-full.fire.hourglass.circle-dashed.x-circle.plus-circle.pencil-simple.paper-plane-tilt.arrows-left-right.arrow-circle-down.arrow-circle-up.laptop.monitor.device-mobile.printer.stethoscope.heartbeat.heart.pill.syringe.first-aid-kit.thermometer.flask.test-tube.microscope.bed.hospital.ambulance.tooth.eyeglasses.wheelchair.baby.dna.brain.bandaids.hand-heart.graduation-cap.book-open.student.chalkboard-teacher.factory.warehouse.house-line.plant.leaf.sun.cloud.drop.airplane.bicycle.bus.train.boat.hammer.toolbox.plug.lightbulb.cube.camera.image.trophy.gift.coffee.fork-knife.shopping-bag.basket.barcode.qr-code.scales.gavel.certificate.identification-card.fingerprint.eye.link.paperclip.scissors.palette.code.terminal.users-three.user-plus.caret-left.caret-right.caret-up.caret-down.arrow-left.arrow-right.x.plus.dots-three`.split(`.`),i3=new Set(r3),a3=e=>typeof e==`string`&&i3.has(e)})),s3,c3=s((()=>{ba(),s3=pa({choosePlaceholder:`Choose {label}`,chooseOne:`Choose one`,showValue:`Show`,hideValue:`Hide`,yesWord:`Yes`,noWord:`No`,monthPlaceholder:`MM/YYYY`})})),l3=l({IntakeControl:()=>y3,drawnHere:()=>d3});function u3(e,t){let n=(e.type===`choice`||e.type===`choices`)&&e.source?e.source:void 0,r=n&&(e.type===`choice`||e.type===`choices`)&&(n.served||e.options.length)?e.options:void 0,i=eJ({queryKey:[`command-choices`,typeof t==`string`?t:t?.visitor,n?.from,n?.by,n?.labelColumn],enabled:n!==void 0&&t!==void 0&&r===void 0,staleTime:6e4,queryFn:async()=>{let e=[...new Set([n.by,n.labelColumn])].join(`, `),r=await k4(t,{q:`${n.from} show ${e} sort ${n.labelColumn}`,limit:S3,offset:0,count:`none`});return(Array.isArray(r.rows)?r.rows:[]).flatMap(e=>{let t=e[n.by];return typeof t==`string`||typeof t==`number`?[{value:t,label:String(e[n.labelColumn]??t)}]:[]})}});return n?r??i.data:void 0}function d3(e){switch(e.type){case`money`:case`month`:case`choices`:return!0;case`number`:return e.as===`slider`;case`text`:return e.mask!==void 0||e.sensitive!==void 0;case`boolean`:return e.as===`buttons`||e.statement!==void 0;case`choice`:return e.as===`cards`||e.as===`buttons`||e.source!==void 0;default:return!1}}function f3(e,t){let n=[...e].filter(e=>t4.test(e)),r=``;for(let e of t){let t=n[r.length];if(!t)break;(t===`0`?/\d/.test(e):t===`a`?/[A-Za-z]/.test(e):/[A-Za-z0-9]/.test(e))&&(r+=e)}return r}function p3(e){let t=e.replace(/\D/g,``).slice(0,6);return t.length===6?`${t.slice(2)}-${t.slice(0,2)}`:t}function m3(e){if(!(e.length<3||e.some(e=>e.label.length>O3)))return e.every(e=>!e.help&&e.label.length<=D3)?`short`:e.every(e=>(e.help?.length??0)<=k3)?`brief`:void 0}function h3(e){let t=u3(e.field,e.source),{field:n,id:r,value:i,disabled:a,onChange:o}=e;if(n.type!==`choice`&&n.type!==`choices`||!t)return null;let s=t,c={...n,options:s,source:void 0};if(n.type===`choice`&&n.as!==`cards`&&n.as!==`buttons`&&(n.as===`select`||s.length>C3)){let t=s.findIndex(e=>e.value===i);return(0,x3.jsx)(rQ,{id:r,ariaLabelledBy:`${r}-label`,ariaInvalid:e[`aria-invalid`]===!0||e[`aria-invalid`]===`true`,ariaDescribedBy:e[`aria-describedby`],disabled:a,value:t<0?``:String(t),valueClassName:t<0?`is-empty`:void 0,items:[...t<0?[{value:``,label:nQ(n.label)?s3(`choosePlaceholder`,{label:n.label.toLowerCase()}):s3(`chooseOne`)}]:[],...s.map((e,t)=>({value:String(t),label:e.label}))],onChange:e=>{e!==``&&o(s[Number(e)].value)}})}return(0,x3.jsx)(y3,{...e,field:c})}function g3(e){let t=String(e??``),n=Number(t);return t.trim()&&Number.isFinite(n)?n.toLocaleString(mi(),{maximumFractionDigits:20}):t}function _3(e,t){let n=String(e??``);if(!/^-?\d*\.?\d*$/.test(n.trim())||!/\d/.test(n))return n;try{return new Intl.NumberFormat(mi(),{minimumFractionDigits:t,maximumFractionDigits:t}).format(n.trim())}catch{return n}}function v3(e,t){let[n,...r]=e.replace(/[^\d.-]/g,``).split(`.`);return t&&r.length?`${n}.${r.join(``).slice(0,t)}`:n}function y3(e){let{field:t,id:n,value:r,disabled:i,onChange:a}=e,o={"aria-describedby":e[`aria-describedby`],"aria-invalid":e[`aria-invalid`]},[s,c]=(0,b3.useState)(!1),[l,u]=(0,b3.useState)(!1);if(t.type===`money`&&t.as!==`slider`){let s=(t.currency||e.currency)??void 0,c=e4(s),d=t.minor?X4(s||vi()):void 0;return(0,x3.jsxs)(`div`,{className:`intake-money`,children:[(0,x3.jsx)(`span`,{className:`intake-money-symbol`,"aria-hidden":`true`,children:c}),(0,x3.jsx)(`input`,{...o,id:n,className:`field-control`,style:{paddingInlineStart:`calc(var(--money-pad) + ${c.length}ch + var(--space-2))`},type:`text`,inputMode:(d===void 0?t.step!==void 0&&Number.isInteger(t.step):d===0)?`numeric`:`decimal`,enterKeyHint:`next`,autoComplete:`off`,disabled:i,required:t.required,value:l?String(r??``):d===void 0?g3(r):_3(r,d),onFocus:()=>u(!0),onBlur:()=>u(!1),onChange:e=>a(d===void 0?e.target.value.replace(/[^\d.-]/g,``):v3(e.target.value,d))})]})}if(t.type===`month`)return(0,x3.jsx)(`input`,{...o,id:n,className:`field-control intake-month`,type:`text`,inputMode:`numeric`,enterKeyHint:`next`,autoComplete:`off`,placeholder:s3(`monthPlaceholder`),disabled:i,required:t.required,value:T3(typeof r==`string`?r:``),onChange:e=>a(p3(e.target.value))});if((t.type===`number`||t.type===`money`)&&t.as===`slider`){let s=t.min??0,c=t.max??100,l=typeof r==`number`?r:r===void 0||r===``?s:Number(r),u=c>s?(l-s)/(c-s)*100:0,d=n=>t.type===`money`?$2(n,e.currency,t.step):n.toLocaleString(mi()),f=d(l);return(0,x3.jsxs)(`div`,{className:`intake-slider`,children:[(0,x3.jsx)(`output`,{className:`field-control field-readout`,htmlFor:n,"aria-hidden":`true`,children:f}),(0,x3.jsx)(`input`,{...o,id:n,type:`range`,className:`field-range`,min:s,max:c,step:t.step??(t.type===`money`||t.integer?1:`any`),value:l,disabled:i,"aria-valuetext":f,style:{"--range-share":`${u}%`},onChange:e=>a(Number(e.target.value))}),(0,x3.jsxs)(`div`,{className:`intake-slider-ends`,"aria-hidden":`true`,children:[(0,x3.jsx)(`span`,{children:d(s)}),(0,x3.jsx)(`span`,{children:d(c)})]})]})}if(t.type===`text`&&t.sensitive){let e=typeof r==`string`?r:``,l=t.mask?Q2(t.mask,e):e;return(0,x3.jsxs)(`div`,{className:`field-with-action`,children:[(0,x3.jsx)(`input`,{...o,id:n,className:`field-control${s?``:` field-hidden`}`,type:s?`text`:`password`,inputMode:t.mask?w3(t.mask):`text`,enterKeyHint:`next`,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":`true`,disabled:i,required:t.required,value:l,onChange:e=>a(t.mask?f3(t.mask,e.target.value):e.target.value)}),(0,x3.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,"aria-controls":n,"aria-pressed":s,onClick:()=>c(!s),children:s3(s?`hideValue`:`showValue`)})]})}if(t.type===`text`&&t.mask){let e=t.mask;return(0,x3.jsx)(`input`,{...o,id:n,className:`field-control`,type:`text`,inputMode:w3(e),enterKeyHint:`next`,autoComplete:`off`,placeholder:e.replace(/[0a*]/g,`_`),disabled:i,required:t.required,value:Q2(e,typeof r==`string`?r:``),onChange:t=>a(f3(e,t.target.value))})}if(t.type===`boolean`)return t.as===`buttons`?(0,x3.jsx)(`div`,{className:`choice-pair`,role:`radiogroup`,id:n,"aria-labelledby":`${n}-label`,...o,children:[!0,!1].map(e=>(0,x3.jsxs)(`label`,{className:`choice-pick${r===e?` is-on`:``}`,children:[(0,x3.jsx)(`input`,{type:`radio`,name:n,className:`choice-input`,checked:r===e,disabled:i,onChange:()=>a(e)}),s3(e?`yesWord`:`noWord`)]},String(e)))}):(0,x3.jsxs)(`span`,{className:`intake-consent`,children:[(0,x3.jsx)(`input`,{...o,id:n,type:`checkbox`,className:`command-check field-check`,required:t.accept===!0,checked:r===!0,disabled:i,onChange:e=>a(e.target.checked)}),(0,x3.jsx)(`span`,{className:`intake-statement`,children:t.statement})]});if((t.type===`choice`||t.type===`choices`)&&t.source)return(0,x3.jsx)(h3,{...e});if(t.type===`choice`||t.type===`choices`){let s=t.type===`choices`,c=s?Array.isArray(r)?r:[]:r===void 0?[]:[r],l=t.type===`choices`?t.exclusive??[]:[],u=(e,n)=>{if(!s)return a(e.value);if(l.includes(e.value))return a(n?[e.value]:[]);let r=c.filter(t=>t!==e.value&&!l.includes(t));a(t.options.map(e=>e.value).filter(t=>n&&t===e.value||r.includes(t)))},d=t.as===`buttons`;return s?(0,x3.jsx)(P$,{id:n,"aria-labelledby":`${n}-label`,"aria-describedby":e[`aria-describedby`],"aria-invalid":e[`aria-invalid`],disabled:i,fit:m3(t.options),cards:t.options.map(e=>({key:E3(e),label:e.label,icon:e.icon&&a3(e.icon)?(0,x3.jsx)(Pe,{name:e.icon}):void 0,help:e.help,on:c.includes(e.value)})),onToggle:(e,n)=>u(t.options[e],n)}):(0,x3.jsx)(`div`,{className:d?`choice-pair intake-buttons`:`choice-cards`,"data-fit":d?void 0:m3(t.options),role:s?`group`:`radiogroup`,id:n,"aria-labelledby":`${n}-label`,"aria-required":!s&&t.required||void 0,...o,children:t.options.map(e=>{let t=c.includes(e.value);return(0,x3.jsxs)(`label`,{className:`${d?`choice-pick`:`choice-card`}${t?` is-on`:``}`,children:[e.icon&&!d&&a3(e.icon)?(0,x3.jsx)(`span`,{className:`choice-card-icon`,"aria-hidden":`true`,children:(0,x3.jsx)(Pe,{name:e.icon})}):null,(0,x3.jsxs)(`span`,{className:`choice-card-label`,children:[e.label,e.help&&!d?(0,x3.jsx)(`span`,{className:`intake-choice-help`,children:e.help}):null]}),(0,x3.jsx)(`input`,{type:s?`checkbox`:`radio`,name:s?void 0:n,className:`choice-input`,checked:t,disabled:i,onChange:t=>u(e,t.target.checked)}),d?null:(0,x3.jsx)(`span`,{className:`choice-box`,"aria-hidden":`true`})]},E3(e))})})}return null}var b3,x3,S3,C3,w3,T3,E3,D3,O3,k3,A3=s((()=>{b3=d(m()),nJ(),aQ(),L$(),q4(),J4(),Y4(),Yi(),n3(),Fe(),o3(),c3(),n4(),x3=d(O()),S3=200,C3=6,w3=e=>[...e].every(e=>!t4.test(e)||e===`0`)?`numeric`:`text`,T3=e=>{let t=/^(\d{4})-(\d{2})$/.exec(e),n=t?`${t[2]}${t[1]}`:e.replace(/\D/g,``);return n.length>2?`${n.slice(0,2)}/${n.slice(2)}`:n},E3=e=>`${typeof e.value}:${e.value}`,D3=14,O3=24,k3=40}));function j3(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(/\s/.test(r)){n++;continue}if(/\d/.test(r)){let r=/\d+(?:\.\d+)?/y;r.lastIndex=n;let i=r.exec(e)[0];t.push({t:`number`,v:i,at:n}),n+=i.length;continue}if(r===`'`){let r=n+1,i=``;for(;;){if(r>=e.length)throw new Zn(`a quoted text is not closed.`,n);if(e[r]===`'`){if(e[r+1]===`'`){i+=`'`,r+=2;continue}break}i+=e[r++]}if([...i].some(e=>e===`\\`||e.charCodeAt(0)<32||e.charCodeAt(0)===127))throw new Zn(`a quoted text holds a backslash or a control character, which engines read differently.`,n);t.push({t:`text`,v:i,at:n}),n=r+1;continue}let i=e.slice(n,n+2);if([`!=`,`<>`,`<=`,`>=`].includes(i)){t.push({t:`op`,v:i===`<>`?`!=`:i,at:n}),n+=2;continue}if(`=<>+-*/(),`.includes(r)){t.push({t:`op`,v:r,at:n}),n++;continue}R3.lastIndex=n;let a=R3.exec(e);if(a)t.push({t:`word`,v:a[0],at:n}),n+=a[0].length;else throw new Zn(`"${r}" is not part of an expression.`,n)}return t.push({t:`end`,v:``,at:e.length}),t}function M3(e,t){let n=j3(e),r=0,i=()=>n[r],a=e=>i().t===`word`&&i().v.toLowerCase()===e,o=()=>n[r++],s=e=>{if(i().t!==`op`||i().v!==e)throw new Zn(`expected "${e}"${i().t===`end`?` before the end`:` at "${i().v}"`}.`,i().at);o()},c=()=>{let e=l();for(;a(`or`);)o(),e={k:`op`,op:`or`,left:e,right:l()};return e},l=()=>{let e=u();for(;a(`and`);)o(),e={k:`op`,op:`and`,left:e,right:u()};return e},u=()=>a(`not`)?(o(),{k:`not`,of:u()}):d(),d=()=>{let e=f();if(a(`is`)){o();let t=a(`not`);if(t&&o(),!a(`empty`))throw new Zn(`say "is empty" or "is not empty".`,i().at);return o(),{k:`empty`,of:e,negate:t}}let c=a(`not`)&&n[r+1].t===`word`&&n[r+1].v.toLowerCase()===`in`;if(c||a(`in`)){c&&o(),o(),s(`(`);let a=[];for(;;){let c=i(),l=n[r+1];if(a.push(e.k===`path`&&c.t===`word`&&!I3.has(c.v.toLowerCase())&&!c.v.includes(`.`)&&!t(c.v)&&l.t===`op`&&(l.v===`,`||l.v===`)`)?(o(),{k:`text`,value:c.v}):f()),i().t===`op`&&i().v===`,`)o();else{s(`)`);break}}let l=a.map(t=>({k:`op`,op:`=`,left:e,right:t})).reduce((e,t)=>({k:`op`,op:`or`,left:e,right:t}));return c?{k:`not`,of:l}:l}let l=i();if(l.t===`op`&&[`=`,`!=`,`<`,`<=`,`>`,`>=`].includes(l.v)){o();let a=i(),s=(l.v===`=`||l.v===`!=`)&&e.k===`path`&&a.t===`word`&&!I3.has(a.v.toLowerCase())&&!a.v.includes(`.`)&&!t(a.v)&&(n[r+1].t===`end`||n[r+1].t===`word`||n[r+1].t===`op`&&n[r+1].v===`)`)?(o(),{k:`text`,value:a.v}):f();if(l.v===`=`&&s.k===`path`&&/^null$/i.test(s.path))throw new Zn(`"= null" is never true; say "is empty".`,a.at);return{k:`op`,op:l.v,left:e,right:s}}return e},f=()=>{let e=p();for(;i().t===`op`&&(i().v===`+`||i().v===`-`);)e={k:`op`,op:o().v,left:e,right:p()};return e},p=()=>{let e=m();for(;i().t===`op`&&(i().v===`*`||i().v===`/`);)e={k:`op`,op:o().v,left:e,right:m()};return e},m=()=>{if(i().t===`op`&&i().v===`-`)return o(),{k:`neg`,of:m()};let e=h();return i().t===`word`&&Object.hasOwn(L3,i().v.toLowerCase())?{k:`span`,of:e,unit:L3[o().v.toLowerCase()]}:e},h=()=>{let e=o();if(e.t===`number`)return{k:`number`,value:Number(e.v)};if(e.t===`text`)return{k:`text`,value:e.v};if(e.t===`op`&&e.v===`(`){let e=c();return s(`)`),e}if(e.t===`word`){let t=e.v.toLowerCase();if(i().t===`op`&&i().v===`(`){if(!P3(t))throw new Zn(`"${e.v}" is not a function; an expression calls ${N3.join(`, `)}.`,e.at);o();let n=[];if(i().t!==`op`||i().v!==`)`)for(;n.push(c()),i().t===`op`&&i().v===`,`;)o();s(`)`);let r=t,a=r===`coalesce`||r===`min`||r===`max`;if(a?n.length<2:r===`round`?n.length<1||n.length>2:n.length!==1)throw new Zn(a?`${r}(…) takes two values or more: ${r}(a, b).`:r===`round`?`round(…) takes a number and, if you like, how many places: round(total) or round(total, 2).`:`${r}(…) takes one number.`,e.at);if(r===`round`&&n[1]&&!(n[1].k===`number`&&Number.isInteger(n[1].value)&&n[1].value<=F3))throw new Zn(`round(…)'s places are a whole number from 0 to ${F3}, written out: round(total, 2).`,e.at);return{k:`call`,fn:r,args:n}}if(t===`true`||t===`false`)return{k:`bool`,value:t===`true`};if(t===`today`||t===`now`||t===`me`)return{k:t};if([`and`,`or`,`not`,`is`,`empty`,`in`].includes(t)||Object.hasOwn(L3,t))throw new Zn(`"${e.v}" stands where a value goes.`,e.at);return{k:`path`,path:e.v}}throw new Zn(e.t===`end`?`the expression ends where a value goes.`:`"${e.v}" stands where a value goes.`,e.at)},g=c();if(i().t!==`end`)throw new Zn(`"${i().v}" follows a complete expression; join two with "and" or "or".`,i().at);return g}var N3,P3,F3,I3,L3,R3,z3=s((()=>{Qn(),N3=[`coalesce`,`round`,`min`,`max`,`abs`],P3=e=>N3.includes(e),F3=10,I3=new Set([`today`,`now`,`me`,`true`,`false`]),L3={minute:`minute`,minutes:`minute`,hour:`hour`,hours:`hour`,day:`day`,days:`day`,week:`week`,weeks:`week`,month:`month`,months:`month`,year:`year`,years:`year`},R3=/[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_$][A-Za-z0-9_$]*)*/y}));function B3(e,t){let n=10**t,r=Number((Math.abs(e)*n).toPrecision(15)),i=Math.round(r)/n;return i===0?0:Math.sign(e)*i}function V3(e,t,n=e=>{throw new Zn(`"${e}" is a column, and this expression reads none.`,0)}){let r=e=>({count:Number(l(e.of)),unit:e.unit}),i=(e,t,n)=>{let r=`day`in e?new Date(`${e.day}T00:00:00Z`):new Date(e.instant),i=t.count*n;if(t.unit===`hour`||t.unit===`minute`)return{instant:new Date(r.getTime()+i*(t.unit===`hour`?36e5:6e4))};if(t.unit===`day`||t.unit===`week`)r.setTime(r.getTime()+i*(t.unit===`week`?7:1)*U3);else{let e=t.unit===`year`?i*12:i,n=r.getUTCDate();r.setUTCDate(1),r.setUTCMonth(r.getUTCMonth()+e);let a=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth()+1,0)).getUTCDate();r.setUTCDate(Math.min(n,a))}return`day`in e?{day:W3(r)}:{instant:r}},a=e=>typeof e==`object`&&!!e,o=e=>`day`in e?Date.parse(`${e.day}T00:00:00Z`):e.instant.getTime(),s=e=>a(e)?o(e):e,c=e=>e===null?null:!!e,l=e=>{switch(e.k){case`number`:return e.value;case`text`:return e.value;case`bool`:return e.value;case`today`:return{day:t.today};case`date`:return{day:e.value};case`now`:return{instant:t.now};case`instant`:return{instant:new Date(e.value)};case`me`:return t.me;case`nobody`:return null;case`not`:{let t=c(l(e.of));return t===null?null:!t}case`neg`:{let t=l(e.of);return t===null?null:-Number(t)}case`empty`:{let t=l(e.of);return(t===null||t===``)!==e.negate}case`span`:return Number(l(e.of));case`call`:{let t=e.args.map(l);if(e.fn===`coalesce`)return t.find(e=>e!==null)??null;if(t.some(e=>e===null))return null;if(e.fn===`abs`)return Math.abs(Number(t[0]));if(e.fn===`round`)return B3(Number(t[0]),t[1]===void 0?0:Number(t[1]));let n=t[0];for(let r of t.slice(1)){let[t,i]=[s(r),s(n)];(e.fn===`min`?t<i:t>i)&&(n=r)}return n}case`path`:{let t=n(e.path);return t===void 0||t===``?null:t}case`json`:return H3(n(e.column),e.keys);case`op`:{if(e.op===`and`||e.op===`or`){let t=c(l(e.left)),n=c(l(e.right));return e.op===`and`?t===!1||n===!1?!1:t===null||n===null?null:!0:t===!0||n===!0?!0:t===null||n===null?null:!1}let t=l(e.left),n=l(e.right);if(G3.has(e.op)){if(t===null||n===null)return null;let r=s(t),i=s(n);switch(e.op){case`=`:return r===i;case`!=`:return r!==i;case`<`:return r<i;case`<=`:return r<=i;case`>`:return r>i;default:return r>=i}}if(t===null||n===null)return null;if(e.op===`+`||e.op===`-`){let s=e.op===`+`?1:-1;return a(t)&&a(n)&&e.op===`-`?Math.round((o(t)-o(n))/U3):a(t)&&!a(n)?i(t,e.right.k===`span`?r(e.right):{count:Number(n),unit:`day`},s):a(n)&&!a(t)&&e.op===`+`?i(n,e.left.k===`span`?r(e.left):{count:Number(t),unit:`day`},1):Number(t)+s*Number(n)}return e.op===`*`?Number(t)*Number(n):Number(n)===0?null:Number(t)/Number(n)}}},u=l(e);return u===null&&K3(e)?!1:u}function H3(e,t){let n=e;if(typeof n==`string`)try{n=JSON.parse(n)}catch{return null}for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n)||!Object.hasOwn(n,e))return null;n=n[e]}return n==null?null:typeof n==`object`?JSON.stringify(n):String(n)}var U3,W3,G3,K3,q3=s((()=>{Qn(),U3=864e5,W3=e=>e.toISOString().slice(0,10),G3=new Set([`=`,`!=`,`<`,`<=`,`>`,`>=`]),K3=e=>e.k===`not`||e.k===`empty`||e.k===`bool`||e.k===`op`&&(e.op===`and`||e.op===`or`||G3.has(e.op))})),J3=s((()=>{})),Y3=l({CommandLive:()=>Q3,liveFigures:()=>Z3});function X3(e,t){let n=`${[...t].join(`,`)}|${e}`;if(!t6.has(n))try{t6.set(n,M3(e,e=>t.has(e)))}catch{t6.set(n,null)}return t6.get(n)}function Z3(e,t,n){let r=new Set(t.filter(e=>e.type===`number`||e.type===`money`).map(e=>e.name)),i=[];for(let[t,a]of Object.entries(e.live??{})){let e=X3(a,r);if(!e)continue;let o=!1,s=V3(e,{today:``,now:new Date,me:null},e=>{let t=n6(n[e]);return t===null&&(o=!0),t});!o&&typeof s==`number`&&Number.isFinite(s)&&i.push([t,s])}return i}function Q3({field:e,fields:t,values:n,id:r,currency:i=`USD`}){let a=(0,$3.useMemo)(()=>Z3(e,t,n),[e,t,n]),o=t=>new Intl.NumberFormat(mi(),e.type===`money`?{style:`currency`,currency:i,maximumFractionDigits:Math.abs(t)>=1e3?0:2}:{maximumFractionDigits:2}).format(t);return(0,e6.jsx)(`p`,{id:r,className:`command-live`,"aria-live":`polite`,children:a.map(([e,t],n)=>(0,e6.jsxs)(`span`,{children:[n>0&&` · `,o(t),` `,e]},e))})}var $3,e6,t6,n6,r6=s((()=>{Qn(),z3(),q3(),Yi(),$3=d(m()),J3(),e6=d(O()),t6=new Map,n6=e=>{if(typeof e==`number`)return Number.isFinite(e)?e:null;if(typeof e!=`string`||!e.trim())return null;let t=Number(e.replace(/[,\s]/g,``));return Number.isFinite(t)?t:null}})),i6=l({bindRecord:()=>p6,boundText:()=>m6,brokenRules:()=>g6,draftHolds:()=>h6,draftNames:()=>u6,readsRecord:()=>S6,recordComparisons:()=>x6});function a6(e,t,n,r){let[i,a,o]=e.split(`-`).map(Number),s=(t===`-`?-1:1)*n*(r.startsWith(`week`)?7:1),c=v6[r.toLowerCase()];if(c===`day`)return new Date(Date.UTC(i,a-1,o+s)).toISOString().slice(0,10);let l=c===`year`?s*12:s,u=new Date(Date.UTC(i,a-1+l,1)),d=new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth()+1,0)).getUTCDate();return new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth(),Math.min(o,d))).toISOString().slice(0,10)}function o6(e,t){return e.replace(y6,(e,n,r,i)=>a6(t,n,Number(r),i))}function s6(e){switch(e.type){case`number`:case`money`:return`NUMERIC`;case`boolean`:return`BOOLEAN`;case`date`:return`DATE`;case`datetime`:return`TIMESTAMPTZ`;case`choice`:return e.options.length&&e.options.every(e=>typeof e.value==`number`)?`NUMERIC`:`TEXT`;case`text`:case`textarea`:case`month`:case`time`:case`reference`:return`TEXT`;default:return}}function c6(e){return e.flatMap(e=>{let t=s6(e);return!t||e.type===`text`&&e.sensitive?[]:[{name:e.name,type:t,nullable:!0,primaryKey:!1}]})}function l6(e,t,n=new Date,r){let i=o6(e,b6(n)),a=p2(i,t,void 0,`record`,!0);if(!r)return a;let o=c6(r),s=new Set(o.map(e=>e.name));for(let e of a.flat())for(let t of[e.field,...e.other===void 0?[]:[e.other]])s.has(t)||(s.add(t),o.push({name:t,type:``,nullable:!0,primaryKey:!1}));try{return p2(i,t,o,`record`,!0)}catch{return a}}function u6(e,t){let n=new Set,r=new Set;for(let i of l6(e,t).flat())for(let e of[i.field,...i.other===void 0?[]:[i.other]])if(e.startsWith(_6))r.add(e.slice(7));else if(e.includes(`.`))throw Error(`${t}: "${e}" is a path; a condition here names a field of the input, or record.<column> for the record's own.`);else n.add(e);return{fields:[...n],record:[...r]}}function d6(e,t){return e.map(e=>e.map(e=>e.other===void 0&&e.values.length===1&&typeof e.values[0]==`string`&&t.has(e.values[0])&&e.values[0]!==e.field?{field:e.field,operator:e.operator,values:[],other:e.values[0]}:e))}function f6(e){let t=e.field.startsWith(_6)?e.field.slice(7):e.field;return e.other===void 0?e.values.length===1&&e.values[0]===null?`${t} ${e.operator===`ne`?`is not empty`:`is empty`}`:e.values.length>1?`${t} in (${e.values.map(e=>pn(e)).join(`, `)})`:`${t} ${{eq:`=`,ne:`!=`,lt:`<`,lte:`<=`,gt:`>`,gte:`>=`}[e.operator]} ${pn(e.values[0])}`:`${t} ${{eq:`=`,ne:`!=`,lt:`<`,lte:`<=`,gt:`>`,gte:`>=`}[e.operator]} ${e.other}`}async function p6(e,t,n,r=new Date,i){let a=[];for(let o of l6(e,t,r,i)){let e=[],t=!0;for(let r of o)if(!r.field.startsWith(_6))e.push(r);else if(!await n(f6(r))){t=!1;break}t&&a.push(e)}return a}function m6(e){return e.length?e.some(e=>!e.length)?!0:e.map(e=>e.map(f6).join(` and `)).join(` or `):!1}function h6(e,t,n,r=new Date){let i=c6(n),a=new Set(i.map(e=>e.name)),o=d6(typeof e==`string`?l6(e,`Condition`,r,n):e,a);if(!o.length)return!1;if(o.some(e=>!e.length))return!0;let s=Object.fromEntries(i.map(e=>[e.name,C6(t[e.name])?null:t[e.name]])),c=e=>!w6(e)&&[e.field,...e.other===void 0?[]:[e.other]].some(e=>s[e]===null)?!1:C2([[e]],s,i)===!0;return o.some(e=>e.every(c))}function g6(e,t,n,r=new Date){let i=[];for(let a of e)u6(a.must,`Rule`).fields.some(e=>t[e]===void 0||t[e]===null||t[e]===``)||a.when!==void 0&&!h6(a.when,t,n,r)||h6(a.must,t,n,r)||i.push({field:T6(a),message:a.message});return i}var _6,v6,y6,b6,x6,S6,C6,w6,T6,E6=s((()=>{k2(),Yn(),_6=`record.`,v6={day:`day`,days:`day`,week:`day`,weeks:`day`,month:`month`,months:`month`,year:`year`,years:`year`},y6=/\btoday\s*([+-])\s*(\d{1,4})\s*(days?|weeks?|months?|years?)\b/gi,b6=e=>e.toISOString().slice(0,10),x6=e=>l6(e,`Condition`).flat().filter(e=>e.field.startsWith(_6)).map(f6),S6=e=>l6(e,`Condition`).flat().some(e=>e.field.startsWith(_6)),C6=e=>e==null||e===``,w6=e=>e.other===void 0&&e.values.length===1&&e.values[0]===null,T6=e=>u6(e.must,`Rule`).fields[0]}));function D6(e,t,n){let r=e.columns.find(e=>e.name===t);if(!r)return`shape`;let i=typeof n==`string`?n.trim():n;if(gt(r))return typeof i==`boolean`?{value:i}:i===1||i===`true`||i===`1`?{value:!0}:i===0||i===`false`||i===`0`?{value:!1}:`type`;if(r.allowed?.length)return r.allowed.includes(String(i))?{value:String(i)}:`choice`;let a=ht(r.type);if(a===`number`){let e=typeof i==`number`?i:typeof i==`string`&&/^-?\d+(\.\d+)?$/.test(i)?Number(i):NaN;return Number.isFinite(e)?{value:e}:`type`}return typeof i==`string`?a===`date`?Ar(i)||Mr(i)!==void 0?{value:i}:`type`:{value:i}:`type`}var O6=s((()=>{Vr(),St()}));function k6(e){let t=e.via.lastIndexOf(`.`),n=e.via.slice(t+1);return t<0||n.includes(`+`)?void 0:{table:e.via.slice(0,t),column:n}}function A6(e,t,n,r,i){let a={today:new Date().toISOString().slice(0,10),now:new Date,me:null},o=new Map,s=(e,t,n,r)=>r?V3(r.expr,a,n=>w2(e,n,t[n])):w2(e,n,t[n]),c=n=>{if(o.has(n))return o.get(n);o.set(n,null);let l=null,u=t.rollups?.[n],d=t.computed?.[n];if(u){let t=k6(u),n=t&&lt(e,t.table),r=(n&&i[n.id])??[];if(n&&!u.of&&!u.filter&&u.fn!==`latest`){let e=r.map(e=>s(n,e,u.column??``,u.expression)).filter(e=>typeof e==`number`&&Number.isFinite(e));l=u.fn===`count`?r.length:u.fn===`sum`?e.reduce((e,t)=>e+t,0):e.length?u.fn===`avg`?e.reduce((e,t)=>e+t,0)/e.length:u.fn===`min`?Math.min(...e):Math.max(...e):null}}else d&&(l=V3(d.expr,a,e=>t.rollups?.[e]||t.computed?.[e]?c(e):w2(t,e,r[e])));return o.set(n,l),l};return Object.fromEntries(n.filter(e=>t.rollups?.[e]||t.computed?.[e]).map(e=>[e,c(e)]))}var j6=s((()=>{Qn(),q3(),St(),k2()}));function M6(e,t){return!!(e?.primaryKey||e?.references||e?.identifier||L6.test(e?.sourceName??t))}function N6(e,t,n){let r=n.map(e=>e[t]).filter(e=>e!=null),i=ht(e?.type),a={align:`left`,kind:i,mono:!1},o=r.length>0&&r.every(e=>typeof e==`number`);if(i===`boolean`||e?.flag===!0||o&&F6.test(e?.sourceName??t)&&r.every(e=>e===0||e===1))return{...a,kind:`boolean`,align:`center`};if(i===`number`||o){let t=!!(e?.primaryKey||e?.references||e?.identifier),n=t?0:Math.max(0,...r.map(P6)),i=!t&&r.some(e=>Math.abs(Number(e))>=1e4);return{...a,kind:`number`,align:`right`,decimals:n,group:i,identifier:t}}if(i===`date`||r.length&&r.every(e=>typeof e==`string`&&I6.test(e))){let e=r.some(e=>/[ T]\d{2}:\d{2}/.test(String(e))&&!/[ T]00:00:00(\.0+)?$/.test(String(e)));return{...a,kind:`date`,mono:!0,showTime:e}}let s=Math.max(0,...r.map(e=>String(e).length));return{...a,kind:`text`,mono:s<=12&&r.length>0,idLike:M6(e,t)}}function P6(e){let t=String(e),n=t.indexOf(`.`);return n===-1?0:Math.min(6,t.length-n-1)}var F6,I6,L6,R6=s((()=>{St(),F6=/^(is|has|can|should|was)_|_(flag|enabled|disabled)$|^(active|enabled|disabled|deleted|archived|verified|published|visible|locked|hidden|default|primary|required|readonly)$/i,I6=/^\d{4}-\d{2}-\d{2}([ T]\d{2}:\d{2}(:\d{2})?)?/,L6=/(^|_)(id|uuid|code|sku|vin|ref|key|token|serial|number|no|hash|slug)$/i}));function z6(e,t){return N6(e,e?.name??``,t?[t]:[]).kind===`boolean`?/bool/i.test(e?.type??``)?{yes:`true`,no:`false`}:{yes:`1`,no:`0`}:null}var B6=s((()=>{Es(),R6(),XQ()}));function V6(e){let t=new Set;return e.flatMap(e=>[...typeof e?.field==`string`?[{field:e.field,message:e.message}]:[],...Array.isArray(e?.fields)?e.fields:[]]).flatMap(e=>typeof e?.field!=`string`||!/^[^\s.\x00-\x1f\x7f]{1,256}(?:\.[A-Za-z_][A-Za-z0-9_]{0,127})?$/u.test(e.field)||typeof e.message!=`string`||!e.message.trim()||e.message.length>256||t.has(e.field)?[]:(t.add(e.field),[{field:e.field,message:e.message}]))}var H6=s((()=>{})),U6,W6=s((()=>{ba(),U6=pa({updateNotConfirmedTheRecord:`Update not confirmed. The record may already have changed. Check the stored values before editing again.`,anUpdateIsAlready:`An update is already pending for this record.`,theRequestMayStill:`The request may still complete.`,theServerDidNotAcknowledge:`The server did not acknowledge exactly the requested fields on one record.`})}));function G6(e,t){if(!Y6(e)||e.affected!==1||!Y6(e.applied)||e.outcome!==void 0&&e.outcome!==`applied`)return;let n=e.applied;if(Object.keys(t).every(e=>Object.hasOwn(n,e))&&Object.values(n).every(e=>e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&Number.isFinite(e)))return n}function K6(e=()=>!1){let t=new Map,n=new Set,r=0,i=0,a=()=>{r++;for(let e of n)e()},o=e=>t.get(J6(e));return{get:o,run:async(n,r,s)=>{let c=i,l=e(),u=J6(n);if(t.has(u))return{kind:`blocked`,message:o(n).message||U6(`anUpdateIsAlready`)};let d={...r},f=l?ci().mutations.start(`update`):void 0;t.set(u,{phase:`pending`,values:d,message:``}),a();let p=e=>{ci().mutations.unknown(f);let n=q6;return c===i&&(t.set(u,{phase:`uncertain`,values:d,message:n,detail:e}),a()),{kind:`uncertain`,message:n}},m=(e,n=[])=>(ci().mutations.settle(f),c===i&&(t.delete(u),a()),{kind:`rejected`,message:e,...n.length?{fields:n}:{}}),h=setTimeout(()=>p(U6(`theRequestMayStill`)),3e4),g;try{g=await s()}catch(e){let t=Y6(e)?e.status:void 0,n=Y6(e)?e.outcome:void 0,r=e instanceof Error?e.message:String(e);return n!==`unknown`&&(n===`rejected`||n===`not_applied`||!l&&typeof t==`number`&&[400,401,403,404,409,422,501].includes(t))?m(r):p(r)}finally{clearTimeout(h)}if(Y6(g)&&Array.isArray(g.errors)){let e=Y6(g.errors[0])&&typeof g.errors[0].message==`string`?g.errors[0].message:``;return e&&g.outcome===`rejected`?m(e,V6(g.errors.filter(Y6))):p(e)}let _=G6(g,d);if(!_)return p(U6(`theServerDidNotAcknowledge`));ci().mutations.settle(f),c===i&&(t.delete(u),a());let v=Y6(g)?io(g.undoId,l):void 0;return{kind:`applied`,applied:_,...v===void 0?{}:{undoId:v}}},reset:()=>{i++,t.clear(),a()},hasUnresolved:()=>t.size>0,version:()=>r,subscribe:e=>(n.add(e),()=>{n.delete(e)})}}var q6,J6,Y6,X6,Z6=s((()=>{Ja(),ao(),pi(),H6(),W6(),sa(),q6=U6(`updateNotConfirmedTheRecord`),J6=e=>JSON.stringify([e.connection,e.table,Object.keys(e.key).sort().map(t=>[t,String(e.key[t])])]),Y6=e=>!!e&&typeof e==`object`&&!Array.isArray(e),X6=K6(()=>Ka().tenantRequired===!0),Ra(()=>X6.reset()),ea(window,`beforeunload`,e=>{X6.hasUnresolved()&&(e.preventDefault(),e.returnValue=``)})})),Q6=s((()=>{ba()})),$6=s((()=>{Q6()})),e8=s((()=>{ba()})),t8=s((()=>{e8()}));function n8(e,t){let n=typeof e==`number`?Number.isFinite(e)?String(e):``:e.trim(),r=/^([-+]?)(\d*)(?:\.(\d*))?$/.exec(n);if(!r||!r[2]&&!r[3])return;let i=X4(t),a=(r[3]??``).replace(/0+$/,``);if(a.length>i)return;let o=`${r[2]}${a.padEnd(i,`0`)}`.replace(/^0+(?=\d)/,``)||`0`;return r[1]===`-`&&o!==`0`?`-${o}`:o}function r8(e,t){let n=n8(e,t);if(n===void 0)return;let r=Number(n);return Number.isSafeInteger(r)?r:void 0}var i8=s((()=>{n3()})),a8=s((()=>{ba()}));function o8(e,t){return e==null||e===``?``:Z4(e,t)??e}function s8(e,t){if(e.trim()===``)return``;let n=r8(e,t);return n===void 0?e:String(n)}function c8({value:e,currency:t,onChange:n,children:r}){let[i,a]=(0,l8.useState)(()=>o8(e,t));return(0,l8.useEffect)(()=>{s8(i,t)!==e&&a(o8(e,t))},[e,t]),(0,u8.jsx)(u8.Fragment,{children:r(i,e=>{a(e),n(s8(e,t))})})}var l8,u8,d8=s((()=>{l8=d(m(),1),n3(),i8(),a8(),u8=d(O(),1)})),f8=s((()=>{ba()}));function p8(e,t){return e&&Object.hasOwn(e.resources,t)?e.resources[t]:void 0}var m8=s((()=>{f8()})),h8,g8=s((()=>{ba(),h8=pa({remove:`Remove {shownLabel}`,choose:`Choose {name}`,search:`Search {name}…`,nothingToChoose:`Nothing to choose from.`})}));function _8(e){let t=Ss(e);if(t?.startsWith(`$`))return;let n=p8(ci().app(),e.id)?.display;return L2(gs.schema??void 0,e,t,n)}async function v8(e,t,n=pt(e)[0],r=gs.activeConnection,i=``,a=[],o){let s=Ss(e)??n,c=n;if(!c)return[];let l=o&&o.path!==c?[o.path]:[],u=[i,t?`${s} contains ${JSON.stringify(t)}`:``].filter(Boolean).join(` and `);return((await rs(`/api/run`,{q:[e.id,u,`show ${[...new Set([s,c,...pt(e),...a,...l])].join(`, `)}`,`sort ${s}`].filter(Boolean).join(` `),limit:w8,offset:0,count:`none`,...Aa(r)})).rows??[]).map(t=>({value:String(t[c]),label:Cs(e)===void 0?String(t[s]??t[c]):cs(e,t),...a.length?{row:t}:{},...l.length&&R2(t[l[0]])?{sub:R2(t[l[0]])}:{}}))}function y8(e){return e.editing?(0,C8.jsx)(b8,{...e}):(0,C8.jsx)(x8,{...e})}function b8(e){let t=(0,S8.useSyncExternalStore)(Ra,Ka,Ka),n=JSON.stringify([t.epoch,gs.activeConnection,e.table.id,e.valueColumn??pt(e.table)[0],Ss(e.table)]);return(0,C8.jsx)(x8,{...e,scope:n},n)}function x8(e){let{table:t,ariaLabel:n,placeholder:r,app:i,inputRef:a}=e,o=e.editing,s=gs.activeConnection,c=e.valueColumn??pt(t)[0],l=e.face?void 0:_8(t),u=e.multiple===!0?e.value:e.value?[e.value]:[],[d,f]=(0,S8.useState)(new Map),[p,m]=(0,S8.useState)(new Map),h=e.multiple===!0?void 0:e.known,g=e=>d.get(e)??(h?.value===e?h.label:void 0)??e,[_,v]=(0,S8.useState)(()=>e.multiple!==!0&&e.value?g(e.value):``),[y,b]=(0,S8.useState)(null),x=o&&typeof e.value==`string`?y??(e.value?g(e.value):``):_,S=o&&typeof e.value==`string`?y??``:_,[C,w]=(0,S8.useState)(``),[T,E]=(0,S8.useState)(!1),D=JSON.stringify(u),O=(0,S8.useRef)(D),k=(0,S8.useRef)(null),[A,j]=(0,S8.useState)(D);o&&A!==D&&(j(D),k.current!==D&&(b(null),E(!1),w(``),f(new Map)),k.current=null);let M=!!(o&&y!==null),N=(0,S8.useRef)(null);(0,S8.useLayoutEffect)(()=>{o&&(N.current?.unresolvedReference!==M||N.current?.open!==T)&&(N.current={unresolvedReference:M,open:T},o.onStateChange(N.current))});let P=(0,S8.useRef)(null),F=(0,S8.useRef)(null);(0,S8.useEffect)(()=>{f(new Map)},[s,t.id,c]);let I=e=>{F.current=e,typeof a==`function`?a(e):a&&(a.current=e)};(0,S8.useEffect)(()=>{let e=setTimeout(()=>w(x.trim()),150);return()=>clearTimeout(e)},[x]);let L=eJ({queryKey:[`picker`,s,t.id,c,C,e.scope,o?D:void 0,Ss(t),Cs(t),e.where??``,e.face?.columns.join(),l?.path],queryFn:()=>v8(t,C,c,s,e.where,e.face?.columns,e.face?void 0:l),enabled:T&&!e.disabled,placeholderData:(n,r)=>r&&r.queryKey[1]===s&&r.queryKey[2]===t.id&&r.queryKey[3]===c&&r.queryKey[5]===e.scope&&(!o||r.queryKey[6]===D)&&r.queryKey[7]===Ss(t)&&r.queryKey[8]===Cs(t)&&r.queryKey[9]===(e.where??``)?n:void 0}),{choices:R,answered:z}=r2({typed:S,asked:C,placeholder:L.isPlaceholderData,rows:L.data,label:e=>e.label}),B=eJ({queryKey:[`picker-labels`,s,t.id,c,u,e.scope,Ss(t),Cs(t),l?.path],enabled:!!(c&&u.length),queryFn:async()=>{let n=Ss(t)??c,r=[...new Set([c,n,...pt(t),...e.multiple&&l?[l.path]:[]])];return((r.some(e=>e.includes(`.`))||n.startsWith(`$`)?await rs(`/api/view/run`,{...Aa(s),view:{id:`picker:${t.id}`,name:``,base:t.id,columns:r.map(e=>({path:e})),filter:{groups:[[{path:c,op:`in`,value:u}]]},limit:u.length}}):await rs(`/api/query`,{...Aa(s),table:t.id,columns:r,filter:{groups:[[{column:c,op:`in`,value:u}]]},limit:u.length,offset:0})).rows??[]).map(r=>({value:String(r[c]),label:Cs(t)===void 0?String(r[n]??r[c]):cs(t,r),...e.multiple&&l&&R2(r[l.path])?{sub:R2(r[l.path])}:{}}))}});(0,S8.useEffect)(()=>{B.data&&f(e=>new Map([...e,...B.data.map(e=>[e.value,e.label])])),B.data?.some(e=>e.sub)&&m(e=>new Map([...e,...B.data.flatMap(e=>e.sub?[[e.value,e.sub]]:[])]))},[B.data]),(0,S8.useEffect)(()=>{if(o)return;let t=O.current!==D;O.current=D;let n=k.current===D;n&&(k.current=null),e.multiple!==!0&&(!T&&!n||t&&!n)&&v(e.value?g(e.value):``)},[D,d,T]);let V=t=>{k.current=JSON.stringify(t),e.multiple===!0?e.onChange(t):e.onChange(t[0]??``)},H=t=>{f(e=>new Map(e).set(t.value,t.label)),t.sub&&m(e=>new Map(e).set(t.value,t.sub)),e.multiple?(V(u.includes(t.value)?u.filter(e=>e!==t.value):[...u,t.value]),v(``)):(b(null),V([t.value]),v(t.label),E(!1))},U=e=>{V(u.filter(t=>t!==e)),F.current?.focus()},W=()=>{b(null),V([]),v(``),F.current?.focus()},G=e=>d.get(e)??e,ee=z2(R.map(e=>e.label)),te=e=>e.sub&&(l?.declared||ee.has(e.label))?e.sub:void 0,ne=z2(u.map(G)),K=e=>ne.has(G(e))&&p.get(e)?`${G(e)} · ${p.get(e)}`:G(e);return(0,C8.jsxs)(`div`,{className:`picker${e.multiple?` picker-multi`:``}`,ref:P,onKeyDownCapture:e=>{o&&T&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),o.onCancel?.(),b(null),E(!1))},children:[(0,C8.jsx)(`span`,{className:`picker-chips`,children:e.multiple&&u.map(e=>(0,C8.jsxs)(`span`,{className:`picker-chip`,children:[(0,C8.jsx)(`span`,{children:K(e)}),(0,C8.jsx)(`button`,{type:`button`,className:`picker-chip-x`,"aria-label":h8(`remove`,{shownLabel:K(e)}),onClick:()=>U(e),children:`×`})]},e))}),(0,C8.jsx)($0,{text:x,onText:t=>{o?b(t):v(t),E(!0),!o&&!e.multiple&&u.length&&V([])},open:T,onOpenChange:E,items:R,itemKey:e=>e.value,itemLabel:e=>e.label,itemClassName:(e,t)=>`picker-option${t?` active`:``}${u.includes(e.value)?` chosen`:``}`,renderItem:t=>e.face&&t.row?e.face.draw(t.row,t.label,R.flatMap(e=>e.row?[e.row]:[])):(0,C8.jsxs)(C8.Fragment,{children:[te(t)?(0,C8.jsxs)(`span`,{className:`picker-option-name`,children:[(0,C8.jsx)(`span`,{className:`picker-option-label`,children:t.label}),(0,C8.jsx)(`span`,{className:`picker-option-sub`,children:te(t)})]}):(0,C8.jsx)(`span`,{className:`picker-option-label`,children:t.label}),!e.hideKey&&t.label!==t.value&&(0,C8.jsx)(`span`,{className:`picker-option-detail`,children:t.value})]}),onPick:H,inputRef:I,popupRef:o?.popupRef,anchorRef:P,fit:`width`,inputProps:{type:`text`,className:`picker-input`,"aria-label":n??h8(`choose`,{name:nr(t.name)}),placeholder:r??(i?h8(`search`,{name:(p8(ci().app(),t.id)?.noun?.one??nr(t.name)).toLowerCase()}):`→ ${t.name}`),autoComplete:`off`,spellCheck:!1,...e.disabled?{disabled:!0}:{},...e.invalid?{"aria-invalid":!0}:{},...e.describedBy?{"aria-describedby":e.describedBy}:{},onKeyDown:t=>{o&&t.key===`Escape`&&t.preventBaseUIHandler?.(),t.key===`Backspace`&&e.multiple&&!x&&u.length&&V(u.slice(0,-1))}},popupClassName:`picker-popup`,listClassName:`picker-list`,empty:L.isPending||!z?void 0:h8(x?`common.nothingMatches`:`nothingToChoose`),emptyClassName:`picker-empty`}),(0,C8.jsx)(`button`,{type:`button`,className:`picker-clear`,"aria-label":h8(`common.clear`),hidden:u.length===0&&!M,onClick:W,children:`×`})]})}var S8,C8,w8,T8=s((()=>{Fa(),S8=d(m(),1),nJ(),Es(),n2(),i2(),St(),cr(),pi(),m8(),U2(),Ja(),g8(),C8=d(O(),1),w8=20}));function E8(e){return/[^aeiou]ies$/i.test(e)?`${e.slice(0,-3)}${e.at(-3)===`I`?`Y`:`y`}`:/(x|ch|sh|ss|z)es$/i.test(e)?e.slice(0,-2):e.slice(0,-1)}function D8(e){if(A8.test(e))return e.slice(0,-1);if(j8.test(e)&&!/(ss|us|is)$/i.test(e)&&/[aeiouy]/i.test(e.slice(0,-1)))return E8(e)}function O8(e,t){return k8.test(e)?D8(t)??t:t}var k8,A8,j8,M8=s((()=>{k8=/^[-−]?1$/,A8=/^(second|minute|hour|day|night|week|month|year)s$/i,j8=/^(?=[a-z]*[aeiouy][a-z]*s$)[a-z]{3,}s$/i})),N8,P8=s((()=>{ba(),N8=pa({textOfMax:`{text} of {max}`,starsOf:`{stars} of {outOf} stars`,signed:`Signed`})}));function F8(e,t){return e.whole?Si(t,e.currency):xi(t,e.currency)}function I8(e,t){return ir(e,t)}function L8(e,t){let n=(t,n)=>[t,...n].map(t=>e?.values&&Object.hasOwn(e.values,t)?e.values[t]:void 0).find(Boolean);return{yes:n(t.yes,Q8.yes),no:n(t.no,Q8.no)}}function R8(e,t){return t?t===`%`?wi(e):t.startsWith(`/`)?`${e}${t}`:`${e} ${O8(e,t)}`:e}function z8(e,t,n){if(!e.tone)return null;let r=Object.hasOwn(e.tone,n)?e.tone[n]:void 0;if(r)return r;let i=Object.hasOwn(e.tone,`*`)?e.tone[`*`]:n.trim()?`neutral`:null,a=Number(t);if(!Number.isFinite(a))return B8(e.tone,n)??i;for(let[t,n]of Object.entries(e.tone)){let e=/^(>=|<=|>|<)\s*(-?\d+(?:\.\d+)?)$/.exec(t);if(!e)continue;let r=Number(e[2]);if(e[1]===`>=`?a>=r:e[1]===`<=`?a<=r:e[1]===`>`?a>r:a<r)return n}return i}function B8(e,t){let n=Object.keys(e).filter(e=>/^[<>]/.test(e));if(!n.length)return null;let r=Li(t);if(r===null)return null;let i=Ii();for(let t of n){let n=zt(t);if(n&&Bt(n,r,i))return e[t]}return null}function V8(e,t){if(!e||t==null||t===``)return;if(e.masked===!0)return sr;let n=e.masked?.prefix;return n&&String(t).startsWith(n)?`${n}${sr}`:void 0}function H8(e){return e.trim().split(/[\s._-]+/).filter(e=>/[\p{L}\p{N}]/u.test(e)).slice(0,2).map(e=>[...e.replace(/[^\p{L}\p{N}]/gu,``)][0]??``).join(``).toUpperCase()||`?`}function U8(e,t){let n=e<0?`−`:``,r=Math.round(Math.abs(e)),i=[];for(let[e,t,n]of $8){let a=Math.floor(r/t);if(r-=a*t,a&&i.length<2)i.push({unit:e,count:a,mark:n});else if(i.length)break}i.length||i.push({unit:`seconds`,count:0,mark:`s`});let a=Intl.DurationFormat;if(a)try{return n+new a(t,{style:`narrow`}).format(Object.fromEntries(i.map(({unit:e,count:t})=>[e,t])))}catch{}return n+i.map(({count:e,mark:t})=>`${e}${t}`).join(` `)}function W8(e){let t=0;for(let n of e)t=t*31+(n.codePointAt(0)??0)>>>0;return t%8}function G8(e){let t=e;if(typeof e==`string`&&e.trim().startsWith(`[`))try{t=JSON.parse(e)}catch{t=e}return(Array.isArray(t)?t.map(e=>e==null?``:String(e)):String(t).split(/\r?\n|,/)).map(e=>e.trim()).filter(Boolean)}function K8(e,t){let n=Object.keys(e.values??{}).find(e=>e.trim()!==``&&Number(e)===t);return n===void 0?void 0:e.values?.[n]}function q8(e,t){return e.icons&&Object.hasOwn(e.icons,t)?e.icons[t]:void 0}function J8(e,t){if(!e||t==null)return null;let n=V8(e,t);if(n!==void 0)return{kind:`masked`,text:n};if(e.format===`avatars`){let e=G8(t);return e.length?{kind:`avatars`,names:e.slice(0,e5),more:Math.max(0,e.length-e5),text:e.join(`, `)}:null}e.minor&&e.format===`money`&&(t=Q4(t,e.currency||vi())??t);let r=String(t);if(e.signature&&typeof e.signature==`object`&&r.trim())return{kind:`signature`,src:_r(e.signature.table,{[e.signature.key]:r}),text:N8(`signed`)};let i=Y8(e,t,r);if(i!==void 0)return i;let a=z8(e,t,r),o=Number(t);if(e.bar&&e.max!==void 0&&e.format!==`percent`&&Number.isFinite(o)&&Number.isSafeInteger(Math.trunc(o)))return{kind:`meter`,text:e.format===`money`?F8(e,o):bi(o),fill:Math.max(0,Math.min(100,o/e.max*100)),tone:a,title:N8(`textOfMax`,{text:r,max:e.max})};let s=Number.isFinite(o)&&Number.isSafeInteger(Math.trunc(o))||e.format===`money`&&Z8(t),c=a?!s||r.trim()===``?!1:e.format===`money`||e.format===`percent`||e.format===`number`||!!e.unit:!1;if(a&&!(c&&a===`neutral`)){let n=!s||r.trim()===``?null:e.format===`money`?R8(F8(e,typeof t==`string`?r:o),e.unit):e.format===`percent`?Ci(o):e.format===`number`||e.unit?R8(bi(o),e.unit):null,i=q8(e,r);return{kind:`tone`,tone:a,text:r,label:n??I8(e,r)??rr(r),...i?{icon:i}:{},...n===null?{}:{figure:!0}}}let l=q8(e,r);if(l)return{kind:`mark`,icon:l,text:r,label:I8(e,r)??rr(r)};let u=e.format===void 0&&!e.bar&&!e.avatar?I8(e,r):void 0;if(u!==void 0)return{kind:`word`,text:r,label:u};let d=(e.format===`money`||e.format===`number`||e.format===`percent`)&&s&&r.trim()?K8(e,o):void 0;if(d!==void 0)return{kind:`word`,text:r,label:d};if(e.format===`money`&&s)return{kind:`money`,text:R8(F8(e,typeof t==`string`?r:o),e.unit),title:r};if(e.format===`percent`&&s){let t=Ci(o),n=Math.max(0,Math.min(100,o));return e.bar?{kind:`percent`,text:t,bar:n}:e.ring?{kind:`percent`,text:t,ring:n}:{kind:`percent`,text:t}}if((e.format===`number`||e.format===void 0&&e.unit)&&s&&r.trim()!==``)return{kind:`number`,text:R8(bi(o),e.unit),title:r};if(e.format===`duration`&&s)return{kind:`number`,text:U8(o,mi()),title:`${r} s`};if(e.format===`richText`)return{kind:`richText`,html:r,text:br(r)};if(e.format===`items`){let e=r.split(/\r?\n/).map(e=>e.trim()).filter(Boolean);if(e.length)return{kind:`items`,items:e,text:e.join(`, `)}}if(e.format===`relative`){let t=Fi(r),n=Li(r),i=e.open===!0&&n!==null&&n<0?{overdue:!0}:{};if(t&&n!==null&&(e.absolute||Math.abs(n)>14))return{kind:`relative`,text:Oi(r),title:t,...i};if(t)return{kind:`relative`,text:t,title:r,...i}}return e.avatar&&r.trim()?{kind:`avatar`,text:r,initials:H8(r),hue:W8(r)}:null}function Y8(e,t,n){switch(e.format){case`rating`:{let r=e.outOf??5,i=Number(t);if(n.trim()===``||!Number.isFinite(i))return null;let a=Math.max(0,Math.min(r,Math.round(i)));return{kind:`rating`,value:a,outOf:r,tone:z8(e,t,n),text:N8(`starsOf`,{stars:a,outOf:r})}}case`color`:return t5.test(n.trim())?{kind:`color`,hex:n.trim().toLowerCase(),text:n.trim()}:null;case`time`:{let e=n5.exec(n.trim());return!e||Number(e[1])>23||Number(e[2])>59?null:{kind:`number`,text:new Intl.DateTimeFormat(mi(),{hour:`numeric`,minute:`2-digit`,timeZone:`UTC`}).format(Date.UTC(2e3,0,1,Number(e[1]),Number(e[2]))),title:n}}case`month`:{let e=r5.exec(n.trim());return!e||Number(e[2])<1||Number(e[2])>12?null:{kind:`number`,text:new Intl.DateTimeFormat(mi(),{month:`short`,year:`numeric`,timeZone:`UTC`}).format(Date.UTC(Number(e[1]),Number(e[2])-1,1)),title:n}}case`date`:case`datetime`:{if(typeof t!=`string`||!n.trim())return null;let r=Ni(n,{time:e.format===`datetime`,zone:e.timezone});if(r===n)return null;let i=e.tone?z8(e,t,n):null;return i&&i!==`neutral`?{kind:`tone`,tone:i,text:n,label:r}:{kind:`date`,text:r,title:n}}case`year`:return/^\d{1,4}$/.test(n.trim())?{kind:`number`,text:n.trim(),title:n}:null;case`json`:{let e=typeof t==`string`?n:JSON.stringify(t),r;try{r=JSON.parse(e)}catch{return null}return!r||typeof r!=`object`?null:{kind:`json`,text:e,excerpt:e.replace(/\s+/g,` `).slice(0,120)}}case`qr`:return n.trim()?{kind:`qr`,text:n}:null;case`address`:{let e=X8(n);return e.length?{kind:`address`,lines:e,text:e.join(`, `)}:null}}}function X8(e){return e.split(/\r?\n/).map(e=>e.trim().replace(/\s+/g,` `)).filter(Boolean)}var Z8,Q8,$8,e5,t5,n5,r5,i5=s((()=>{Dr(),cr(),Yi(),n3(),Vt(),M8(),P8(),Z8=e=>typeof e==`number`&&Number.isFinite(e)||typeof e==`string`&&/^\s*[+-]?\d+(\.\d+)?\s*$/.test(e),Q8={yes:[`true`,`1`,`t`],no:[`false`,`0`,`f`]},$8=[[`days`,86400,`d`],[`hours`,3600,`h`],[`minutes`,60,`m`],[`seconds`,1,`s`]],e5=3,t5=/^#[0-9a-f]{6}$|^#[0-9a-f]{3}$/i,n5=/^(\d{1,2}):(\d{2})(?::\d{2}(?:\.\d+)?)?$/,r5=/^(\d{4})-(\d{2})(?:-\d{2})?/}));function a5(e,t){return!!t.references&&!xs(e.id).some(e=>e.from.columns.length>1&&e.from.columns.includes(t.name))}var o5=s((()=>{Es()})),s5,c5=s((()=>{ba(),s5=pa({one:`one of: {allowed}`,saved:`Saved {label}.`,edit:`Edit {label}`})}));function l5(e){let t=(0,d5.useId)(),n=t$(e.table.id,e.column.name);return n?(0,f5.jsx)(n$,{component:n,fallback:(0,f5.jsx)(u5,{...e}),value:e.value,onChange:t=>e.onChange(t===null||t===``?e.column.nullable?null:``:String(t)),id:e.id??t,describedBy:e.describedBy,invalid:e.invalid===!0,disabled:!1,required:e.column.nullable===!1,label:e.label,field:{name:e.column.name,resource:e.table.id},context:`edit`}):(0,f5.jsx)(u5,{...e})}function u5({table:e,column:t,value:n,onChange:r,label:i,id:a,row:o,onPickerState:s,describedBy:c,invalid:l,valueLabel:u}){let d=(0,d5.useId)(),f=e=>r(e===``&&t.nullable?null:e),p=t.references&&a5(e,t)?bs(t.references.table):void 0;if(p)return(0,f5.jsx)(y8,{table:p,valueColumn:t.references.column,value:n??``,onChange:f,ariaLabel:i,app:!0,...u&&n?{known:{value:n,label:u}}:{},editing:{onStateChange:e=>s?.(e)}});let m=z6(t,o);if(t.allowed?.length||m){let r=m?L8(ps(e.id,t.name),m):{},o=t.allowed?.length?t.allowed.map(e=>({value:e,label:rr(e)||nr(e)})):[{value:m.yes,label:r.yes??s5(`common.yes`)},{value:m.no,label:r.no??s5(`common.no`)}];return n!==null&&!o.some(e=>e.value===n)&&o.unshift({value:n,label:n}),(0,f5.jsx)(rQ,{ariaLabel:i,id:a,value:n??``,ariaInvalid:l,ariaDescribedBy:c,items:[...t.nullable?[{value:``,label:s5(`common.noValue`)}]:[],...o],onChange:f})}if(ht(t.type)===`date`&&!/time/i.test(t.type))return(0,f5.jsx)(WQ,{id:a??d,value:n??``,onChange:f,"aria-label":i,"aria-invalid":l||void 0,"aria-describedby":c,locale:mi(),timezone:hi(),now:_i()});let h=ps(e.id,t.name);return h?.format===`money`&&h.minor?(0,f5.jsx)(c8,{value:n??``,currency:e3(h,o,h.currency||vi()),onChange:f,children:(e,t)=>(0,f5.jsx)(`input`,{id:a,type:`text`,inputMode:`decimal`,className:`cell-edit`,"aria-label":i,"aria-invalid":l||void 0,"aria-describedby":c,value:e,"data-null":String(n===null),onChange:e=>t(e.target.value)})}):(0,f5.jsx)(`input`,{id:a,type:`text`,className:`cell-edit`,"aria-label":i,"aria-invalid":l||void 0,"aria-describedby":c,value:n??``,"data-null":String(n===null),onChange:e=>f(e.target.value),title:t.allowed?.length?s5(`one`,{allowed:t.allowed.join(`, `)}):void 0})}var d5,f5,p5=s((()=>{d5=d(m(),1),Es(),Fa(),St(),cr(),B6(),Z6(),$6(),t8(),pi(),Ja(),Yi(),n3(),d8(),aQ(),T8(),qQ(),i5(),o5(),c$(),c5(),f5=d(O(),1)})),m5=s((()=>{cr(),A2()}));function h5(e,t,n,r){return U(`/api/file?${new URLSearchParams({...Aa(n??null),table:e,key:JSON.stringify(t),inline:`1`,...r?{variant:r}:{}})}`)}var g5=s((()=>{W(),Fa(),m5()}));function _5(e,t){let n=gs.activeConnection??null,r=e.flatMap(e=>{let n=y5(e.display),r=n&&e.photoOwner?bs(n.from):void 0,i=r?pt(r):[];if(!n||!r||!i.length||!e.photoOwner)return[];let a=[...new Set(t.map(t=>t[e.photoOwner]).filter(e=>e!=null))];if(!a.length)return[];let[o,s=`asc`]=(n.sort??``).split(/\s+/),c=`${r.id} ${n.whose} in (${a.map(b5).join(`, `)}) sort ${n.whose}${o?`, ${o} ${s}`:``} show ${[...new Set([...i,n.whose])].join(`, `)}`;return[{column:e.name,from:r,key:i,whose:n.whose,text:c}]}),i=Yq({queries:r.map(e=>({queryKey:[`run`,n??``,`avatar-photos`,e.text],staleTime:6e4,queryFn:async()=>{let t=await rs(`/api/run`,{q:e.text,limit:500,offset:0,count:`none`,...Aa(n)});return t.errors?.length?[]:t.rows??[]}}))}),a=r.map((e,t)=>`${e.text}@${i[t]?.dataUpdatedAt??0}`).join(`
209
209
  `);return(0,v5.useMemo)(()=>{if(!r.length)return x5;let e=new Map;return r.forEach((t,r)=>{let a=new Map;for(let e of i[r]?.data??[]){let r=String(e[t.whose]);a.has(r)||a.set(r,h5(t.from.id,Object.fromEntries(t.key.map(t=>[t,e[t]])),n,`thumb`))}e.set(t.column,a)}),(t,n)=>n==null?void 0:e.get(t)?.get(String(n))},[a])}var v5,y5,b5,x5,Pne=s((()=>{v5=d(m(),1),nJ(),Es(),Fa(),St(),g5(),O(),y5=e=>e?.avatar&&typeof e.avatar==`object`?e.avatar:void 0,(0,v5.createContext)(()=>void 0),b5=e=>typeof e==`number`?String(e):ms(String(e)),x5=()=>void 0}));function Fne(e,t,n,r){return{phase:`pending`,touch:e===`touch`,x0:t,y0:n,t0:r}}function Ine(e,t,n,r){if(e.phase===`dragging`)return[e,`move`];if(e.phase===`over`)return[e,`none`];let i=C5(e,t,n);return e.touch?i>8?[{...e,phase:`over`},`abandon`]:r-e.t0>=350?[{...e,phase:`dragging`},`lift`]:[e,`none`]:i>4?[{...e,phase:`dragging`},`lift`]:[e,`none`]}function Lne(e,t){return e.phase!==`pending`||!e.touch||t-e.t0<350?[e,`none`]:[{...e,phase:`dragging`},`lift`]}function Rne(e){return e.phase===`dragging`?`drop`:e.phase===`pending`?`click`:`none`}function S5(e,t,n,r=48,i=18){return n-t<=r*2?0:e<t+r?-Math.ceil((t+r-e)/r*i):e>n-r?Math.ceil((e-(n-r))/r*i):0}function zne(e,t,n,r){return e.map((i,a)=>{if(t===void 0)return n!==void 0&&a>=n?r:0;if(a===t)return n===void 0||n===t?0:n>t?e.slice(t+1,n+1).reduce((e,t)=>e+t,0):-e.slice(n,t).reduce((e,t)=>e+t,0);let o=a<t?a:a-1;return n===void 0?a>t?-r:0:o>=t&&o<n?-r:o>=n&&o<t?r:0})}var C5,Bne=s((()=>{C5=(e,t,n)=>Math.hypot(t-e.x0,n-e.y0)}));function Vne(e,t){let n=e.getBoundingClientRect(),r=document.createElement(`div`);r.className=`drag-ghost`,r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`inert`,``),r.style.width=`${n.width/t}px`,r.style.height=`${n.height/t}px`;let i=e.cloneNode(!0);i.setAttribute(`data-ghost`,``),i.style.removeProperty(`scale`),i.style.removeProperty(`transition`),e instanceof HTMLTableRowElement&&[...e.cells].forEach((e,n)=>{let r=i.children[n];r&&(r.style.width=`${e.getBoundingClientRect().width/t}px`)});let a=i;for(let t=e.parentElement;t&&t!==document.body&&t!==na();t=t.parentElement){let e=Hne(t);t.tagName===`TABLE`?Object.assign(e.style,{width:`100%`,height:`100%`,tableLayout:`fixed`,margin:`0`}):/^(TBODY|THEAD|TFOOT)$/.test(t.tagName)||(e.style.display=`contents`),e.appendChild(a),a=e}for(let e of[a,...a.querySelectorAll(`*`)])for(let t of N5)e.removeAttribute(t);return r.appendChild(a),ra().appendChild(r),r}function Hne(e){if(e.tagName!==`DETAILS`)return e.cloneNode(!1);let t=document.createElement(`div`);for(let{name:n,value:r}of e.attributes)t.setAttribute(n,r);return t}function Une(e){let t=[];for(let n=e.parentElement;n&&n!==document.body&&n!==na();n=n.parentElement){let e=getComputedStyle(n);/(auto|scroll)/.test(`${e.overflowX} ${e.overflowY}`)&&t.push(n)}return t}function Wne(e,t){let n=e.getBoundingClientRect(),r=parseFloat(getComputedStyle(e).scrollPaddingLeft)||0,i=[...e.querySelectorAll(`:scope > *, :scope > * > *`)].filter(e=>e.offsetWidth>0&&getComputedStyle(e).scrollSnapAlign.split(` `).some(e=>e!==`none`)).map(i=>Math.round((i.getBoundingClientRect().left-n.left)/t+e.scrollLeft-r));return[...new Set(i)].sort((e,t)=>e-t)}function w5(e){let t=e.parentElement,n=t&&parseFloat(getComputedStyle(t).rowGap)||0;return e.offsetHeight+n}function Gne(e){let t=(0,T5.useRef)(e);t.current=e;let[n,r]=(0,T5.useState)(null),i=(0,T5.useRef)(null);(0,T5.useEffect)(()=>(O5++===0&&ea(window,`touchmove`,k5,{passive:!1}),()=>{i.current?.cancel(),--O5===0&&ta(window,`touchmove`,k5)}),[]);let a=()=>t.current.items??`[data-drop-item]`,o=(e,t)=>{let n=typeof document.elementsFromPoint==`function`?document.elementsFromPoint(e,t):[];return n.find(e=>!e.closest(`.drag-ghost`))??(n.length?null:document.elementFromPoint(e,t))},s=(e,t)=>A5.get(e)?t-(parseFloat((getComputedStyle(e).translate||``).split(` `)[1]??`0`)||0)*j5:t,c=(e,n)=>{let r=o(e,n),i=r?.closest(`[data-drop-zone]`);if(!i)return null;let c=a(),l=r.closest(c),u=t=>{let r=t.getBoundingClientRect();return{upper:r.height===0||n<r.top+r.height/2,left:r.width===0||e<r.left+r.width/2}},d=!!t.current.gap;if(l&&i.contains(l)&&!(d&&(l.hasAttribute(`data-drag-origin`)||A5.get(l)))||l&&i.contains(l)&&l.getBoundingClientRect().height===0)return{zone:i,item:l,...u(l)};for(let e of i.querySelectorAll(c)){if(e.closest(`[data-drop-zone]`)!==i||d&&e.hasAttribute(`data-drag-origin`))continue;let t=e.getBoundingClientRect();if(n<s(e,t.top)+t.height/2)return{zone:i,item:e,upper:!0,left:!0}}return{zone:i,upper:!1,left:!1}},l=(e,n,o)=>{if(E5||!e.isPrimary||e.pointerType===`mouse`&&e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let s=e.target?.closest?.(M5);if(s&&o.contains(s))return;let l=e.pointerId,u=Fne(e.pointerType,e.clientX,e.clientY,performance.now()),d=e.clientX,f=e.clientY,p=null,m={x:0,y:0},h=1,g=[],_=0,v=o.closest(a())??o,y=v.closest(`[data-drop-zone]`),b=null,x=new Set,S=new Map,C=new Map,w=new Map,T=!F5(),E=e=>[...e.querySelectorAll(a())].filter(t=>t.closest(`[data-drop-zone]`)===e),D=(e,t)=>{(A5.get(e)??0)!==t&&(T&&!e.style.transition&&(e.style.transition=`translate ${I5}`),e.style.translate=t?R5(t):``,A5.set(e,t),x.add(e))},O=e=>{if(e?.zone===b?.zone&&e?.before===b?.before)return;b=e;let t=w5(v),n=new Set([...x].map(e=>e.closest(`[data-drop-zone]`)).filter(Boolean));y&&n.add(y),e&&n.add(e.zone);for(let r of n){let n=E(r),i=n.indexOf(v),a=n.filter(e=>e!==v),o=e?.zone===r?e.before?a.indexOf(e.before):a.length:void 0,s=e?zne(n.map(w5),i<0?void 0:i,o!==void 0&&o>=0?o:void 0,t):n.map(()=>0);n.forEach((e,t)=>D(e,s[t]));let c=!!(e&&e.zone===r&&i<0);c&&!S.has(r)?(S.set(r,r.style.paddingBottom),r.style.paddingBottom=`${(parseFloat(getComputedStyle(r).paddingBottom)||0)+t}px`):!c&&S.has(r)&&(r.style.paddingBottom=S.get(r),S.delete(r))}v.style.opacity=e&&e.zone!==y?`0`:``},k=()=>{for(let e of x)e.style.transition=``,e.style.translate=``,A5.delete(e);x.clear();for(let[e,t]of S)e.style.paddingBottom=t;S.clear(),v.style.opacity=``,b=null},A=()=>{if(!p)return;p.style.transform=`translate(${(d-m.x)/h}px, ${(f-m.y)/h}px)`;let e=t.current.over(n,c(d,f));t.current.gap&&O(e||null)},j=()=>{let e=!1,t=performance.now();for(let n of g){let r=n.getBoundingClientRect(),i=n.scrollWidth>n.clientWidth?S5(d,r.left,r.right):0,a=n.scrollHeight>n.clientHeight?S5(f,r.top,r.bottom):0,[o,s]=[n.scrollLeft,n.scrollTop];if(i&&C.has(n)){if(t-(w.get(n)??0)>600){let e=Wne(n,h),r=i>0?e.find(e=>e>o+2):e.filter(e=>e<o-2).at(-1);r!==void 0&&n.scrollTo({left:r,behavior:T?`smooth`:`auto`}),w.set(n,t)}}else i&&(n.scrollLeft+=i);a&&(n.scrollTop+=a),e||=n.scrollLeft!==o||n.scrollTop!==s}let n=S5(f,0,window.innerHeight);if(n){let t=window.scrollY;window.scrollBy(0,n),e||=window.scrollY!==t}e&&A(),_=requestAnimationFrame(j)},M=()=>{U(),h=j5=P5();let e=o.getBoundingClientRect();m={x:u.x0-e.left,y:u.y0-e.top},g=Une(o);let t=g.filter(e=>{let t=getComputedStyle(e).scrollSnapType;return!!t&&!t.startsWith(`none`)});p=Vne(o,h);for(let e of t)C.set(e,e.style.scrollSnapType),e.style.scrollSnapType=`none`;o.setAttribute(`data-lifted`,``),v.setAttribute(`data-drag-origin`,``),window.getSelection()?.removeAllRanges(),D5=u.touch,r(()=>n),_=requestAnimationFrame(j)},N=([e,t])=>{u=e,t===`abandon`?G():(t===`lift`&&M(),(t===`lift`||t===`move`)&&A())},P=e=>{e.pointerId===l&&(d=e.clientX,f=e.clientY,N(Ine(u,d,f,performance.now())))},F=e=>{if(e.pointerId!==l)return;if(d=e.clientX,f=e.clientY,Rne(u)!==`drop`){G();return}let r=c(d,f),i=new Map([...x].map(e=>[e,e.getBoundingClientRect().top])),a=G(!0),o=e=>{e.preventDefault(),e.stopPropagation()};ea(window,`click`,o,!0),setTimeout(()=>ta(window,`click`,o,!0),0),t.current.drop(n,r),t.current.end?.(n);let s=t.current.locate;ee(a,s?s(n):null,i)},I=e=>{e.pointerId===l&&te()},L=e=>{e.key===`Escape`&&(p&&(e.preventDefault(),e.stopPropagation()),te())},R=e=>{u.touch&&e.preventDefault()},z=e=>e.preventDefault(),B=e=>{p&&e.preventDefault()},V=u.touch?window.setTimeout(()=>N(Lne(u,performance.now())),350):0;u.touch&&na().classList.add(`is-pressing`);let H=!1;u.touch&&T&&(H=!0,o.style.transition=`scale ${I5}`,requestAnimationFrame(()=>{H&&(o.style.scale=`0.97`)}));function U(){H&&(H=!1,o.style.removeProperty(`scale`),o.style.removeProperty(`transition`))}let W=[[`pointermove`,P,!1],[`pointerup`,F,!1],[`pointercancel`,I,!1],[`keydown`,L,!0],[`contextmenu`,R,!0],[`dragstart`,z,!0],[`selectstart`,B,!0],[`blur`,()=>te(),!1]];for(let[e,t,n]of W)ea(window,e,t,n);function G(e=!1){window.clearTimeout(V),cancelAnimationFrame(_),U();for(let[e,t,n]of W)ta(window,e,t,n);let t=p;p=null,e||t?.remove(),k();for(let[e,t]of C)e.style.scrollSnapType=t;return C.clear(),e||o.removeAttribute(`data-lifted`),v.removeAttribute(`data-drag-origin`),na().classList.remove(`is-pressing`),D5=!1,E5=i.current=null,t&&r(null),t}function ee(e,t,n){let r=o;if(!e){r.removeAttribute(`data-lifted`);return}let i=()=>{e.remove(),r.removeAttribute(`data-lifted`),t&&t.style.removeProperty(`opacity`)},a=t?.isConnected?t.getBoundingClientRect():null;if(!T||!t||!a||a.width===0&&a.height===0)i();else{for(let[e,r]of n){if(!e.isConnected||e===v||e.contains(t))continue;let n=(r-e.getBoundingClientRect().top)/h;Math.abs(n)<.5||(e.style.transition=`none`,e.style.translate=R5(n),requestAnimationFrame(()=>{e.style.transition=`translate ${I5}`,e.style.translate=``,setTimeout(()=>e.style.removeProperty(`transition`),L5()+50)}))}t.style.opacity=`0`,e.style.transition=`transform ${I5}`,e.style.transform=`translate(${a.left/h}px, ${a.top/h}px)`,setTimeout(i,L5()+20)}}function te(){let e=G(!0);e?(ee(e,o.isConnected?o:null,new Map),t.current.end?.(n)):o.removeAttribute(`data-lifted`)}E5=i.current={cancel:te}};return{source:(e,t)=>t?{"data-draggable":`true`,onPointerDown:t=>l(t,e,t.currentTarget)}:{},start:l,dragging:n}}var T5,E5,D5,O5,k5,A5,j5,M5,N5,P5,F5,I5,L5,R5,Kne=s((()=>{T5=d(m(),1),Bne(),sa(),E5=null,D5=!1,O5=0,k5=e=>{D5&&e.cancelable&&e.preventDefault()},A5=new WeakMap,j5=1,M5=`[data-drag-ignore], input, textarea, select, [contenteditable="true"]`,N5=[`id`,`data-drop-zone`,`data-drop-item`,`data-drop`,`data-lifted`,`data-draggable`,`data-row-key`,`data-card`],P5=()=>Number(getComputedStyle(na()).zoom)||1,F5=()=>typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,I5=`var(--t-press, 140ms) var(--ease-out, ease-out)`,L5=()=>{let e=getComputedStyle(na()).getPropertyValue(`--t-press`).trim(),t=e.endsWith(`ms`)?parseFloat(e):e.endsWith(`s`)?parseFloat(e)*1e3:140;return Number.isFinite(t)?Math.min(t,150):140},R5=e=>`0 ${e}px`})),z5,qne=s((()=>{ba(),z5=pa({fill:`Fill in {column}.`,addLine:`Add line`,removeLine:`Remove line`,moveUp:`Move up`,moveDown:`Move down`,moveLine:`Move line {n}`,moveLineHint:`Drag, or press Alt and an arrow key, to move this line`,lineActions:`Line {n} actions`,lineActionsHeading:`Actions`,lineMoved:`Line moved to place {n} of {count}.`,noLinesYet:`No lines yet.`,subtotal:`Subtotal`})})),Jne=s((()=>{}));function B5(e,t){return fs(e.id,t.name)??nr(t.name)}function Yne(e){try{return new Intl.NumberFormat(mi(),{style:`currency`,currency:e}).formatToParts(0).find(e=>e.type===`currency`)?.value??e}catch{return e}}function Xne(e,t){if(t$(e.id,t.name))return`control`;if(t.references&&a5(e,t)&&bs(t.references.table))return`reference`;if(t.allowed?.length||z6(t,null))return`control`;let n=ht(t.type);return n===`date`?`control`:J5(e,t.name)?.format===`money`?`money`:n===`number`?`number`:`text`}function Zne(e,t){return Object.entries(e.computed??{}).filter(([n,r])=>{if(t.includes(n))return!1;let i=Xn(r.expr);return i.length>0&&i.every(t=>!t.includes(`.`)&&e.columns.some(e=>e.name===t))}).map(([e])=>e)}function V5(e,t){let n=J5(e,t);if(n||!e.computed?.[t])return n;let r=Xn(e.computed[t].expr).filter(t=>J5(e,t)?.format===`money`);return r.length===1?J5(e,r[0]):null}function H5(e,t,n){if(t===null)return`—`;if(typeof t==`object`)return`day`in t?t.day:t.instant.toISOString();let r=e?.currencyColumn?{...e,currency:e3(e,n,e.currency??``)||void 0}:e,i=typeof t==`number`?J8(r,t):null;if(i&&`text`in i&&typeof i.text==`string`&&i.kind===`money`){let e=r?.currency||vi(),n=Number(r?.minor?Q4(t,e)??t:t),a=X4(e);return(Number.isFinite(n)?xi(n,e,{minimumFractionDigits:a,maximumFractionDigits:a}):i.text).replace(/^-/,`−`)}return typeof t==`number`?bi(t):typeof t==`boolean`?z5(t?`common.yes`:`common.no`):t}function Qne(e,t,n,r,i={}){if(!e||!n.length)return{};try{return A6(e,t,n,r,i)}catch{return{}}}function $ne(e){let t=e.references?bs(e.references.table):void 0,n=t?pt(t):[],r=t?Ss(t):void 0,i=r&&!r.startsWith(`$`)?r:/\{([^}]+)\}/.exec(String((t&&Cs(t))??``))?.[1];if(!t||n.length!==1||!i)return;let[a,o,s]=i.split(`.`);if(s!==void 0)return;let c=e=>typeof e?.subtitle==`string`?t.columns.find(t=>t.name===e.subtitle&&!t.references):void 0,l=e=>e?.avatar&&typeof e.avatar==`object`?e.avatar:void 0,u;if(o===void 0){let e=J5(t,a),r=c(e),i=l(e);u={owner:n[0],...r?{subtitle:r.name}:{},...i?{photo:i}:{}}}else{let e=t.columns.find(e=>e.name===a&&e.references),n=e?bs(e.references.table):void 0;if(!e||!n||e.references.column!==pt(n)[0])return;let r=c(J5(t,a)),i=l(J5(n,o));u={owner:a,...r?{subtitle:r.name}:{},...i?{photo:i}:{}}}if(u.subtitle||u.photo)return{column:e.name,target:t,valueColumn:e.references.column,key:n[0],...u}}function U5({src:e}){return(0,G5.jsx)(`span`,{className:`lines-thumb`,children:e?(0,G5.jsx)(`img`,{src:e,alt:``,loading:`lazy`,decoding:`async`}):null})}function ere({face:e,row:t,label:n,rows:r}){let i=_5(e.photo?[{name:`choice`,display:{avatar:e.photo},photoOwner:e.owner}]:[],r);return(0,G5.jsxs)(`span`,{className:`lines-choice`,children:[e.photo&&(0,G5.jsx)(U5,{src:i(`choice`,t[e.owner])}),(0,G5.jsxs)(`span`,{className:`lines-choice-text`,children:[(0,G5.jsx)(`span`,{className:`picker-option-label`,children:n}),e.subtitle&&(0,G5.jsx)(`span`,{className:`lines-ref-sub`,children:X5(t[e.subtitle])})]})]})}function tre(e,t){let n=gs.activeConnection,r=e.map(e=>[...new Set(t.map(t=>t.values[e.column]).filter(Boolean))].sort()),i=Yq({queries:e.map((e,t)=>({queryKey:[`lines-faces`,n,e.target.id,e.valueColumn,e.owner,e.subtitle,r[t]],enabled:r[t].length>0,staleTime:6e4,placeholderData:e=>e,queryFn:async()=>(await rs(`/api/query`,{...Aa(n),table:e.target.id,columns:[...new Set([e.key,e.owner,e.valueColumn,...e.subtitle?[e.subtitle]:[]])],filter:{groups:[[{column:e.valueColumn,op:`in`,value:r[t]}]]},limit:r[t].length,offset:0})).rows??[]}))}),a=e.flatMap((e,t)=>e.photo?(i[t]?.data??[]).map(t=>({[e.column]:t[e.owner]})):[]),o=_5(e.flatMap(e=>e.photo?[{name:e.column,display:{avatar:e.photo},photoOwner:e.column}]:[]),a);return(t,n)=>{let r=e.findIndex(e=>e.column===t);if(r<0||!n)return{};let a=i[r]?.data?.find(t=>X5(t[e[r].valueColumn])===n);return{photo:a?o(t,a[e[r].owner]):void 0,subtitle:a&&e[r].subtitle?X5(a[e[r].subtitle]):``}}}function nre(e,t,n,r){let i=gs.activeConnection,a=[...new Set(Object.values(t).map(e=>e.split(`.`)[0]))].flatMap(r=>{let i=e.columns.find(e=>e.name===r)?.references,a=i?bs(i.table):void 0;if(!i||!a)return[];let o=Object.entries(t).filter(([,e])=>e.split(`.`)[0]===r).map(([e,t])=>({column:e,read:t.split(`.`)[1]})),s=[...new Set(n.map(e=>e.values[r]).filter(Boolean))].sort();return[{via:r,target:a,valueColumn:i.column,reads:o,asked:s}]}),o=Yq({queries:a.map(e=>({queryKey:[`lines-copies`,i,e.target.id,e.valueColumn,e.reads.map(e=>e.read),e.asked],enabled:e.asked.length>0,staleTime:6e4,placeholderData:e=>e,queryFn:async()=>(await rs(`/api/query`,{...Aa(i),table:e.target.id,columns:[...new Set([e.valueColumn,...e.reads.map(e=>e.read)])],filter:{groups:[[{column:e.valueColumn,op:`in`,value:e.asked}]]},limit:e.asked.length,offset:0})).rows??[]}))}),s=a.map((e,t)=>o[t]?.data);(0,W5.useEffect)(()=>{let e=!1,t=n.map(t=>{let n={...t.values};return a.forEach((r,i)=>{let a=s[i]?.find(e=>X5(e[r.valueColumn])===(t.values[r.via]??``));for(let{column:t,read:i}of r.reads){let r=a?X5(a[i]):``;(n[t]??``)!==r&&(n[t]=r,e=!0)}}),{...t,values:n}});e&&r(t)})}function rre(e,t,n){if(!/^-?\d+(\.\d*)?$/.test(e.trim()))return e;let[,r=``]=e.trim().split(`.`);return r.length>t?e:xi(Number(e),n,{minimumFractionDigits:t,maximumFractionDigits:t})}function ire({value:e,currency:t,minor:n,onChange:r,input:i}){let[a,o]=(0,W5.useState)(!1),s=X4(t),c=(e,n)=>(0,G5.jsxs)(`span`,{className:`lines-box lines-money`,children:[a&&(0,G5.jsx)(`span`,{className:`lines-affix`,"aria-hidden":`true`,children:Yne(t)}),(0,G5.jsx)(`input`,{type:`text`,inputMode:`decimal`,className:`lines-input is-figure`,autoComplete:`off`,...i,value:a?e:rre(e,s,t),onFocus:()=>o(!0),onBlur:()=>o(!1),onChange:e=>n(e.target.value)})]});return n?(0,G5.jsx)(c8,{value:e,currency:t,onChange:r,children:c}):c(e,r)}function are(){return(0,G5.jsx)(`svg`,{width:`8`,height:`14`,viewBox:`0 0 8 14`,"aria-hidden":`true`,focusable:`false`,children:[2,7,12].flatMap(e=>[1.5,6.5].map(t=>(0,G5.jsx)(`circle`,{cx:t,cy:e,r:`1.3`,fill:`currentColor`},`${t}-${e}`)))})}function ore({title:e,table:t,columns:n,rows:r,onChange:i,ordered:a=!1,max:o=64,problems:s={},disabled:c=!1,titleShown:l=!0,summary:u,description:d,copy:f,where:p,subtotal:m=!1}){let h=n.map(e=>t.columns.find(t=>t.name===e)).filter(e=>!!e),g=h.map(e=>Xne(t,e)),_=Object.keys(f??{}).filter(e=>t.columns.some(t=>t.name===e)),v=(0,W5.useMemo)(()=>Zne(t,[...n,..._]),[t,n,_.join()]);nre(t,f??{},r,i);let y=r.map(e=>Qne(gs.schema,t,v,e.values)),b=m&&!u?v.filter(e=>V5(t,e)?.format===`money`):[],x=h.flatMap((e,t)=>g[t]===`reference`?$ne(e)??[]:[]),S=tre(x,r),C=(0,W5.useRef)(null),w=(0,W5.useRef)(null),T=(0,W5.useRef)(null),[E,D]=(0,W5.useState)(``),[O,k]=(0,W5.useState)(null);(0,W5.useEffect)(()=>{C.current!==null&&(T.current?.querySelector(`tr[data-line="${C.current}"] input`)?.focus(),C.current=null),w.current&&=(T.current?.querySelector(`tr[data-line="${w.current.line}"] ${w.current.what}`)?.focus(),null)});let A=(e,t,n)=>i(r.map((r,i)=>i===e?{...r,values:{...r.values,[t]:n??``}}:r)),j=(e,t,n)=>{if(t<0||t>=r.length||t===e)return;let a=[...r],[o]=a.splice(e,1);a.splice(t,0,o),n&&(w.current={line:o.id,what:n}),D(z5(`lineMoved`,{n:t+1,count:r.length})),i(a)},M=e=>{let t=r.filter((t,n)=>n!==e),n=t[Math.min(e,t.length-1)];n&&(w.current={line:n.id,what:`.row-actions-trigger`}),i(t)},N=Gne({over:(e,t)=>k(P(e,t)),drop:(e,t)=>{let n=P(e,t),i=r.findIndex(t=>t.id===e);if(!n||i<0)return;let a=r.findIndex(e=>e.id===n.line)+ +(n.side===`after`);a>i&&--a,j(i,a,`.lines-grip`)},end:()=>k(null),items:`tr[data-line]`}),P=(e,t)=>{if(!t)return null;let n=t.item?Number(t.item.dataset.line):r[r.length-1]?.id;return n===void 0||n===e?null:{line:n,side:t.item&&t.upper?`before`:`after`}},F=(e,t)=>{let n=e.key===`ArrowUp`?-1:+(e.key===`ArrowDown`);!n||e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),j(t,t+n,`.lines-grip`))},I=(e,n)=>{let r=J5(t,e.name);return e3(r??{},n.values,r?.currency||vi())},L=e=>`is-${e}`,R=h.length+_.length+v.length+ +!!a+1,z=e=>fs(t.id,e)??nr(e);return(0,G5.jsxs)(`fieldset`,{className:`form-lines`,disabled:c,children:[(0,G5.jsx)(`legend`,{className:l?void 0:`visually-hidden`,children:e}),d&&(0,G5.jsx)(`p`,{className:`form-lines-description`,children:d}),(0,G5.jsxs)(`div`,{className:`form-lines-body`,children:[(0,G5.jsxs)(`table`,{className:`form-lines-grid${a?` is-ordered`:``}`,children:[(0,G5.jsxs)(`colgroup`,{children:[a&&(0,G5.jsx)(`col`,{className:`lines-col-grip`}),h.map((e,t)=>(0,G5.jsx)(`col`,{className:`lines-col-${g[t]}`},e.name)),_.map(e=>(0,G5.jsx)(`col`,{className:`lines-col-figure`},e)),v.map(e=>(0,G5.jsx)(`col`,{className:`lines-col-figure`},e)),(0,G5.jsx)(`col`,{className:`lines-col-menu`})]}),(0,G5.jsx)(`thead`,{children:(0,G5.jsxs)(`tr`,{children:[a&&(0,G5.jsx)(`th`,{"aria-hidden":`true`}),h.map((e,n)=>(0,G5.jsx)(`th`,{scope:`col`,className:L(g[n]),children:B5(t,e)},e.name)),_.map(e=>(0,G5.jsx)(`th`,{scope:`col`,className:`is-figure`,children:z(e)},e)),v.map(e=>(0,G5.jsx)(`th`,{scope:`col`,className:`is-figure`,children:fs(t.id,e)??nr(e)},e)),(0,G5.jsx)(`th`,{children:(0,G5.jsx)(`span`,{className:`visually-hidden`,children:z5(`lineActionsHeading`)})})]})}),(0,G5.jsxs)(`tbody`,{ref:T,"data-drop-zone":``,children:[r.map((e,n)=>{let i=n+1;return(0,G5.jsxs)(`tr`,{"data-line":e.id,...O?.line===e.id?{"data-drop":O.side}:{},...N.dragging===e.id?{"data-lifted":``}:{},children:[a&&(0,G5.jsx)(`td`,{className:`lines-handle`,children:(0,G5.jsx)(`button`,{type:`button`,className:`lines-grip`,"aria-label":z5(`moveLine`,{n:i}),"aria-keyshortcuts":`Alt+ArrowUp Alt+ArrowDown`,title:z5(`moveLineHint`),onPointerDown:t=>{let n=t.currentTarget.closest(`tr`);n&&N.start(t,e.id,n)},onKeyDown:e=>F(e,n),children:(0,G5.jsx)(are,{})})}),h.map((r,a)=>{let o=g[a],c=s[`${n}.${r.name}`],l=c?`line-${e.id}-${r.name}-error`:void 0,u=`${B5(t,r)}, ${i}`,d=e.values[r.name]??``,f={"aria-label":u,...c?{"aria-invalid":!0,"aria-describedby":l}:{}},m;if(o===`reference`){let e=x.find(e=>e.column===r.name),t=bs(r.references.table),i=e?S(r.name,d):{};m=(0,G5.jsxs)(`span`,{className:`lines-box lines-ref${e?.photo?` has-thumb`:``}${e?.subtitle?` has-sub`:``}`,children:[e?.photo&&(0,G5.jsx)(U5,{src:i.photo}),(0,G5.jsxs)(`span`,{className:`lines-ref-text`,children:[(0,G5.jsx)(y8,{table:t,valueColumn:r.references.column,value:d,onChange:e=>A(n,r.name,e),ariaLabel:u,invalid:f[`aria-invalid`]===!0,...f[`aria-describedby`]?{describedBy:f[`aria-describedby`]}:{},app:!0,hideKey:!!e,...p?.[r.name]?{where:p[r.name]}:{},editing:{onStateChange:()=>{}},...e?{face:{columns:[...new Set([e.key,e.owner,...e.subtitle?[e.subtitle]:[]])],draw:(t,n,r)=>(0,G5.jsx)(ere,{face:e,row:t,label:n,rows:r})}}:{}}),e?.subtitle&&(0,G5.jsx)(`span`,{className:`lines-ref-sub`,children:i.subtitle})]})]})}else m=o===`money`?(0,G5.jsx)(ire,{value:d,currency:I(r,e),minor:!!Y5(t,r.name),onChange:e=>A(n,r.name,e),input:f}):o===`number`||o===`text`?(0,G5.jsx)(`span`,{className:`lines-box`,children:(0,G5.jsx)(`input`,{type:`text`,className:`lines-input${o===`number`?` is-figure`:``}`,autoComplete:`off`,...o===`number`?{inputMode:`decimal`}:{},...f,value:d,onChange:e=>A(n,r.name,e.target.value)})}):(0,G5.jsx)(`span`,{className:`lines-box lines-control`,children:(0,G5.jsx)(l5,{table:t,column:r,value:d,onChange:e=>A(n,r.name,e),label:u,row:e.values,invalid:!!c,describedBy:l})});return(0,G5.jsxs)(`td`,{className:`${L(o)}${a===0?` lines-lead`:``}${c?` is-invalid`:``}`,"data-label":B5(t,r),children:[m,c&&(0,G5.jsx)(`span`,{id:l,className:`insert-missing`,children:c})]},r.name)}),_.map(n=>(0,G5.jsx)(`td`,{className:`is-figure lines-figure lines-copied`,"data-label":z(n),children:H5(J5(t,n),w2(t,n,e.values[n]),e.values)},n)),v.map(r=>(0,G5.jsx)(`td`,{className:`is-figure lines-figure`,"data-label":fs(t.id,r)??nr(r),children:H5(V5(t,r),y[n][r]??null,e.values)},r)),(0,G5.jsx)(`td`,{className:`lines-menu`,children:(0,G5.jsxs)(bG,{className:`row-actions-menu`,triggerClassName:`ghost row-actions-trigger`,triggerLabel:z5(`lineActions`,{n:i}),triggerTitle:z5(`lineActions`,{n:i}),label:`⋯`,popupClassName:`page-actions-popup`,align:`end`,children:[a&&(0,G5.jsx)(xG,{className:`page-actions-item`,disabled:n===0,onClick:()=>j(n,n-1,`.row-actions-trigger`),children:z5(`moveUp`)}),a&&(0,G5.jsx)(xG,{className:`page-actions-item`,disabled:n===r.length-1,onClick:()=>j(n,n+1,`.row-actions-trigger`),children:z5(`moveDown`)}),(0,G5.jsx)(xG,{className:`page-actions-item is-danger`,onClick:()=>M(n),children:z5(`removeLine`)})]})})]},e.id)}),!r.length&&(0,G5.jsx)(`tr`,{className:`lines-empty`,children:(0,G5.jsx)(`td`,{colSpan:R,children:z5(`noLinesYet`)})})]})]}),(0,G5.jsxs)(`div`,{className:`form-lines-foot`,children:[(0,G5.jsxs)(gG,{intent:`quiet`,size:`compact`,className:`lines-add`,disabled:r.length>=o,onClick:()=>{let e=q5();C.current=e.id,i([...r,e])},children:[`+ `,z5(`addLine`)]}),u,b.length>0&&(0,G5.jsx)(`dl`,{className:`form-live lines-summary`,"aria-live":`polite`,children:b.map(e=>{let n=y.map(t=>t[e]).filter(e=>typeof e==`number`),i=n.length?n.reduce((e,t)=>e+t,0):null;return(0,G5.jsxs)(`div`,{className:`lines-summary-row`,children:[(0,G5.jsx)(`dt`,{children:b.length===1?z5(`subtotal`):z(e)}),(0,G5.jsx)(`dd`,{children:H5(V5(t,e),i,r[0]?.values??{})})]},e)})})]}),(0,G5.jsx)(`div`,{className:`visually-hidden`,"aria-live":`polite`,children:E})]})]})}var W5,G5,K5,q5,J5,Y5,X5,sre=s((()=>{W5=d(m()),nJ(),Es(),Fa(),Yi(),j6(),n3(),cr(),St(),Qn(),B6(),p5(),o5(),c$(),d8(),T8(),wG(),yG(),Pne(),Kne(),i5(),qne(),Jne(),G5=d(O()),K5=0,q5=()=>({id:++K5,values:{}}),J5=(e,t)=>ps(e.id,t),Y5=(e,t)=>{let n=J5(e,t);return n?.format===`money`&&n.minor?n:void 0},X5=e=>e==null?``:String(e)})),cre=l({CommandLines:()=>fre,lineAt:()=>ure,lineCellOf:()=>lre});function lre(e,t,n){let r=bs(e);return r?D6(r,t,n):{value:n}}function ure(e,t){let n=/^([A-Za-z_][A-Za-z0-9_]*)\[(\d+)\]\.([A-Za-z_][A-Za-z0-9_]*)$/.exec(t),r=n?e.find(e=>e.name===n[1]):void 0;if(!n||r?.type!==`lines`)return;let i=bs(r.from);return{field:r,row:Number(n[2]),label:i&&fs(i.id,n[3])||nr(n[3])}}function dre(e,t){let n=`${e}[`;return Object.fromEntries(Object.entries(t??{}).flatMap(([t,r])=>{if(!t.startsWith(n))return[];let i=/^\[(\d+)\]\.(.+)$/.exec(t.slice(e.length));return i?[[`${i[1]}.${i[2]}`,r]]:[]}))}function fre({field:e,path:t,rows:n,problems:r,disabled:i,onChange:a}){let o=bs(e.from);return o?(0,Z5.jsx)(ore,{title:e.label,...e.help?{description:e.help}:{},table:o,columns:e.show,rows:n,onChange:e=>a(e,t),ordered:!0,max:e.max,problems:dre(t,r),disabled:i===!0,...e.copy?{copy:e.copy}:{},...e.query?{where:e.query}:{},subtotal:!0}):null}var Z5,pre=s((()=>{Es(),O6(),cr(),sre(),Z5=d(O())}));function mre(e){return T(Q5,e)}var Q5,hre=s((()=>{E(),sa(),Q5=x(typeof document>`u`?null:oa(`meta[name="mistri-mount"]`)?.getAttribute(`content`)),(()=>{if(typeof window>`u`)return null;let e=new URLSearchParams(window.location.search).getAll(`via`);return e.length===1&&/^[A-Za-z0-9_-]{22,128}$/.test(e[0])?e[0]:null})()})),$5,gre=s((()=>{$5={prepare:`/api/commands/prepare`,execute:`/api/commands/execute`,status:`/api/commands/status`,availability:`/api/commands/availability`,check:`/api/commands/check`,draft:`/api/commands/draft`,files:`/api/commands/files`},Object.values($5)})),e7,_re=s((()=>{ba(),e7=pa({stars:`{stars} of {outOf} stars`,pickColor:`Pick {label}`,jsonProblem:`Not valid JSON: {problem}`,formatJson:`Format`,scan:`Scan`,stopScanning:`Stop scanning`,cameraView:`Camera: hold the code in view`,cameraRefused:`The camera could not be opened. Type the code instead.`,signHere:`Sign here: {label}`,typedSignature:`{label}, typed`,typeYourName:`Type your full name`,keptSignature:`{label}: the kept signature`,signatureKept:`Signed`,undoStroke:`Undo`,clearSignature:`Clear`,typeInstead:`Type instead`,drawInstead:`Draw instead`,useSignature:`Use this signature`,keepingSignature:`Keeping…`,keepPrevious:`Keep the previous one`,signAgain:`Sign again`,removeSignature:`Remove`,signatureUnread:`The signature could not be kept. Try again.`})})),vre=s((()=>{}));async function yre(e){let t=await new Promise(t=>e.toBlob(t,`image/png`));if(!t)throw Error(e7(`signatureUnread`));return t}async function bre(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}function xre({value:e,onChange:t,id:n,describedBy:r,invalid:i,disabled:a,label:o,keeper:s}){let c=(0,t7.useRef)(null),[l,u]=(0,t7.useState)([]),[d,f]=(0,t7.useState)(null),[p,m]=(0,t7.useState)(e===null||e===``),[h,g]=(0,t7.useState)(`idle`),_=(0,t7.useRef)(null),v=(0,t7.useRef)(null),y=(0,t7.useRef)(!1);(0,t7.useEffect)(()=>{y.current&&v.current&&(y.current=!1,v.current.focus())});let b=d===null?l.length===0:!d.trim();(0,t7.useEffect)(()=>{let e=c.current,t=e?.getContext(`2d`);if(!e||!t)return;let n=window.devicePixelRatio||1;if(e.width=r7.wide*n,e.height=r7.high*n,t.setTransform(n,0,0,n,0,0),t.clearRect(0,0,r7.wide,r7.high),t.strokeStyle=t.fillStyle=`#111827`,t.lineWidth=2.4,t.lineCap=t.lineJoin=`round`,d!==null)t.font=`italic 40px Georgia, "Times New Roman", serif`,t.textBaseline=`middle`,t.fillText(d,24,r7.high/2,r7.wide-48);else for(let e of[...l,..._.current?[_.current]:[]])t.beginPath(),e.forEach(([e,n],r)=>r?t.lineTo(e,n):t.moveTo(e,n)),e.length===1&&t.lineTo(e[0][0]+.1,e[0][1]),t.stroke()});let x=e=>{let t=e.currentTarget.getBoundingClientRect();return[(e.clientX-t.left)/(t.width||1)*r7.wide,(e.clientY-t.top)/(t.height||1)*r7.high]},[,S]=(0,t7.useState)(0),C=async()=>{if(s&&c.current){g(`keeping`);try{t(await s.keep(await yre(c.current))),y.current=!0,m(!1),u([]),f(null),g(`idle`)}catch{g(`failed`)}}},w=e!==null&&e!==``&&typeof e!=`boolean`?s?.picture(e):void 0;return!p&&e!==null&&e!==``&&s?(0,n7.jsxs)(`span`,{className:`signature-input`,children:[w?(0,n7.jsx)(`img`,{className:`signature-input-kept`,src:w,alt:e7(`keptSignature`,{label:o})}):(0,n7.jsx)(`span`,{className:`signature-input-kept is-unseen`,children:e7(`signatureKept`)}),(0,n7.jsxs)(`span`,{className:`signature-input-tools`,children:[(0,n7.jsx)(`button`,{ref:v,type:`button`,className:`btn btn-quiet`,disabled:a,onClick:()=>m(!0),children:e7(`signAgain`)}),(0,n7.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,disabled:a,onClick:()=>t(null),children:e7(`removeSignature`)})]})]}):(0,n7.jsxs)(`span`,{className:`signature-input`,"aria-describedby":r,children:[d===null?(0,n7.jsx)(`canvas`,{id:n,ref:c,className:`signature-input-pad`,tabIndex:-1,role:`img`,"aria-label":e7(`signHere`,{label:o}),"aria-invalid":i||void 0,onPointerDown:e=>{a||(e.currentTarget.setPointerCapture?.(e.pointerId),_.current=[x(e)],S(e=>e+1))},onPointerMove:e=>{_.current&&(_.current.push(x(e)),S(e=>e+1))},onPointerUp:()=>{let e=_.current;_.current=null,e&&u(t=>[...t,e])},onPointerCancel:()=>{_.current=null,S(e=>e+1)}}):(0,n7.jsxs)(n7.Fragment,{children:[(0,n7.jsx)(`input`,{id:n,type:`text`,className:`signature-input-name`,value:d,autoComplete:`name`,placeholder:e7(`typeYourName`),"aria-label":e7(`typedSignature`,{label:o}),"aria-invalid":i||void 0,disabled:a,onChange:e=>f(e.target.value)}),(0,n7.jsx)(`canvas`,{ref:c,className:`signature-input-pad`,"aria-hidden":`true`})]}),(0,n7.jsxs)(`span`,{className:`signature-input-tools`,children:[d===null&&(0,n7.jsxs)(n7.Fragment,{children:[(0,n7.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,disabled:a||!l.length,onClick:()=>u(e=>e.slice(0,-1)),children:e7(`undoStroke`)}),(0,n7.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,disabled:a||!l.length,onClick:()=>u([]),children:e7(`clearSignature`)})]}),(0,n7.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,disabled:a,onClick:()=>f(d===null?``:null),children:e7(d===null?`typeInstead`:`drawInstead`)}),(0,n7.jsx)(`button`,{type:`button`,className:`btn signature-input-keep`,disabled:a||b||!s||h===`keeping`,onClick:()=>void C(),children:e7(h===`keeping`?`keepingSignature`:`useSignature`)}),e!==null&&e!==``&&(0,n7.jsx)(`button`,{type:`button`,className:`btn btn-quiet`,onClick:()=>m(!1),children:e7(`keepPrevious`)})]}),h===`failed`&&(0,n7.jsx)(`span`,{className:`signature-input-problem`,role:`alert`,children:e7(`signatureUnread`)})]})}var t7,n7,r7,Sre=s((()=>{t7=d(m()),Es(),XQ(),Dr(),_re(),vre(),n7=d(O()),r7={wide:480,high:150}})),i7,Cre=s((()=>{ba(),i7=pa({chooseFiles:`Choose files`,chooseFile:`Choose a file`,orDropOrPaste:`or drop or paste them here`,orDropOrPasteOne:`or drop or paste it here`,sending:`Sending {name}, {percent}%`,cancel:`Cancel`,remove:`Remove`,removeFile:`Remove {name}`,preview:`Preview {name}`,takesAtMost:{one:`{label} takes at most {count} file.`,other:`{label} takes at most {count} files.`},notSent:`{name} was not sent: {reason}`,couldNotSend:`The server could not be reached.`,tooLarge:`it is too large`,noHolding:`Files cannot be sent from this form.`,aFile:`A file sent earlier`})})),wre=s((()=>{})),Tre=l({HeldFilesInput:()=>o7,HeldInput:()=>Ere,HeldSignatureInput:()=>s7});function a7(e,t,n,r){let i=new XMLHttpRequest;return{done:(async()=>{let a={field:t,file:{name:n.name||`file`,type:n.type,data:await bre(n)}};if(`command`in e&&qa().tenantRequired)try{let t=await rs($5.files,{command:e.command,...a});if(r(1),typeof t.id!=`string`)throw new d7(i7(`couldNotSend`));return{id:t.id,name:typeof t.name==`string`?t.name:n.name,type:typeof t.type==`string`?t.type:n.type,size:typeof t.size==`number`?t.size:n.size,url:URL.createObjectURL(n)}}catch(e){throw e instanceof d7?e:new d7(e instanceof Error&&e.message?e.message:i7(`couldNotSend`))}let o,s,c={"content-type":`application/json`};if(`form`in e)o=`/api/forms/${encodeURIComponent(e.form)}/files${e.via?`?via=${encodeURIComponent(e.via)}`:``}`,s=a;else{let t=ja($5.files,{command:e.command,...a,...Aa(e.connection)},gs.activeConnection);o=t.url,s=t.payload??{};let n=qa();n.mode===`authenticated`&&n.accountId&&(c[`x-mistri-account`]=n.accountId)}return await new Promise((e,t)=>{i.open(`POST`,mre(o)),i.withCredentials=!0;for(let[e,t]of Object.entries(c))i.setRequestHeader(e,t);i.upload.onprogress=e=>{e.lengthComputable&&e.total>0&&r(e.loaded/e.total)},i.onerror=()=>t(new d7(i7(`couldNotSend`))),i.onabort=()=>t(new DOMException(`aborted`,`AbortError`)),i.onload=()=>{let r={};try{r=JSON.parse(i.responseText)}catch{}if(i.status===200&&typeof r.id==`string`)return e({id:r.id,name:typeof r.name==`string`?r.name:n.name,type:typeof r.type==`string`?r.type:n.type,size:typeof r.size==`number`?r.size:n.size,url:URL.createObjectURL(n)});let a=typeof r.error==`string`?r.error:typeof r.message==`string`?r.message:void 0;t(new d7(a??(i.status===413?i7(`tooLarge`):i7(`couldNotSend`))))},i.send(JSON.stringify(s))})})(),abort:()=>i.abort()}}function o7({id:e,describedBy:t,labelledBy:n,invalid:r,disabled:i,label:a,name:o,target:s,value:c,max:l,accept:u,onChange:d}){let[f,p]=(0,c7.useState)(!1),[m,h]=(0,c7.useState)([]),[g,_]=(0,c7.useState)(),[v,y]=(0,c7.useState)(),b=(0,c7.useRef)(null),x=(0,c7.useRef)(c);x.current=c;let S=e=>{x.current=e,d(e)},C=l-c.length-m.length,w=i||!s,T=async e=>{if(w||!e.length||!s)return;_(void 0);let t=[];e.length>C&&t.push(i7(`takesAtMost`,{label:a,count:l}));for(let n of e.slice(0,Math.max(0,C))){let e=++p7,r=a7(s,o,n,t=>h(n=>n.map(n=>n.key===e?{...n,fraction:t}:n)));h(t=>[...t,{key:e,name:n.name||`file`,fraction:0,abort:r.abort}]);try{let e=await r.done;r4(e.id,e),S([...x.current,e.id])}catch(e){e instanceof d7&&t.push(i7(`notSent`,{name:n.name||`file`,reason:e.message}))}finally{h(t=>t.filter(t=>t.key!==e))}}t.length&&_(t.join(` `))},E=e=>[...e.dataTransfer.types].includes(`Files`),D=l===1;return(0,l7.jsxs)(`div`,{className:`held-files${f?` is-over`:``}`,role:`group`,"aria-labelledby":n,"aria-describedby":t,onDragOver:e=>{!w&&E(e)&&(e.preventDefault(),p(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||p(!1)},onDrop:e=>{w||(e.preventDefault(),p(!1),T([...e.dataTransfer.files]))},onPaste:e=>{let t=[...e.clipboardData.files];!w&&t.length&&(e.preventDefault(),T(t))},children:[s?(0,l7.jsxs)(`div`,{className:`held-files-add`,children:[(0,l7.jsx)(gG,{id:e,intent:`secondary`,size:`compact`,disabled:w||C<=0,"aria-invalid":r||void 0,onClick:()=>b.current?.click(),children:`+ ${i7(D?`chooseFile`:`chooseFiles`)}`}),(0,l7.jsx)(`input`,{ref:b,type:`file`,multiple:!D,hidden:!0,tabIndex:-1,"aria-label":a,...u?.length?{accept:u.join(`,`)}:{},onChange:e=>{let t=[...e.target.files??[]];e.target.value=``,T(t)}}),(0,l7.jsx)(`span`,{className:`held-files-hint`,children:i7(D?`orDropOrPasteOne`:`orDropOrPaste`)})]}):(0,l7.jsx)(`p`,{className:`held-files-hint`,children:i7(`noHolding`)}),g&&(0,l7.jsx)(`p`,{className:`held-files-error`,role:`alert`,children:g}),(c.length>0||m.length>0)&&(0,l7.jsxs)(`ul`,{className:`held-files-list`,children:[c.map(e=>{let t=o4(e),n=t?.name??i7(`aFile`),r=t?.url?aY(n,t.type):void 0;return(0,l7.jsxs)(`li`,{className:`held-files-item`,children:[(0,l7.jsx)(`span`,{className:`held-files-badge`,"aria-hidden":`true`,children:f7(n)}),(0,l7.jsxs)(`span`,{className:`held-files-text`,children:[r&&t?.url?(0,l7.jsx)(`button`,{type:`button`,className:`held-files-name`,"aria-label":i7(`preview`,{name:n}),onClick:()=>y({name:n,kind:r,href:t.url}),children:n}):(0,l7.jsx)(`span`,{className:`held-files-name is-plain`,children:n}),t&&(0,l7.jsx)(`span`,{className:`held-files-meta`,children:Ti(t.size)})]}),(0,l7.jsx)(gG,{intent:`quiet`,size:`compact`,disabled:i,"aria-label":i7(`removeFile`,{name:n}),onClick:()=>{i4(e),S(x.current.filter(t=>t!==e))},children:i7(`remove`)})]},e)}),m.map(e=>{let t=Math.round(e.fraction*100);return(0,l7.jsxs)(`li`,{className:`held-files-item is-sending`,children:[(0,l7.jsx)(`span`,{className:`held-files-badge`,"aria-hidden":`true`,children:f7(e.name)}),(0,l7.jsxs)(`span`,{className:`held-files-text`,children:[(0,l7.jsx)(`span`,{className:`held-files-name is-plain`,children:e.name}),(0,l7.jsx)(T$,{value:t,max:100,label:i7(`sending`,{name:e.name,percent:t})})]}),(0,l7.jsx)(gG,{intent:`quiet`,size:`compact`,onClick:e.abort,children:i7(`cancel`)})]},`sending-${e.key}`)})]}),v&&(0,l7.jsx)(u7,{file:v,onClose:()=>y(void 0)})]})}function s7({id:e,describedBy:t,invalid:n,disabled:r,label:i,name:a,target:o,value:s,onChange:c}){return o?(0,l7.jsx)(xre,{id:e,...t?{describedBy:t}:{},invalid:n,disabled:r,label:i,value:s??null,onChange:e=>{s&&e!==s&&i4(s),c(typeof e==`string`?e:null)},keeper:{keep:async e=>{try{let t=await a7(o,a,new File([e],`signature.png`,{type:`image/png`}),()=>{}).done;return r4(t.id,t),t.id}catch(e){throw e instanceof d7?e:Error(i7(`couldNotSend`))}},picture:e=>o4(String(e))?.url}}):(0,l7.jsx)(`p`,{className:`held-files-hint`,children:i7(`noHolding`)})}function Ere({field:e,value:t,onChange:n,...r}){let i={...r,label:e.label,name:e.name};return e.type===`files`?(0,l7.jsx)(o7,{...i,value:Array.isArray(t)?t:[],max:e.max,...e.accept?{accept:e.accept}:{},onChange:e=>n(e.length?e:void 0)}):(0,l7.jsx)(s7,{...i,value:typeof t==`string`?t:void 0,onChange:e=>n(e??void 0)})}var c7,l7,u7,d7,f7,p7,Dre=s((()=>{c7=d(m()),Yi(),hre(),Es(),Fa(),Ja(),Ys(),uY(),yG(),M$(),gre(),s4(),Sre(),Cre(),wre(),l7=d(O()),u7=Us(()=>Promise.resolve().then(()=>(xY(),pY)),`FilePreview`,{quiet:!0}),d7=class extends Error{},f7=e=>{let t=e.lastIndexOf(`.`);return(t>0?e.slice(t+1).slice(0,4).toUpperCase():``)||`FILE`},p7=0}));function Ore(e,t){if(v7(t))return e.required?`required`:void 0;switch(e.type){case`number`:case`money`:return typeof t==`number`&&Number.isFinite(t)?void 0:`number`;case`bool`:return typeof t==`boolean`?void 0:`bool`;case`date`:return typeof t==`string`&&m7.test(t)&&_7(t)?void 0:`date`;case`datetime`:return typeof t==`string`&&h7.test(t)&&_7(t)?void 0:`datetime`;case`choice`:return typeof t==`string`&&e.options.includes(t)?void 0:`choice`;case`choices`:return Array.isArray(t)&&t.every(t=>typeof t==`string`&&e.options.includes(t))&&new Set(t).size===t.length?void 0:`choice`;default:return typeof t==`string`&&t.length<=g7?void 0:`text`}}function kre(e,t,n){let r=e.flatMap(e=>{let n=Ore(e,t[e.key]);return n?[{key:e.key,reason:n}]:[]});if(n.extras){let n=new Set(e.map(e=>e.key));for(let e of Object.keys(t))n.has(e)||r.push({key:e,reason:`unknown`})}return r}function Are(e,t){if(v7(t))return;if(e.type===`choices`){let e=(Array.isArray(t)?t.map(String):String(t).split(`,`)).map(e=>e.trim()).filter(Boolean);return e.length?[...new Set(e)]:void 0}if(e.type===`bool`)return typeof t==`boolean`?t:t===`true`||t===`1`?!0:t===`false`||t===`0`?!1:String(t);let n=String(t).trim();if(e.type===`number`||e.type===`money`){let e=Number(n.replace(/[,\s$]/g,``));return Number.isFinite(e)?e:n}return e.type===`textarea`?String(t):n}var m7,h7,g7,_7,v7,jre=s((()=>{m7=/^\d{4}-\d{2}-\d{2}$/,h7=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,6})?)?(?:Z|[+-]\d{2}:?\d{2})?$/,g7=1e4,_7=e=>{let t=new Date(`${e.slice(0,10)}T00:00:00Z`);return!Number.isNaN(t.getTime())&&t.toISOString().slice(0,10)===e.slice(0,10)},v7=e=>e==null||typeof e==`string`&&!e.trim()||Array.isArray(e)&&!e.length,Object.freeze({required:`This field is required.`,number:`Enter a number.`,date:`Enter a date.`,datetime:`Enter a date and time.`,bool:`Choose yes or no.`,choice:`Choose from the list.`,text:`Enter text, at most 10,000 characters.`,unknown:`This is not one of the fields this record has.`})})),Mre=l({DefinedAnswers:()=>Ire,answerProblems:()=>Pre});function Nre(e,t){let n=e.label;switch(t){case`required`:return l$(`isRequired`,{label:n});case`number`:return l$(`mustBeANumber`,{label:n});case`date`:return l$(`mustBeADate`,{label:n});case`datetime`:return l$(`mustBeADateAndTime`,{label:n});case`bool`:return l$(`mustBeYes`,{label:n});case`choice`:return l$(`chooseLabel`,{label:n});case`text`:return l$(`hasCharactersAForm`,{label:n});case`unknown`:return l$(`theFormHasAnInput`)}}function Pre(e,t,n){return n?e.flatMap(e=>{let r=e.type===`defined`?n[e.name]:void 0;if(!r)return[];let i=t[e.name];return kre(r,x7(i)?i:{},{extras:!1}).map(({key:t,reason:n})=>[`${e.name}.${t}`,Nre(r.find(e=>e.key===t),n)])}):[]}function Fre(e){let t={name:e.key,label:e.label,...e.required?{required:!0}:{}};switch(e.type){case`number`:return{...t,type:`number`};case`money`:return{...t,type:`number`,step:.01};case`date`:case`datetime`:return{...t,type:e.type};case`bool`:return{...t,type:`boolean`};case`choice`:return{...t,type:`choice`,options:e.options.map(e=>({value:e,label:e}))};case`textarea`:return{...t,type:`textarea`};default:return{...t,type:`text`}}}function Ire({field:e,id:t,path:n,value:r,shared:i,onChange:a,Control:o}){let[s,c]=(0,y7.useState)({}),l=i.questions?.[e.name];if(!l?.length)return null;let u=x7(r)?r:{},d=e.help?`${t}-help`:void 0;return(0,b7.jsxs)(`fieldset`,{className:`command-group`,"aria-describedby":d,children:[(0,b7.jsx)(`legend`,{children:e.label}),(0,b7.jsxs)(`div`,{className:`command-group-body`,children:[e.help&&(0,b7.jsx)(`span`,{id:d,className:`command-help`,children:e.help}),(0,b7.jsx)(`div`,{className:`command-fields`,children:l.map(e=>{let r=`${n}.${e.key}`,l=`${t}-${e.key}`,d=i.problems?.[r],f=u[e.key],p=Object.hasOwn(s,e.key)?s[e.key]:f,m=t=>{c(n=>({...n,[e.key]:t}));let n=Are(e,t),i={...u};n===void 0?delete i[e.key]:i[e.key]=n,a(i,r)},h=Fre(e),g=`${e.label}${e.required&&e.type!==`bool`?` (required)`:``}`;return(0,b7.jsx)(hJ,{label:g,id:l,hint:e.help,problem:d,group:h.type===`choice`||e.type===`choices`,check:e.type===`bool`,className:`command-field`,children:t=>e.type===`choices`?(0,b7.jsx)(`div`,{className:`command-choices`,role:`group`,id:l,"aria-labelledby":`${l}-label`,children:e.options.map(t=>{let n=Array.isArray(p)?p:[];return(0,b7.jsxs)(`label`,{className:`command-choice`,children:[(0,b7.jsx)(`input`,{type:`checkbox`,checked:n.includes(t),disabled:i.disabled,onChange:r=>m(e.options.filter(e=>e===t?r.target.checked:n.includes(e)))}),t]},t)})}):(0,b7.jsx)(o,{field:h,id:l,describedBy:t[`aria-describedby`],invalid:!!d,value:typeof p==`string`||typeof p==`number`||typeof p==`boolean`?p:void 0,disabled:i.disabled,onChange:m})},e.key)})})]})]})}var y7,b7,x7,Lre=s((()=>{y7=d(m()),jre(),yJ(),u$(),b7=d(O()),x7=e=>!!e&&typeof e==`object`&&!Array.isArray(e)}));function S7(e,t){return t?.length?!0:e.some(e=>l9(e)!==void 0||e.type===`group`&&S7(e.fields))}function Rre(e){switch(e.type){case`money`:case`month`:case`choices`:return!0;case`number`:return e.as===`slider`;case`text`:return e.mask!==void 0||e.sensitive!==void 0;case`boolean`:return e.as===`buttons`||e.statement!==void 0;case`choice`:return e.as===`cards`||e.as===`buttons`||e.source!==void 0;default:return!1}}function C7(e){let t={};for(let n of e){let e=n.type===`group`?void 0:n.default;e!==void 0&&typeof e!=`object`?t[n.name]=e:typeof e==`object`&&`auto`in e&&e.auto!==`me`?t[n.name]=e.auto===`today`?new Intl.DateTimeFormat(`en-CA`,{timeZone:hi()}).format(_i()):new Date(Math.floor(_i().getTime()/6e4)*6e4).toISOString():n.type===`boolean`&&n.as!==`buttons`?t[n.name]=!1:n.type===`lines`?t[n.name]=Array.from({length:Math.max(n.min??0,1)},()=>Q7()):n.type===`group`&&(t[n.name]=n.repeat?Array.from({length:n.repeat.min??0},()=>C7(n.fields)):C7(n.fields))}return t}function w7(e,t){let n=C7(e);if(!c9(t))return n;for(let r of e){if(!Object.hasOwn(t,r.name))continue;let e=t[r.name];r.type!==`files`&&r.type!==`signature`&&(r.type===`defined`?c9(e)&&(n[r.name]={...e}):r.type===`lines`?Array.isArray(e)&&(n[r.name]=e.map(e=>Q7(Object.fromEntries(r.show.flatMap(t=>{let n=c9(e)?e[t]:void 0;return typeof n==`string`||typeof n==`number`||typeof n==`boolean`?[[t,String(n)]]:[]}))))):r.type===`group`?r.repeat?Array.isArray(e)&&(n[r.name]=e.map(e=>w7(r.fields,e))):n[r.name]=w7(r.fields,e):(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)&&(n[r.name]=e))}return n}function T7(e,t){return(e.type===`number`||e.type===`money`)&&typeof t==`string`?t.trim()?Number(t):``:t}function E7(e,t,n){let r=new Set;if(!e.some(e=>l9(e)!==void 0))return r;let i=n??{fields:e,values:t},a={};for(let e of i.fields)a[e.name]=T7(e,i.values[e.name]);for(let n of e)a[n.name]=T7(n,t[n.name]);let o=[...i.fields,...e.filter(e=>!i.fields.includes(e))];for(let t of e){let e=l9(t);e===void 0||G7(e)||V7&&!V7.draftHolds(e,a,o)&&r.add(t.name)}return r}function D7(e,t,n){let r={},i=E7(e,t,n);for(let n of e){if(i.has(n.name))continue;let e=t[n.name];n.type===`lines`?r[n.name]=($7(e)?e:[]).map(e=>Object.fromEntries(n.show.flatMap(t=>e.values[t]?[[t,e.values[t]]]:[]))):n.type===`group`?r[n.name]=n.repeat?(Array.isArray(e)?e:[]).map(e=>D7(n.fields,c9(e)?e:{})):D7(n.fields,c9(e)?e:{}):(n.type===`number`||n.type===`money`)&&typeof e==`string`&&!(n.type===`money`&&n.minor)?r[n.name]=e.trim()?Number(e):``:e!==void 0&&(r[n.name]=e)}return r}function O7(e,t,n){let r=Y7(e,t);if(r){let e=r.label;return n===`required`?l$(`isRequired`,{label:e}):n===`choice`?l$(`chooseLabel`,{label:e}):n===`type`?l$(`isNotInAForm`,{label:e}):l$(`theFormHasAnInput`)}let i=Zr(e,t);if(!i)return l$(`theFormHasAnInput`);let a=i.label,o=d9(i.type),s=e=>e&&i.type===`datetime`?new Date(e).toLocaleString(mi(),{timeZone:hi(),dateStyle:`medium`,timeStyle:`short`}):e??``,c=i.type===`text`||i.type===`textarea`?i:void 0,l=c?.maxLength??(i.type===`richText`?i.maxLength:void 0),u=n=>{let r=t.includes(`.`)?t.slice(0,t.lastIndexOf(`.`)+1):``;return(n&&Zr(e,`${r}${n}`)?.label)??n??``};switch(n){case`required`:return s9(i)?l$(`checkThisBoxTo`):l$(`isRequired`,{label:a});case`too_short`:return l$(`mustBeAtLeast`,{label:a,minLength:c?.minLength??(i.type===`richText`?i.minLength:void 0)??``});case`too_long`:return l$(`mustBeCharactersOrFewer`,{label:a,maxLength:l??``});case`format`:return c?.message??l$(`must`,{label:a,value:c?.format?u9[c.format]:c?.as===`color`?l$(`aColor`):l$(`inTheFormItTakes`)});case`pattern`:return c?.message??l$(`isNotInTheForm`,{label:a});case`not_below`:{let e=u(i.below);return l$(o?`mustBeBefore`:`mustBeLessThan`,{label:a,other:e})}case`not_above`:{let e=u(i.above);return l$(o?`mustBeAfter`:`mustBeMoreThan`,{label:a,other:e})}case`text`:return l$(`hasCharactersAForm`,{label:a});case`integer`:return l$(`mustBeASafe`,{label:a});case`precision`:return l$(`hasMoreDecimalsThanTheCurrency`,{label:a});case`below_min`:return o?l$(`mustBeOnOrAfter`,{label:a,min:s(i.min)}):l$(`labelMustBeAt`,{label:a,min:i.min??``});case`above_max`:return o?l$(`mustBeOnOrBefore`,{label:a,max:s(i.max)}):l$(`mustBeAtMost`,{label:a,max:i.max??``});case`choice`:return l$(`chooseLabel`,{label:a});case`too_few`:{if(i.type===`files`)return l$(`needsAtLeastFiles`,{label:a,count:i.min??1});let e=i.type===`group`?i.repeat?.min??0:i.type===`lines`?i.min??0:0;return l$(`needsAtLeastRows`,{label:a,count:e})}case`too_many`:return i.type===`files`?l$(`takesAtMostFiles`,{label:a,count:i.max}):l$(`takesAtMostRows`,{label:a,max:(i.type===`group`?i.repeat?.max:i.type===`lines`?i.max:0)??``});case`type`:return i.type===`number`?l$(`mustBeANumber`,{label:a}):i.type===`boolean`?l$(`mustBeYes`,{label:a}):o?l$(i.type===`datetime`?`mustBeADateAndTime`:i.type===`time`?`mustBeATime`:`mustBeADate`,{label:a}):i.type===`reference`?l$(`chooseLabel`,{label:a}):l$(`isNotInAForm`,{label:a});case`shape`:return l$(`isNotInAForm`,{label:a});case`exclusive`:return l$(`chooseAlone`,{label:a})}}function k7(e,t){let n=[],r=e;for(let i of t.split(`.`)){let a=/^([A-Za-z_][A-Za-z0-9_]*)(?:\[(\d+)\])?$/.exec(i),o=a&&r.find(e=>e.name===a[1]);if(!o)return;if(n.push(o.label),a[2]!==void 0&&n.push(l$(`rowMatch`,{match:Number(a[2])+1})),o.type===`lines`){let r=Y7(e,t);return r&&a[2]!==void 0&&n.push(r.label),r||!t.includes(`.`)?n.join(`, `):void 0}r=o.type===`group`?o.fields:[]}return n.join(`, `)}function A7(e,t,n){let r=[],i=E7(e,t,n.whole);for(let n of e){let a=l9(n);if(a===void 0||i.has(n.name)||G7(a)||n.type===`group`||n.type===`lines`)continue;let o=t[n.name],s=o==null||o===``||Array.isArray(o)&&!o.length;(s9(n)?n.accept===!0&&o!==!0:n.required&&s)&&r.push([n.name,O7(e,n.name,`required`)])}if(n.rules?.length&&V7){let i=n.whole??{fields:e,values:t},a={...D7(i.fields,i.values),...D7(e,t,n.whole)},o=new Set(e.map(e=>e.name));for(let t of V7.brokenRules(n.rules,a,[...i.fields,...e.filter(e=>!i.fields.includes(e))]))o.has(t.field)&&r.push([t.field,t.message])}return r}function j7(e,t,n,r={}){let i={};for(let n of Xr(e,D7(e,t,r.whole),X7()))Object.hasOwn(i,n.path)||(i[n.path]=O7(e,n.path,n.reason));for(let[r,a]of i9(e,t,n))Object.hasOwn(i,r)||(i[r]=a);for(let[n,a]of A7(e,t,r))Object.hasOwn(i,n)||(i[n]=a);return i}function M7(e,t,n,r={}){let i;try{i=Yr(e,D7(e,t,r.whole),X7())}catch(t){if(!(t instanceof Qr))throw t;let n=O7(e,t.path,t.reason),r=t.path.includes(`.`)?k7(e,t.path.slice(0,t.path.lastIndexOf(`.`))):void 0;throw Error(r?`${r}: ${n}`:n)}let[a]=i9(e,t,n);if(a){let t=e.find(e=>e.name===a[0].slice(0,a[0].indexOf(`.`)));throw Error(t?`${t.label}: ${a[1]}`:a[1])}let[o]=A7(e,t,r);if(o)throw Error(o[1]);return i}function N7({field:e,id:t,describedBy:n,invalid:r,value:i,disabled:a,onChange:o,connection:s,visitor:c,record:l,valid:u,onLeave:d}){let f={id:t,"aria-describedby":n,"aria-invalid":r||void 0,required:e.required,className:`field-control`,disabled:a,...d?{onBlur:d}:{}},p=(e,t=!1)=>u===void 0?e:(0,L7.jsxs)(`div`,{className:`field-box has-mark`,...t&&d?{onBlur:d}:{},children:[e,u?(0,L7.jsx)(`span`,{className:`field-mark`,"aria-hidden":`true`}):null]});if(Rre(e))return p((0,L7.jsx)(z7,{field:e,id:t,"aria-describedby":n,"aria-invalid":r||void 0,value:i,disabled:a,onChange:o,...s===void 0?c?{source:{visitor:c}}:{}:{source:s}}),!0);if(e.type===`boolean`)return(0,L7.jsx)(`input`,{...f,required:e.accept===!0,className:`command-check`,type:`checkbox`,checked:i===!0,onChange:e=>o(e.target.checked)});if(e.type===`richText`)return(0,L7.jsx)(Dne,{id:t,label:e.label,describedBy:n,invalid:r,disabled:a,value:typeof i==`string`?i:``,onChange:o,...e.mentions&&s!==void 0?{mentions:One(e.mentions,s)}:{},...e.images&&s!==void 0&&l?(()=>{let t=kne(e.images,l,s);return t?{pictures:t,onProblem:e=>hs(e,`error`)}:{}})():{}});if(e.type===`textarea`)return(0,L7.jsx)(`textarea`,{...f,rows:3,maxLength:e.maxLength,value:String(i??``),onChange:e=>o(e.target.value)});if(e.type===`choice`){let s=e.options.findIndex(e=>e.value===i);return o9(e)?(0,L7.jsx)(`div`,{className:`command-choices`,role:`radiogroup`,id:t,"aria-labelledby":`${t}-label`,"aria-describedby":n,"aria-required":e.required||void 0,"aria-invalid":r||void 0,children:e.options.map((e,n)=>(0,L7.jsxs)(`label`,{className:`command-choice`,children:[(0,L7.jsx)(`input`,{type:`radio`,name:t,checked:n===s,disabled:a,onChange:()=>o(e.value)}),e.label]},`${typeof e.value}:${e.value}`))}):(0,L7.jsx)(rQ,{id:t,ariaLabelledBy:`${t}-label`,ariaInvalid:r,ariaDescribedBy:n,disabled:a,value:s<0?``:String(s),valueClassName:s<0?`is-empty`:void 0,items:[...s<0?[{value:``,label:nQ(e.label)?l$(`choosePlaceholder`,{label:e.label.toLowerCase()}):l$(`chooseOne`)}]:[],...e.options.map((e,t)=>({value:String(t),label:e.label}))],onChange:t=>{t!==``&&o(e.options[Number(t)].value)}})}if(e.type===`date`)return(0,L7.jsx)(WQ,{...f,"aria-label":`${e.label}${e.required?` (required)`:``}`,min:e.min,max:e.max,locale:mi(),timezone:hi(),now:_i(),value:String(i??``),onChange:o});if(e.type===`datetime`)return(0,L7.jsx)(R7,{...f,"aria-label":`${e.label}${e.required?` (required)`:``}`,min:e.min,max:e.max,value:typeof i==`string`?i:``,onChange:o});if(e.type===`time`)return(0,L7.jsx)(`input`,{...f,className:`field-control time-input`,type:`time`,min:e.min,max:e.max,value:typeof i==`string`?i:``,onChange:e=>o(e.target.value)});if(e.type===`number`){let t=e.integer||e.step!==void 0&&Number.isInteger(e.step);return p((0,L7.jsx)(`input`,{...f,type:`number`,min:e.min,max:e.max,step:e.step??(e.integer?1:`any`),inputMode:t?`numeric`:`decimal`,value:String(i??``),onChange:e=>o(e.target.value)}))}if(e.type!==`text`)return null;let m=e.format===`email`?`email`:e.format===`url`?`url`:e.format===`phone`?`tel`:`text`;return p((0,L7.jsx)(`input`,{...f,type:m,minLength:e.minLength,maxLength:e.maxLength,...e.case===`upper`?{autoCapitalize:`characters`}:{},value:String(i??``),onChange:e=>o(e.target.value)}))}function zre(e){if(e.type===`number`&&e.as===`rating`)return`rating`;if(e.type===`text`&&(e.as===`scan`||e.as===`color`))return e.as}function Bre(e,t){if(t==null||t===``)return!1;let{when:n,...r}=e;return Xr([r],D7([r],{[e.name]:t}),X7()).length===0}function Vre({fields:e,values:t,onChange:n,whole:r,...i}){let a=Ws(W7,S7(r?.fields??e)),o=E7(e,t,r);return!a&&S7(r?.fields??e)?null:(0,L7.jsx)(L7.Fragment,{children:e.filter(e=>!o.has(e.name)).map(a=>{let o=(0,L7.jsx)(P7,{field:a,path:a.name,value:t[a.name],shared:i,onChange:(e,r)=>n({...t,[a.name]:e},r)},a.name);return a.type!==`number`&&a.type!==`money`||!a.live?o:(0,L7.jsxs)(I7.Fragment,{children:[o,(0,L7.jsx)(B7,{field:a,fields:r?.fields??e,values:r?.values??t,id:`${i.idPrefix}-live-${a.name}`})]},a.name)})})}function P7({field:e,path:t,value:n,onChange:r,shared:i}){let a=`${i.idPrefix}-field-${t.replace(/[^A-Za-z0-9_-]/g,`-`)}`,o=i.problems?.[t],[s,c]=(0,I7.useState)(!1);if(e.type===`defined`)return(0,L7.jsx)(r9,{field:e,id:a,path:t,value:n,shared:i,onChange:r,Control:N7});if(e.type===`lines`)return(0,L7.jsxs)(`div`,{className:`command-lines`,children:[(0,L7.jsx)(J7,{field:e,path:t,rows:$7(n)?n:[],problems:i.problems,disabled:i.disabled,onChange:(e,t)=>r(e,t)}),i.problems&&(0,L7.jsx)(`span`,{className:`insert-missing`,"aria-live":`polite`,hidden:!o,children:o})]});if(e.type===`group`){let s=e.help?`${a}-help`:void 0,c=`${a}-error`,l=[s,o?c:void 0].filter(Boolean).join(` `)||void 0;return(0,L7.jsxs)(`fieldset`,{className:`command-group${e.repeat?` command-repeat`:``}`,"aria-describedby":l,children:[(0,L7.jsx)(`legend`,{children:e.label}),(0,L7.jsxs)(`div`,{className:`command-group-body`,children:[e.help&&(0,L7.jsx)(`span`,{id:s,className:`command-help`,children:e.help}),e.repeat?(0,L7.jsx)(Hre,{field:e,path:t,rows:Array.isArray(n)?n:[],shared:i,onChange:r}):(0,L7.jsx)(F7,{field:e,path:t,values:c9(n)?n:{},shared:i,onChange:r}),i.problems&&(0,L7.jsx)(`span`,{id:c,className:`insert-missing`,"aria-live":`polite`,hidden:!o,children:o})]})]})}let l=e.type===`choices`?Array.isArray(n)?n:void 0:c9(n)||Array.isArray(n)?void 0:n,u=s9(e)?e.accept===!0:e.required,d=u?(0,L7.jsxs)(L7.Fragment,{children:[e.label,(0,L7.jsxs)(`span`,{className:`visually-hidden`,children:[` `,l$(`requiredWord`)]})]}):e.label,f=e.type===`choice`&&o9(e),p=e.type===`choice`&&!f,m=e.type===`files`||e.type===`signature`,h=t.replace(/\[\d+\]/g,``),g=zre(e),_=i.inputs&&Object.hasOwn(i.inputs,h)?i.inputs[h]:`input`in e&&typeof e.input==`string`?{id:e.input}:g?{id:a$(g)}:void 0,v=e.type===`boolean`&&e.statement!==void 0&&!_,y=s9(e)&&!_&&!v,b=e.type===`boolean`&&e.as===`buttons`&&!_,x=i.bound&&Object.hasOwn(i.bound,h)?i.bound[h]:void 0,S=_||`as`in e&&e.as!==void 0?void 0:f9(e);return(0,L7.jsx)(hJ,{label:d,required:u===!0,optional:s9(e)?void 0:l$(`optionalWord`),id:a,hint:e.help,problem:o,group:f||p||b||m,check:y,labelHidden:v,kind:S,className:`command-field`,children:u=>m?(0,L7.jsx)(t9,{field:e,id:a,describedBy:u[`aria-describedby`],labelledBy:u[`aria-labelledby`],invalid:!!o,disabled:i.disabled===!0,target:i.held,value:n,onChange:e=>r(e,t)}):e.type===`reference`?(i.connection!==void 0||i.visitor)&&(0,L7.jsx)(e9,{field:x===void 0?e:{...e,query:x??``},id:a,describedBy:u[`aria-describedby`],invalid:!!o,connection:i.connection??{visitor:i.visitor},identityEpoch:i.identityEpoch,disabled:i.disabled===!0||x===null,value:l,isCurrent:i.isCurrent,onChange:e=>r(e,t)}):(()=>{let n=i.presentation===`intake`&&p9(e),d=(0,L7.jsx)(N7,{field:e,id:a,describedBy:u[`aria-describedby`],invalid:!!o,...n?{valid:s&&!o&&Bre(e,l),onLeave:()=>c(!0)}:{},value:l,disabled:i.disabled,onChange:e=>r(e,t),...i.connection===void 0?{}:{connection:i.connection},...i.visitor?{visitor:i.visitor}:{},...i.record?{record:i.record}:{}});return _?(0,L7.jsx)(n$,{component:_.id,fallback:d,value:Array.isArray(l)?null:l??null,onChange:e=>r(e,t),id:a,describedBy:u[`aria-describedby`],invalid:!!o,disabled:i.disabled===!0,required:e.required===!0,label:e.label,field:{name:e.name,...e.type===`number`&&e.outOf?{rule:{outOf:e.outOf}}:{}},context:`command`}):d})()})}function F7({field:e,path:t,values:n,shared:r,onChange:i}){let a=E7(e.fields,n);return(0,L7.jsx)(`div`,{className:`command-fields`,children:e.fields.filter(e=>!a.has(e.name)).map(e=>(0,L7.jsx)(P7,{field:e,path:`${t}.${e.name}`,value:n[e.name],shared:r,onChange:(t,r)=>i({...n,[e.name]:t},r)},e.name))})}function Hre({field:e,path:t,rows:n,shared:r,onChange:i}){let a=(0,I7.useRef)([]),o=(0,I7.useRef)(0);for(;a.current.length<n.length;)a.current.push(o.current++);a.current.length>n.length&&(a.current.length=n.length);let s=e.repeat?.min??0,c=e.repeat?.max??0;return(0,L7.jsxs)(L7.Fragment,{children:[n.map((o,c)=>(0,L7.jsxs)(`div`,{className:`command-row`,role:`group`,"aria-label":l$(`groupRow`,{label:e.label,index:c+1}),children:[(0,L7.jsxs)(`div`,{className:`command-row-head`,children:[(0,L7.jsxs)(`span`,{className:`command-row-number`,children:[l$(`rowLabel`),` `,c+1]}),(0,L7.jsx)(gG,{intent:`secondary`,size:`compact`,disabled:r.disabled||n.length<=s,"aria-label":l$(`removeRow`,{index:c+1,label:e.label}),onClick:()=>{a.current.splice(c,1),i(n.filter((e,t)=>t!==c),t)},children:l$(`common.remove`)})]}),(0,L7.jsx)(F7,{field:e,path:`${t}[${c}]`,values:o,shared:r,onChange:(e,t)=>i(n.map((t,n)=>n===c?e:t),t)})]},a.current[c])),(0,L7.jsx)(`div`,{className:`command-repeat-actions`,children:(0,L7.jsx)(gG,{intent:`secondary`,disabled:r.disabled||n.length>=c,"aria-label":l$(`addRowTo`,{label:e.label}),onClick:()=>i([...n,C7(e.fields)],t),children:l$(`addRow`)})})]})}var I7,L7,R7,z7,B7,V7,H7,U7,W7,G7,K7,q7,J7,Y7,X7,Z7,Q7,$7,e9,t9,n9,r9,i9,a9,o9,s9,c9,l9,u9,d9,f9,p9;s((()=>{I7=d(m()),si(),Es(),Ane(),aQ(),qQ(),Yi(),Ys(),yG(),yJ(),c$(),u$(),L7=d(O()),R7=Us(()=>Promise.resolve().then(()=>(S$(),v$)),`DateTimeInput`,{quiet:!0}),z7=Us(()=>Promise.resolve().then(()=>(A3(),l3)),`IntakeControl`,{quiet:!0}),B7=Us(()=>Promise.resolve().then(()=>(r6(),Y3)),`CommandLive`,{quiet:!0}),U7=()=>H7??=Promise.resolve().then(()=>(E6(),i6)).then(e=>{V7=e},e=>{throw H7=void 0,e}),W7={ready:()=>U7().catch(()=>{}),here:()=>V7!==void 0},G7=e=>V7?V7.readsRecord(e):/\brecord\./.test(e),q7=()=>Promise.resolve().then(()=>(pre(),cre)).then(e=>(K7=e,e)),J7=Us(q7,`CommandLines`),Y7=(e,t)=>K7?.lineAt(e,t),X7=()=>({currency:vi(),wire:!0,...K7?{cell:K7.lineCellOf}:{}}),Z7=0,Q7=(e={})=>({id:-++Z7,values:e}),$7=e=>Array.isArray(e)&&e.every(e=>!!e&&typeof e==`object`&&`values`in e&&`id`in e),e9=Us(()=>Promise.resolve().then(()=>(q4(),O4)),`CommandReferenceField`,{quiet:!0}),t9=Us(()=>Promise.resolve().then(()=>(Dre(),Tre)),`HeldInput`,{quiet:!0}),r9=Us(()=>Promise.resolve().then(()=>(Lre(),Mre)).then(e=>(n9=e,e)),`DefinedAnswers`,{quiet:!0}),i9=(e,t,n)=>n&&n9?n9.answerProblems(e,t,n):[],a9=4,o9=e=>e.as===`radios`||e.as!==`select`&&e.options.length<=a9,s9=e=>e.type===`boolean`&&e.as!==`buttons`,c9=e=>!!e&&typeof e==`object`&&!Array.isArray(e),l9=e=>`when`in e?e.when:void 0,u9={email:l$(`anEmailAddress`),url:l$(`aWebAddressStarting`),phone:l$(`aPhoneNumber`)},d9=e=>e===`date`||e===`datetime`||e===`time`,f9=e=>e.type===`number`||e.type===`money`||e.type===`date`||e.type===`datetime`||e.type===`time`?e.type:void 0,p9=e=>(e.type===`money`||e.type===`number`)&&e.as!==`slider`&&e.as!==`rating`||e.type===`text`&&e.sensitive===void 0&&e.as!==`color`&&e.as!==`scan`}))();var m9={unauthenticated:`Sign in to continue.`,stale_account:`The signed-in account changed. Reload before continuing.`,invalid_input:`The command input is invalid.`,command_version_mismatch:`This command version is unavailable. Keep the original request for reconciliation.`,not_found:`The record was not found.`,ineligible_state:`This record is not eligible for this command.`,consumes_refused:`There is not enough left of what this would use.`,reviewer_unavailable:`The selected reviewer is unavailable.`,forbidden:`This command is not available to this account.`,idempotency_conflict:`This request key was already used with different input.`,duplicate_record:`A record with this value already exists.`,stale_record:`The record has changed. Reload it before trying again.`,cancelled:`The command was cancelled.`,temporarily_unavailable:`The command could not be completed. Retry with the same request key.`,row_locked:`The record is locked by another transaction. Nothing was changed; retry in a moment.`,invalid_result:`The command did not produce a valid result.`};Es(),sa();function Ure(e){let t=e=>{e.preventDefault(),e.returnValue=``};ea(window,`beforeunload`,t),ea(window,`pagehide`,e);let n=ls(()=>!0);return()=>{ta(window,`beforeunload`,t),ta(window,`pagehide`,e),n()}}Fe();function Wre({note:e}){return e?(0,j.jsxs)(`p`,{className:`intake-note`,children:[e.icon&&(0,j.jsx)(Pe,{name:e.icon,size:16}),(0,j.jsx)(`span`,{children:e.text})]}):null}ba();var h9=pa({done:`Done`,sending:`Sending…`,checking:`Checking the result…`,queued:`Queued`,approval:`Awaiting approval`,refused:`Not done`,unknown:`Result not confirmed`,doneBody:`The change is saved.`,queuedBody:`It is in line and runs shortly. Nothing more is needed from you.`,approvalBody:`It goes ahead once someone who may approve it does.`,unknownBody:`The answer did not arrive, so it may or may not have gone through.`,unknownNext:`Check again before sending it a second time: a check reads what was kept and never sends twice.`,untrackedNext:`This action keeps no receipt to check by. Look at the record before you try again.`,nextField:`Change {field} and send again.`,nextInput:`Correct the answers and send again.`,nextStale:`Refresh and review what changed, then send again.`,nextIneligible:`It is no longer in a state this applies to. Refresh to see where it stands.`,nextForbidden:`Your role may not do this. Ask someone who may.`,nextNotFound:`It is no longer there. Refresh to see what is.`,nextWait:`Wait a moment and send again.`,nextDuplicate:`One like it already exists. Find that one instead of making another.`,nextDefault:`Nothing was changed. Review and send again.`});function Gre(e,t){if(t)return h9(`nextField`,{field:t});switch(e){case`invalid_input`:return h9(`nextInput`);case`stale_record`:case`idempotency_conflict`:case`command_version_mismatch`:return h9(`nextStale`);case`ineligible_state`:return h9(`nextIneligible`);case`forbidden`:return h9(`nextForbidden`);case`not_found`:return h9(`nextNotFound`);case`rate_limited`:case`row_locked`:case`temporarily_unavailable`:case`unavailable`:return h9(`nextWait`);case`duplicate_record`:return h9(`nextDuplicate`);default:return h9(`nextDefault`)}}var Kre=(e=!1)=>h9(e?`untrackedNext`:`unknownNext`);function qre(e){return e.state===`pending`?Jre[e.waiting]():Yre[e.state]()}var Jre={sending:()=>h9(`sending`),checking:()=>h9(`checking`),queued:()=>h9(`queued`),approval:()=>h9(`approval`)},Yre={done:()=>h9(`done`),refused:()=>h9(`refused`),unknown:()=>h9(`unknown`)};ba();var g9=pa({openRecord:`Open {label}`,checkAgain:`Check again`});yG();function Xre({outcome:e,onOpen:t,onCheck:n,className:r,...i}){return(0,j.jsxs)(`div`,{...i,className:`command-outcome${r?` ${r}`:``}`,"data-state":e.state,...e.state===`pending`?{"data-waiting":e.waiting}:{},children:[(0,j.jsx)(`p`,{className:`command-outcome-title`,children:qre(e)}),e.said&&(0,j.jsx)(`p`,{className:`command-outcome-body`,children:e.said}),e.state===`done`&&e.changed&&t&&(0,j.jsx)(`p`,{className:`command-outcome-next`,children:(0,j.jsx)(gG,{intent:`quiet`,size:`compact`,onClick:t,children:g9(`openRecord`,{label:e.changed.label})})}),(e.state===`refused`||e.state===`unknown`)&&(0,j.jsx)(`p`,{className:`command-outcome-next`,children:e.next}),e.state===`unknown`&&n&&(0,j.jsx)(`p`,{className:`command-outcome-check`,children:(0,j.jsx)(gG,{intent:`secondary`,onClick:n,children:g9(`checkAgain`)})})]})}Ys(),m4();var Zre=Us(()=>Promise.resolve().then(()=>(q4(),O4)),`ReviewNamed`,{quiet:!0});function _9({field:e,value:t,from:n}){if(n&&(e.type===`reference`?t!==``&&t!=null:e.type===`group`&&e.fields.some(e=>e.type===`reference`)))return(0,j.jsx)(Zre,{field:e,value:t,from:n});if(e.type===`group`){let n=f4(e,t);if(n.length>1)return(0,j.jsx)(`ul`,{className:`review-lines`,children:n.map((e,t)=>(0,j.jsx)(`li`,{children:e},t))})}return(0,j.jsx)(j.Fragment,{children:u4(e,t)})}ba();var v9=pa({theFormCouldNotBeSubmitted:`The form could not be submitted ({status}).`,tooManySubmissionsFromThisAddress:`Too many submissions from this address. Try again in {retryAfter} seconds.`,review:`Review`,reviewTitle:`Review your answers`,reviewLead:`Check each section. Change anything that is not right.`,keepThisReference:`Keep this reference.`,received:`Received`,yourReference:`Your reference`,fillInAnother:`Fill in another`,backToApp:`Back to {name}`,submit:`Submit`,change:`Change {label}`,changeStep:`Change`,checkThisBoxTo:`Check this box to continue.`,thisAnswerWasNot:`This answer was not accepted. Check it and try again.`,couldNotReach:`The form could not be sent. Check your connection and try again.`,refusedInvalidInput:`Some answers need another look.`,refusedVersion:`This form has changed since the page was opened. Reload the page to continue.`,refusedNotFound:`What this form was about is no longer here. Reload the page to continue.`,refusedIneligible:`This can’t be sent as it stands. Check your answers and try again.`,refusedForbidden:`This form can’t be sent from this page. Reload it and try again.`,refusedKeyReused:`This was already sent with different answers. Reload the page to start again.`,refusedDuplicate:`Something with these details already exists.`,refusedStale:`Something changed while you were filling this in. Reload the page and try again.`,refusedCancelled:`It was not sent.`,refusedUnavailable:`It could not be sent just now. Try again in a moment; it will not be sent twice.`,refusedLocked:`Someone else is changing this record right now. Nothing was sent; try again in a moment.`}),y9,Qre=s((()=>{ba(),y9=pa({reviewThisStepBefore:`Review this step before continuing.`,thisStepCouldNotBeValidated:`This step could not be validated. Try again.`,thisFormCouldNotBeCompleted:`This form could not be completed. Try again.`,formSteps:`Form steps`,stepOf:`Step {step} of {count}`,progress:`Step {step} of {count}: {label}`,continue:`Continue`,stepDone:`, done`})})),$re=s((()=>{})),eie=l({}),tie=s((()=>{J4(),$re()})),nie=l({MultiStepForm:()=>rie,loadIntakeStyle:()=>b9});function b9(){return E9??=Promise.resolve().then(()=>(tie(),eie)).then(()=>{T9=!0}),E9}function x9(e,t){return Number.isSafeInteger(e)?Math.max(0,Math.min(e,t-1)):0}function rie({steps:e,children:t,step:n,initialStep:r=0,onStepChange:i,validateStep:a,onComplete:o,nextLabel:s,previousLabel:c=y9(`common.back`),completeLabel:l=y9(`common.save`),className:u=``,leading:d,said:f,style:p=`stepper`,note:m,isStepEmpty:h,presentation:g=`page`,headingLevel:_=1,summarize:v}){let y=(0,S9.useId)(),b=e.slice(0,w9),x=n!==void 0,[S,C]=(0,S9.useState)(()=>p!==`intake`||T9);(0,S9.useEffect)(()=>{if(S)return;let e=!0;return b9().then(()=>e&&C(!0)),()=>{e=!1}},[S]);let[w,T]=(0,S9.useState)(()=>x9(r,b.length)),E=x9(x?n:w,b.length),[D,O]=(0,S9.useState)(``),[k,A]=(0,S9.useState)(!1),j=(0,S9.useRef)(!0);(0,S9.useEffect)(()=>()=>{j.current=!1},[]);let M=(0,S9.useRef)(null),N=(0,S9.useRef)(null),P=(0,S9.useRef)(null),[F,I]=(0,S9.useState)(0);(0,S9.useLayoutEffect)(()=>{if(!F)return;let e=M.current?.querySelector(`[aria-invalid="true"], :is(input, select, textarea):invalid`);M.current?.querySelector(`[aria-invalid="true"]`)&&O(``),(e??P.current)?.focus({preventScroll:!0})},[F]);let L=(0,S9.useRef)(E);if((0,S9.useLayoutEffect)(()=>{if(L.current===E)return;L.current=E;let e=N.current?.getBoundingClientRect().top??0;(e<0||e>window.innerHeight)&&N.current?.scrollIntoView?.({block:`start`,inline:`nearest`,behavior:`instant`})},[E]),!b.length)return null;let R=b[E],z=`${y}-title`,B=`${y}-panel`,V=async e=>{if(k)return;let t=e===`next`?E+1:E-1;if(!(t<0||t>=b.length)){A(!0),O(``);try{if(e===`next`&&a&&!await a(R,e)){j.current&&(O(y9(`reviewThisStepBefore`)),I(e=>e+1));return}if(!j.current)return;x||T(t),i?.(t,b[t])}catch{j.current&&O(y9(`thisStepCouldNotBeValidated`))}finally{j.current&&A(!1)}}},H=async()=>{if(!k){A(!0),O(``);try{if(a&&!await a(R,`next`)){j.current&&(O(y9(`reviewThisStepBefore`)),I(e=>e+1));return}await o?.()}catch{j.current&&O(y9(`thisFormCouldNotBeCompleted`))}finally{j.current&&A(!1)}}},U=e=>{k||e>=E||(x||T(e),O(``),i?.(e,b[e]))},W=p===`intake`;if(!S)return(0,C9.jsx)(`section`,{ref:N,className:`multi-step-form ${u}`.trim(),"data-style":`intake`,"aria-busy":`true`});let G=E===b.length-1,ee=g===`dialog`,te=G?l:s??(W&&R.skip&&h?.(R)?R.skip:R.next??y9(`continue`)),ne=R.title??R.label,K=e=>{if(e.key!==`Enter`||e.defaultPrevented||e.nativeEvent.isComposing||e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)return;let t=e.target;t instanceof HTMLInputElement&&!D9.has(t.type)&&t.getAttribute(`role`)!==`combobox`&&t.getAttribute(`aria-expanded`)!==`true`&&(e.preventDefault(),G?H():V(`next`))},re=(0,C9.jsxs)(`div`,{className:`multi-step-progress`,children:[(0,C9.jsx)(T$,{min:1,value:E+1,max:b.length,label:y9(`progress`,{step:E+1,count:b.length,label:R.label})}),(0,C9.jsx)(`span`,{className:`multi-step-count`,"aria-hidden":`true`,children:y9(`stepOf`,{step:E+1,count:b.length})})]}),q=(0,C9.jsx)(`div`,{id:B,ref:M,className:`multi-step-panel`,role:`group`,"aria-labelledby":z,onKeyDown:K,children:t(R,E)}),ie=(0,C9.jsx)(`p`,{ref:P,tabIndex:-1,className:`multi-step-problem`,role:`alert`,"aria-live":`polite`,hidden:!D,children:D}),ae=g===`page`?(0,C9.jsx)(`aside`,{className:`multi-step-aside`,children:(0,C9.jsx)(`nav`,{"aria-label":y9(`formSteps`),children:(0,C9.jsx)(`ol`,{className:`multi-step-list`,children:b.map((e,t)=>{let n=t<E?v?.(e,R):void 0,r=(0,C9.jsx)(`span`,{className:`multi-step-mark`,"aria-hidden":`true`,children:t<E&&(0,C9.jsx)(`svg`,{viewBox:`0 0 256 256`,width:`10`,height:`10`,focusable:`false`,children:(0,C9.jsx)(`path`,{d:O9,fill:`currentColor`})})});return(0,C9.jsxs)(`li`,{className:t<E?`is-done`:t===E?`is-current`:`is-ahead`,children:[t<E?(0,C9.jsxs)(`button`,{type:`button`,className:`multi-step-list-item`,disabled:k,onClick:()=>U(t),children:[r,(0,C9.jsx)(`span`,{className:`multi-step-list-label`,children:e.label}),(0,C9.jsx)(`span`,{className:`visually-hidden`,children:y9(`stepDone`)})]}):(0,C9.jsxs)(`span`,{className:`multi-step-list-item`,...t===E?{"aria-current":`step`}:{},children:[r,(0,C9.jsx)(`span`,{className:`multi-step-list-label`,children:e.label})]}),n&&(0,C9.jsx)(`p`,{className:`multi-step-list-said`,children:n})]},e.id)})})})}):null;return W&&!ee&&!d?(0,C9.jsxs)(`section`,{ref:N,className:`multi-step-form ${u}`.trim(),"data-style":`intake`,"aria-labelledby":z,children:[ae,m,(0,C9.jsxs)(`div`,{className:`intake-head`,children:[re,(0,C9.jsx)(E$,{level:_,id:z,title:ne,...R.lead?{lead:R.lead}:{}})]}),q,ie,f,(0,C9.jsx)(D$,{className:`intake-actions`,...E>0?{back:{label:c,onClick:()=>void V(`previous`)}}:{},primary:{label:te,onClick:()=>void(G?H():V(`next`)),busy:k,busyLabel:y9(G?`common.saving`:`common.checking`)}})]}):(0,C9.jsxs)(`section`,{ref:N,className:`multi-step-form ${u}`.trim(),...W?{"data-style":`intake`}:{},"aria-labelledby":z,children:[ae,W?(0,C9.jsxs)(C9.Fragment,{children:[m,(0,C9.jsxs)(`div`,{className:`intake-head`,children:[re,(0,C9.jsx)(E$,{level:2,id:z,title:ne,...R.lead?{lead:R.lead}:{}})]})]}):(0,C9.jsxs)(`div`,{className:`multi-step-heading`,children:[re,(0,C9.jsx)(`h2`,{id:z,children:R.label})]}),q,ie,f,(0,C9.jsxs)(`div`,{className:`multi-step-actions form-actions`,children:[d,E>0&&(0,C9.jsx)(gG,{intent:`quiet`,className:`multi-step-back`,disabled:k,onClick:()=>void V(`previous`),children:c}),G?(0,C9.jsx)(gG,{intent:`primary`,busy:k,busyLabel:y9(`common.saving`),onClick:()=>void H(),children:te}):(0,C9.jsx)(gG,{intent:`primary`,busy:k,busyLabel:y9(`common.checking`),onClick:()=>void V(`next`),children:te})]})]})}var S9,C9,w9,T9,E9,D9,O9,iie=s((()=>{S9=d(m(),1),yG(),M$(),Qre(),C9=d(O(),1),w9=16,T9=!1,D9=new Set([`checkbox`,`radio`,`button`,`submit`,`reset`,`file`,`image`]),O9=`M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z`})),aie=l({PublicGuard:()=>sie});function oie(e){let t=M9.get(e);return t||(t=new Promise((t,n)=>{let r=document.createElement(`script`);r.src=e,r.async=!0,r.onload=()=>t(),r.onerror=()=>{M9.delete(e),n(Error(e))},document.head.append(r)}),M9.set(e,t)),t}function sie({widget:e,handle:t}){let n=(0,k9.useRef)(null),r=(0,k9.useRef)(null),i=(0,k9.useRef)(void 0),a=(0,k9.useRef)([]),o=(0,k9.useRef)(void 0),s=e=>{if(i.current=e,e!==void 0)for(let t of a.current.splice(0))t(e)};return(0,k9.useEffect)(()=>(t.current={take(){let t=n.current?.value,r=t?{trap:t}:{};if(!e)return r;let o=e=>(i.current=void 0,e?{...r,challenge:e}:r);return i.current===void 0?new Promise(e=>{let t=setTimeout(()=>e(void 0),j9);a.current.push(n=>{clearTimeout(t),e(n)})}).then(o):o(i.current)},reset(){i.current=void 0,e&&o.current!==void 0&&N9(e)?.reset?.(o.current)}},()=>{t.current=void 0}),[t,e]),(0,k9.useEffect)(()=>{if(!e)return;let t=!1;return oie(e.script).then(()=>{let n=N9(e);!t&&r.current&&n?.render&&(o.current=n.render(r.current,{sitekey:e.siteKey,...e.action?{action:e.action}:{},callback:e=>s(e),"expired-callback":()=>s(void 0),"error-callback":()=>s(void 0)}))}).catch(()=>s(void 0)),()=>{t=!0,o.current!==void 0&&N9(e)?.remove?.(o.current),o.current=void 0}},[e?.script,e?.api,e?.siteKey,e?.action]),(0,A9.jsxs)(A9.Fragment,{children:[(0,A9.jsx)(`div`,{className:`visually-hidden`,"aria-hidden":`true`,children:(0,A9.jsx)(`input`,{ref:n,name:`mx_hp_7f`,tabIndex:-1,autoComplete:`new-password`,"aria-hidden":`true`})}),e&&(0,A9.jsx)(`div`,{ref:r,className:`form-challenge`})]})}var k9,A9,j9,M9,N9,cie=s((()=>{k9=d(m()),A9=d(O()),j9=1e4,M9=new Map,N9=e=>globalThis[e.api]})),lie=c((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),uie=c(((e,t)=>{t.exports=lie()})),die=c((e=>{var t=uie(),n=m(),r=g();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function o(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function s(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(a(e)!==e)throw Error(i(188))}function l(e){var t=e.alternate;if(!t){if(t=a(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var s=o.alternate;if(s===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return c(o),e;if(s===r)return c(o),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=o,r=s;else{for(var l=!1,u=o.child;u;){if(u===n){l=!0,n=o,r=s;break}if(u===r){l=!0,r=o,n=s;break}u=u.sibling}if(!l){for(u=s.child;u;){if(u===n){l=!0,n=s,r=o;break}if(u===r){l=!0,r=s,n=o;break}u=u.sibling}if(!l)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function u(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=u(e),t!==null)return t;e=e.sibling}return null}var d=Object.assign,f=Symbol.for(`react.element`),p=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},L=[],R=-1;function z(e){return{current:e}}function B(e){0>R||(e.current=L[R],L[R]=null,R--)}function V(e,t){R++,L[R]=e.current,e.current=t}var H=z(null),U=z(null),W=z(null),G=z(null);function ee(e,t){switch(V(W,t),V(U,e),V(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?zd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=zd(t),e=Bd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(H),V(H,e)}function te(){B(H),B(U),B(W)}function ne(e){e.memoizedState!==null&&V(G,e);var t=H.current,n=Bd(t,e.type);t!==n&&(V(U,e),V(H,n))}function K(e){U.current===e&&(B(H),B(U)),G.current===e&&(B(G),Xf._currentValue=I)}var re,q;function ie(e){if(re===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);re=t&&t[1]||``,q=-1<e.stack.indexOf(`
210
210
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
211
211
  `+re+e+q}var ae=!1;function oe(e,t){if(!e||ae)return``;ae=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`