appos 0.3.5-0 → 0.3.7-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 (242) hide show
  1. package/dist/bin/main.mjs +3 -3
  2. package/dist/bin/youch-handler-D7REmh8Z.mjs +2 -0
  3. package/dist/exports/api/adapter-C2mMJKvG.mjs +1504 -0
  4. package/dist/exports/api/{auth-schema.mjs → auth-schema-CON4yFFY.mjs} +2 -3
  5. package/dist/exports/api/bun-sqlite-dialect-CPpPZa23.mjs +155 -0
  6. package/dist/exports/{cli/_virtual/rolldown_runtime.mjs → api/chunk-CyXqrcp_.mjs} +14 -1
  7. package/dist/exports/api/conditions-DjBAWfiK.mjs +116 -0
  8. package/dist/exports/api/dialect-CUUD24Ge.mjs +72 -0
  9. package/dist/exports/api/env-CwT3zhez.mjs +1 -0
  10. package/dist/exports/api/esm-_hkVMulx.mjs +15816 -0
  11. package/dist/exports/api/event-BHFSE6hY.mjs +20983 -0
  12. package/dist/exports/api/extract-blob-metadata-BMgUEPcW.mjs +4 -0
  13. package/dist/exports/api/extract-blob-metadata-_9RUEwoU.mjs +9818 -0
  14. package/dist/exports/api/generate-image-variant-DOIzj1wJ.mjs +4 -0
  15. package/dist/exports/api/generate-image-variant-DxOPoGAk.mjs +118 -0
  16. package/dist/exports/api/generate-preview-CvTFuq58.mjs +160 -0
  17. package/dist/exports/api/generate-preview-Dk3coswZ.mjs +4 -0
  18. package/dist/exports/api/index.d.mts +7347 -20
  19. package/dist/exports/api/index.mjs +146856 -18
  20. package/dist/exports/api/kysely-adapter-CmP2TbkS.mjs +296 -0
  21. package/dist/exports/api/memory-adapter-BzhRhLFK.mjs +212 -0
  22. package/dist/exports/api/node-sqlite-dialect-Bl5suBxl.mjs +155 -0
  23. package/dist/exports/api/orm-CMqufD21.mjs +153690 -0
  24. package/dist/exports/api/orm-DXqYuKvB.d.mts +11 -0
  25. package/dist/exports/api/orm.d.mts +2 -11
  26. package/dist/exports/api/orm.mjs +4 -42
  27. package/dist/exports/api/pdf-YxB2Hm1p.mjs +25822 -0
  28. package/dist/exports/api/purge-attachment-Cf6KH2Jv.mjs +34 -0
  29. package/dist/exports/api/purge-attachment-DIuil7ps.mjs +4 -0
  30. package/dist/exports/{cli/api/workflows/purge-audit-logs.mjs → api/purge-audit-logs-z6j_Pu47.mjs} +3 -3
  31. package/dist/exports/{cli/api/workflows/purge-unattached-blobs.mjs → api/purge-unattached-blobs-B0TfY5Hk.mjs} +1 -1
  32. package/dist/exports/api/react-BYhV5bYt.mjs +1131 -0
  33. package/dist/exports/api/server.node-DyVrQ6cz.mjs +19298 -0
  34. package/dist/exports/api/table-6bTIEqON.mjs +2636 -0
  35. package/dist/exports/api/{workflows/track-db-changes.mjs → track-db-changes-BysaV6nN.mjs} +14 -14
  36. package/dist/exports/api/{workflow.mjs → workflow-BuSWHcX-.mjs} +121 -10
  37. package/dist/exports/api/workflows/auth-schema-BFve3hgZ.mjs +2813 -0
  38. package/dist/exports/api/workflows/{_virtual/rolldown_runtime.mjs → chunk-B36mNPO4.mjs} +5 -1
  39. package/dist/exports/api/workflows/extract-blob-metadata-BcWKvY2K.mjs +9818 -0
  40. package/dist/exports/{cli/api/workflows/generate-image-variant.mjs → api/workflows/generate-image-variant-BAFvL_zV.mjs} +20 -20
  41. package/dist/exports/{cli/api/workflows/generate-preview.mjs → api/workflows/generate-preview-BjlIVYYp.mjs} +6 -6
  42. package/dist/exports/api/workflows/index.d.mts +2011 -1
  43. package/dist/exports/api/workflows/index.mjs +2 -1
  44. package/dist/exports/api/workflows/pdf-DUB8zyIc.mjs +25822 -0
  45. package/dist/exports/{cli/api/workflows/purge-attachment.mjs → api/workflows/purge-attachment-k_sdxTPY.mjs} +3 -3
  46. package/dist/exports/api/workflows/{purge-audit-logs.mjs → purge-audit-logs-zCyWj4Mw.mjs} +12 -3
  47. package/dist/exports/api/workflows/{purge-unattached-blobs.mjs → purge-unattached-blobs-CdsuFAeW.mjs} +1 -1
  48. package/dist/exports/api/workflows/track-db-changes-CiKaI9gT.mjs +20943 -0
  49. package/dist/exports/api/workflows/track-db-changes-DEWQYryO.mjs +4 -0
  50. package/dist/exports/{cli/api/workflow.mjs → api/workflows/workflow-BjM2xCa6.mjs} +23 -3
  51. package/dist/exports/api/workflows/zod-Br0enFWK.mjs +12333 -0
  52. package/dist/exports/api/zod-CdrJdBtV.mjs +12571 -0
  53. package/dist/exports/cli/auth-schema-CNuOqPi-.mjs +2813 -0
  54. package/dist/exports/{api/_virtual/rolldown_runtime.mjs → cli/chunk-B36mNPO4.mjs} +5 -1
  55. package/dist/exports/cli/extract-blob-metadata-CV1Ke90d.mjs +9818 -0
  56. package/dist/exports/{api/workflows/generate-image-variant.mjs → cli/generate-image-variant-CM1BrVvZ.mjs} +20 -20
  57. package/dist/exports/{api/workflows/generate-preview.mjs → cli/generate-preview-DdHQ3ukz.mjs} +6 -6
  58. package/dist/exports/cli/index.d.mts +2142 -2
  59. package/dist/exports/cli/index.mjs +41 -1
  60. package/dist/exports/cli/pdf-CLUPEIdT.mjs +25822 -0
  61. package/dist/exports/{api/workflows/purge-attachment.mjs → cli/purge-attachment-Dc_J74dG.mjs} +3 -3
  62. package/dist/exports/cli/purge-audit-logs-DFhWh-Bx.mjs +56 -0
  63. package/dist/exports/cli/purge-unattached-blobs-C1MRlM_2.mjs +46 -0
  64. package/dist/exports/cli/track-db-changes-CfneOF2_.mjs +20943 -0
  65. package/dist/exports/{api/workflows/api/workflow.mjs → cli/workflow-DSbbXBMt.mjs} +23 -3
  66. package/dist/exports/cli/zod-7q0_Mtnn.mjs +12333 -0
  67. package/dist/exports/tests/api.d.mts +7354 -5
  68. package/dist/exports/tests/api.mjs +79 -1
  69. package/dist/exports/tests/auth-schema-B_qHPoa4.mjs +1 -0
  70. package/dist/exports/tests/chunk-Cii4FAhs.mjs +1 -0
  71. package/dist/exports/tests/conditions-BeWxRN_Z.mjs +1 -0
  72. package/dist/exports/tests/constants-D_m07gCJ.mjs +1 -0
  73. package/dist/exports/tests/dist-Cx2HEBOB.mjs +296 -0
  74. package/dist/exports/tests/dist-DnACOvNW.mjs +7 -0
  75. package/dist/exports/tests/extract-blob-metadata-6xQrarjB.mjs +169 -0
  76. package/dist/exports/tests/generate-image-variant-KQITLmCx.mjs +1 -0
  77. package/dist/exports/tests/generate-preview-YnujQo5I.mjs +1 -0
  78. package/dist/exports/tests/mock-BvoS23fi.mjs +1 -0
  79. package/dist/exports/tests/mock.mjs +1 -1
  80. package/dist/exports/tests/pdf-lZ-as2o7.mjs +13 -0
  81. package/dist/exports/tests/purge-attachment-DTSmCl-z.mjs +1 -0
  82. package/dist/exports/tests/purge-audit-logs-D0_UUhN2.mjs +1 -0
  83. package/dist/exports/tests/purge-unattached-blobs-IENmSB8K.mjs +1 -0
  84. package/dist/exports/tests/react.mjs +6 -1
  85. package/dist/exports/tests/setup.d.mts +1 -1
  86. package/dist/exports/tests/setup.mjs +34 -1
  87. package/dist/exports/tests/table-CmPSf_pE.mjs +1 -0
  88. package/dist/exports/tests/track-db-changes-Td9Q3DLd.mjs +1 -0
  89. package/dist/exports/tests/{api/workflow.mjs → workflow-BWRWyC83.mjs} +1 -1
  90. package/dist/exports/tests/youch-handler-efUxKCCs.mjs +1 -0
  91. package/dist/exports/tests/zod-CkJO9qpV.mjs +23 -0
  92. package/dist/exports/vendors/date.js +13236 -1
  93. package/dist/exports/vendors/toolkit.js +2206 -1
  94. package/dist/exports/vendors/zod.js +12344 -1
  95. package/dist/exports/vite/index.d.mts +1 -1
  96. package/dist/exports/vite/index.mjs +26 -1
  97. package/dist/exports/vite/lib-B0s0q6aX.mjs +382 -0
  98. package/dist/exports/vite/lib-BkrbWMaV.mjs +1 -0
  99. package/dist/exports/web/browser-ponyfill-DxTJMXNq.js +443 -0
  100. package/dist/exports/web/chunk-DksrlJLg.js +49 -0
  101. package/dist/exports/web/index.d.ts +2546 -2
  102. package/dist/exports/web/index.js +9295 -6
  103. package/dist/exports/web/plugin-DqTFWG7p.js +250 -0
  104. package/package.json +1 -7
  105. package/dist/bin/youch-handler-DrYdbUhe.mjs +0 -2
  106. package/dist/exports/api/app-context.d.mts +0 -115
  107. package/dist/exports/api/app-context.mjs +0 -24
  108. package/dist/exports/api/auth-schema.d.mts +0 -4248
  109. package/dist/exports/api/auth.d.mts +0 -402
  110. package/dist/exports/api/auth.mjs +0 -188
  111. package/dist/exports/api/cache.d.mts +0 -44
  112. package/dist/exports/api/cache.mjs +0 -28
  113. package/dist/exports/api/config.d.mts +0 -28
  114. package/dist/exports/api/config.mjs +0 -72
  115. package/dist/exports/api/constants.mjs +0 -92
  116. package/dist/exports/api/container.d.mts +0 -210
  117. package/dist/exports/api/container.mjs +0 -49
  118. package/dist/exports/api/database.d.mts +0 -101
  119. package/dist/exports/api/database.mjs +0 -219
  120. package/dist/exports/api/event.d.mts +0 -235
  121. package/dist/exports/api/event.mjs +0 -236
  122. package/dist/exports/api/i18n.d.mts +0 -34
  123. package/dist/exports/api/i18n.mjs +0 -45
  124. package/dist/exports/api/instrumentation.d.mts +0 -7
  125. package/dist/exports/api/instrumentation.mjs +0 -40
  126. package/dist/exports/api/logger.d.mts +0 -21
  127. package/dist/exports/api/logger.mjs +0 -26
  128. package/dist/exports/api/mailer.d.mts +0 -70
  129. package/dist/exports/api/mailer.mjs +0 -37
  130. package/dist/exports/api/middleware/request-logger.d.mts +0 -24
  131. package/dist/exports/api/middleware.d.mts +0 -39
  132. package/dist/exports/api/middleware.mjs +0 -73
  133. package/dist/exports/api/openapi.d.mts +0 -271
  134. package/dist/exports/api/openapi.mjs +0 -507
  135. package/dist/exports/api/otel.d.mts +0 -40
  136. package/dist/exports/api/otel.mjs +0 -56
  137. package/dist/exports/api/redis.d.mts +0 -34
  138. package/dist/exports/api/redis.mjs +0 -41
  139. package/dist/exports/api/storage-schema.d.mts +0 -707
  140. package/dist/exports/api/storage-schema.mjs +0 -72
  141. package/dist/exports/api/storage.d.mts +0 -506
  142. package/dist/exports/api/storage.mjs +0 -833
  143. package/dist/exports/api/web/auth.mjs +0 -17
  144. package/dist/exports/api/workflow.d.mts +0 -250
  145. package/dist/exports/api/workflows/api/auth-schema.mjs +0 -373
  146. package/dist/exports/api/workflows/api/auth.d.mts +0 -379
  147. package/dist/exports/api/workflows/api/cache.d.mts +0 -44
  148. package/dist/exports/api/workflows/api/config.d.mts +0 -18
  149. package/dist/exports/api/workflows/api/container.d.mts +0 -167
  150. package/dist/exports/api/workflows/api/database.d.mts +0 -47
  151. package/dist/exports/api/workflows/api/event.d.mts +0 -68
  152. package/dist/exports/api/workflows/api/event.mjs +0 -126
  153. package/dist/exports/api/workflows/api/logger.d.mts +0 -21
  154. package/dist/exports/api/workflows/api/mailer.d.mts +0 -70
  155. package/dist/exports/api/workflows/api/orm.d.mts +0 -13
  156. package/dist/exports/api/workflows/api/redis.mjs +0 -3
  157. package/dist/exports/api/workflows/api/storage-schema.d.mts +0 -699
  158. package/dist/exports/api/workflows/api/storage.d.mts +0 -396
  159. package/dist/exports/api/workflows/api/workflow.d.mts +0 -24
  160. package/dist/exports/api/workflows/constants.mjs +0 -23
  161. package/dist/exports/api/workflows/extract-blob-metadata.mjs +0 -132
  162. package/dist/exports/api/workflows/generate-image-variant.d.mts +0 -63
  163. package/dist/exports/api/workflows/track-db-changes.d.mts +0 -72
  164. package/dist/exports/cli/api/auth-schema.mjs +0 -373
  165. package/dist/exports/cli/api/auth.d.mts +0 -379
  166. package/dist/exports/cli/api/cache.d.mts +0 -44
  167. package/dist/exports/cli/api/config.d.mts +0 -18
  168. package/dist/exports/cli/api/container.d.mts +0 -167
  169. package/dist/exports/cli/api/database.d.mts +0 -47
  170. package/dist/exports/cli/api/event.d.mts +0 -68
  171. package/dist/exports/cli/api/event.mjs +0 -126
  172. package/dist/exports/cli/api/logger.d.mts +0 -21
  173. package/dist/exports/cli/api/mailer.d.mts +0 -70
  174. package/dist/exports/cli/api/orm.d.mts +0 -13
  175. package/dist/exports/cli/api/redis.mjs +0 -3
  176. package/dist/exports/cli/api/storage-schema.d.mts +0 -699
  177. package/dist/exports/cli/api/storage.d.mts +0 -396
  178. package/dist/exports/cli/api/workflow.d.mts +0 -2
  179. package/dist/exports/cli/api/workflows/extract-blob-metadata.mjs +0 -132
  180. package/dist/exports/cli/api/workflows/generate-image-variant.d.mts +0 -63
  181. package/dist/exports/cli/api/workflows/track-db-changes.mjs +0 -110
  182. package/dist/exports/cli/command.d.mts +0 -56
  183. package/dist/exports/cli/command.mjs +0 -43
  184. package/dist/exports/cli/constants.mjs +0 -23
  185. package/dist/exports/cli/context.d.mts +0 -170
  186. package/dist/exports/devtools/index.d.ts +0 -3
  187. package/dist/exports/devtools/index.js +0 -4
  188. package/dist/exports/tests/_virtual/rolldown_runtime.mjs +0 -1
  189. package/dist/exports/tests/api/app-context.d.mts +0 -115
  190. package/dist/exports/tests/api/app-context.mjs +0 -1
  191. package/dist/exports/tests/api/auth-schema.d.mts +0 -4248
  192. package/dist/exports/tests/api/auth-schema.mjs +0 -1
  193. package/dist/exports/tests/api/auth.d.mts +0 -402
  194. package/dist/exports/tests/api/cache.d.mts +0 -44
  195. package/dist/exports/tests/api/config.d.mts +0 -28
  196. package/dist/exports/tests/api/container.d.mts +0 -210
  197. package/dist/exports/tests/api/database.d.mts +0 -101
  198. package/dist/exports/tests/api/database.mjs +0 -1
  199. package/dist/exports/tests/api/event.d.mts +0 -235
  200. package/dist/exports/tests/api/event.mjs +0 -1
  201. package/dist/exports/tests/api/i18n.d.mts +0 -34
  202. package/dist/exports/tests/api/index.d.mts +0 -26
  203. package/dist/exports/tests/api/logger.d.mts +0 -21
  204. package/dist/exports/tests/api/mailer.d.mts +0 -70
  205. package/dist/exports/tests/api/middleware/error-handler.mjs +0 -1
  206. package/dist/exports/tests/api/middleware/health.mjs +0 -1
  207. package/dist/exports/tests/api/middleware/i18n.mjs +0 -1
  208. package/dist/exports/tests/api/middleware/request-logger.d.mts +0 -24
  209. package/dist/exports/tests/api/middleware/request-logger.mjs +0 -1
  210. package/dist/exports/tests/api/middleware/shutdown.mjs +0 -1
  211. package/dist/exports/tests/api/middleware/timeout.mjs +0 -1
  212. package/dist/exports/tests/api/middleware/youch-handler.mjs +0 -1
  213. package/dist/exports/tests/api/middleware.d.mts +0 -39
  214. package/dist/exports/tests/api/middleware.mjs +0 -1
  215. package/dist/exports/tests/api/openapi.d.mts +0 -271
  216. package/dist/exports/tests/api/openapi.mjs +0 -1
  217. package/dist/exports/tests/api/orm.d.mts +0 -13
  218. package/dist/exports/tests/api/otel.d.mts +0 -40
  219. package/dist/exports/tests/api/redis.d.mts +0 -34
  220. package/dist/exports/tests/api/redis.mjs +0 -1
  221. package/dist/exports/tests/api/server.mjs +0 -1
  222. package/dist/exports/tests/api/storage-schema.d.mts +0 -707
  223. package/dist/exports/tests/api/storage.d.mts +0 -506
  224. package/dist/exports/tests/api/workflow.d.mts +0 -250
  225. package/dist/exports/tests/api/workflows/extract-blob-metadata.mjs +0 -1
  226. package/dist/exports/tests/api/workflows/generate-image-variant.d.mts +0 -63
  227. package/dist/exports/tests/api/workflows/generate-image-variant.mjs +0 -1
  228. package/dist/exports/tests/api/workflows/generate-preview.mjs +0 -1
  229. package/dist/exports/tests/api/workflows/purge-attachment.mjs +0 -1
  230. package/dist/exports/tests/api/workflows/purge-audit-logs.mjs +0 -1
  231. package/dist/exports/tests/api/workflows/purge-unattached-blobs.mjs +0 -1
  232. package/dist/exports/tests/api/workflows/track-db-changes.mjs +0 -1
  233. package/dist/exports/tests/constants.mjs +0 -1
  234. package/dist/exports/tests/instrumentation.d.mts +0 -7
  235. package/dist/exports/tests/instrumentation.mjs +0 -1
  236. package/dist/exports/web/api/auth.d.ts +0 -125
  237. package/dist/exports/web/api/database.d.ts +0 -4
  238. package/dist/exports/web/api/logger.d.ts +0 -1
  239. package/dist/exports/web/auth.d.ts +0 -2388
  240. package/dist/exports/web/auth.js +0 -75
  241. package/dist/exports/web/i18n.d.ts +0 -42
  242. package/dist/exports/web/i18n.js +0 -45
