autumn-js 0.0.113 → 0.0.114-beta.2

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 (245) hide show
  1. package/dist/libraries/backend/better-auth.d.mts +18 -18
  2. package/dist/libraries/backend/better-auth.d.ts +18 -18
  3. package/dist/libraries/backend/better-auth.js +5 -16
  4. package/dist/libraries/backend/better-auth.mjs +14 -11
  5. package/dist/libraries/backend/{chunk-EUAZMSHG.mjs → chunk-6Q2ITB2J.mjs} +6 -2
  6. package/dist/libraries/backend/{chunk-C342MVRJ.mjs → chunk-EJOHQRIY.mjs} +5 -1
  7. package/dist/libraries/backend/{chunk-BNRLG2NJ.mjs → chunk-ES5GSXMO.mjs} +51 -2
  8. package/dist/libraries/backend/{chunk-45WVZY23.mjs → chunk-I4AT5QDU.mjs} +10 -6
  9. package/dist/libraries/backend/{chunk-NBQSYUOH.mjs → chunk-JBMNONDP.mjs} +6 -2
  10. package/dist/libraries/backend/{chunk-6DZX6EAA.mjs → chunk-MZDBMPP4.mjs} +14 -1
  11. package/dist/libraries/backend/{chunk-UNZHJTEY.mjs → chunk-O4CGURPC.mjs} +5 -0
  12. package/dist/libraries/backend/{chunk-KSG3E4Q2.mjs → chunk-V47ADUWV.mjs} +5 -0
  13. package/dist/libraries/backend/{chunk-74THWZUU.mjs → chunk-W3UTLGLL.mjs} +11 -7
  14. package/dist/libraries/backend/{chunk-B5EK655Y.mjs → chunk-WVOOJ47K.mjs} +6 -2
  15. package/dist/libraries/backend/{chunk-ZHA3DHVC.mjs → chunk-YIQFOU5D.mjs} +7 -2
  16. package/dist/libraries/backend/constants.mjs +2 -2
  17. package/dist/libraries/backend/convex.js +5 -16
  18. package/dist/libraries/backend/convex.mjs +14 -11
  19. package/dist/libraries/backend/elysia.js +5 -16
  20. package/dist/libraries/backend/elysia.mjs +15 -11
  21. package/dist/libraries/backend/express.d.mts +1 -1
  22. package/dist/libraries/backend/express.d.ts +1 -1
  23. package/dist/libraries/backend/express.js +5 -16
  24. package/dist/libraries/backend/express.mjs +14 -11
  25. package/dist/libraries/backend/fastify.js +5 -16
  26. package/dist/libraries/backend/fastify.mjs +14 -11
  27. package/dist/libraries/backend/hono.js +5 -16
  28. package/dist/libraries/backend/hono.mjs +14 -11
  29. package/dist/libraries/backend/next.js +217 -101
  30. package/dist/libraries/backend/next.mjs +156 -107
  31. package/dist/libraries/backend/react-router.js +5 -16
  32. package/dist/libraries/backend/react-router.mjs +14 -11
  33. package/dist/libraries/backend/remix_dep.js +5 -16
  34. package/dist/libraries/backend/remix_dep.mjs +13 -10
  35. package/dist/libraries/backend/routes/backendRouter.js +5 -16
  36. package/dist/libraries/backend/routes/backendRouter.mjs +10 -10
  37. package/dist/libraries/backend/routes/basePath.mjs +6 -0
  38. package/dist/libraries/backend/routes/entityRoutes.js +5 -16
  39. package/dist/libraries/backend/routes/entityRoutes.mjs +6 -6
  40. package/dist/libraries/backend/routes/genRoutes.js +5 -16
  41. package/dist/libraries/backend/routes/genRoutes.mjs +6 -6
  42. package/dist/libraries/backend/routes/productRoutes.js +5 -16
  43. package/dist/libraries/backend/routes/productRoutes.mjs +6 -6
  44. package/dist/libraries/backend/routes/referralRoutes.js +5 -16
  45. package/dist/libraries/backend/routes/referralRoutes.mjs +6 -6
  46. package/dist/libraries/backend/schemas/zod.mjs +4 -1
  47. package/dist/libraries/backend/supabase.js +5 -16
  48. package/dist/libraries/backend/supabase.mjs +14 -11
  49. package/dist/libraries/backend/tanstack.js +85 -16
  50. package/dist/libraries/backend/tanstack.mjs +25 -11
  51. package/dist/libraries/backend/utils/AuthFunction.mjs +6 -0
  52. package/dist/libraries/backend/utils/backendRes.js +5 -16
  53. package/dist/libraries/backend/utils/backendRes.mjs +4 -4
  54. package/dist/libraries/backend/utils/logBackendErrors.js +5 -16
  55. package/dist/libraries/backend/utils/logBackendErrors.mjs +5 -2
  56. package/dist/libraries/backend/utils/secretKeyCheck.mjs +2 -2
  57. package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
  58. package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
  59. package/dist/libraries/backend/utils/withAuth.js +5 -16
  60. package/dist/libraries/backend/utils/withAuth.mjs +5 -5
  61. package/dist/libraries/react/AutumnContext.d.mts +6 -6
  62. package/dist/libraries/react/AutumnContext.d.ts +6 -6
  63. package/dist/libraries/react/AutumnContext.js +5 -16
  64. package/dist/libraries/react/AutumnContext.mjs +5 -5
  65. package/dist/libraries/react/BaseAutumnProvider.d.mts +6 -6
  66. package/dist/libraries/react/BaseAutumnProvider.d.ts +6 -6
  67. package/dist/libraries/react/BaseAutumnProvider.js +5 -6
  68. package/dist/libraries/react/BaseAutumnProvider.mjs +10 -10
  69. package/dist/libraries/react/{ReactAutumnClient-BNcDsxYe.d.ts → ReactAutumnClient-CDfo8hZ4.d.ts} +17 -17
  70. package/dist/libraries/react/{ReactAutumnClient-Bm0Y_zzP.d.mts → ReactAutumnClient-c3yiqDyr.d.mts} +17 -17
  71. package/dist/libraries/react/ReactAutumnProvider.d.mts +2 -2
  72. package/dist/libraries/react/ReactAutumnProvider.d.ts +2 -2
  73. package/dist/libraries/react/ReactAutumnProvider.js +5 -6
  74. package/dist/libraries/react/ReactAutumnProvider.mjs +11 -11
  75. package/dist/libraries/react/{attachTypes-BQzswBtK.d.mts → attachTypes--vy7a8ko.d.mts} +7 -7
  76. package/dist/libraries/react/{attachTypes-DIsESO5Y.d.ts → attachTypes-BUrxxKCh.d.ts} +7 -7
  77. package/dist/libraries/react/{chunk-GUZH4TKK.mjs → chunk-3JORYFTY.mjs} +5 -6
  78. package/dist/libraries/react/{chunk-DDYSMKLY.mjs → chunk-3UNBBJY5.mjs} +1 -1
  79. package/dist/libraries/react/{chunk-HDMOJP3E.mjs → chunk-4Q7BDIOS.mjs} +1 -1
  80. package/dist/libraries/react/{chunk-DGBYTZLQ.mjs → chunk-5PA5P2UE.mjs} +2 -2
  81. package/dist/libraries/react/{chunk-4X4TKILZ.mjs → chunk-62QDB3KQ.mjs} +3 -3
  82. package/dist/libraries/react/{chunk-3C7OO2N3.mjs → chunk-6R3O2T4H.mjs} +1 -1
  83. package/dist/libraries/react/{chunk-JP6WLDHX.mjs → chunk-CV4TKYAC.mjs} +2 -2
  84. package/dist/libraries/react/{chunk-QMOLXJIH.mjs → chunk-CZVP6BZG.mjs} +3 -3
  85. package/dist/libraries/react/{chunk-QEKHWOGC.mjs → chunk-E2H5MYIO.mjs} +1 -1
  86. package/dist/libraries/react/{chunk-TX3X2LDE.mjs → chunk-FEISQQNM.mjs} +92 -649
  87. package/dist/libraries/react/chunk-FJWZPMWU.mjs +448 -0
  88. package/dist/libraries/react/{chunk-F324RNGU.mjs → chunk-FOXUAY7Y.mjs} +7 -7
  89. package/dist/libraries/react/{chunk-CYFC6BOH.mjs → chunk-HBVLIBOE.mjs} +3 -3
  90. package/dist/libraries/react/chunk-I2A7PK2L.mjs +151 -0
  91. package/dist/libraries/react/chunk-JGDTNJTR.mjs +584 -0
  92. package/dist/libraries/react/chunk-KUS3X33V.mjs +46 -0
  93. package/dist/libraries/react/chunk-OTZ65PCT.mjs +2520 -0
  94. package/dist/libraries/react/{chunk-EGPEAPRK.mjs → chunk-PEYCQWHI.mjs} +2 -2
  95. package/dist/libraries/react/{chunk-4NIALZY6.mjs → chunk-PNTVQMRO.mjs} +32 -31
  96. package/dist/libraries/react/{chunk-RL47UQK4.mjs → chunk-RGAEIODW.mjs} +1 -1
  97. package/dist/libraries/react/{chunk-PLGLCII4.mjs → chunk-YDRULJZE.mjs} +2 -2
  98. package/dist/libraries/react/{chunk-PRFT4OKG.mjs → chunk-YEG5KJEI.mjs} +1 -1
  99. package/dist/libraries/react/{chunk-6EZVNJHQ.mjs → chunk-YWQTQ72B.mjs} +15 -50
  100. package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -6
  101. package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -6
  102. package/dist/libraries/react/client/ReactAutumnClient.js +5 -16
  103. package/dist/libraries/react/client/ReactAutumnClient.mjs +4 -4
  104. package/dist/libraries/react/client/clientCompMethods.d.mts +6 -6
  105. package/dist/libraries/react/client/clientCompMethods.d.ts +6 -6
  106. package/dist/libraries/react/client/clientCusMethods.d.mts +6 -6
  107. package/dist/libraries/react/client/clientCusMethods.d.ts +6 -6
  108. package/dist/libraries/react/client/clientEntityMethods.d.mts +6 -6
  109. package/dist/libraries/react/client/clientEntityMethods.d.ts +6 -6
  110. package/dist/libraries/react/client/clientGenMethods.d.mts +6 -6
  111. package/dist/libraries/react/client/clientGenMethods.d.ts +6 -6
  112. package/dist/libraries/react/client/clientProdMethods.d.mts +6 -6
  113. package/dist/libraries/react/client/clientProdMethods.d.ts +6 -6
  114. package/dist/libraries/react/client/clientReferralMethods.d.mts +6 -6
  115. package/dist/libraries/react/client/clientReferralMethods.d.ts +6 -6
  116. package/dist/libraries/react/client/types/clientAttachTypes.d.mts +18 -18
  117. package/dist/libraries/react/client/types/clientAttachTypes.d.ts +18 -18
  118. package/dist/libraries/react/client/types/clientGenTypes.d.mts +4 -4
  119. package/dist/libraries/react/client/types/clientGenTypes.d.ts +4 -4
  120. package/dist/libraries/react/client/types/clientGenTypes.js +5 -16
  121. package/dist/libraries/react/client/types/clientGenTypes.mjs +1 -1
  122. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +2 -2
  123. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +2 -2
  124. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +6486 -3517
  125. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +30 -27
  126. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +2 -2
  127. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +2 -2
  128. package/dist/libraries/react/components/check-dialog/check-dialog-synced.js +3131 -169
  129. package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +30 -27
  130. package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -1
  131. package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -1
  132. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +1 -1
  133. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +1 -1
  134. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
  135. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
  136. package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +5895 -2928
  137. package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +30 -27
  138. package/dist/libraries/react/components/ui/accordion.js +984 -26
  139. package/dist/libraries/react/components/ui/accordion.mjs +4 -1
  140. package/dist/libraries/react/components/ui/dialog.mjs +4 -2
  141. package/dist/libraries/react/components/ui/popover.js +4282 -24
  142. package/dist/libraries/react/components/ui/popover.mjs +6 -1
  143. package/dist/libraries/react/components/ui/switch.mjs +3 -2
  144. package/dist/libraries/react/{cusTypes-CwLJs1D1.d.ts → cusTypes-B_vSLMNd.d.ts} +7 -7
  145. package/dist/libraries/react/{cusTypes-CI8GNjww.d.mts → cusTypes-D1pgp32k.d.mts} +7 -7
  146. package/dist/libraries/react/{entTypes-Kh8o7OKO.d.mts → entTypes-Bw3nZ-hB.d.mts} +1 -1
  147. package/dist/libraries/react/{entTypes-ByG7ZqG-.d.ts → entTypes-DQXsozw-.d.ts} +1 -1
  148. package/dist/libraries/react/{genTypes-BjDGPkYi.d.mts → genTypes-C-CUGCpC.d.mts} +5 -5
  149. package/dist/libraries/react/{genTypes-CtkYtnSx.d.ts → genTypes-CaRSTLgV.d.ts} +5 -5
  150. package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +6 -6
  151. package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +6 -6
  152. package/dist/libraries/react/hooks/helpers/handleCheck.js +5 -16
  153. package/dist/libraries/react/hooks/helpers/handleCheck.mjs +2 -2
  154. package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +6 -6
  155. package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +6 -6
  156. package/dist/libraries/react/hooks/helpers/useAutumnBase.js +5 -6
  157. package/dist/libraries/react/hooks/helpers/useAutumnBase.mjs +3 -3
  158. package/dist/libraries/react/hooks/useAnalytics.d.mts +2 -2
  159. package/dist/libraries/react/hooks/useAnalytics.d.ts +2 -2
  160. package/dist/libraries/react/hooks/useAnalytics.js +5 -6
  161. package/dist/libraries/react/hooks/useAnalytics.mjs +6 -6
  162. package/dist/libraries/react/hooks/useCustomer.d.mts +6 -6
  163. package/dist/libraries/react/hooks/useCustomer.d.ts +6 -6
  164. package/dist/libraries/react/hooks/useCustomer.js +5 -6
  165. package/dist/libraries/react/hooks/useCustomer.mjs +10 -10
  166. package/dist/libraries/react/hooks/useCustomerBase.d.mts +6 -6
  167. package/dist/libraries/react/hooks/useCustomerBase.d.ts +6 -6
  168. package/dist/libraries/react/hooks/useCustomerBase.js +5 -6
  169. package/dist/libraries/react/hooks/useCustomerBase.mjs +9 -9
  170. package/dist/libraries/react/hooks/useEntity.d.mts +4 -4
  171. package/dist/libraries/react/hooks/useEntity.d.ts +4 -4
  172. package/dist/libraries/react/hooks/useEntity.js +5 -6
  173. package/dist/libraries/react/hooks/useEntity.mjs +10 -10
  174. package/dist/libraries/react/hooks/useEntityBase.d.mts +6 -6
  175. package/dist/libraries/react/hooks/useEntityBase.d.ts +6 -6
  176. package/dist/libraries/react/hooks/useEntityBase.js +5 -6
  177. package/dist/libraries/react/hooks/useEntityBase.mjs +9 -9
  178. package/dist/libraries/react/hooks/usePaywall.d.mts +1 -1
  179. package/dist/libraries/react/hooks/usePaywall.d.ts +1 -1
  180. package/dist/libraries/react/hooks/usePaywall.js +5 -6
  181. package/dist/libraries/react/hooks/usePaywall.mjs +6 -6
  182. package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
  183. package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
  184. package/dist/libraries/react/hooks/usePricingTable.js +5 -6
  185. package/dist/libraries/react/hooks/usePricingTable.mjs +7 -7
  186. package/dist/libraries/react/hooks/usePricingTableBase.d.mts +6 -6
  187. package/dist/libraries/react/hooks/usePricingTableBase.d.ts +6 -6
  188. package/dist/libraries/react/hooks/usePricingTableBase.js +5 -6
  189. package/dist/libraries/react/hooks/usePricingTableBase.mjs +2 -2
  190. package/dist/libraries/react/hooks/useProductsBase.d.mts +6 -6
  191. package/dist/libraries/react/hooks/useProductsBase.d.ts +6 -6
  192. package/dist/libraries/react/index.js +5906 -2939
  193. package/dist/libraries/react/index.mjs +5863 -2896
  194. package/dist/next/client/NextAutumnClient.d.mts +18 -18
  195. package/dist/next/client/NextAutumnClient.d.ts +18 -18
  196. package/dist/next/client/NextAutumnProvider.d.mts +2 -2
  197. package/dist/next/client/NextAutumnProvider.d.ts +2 -2
  198. package/dist/next/client/{attachTypes-CACw68CG.d.ts → attachTypes-DPYjShM5.d.ts} +7 -7
  199. package/dist/next/client/{attachTypes-DFz8xggN.d.mts → attachTypes-mELcg_uC.d.mts} +7 -7
  200. package/dist/next/client/{clientAttachTypes-Chgx4uq1.d.ts → clientAttachTypes-B4i2ri-1.d.ts} +27 -27
  201. package/dist/next/client/{clientAttachTypes-CsHcLMla.d.mts → clientAttachTypes-EGitteWV.d.mts} +27 -27
  202. package/dist/next/client/clientUtils.d.mts +3 -3
  203. package/dist/next/client/clientUtils.d.ts +3 -3
  204. package/dist/next/client/{cusTypes-CfOlwucH.d.mts → cusTypes-CRJanGZd.d.mts} +5 -5
  205. package/dist/next/client/{cusTypes-C9G9xqQj.d.ts → cusTypes-Dn0ETI7G.d.ts} +5 -5
  206. package/dist/next/client/{entTypes-_335WLpv.d.ts → entTypes-Caov3CJ9.d.ts} +1 -1
  207. package/dist/next/client/{entTypes-BF3ut9It.d.mts → entTypes-Qyo2WYGP.d.mts} +1 -1
  208. package/dist/next/client/hooks/useAutumn.d.mts +5 -5
  209. package/dist/next/client/hooks/useAutumn.d.ts +5 -5
  210. package/dist/next/client/hooks/useCustomer.d.mts +5 -5
  211. package/dist/next/client/hooks/useCustomer.d.ts +5 -5
  212. package/dist/next/client/hooks/useEntity.d.mts +7 -7
  213. package/dist/next/client/hooks/useEntity.d.ts +7 -7
  214. package/dist/next/client/hooks/usePricingTable.d.mts +1 -1
  215. package/dist/next/client/hooks/usePricingTable.d.ts +1 -1
  216. package/dist/next/client/types.d.mts +3 -3
  217. package/dist/next/client/types.d.ts +3 -3
  218. package/dist/next/server/auth/withNextAuth.d.mts +1 -1
  219. package/dist/next/server/auth/withNextAuth.d.ts +1 -1
  220. package/dist/next/server/componentActions.d.mts +1 -1
  221. package/dist/next/server/componentActions.d.ts +1 -1
  222. package/dist/next/server/cusActions.d.mts +15 -15
  223. package/dist/next/server/cusActions.d.ts +15 -15
  224. package/dist/next/server/genActions.d.mts +1 -1
  225. package/dist/next/server/genActions.d.ts +1 -1
  226. package/dist/sdk/index.js +7 -10
  227. package/dist/sdk/index.mjs +7 -6
  228. package/dist/utils/{chunk-V7R5DCYR.mjs → chunk-WNUBT3GZ.mjs} +5 -6
  229. package/dist/utils/encryptUtils.js +5 -6
  230. package/dist/utils/encryptUtils.mjs +1 -1
  231. package/dist/utils/logger.js +5 -16
  232. package/dist/utils/logger.mjs +1 -1
  233. package/package.json +7 -13
  234. package/tsup.config.ts +31 -0
  235. package/dist/libraries/react/chunk-JGRLRPKG.mjs +0 -56
  236. package/dist/libraries/react/chunk-UM3ZQPMU.mjs +0 -34
  237. package/dist/libraries/backend/{referralTypes-COVVwj-1.d.mts → referralTypes-CHRdXdZi.d.mts} +35 -35
  238. package/dist/libraries/backend/{referralTypes-qMay-K9l.d.ts → referralTypes-KN1bdpbB.d.ts} +35 -35
  239. package/dist/libraries/react/{chunk-KWNH6C27.mjs → chunk-7TYAAD2T.mjs} +11 -11
  240. package/dist/libraries/react/{prodTypes-Y1CLtmfa.d.mts → prodTypes-DWMxMrWG.d.mts} +2 -2
  241. package/dist/libraries/react/{prodTypes-Y1CLtmfa.d.ts → prodTypes-DWMxMrWG.d.ts} +2 -2
  242. package/dist/next/client/{prodTypes-CYd9Q1Rw.d.mts → prodTypes-si707oHg.d.mts} +4 -4
  243. package/dist/next/client/{prodTypes-CYd9Q1Rw.d.ts → prodTypes-si707oHg.d.ts} +4 -4
  244. package/dist/next/server/{cusTypes-PcPWkSme.d.mts → cusTypes-wfx--BDG.d.mts} +4 -4
  245. package/dist/next/server/{cusTypes-PcPWkSme.d.ts → cusTypes-wfx--BDG.d.ts} +4 -4
