tanstack_start_ts 1.0.0

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 (336) hide show
  1. package/.wrangler/deploy/config.json +1 -0
  2. package/bunfig.toml +6 -0
  3. package/components.json +22 -0
  4. package/config.json +0 -0
  5. package/dist/client/.assetsignore +2 -0
  6. package/dist/client/assets/ProductCard-DbIkJAE-.js +1 -0
  7. package/dist/client/assets/about-AskxOruL.js +1 -0
  8. package/dist/client/assets/admin-BZVcAQM3.js +1 -0
  9. package/dist/client/assets/admin.functions--RdVcuBx.js +1 -0
  10. package/dist/client/assets/admin.login-QgrF_9Fp.js +1 -0
  11. package/dist/client/assets/affiliate-disclosure-BIAsA-HO.js +1 -0
  12. package/dist/client/assets/categories-D0N418mK.js +1 -0
  13. package/dist/client/assets/category._slug-aCaQm14E.js +1 -0
  14. package/dist/client/assets/contact-PhvO-V15.js +1 -0
  15. package/dist/client/assets/faq-BsiHWPM8.js +1 -0
  16. package/dist/client/assets/hero-bg-BP2eVUIX.jpg +0 -0
  17. package/dist/client/assets/index-BU9rnkF3.js +1 -0
  18. package/dist/client/assets/index-BpJWZkva.js +1 -0
  19. package/dist/client/assets/index-vRX-zAyq.js +1 -0
  20. package/dist/client/assets/login-DteE0ZGp.js +1 -0
  21. package/dist/client/assets/logo-pSNfLJQk.png +0 -0
  22. package/dist/client/assets/privacy-B_Pu7040.js +1 -0
  23. package/dist/client/assets/product-links-BkZ41Gv3.js +1 -0
  24. package/dist/client/assets/product._id-BVUysCW-.js +1 -0
  25. package/dist/client/assets/products.functions-cGzRziKO.js +1 -0
  26. package/dist/client/assets/profile-CveRcKq2.js +1 -0
  27. package/dist/client/assets/reset-password-ySEjItX_.js +1 -0
  28. package/dist/client/assets/saved-CHtdQDJF.js +1 -0
  29. package/dist/client/assets/search-CXWfET1y.js +1 -0
  30. package/dist/client/assets/signup-CEx90iuV.js +1 -0
  31. package/dist/client/assets/styles-DrNJG0BO.css +1 -0
  32. package/dist/client/assets/terms-VqJ9kX9b.js +1 -0
  33. package/dist/client/assets/update-password-C-d0ix5e.js +1 -0
  34. package/dist/client/assets/vendor-aria-hidden-DvXkyWUv.js +1 -0
  35. package/dist/client/assets/vendor-class-variance-authority-5VPnzWs2.js +1 -0
  36. package/dist/client/assets/vendor-clsx-B-dksMZM.js +1 -0
  37. package/dist/client/assets/vendor-cookie-es-CS0aJGDi.js +1 -0
  38. package/dist/client/assets/vendor-detect-node-es-l0sNRNKZ.js +1 -0
  39. package/dist/client/assets/vendor-floating-ui-core-BlUy28sp.js +1 -0
  40. package/dist/client/assets/vendor-floating-ui-dom-BxK0hn2R.js +1 -0
  41. package/dist/client/assets/vendor-floating-ui-react-dom-Bas3975S.js +1 -0
  42. package/dist/client/assets/vendor-floating-ui-utils-BfYUAVcw.js +1 -0
  43. package/dist/client/assets/vendor-framer-motion-BMdL-cuX.js +9 -0
  44. package/dist/client/assets/vendor-get-nonce-C-Z93AgS.js +1 -0
  45. package/dist/client/assets/vendor-iceberg-js-tWD4K6Lg.js +1 -0
  46. package/dist/client/assets/vendor-lovable.dev-cloud-auth-js-VuzqtJVg.js +1 -0
  47. package/dist/client/assets/vendor-lucide-react-b5K2fehp.js +1 -0
  48. package/dist/client/assets/vendor-motion-dom-BETJamZt.js +1 -0
  49. package/dist/client/assets/vendor-motion-utils-BuWewJbj.js +1 -0
  50. package/dist/client/assets/vendor-radix-ui-primitive-Dc_FVRD7.js +1 -0
  51. package/dist/client/assets/vendor-radix-ui-react-accordion-C22Rgxe9.js +1 -0
  52. package/dist/client/assets/vendor-radix-ui-react-arrow-DMHj2mKI.js +1 -0
  53. package/dist/client/assets/vendor-radix-ui-react-avatar-CVPBkFXg.js +1 -0
  54. package/dist/client/assets/vendor-radix-ui-react-collapsible-BvM-4sKX.js +1 -0
  55. package/dist/client/assets/vendor-radix-ui-react-collection-D9KtqmHm.js +1 -0
  56. package/dist/client/assets/vendor-radix-ui-react-compose-refs-Cvq0AS8Z.js +1 -0
  57. package/dist/client/assets/vendor-radix-ui-react-context-CAqqn5Nx.js +1 -0
  58. package/dist/client/assets/vendor-radix-ui-react-dialog-DZ01vOLq.js +5 -0
  59. package/dist/client/assets/vendor-radix-ui-react-direction-DxZwNuei.js +1 -0
  60. package/dist/client/assets/vendor-radix-ui-react-dismissable-layer-Dqgrs55Y.js +1 -0
  61. package/dist/client/assets/vendor-radix-ui-react-dropdown-menu-0uzvrqkn.js +1 -0
  62. package/dist/client/assets/vendor-radix-ui-react-focus-guards-DgWoZ-fP.js +1 -0
  63. package/dist/client/assets/vendor-radix-ui-react-focus-scope-BLIu5QaL.js +1 -0
  64. package/dist/client/assets/vendor-radix-ui-react-id-bpga_rLa.js +1 -0
  65. package/dist/client/assets/vendor-radix-ui-react-menu-D0qf2r6_.js +1 -0
  66. package/dist/client/assets/vendor-radix-ui-react-popper-BafIylxU.js +1 -0
  67. package/dist/client/assets/vendor-radix-ui-react-portal-BnAsfNCS.js +1 -0
  68. package/dist/client/assets/vendor-radix-ui-react-presence-C-f3UKQ2.js +1 -0
  69. package/dist/client/assets/vendor-radix-ui-react-primitive-zTHwXNoz.js +1 -0
  70. package/dist/client/assets/vendor-radix-ui-react-roving-focus-jyJB8K2E.js +1 -0
  71. package/dist/client/assets/vendor-radix-ui-react-slot-6LXHJrHl.js +1 -0
  72. package/dist/client/assets/vendor-radix-ui-react-use-callback-ref-E91aPc6s.js +1 -0
  73. package/dist/client/assets/vendor-radix-ui-react-use-controllable-state-Ca3eMtxa.js +1 -0
  74. package/dist/client/assets/vendor-radix-ui-react-use-effect-event-CPeX4A3c.js +1 -0
  75. package/dist/client/assets/vendor-radix-ui-react-use-escape-keydown-7n3YsXFo.js +1 -0
  76. package/dist/client/assets/vendor-radix-ui-react-use-is-hydrated-C1PY1qNv.js +1 -0
  77. package/dist/client/assets/vendor-radix-ui-react-use-layout-effect-B3AcGWPy.js +1 -0
  78. package/dist/client/assets/vendor-radix-ui-react-use-size-CXS04sct.js +1 -0
  79. package/dist/client/assets/vendor-react-dom-BnNs-kzm.js +9 -0
  80. package/dist/client/assets/vendor-react-gJPiVnX5.js +1 -0
  81. package/dist/client/assets/vendor-react-remove-scroll-DHKl-IMP.js +4 -0
  82. package/dist/client/assets/vendor-react-remove-scroll-bar-CSjdInc2.js +38 -0
  83. package/dist/client/assets/vendor-react-style-singleton-BqHpkgXn.js +1 -0
  84. package/dist/client/assets/vendor-scheduler-7OC5HNn7.js +1 -0
  85. package/dist/client/assets/vendor-seroval-B_Fur-nl.js +3 -0
  86. package/dist/client/assets/vendor-seroval-plugins-CBHnPkZJ.js +1 -0
  87. package/dist/client/assets/vendor-sonner-71-LdGG1.js +1 -0
  88. package/dist/client/assets/vendor-supabase-auth-js-DWrN-bIx.js +18 -0
  89. package/dist/client/assets/vendor-supabase-functions-js-uY_V-TxC.js +1 -0
  90. package/dist/client/assets/vendor-supabase-phoenix-BzEf37Ve.js +2 -0
  91. package/dist/client/assets/vendor-supabase-postgrest-js-C4rBWbCx.js +4 -0
  92. package/dist/client/assets/vendor-supabase-realtime-js-D6BlOYKE.js +23 -0
  93. package/dist/client/assets/vendor-supabase-storage-js-BG98L3Zz.js +1 -0
  94. package/dist/client/assets/vendor-supabase-supabase-js-DCCzdwBJ.js +1 -0
  95. package/dist/client/assets/vendor-tailwind-merge-Ct12j0u0.js +1 -0
  96. package/dist/client/assets/vendor-tanstack-history-C617CaxG.js +1 -0
  97. package/dist/client/assets/vendor-tanstack-query-core-7wuJJ5ZL.js +1 -0
  98. package/dist/client/assets/vendor-tanstack-react-query-HImzo8sX.js +1 -0
  99. package/dist/client/assets/vendor-tanstack-react-router-sIZLK-LU.js +1 -0
  100. package/dist/client/assets/vendor-tanstack-react-start-client-GiYCfWmf.js +1 -0
  101. package/dist/client/assets/vendor-tanstack-react-store-EvTi3ahh.js +1 -0
  102. package/dist/client/assets/vendor-tanstack-router-core-Cr7bYUZv.js +1 -0
  103. package/dist/client/assets/vendor-tanstack-start-client-core-C-00BBOu.js +2 -0
  104. package/dist/client/assets/vendor-tanstack-start-fn-stubs-l0sNRNKZ.js +1 -0
  105. package/dist/client/assets/vendor-tanstack-store-BC7mA7pq.js +1 -0
  106. package/dist/client/assets/vendor-tslib-Du-meQkk.js +1 -0
  107. package/dist/client/assets/vendor-use-callback-ref-C_fIAtot.js +1 -0
  108. package/dist/client/assets/vendor-use-sidecar-Bh0DDN6h.js +1 -0
  109. package/dist/client/assets/vendor-use-sync-external-store-ZvKHXaIn.js +1 -0
  110. package/dist/client/assets/vendor-vercel-analytics-DwPM5BWs.js +1 -0
  111. package/dist/client/assets/vendor-zod-By9teAtI.js +1 -0
  112. package/dist/client/robots.txt +2 -0
  113. package/dist/server/.dev.vars +5 -0
  114. package/dist/server/.vite/manifest.json +2528 -0
  115. package/dist/server/assets/ProductCard-CUPXy5Eo.js +149 -0
  116. package/dist/server/assets/_tanstack-start-manifest_v-do7vTWFD.js +4 -0
  117. package/dist/server/assets/about-TfKQw0Ga.js +28 -0
  118. package/dist/server/assets/admin-DspfJOJk.js +578 -0
  119. package/dist/server/assets/admin.functions-B78ppWLR.js +645 -0
  120. package/dist/server/assets/admin.functions-BWlKBoTL.js +93 -0
  121. package/dist/server/assets/admin.login-CV7QfeA6.js +139 -0
  122. package/dist/server/assets/affiliate-disclosure-B1wI1cDb.js +86 -0
  123. package/dist/server/assets/auth-middleware-Cn49MidW.js +62 -0
  124. package/dist/server/assets/categories-Z7jnAYZP.js +108 -0
  125. package/dist/server/assets/category._slug-D0XY3FGK.js +112 -0
  126. package/dist/server/assets/contact-IzyONsXs.js +104 -0
  127. package/dist/server/assets/faq-aRhB_CR3.js +133 -0
  128. package/dist/server/assets/hero-bg-BP2eVUIX.jpg +0 -0
  129. package/dist/server/assets/index-BTPHbXw9.js +221 -0
  130. package/dist/server/assets/index-ByJkHkrU.js +30 -0
  131. package/dist/server/assets/login-Dvy5Dm0f.js +175 -0
  132. package/dist/server/assets/logo-pSNfLJQk.png +0 -0
  133. package/dist/server/assets/privacy-B6Wiez1P.js +93 -0
  134. package/dist/server/assets/product-links-CGYEPP56.js +16 -0
  135. package/dist/server/assets/product._id-BpRa-1z0.js +231 -0
  136. package/dist/server/assets/products.functions-DSlmibYN.js +209 -0
  137. package/dist/server/assets/products.functions-DlHkRiqi.js +24 -0
  138. package/dist/server/assets/profile-B0NWzVAZ.js +314 -0
  139. package/dist/server/assets/reset-password-CY-rmqMr.js +115 -0
  140. package/dist/server/assets/saved-7FA6Dbom.js +126 -0
  141. package/dist/server/assets/search-Yw5c_fZa.js +329 -0
  142. package/dist/server/assets/signup-UPzgZo4i.js +143 -0
  143. package/dist/server/assets/styles-DrNJG0BO.css +1 -0
  144. package/dist/server/assets/terms-CMnX95bP.js +89 -0
  145. package/dist/server/assets/update-password-Cr94ea8n.js +131 -0
  146. package/dist/server/assets/vendor-aria-hidden-DPa16MWu.js +122 -0
  147. package/dist/server/assets/vendor-class-variance-authority-0YxJPB9Y.js +44 -0
  148. package/dist/server/assets/vendor-cloudflare-unenv-preset-ya0VEFBz.js +250 -0
  149. package/dist/server/assets/vendor-clsx-DgYk2OaC.js +16 -0
  150. package/dist/server/assets/vendor-cookie-es-DAoofYiI.js +44 -0
  151. package/dist/server/assets/vendor-detect-node-es-l0sNRNKZ.js +1 -0
  152. package/dist/server/assets/vendor-floating-ui-core-3tkK0THV.js +726 -0
  153. package/dist/server/assets/vendor-floating-ui-dom-C-cPtgJv.js +626 -0
  154. package/dist/server/assets/vendor-floating-ui-react-dom-CRG6gBpH.js +319 -0
  155. package/dist/server/assets/vendor-floating-ui-utils-DmXANH-E.js +320 -0
  156. package/dist/server/assets/vendor-framer-motion-X4zAkX3J.js +1979 -0
  157. package/dist/server/assets/vendor-get-nonce-DiSj3EHl.js +9 -0
  158. package/dist/server/assets/vendor-h3-v2-CCobnLY5.js +287 -0
  159. package/dist/server/assets/vendor-iceberg-js-bHCkXyJn.js +534 -0
  160. package/dist/server/assets/vendor-isbot-CZ7WjwVs.js +21 -0
  161. package/dist/server/assets/vendor-lovable.dev-cloud-auth-js-BE03njZw.js +180 -0
  162. package/dist/server/assets/vendor-lucide-react-Ddew6HYb.js +458 -0
  163. package/dist/server/assets/vendor-motion-dom-D2MTwGIG.js +5983 -0
  164. package/dist/server/assets/vendor-motion-utils-LJlIFN6m.js +161 -0
  165. package/dist/server/assets/vendor-radix-ui-primitive-B-mNdDrH.js +11 -0
  166. package/dist/server/assets/vendor-radix-ui-react-accordion-1Izf6x00.js +308 -0
  167. package/dist/server/assets/vendor-radix-ui-react-arrow-B882lnFK.js +23 -0
  168. package/dist/server/assets/vendor-radix-ui-react-avatar-BVgZt2Ab.js +209 -0
  169. package/dist/server/assets/vendor-radix-ui-react-collapsible-DCBbMZiS.js +147 -0
  170. package/dist/server/assets/vendor-radix-ui-react-collection-BZ2srfgU.js +150 -0
  171. package/dist/server/assets/vendor-radix-ui-react-compose-refs-D3qsKVk1.js +39 -0
  172. package/dist/server/assets/vendor-radix-ui-react-context-BVoNDLue.js +78 -0
  173. package/dist/server/assets/vendor-radix-ui-react-dialog-DlxMaNYK.js +406 -0
  174. package/dist/server/assets/vendor-radix-ui-react-direction-Dt_WDL1t.js +9 -0
  175. package/dist/server/assets/vendor-radix-ui-react-dismissable-layer-CjsuPohV.js +210 -0
  176. package/dist/server/assets/vendor-radix-ui-react-dropdown-menu-DVxKumY8.js +263 -0
  177. package/dist/server/assets/vendor-radix-ui-react-focus-guards-D_6NoePE.js +29 -0
  178. package/dist/server/assets/vendor-radix-ui-react-focus-scope-DEIhTJJH.js +206 -0
  179. package/dist/server/assets/vendor-radix-ui-react-id-DFFpgh6m.js +14 -0
  180. package/dist/server/assets/vendor-radix-ui-react-menu-CiTMLwjT.js +893 -0
  181. package/dist/server/assets/vendor-radix-ui-react-popper-23Ye2Vyc.js +286 -0
  182. package/dist/server/assets/vendor-radix-ui-react-portal-CZCH5uPk.js +16 -0
  183. package/dist/server/assets/vendor-radix-ui-react-presence-CaAULlDU.js +128 -0
  184. package/dist/server/assets/vendor-radix-ui-react-primitive-BeOk3UYa.js +124 -0
  185. package/dist/server/assets/vendor-radix-ui-react-roving-focus-DES9GR8l.js +224 -0
  186. package/dist/server/assets/vendor-radix-ui-react-slot-DUhZbzoH.js +103 -0
  187. package/dist/server/assets/vendor-radix-ui-react-use-callback-ref-BynBgohw.js +11 -0
  188. package/dist/server/assets/vendor-radix-ui-react-use-controllable-state-C9KpT6DG.js +69 -0
  189. package/dist/server/assets/vendor-radix-ui-react-use-effect-event-gpNY2xjS.js +1 -0
  190. package/dist/server/assets/vendor-radix-ui-react-use-escape-keydown-CcYRQ2pp.js +17 -0
  191. package/dist/server/assets/vendor-radix-ui-react-use-is-hydrated-D_LcBPXY.js +15 -0
  192. package/dist/server/assets/vendor-radix-ui-react-use-layout-effect-1LNLXAjr.js +6 -0
  193. package/dist/server/assets/vendor-radix-ui-react-use-size-D6fiKJQo.js +39 -0
  194. package/dist/server/assets/vendor-react-DvBrY0qp.js +511 -0
  195. package/dist/server/assets/vendor-react-dom-yvMLPM0j.js +10484 -0
  196. package/dist/server/assets/vendor-react-remove-scroll-BNtiEvVN.js +328 -0
  197. package/dist/server/assets/vendor-react-remove-scroll-bar-hLqRASRk.js +82 -0
  198. package/dist/server/assets/vendor-react-style-singleton-BXjcXskB.js +69 -0
  199. package/dist/server/assets/vendor-rou3-3NaGPdI8.js +8 -0
  200. package/dist/server/assets/vendor-seroval-dJyC-Zhz.js +1775 -0
  201. package/dist/server/assets/vendor-seroval-plugins-Pq_U2meB.js +58 -0
  202. package/dist/server/assets/vendor-sonner-CqbjhsRh.js +1086 -0
  203. package/dist/server/assets/vendor-srvx-BA-baEX9.js +6 -0
  204. package/dist/server/assets/vendor-supabase-auth-js-D4xjVprw.js +7602 -0
  205. package/dist/server/assets/vendor-supabase-functions-js-sWy4UYn1.js +322 -0
  206. package/dist/server/assets/vendor-supabase-phoenix-Bw3Uh2Nn.js +1777 -0
  207. package/dist/server/assets/vendor-supabase-postgrest-js-AO-BXa7I.js +4938 -0
  208. package/dist/server/assets/vendor-supabase-realtime-js-BtdNgJbm.js +2111 -0
  209. package/dist/server/assets/vendor-supabase-storage-js-Dk_MrPYO.js +2679 -0
  210. package/dist/server/assets/vendor-supabase-supabase-js-D1EEtG3j.js +697 -0
  211. package/dist/server/assets/vendor-tailwind-merge-BHb_obmC.js +3255 -0
  212. package/dist/server/assets/vendor-tanstack-history-C4pKJmkt.js +204 -0
  213. package/dist/server/assets/vendor-tanstack-query-core-PwwTR5ld.js +2552 -0
  214. package/dist/server/assets/vendor-tanstack-react-query-hhHzXAK1.js +190 -0
  215. package/dist/server/assets/vendor-tanstack-react-router-XzqpA65A.js +1120 -0
  216. package/dist/server/assets/vendor-tanstack-react-start-RvWUpvat.js +37 -0
  217. package/dist/server/assets/vendor-tanstack-react-start-client-gpNY2xjS.js +1 -0
  218. package/dist/server/assets/vendor-tanstack-react-start-server-uj_Y9pEN.js +15 -0
  219. package/dist/server/assets/vendor-tanstack-react-store-gpNY2xjS.js +1 -0
  220. package/dist/server/assets/vendor-tanstack-router-core-6wywV3KN.js +4252 -0
  221. package/dist/server/assets/vendor-tanstack-start-client-core-DoOKV2pA.js +1741 -0
  222. package/dist/server/assets/vendor-tanstack-start-fn-stubs-l0sNRNKZ.js +1 -0
  223. package/dist/server/assets/vendor-tanstack-start-server-core-CsAstXv7.js +1421 -0
  224. package/dist/server/assets/vendor-tanstack-start-storage-context-DgH9hIJT.js +17 -0
  225. package/dist/server/assets/vendor-tanstack-store-l0sNRNKZ.js +1 -0
  226. package/dist/server/assets/vendor-tslib-_8ICaZ64.js +67 -0
  227. package/dist/server/assets/vendor-unenv-DUvF4YIF.js +544 -0
  228. package/dist/server/assets/vendor-use-callback-ref-DMFDRvmi.js +66 -0
  229. package/dist/server/assets/vendor-use-sidecar-DG1tHua4.js +106 -0
  230. package/dist/server/assets/vendor-use-sync-external-store-rZ8vi0It.js +64 -0
  231. package/dist/server/assets/vendor-vercel-analytics-oP8BDp0L.js +168 -0
  232. package/dist/server/assets/vendor-zod-BRyQdbC-.js +3580 -0
  233. package/dist/server/index.js +158 -0
  234. package/dist/server/wrangler.json +1 -0
  235. package/enable-powershell.ps1 +7 -0
  236. package/eslint.config.js +41 -0
  237. package/lint.bat +4 -0
  238. package/package.json +95 -0
  239. package/public/robots.txt +2 -0
  240. package/run-npm-build.cjs +20 -0
  241. package/run-npm-build.js +20 -0
  242. package/src/assets/hero-bg.jpg +0 -0
  243. package/src/assets/logo.png +0 -0
  244. package/src/components/scrollsy/Footer.tsx +68 -0
  245. package/src/components/scrollsy/LiveTicker.tsx +31 -0
  246. package/src/components/scrollsy/Logo.tsx +28 -0
  247. package/src/components/scrollsy/Nav.tsx +255 -0
  248. package/src/components/scrollsy/ProductCard.tsx +190 -0
  249. package/src/components/scrollsy/ProductFilters.tsx +226 -0
  250. package/src/components/scrollsy/SupportWidget.tsx +197 -0
  251. package/src/components/ui/accordion.tsx +51 -0
  252. package/src/components/ui/alert-dialog.tsx +115 -0
  253. package/src/components/ui/alert.tsx +49 -0
  254. package/src/components/ui/aspect-ratio.tsx +5 -0
  255. package/src/components/ui/avatar.tsx +47 -0
  256. package/src/components/ui/badge.tsx +32 -0
  257. package/src/components/ui/breadcrumb.tsx +101 -0
  258. package/src/components/ui/button.tsx +49 -0
  259. package/src/components/ui/calendar.tsx +177 -0
  260. package/src/components/ui/card.tsx +55 -0
  261. package/src/components/ui/carousel.tsx +240 -0
  262. package/src/components/ui/chart.tsx +331 -0
  263. package/src/components/ui/checkbox.tsx +26 -0
  264. package/src/components/ui/collapsible.tsx +11 -0
  265. package/src/components/ui/command.tsx +143 -0
  266. package/src/components/ui/context-menu.tsx +187 -0
  267. package/src/components/ui/dialog.tsx +104 -0
  268. package/src/components/ui/drawer.tsx +98 -0
  269. package/src/components/ui/dropdown-menu.tsx +188 -0
  270. package/src/components/ui/form.tsx +171 -0
  271. package/src/components/ui/hover-card.tsx +27 -0
  272. package/src/components/ui/input-otp.tsx +69 -0
  273. package/src/components/ui/input.tsx +22 -0
  274. package/src/components/ui/label.tsx +21 -0
  275. package/src/components/ui/menubar.tsx +229 -0
  276. package/src/components/ui/navigation-menu.tsx +120 -0
  277. package/src/components/ui/pagination.tsx +98 -0
  278. package/src/components/ui/popover.tsx +31 -0
  279. package/src/components/ui/progress.tsx +25 -0
  280. package/src/components/ui/radio-group.tsx +36 -0
  281. package/src/components/ui/resizable.tsx +37 -0
  282. package/src/components/ui/scroll-area.tsx +44 -0
  283. package/src/components/ui/select.tsx +152 -0
  284. package/src/components/ui/separator.tsx +24 -0
  285. package/src/components/ui/sheet.tsx +122 -0
  286. package/src/components/ui/sidebar.tsx +744 -0
  287. package/src/components/ui/skeleton.tsx +7 -0
  288. package/src/components/ui/slider.tsx +23 -0
  289. package/src/components/ui/sonner.tsx +23 -0
  290. package/src/components/ui/switch.tsx +27 -0
  291. package/src/components/ui/table.tsx +94 -0
  292. package/src/components/ui/tabs.tsx +53 -0
  293. package/src/components/ui/textarea.tsx +21 -0
  294. package/src/components/ui/toggle-group.tsx +57 -0
  295. package/src/components/ui/toggle.tsx +42 -0
  296. package/src/components/ui/tooltip.tsx +32 -0
  297. package/src/hooks/use-auth.ts +26 -0
  298. package/src/hooks/use-mobile.tsx +19 -0
  299. package/src/integrations/lovable/index.ts +41 -0
  300. package/src/lib/admin.functions.ts +564 -0
  301. package/src/lib/error-capture.ts +27 -0
  302. package/src/lib/error-page.ts +30 -0
  303. package/src/lib/product-links.ts +39 -0
  304. package/src/lib/products.functions.ts +101 -0
  305. package/src/lib/utils.ts +6 -0
  306. package/src/routeTree.gen.ts +480 -0
  307. package/src/router.tsx +16 -0
  308. package/src/routes/__root.tsx +177 -0
  309. package/src/routes/about.tsx +66 -0
  310. package/src/routes/admin.login.tsx +95 -0
  311. package/src/routes/admin.tsx +811 -0
  312. package/src/routes/affiliate-disclosure.tsx +35 -0
  313. package/src/routes/categories.tsx +57 -0
  314. package/src/routes/category.$slug.tsx +51 -0
  315. package/src/routes/contact.tsx +69 -0
  316. package/src/routes/faq.tsx +63 -0
  317. package/src/routes/index.tsx +269 -0
  318. package/src/routes/login.tsx +160 -0
  319. package/src/routes/privacy.tsx +39 -0
  320. package/src/routes/product.$id.tsx +212 -0
  321. package/src/routes/profile.tsx +393 -0
  322. package/src/routes/reset-password.tsx +71 -0
  323. package/src/routes/saved.tsx +83 -0
  324. package/src/routes/search.tsx +136 -0
  325. package/src/routes/signup.tsx +108 -0
  326. package/src/routes/sitemap[.]xml.ts +34 -0
  327. package/src/routes/terms.tsx +40 -0
  328. package/src/routes/update-password.tsx +91 -0
  329. package/src/server.ts +80 -0
  330. package/src/start.ts +24 -0
  331. package/src/styles.css +333 -0
  332. package/terminal-test-output.txt +1 -0
  333. package/tsconfig.json +27 -0
  334. package/vercel.json +26 -0
  335. package/vite.config.ts +38 -0
  336. package/wrangler.jsonc +7 -0