@@ -1,6 +1,6 @@
1
+ import { PluginOption } from "vite";
1
2
  import react from "@vitejs/plugin-react";
2
3
  import { i18nextHMRPlugin } from "i18next-hmr/vite";
3
- import { PluginOption } from "vite";
4
4
  import babel from "vite-plugin-babel";
5
5
  export * from "vite";
6
6
 
@@ -1 +1,26 @@
1
- import e from"@vitejs/plugin-react";import{i18nextHMRPlugin as t}from"i18next-hmr/vite";import n from"vite-plugin-babel";export*from"vite";function r(){return{name:`vitest-ssr-fix`,enforce:`post`,config(e){e.ssr?.resolve?.conditions&&(e.ssr.resolve.conditions=e.ssr.resolve.conditions.filter(e=>e!==`module`))}}}export{n as babel,t as i18nextHMRPlugin,e as react,r as vitestSSRFix};
1
+ import{a as e,i as t,n,r,t as i}from"./lib-B0s0q6aX.mjs";import{dirname as a,join as o}from"node:path";import{fileURLToPath as s}from"node:url";import{readFileSync as c}from"node:fs";import*as l from"vite";import{createFilter as u}from"vite";import d from"path";import f from"fs";export*from"vite";function p(e,t){return RegExp(`^${h(e)}$`,t)}const m=/[-/\\^$*+?.()|[\]{}]/g;function h(e){return e.replace(m,`\\$&`)}function g(e){return Array.isArray(e)?e.map(e=>_(e)):_(e)}function _(e){return typeof e==`string`?`${e}{?*,}`:v(e)}function v(e){return new RegExp(e.source.replace(/(?<!\\)\$/g,`(?:\\?.*)?$`),e.flags)}const y=`/@react-refresh`,b=/extends\s+(?:React\.)?(?:Pure)?Component/,x=/\$RefreshReg\$\(/,S=`import { injectIntoGlobalHook } from "__BASE__${y.slice(1)}";
2
+ injectIntoGlobalHook(window);
3
+ window.$RefreshReg$ = () => {};
4
+ window.$RefreshSig$ = () => (type) => type;`,C=e=>S.replace(`__BASE__`,e);function w(e,t,n,r=``){let i=x.test(e),a=!i&&b.test(e);if(!i&&!a)return;let o=e;return o+=`
5
+
6
+ import * as RefreshRuntime from "${r}${y}";
7
+ const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope;
8
+ if (import.meta.hot && !inWebWorker) {
9
+ if (!window.$RefreshReg$) {
10
+ throw new Error(
11
+ "${t} can't detect preamble. Something is wrong."
12
+ );
13
+ }
14
+
15
+ RefreshRuntime.__hmr_import(import.meta.url).then((currentExports) => {
16
+ RefreshRuntime.registerExportsForReactRefresh(${JSON.stringify(n)}, currentExports);
17
+ import.meta.hot.accept((nextExports) => {
18
+ if (!nextExports) return;
19
+ const invalidateMessage = RefreshRuntime.validateRefreshBoundaryAndEnqueueUpdate(${JSON.stringify(n)}, currentExports, nextExports);
20
+ if (invalidateMessage) import.meta.hot.invalidate(invalidateMessage);
21
+ });
22
+ });
23
+ }
24
+ `,i&&(o+=`function $RefreshReg$(type, id) { return RefreshRuntime.register(type, ${JSON.stringify(n)} + ' ' + id) }
25
+ function $RefreshSig$() { return RefreshRuntime.createSignatureFunctionForTransform(); }
26
+ `),o}function T({name:e,isEnabled:t}){return{name:`vite:react-virtual-preamble`,resolveId:{order:`pre`,filter:{id:p(e)},handler(t){if(t===e)return`\0`+t}},load:{filter:{id:p(`\0`+e)},handler(n){if(n===`\0`+e)return t()?S.replace(`__BASE__`,`/`):``}}}}const E=e=>({rollupOptions:{onwarn(t,n){t.code===`MODULE_LEVEL_DIRECTIVE`&&(t.message.includes(`use client`)||t.message.includes(`use server`))||t.code===`SOURCEMAP_ERROR`&&t.message.includes(`resolve original location`)&&t.pos===0||(e.build?.rollupOptions?.onwarn?e.build.rollupOptions.onwarn(t,n):n(t))}}}),D=o(a(s(import.meta.url)),`refresh-runtime.js`);let O;async function k(){return O||=await import(`./lib-BkrbWMaV.mjs`).then(t(1)),O}const A=/\.[tj]sx?$/,j=/\/node_modules\//,M=/\.tsx?$/,N=/['"]use memo['"]/;function P(e={}){let t=e.include??A,n=e.exclude??j,r=u(t,n),i=e.jsxImportSource??`react`,a=`${i}/jsx-runtime`,o=`${i}/jsx-dev-runtime`,s=`rolldownVersion`in l,d=!1,f=!0,m=process.cwd(),h=!0,_,v=!1,b,x,S=/\bimport\s+(?:\*\s+as\s+)?React\b/,O={name:`vite:react-babel`,enforce:`pre`,config(r,{command:i}){return`rolldownVersion`in l?e.jsxRuntime===`classic`?{oxc:{jsx:{runtime:`classic`,refresh:i===`serve`,development:!1},jsxRefreshInclude:g(t),jsxRefreshExclude:g(n)}}:{oxc:{jsx:{runtime:`automatic`,importSource:e.jsxImportSource,refresh:i===`serve`},jsxRefreshInclude:g(t),jsxRefreshExclude:g(n)},optimizeDeps:{rolldownOptions:{transform:{jsx:{runtime:`automatic`}}}}}:e.jsxRuntime===`classic`?{esbuild:{jsx:`transform`}}:{esbuild:{jsx:`automatic`,jsxImportSource:e.jsxImportSource},optimizeDeps:{esbuildOptions:{jsx:`automatic`}}}},configResolved(t){d=!0,_=t.base,t.experimental.bundledDev&&(v=!0),m=t.root,f=t.isProduction,h=f||t.command===`build`||t.server.hmr===!1;let n=t.plugins.map(e=>e.api?.reactBabel).filter(B);n.length>0?b=(e,r)=>{n.forEach(n=>n(e,r,t))}:typeof e.babel!=`function`&&(x=z(e.babel),(s||h)&&I(x.plugins,x)&&(e.jsxRuntime!==`classic`||f)&&delete O.transform)},options(t){if(!d)return t.transform??={},t.transform.jsx={runtime:e.jsxRuntime,importSource:e.jsxImportSource},t},transform:{filter:{id:{include:g(t),exclude:g(n)}},async handler(t,n,i){let[c]=n.split(`?`);if(!r(c))return;let l=i?.ssr===!0,u=(()=>{if(x)return x;let t=z(typeof e.babel==`function`?e.babel(n,{ssr:l}):e.babel);return b?.(t,{id:n,ssr:l}),t})(),d=[...u.plugins],p=V(d);p&&l&&(d.splice(d.indexOf(p),1),p=void 0),Array.isArray(p)&&p[1]?.compilationMode===`annotation`&&!N.test(t)&&(d.splice(d.indexOf(p),1),p=void 0);let g=c.endsWith(`x`),_=!(s||h)&&!l&&(g||(e.jsxRuntime===`classic`?S.test(t):t.includes(o)||t.includes(a)));if(_&&d.push([await R(`react-refresh/babel`),{skipEnvCheck:!0}]),e.jsxRuntime===`classic`&&g&&(f||d.push(await R(`@babel/plugin-transform-react-jsx-self`),await R(`@babel/plugin-transform-react-jsx-source`))),I(d,u))return;let v=[...u.parserOpts.plugins];c.endsWith(`.ts`)||v.push(`jsx`),M.test(c)&&v.push(`typescript`);let y=await(await k()).transformAsync(t,{...u,root:m,filename:n,sourceFileName:c,retainLines:p?!1:!f&&g&&e.jsxRuntime!==`classic`,parserOpts:{...u.parserOpts,sourceType:`module`,allowAwaitOutsideFunction:!0,plugins:v},generatorOpts:{...u.generatorOpts,importAttributesKeyword:`with`,decoratorsBeforeExport:!0},plugins:d,sourceMaps:!0});if(y)return _?{code:w(y.code,`@vitejs/plugin-react`,n,e.reactRefreshHost)??y.code,map:y.map}:{code:y.code,map:y.map}}}},P={name:`vite:react:refresh-wrapper`,apply:`serve`,async applyToEnvironment(r){if(r.config.consumer!==`client`||h)return!1;let a;try{a=(await import(`vite/internal`)).reactRefreshWrapperPlugin}catch{}return!a||[`7.1.10`,`7.1.11`,`7.1.12`].includes(l.version)?!0:(delete P.transform,a({cwd:process.cwd(),include:g(t),exclude:g(n),jsxImportSource:i,reactRefreshHost:e.reactRefreshHost??``}))},transform:{filter:{id:{include:g(t),exclude:g(n)}},handler(t,n,r){let i=r?.ssr===!0,[s]=n.split(`?`),c=s.endsWith(`x`);if(!(!h&&!i&&(c||t.includes(o)||t.includes(a))))return;let l=w(t,`@vitejs/plugin-react`,n,e.reactRefreshHost);return l?{code:l,map:null}:void 0}}},F={name:`vite:react:config-post`,enforce:`post`,config(e){if(e.server?.hmr===!1)return{oxc:{jsx:{refresh:!1}}}}},L={name:`vite:react-refresh-fbm`,enforce:`pre`,transformIndexHtml:{handler(){if(!h&&v)return[{tag:`script`,attrs:{type:`module`},children:C(_)}]},order:`pre`}},U=[`react`,`react-dom`,o,a],W=V(typeof e.babel==`object`?e.babel?.plugins??[]:[]);if(W!=null){let e=H(W);U.push(e)}let G={name:`vite:react-refresh`,enforce:`pre`,config:e=>({build:E(e),optimizeDeps:{include:U}}),resolveId:{filter:{id:p(y)},handler(e){if(e===y)return e}},load:{filter:{id:p(y)},handler(e){if(e===y)return c(D,`utf-8`).replace(/__README_URL__/g,`https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react`)}},transformIndexHtml(){if(!h&&!v)return[{tag:`script`,attrs:{type:`module`},children:C(_)}]}};return[O,...s?[P,F,L]:[],G,T({name:`@vitejs/plugin-react/preamble`,isEnabled:()=>!h&&!v})]}P.preambleCode=S;function F(e){return P.call(this,e)}Object.assign(F,{default:F});function I(e,t){return!(e.length||t.presets.length||t.configFile||t.babelrc)}const L=new Map;function R(e){let t=L.get(e);if(t)return t;let n=import(e).then(t=>{let n=t.default||t;return L.set(e,n),n});return L.set(e,n),n}function z(e){let t={babelrc:!1,configFile:!1,...e};return t.plugins||=[],t.presets||=[],t.overrides||=[],t.parserOpts||={},t.parserOpts.plugins||=[],t}function B(e){return e!==void 0}function V(e){return e.find(e=>e===`babel-plugin-react-compiler`||Array.isArray(e)&&e[0]===`babel-plugin-react-compiler`)}function H(e){let t=`react/compiler-runtime`;return Array.isArray(e)&&(e[1]?.target===`17`||e[1]?.target===`18`)&&(t=`react-compiler-runtime`),t}var U=n(((e,t)=>{let n=r(`path`),i=e=>{let t=typeof process<`u`&&process.platform===`win32`;return n.posix.normalize(t?e.replace(/\\/g,`/`):e)};t.exports.i18nextHMRPlugin=function(e){let t=[];return{name:`i18next-hmr`,configResolved(r){t=[].concat(e.localesDir,e.localesDirs).filter(Boolean).map(e=>i(n.isAbsolute(e)?e:n.resolve(r.root||process.cwd(),e)))},handleHotUpdate({file:e,server:r}){let i=t.find(t=>e.startsWith(t));if(i){let t=n.extname(e),a=n.posix.relative(i,e);r.ws.send(`i18next-hmr:locale-changed`,{changedFiles:[a.slice(0,-1*t.length||void 0)]})}}}}}))(),W=e(i(),1);function G(e,t){return typeof e==`function`?e(t):e.test(t)}const K=e=>({name:`babel`,setup(t){let{filter:n=/.*/,namespace:r=``,config:i={},loader:a,customFilter:o}=e,s=e=>typeof a==`function`?a(e.path):a,c=async(e,t)=>{let n=W.default.loadOptions({filename:e.path,...i,caller:{name:`esbuild-plugin-babel`,supportsStaticESM:!0}});return n?(n.sourceMaps&&(n.sourceFileName=d.relative(process.cwd(),e.path)),W.default.transformAsync(t,n).then(t=>({contents:t?.code??``,loader:s(e)}))):{contents:t,loader:s(e)}};t.onLoad({filter:/.*/,namespace:r},async e=>{if(o(e.path)&&G(n,e.path))return c(e,await f.promises.readFile(e.path,`utf8`))})}}),q=/\.jsx?$/,J=({babelConfig:e={},filter:t=q,include:n,exclude:r,apply:i,enforce:a=`pre`,loader:o}={})=>{let s=u(n,r);return{name:`babel-plugin`,apply:i,enforce:a,config(){return{optimizeDeps:{esbuildOptions:{plugins:[K({config:{...e},customFilter:s,filter:t,loader:o})]}}}},transform(n,r){if(s(r)&&G(t,r))return W.default.transformAsync(n,{filename:r,...e}).then(e=>({code:e?.code??``,map:e?.map}))}}};function Y(){return{name:`vitest-ssr-fix`,enforce:`post`,config(e){e.ssr?.resolve?.conditions&&(e.ssr.resolve.conditions=e.ssr.resolve.conditions.filter(e=>e!==`module`))}}}var X=U.i18nextHMRPlugin;export{J as babel,X as i18nextHMRPlugin,P as react,Y as vitestSSRFix};