@@ -0,0 +1,448 @@
1
+ "use client";
2
+
3
+ import {
4
+ Combination_default,
5
+ DismissableLayer,
6
+ FocusScope,
7
+ Portal,
8
+ hideOthers,
9
+ useFocusGuards
10
+ } from "./chunk-FEISQQNM.mjs";
11
+ import {
12
+ X
13
+ } from "./chunk-QJPZFEVW.mjs";
14
+ import {
15
+ Presence,
16
+ useId
17
+ } from "./chunk-I2A7PK2L.mjs";
18
+ import {
19
+ Primitive,
20
+ composeEventHandlers,
21
+ createContext2,
22
+ createContextScope,
23
+ useControllableState
24
+ } from "./chunk-7TYAAD2T.mjs";
25
+ import {
26
+ createSlot,
27
+ useComposedRefs
28
+ } from "./chunk-RPEGNKJH.mjs";
29
+ import {
30
+ cn
31
+ } from "./chunk-4J6OC4ZQ.mjs";
32
+
33
+ // src/libraries/react/components/ui/dialog.tsx
34
+ import * as React2 from "react";
35
+
36
+ // ../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19.1._xkx6efnpqhhb4lkirxfs4qofci/node_modules/@radix-ui/react-dialog/dist/index.mjs
37
+ import * as React from "react";
38
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
39
+ var DIALOG_NAME = "Dialog";
40
+ var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
41
+ var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
42
+ var Dialog = (props) => {
43
+ const {
44
+ __scopeDialog,
45
+ children,
46
+ open: openProp,
47
+ defaultOpen,
48
+ onOpenChange,
49
+ modal = true
50
+ } = props;
51
+ const triggerRef = React.useRef(null);
52
+ const contentRef = React.useRef(null);
53
+ const [open, setOpen] = useControllableState({
54
+ prop: openProp,
55
+ defaultProp: defaultOpen ?? false,
56
+ onChange: onOpenChange,
57
+ caller: DIALOG_NAME
58
+ });
59
+ return /* @__PURE__ */ jsx(
60
+ DialogProvider,
61
+ {
62
+ scope: __scopeDialog,
63
+ triggerRef,
64
+ contentRef,
65
+ contentId: useId(),
66
+ titleId: useId(),
67
+ descriptionId: useId(),
68
+ open,
69
+ onOpenChange: setOpen,
70
+ onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
71
+ modal,
72
+ children
73
+ }
74
+ );
75
+ };
76
+ Dialog.displayName = DIALOG_NAME;
77
+ var TRIGGER_NAME = "DialogTrigger";
78
+ var DialogTrigger = React.forwardRef(
79
+ (props, forwardedRef) => {
80
+ const { __scopeDialog, ...triggerProps } = props;
81
+ const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
82
+ const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
83
+ return /* @__PURE__ */ jsx(
84
+ Primitive.button,
85
+ {
86
+ type: "button",
87
+ "aria-haspopup": "dialog",
88
+ "aria-expanded": context.open,
89
+ "aria-controls": context.contentId,
90
+ "data-state": getState(context.open),
91
+ ...triggerProps,
92
+ ref: composedTriggerRef,
93
+ onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
94
+ }
95
+ );
96
+ }
97
+ );
98
+ DialogTrigger.displayName = TRIGGER_NAME;
99
+ var PORTAL_NAME = "DialogPortal";
100
+ var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
101
+ forceMount: void 0
102
+ });
103
+ var DialogPortal = (props) => {
104
+ const { __scopeDialog, forceMount, children, container } = props;
105
+ const context = useDialogContext(PORTAL_NAME, __scopeDialog);
106
+ return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal, { asChild: true, container, children: child }) })) });
107
+ };
108
+ DialogPortal.displayName = PORTAL_NAME;
109
+ var OVERLAY_NAME = "DialogOverlay";
110
+ var DialogOverlay = React.forwardRef(
111
+ (props, forwardedRef) => {
112
+ const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
113
+ const { forceMount = portalContext.forceMount, ...overlayProps } = props;
114
+ const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
115
+ return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
116
+ }
117
+ );
118
+ DialogOverlay.displayName = OVERLAY_NAME;
119
+ var Slot = createSlot("DialogOverlay.RemoveScroll");
120
+ var DialogOverlayImpl = React.forwardRef(
121
+ (props, forwardedRef) => {
122
+ const { __scopeDialog, ...overlayProps } = props;
123
+ const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
124
+ return (
125
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
126
+ // ie. when `Overlay` and `Content` are siblings
127
+ /* @__PURE__ */ jsx(Combination_default, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(
128
+ Primitive.div,
129
+ {
130
+ "data-state": getState(context.open),
131
+ ...overlayProps,
132
+ ref: forwardedRef,
133
+ style: { pointerEvents: "auto", ...overlayProps.style }
134
+ }
135
+ ) })
136
+ );
137
+ }
138
+ );
139
+ var CONTENT_NAME = "DialogContent";
140
+ var DialogContent = React.forwardRef(
141
+ (props, forwardedRef) => {
142
+ const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
143
+ const { forceMount = portalContext.forceMount, ...contentProps } = props;
144
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
145
+ return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
146
+ }
147
+ );
148
+ DialogContent.displayName = CONTENT_NAME;
149
+ var DialogContentModal = React.forwardRef(
150
+ (props, forwardedRef) => {
151
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
152
+ const contentRef = React.useRef(null);
153
+ const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
154
+ React.useEffect(() => {
155
+ const content = contentRef.current;
156
+ if (content) return hideOthers(content);
157
+ }, []);
158
+ return /* @__PURE__ */ jsx(
159
+ DialogContentImpl,
160
+ {
161
+ ...props,
162
+ ref: composedRefs,
163
+ trapFocus: context.open,
164
+ disableOutsidePointerEvents: true,
165
+ onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
166
+ event.preventDefault();
167
+ context.triggerRef.current?.focus();
168
+ }),
169
+ onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
170
+ const originalEvent = event.detail.originalEvent;
171
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
172
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
173
+ if (isRightClick) event.preventDefault();
174
+ }),
175
+ onFocusOutside: composeEventHandlers(
176
+ props.onFocusOutside,
177
+ (event) => event.preventDefault()
178
+ )
179
+ }
180
+ );
181
+ }
182
+ );
183
+ var DialogContentNonModal = React.forwardRef(
184
+ (props, forwardedRef) => {
185
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
186
+ const hasInteractedOutsideRef = React.useRef(false);
187
+ const hasPointerDownOutsideRef = React.useRef(false);
188
+ return /* @__PURE__ */ jsx(
189
+ DialogContentImpl,
190
+ {
191
+ ...props,
192
+ ref: forwardedRef,
193
+ trapFocus: false,
194
+ disableOutsidePointerEvents: false,
195
+ onCloseAutoFocus: (event) => {
196
+ props.onCloseAutoFocus?.(event);
197
+ if (!event.defaultPrevented) {
198
+ if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
199
+ event.preventDefault();
200
+ }
201
+ hasInteractedOutsideRef.current = false;
202
+ hasPointerDownOutsideRef.current = false;
203
+ },
204
+ onInteractOutside: (event) => {
205
+ props.onInteractOutside?.(event);
206
+ if (!event.defaultPrevented) {
207
+ hasInteractedOutsideRef.current = true;
208
+ if (event.detail.originalEvent.type === "pointerdown") {
209
+ hasPointerDownOutsideRef.current = true;
210
+ }
211
+ }
212
+ const target = event.target;
213
+ const targetIsTrigger = context.triggerRef.current?.contains(target);
214
+ if (targetIsTrigger) event.preventDefault();
215
+ if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
216
+ event.preventDefault();
217
+ }
218
+ }
219
+ }
220
+ );
221
+ }
222
+ );
223
+ var DialogContentImpl = React.forwardRef(
224
+ (props, forwardedRef) => {
225
+ const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
226
+ const context = useDialogContext(CONTENT_NAME, __scopeDialog);
227
+ const contentRef = React.useRef(null);
228
+ const composedRefs = useComposedRefs(forwardedRef, contentRef);
229
+ useFocusGuards();
230
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
231
+ /* @__PURE__ */ jsx(
232
+ FocusScope,
233
+ {
234
+ asChild: true,
235
+ loop: true,
236
+ trapped: trapFocus,
237
+ onMountAutoFocus: onOpenAutoFocus,
238
+ onUnmountAutoFocus: onCloseAutoFocus,
239
+ children: /* @__PURE__ */ jsx(
240
+ DismissableLayer,
241
+ {
242
+ role: "dialog",
243
+ id: context.contentId,
244
+ "aria-describedby": context.descriptionId,
245
+ "aria-labelledby": context.titleId,
246
+ "data-state": getState(context.open),
247
+ ...contentProps,
248
+ ref: composedRefs,
249
+ onDismiss: () => context.onOpenChange(false)
250
+ }
251
+ )
252
+ }
253
+ ),
254
+ /* @__PURE__ */ jsxs(Fragment, { children: [
255
+ /* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),
256
+ /* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
257
+ ] })
258
+ ] });
259
+ }
260
+ );
261
+ var TITLE_NAME = "DialogTitle";
262
+ var DialogTitle = React.forwardRef(
263
+ (props, forwardedRef) => {
264
+ const { __scopeDialog, ...titleProps } = props;
265
+ const context = useDialogContext(TITLE_NAME, __scopeDialog);
266
+ return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
267
+ }
268
+ );
269
+ DialogTitle.displayName = TITLE_NAME;
270
+ var DESCRIPTION_NAME = "DialogDescription";
271
+ var DialogDescription = React.forwardRef(
272
+ (props, forwardedRef) => {
273
+ const { __scopeDialog, ...descriptionProps } = props;
274
+ const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
275
+ return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
276
+ }
277
+ );
278
+ DialogDescription.displayName = DESCRIPTION_NAME;
279
+ var CLOSE_NAME = "DialogClose";
280
+ var DialogClose = React.forwardRef(
281
+ (props, forwardedRef) => {
282
+ const { __scopeDialog, ...closeProps } = props;
283
+ const context = useDialogContext(CLOSE_NAME, __scopeDialog);
284
+ return /* @__PURE__ */ jsx(
285
+ Primitive.button,
286
+ {
287
+ type: "button",
288
+ ...closeProps,
289
+ ref: forwardedRef,
290
+ onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
291
+ }
292
+ );
293
+ }
294
+ );
295
+ DialogClose.displayName = CLOSE_NAME;
296
+ function getState(open) {
297
+ return open ? "open" : "closed";
298
+ }
299
+ var TITLE_WARNING_NAME = "DialogTitleWarning";
300
+ var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
301
+ contentName: CONTENT_NAME,
302
+ titleName: TITLE_NAME,
303
+ docsSlug: "dialog"
304
+ });
305
+ var TitleWarning = ({ titleId }) => {
306
+ const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
307
+ const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
308
+
309
+ If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
310
+
311
+ For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
312
+ React.useEffect(() => {
313
+ if (titleId) {
314
+ const hasTitle = document.getElementById(titleId);
315
+ if (!hasTitle) console.error(MESSAGE);
316
+ }
317
+ }, [MESSAGE, titleId]);
318
+ return null;
319
+ };
320
+ var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
321
+ var DescriptionWarning = ({ contentRef, descriptionId }) => {
322
+ const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
323
+ const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
324
+ React.useEffect(() => {
325
+ const describedById = contentRef.current?.getAttribute("aria-describedby");
326
+ if (descriptionId && describedById) {
327
+ const hasDescription = document.getElementById(descriptionId);
328
+ if (!hasDescription) console.warn(MESSAGE);
329
+ }
330
+ }, [MESSAGE, contentRef, descriptionId]);
331
+ return null;
332
+ };
333
+ var Root = Dialog;
334
+ var Trigger = DialogTrigger;
335
+ var Portal2 = DialogPortal;
336
+ var Overlay = DialogOverlay;
337
+ var Content = DialogContent;
338
+ var Title = DialogTitle;
339
+ var Description = DialogDescription;
340
+ var Close = DialogClose;
341
+
342
+ // src/libraries/react/components/ui/dialog.tsx
343
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
344
+ var Dialog2 = Root;
345
+ var DialogTrigger2 = Trigger;
346
+ var DialogPortal2 = ({
347
+ children,
348
+ ...props
349
+ }) => {
350
+ return /* @__PURE__ */ jsx2(Portal2, { ...props, children: /* @__PURE__ */ jsx2("div", { className: "au-root", children }) });
351
+ };
352
+ var DialogClose2 = Close;
353
+ var DialogOverlay2 = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
354
+ Overlay,
355
+ {
356
+ ref,
357
+ className: cn(
358
+ "au-fixed au-inset-0 au-z-50 data-[state=open]:au-animate-in data-[state=closed]:au-animate-out data-[state=closed]:au-fade-out-0 data-[state=open]:au-fade-in-0 au-backdrop-blur-sm au-bg-black/40",
359
+ className
360
+ ),
361
+ ...props
362
+ }
363
+ ));
364
+ DialogOverlay2.displayName = Overlay.displayName;
365
+ var DialogContent2 = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs2(DialogPortal2, { children: [
366
+ /* @__PURE__ */ jsx2(DialogOverlay2, {}),
367
+ /* @__PURE__ */ jsxs2(
368
+ Content,
369
+ {
370
+ ref,
371
+ className: cn(
372
+ `au-fixed au-left-[50%] au-top-[50%] au-z-50 au-grid au-w-full au-max-w-lg au-translate-x-[-50%] au-translate-y-[-50%] au-gap-4 au-border au-bg-background au-p-6 au-shadow-lg au-duration-200 data-[state=open]:au-animate-in data-[state=closed]:au-animate-out data-[state=closed]:au-fade-out-0 data-[state=open]:au-fade-in-0 data-[state=closed]:au-zoom-out-95 data-[state=open]:au-zoom-in-95 data-[state=closed]:au-slide-out-to-left-1/2 data-[state=closed]:au-slide-out-to-top-[48%] data-[state=open]:au-slide-in-from-left-1/2 data-[state=open]:au-slide-in-from-top-[48%] sm:au-rounded-lg`,
373
+ className
374
+ ),
375
+ ...props,
376
+ children: [
377
+ children,
378
+ /* @__PURE__ */ jsxs2(Close, { className: "au-absolute au-right-4 au-top-4 au-rounded-sm au-opacity-70 au-ring-offset-background au-transition-opacity hover:au-opacity-100 focus:au-outline-none focus:au-ring-2 focus:au-ring-ring focus:au-ring-offset-2 disabled:au-pointer-events-none data-[state=open]:au-bg-accent data-[state=open]:au-text-muted-foreground", children: [
379
+ /* @__PURE__ */ jsx2(X, { className: "au-h-4 au-w-4" }),
380
+ /* @__PURE__ */ jsx2("span", { className: "au-sr-only", children: "Close" })
381
+ ] })
382
+ ]
383
+ }
384
+ )
385
+ ] }));
386
+ DialogContent2.displayName = Content.displayName;
387
+ var DialogHeader = ({
388
+ className,
389
+ ...props
390
+ }) => /* @__PURE__ */ jsx2(
391
+ "div",
392
+ {
393
+ className: cn(
394
+ "au-flex au-flex-col au-space-y-1.5 au-text-center sm:au-text-left",
395
+ className
396
+ ),
397
+ ...props
398
+ }
399
+ );
400
+ DialogHeader.displayName = "DialogHeader";
401
+ var DialogFooter = ({
402
+ className,
403
+ ...props
404
+ }) => /* @__PURE__ */ jsx2(
405
+ "div",
406
+ {
407
+ className: cn(
408
+ "au-flex au-flex-col-reverse sm:au-flex-row sm:au-justify-end sm:au-space-x-2",
409
+ className
410
+ ),
411
+ ...props
412
+ }
413
+ );
414
+ DialogFooter.displayName = "DialogFooter";
415
+ var DialogTitle2 = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
416
+ Title,
417
+ {
418
+ ref,
419
+ className: cn(
420
+ "au-text-lg au-font-semibold au-leading-none au-tracking-tight",
421
+ className
422
+ ),
423
+ ...props
424
+ }
425
+ ));
426
+ DialogTitle2.displayName = Title.displayName;
427
+ var DialogDescription2 = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
428
+ Description,
429
+ {
430
+ ref,
431
+ className: cn("au-text-sm au-text-muted-foreground", className),
432
+ ...props
433
+ }
434
+ ));
435
+ DialogDescription2.displayName = Description.displayName;
436
+
437
+ export {
438
+ Dialog2 as Dialog,
439
+ DialogTrigger2 as DialogTrigger,
440
+ DialogPortal2 as DialogPortal,
441
+ DialogClose2 as DialogClose,
442
+ DialogOverlay2 as DialogOverlay,
443
+ DialogContent2 as DialogContent,
444
+ DialogHeader,
445
+ DialogFooter,
446
+ DialogTitle2 as DialogTitle,
447
+ DialogDescription2 as DialogDescription
448
+ };
@@ -3,13 +3,7 @@
3
3
  import {
4
4
  AutumnError,
5
5
  toContainerResult
6
- } from "./chunk-GUZH4TKK.mjs";
7
- import {
8
- logAuthError
9
- } from "./chunk-JVCOY7ZL.mjs";
10
- import {
11
- logFetchError
12
- } from "./chunk-CIBQ4BJU.mjs";
6
+ } from "./chunk-3JORYFTY.mjs";
13
7
  import {
14
8
  listProductsMethod
15
9
  } from "./chunk-V575SGOW.mjs";