@@ -0,0 +1,1086 @@
1
+ import { R as React } from "./vendor-react-DvBrY0qp.js";
2
+ import { R as ReactDOM } from "./vendor-react-dom-yvMLPM0j.js";
3
+ function __insertCSS(code) {
4
+ if (typeof document == "undefined") return;
5
+ let head = document.head || document.getElementsByTagName("head")[0];
6
+ let style = document.createElement("style");
7
+ style.type = "text/css";
8
+ head.appendChild(style);
9
+ style.styleSheet ? style.styleSheet.cssText = code : style.appendChild(document.createTextNode(code));
10
+ }
11
+ const getAsset = (type) => {
12
+ switch (type) {
13
+ case "success":
14
+ return SuccessIcon;
15
+ case "info":
16
+ return InfoIcon;
17
+ case "warning":
18
+ return WarningIcon;
19
+ case "error":
20
+ return ErrorIcon;
21
+ default:
22
+ return null;
23
+ }
24
+ };
25
+ const bars = Array(12).fill(0);
26
+ const Loader = ({ visible, className }) => {
27
+ return /* @__PURE__ */ React.createElement("div", {
28
+ className: [
29
+ "sonner-loading-wrapper",
30
+ className
31
+ ].filter(Boolean).join(" "),
32
+ "data-visible": visible
33
+ }, /* @__PURE__ */ React.createElement("div", {
34
+ className: "sonner-spinner"
35
+ }, bars.map((_, i) => /* @__PURE__ */ React.createElement("div", {
36
+ className: "sonner-loading-bar",
37
+ key: `spinner-bar-${i}`
38
+ }))));
39
+ };
40
+ const SuccessIcon = /* @__PURE__ */ React.createElement("svg", {
41
+ xmlns: "http://www.w3.org/2000/svg",
42
+ viewBox: "0 0 20 20",
43
+ fill: "currentColor",
44
+ height: "20",
45
+ width: "20"
46
+ }, /* @__PURE__ */ React.createElement("path", {
47
+ fillRule: "evenodd",
48
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
49
+ clipRule: "evenodd"
50
+ }));
51
+ const WarningIcon = /* @__PURE__ */ React.createElement("svg", {
52
+ xmlns: "http://www.w3.org/2000/svg",
53
+ viewBox: "0 0 24 24",
54
+ fill: "currentColor",
55
+ height: "20",
56
+ width: "20"
57
+ }, /* @__PURE__ */ React.createElement("path", {
58
+ fillRule: "evenodd",
59
+ d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
60
+ clipRule: "evenodd"
61
+ }));
62
+ const InfoIcon = /* @__PURE__ */ React.createElement("svg", {
63
+ xmlns: "http://www.w3.org/2000/svg",
64
+ viewBox: "0 0 20 20",
65
+ fill: "currentColor",
66
+ height: "20",
67
+ width: "20"
68
+ }, /* @__PURE__ */ React.createElement("path", {
69
+ fillRule: "evenodd",
70
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
71
+ clipRule: "evenodd"
72
+ }));
73
+ const ErrorIcon = /* @__PURE__ */ React.createElement("svg", {
74
+ xmlns: "http://www.w3.org/2000/svg",
75
+ viewBox: "0 0 20 20",
76
+ fill: "currentColor",
77
+ height: "20",
78
+ width: "20"
79
+ }, /* @__PURE__ */ React.createElement("path", {
80
+ fillRule: "evenodd",
81
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
82
+ clipRule: "evenodd"
83
+ }));
84
+ const CloseIcon = /* @__PURE__ */ React.createElement("svg", {
85
+ xmlns: "http://www.w3.org/2000/svg",
86
+ width: "12",
87
+ height: "12",
88
+ viewBox: "0 0 24 24",
89
+ fill: "none",
90
+ stroke: "currentColor",
91
+ strokeWidth: "1.5",
92
+ strokeLinecap: "round",
93
+ strokeLinejoin: "round"
94
+ }, /* @__PURE__ */ React.createElement("line", {
95
+ x1: "18",
96
+ y1: "6",
97
+ x2: "6",
98
+ y2: "18"
99
+ }), /* @__PURE__ */ React.createElement("line", {
100
+ x1: "6",
101
+ y1: "6",
102
+ x2: "18",
103
+ y2: "18"
104
+ }));
105
+ const useIsDocumentHidden = () => {
106
+ const [isDocumentHidden, setIsDocumentHidden] = React.useState(document.hidden);
107
+ React.useEffect(() => {
108
+ const callback = () => {
109
+ setIsDocumentHidden(document.hidden);
110
+ };
111
+ document.addEventListener("visibilitychange", callback);
112
+ return () => window.removeEventListener("visibilitychange", callback);
113
+ }, []);
114
+ return isDocumentHidden;
115
+ };
116
+ let toastsCounter = 1;
117
+ class Observer {
118
+ constructor() {
119
+ this.subscribe = (subscriber) => {
120
+ this.subscribers.push(subscriber);
121
+ return () => {
122
+ const index = this.subscribers.indexOf(subscriber);
123
+ this.subscribers.splice(index, 1);
124
+ };
125
+ };
126
+ this.publish = (data) => {
127
+ this.subscribers.forEach((subscriber) => subscriber(data));
128
+ };
129
+ this.addToast = (data) => {
130
+ this.publish(data);
131
+ this.toasts = [
132
+ ...this.toasts,
133
+ data
134
+ ];
135
+ };
136
+ this.create = (data) => {
137
+ var _data_id;
138
+ const { message, ...rest } = data;
139
+ const id = typeof (data == null ? void 0 : data.id) === "number" || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
140
+ const alreadyExists = this.toasts.find((toast2) => {
141
+ return toast2.id === id;
142
+ });
143
+ const dismissible = data.dismissible === void 0 ? true : data.dismissible;
144
+ if (this.dismissedToasts.has(id)) {
145
+ this.dismissedToasts.delete(id);
146
+ }
147
+ if (alreadyExists) {
148
+ this.toasts = this.toasts.map((toast2) => {
149
+ if (toast2.id === id) {
150
+ this.publish({
151
+ ...toast2,
152
+ ...data,
153
+ id,
154
+ title: message
155
+ });
156
+ return {
157
+ ...toast2,
158
+ ...data,
159
+ id,
160
+ dismissible,
161
+ title: message
162
+ };
163
+ }
164
+ return toast2;
165
+ });
166
+ } else {
167
+ this.addToast({
168
+ title: message,
169
+ ...rest,
170
+ dismissible,
171
+ id
172
+ });
173
+ }
174
+ return id;
175
+ };
176
+ this.dismiss = (id) => {
177
+ if (id) {
178
+ this.dismissedToasts.add(id);
179
+ requestAnimationFrame(() => this.subscribers.forEach((subscriber) => subscriber({
180
+ id,
181
+ dismiss: true
182
+ })));
183
+ } else {
184
+ this.toasts.forEach((toast2) => {
185
+ this.subscribers.forEach((subscriber) => subscriber({
186
+ id: toast2.id,
187
+ dismiss: true
188
+ }));
189
+ });
190
+ }
191
+ return id;
192
+ };
193
+ this.message = (message, data) => {
194
+ return this.create({
195
+ ...data,
196
+ message
197
+ });
198
+ };
199
+ this.error = (message, data) => {
200
+ return this.create({
201
+ ...data,
202
+ message,
203
+ type: "error"
204
+ });
205
+ };
206
+ this.success = (message, data) => {
207
+ return this.create({
208
+ ...data,
209
+ type: "success",
210
+ message
211
+ });
212
+ };
213
+ this.info = (message, data) => {
214
+ return this.create({
215
+ ...data,
216
+ type: "info",
217
+ message
218
+ });
219
+ };
220
+ this.warning = (message, data) => {
221
+ return this.create({
222
+ ...data,
223
+ type: "warning",
224
+ message
225
+ });
226
+ };
227
+ this.loading = (message, data) => {
228
+ return this.create({
229
+ ...data,
230
+ type: "loading",
231
+ message
232
+ });
233
+ };
234
+ this.promise = (promise, data) => {
235
+ if (!data) {
236
+ return;
237
+ }
238
+ let id = void 0;
239
+ if (data.loading !== void 0) {
240
+ id = this.create({
241
+ ...data,
242
+ promise,
243
+ type: "loading",
244
+ message: data.loading,
245
+ description: typeof data.description !== "function" ? data.description : void 0
246
+ });
247
+ }
248
+ const p = Promise.resolve(promise instanceof Function ? promise() : promise);
249
+ let shouldDismiss = id !== void 0;
250
+ let result;
251
+ const originalPromise = p.then(async (response) => {
252
+ result = [
253
+ "resolve",
254
+ response
255
+ ];
256
+ const isReactElementResponse = React.isValidElement(response);
257
+ if (isReactElementResponse) {
258
+ shouldDismiss = false;
259
+ this.create({
260
+ id,
261
+ type: "default",
262
+ message: response
263
+ });
264
+ } else if (isHttpResponse(response) && !response.ok) {
265
+ shouldDismiss = false;
266
+ const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
267
+ const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
268
+ const isExtendedResult = typeof promiseData === "object" && !React.isValidElement(promiseData);
269
+ const toastSettings = isExtendedResult ? promiseData : {
270
+ message: promiseData
271
+ };
272
+ this.create({
273
+ id,
274
+ type: "error",
275
+ description,
276
+ ...toastSettings
277
+ });
278
+ } else if (response instanceof Error) {
279
+ shouldDismiss = false;
280
+ const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
281
+ const description = typeof data.description === "function" ? await data.description(response) : data.description;
282
+ const isExtendedResult = typeof promiseData === "object" && !React.isValidElement(promiseData);
283
+ const toastSettings = isExtendedResult ? promiseData : {
284
+ message: promiseData
285
+ };
286
+ this.create({
287
+ id,
288
+ type: "error",
289
+ description,
290
+ ...toastSettings
291
+ });
292
+ } else if (data.success !== void 0) {
293
+ shouldDismiss = false;
294
+ const promiseData = typeof data.success === "function" ? await data.success(response) : data.success;
295
+ const description = typeof data.description === "function" ? await data.description(response) : data.description;
296
+ const isExtendedResult = typeof promiseData === "object" && !React.isValidElement(promiseData);
297
+ const toastSettings = isExtendedResult ? promiseData : {
298
+ message: promiseData
299
+ };
300
+ this.create({
301
+ id,
302
+ type: "success",
303
+ description,
304
+ ...toastSettings
305
+ });
306
+ }
307
+ }).catch(async (error) => {
308
+ result = [
309
+ "reject",
310
+ error
311
+ ];
312
+ if (data.error !== void 0) {
313
+ shouldDismiss = false;
314
+ const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
315
+ const description = typeof data.description === "function" ? await data.description(error) : data.description;
316
+ const isExtendedResult = typeof promiseData === "object" && !React.isValidElement(promiseData);
317
+ const toastSettings = isExtendedResult ? promiseData : {
318
+ message: promiseData
319
+ };
320
+ this.create({
321
+ id,
322
+ type: "error",
323
+ description,
324
+ ...toastSettings
325
+ });
326
+ }
327
+ }).finally(() => {
328
+ if (shouldDismiss) {
329
+ this.dismiss(id);
330
+ id = void 0;
331
+ }
332
+ data.finally == null ? void 0 : data.finally.call(data);
333
+ });
334
+ const unwrap = () => new Promise((resolve, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve(result[1])).catch(reject));
335
+ if (typeof id !== "string" && typeof id !== "number") {
336
+ return {
337
+ unwrap
338
+ };
339
+ } else {
340
+ return Object.assign(id, {
341
+ unwrap
342
+ });
343
+ }
344
+ };
345
+ this.custom = (jsx, data) => {
346
+ const id = (data == null ? void 0 : data.id) || toastsCounter++;
347
+ this.create({
348
+ jsx: jsx(id),
349
+ id,
350
+ ...data
351
+ });
352
+ return id;
353
+ };
354
+ this.getActiveToasts = () => {
355
+ return this.toasts.filter((toast2) => !this.dismissedToasts.has(toast2.id));
356
+ };
357
+ this.subscribers = [];
358
+ this.toasts = [];
359
+ this.dismissedToasts = /* @__PURE__ */ new Set();
360
+ }
361
+ }
362
+ const ToastState = new Observer();
363
+ const toastFunction = (message, data) => {
364
+ const id = (data == null ? void 0 : data.id) || toastsCounter++;
365
+ ToastState.addToast({
366
+ title: message,
367
+ ...data,
368
+ id
369
+ });
370
+ return id;
371
+ };
372
+ const isHttpResponse = (data) => {
373
+ return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
374
+ };
375
+ const basicToast = toastFunction;
376
+ const getHistory = () => ToastState.toasts;
377
+ const getToasts = () => ToastState.getActiveToasts();
378
+ const toast = Object.assign(basicToast, {
379
+ success: ToastState.success,
380
+ info: ToastState.info,
381
+ warning: ToastState.warning,
382
+ error: ToastState.error,
383
+ custom: ToastState.custom,
384
+ message: ToastState.message,
385
+ promise: ToastState.promise,
386
+ dismiss: ToastState.dismiss,
387
+ loading: ToastState.loading
388
+ }, {
389
+ getHistory,
390
+ getToasts
391
+ });
392
+ __insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
393
+ function isAction(action) {
394
+ return action.label !== void 0;
395
+ }
396
+ const VISIBLE_TOASTS_AMOUNT = 3;
397
+ const VIEWPORT_OFFSET = "24px";
398
+ const MOBILE_VIEWPORT_OFFSET = "16px";
399
+ const TOAST_LIFETIME = 4e3;
400
+ const TOAST_WIDTH = 356;
401
+ const GAP = 14;
402
+ const SWIPE_THRESHOLD = 45;
403
+ const TIME_BEFORE_UNMOUNT = 200;
404
+ function cn(...classes) {
405
+ return classes.filter(Boolean).join(" ");
406
+ }
407
+ function getDefaultSwipeDirections(position) {
408
+ const [y, x] = position.split("-");
409
+ const directions = [];
410
+ if (y) {
411
+ directions.push(y);
412
+ }
413
+ if (x) {
414
+ directions.push(x);
415
+ }
416
+ return directions;
417
+ }
418
+ const Toast = (props) => {
419
+ var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
420
+ const { invert: ToasterInvert, toast: toast2, unstyled, interacting, setHeights, visibleToasts, heights, index, toasts, expanded, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style, cancelButtonStyle, actionButtonStyle, className = "", descriptionClassName = "", duration: durationFromToaster, position, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = "Close toast" } = props;
421
+ const [swipeDirection, setSwipeDirection] = React.useState(null);
422
+ const [swipeOutDirection, setSwipeOutDirection] = React.useState(null);
423
+ const [mounted, setMounted] = React.useState(false);
424
+ const [removed, setRemoved] = React.useState(false);
425
+ const [swiping, setSwiping] = React.useState(false);
426
+ const [swipeOut, setSwipeOut] = React.useState(false);
427
+ const [isSwiped, setIsSwiped] = React.useState(false);
428
+ const [offsetBeforeRemove, setOffsetBeforeRemove] = React.useState(0);
429
+ const [initialHeight, setInitialHeight] = React.useState(0);
430
+ const remainingTime = React.useRef(toast2.duration || durationFromToaster || TOAST_LIFETIME);
431
+ const dragStartTime = React.useRef(null);
432
+ const toastRef = React.useRef(null);
433
+ const isFront = index === 0;
434
+ const isVisible = index + 1 <= visibleToasts;
435
+ const toastType = toast2.type;
436
+ const dismissible = toast2.dismissible !== false;
437
+ const toastClassname = toast2.className || "";
438
+ const toastDescriptionClassname = toast2.descriptionClassName || "";
439
+ const heightIndex = React.useMemo(() => heights.findIndex((height) => height.toastId === toast2.id) || 0, [
440
+ heights,
441
+ toast2.id
442
+ ]);
443
+ const closeButton = React.useMemo(() => {
444
+ var _toast_closeButton;
445
+ return (_toast_closeButton = toast2.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
446
+ }, [
447
+ toast2.closeButton,
448
+ closeButtonFromToaster
449
+ ]);
450
+ const duration = React.useMemo(() => toast2.duration || durationFromToaster || TOAST_LIFETIME, [
451
+ toast2.duration,
452
+ durationFromToaster
453
+ ]);
454
+ const closeTimerStartTimeRef = React.useRef(0);
455
+ const offset = React.useRef(0);
456
+ const lastCloseTimerStartTimeRef = React.useRef(0);
457
+ const pointerStartRef = React.useRef(null);
458
+ const [y, x] = position.split("-");
459
+ const toastsHeightBefore = React.useMemo(() => {
460
+ return heights.reduce((prev, curr, reducerIndex) => {
461
+ if (reducerIndex >= heightIndex) {
462
+ return prev;
463
+ }
464
+ return prev + curr.height;
465
+ }, 0);
466
+ }, [
467
+ heights,
468
+ heightIndex
469
+ ]);
470
+ const isDocumentHidden = useIsDocumentHidden();
471
+ const invert = toast2.invert || ToasterInvert;
472
+ const disabled = toastType === "loading";
473
+ offset.current = React.useMemo(() => heightIndex * gap + toastsHeightBefore, [
474
+ heightIndex,
475
+ toastsHeightBefore
476
+ ]);
477
+ React.useEffect(() => {
478
+ remainingTime.current = duration;
479
+ }, [
480
+ duration
481
+ ]);
482
+ React.useEffect(() => {
483
+ setMounted(true);
484
+ }, []);
485
+ React.useEffect(() => {
486
+ const toastNode = toastRef.current;
487
+ if (toastNode) {
488
+ const height = toastNode.getBoundingClientRect().height;
489
+ setInitialHeight(height);
490
+ setHeights((h) => [
491
+ {
492
+ toastId: toast2.id,
493
+ height,
494
+ position: toast2.position
495
+ },
496
+ ...h
497
+ ]);
498
+ return () => setHeights((h) => h.filter((height2) => height2.toastId !== toast2.id));
499
+ }
500
+ }, [
501
+ setHeights,
502
+ toast2.id
503
+ ]);
504
+ React.useLayoutEffect(() => {
505
+ if (!mounted) return;
506
+ const toastNode = toastRef.current;
507
+ const originalHeight = toastNode.style.height;
508
+ toastNode.style.height = "auto";
509
+ const newHeight = toastNode.getBoundingClientRect().height;
510
+ toastNode.style.height = originalHeight;
511
+ setInitialHeight(newHeight);
512
+ setHeights((heights2) => {
513
+ const alreadyExists = heights2.find((height) => height.toastId === toast2.id);
514
+ if (!alreadyExists) {
515
+ return [
516
+ {
517
+ toastId: toast2.id,
518
+ height: newHeight,
519
+ position: toast2.position
520
+ },
521
+ ...heights2
522
+ ];
523
+ } else {
524
+ return heights2.map((height) => height.toastId === toast2.id ? {
525
+ ...height,
526
+ height: newHeight
527
+ } : height);
528
+ }
529
+ });
530
+ }, [
531
+ mounted,
532
+ toast2.title,
533
+ toast2.description,
534
+ setHeights,
535
+ toast2.id,
536
+ toast2.jsx,
537
+ toast2.action,
538
+ toast2.cancel
539
+ ]);
540
+ const deleteToast = React.useCallback(() => {
541
+ setRemoved(true);
542
+ setOffsetBeforeRemove(offset.current);
543
+ setHeights((h) => h.filter((height) => height.toastId !== toast2.id));
544
+ setTimeout(() => {
545
+ removeToast(toast2);
546
+ }, TIME_BEFORE_UNMOUNT);
547
+ }, [
548
+ toast2,
549
+ removeToast,
550
+ setHeights,
551
+ offset
552
+ ]);
553
+ React.useEffect(() => {
554
+ if (toast2.promise && toastType === "loading" || toast2.duration === Infinity || toast2.type === "loading") return;
555
+ let timeoutId;
556
+ const pauseTimer = () => {
557
+ if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
558
+ const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;
559
+ remainingTime.current = remainingTime.current - elapsedTime;
560
+ }
561
+ lastCloseTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
562
+ };
563
+ const startTimer = () => {
564
+ if (remainingTime.current === Infinity) return;
565
+ closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
566
+ timeoutId = setTimeout(() => {
567
+ toast2.onAutoClose == null ? void 0 : toast2.onAutoClose.call(toast2, toast2);
568
+ deleteToast();
569
+ }, remainingTime.current);
570
+ };
571
+ if (expanded || interacting || isDocumentHidden) {
572
+ pauseTimer();
573
+ } else {
574
+ startTimer();
575
+ }
576
+ return () => clearTimeout(timeoutId);
577
+ }, [
578
+ expanded,
579
+ interacting,
580
+ toast2,
581
+ toastType,
582
+ isDocumentHidden,
583
+ deleteToast
584
+ ]);
585
+ React.useEffect(() => {
586
+ if (toast2.delete) {
587
+ deleteToast();
588
+ toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
589
+ }
590
+ }, [
591
+ deleteToast,
592
+ toast2.delete
593
+ ]);
594
+ function getLoadingIcon() {
595
+ var _toast_classNames9;
596
+ if (icons == null ? void 0 : icons.loading) {
597
+ var _toast_classNames12;
598
+ return /* @__PURE__ */ React.createElement("div", {
599
+ className: cn(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames12 = toast2.classNames) == null ? void 0 : _toast_classNames12.loader, "sonner-loader"),
600
+ "data-visible": toastType === "loading"
601
+ }, icons.loading);
602
+ }
603
+ return /* @__PURE__ */ React.createElement(Loader, {
604
+ className: cn(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames9 = toast2.classNames) == null ? void 0 : _toast_classNames9.loader),
605
+ visible: toastType === "loading"
606
+ });
607
+ }
608
+ const icon = toast2.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);
609
+ var _toast_richColors, _icons_close;
610
+ return /* @__PURE__ */ React.createElement("li", {
611
+ tabIndex: 0,
612
+ ref: toastRef,
613
+ className: cn(className, toastClassname, classNames == null ? void 0 : classNames.toast, toast2 == null ? void 0 : (_toast_classNames = toast2.classNames) == null ? void 0 : _toast_classNames.toast, classNames == null ? void 0 : classNames.default, classNames == null ? void 0 : classNames[toastType], toast2 == null ? void 0 : (_toast_classNames1 = toast2.classNames) == null ? void 0 : _toast_classNames1[toastType]),
614
+ "data-sonner-toast": "",
615
+ "data-rich-colors": (_toast_richColors = toast2.richColors) != null ? _toast_richColors : defaultRichColors,
616
+ "data-styled": !Boolean(toast2.jsx || toast2.unstyled || unstyled),
617
+ "data-mounted": mounted,
618
+ "data-promise": Boolean(toast2.promise),
619
+ "data-swiped": isSwiped,
620
+ "data-removed": removed,
621
+ "data-visible": isVisible,
622
+ "data-y-position": y,
623
+ "data-x-position": x,
624
+ "data-index": index,
625
+ "data-front": isFront,
626
+ "data-swiping": swiping,
627
+ "data-dismissible": dismissible,
628
+ "data-type": toastType,
629
+ "data-invert": invert,
630
+ "data-swipe-out": swipeOut,
631
+ "data-swipe-direction": swipeOutDirection,
632
+ "data-expanded": Boolean(expanded || expandByDefault && mounted),
633
+ "data-testid": toast2.testId,
634
+ style: {
635
+ "--index": index,
636
+ "--toasts-before": index,
637
+ "--z-index": toasts.length - index,
638
+ "--offset": `${removed ? offsetBeforeRemove : offset.current}px`,
639
+ "--initial-height": expandByDefault ? "auto" : `${initialHeight}px`,
640
+ ...style,
641
+ ...toast2.style
642
+ },
643
+ onDragEnd: () => {
644
+ setSwiping(false);
645
+ setSwipeDirection(null);
646
+ pointerStartRef.current = null;
647
+ },
648
+ onPointerDown: (event) => {
649
+ if (event.button === 2) return;
650
+ if (disabled || !dismissible) return;
651
+ dragStartTime.current = /* @__PURE__ */ new Date();
652
+ setOffsetBeforeRemove(offset.current);
653
+ event.target.setPointerCapture(event.pointerId);
654
+ if (event.target.tagName === "BUTTON") return;
655
+ setSwiping(true);
656
+ pointerStartRef.current = {
657
+ x: event.clientX,
658
+ y: event.clientY
659
+ };
660
+ },
661
+ onPointerUp: () => {
662
+ var _toastRef_current, _toastRef_current1, _dragStartTime_current;
663
+ if (swipeOut || !dismissible) return;
664
+ pointerStartRef.current = null;
665
+ const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0);
666
+ const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0);
667
+ const timeTaken = (/* @__PURE__ */ new Date()).getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
668
+ const swipeAmount = swipeDirection === "x" ? swipeAmountX : swipeAmountY;
669
+ const velocity = Math.abs(swipeAmount) / timeTaken;
670
+ if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
671
+ setOffsetBeforeRemove(offset.current);
672
+ toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
673
+ if (swipeDirection === "x") {
674
+ setSwipeOutDirection(swipeAmountX > 0 ? "right" : "left");
675
+ } else {
676
+ setSwipeOutDirection(swipeAmountY > 0 ? "down" : "up");
677
+ }
678
+ deleteToast();
679
+ setSwipeOut(true);
680
+ return;
681
+ } else {
682
+ var _toastRef_current2, _toastRef_current3;
683
+ (_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty("--swipe-amount-x", `0px`);
684
+ (_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty("--swipe-amount-y", `0px`);
685
+ }
686
+ setIsSwiped(false);
687
+ setSwiping(false);
688
+ setSwipeDirection(null);
689
+ },
690
+ onPointerMove: (event) => {
691
+ var _window_getSelection, _toastRef_current, _toastRef_current1;
692
+ if (!pointerStartRef.current || !dismissible) return;
693
+ const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;
694
+ if (isHighlighted) return;
695
+ const yDelta = event.clientY - pointerStartRef.current.y;
696
+ const xDelta = event.clientX - pointerStartRef.current.x;
697
+ var _props_swipeDirections;
698
+ const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position);
699
+ if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
700
+ setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y");
701
+ }
702
+ let swipeAmount = {
703
+ x: 0,
704
+ y: 0
705
+ };
706
+ const getDampening = (delta) => {
707
+ const factor = Math.abs(delta) / 20;
708
+ return 1 / (1.5 + factor);
709
+ };
710
+ if (swipeDirection === "y") {
711
+ if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) {
712
+ if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) {
713
+ swipeAmount.y = yDelta;
714
+ } else {
715
+ const dampenedDelta = yDelta * getDampening(yDelta);
716
+ swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
717
+ }
718
+ }
719
+ } else if (swipeDirection === "x") {
720
+ if (swipeDirections.includes("left") || swipeDirections.includes("right")) {
721
+ if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) {
722
+ swipeAmount.x = xDelta;
723
+ } else {
724
+ const dampenedDelta = xDelta * getDampening(xDelta);
725
+ swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
726
+ }
727
+ }
728
+ }
729
+ if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {
730
+ setIsSwiped(true);
731
+ }
732
+ (_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
733
+ (_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
734
+ }
735
+ }, closeButton && !toast2.jsx && toastType !== "loading" ? /* @__PURE__ */ React.createElement("button", {
736
+ "aria-label": closeButtonAriaLabel,
737
+ "data-disabled": disabled,
738
+ "data-close-button": true,
739
+ onClick: disabled || !dismissible ? () => {
740
+ } : () => {
741
+ deleteToast();
742
+ toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
743
+ },
744
+ className: cn(classNames == null ? void 0 : classNames.closeButton, toast2 == null ? void 0 : (_toast_classNames2 = toast2.classNames) == null ? void 0 : _toast_classNames2.closeButton)
745
+ }, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast2.icon || toast2.promise) && toast2.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast2.icon) ? /* @__PURE__ */ React.createElement("div", {
746
+ "data-icon": "",
747
+ className: cn(classNames == null ? void 0 : classNames.icon, toast2 == null ? void 0 : (_toast_classNames3 = toast2.classNames) == null ? void 0 : _toast_classNames3.icon)
748
+ }, toast2.promise || toast2.type === "loading" && !toast2.icon ? toast2.icon || getLoadingIcon() : null, toast2.type !== "loading" ? icon : null) : null, /* @__PURE__ */ React.createElement("div", {
749
+ "data-content": "",
750
+ className: cn(classNames == null ? void 0 : classNames.content, toast2 == null ? void 0 : (_toast_classNames4 = toast2.classNames) == null ? void 0 : _toast_classNames4.content)
751
+ }, /* @__PURE__ */ React.createElement("div", {
752
+ "data-title": "",
753
+ className: cn(classNames == null ? void 0 : classNames.title, toast2 == null ? void 0 : (_toast_classNames5 = toast2.classNames) == null ? void 0 : _toast_classNames5.title)
754
+ }, toast2.jsx ? toast2.jsx : typeof toast2.title === "function" ? toast2.title() : toast2.title), toast2.description ? /* @__PURE__ */ React.createElement("div", {
755
+ "data-description": "",
756
+ className: cn(descriptionClassName, toastDescriptionClassname, classNames == null ? void 0 : classNames.description, toast2 == null ? void 0 : (_toast_classNames6 = toast2.classNames) == null ? void 0 : _toast_classNames6.description)
757
+ }, typeof toast2.description === "function" ? toast2.description() : toast2.description) : null), /* @__PURE__ */ React.isValidElement(toast2.cancel) ? toast2.cancel : toast2.cancel && isAction(toast2.cancel) ? /* @__PURE__ */ React.createElement("button", {
758
+ "data-button": true,
759
+ "data-cancel": true,
760
+ style: toast2.cancelButtonStyle || cancelButtonStyle,
761
+ onClick: (event) => {
762
+ if (!isAction(toast2.cancel)) return;
763
+ if (!dismissible) return;
764
+ toast2.cancel.onClick == null ? void 0 : toast2.cancel.onClick.call(toast2.cancel, event);
765
+ deleteToast();
766
+ },
767
+ className: cn(classNames == null ? void 0 : classNames.cancelButton, toast2 == null ? void 0 : (_toast_classNames7 = toast2.classNames) == null ? void 0 : _toast_classNames7.cancelButton)
768
+ }, toast2.cancel.label) : null, /* @__PURE__ */ React.isValidElement(toast2.action) ? toast2.action : toast2.action && isAction(toast2.action) ? /* @__PURE__ */ React.createElement("button", {
769
+ "data-button": true,
770
+ "data-action": true,
771
+ style: toast2.actionButtonStyle || actionButtonStyle,
772
+ onClick: (event) => {
773
+ if (!isAction(toast2.action)) return;
774
+ toast2.action.onClick == null ? void 0 : toast2.action.onClick.call(toast2.action, event);
775
+ if (event.defaultPrevented) return;
776
+ deleteToast();
777
+ },
778
+ className: cn(classNames == null ? void 0 : classNames.actionButton, toast2 == null ? void 0 : (_toast_classNames8 = toast2.classNames) == null ? void 0 : _toast_classNames8.actionButton)
779
+ }, toast2.action.label) : null);
780
+ };
781
+ function getDocumentDirection() {
782
+ if (typeof window === "undefined") return "ltr";
783
+ if (typeof document === "undefined") return "ltr";
784
+ const dirAttribute = document.documentElement.getAttribute("dir");
785
+ if (dirAttribute === "auto" || !dirAttribute) {
786
+ return window.getComputedStyle(document.documentElement).direction;
787
+ }
788
+ return dirAttribute;
789
+ }
790
+ function assignOffset(defaultOffset, mobileOffset) {
791
+ const styles = {};
792
+ [
793
+ defaultOffset,
794
+ mobileOffset
795
+ ].forEach((offset, index) => {
796
+ const isMobile = index === 1;
797
+ const prefix = isMobile ? "--mobile-offset" : "--offset";
798
+ const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
799
+ function assignAll(offset2) {
800
+ [
801
+ "top",
802
+ "right",
803
+ "bottom",
804
+ "left"
805
+ ].forEach((key) => {
806
+ styles[`${prefix}-${key}`] = typeof offset2 === "number" ? `${offset2}px` : offset2;
807
+ });
808
+ }
809
+ if (typeof offset === "number" || typeof offset === "string") {
810
+ assignAll(offset);
811
+ } else if (typeof offset === "object") {
812
+ [
813
+ "top",
814
+ "right",
815
+ "bottom",
816
+ "left"
817
+ ].forEach((key) => {
818
+ if (offset[key] === void 0) {
819
+ styles[`${prefix}-${key}`] = defaultValue;
820
+ } else {
821
+ styles[`${prefix}-${key}`] = typeof offset[key] === "number" ? `${offset[key]}px` : offset[key];
822
+ }
823
+ });
824
+ } else {
825
+ assignAll(defaultValue);
826
+ }
827
+ });
828
+ return styles;
829
+ }
830
+ const Toaster = /* @__PURE__ */ React.forwardRef(function Toaster2(props, ref) {
831
+ const { id, invert, position = "bottom-right", hotkey = [
832
+ "altKey",
833
+ "KeyT"
834
+ ], expand, closeButton, className, offset, mobileOffset, theme = "light", richColors, duration, style, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, containerAriaLabel = "Notifications" } = props;
835
+ const [toasts, setToasts] = React.useState([]);
836
+ const filteredToasts = React.useMemo(() => {
837
+ if (id) {
838
+ return toasts.filter((toast2) => toast2.toasterId === id);
839
+ }
840
+ return toasts.filter((toast2) => !toast2.toasterId);
841
+ }, [
842
+ toasts,
843
+ id
844
+ ]);
845
+ const possiblePositions = React.useMemo(() => {
846
+ return Array.from(new Set([
847
+ position
848
+ ].concat(filteredToasts.filter((toast2) => toast2.position).map((toast2) => toast2.position))));
849
+ }, [
850
+ filteredToasts,
851
+ position
852
+ ]);
853
+ const [heights, setHeights] = React.useState([]);
854
+ const [expanded, setExpanded] = React.useState(false);
855
+ const [interacting, setInteracting] = React.useState(false);
856
+ const [actualTheme, setActualTheme] = React.useState(theme !== "system" ? theme : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
857
+ const listRef = React.useRef(null);
858
+ const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
859
+ const lastFocusedElementRef = React.useRef(null);
860
+ const isFocusWithinRef = React.useRef(false);
861
+ const removeToast = React.useCallback((toastToRemove) => {
862
+ setToasts((toasts2) => {
863
+ var _toasts_find;
864
+ if (!((_toasts_find = toasts2.find((toast2) => toast2.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {
865
+ ToastState.dismiss(toastToRemove.id);
866
+ }
867
+ return toasts2.filter(({ id: id2 }) => id2 !== toastToRemove.id);
868
+ });
869
+ }, []);
870
+ React.useEffect(() => {
871
+ return ToastState.subscribe((toast2) => {
872
+ if (toast2.dismiss) {
873
+ requestAnimationFrame(() => {
874
+ setToasts((toasts2) => toasts2.map((t) => t.id === toast2.id ? {
875
+ ...t,
876
+ delete: true
877
+ } : t));
878
+ });
879
+ return;
880
+ }
881
+ setTimeout(() => {
882
+ ReactDOM.flushSync(() => {
883
+ setToasts((toasts2) => {
884
+ const indexOfExistingToast = toasts2.findIndex((t) => t.id === toast2.id);
885
+ if (indexOfExistingToast !== -1) {
886
+ return [
887
+ ...toasts2.slice(0, indexOfExistingToast),
888
+ {
889
+ ...toasts2[indexOfExistingToast],
890
+ ...toast2
891
+ },
892
+ ...toasts2.slice(indexOfExistingToast + 1)
893
+ ];
894
+ }
895
+ return [
896
+ toast2,
897
+ ...toasts2
898
+ ];
899
+ });
900
+ });
901
+ });
902
+ });
903
+ }, [
904
+ toasts
905
+ ]);
906
+ React.useEffect(() => {
907
+ if (theme !== "system") {
908
+ setActualTheme(theme);
909
+ return;
910
+ }
911
+ if (theme === "system") {
912
+ if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
913
+ setActualTheme("dark");
914
+ } else {
915
+ setActualTheme("light");
916
+ }
917
+ }
918
+ if (typeof window === "undefined") return;
919
+ const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
920
+ try {
921
+ darkMediaQuery.addEventListener("change", ({ matches }) => {
922
+ if (matches) {
923
+ setActualTheme("dark");
924
+ } else {
925
+ setActualTheme("light");
926
+ }
927
+ });
928
+ } catch (error) {
929
+ darkMediaQuery.addListener(({ matches }) => {
930
+ try {
931
+ if (matches) {
932
+ setActualTheme("dark");
933
+ } else {
934
+ setActualTheme("light");
935
+ }
936
+ } catch (e) {
937
+ console.error(e);
938
+ }
939
+ });
940
+ }
941
+ }, [
942
+ theme
943
+ ]);
944
+ React.useEffect(() => {
945
+ if (toasts.length <= 1) {
946
+ setExpanded(false);
947
+ }
948
+ }, [
949
+ toasts
950
+ ]);
951
+ React.useEffect(() => {
952
+ const handleKeyDown = (event) => {
953
+ var _listRef_current;
954
+ const isHotkeyPressed = hotkey.every((key) => event[key] || event.code === key);
955
+ if (isHotkeyPressed) {
956
+ var _listRef_current1;
957
+ setExpanded(true);
958
+ (_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus();
959
+ }
960
+ if (event.code === "Escape" && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) {
961
+ setExpanded(false);
962
+ }
963
+ };
964
+ document.addEventListener("keydown", handleKeyDown);
965
+ return () => document.removeEventListener("keydown", handleKeyDown);
966
+ }, [
967
+ hotkey
968
+ ]);
969
+ React.useEffect(() => {
970
+ if (listRef.current) {
971
+ return () => {
972
+ if (lastFocusedElementRef.current) {
973
+ lastFocusedElementRef.current.focus({
974
+ preventScroll: true
975
+ });
976
+ lastFocusedElementRef.current = null;
977
+ isFocusWithinRef.current = false;
978
+ }
979
+ };
980
+ }
981
+ }, [
982
+ listRef.current
983
+ ]);
984
+ return (
985
+ // Remove item from normal navigation flow, only available via hotkey
986
+ /* @__PURE__ */ React.createElement("section", {
987
+ ref,
988
+ "aria-label": `${containerAriaLabel} ${hotkeyLabel}`,
989
+ tabIndex: -1,
990
+ "aria-live": "polite",
991
+ "aria-relevant": "additions text",
992
+ "aria-atomic": "false",
993
+ suppressHydrationWarning: true
994
+ }, possiblePositions.map((position2, index) => {
995
+ var _heights_;
996
+ const [y, x] = position2.split("-");
997
+ if (!filteredToasts.length) return null;
998
+ return /* @__PURE__ */ React.createElement("ol", {
999
+ key: position2,
1000
+ dir: dir === "auto" ? getDocumentDirection() : dir,
1001
+ tabIndex: -1,
1002
+ ref: listRef,
1003
+ className,
1004
+ "data-sonner-toaster": true,
1005
+ "data-sonner-theme": actualTheme,
1006
+ "data-y-position": y,
1007
+ "data-x-position": x,
1008
+ style: {
1009
+ "--front-toast-height": `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
1010
+ "--width": `${TOAST_WIDTH}px`,
1011
+ "--gap": `${gap}px`,
1012
+ ...style,
1013
+ ...assignOffset(offset, mobileOffset)
1014
+ },
1015
+ onBlur: (event) => {
1016
+ if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
1017
+ isFocusWithinRef.current = false;
1018
+ if (lastFocusedElementRef.current) {
1019
+ lastFocusedElementRef.current.focus({
1020
+ preventScroll: true
1021
+ });
1022
+ lastFocusedElementRef.current = null;
1023
+ }
1024
+ }
1025
+ },
1026
+ onFocus: (event) => {
1027
+ const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
1028
+ if (isNotDismissible) return;
1029
+ if (!isFocusWithinRef.current) {
1030
+ isFocusWithinRef.current = true;
1031
+ lastFocusedElementRef.current = event.relatedTarget;
1032
+ }
1033
+ },
1034
+ onMouseEnter: () => setExpanded(true),
1035
+ onMouseMove: () => setExpanded(true),
1036
+ onMouseLeave: () => {
1037
+ if (!interacting) {
1038
+ setExpanded(false);
1039
+ }
1040
+ },
1041
+ onDragEnd: () => setExpanded(false),
1042
+ onPointerDown: (event) => {
1043
+ const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
1044
+ if (isNotDismissible) return;
1045
+ setInteracting(true);
1046
+ },
1047
+ onPointerUp: () => setInteracting(false)
1048
+ }, filteredToasts.filter((toast2) => !toast2.position && index === 0 || toast2.position === position2).map((toast2, index2) => {
1049
+ var _toastOptions_duration, _toastOptions_closeButton;
1050
+ return /* @__PURE__ */ React.createElement(Toast, {
1051
+ key: toast2.id,
1052
+ icons,
1053
+ index: index2,
1054
+ toast: toast2,
1055
+ defaultRichColors: richColors,
1056
+ duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration,
1057
+ className: toastOptions == null ? void 0 : toastOptions.className,
1058
+ descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
1059
+ invert,
1060
+ visibleToasts,
1061
+ closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
1062
+ interacting,
1063
+ position: position2,
1064
+ style: toastOptions == null ? void 0 : toastOptions.style,
1065
+ unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
1066
+ classNames: toastOptions == null ? void 0 : toastOptions.classNames,
1067
+ cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
1068
+ actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
1069
+ closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
1070
+ removeToast,
1071
+ toasts: filteredToasts.filter((t) => t.position == toast2.position),
1072
+ heights: heights.filter((h) => h.position == toast2.position),
1073
+ setHeights,
1074
+ expandByDefault: expand,
1075
+ gap,
1076
+ expanded,
1077
+ swipeDirections: props.swipeDirections
1078
+ });
1079
+ }));
1080
+ }))
1081
+ );
1082
+ });
1083
+ export {
1084
+ Toaster as T,
1085
+ toast as t
1086
+ };