@@ -17,6 +11,12 @@ import {
17
11
  createCode,
18
12
  redeemCode
19
13
  } from "./chunk-ZV4RPZTM.mjs";
14
+ import {
15
+ logAuthError
16
+ } from "./chunk-JVCOY7ZL.mjs";
17
+ import {
18
+ logFetchError
19
+ } from "./chunk-CIBQ4BJU.mjs";
20
20
  import {
21
21
  getPricingTableMethod
22
22
  } from "./chunk-VTGR7VVK.mjs";
@@ -3,13 +3,13 @@
3
3
  import {
4
4
  handleCheck,
5
5
  openDialog
6
- } from "./chunk-RL47UQK4.mjs";
6
+ } from "./chunk-RGAEIODW.mjs";
7
7
  import {
8
8
  useAutumnBase
9
- } from "./chunk-HDMOJP3E.mjs";
9
+ } from "./chunk-4Q7BDIOS.mjs";
10
10
  import {
11
11
  useAutumnContext
12
- } from "./chunk-PRFT4OKG.mjs";
12
+ } from "./chunk-YEG5KJEI.mjs";
13
13
 
14
14
  // src/libraries/react/hooks/useEntityBase.tsx
15
15
  import useSWR from "swr";
@@ -0,0 +1,151 @@
1
+ "use client";
2
+
3
+ import {
4
+ useLayoutEffect2
5
+ } from "./chunk-7TYAAD2T.mjs";
6
+ import {
7
+ useComposedRefs
8
+ } from "./chunk-RPEGNKJH.mjs";
9
+
10
+ // ../node_modules/.pnpm/@radix-ui+react-presence@1.1.4_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19.1_2lguv7jzxii6s3eigxktbpwkji/node_modules/@radix-ui/react-presence/dist/index.mjs
11
+ import * as React2 from "react";
12
+ import * as React from "react";
13
+ function useStateMachine(initialState, machine) {
14
+ return React.useReducer((state, event) => {
15
+ const nextState = machine[state][event];
16
+ return nextState ?? state;
17
+ }, initialState);
18
+ }
19
+ var Presence = (props) => {
20
+ const { present, children } = props;
21
+ const presence = usePresence(present);
22
+ const child = typeof children === "function" ? children({ present: presence.isPresent }) : React2.Children.only(children);
23
+ const ref = useComposedRefs(presence.ref, getElementRef(child));
24
+ const forceMount = typeof children === "function";
25
+ return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;
26
+ };
27
+ Presence.displayName = "Presence";
28
+ function usePresence(present) {
29
+ const [node, setNode] = React2.useState();
30
+ const stylesRef = React2.useRef(null);
31
+ const prevPresentRef = React2.useRef(present);
32
+ const prevAnimationNameRef = React2.useRef("none");
33
+ const initialState = present ? "mounted" : "unmounted";
34
+ const [state, send] = useStateMachine(initialState, {
35
+ mounted: {
36
+ UNMOUNT: "unmounted",
37
+ ANIMATION_OUT: "unmountSuspended"
38
+ },
39
+ unmountSuspended: {
40
+ MOUNT: "mounted",
41
+ ANIMATION_END: "unmounted"
42
+ },
43
+ unmounted: {
44
+ MOUNT: "mounted"
45
+ }
46
+ });
47
+ React2.useEffect(() => {
48
+ const currentAnimationName = getAnimationName(stylesRef.current);
49
+ prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
50
+ }, [state]);
51
+ useLayoutEffect2(() => {
52
+ const styles = stylesRef.current;
53
+ const wasPresent = prevPresentRef.current;
54
+ const hasPresentChanged = wasPresent !== present;
55
+ if (hasPresentChanged) {
56
+ const prevAnimationName = prevAnimationNameRef.current;
57
+ const currentAnimationName = getAnimationName(styles);
58
+ if (present) {
59
+ send("MOUNT");
60
+ } else if (currentAnimationName === "none" || styles?.display === "none") {
61
+ send("UNMOUNT");
62
+ } else {
63
+ const isAnimating = prevAnimationName !== currentAnimationName;
64
+ if (wasPresent && isAnimating) {
65
+ send("ANIMATION_OUT");
66
+ } else {
67
+ send("UNMOUNT");
68
+ }
69
+ }
70
+ prevPresentRef.current = present;
71
+ }
72
+ }, [present, send]);
73
+ useLayoutEffect2(() => {
74
+ if (node) {
75
+ let timeoutId;
76
+ const ownerWindow = node.ownerDocument.defaultView ?? window;
77
+ const handleAnimationEnd = (event) => {
78
+ const currentAnimationName = getAnimationName(stylesRef.current);
79
+ const isCurrentAnimation = currentAnimationName.includes(event.animationName);
80
+ if (event.target === node && isCurrentAnimation) {
81
+ send("ANIMATION_END");
82
+ if (!prevPresentRef.current) {
83
+ const currentFillMode = node.style.animationFillMode;
84
+ node.style.animationFillMode = "forwards";
85
+ timeoutId = ownerWindow.setTimeout(() => {
86
+ if (node.style.animationFillMode === "forwards") {
87
+ node.style.animationFillMode = currentFillMode;
88
+ }
89
+ });
90
+ }
91
+ }
92
+ };
93
+ const handleAnimationStart = (event) => {
94
+ if (event.target === node) {
95
+ prevAnimationNameRef.current = getAnimationName(stylesRef.current);
96
+ }
97
+ };
98
+ node.addEventListener("animationstart", handleAnimationStart);
99
+ node.addEventListener("animationcancel", handleAnimationEnd);
100
+ node.addEventListener("animationend", handleAnimationEnd);
101
+ return () => {
102
+ ownerWindow.clearTimeout(timeoutId);
103
+ node.removeEventListener("animationstart", handleAnimationStart);
104
+ node.removeEventListener("animationcancel", handleAnimationEnd);
105
+ node.removeEventListener("animationend", handleAnimationEnd);
106
+ };
107
+ } else {
108
+ send("ANIMATION_END");
109
+ }
110
+ }, [node, send]);
111
+ return {
112
+ isPresent: ["mounted", "unmountSuspended"].includes(state),
113
+ ref: React2.useCallback((node2) => {
114
+ stylesRef.current = node2 ? getComputedStyle(node2) : null;
115
+ setNode(node2);
116
+ }, [])
117
+ };
118
+ }
119
+ function getAnimationName(styles) {
120
+ return styles?.animationName || "none";
121
+ }
122
+ function getElementRef(element) {
123
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
124
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
125
+ if (mayWarn) {
126
+ return element.ref;
127
+ }
128
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
129
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
130
+ if (mayWarn) {
131
+ return element.props.ref;
132
+ }
133
+ return element.props.ref || element.ref;
134
+ }
135
+
136
+ // ../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.mjs
137
+ import * as React3 from "react";
138
+ var useReactId = React3[" useId ".trim().toString()] || (() => void 0);
139
+ var count = 0;
140
+ function useId(deterministicId) {
141
+ const [id, setId] = React3.useState(useReactId());
142
+ useLayoutEffect2(() => {
143
+ if (!deterministicId) setId((reactId) => reactId ?? String(count++));
144
+ }, [deterministicId]);
145
+ return deterministicId || (id ? `radix-${id}` : "");
146
+ }
147
+
148
+ export {
149
+ Presence,
150
+ useId
151
+ };