cabloy 5.1.10 → 5.1.12

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 (210) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/lint-staged.config.mjs +92 -0
  3. package/oxfmt.config.ts +4 -1
  4. package/package.json +2 -11
  5. package/vona/packages-utils/lint/api/tsconfig.base.esm.json +30 -2
  6. package/vona/packages-utils/lint/package.json +40 -5
  7. package/vona/packages-utils/lint/src/index.ts +3 -0
  8. package/vona/packages-utils/lint/{oxc/format.js → src/oxc/format.ts} +4 -2
  9. package/vona/packages-utils/lint/{oxc/lint.js → src/oxc/lint.ts} +7 -7
  10. package/vona/packages-utils/lint/{oxc/lintVue.js → src/oxc/lintVue.ts} +4 -6
  11. package/vona/packages-utils/lint/tsconfig.json +14 -0
  12. package/vona/pnpm-lock.yaml +338 -17
  13. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/.metadata/index.ts +0 -78
  14. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/controller/toolOne.ts +3 -1
  15. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/controller/toolTwo.ts +3 -1
  16. package/zova/env/.env.ssr.cabloyBasicAdmin +0 -2
  17. package/zova/package.original.json +2 -8
  18. package/zova/packages-cli/cli/package.json +2 -2
  19. package/zova/packages-cli/cli-set-front/package.json +8 -8
  20. package/zova/packages-utils/babel-plugin-zova-bean-module/package.json +3 -3
  21. package/zova/packages-utils/babel-plugin-zova-bean-use/package.json +2 -2
  22. package/zova/packages-utils/babel-plugin-zova-behavior/package.json +2 -2
  23. package/zova/packages-utils/babel-plugin-zova-component/package.json +2 -2
  24. package/zova/packages-utils/logger/package.json +2 -2
  25. package/zova/packages-utils/mutate-on-copy/package.json +2 -2
  26. package/zova/packages-utils/quasar-app-extension-zova/package.json +3 -3
  27. package/zova/packages-utils/word-utils/package.json +2 -2
  28. package/zova/packages-utils/zova-jsx/package.json +4 -4
  29. package/zova/packages-utils/zova-openapi/package.json +2 -2
  30. package/zova/packages-utils/zova-vite/package.json +6 -6
  31. package/zova/packages-zova/zova/package.json +4 -4
  32. package/zova/packages-zova/zova-core/package.json +4 -4
  33. package/zova/pnpm-lock.yaml +67 -63
  34. package/zova/src/suite/a-demo/modules/demo-basic/package.json +1 -1
  35. package/zova/src/suite/a-demo/modules/demo-todo/package.json +1 -1
  36. package/zova/src/suite/a-demo/package.json +1 -1
  37. package/zova/src/suite/a-devui/modules/devui-adapter/package.json +1 -1
  38. package/zova/src/suite/a-devui/package.json +1 -1
  39. package/zova/src/suite/a-home/modules/home-api/package.json +1 -1
  40. package/zova/src/suite/a-home/modules/home-base/package.json +1 -1
  41. package/zova/src/suite/a-home/modules/home-icon/package.json +1 -1
  42. package/zova/src/suite/a-home/modules/home-index/package.json +1 -1
  43. package/zova/src/suite/a-home/modules/home-layoutempty/package.json +1 -1
  44. package/zova/src/suite/a-home/modules/home-layouttabs/package.json +1 -1
  45. package/zova/src/suite/a-home/modules/home-login/package.json +1 -1
  46. package/zova/src/suite/a-home/modules/home-passport/package.json +1 -1
  47. package/zova/src/suite/a-home/modules/home-theme/package.json +1 -1
  48. package/zova/src/suite/a-home/package.json +1 -1
  49. package/zova/src/suite/cabloy-basic/modules/basic-adapter/package.json +1 -1
  50. package/zova/src/suite/cabloy-basic/modules/basic-captcha/package.json +1 -1
  51. package/zova/src/suite/cabloy-basic/modules/basic-commands/package.json +1 -1
  52. package/zova/src/suite/cabloy-basic/modules/basic-commandssync/package.json +1 -1
  53. package/zova/src/suite/cabloy-basic/modules/basic-currency/package.json +1 -1
  54. package/zova/src/suite/cabloy-basic/modules/basic-date/package.json +1 -1
  55. package/zova/src/suite/cabloy-basic/modules/basic-form/package.json +1 -1
  56. package/zova/src/suite/cabloy-basic/modules/basic-input/package.json +1 -1
  57. package/zova/src/suite/cabloy-basic/modules/basic-page/package.json +1 -1
  58. package/zova/src/suite/cabloy-basic/modules/basic-pageentry/package.json +1 -1
  59. package/zova/src/suite/cabloy-basic/modules/basic-select/package.json +1 -0
  60. package/zova/src/suite/cabloy-basic/modules/basic-table/package.json +1 -1
  61. package/zova/src/suite/cabloy-basic/modules/basic-text/package.json +1 -0
  62. package/zova/src/suite-vendor/a-zova/modules/a-api/package.json +2 -2
  63. package/zova/src/suite-vendor/a-zova/modules/a-app/package.json +2 -2
  64. package/zova/src/suite-vendor/a-zova/modules/a-bean/package.json +2 -2
  65. package/zova/src/suite-vendor/a-zova/modules/a-behavior/package.json +2 -2
  66. package/zova/src/suite-vendor/a-zova/modules/a-behaviors/package.json +2 -2
  67. package/zova/src/suite-vendor/a-zova/modules/a-boundary/package.json +2 -2
  68. package/zova/src/suite-vendor/a-zova/modules/a-command/package.json +2 -2
  69. package/zova/src/suite-vendor/a-zova/modules/a-fetch/package.json +2 -2
  70. package/zova/src/suite-vendor/a-zova/modules/a-form/package.json +2 -2
  71. package/zova/src/suite-vendor/a-zova/modules/a-icon/package.json +2 -2
  72. package/zova/src/suite-vendor/a-zova/modules/a-interceptor/package.json +2 -2
  73. package/zova/src/suite-vendor/a-zova/modules/a-logger/package.json +3 -3
  74. package/zova/src/suite-vendor/a-zova/modules/a-meta/package.json +2 -2
  75. package/zova/src/suite-vendor/a-zova/modules/a-model/package.json +3 -3
  76. package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +2 -2
  77. package/zova/src/suite-vendor/a-zova/modules/a-router/package.json +2 -2
  78. package/zova/src/suite-vendor/a-zova/modules/a-routerstack/package.json +2 -2
  79. package/zova/src/suite-vendor/a-zova/modules/a-routertabs/package.json +2 -2
  80. package/zova/src/suite-vendor/a-zova/modules/a-ssr/package.json +2 -2
  81. package/zova/src/suite-vendor/a-zova/modules/a-ssrhmr/package.json +2 -2
  82. package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/package.json +2 -2
  83. package/zova/src/suite-vendor/a-zova/modules/a-style/package.json +2 -2
  84. package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +2 -2
  85. package/zova/src/suite-vendor/a-zova/modules/a-zod/package.json +2 -2
  86. package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +5 -5
  87. package/zova/src/suite-vendor/a-zova/package.json +27 -27
  88. package/vona/packages-utils/lint/api/eslint.js +0 -41
  89. package/vona/packages-utils/lint/api/prettier.js +0 -8
  90. package/vona/packages-utils/lint/api/tsconfig.base.cjs.json +0 -32
  91. package/vona/packages-utils/lint/common/rules.js +0 -155
  92. package/vona/packages-utils/lint/common/rulesVue.js +0 -5
  93. package/vona/packages-utils/lint/front/eslint.js +0 -59
  94. package/vona/packages-utils/lint/front/prettier.js +0 -3
  95. package/vona/packages-utils/lint/front/tsconfig.base.cjs.json +0 -4
  96. package/vona/packages-utils/lint/front/tsconfig.base.esm.json +0 -9
  97. package/vona/packages-utils/lint/index.js +0 -3
  98. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/-zova-config-CoKN49wO.js +0 -11
  99. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-api-DmsK4zNw.js +0 -178
  100. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-app-C7cTDV9C.js +0 -138
  101. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-bean-qjOwLLml.js +0 -408
  102. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-behavior-I9evY2QT.js +0 -454
  103. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-behaviors-Dh8sE2AX.js +0 -58
  104. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-boundary-DxeJURnH.js +0 -21
  105. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-command-Duq9OGnp.js +0 -165
  106. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-fetch-BsiDc5MA.js +0 -317
  107. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-form-BSfvKLPu.js +0 -947
  108. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-icon-Bx0yNmUB.js +0 -460
  109. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-interceptor-CtK-mG6U.js +0 -256
  110. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-logger-D6FVEo-2.js +0 -143
  111. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-meta-DLAWtBzn.js +0 -47
  112. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-model-Ds17NAa5.js +0 -887
  113. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-openapi-Cu42a7Tj.js +0 -677
  114. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-router-BEKs1P3y.js +0 -1009
  115. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-routerstack-CNda3TvU.js +0 -239
  116. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-routertabs-CA8KhmHx.js +0 -519
  117. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-ssr-WZQfI3lD.js +0 -711
  118. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-ssrhmr-DiG_2CbH.js +0 -97
  119. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-style-Dcrophdv.js +0 -408
  120. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-table-Cr0qHPMV.js +0 -464
  121. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-zod-B5ZzHMKp.js +0 -87
  122. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-zova-WAWkGLRj.js +0 -21
  123. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/auth-Bjup4K84.svg +0 -8
  124. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/axios-jFGAltpb.js +0 -3152
  125. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-adapter-BzdgS83E.js +0 -68
  126. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-captcha-gmlRJxbp.js +0 -209
  127. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-commands-CmuoODyc.js +0 -179
  128. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-commandssync-4uJoTYWO.js +0 -62
  129. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-currency-ljdT_mJv.js +0 -159
  130. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-date-CJtZtM5q.js +0 -251
  131. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-form-Bi-Dm8Pp.js +0 -376
  132. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-input-DugSctyu.js +0 -83
  133. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-page-C0Mpx24A.js +0 -610
  134. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-pageentry-De7Zvv7J.js +0 -443
  135. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-select-WKCF4vyo.js +0 -186
  136. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-table-B4Eyf7EC.js +0 -368
  137. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-text-CRqjMEyr.js +0 -118
  138. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/browser-C8cI94Tr.js +0 -2409
  139. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/business-DQeTVrBD.svg +0 -12
  140. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/daisy-BZm4lJOy.svg +0 -4
  141. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/default-DxTAw1iv.svg +0 -118
  142. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/demo-basic-CiW_uKMD.js +0 -1419
  143. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/demo-student-DpiY4dnt.js +0 -69
  144. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/demo-todo-CM3XdLlo.js +0 -427
  145. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/devui-adapter-B2uiKP95.js +0 -95
  146. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/dist.es2015-BMNhwNBy.js +0 -343
  147. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/editor-CmZexDJp.svg +0 -32
  148. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/emoji-CLaR2GZg.svg +0 -3
  149. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/esm-Z9BncIrt.js +0 -2574
  150. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/extends-BSP9iXrM.js +0 -27
  151. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/fecha-DvkbkxAQ.js +0 -9849
  152. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/flow-DCn4s91p.svg +0 -13
  153. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-api-B1NjQp7i.js +0 -374
  154. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-base-DRJdeGsg.js +0 -654
  155. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-icon-65b9tDB5.js +0 -125
  156. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-index-KrvUKcFR.js +0 -79
  157. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-layoutempty-DP2peKfC.js +0 -87
  158. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-layouttabs-CRIoszHS.js +0 -980
  159. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-login-z4Url6WO.js +0 -302
  160. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-passport-OqpwAU0M.js +0 -293
  161. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-theme-BSua63Y_.js +0 -131
  162. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/index-B5HTgis_.css +0 -26
  163. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/index-Cd4EYYtZ.js +0 -1331
  164. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/localforage-e6vl49GD.js +0 -1798
  165. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/login-Qly1YUqs.svg +0 -7
  166. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/openapi3-jIye4jNw.js +0 -23
  167. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/outline-C6s9io8r.svg +0 -41
  168. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/rest-resource-CN0Ontwm.js +0 -552
  169. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/role-fXTNmWmb.svg +0 -10
  170. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/rolldown-runtime-lkMnaVCm.js +0 -38
  171. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/social-DosI14Uo.svg +0 -12
  172. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/src-BRq8dtuS.js +0 -44
  173. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/src-CBGuKzpF.js +0 -5996
  174. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/src-CzJSxlnS.js +0 -496
  175. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/src-YVxhoO6F.js +0 -65
  176. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tanstack-form-CBq6dr_k.js +0 -122
  177. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tanstack-query-BJk2jOuy.js +0 -2377
  178. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tanstack-query-CBWe1LsT.js +0 -365
  179. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tanstack-query-Ch18aWTP.js +0 -212
  180. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tanstack-table-BvC3VgJj.js +0 -2241
  181. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tanstack-table-D85qomSu.js +0 -123
  182. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tools-Wk7SnIwE.svg +0 -4
  183. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/typestyle-C2zp2284.js +0 -281
  184. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/vue-1Y5FbPzj.js +0 -3221
  185. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/vue-C-LVj1DU.js +0 -18
  186. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/vue-ChEE2n-Y.js +0 -598
  187. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/vue-CvF_GLFp.js +0 -190
  188. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/vue-DHzalQTI.js +0 -1308
  189. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/vue-router-COfHCB5q.js +0 -1775
  190. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/wrapAsyncGenerator-zA6hqk-P.js +0 -155
  191. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-6Abekb1F.js +0 -83
  192. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-BHaXQJg22.js +0 -11
  193. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-BYPEGx1T.js +0 -15586
  194. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-BuxXrZHs.js +0 -24
  195. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-C4pGJxwQ.js +0 -1227
  196. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-CoRfsquu.js +0 -8
  197. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-CzTANp3C.js +0 -380
  198. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-DQbBsEtS.js +0 -4130
  199. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-hmnYQoyt.js +0 -374
  200. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/favicon.ico +0 -0
  201. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/handler.js +0 -164729
  202. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/index.js +0 -26236
  203. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/quasar.manifest.json +0 -1
  204. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/bean/ssrMenu.tools.ts +0 -32
  205. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/bean/ssrMenuGroup.tools.ts +0 -18
  206. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/bean/ssrSite.second.ts +0 -31
  207. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/test/ssr.test.ts +0 -44
  208. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/zovaRest/test-second/index.d.mts +0 -9107
  209. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/zovaRest/test-second/index.mjs +0 -234
  210. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/zovaRest/test-second/package.json +0 -40
@@ -1,2574 +0,0 @@
1
- import { n as __esmMin } from "./rolldown-runtime-lkMnaVCm.js";
2
- import { b as toRaw, h as ref, m as readonly } from "./vue-DHzalQTI.js";
3
- import { k as watch } from "./vue-1Y5FbPzj.js";
4
- import { C as _classPrivateFieldSet2, D as _classPrivateFieldInitSpec, O as init_classPrivateFieldInitSpec, S as init_classPrivateFieldGet2, _ as init_toPropertyKey, d as _objectSpread2, f as init_objectSpread2, i as init_objectWithoutProperties, m as init_asyncToGenerator, p as _asyncToGenerator, r as _objectWithoutProperties, v as toPropertyKey, w as init_classPrivateFieldSet2, x as _classPrivateFieldGet2 } from "./fecha-DvkbkxAQ.js";
5
- import { a as init_lib } from "./extends-BSP9iXrM.js";
6
- //#region node_modules/.pnpm/@tanstack+store@0.9.3/node_modules/@tanstack/store/dist/esm/alien.js
7
- /* @__NO_SIDE_EFFECTS__ */
8
- function createReactiveSystem({ update, notify, unwatched }) {
9
- return {
10
- link,
11
- unlink,
12
- propagate,
13
- checkDirty,
14
- shallowPropagate
15
- };
16
- function link(dep, sub, version) {
17
- const prevDep = sub.depsTail;
18
- if (prevDep !== void 0 && prevDep.dep === dep) return;
19
- const nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;
20
- if (nextDep !== void 0 && nextDep.dep === dep) {
21
- nextDep.version = version;
22
- sub.depsTail = nextDep;
23
- return;
24
- }
25
- const prevSub = dep.subsTail;
26
- if (prevSub !== void 0 && prevSub.version === version && prevSub.sub === sub) return;
27
- const newLink = sub.depsTail = dep.subsTail = {
28
- version,
29
- dep,
30
- sub,
31
- prevDep,
32
- nextDep,
33
- prevSub,
34
- nextSub: void 0
35
- };
36
- if (nextDep !== void 0) nextDep.prevDep = newLink;
37
- if (prevDep !== void 0) prevDep.nextDep = newLink;
38
- else sub.deps = newLink;
39
- if (prevSub !== void 0) prevSub.nextSub = newLink;
40
- else dep.subs = newLink;
41
- }
42
- function unlink(link2, sub = link2.sub) {
43
- const dep = link2.dep;
44
- const prevDep = link2.prevDep;
45
- const nextDep = link2.nextDep;
46
- const nextSub = link2.nextSub;
47
- const prevSub = link2.prevSub;
48
- if (nextDep !== void 0) nextDep.prevDep = prevDep;
49
- else sub.depsTail = prevDep;
50
- if (prevDep !== void 0) prevDep.nextDep = nextDep;
51
- else sub.deps = nextDep;
52
- if (nextSub !== void 0) nextSub.prevSub = prevSub;
53
- else dep.subsTail = prevSub;
54
- if (prevSub !== void 0) prevSub.nextSub = nextSub;
55
- else if ((dep.subs = nextSub) === void 0) unwatched(dep);
56
- return nextDep;
57
- }
58
- function propagate(link2) {
59
- let next = link2.nextSub;
60
- let stack;
61
- top: do {
62
- const sub = link2.sub;
63
- let flags = sub.flags;
64
- if (!(flags & 60)) sub.flags = flags | 32;
65
- else if (!(flags & 12)) flags = 0;
66
- else if (!(flags & 4)) sub.flags = flags & -9 | 32;
67
- else if (!(flags & 48) && isValidLink(link2, sub)) {
68
- sub.flags = flags | 40;
69
- flags &= 1;
70
- } else flags = 0;
71
- if (flags & 2) notify(sub);
72
- if (flags & 1) {
73
- const subSubs = sub.subs;
74
- if (subSubs !== void 0) {
75
- const nextSub = (link2 = subSubs).nextSub;
76
- if (nextSub !== void 0) {
77
- stack = {
78
- value: next,
79
- prev: stack
80
- };
81
- next = nextSub;
82
- }
83
- continue;
84
- }
85
- }
86
- if ((link2 = next) !== void 0) {
87
- next = link2.nextSub;
88
- continue;
89
- }
90
- while (stack !== void 0) {
91
- link2 = stack.value;
92
- stack = stack.prev;
93
- if (link2 !== void 0) {
94
- next = link2.nextSub;
95
- continue top;
96
- }
97
- }
98
- break;
99
- } while (true);
100
- }
101
- function checkDirty(link2, sub) {
102
- let stack;
103
- let checkDepth = 0;
104
- let dirty = false;
105
- top: do {
106
- const dep = link2.dep;
107
- const flags = dep.flags;
108
- if (sub.flags & 16) dirty = true;
109
- else if ((flags & 17) === 17) {
110
- if (update(dep)) {
111
- const subs = dep.subs;
112
- if (subs.nextSub !== void 0) shallowPropagate(subs);
113
- dirty = true;
114
- }
115
- } else if ((flags & 33) === 33) {
116
- if (link2.nextSub !== void 0 || link2.prevSub !== void 0) stack = {
117
- value: link2,
118
- prev: stack
119
- };
120
- link2 = dep.deps;
121
- sub = dep;
122
- ++checkDepth;
123
- continue;
124
- }
125
- if (!dirty) {
126
- const nextDep = link2.nextDep;
127
- if (nextDep !== void 0) {
128
- link2 = nextDep;
129
- continue;
130
- }
131
- }
132
- while (checkDepth--) {
133
- const firstSub = sub.subs;
134
- const hasMultipleSubs = firstSub.nextSub !== void 0;
135
- if (hasMultipleSubs) {
136
- link2 = stack.value;
137
- stack = stack.prev;
138
- } else link2 = firstSub;
139
- if (dirty) {
140
- if (update(sub)) {
141
- if (hasMultipleSubs) shallowPropagate(firstSub);
142
- sub = link2.sub;
143
- continue;
144
- }
145
- dirty = false;
146
- } else sub.flags &= -33;
147
- sub = link2.sub;
148
- const nextDep = link2.nextDep;
149
- if (nextDep !== void 0) {
150
- link2 = nextDep;
151
- continue top;
152
- }
153
- }
154
- return dirty;
155
- } while (true);
156
- }
157
- function shallowPropagate(link2) {
158
- do {
159
- const sub = link2.sub;
160
- const flags = sub.flags;
161
- if ((flags & 48) === 32) {
162
- sub.flags = flags | 16;
163
- if ((flags & 6) === 2) notify(sub);
164
- }
165
- } while ((link2 = link2.nextSub) !== void 0);
166
- }
167
- function isValidLink(checkLink, sub) {
168
- let link2 = sub.depsTail;
169
- while (link2 !== void 0) {
170
- if (link2 === checkLink) return true;
171
- link2 = link2.prevDep;
172
- }
173
- return false;
174
- }
175
- }
176
- var ReactiveFlags;
177
- var init_alien = __esmMin((() => {
178
- ReactiveFlags = /* @__PURE__ */ ((ReactiveFlags2) => {
179
- ReactiveFlags2[ReactiveFlags2["None"] = 0] = "None";
180
- ReactiveFlags2[ReactiveFlags2["Mutable"] = 1] = "Mutable";
181
- ReactiveFlags2[ReactiveFlags2["Watching"] = 2] = "Watching";
182
- ReactiveFlags2[ReactiveFlags2["RecursedCheck"] = 4] = "RecursedCheck";
183
- ReactiveFlags2[ReactiveFlags2["Recursed"] = 8] = "Recursed";
184
- ReactiveFlags2[ReactiveFlags2["Dirty"] = 16] = "Dirty";
185
- ReactiveFlags2[ReactiveFlags2["Pending"] = 32] = "Pending";
186
- return ReactiveFlags2;
187
- })(ReactiveFlags || {});
188
- }));
189
- //#endregion
190
- //#region node_modules/.pnpm/@tanstack+store@0.9.3/node_modules/@tanstack/store/dist/esm/atom.js
191
- function toObserver(nextHandler, errorHandler, completionHandler) {
192
- var _ref, _ref2, _ref3;
193
- const isObserver = typeof nextHandler === "object";
194
- const self = isObserver ? nextHandler : void 0;
195
- return {
196
- next: (_ref = isObserver ? nextHandler.next : nextHandler) === null || _ref === void 0 ? void 0 : _ref.bind(self),
197
- error: (_ref2 = isObserver ? nextHandler.error : errorHandler) === null || _ref2 === void 0 ? void 0 : _ref2.bind(self),
198
- complete: (_ref3 = isObserver ? nextHandler.complete : completionHandler) === null || _ref3 === void 0 ? void 0 : _ref3.bind(self)
199
- };
200
- }
201
- function batch(fn) {
202
- try {
203
- ++batchDepth;
204
- fn();
205
- } finally {
206
- if (!--batchDepth) flush();
207
- }
208
- }
209
- function purgeDeps(sub) {
210
- const depsTail = sub.depsTail;
211
- let dep = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
212
- while (dep !== void 0) dep = unlink(dep, sub);
213
- }
214
- function flush() {
215
- if (batchDepth > 0) return;
216
- while (notifyIndex < queuedEffectsLength) {
217
- const effect2 = queuedEffects[notifyIndex];
218
- queuedEffects[notifyIndex++] = void 0;
219
- effect2.notify();
220
- }
221
- notifyIndex = 0;
222
- queuedEffectsLength = 0;
223
- }
224
- function createAtom(valueOrFn, options) {
225
- const isComputed = typeof valueOrFn === "function";
226
- const getter = valueOrFn;
227
- const atom = {
228
- _snapshot: isComputed ? void 0 : valueOrFn,
229
- subs: void 0,
230
- subsTail: void 0,
231
- deps: void 0,
232
- depsTail: void 0,
233
- flags: isComputed ? ReactiveFlags.None : ReactiveFlags.Mutable,
234
- get() {
235
- if (activeSub !== void 0) link(atom, activeSub, cycle);
236
- return atom._snapshot;
237
- },
238
- subscribe(observerOrFn) {
239
- const obs = toObserver(observerOrFn);
240
- const observed = { current: false };
241
- const e = effect(() => {
242
- atom.get();
243
- if (!observed.current) observed.current = true;
244
- else {
245
- var _obs$next;
246
- (_obs$next = obs.next) === null || _obs$next === void 0 || _obs$next.call(obs, atom._snapshot);
247
- }
248
- });
249
- return { unsubscribe: () => {
250
- e.stop();
251
- } };
252
- },
253
- _update(getValue) {
254
- var _options$compare;
255
- const prevSub = activeSub;
256
- const compare = (_options$compare = options === null || options === void 0 ? void 0 : options.compare) !== null && _options$compare !== void 0 ? _options$compare : Object.is;
257
- if (isComputed) {
258
- activeSub = atom;
259
- ++cycle;
260
- atom.depsTail = void 0;
261
- } else if (getValue === void 0) return false;
262
- if (isComputed) atom.flags = ReactiveFlags.Mutable | ReactiveFlags.RecursedCheck;
263
- try {
264
- const oldValue = atom._snapshot;
265
- const newValue = typeof getValue === "function" ? getValue(oldValue) : getValue === void 0 && isComputed ? getter(oldValue) : getValue;
266
- if (oldValue === void 0 || !compare(oldValue, newValue)) {
267
- atom._snapshot = newValue;
268
- return true;
269
- }
270
- return false;
271
- } finally {
272
- activeSub = prevSub;
273
- if (isComputed) atom.flags &= ~ReactiveFlags.RecursedCheck;
274
- purgeDeps(atom);
275
- }
276
- }
277
- };
278
- if (isComputed) {
279
- atom.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty;
280
- atom.get = function() {
281
- const flags = atom.flags;
282
- if (flags & ReactiveFlags.Dirty || flags & ReactiveFlags.Pending && checkDirty(atom.deps, atom)) {
283
- if (atom._update()) {
284
- const subs = atom.subs;
285
- if (subs !== void 0) shallowPropagate(subs);
286
- }
287
- } else if (flags & ReactiveFlags.Pending) atom.flags = flags & ~ReactiveFlags.Pending;
288
- if (activeSub !== void 0) link(atom, activeSub, cycle);
289
- return atom._snapshot;
290
- };
291
- } else atom.set = function(valueOrFn2) {
292
- if (atom._update(valueOrFn2)) {
293
- const subs = atom.subs;
294
- if (subs !== void 0) {
295
- propagate(subs);
296
- shallowPropagate(subs);
297
- flush();
298
- }
299
- }
300
- };
301
- return atom;
302
- }
303
- function effect(fn) {
304
- const run = () => {
305
- const prevSub = activeSub;
306
- activeSub = effectObj;
307
- ++cycle;
308
- effectObj.depsTail = void 0;
309
- effectObj.flags = ReactiveFlags.Watching | ReactiveFlags.RecursedCheck;
310
- try {
311
- return fn();
312
- } finally {
313
- activeSub = prevSub;
314
- effectObj.flags &= ~ReactiveFlags.RecursedCheck;
315
- purgeDeps(effectObj);
316
- }
317
- };
318
- const effectObj = {
319
- deps: void 0,
320
- depsTail: void 0,
321
- subs: void 0,
322
- subsTail: void 0,
323
- flags: ReactiveFlags.Watching | ReactiveFlags.RecursedCheck,
324
- notify() {
325
- const flags = this.flags;
326
- if (flags & ReactiveFlags.Dirty || flags & ReactiveFlags.Pending && checkDirty(this.deps, this)) run();
327
- else this.flags = ReactiveFlags.Watching;
328
- },
329
- stop() {
330
- this.flags = ReactiveFlags.None;
331
- this.depsTail = void 0;
332
- purgeDeps(this);
333
- }
334
- };
335
- run();
336
- return effectObj;
337
- }
338
- var queuedEffects, cycle, link, unlink, propagate, checkDirty, shallowPropagate, notifyIndex, queuedEffectsLength, activeSub, batchDepth;
339
- var init_atom = __esmMin((() => {
340
- init_alien();
341
- queuedEffects = [];
342
- cycle = 0;
343
- ({link, unlink, propagate, checkDirty, shallowPropagate} = /* @__PURE__ */ createReactiveSystem({
344
- update(atom) {
345
- return atom._update();
346
- },
347
- notify(effect2) {
348
- queuedEffects[queuedEffectsLength++] = effect2;
349
- effect2.flags &= ~ReactiveFlags.Watching;
350
- },
351
- unwatched(atom) {
352
- if (atom.depsTail !== void 0) {
353
- atom.depsTail = void 0;
354
- atom.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty;
355
- purgeDeps(atom);
356
- }
357
- }
358
- }));
359
- notifyIndex = 0;
360
- queuedEffectsLength = 0;
361
- batchDepth = 0;
362
- }));
363
- //#endregion
364
- //#region node_modules/.pnpm/@tanstack+store@0.9.3/node_modules/@tanstack/store/dist/esm/store.js
365
- function createStore(valueOrFn) {
366
- if (typeof valueOrFn === "function") return new ReadonlyStore(valueOrFn);
367
- return new Store(valueOrFn);
368
- }
369
- var Store, ReadonlyStore;
370
- var init_store = __esmMin((() => {
371
- init_atom();
372
- Store = class {
373
- constructor(valueOrFn) {
374
- this.atom = createAtom(valueOrFn);
375
- }
376
- setState(updater) {
377
- this.atom.set(updater);
378
- }
379
- get state() {
380
- return this.atom.get();
381
- }
382
- get() {
383
- return this.state;
384
- }
385
- subscribe(observerOrFn) {
386
- return this.atom.subscribe(toObserver(observerOrFn));
387
- }
388
- };
389
- ReadonlyStore = class {
390
- constructor(valueOrFn) {
391
- this.atom = createAtom(valueOrFn);
392
- }
393
- get state() {
394
- return this.atom.get();
395
- }
396
- get() {
397
- return this.state;
398
- }
399
- subscribe(observerOrFn) {
400
- return this.atom.subscribe(toObserver(observerOrFn));
401
- }
402
- };
403
- }));
404
- //#endregion
405
- //#region node_modules/.pnpm/@tanstack+store@0.9.3/node_modules/@tanstack/store/dist/esm/index.js
406
- var init_esm$3 = __esmMin((() => {
407
- init_atom();
408
- init_store();
409
- }));
410
- //#endregion
411
- //#region node_modules/.pnpm/@tanstack+pacer-lite@0.1.1/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js
412
- /**
413
- * Creates a lightweight throttled function that limits how often the provided function can execute.
414
- *
415
- * This is an alternative to the throttle function in the core @tanstack/pacer package, but is more
416
- * suitable for libraries and npm packages that need minimal overhead. Unlike the core version,
417
- * this function creates a throttler with no external dependencies, devtools integration, or reactive state.
418
- *
419
- * Throttling ensures a function executes at most once within a specified time window,
420
- * regardless of how many times it is called. This is useful for rate-limiting
421
- * expensive operations or UI updates.
422
- *
423
- * @example
424
- * ```ts
425
- * const throttledScroll = liteThrottle(() => {
426
- * updateScrollIndicator();
427
- * }, { wait: 100 });
428
- *
429
- * // Will execute at most once per 100ms
430
- * window.addEventListener('scroll', throttledScroll);
431
- * ```
432
- *
433
- * @example
434
- * ```ts
435
- * // Leading edge execution - fires immediately then throttles
436
- * const throttledResize = liteThrottle(() => {
437
- * recalculateLayout();
438
- * }, { wait: 250, leading: true, trailing: false });
439
- * ```
440
- */
441
- function liteThrottle(fn, options) {
442
- return new LiteThrottler(fn, options).maybeExecute;
443
- }
444
- var LiteThrottler;
445
- var init_lite_throttler = __esmMin((() => {
446
- LiteThrottler = class {
447
- constructor(fn, options) {
448
- this.fn = fn;
449
- this.options = options;
450
- this.lastExecutionTime = 0;
451
- this.isPending = false;
452
- this.maybeExecute = (...args) => {
453
- const timeSinceLastExecution = Date.now() - this.lastExecutionTime;
454
- if (this.options.leading && timeSinceLastExecution >= this.options.wait) this.execute(...args);
455
- else {
456
- this.lastArgs = args;
457
- if (!this.timeoutId && this.options.trailing) {
458
- const timeoutDuration = this.options.wait - timeSinceLastExecution;
459
- this.isPending = true;
460
- this.timeoutId = setTimeout(() => {
461
- if (this.lastArgs !== void 0) this.execute(...this.lastArgs);
462
- }, timeoutDuration);
463
- }
464
- }
465
- };
466
- this.execute = (...args) => {
467
- var _this$options$onExecu, _this$options;
468
- this.fn(...args);
469
- (_this$options$onExecu = (_this$options = this.options).onExecute) === null || _this$options$onExecu === void 0 || _this$options$onExecu.call(_this$options, args, this);
470
- this.lastExecutionTime = Date.now();
471
- this.clearTimeout();
472
- this.lastArgs = void 0;
473
- this.isPending = false;
474
- };
475
- this.flush = () => {
476
- if (this.isPending && this.lastArgs) this.execute(...this.lastArgs);
477
- };
478
- this.cancel = () => {
479
- this.clearTimeout();
480
- this.lastArgs = void 0;
481
- this.isPending = false;
482
- };
483
- this.clearTimeout = () => {
484
- if (this.timeoutId) {
485
- clearTimeout(this.timeoutId);
486
- this.timeoutId = void 0;
487
- }
488
- };
489
- if (this.options.leading === void 0 && this.options.trailing === void 0) {
490
- this.options.leading = true;
491
- this.options.trailing = true;
492
- }
493
- }
494
- };
495
- }));
496
- //#endregion
497
- //#region node_modules/.pnpm/@tanstack+pacer-lite@0.1.1/node_modules/@tanstack/pacer-lite/dist/index.js
498
- var init_dist = __esmMin((() => {
499
- init_lite_throttler();
500
- }));
501
- //#endregion
502
- //#region node_modules/.pnpm/@tanstack+devtools-event-client@0.4.3/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js
503
- var _enabled, _pluginId, _eventTarget, _debug, _queuedEvents, _connected, _connectIntervalId, _connectEveryMs, _retryCount, _maxRetries, _connecting, _failedToConnect, _internalEventTarget, _onConnected, _retryConnection, _connectFunction, EventClient;
504
- var init_plugin = __esmMin((() => {
505
- init_classPrivateFieldInitSpec();
506
- init_classPrivateFieldSet2();
507
- init_classPrivateFieldGet2();
508
- _enabled = /* @__PURE__ */ new WeakMap();
509
- _pluginId = /* @__PURE__ */ new WeakMap();
510
- _eventTarget = /* @__PURE__ */ new WeakMap();
511
- _debug = /* @__PURE__ */ new WeakMap();
512
- _queuedEvents = /* @__PURE__ */ new WeakMap();
513
- _connected = /* @__PURE__ */ new WeakMap();
514
- _connectIntervalId = /* @__PURE__ */ new WeakMap();
515
- _connectEveryMs = /* @__PURE__ */ new WeakMap();
516
- _retryCount = /* @__PURE__ */ new WeakMap();
517
- _maxRetries = /* @__PURE__ */ new WeakMap();
518
- _connecting = /* @__PURE__ */ new WeakMap();
519
- _failedToConnect = /* @__PURE__ */ new WeakMap();
520
- _internalEventTarget = /* @__PURE__ */ new WeakMap();
521
- _onConnected = /* @__PURE__ */ new WeakMap();
522
- _retryConnection = /* @__PURE__ */ new WeakMap();
523
- _connectFunction = /* @__PURE__ */ new WeakMap();
524
- EventClient = class {
525
- constructor({ pluginId, debug = false, enabled = true, reconnectEveryMs = 300 }) {
526
- _classPrivateFieldInitSpec(this, _enabled, true);
527
- _classPrivateFieldInitSpec(this, _pluginId, void 0);
528
- _classPrivateFieldInitSpec(this, _eventTarget, void 0);
529
- _classPrivateFieldInitSpec(this, _debug, void 0);
530
- _classPrivateFieldInitSpec(this, _queuedEvents, void 0);
531
- _classPrivateFieldInitSpec(this, _connected, void 0);
532
- _classPrivateFieldInitSpec(this, _connectIntervalId, void 0);
533
- _classPrivateFieldInitSpec(this, _connectEveryMs, void 0);
534
- _classPrivateFieldInitSpec(this, _retryCount, 0);
535
- _classPrivateFieldInitSpec(this, _maxRetries, 5);
536
- _classPrivateFieldInitSpec(this, _connecting, false);
537
- _classPrivateFieldInitSpec(this, _failedToConnect, false);
538
- _classPrivateFieldInitSpec(this, _internalEventTarget, null);
539
- _classPrivateFieldInitSpec(this, _onConnected, () => {
540
- this.debugLog("Connected to event bus");
541
- _classPrivateFieldSet2(_connected, this, true);
542
- _classPrivateFieldSet2(_connecting, this, false);
543
- this.debugLog("Emitting queued events", _classPrivateFieldGet2(_queuedEvents, this));
544
- _classPrivateFieldGet2(_queuedEvents, this).forEach((event) => this.emitEventToBus(event));
545
- _classPrivateFieldSet2(_queuedEvents, this, []);
546
- this.stopConnectLoop();
547
- _classPrivateFieldGet2(_eventTarget, this).call(this).removeEventListener("tanstack-connect-success", _classPrivateFieldGet2(_onConnected, this));
548
- });
549
- _classPrivateFieldInitSpec(this, _retryConnection, () => {
550
- if (_classPrivateFieldGet2(_retryCount, this) < _classPrivateFieldGet2(_maxRetries, this)) {
551
- var _this$retryCount;
552
- _classPrivateFieldSet2(_retryCount, this, (_this$retryCount = _classPrivateFieldGet2(_retryCount, this), _this$retryCount++, _this$retryCount));
553
- this.dispatchCustomEvent("tanstack-connect", {});
554
- return;
555
- }
556
- _classPrivateFieldGet2(_eventTarget, this).call(this).removeEventListener("tanstack-connect", _classPrivateFieldGet2(_retryConnection, this));
557
- _classPrivateFieldSet2(_failedToConnect, this, true);
558
- this.debugLog("Max retries reached, giving up on connection");
559
- this.stopConnectLoop();
560
- });
561
- _classPrivateFieldInitSpec(this, _connectFunction, () => {
562
- if (_classPrivateFieldGet2(_connecting, this)) return;
563
- _classPrivateFieldSet2(_connecting, this, true);
564
- _classPrivateFieldGet2(_eventTarget, this).call(this).addEventListener("tanstack-connect-success", _classPrivateFieldGet2(_onConnected, this));
565
- _classPrivateFieldGet2(_retryConnection, this).call(this);
566
- });
567
- _classPrivateFieldSet2(_pluginId, this, pluginId);
568
- _classPrivateFieldSet2(_enabled, this, enabled);
569
- _classPrivateFieldSet2(_eventTarget, this, this.getGlobalTarget);
570
- _classPrivateFieldSet2(_debug, this, debug);
571
- this.debugLog(" Initializing event subscription for plugin", _classPrivateFieldGet2(_pluginId, this));
572
- _classPrivateFieldSet2(_queuedEvents, this, []);
573
- _classPrivateFieldSet2(_connected, this, false);
574
- _classPrivateFieldSet2(_failedToConnect, this, false);
575
- _classPrivateFieldSet2(_connectIntervalId, this, null);
576
- _classPrivateFieldSet2(_connectEveryMs, this, reconnectEveryMs);
577
- }
578
- startConnectLoop() {
579
- if (_classPrivateFieldGet2(_connectIntervalId, this) !== null || _classPrivateFieldGet2(_connected, this)) return;
580
- this.debugLog(`Starting connect loop (every ${_classPrivateFieldGet2(_connectEveryMs, this)}ms)`);
581
- _classPrivateFieldSet2(_connectIntervalId, this, setInterval(_classPrivateFieldGet2(_retryConnection, this), _classPrivateFieldGet2(_connectEveryMs, this)));
582
- }
583
- stopConnectLoop() {
584
- _classPrivateFieldSet2(_connecting, this, false);
585
- if (_classPrivateFieldGet2(_connectIntervalId, this) === null) return;
586
- clearInterval(_classPrivateFieldGet2(_connectIntervalId, this));
587
- _classPrivateFieldSet2(_connectIntervalId, this, null);
588
- _classPrivateFieldSet2(_queuedEvents, this, []);
589
- this.debugLog("Stopped connect loop");
590
- }
591
- debugLog(...args) {
592
- if (_classPrivateFieldGet2(_debug, this)) console.log(`🌴 [tanstack-devtools:${_classPrivateFieldGet2(_pluginId, this)}-plugin]`, ...args);
593
- }
594
- getGlobalTarget() {
595
- if (typeof globalThis !== "undefined" && globalThis.__TANSTACK_EVENT_TARGET__) {
596
- this.debugLog("Using global event target");
597
- return globalThis.__TANSTACK_EVENT_TARGET__;
598
- }
599
- if (typeof window !== "undefined" && typeof window.addEventListener !== "undefined") {
600
- this.debugLog("Using window as event target");
601
- return window;
602
- }
603
- const eventTarget = typeof EventTarget !== "undefined" ? new EventTarget() : void 0;
604
- if (typeof eventTarget === "undefined" || typeof eventTarget.addEventListener === "undefined") {
605
- this.debugLog("No event mechanism available, running in non-web environment");
606
- return {
607
- addEventListener: () => {},
608
- removeEventListener: () => {},
609
- dispatchEvent: () => false
610
- };
611
- }
612
- this.debugLog("Using new EventTarget as fallback");
613
- return eventTarget;
614
- }
615
- getPluginId() {
616
- return _classPrivateFieldGet2(_pluginId, this);
617
- }
618
- dispatchCustomEventShim(eventName, detail) {
619
- try {
620
- const event = new Event(eventName, { detail });
621
- _classPrivateFieldGet2(_eventTarget, this).call(this).dispatchEvent(event);
622
- } catch (e) {
623
- this.debugLog("Failed to dispatch shim event");
624
- }
625
- }
626
- dispatchCustomEvent(eventName, detail) {
627
- try {
628
- _classPrivateFieldGet2(_eventTarget, this).call(this).dispatchEvent(new CustomEvent(eventName, { detail }));
629
- } catch (e) {
630
- this.dispatchCustomEventShim(eventName, detail);
631
- }
632
- }
633
- emitEventToBus(event) {
634
- this.debugLog("Emitting event to client bus", event);
635
- this.dispatchCustomEvent("tanstack-dispatch-event", event);
636
- }
637
- createEventPayload(eventSuffix, payload) {
638
- return {
639
- type: `${_classPrivateFieldGet2(_pluginId, this)}:${eventSuffix}`,
640
- payload,
641
- pluginId: _classPrivateFieldGet2(_pluginId, this)
642
- };
643
- }
644
- emit(eventSuffix, payload) {
645
- if (!_classPrivateFieldGet2(_enabled, this)) {
646
- this.debugLog("Event bus client is disabled, not emitting event", eventSuffix, payload);
647
- return;
648
- }
649
- if (_classPrivateFieldGet2(_internalEventTarget, this)) {
650
- this.debugLog("Emitting event to internal event target", eventSuffix, payload);
651
- _classPrivateFieldGet2(_internalEventTarget, this).dispatchEvent(new CustomEvent(`${_classPrivateFieldGet2(_pluginId, this)}:${eventSuffix}`, { detail: this.createEventPayload(eventSuffix, payload) }));
652
- }
653
- if (_classPrivateFieldGet2(_failedToConnect, this)) {
654
- this.debugLog("Previously failed to connect, not emitting to bus");
655
- return;
656
- }
657
- if (!_classPrivateFieldGet2(_connected, this)) {
658
- this.debugLog("Bus not available, will be pushed as soon as connected");
659
- _classPrivateFieldGet2(_queuedEvents, this).push(this.createEventPayload(eventSuffix, payload));
660
- if (typeof CustomEvent !== "undefined" && !_classPrivateFieldGet2(_connecting, this)) {
661
- _classPrivateFieldGet2(_connectFunction, this).call(this);
662
- this.startConnectLoop();
663
- }
664
- return;
665
- }
666
- return this.emitEventToBus(this.createEventPayload(eventSuffix, payload));
667
- }
668
- on(eventSuffix, cb, options) {
669
- var _options$withEventTar;
670
- const withEventTarget = (_options$withEventTar = options === null || options === void 0 ? void 0 : options.withEventTarget) !== null && _options$withEventTar !== void 0 ? _options$withEventTar : false;
671
- const eventName = `${_classPrivateFieldGet2(_pluginId, this)}:${eventSuffix}`;
672
- if (withEventTarget) {
673
- if (!_classPrivateFieldGet2(_internalEventTarget, this)) _classPrivateFieldSet2(_internalEventTarget, this, new EventTarget());
674
- _classPrivateFieldGet2(_internalEventTarget, this).addEventListener(eventName, (e) => {
675
- cb(e.detail);
676
- });
677
- }
678
- if (!_classPrivateFieldGet2(_enabled, this)) {
679
- this.debugLog("Event bus client is disabled, not registering event", eventName);
680
- return () => {};
681
- }
682
- const handler = (e) => {
683
- this.debugLog("Received event from bus", e.detail);
684
- cb(e.detail);
685
- };
686
- _classPrivateFieldGet2(_eventTarget, this).call(this).addEventListener(eventName, handler);
687
- this.debugLog("Registered event to bus", eventName);
688
- return () => {
689
- if (withEventTarget) {
690
- var _classPrivateFieldGet2$1;
691
- (_classPrivateFieldGet2$1 = _classPrivateFieldGet2(_internalEventTarget, this)) === null || _classPrivateFieldGet2$1 === void 0 || _classPrivateFieldGet2$1.removeEventListener(eventName, handler);
692
- }
693
- _classPrivateFieldGet2(_eventTarget, this).call(this).removeEventListener(eventName, handler);
694
- };
695
- }
696
- onAll(cb) {
697
- if (!_classPrivateFieldGet2(_enabled, this)) {
698
- this.debugLog("Event bus client is disabled, not registering event");
699
- return () => {};
700
- }
701
- const handler = (e) => {
702
- const event = e.detail;
703
- cb(event);
704
- };
705
- _classPrivateFieldGet2(_eventTarget, this).call(this).addEventListener("tanstack-devtools-global", handler);
706
- return () => _classPrivateFieldGet2(_eventTarget, this).call(this).removeEventListener("tanstack-devtools-global", handler);
707
- }
708
- onAllPluginEvents(cb) {
709
- if (!_classPrivateFieldGet2(_enabled, this)) {
710
- this.debugLog("Event bus client is disabled, not registering event");
711
- return () => {};
712
- }
713
- const handler = (e) => {
714
- const event = e.detail;
715
- if (_classPrivateFieldGet2(_pluginId, this) && event.pluginId !== _classPrivateFieldGet2(_pluginId, this)) return;
716
- cb(event);
717
- };
718
- _classPrivateFieldGet2(_eventTarget, this).call(this).addEventListener("tanstack-devtools-global", handler);
719
- return () => _classPrivateFieldGet2(_eventTarget, this).call(this).removeEventListener("tanstack-devtools-global", handler);
720
- }
721
- };
722
- }));
723
- //#endregion
724
- //#region node_modules/.pnpm/@tanstack+devtools-event-client@0.4.3/node_modules/@tanstack/devtools-event-client/dist/esm/index.js
725
- var init_esm$2 = __esmMin((() => {
726
- init_plugin();
727
- }));
728
- //#endregion
729
- //#region node_modules/.pnpm/@tanstack+form-core@1.32.0/node_modules/@tanstack/form-core/dist/esm/EventClient.js
730
- var FormEventClient, formEventClient;
731
- var init_EventClient = __esmMin((() => {
732
- init_esm$2();
733
- FormEventClient = class extends EventClient {
734
- constructor() {
735
- super({
736
- pluginId: "form-devtools",
737
- reconnectEveryMs: 1e3
738
- });
739
- }
740
- };
741
- formEventClient = new FormEventClient();
742
- }));
743
- //#endregion
744
- //#region node_modules/.pnpm/@tanstack+form-core@1.32.0/node_modules/@tanstack/form-core/dist/esm/utils.js
745
- function functionalUpdate(updater, input) {
746
- return typeof updater === "function" ? updater(input) : updater;
747
- }
748
- function getBy(obj, path) {
749
- return makePathArray(path).reduce((current, pathPart) => {
750
- if (current === null) return null;
751
- if (typeof current !== "undefined") return current[pathPart];
752
- }, obj);
753
- }
754
- function setBy(obj, _path, updater) {
755
- const path = makePathArray(_path);
756
- function doSet(parent) {
757
- if (!path.length) return functionalUpdate(updater, parent);
758
- const key = path.shift();
759
- if (typeof key === "string" || typeof key === "number" && !Array.isArray(parent)) {
760
- if (typeof parent === "object") {
761
- if (parent === null) parent = {};
762
- return _objectSpread2(_objectSpread2({}, parent), {}, { [key]: doSet(parent[key]) });
763
- }
764
- return { [key]: doSet() };
765
- }
766
- if (Array.isArray(parent) && typeof key === "number") {
767
- const prefix = parent.slice(0, key);
768
- return [
769
- ...prefix.length ? prefix : new Array(key),
770
- doSet(parent[key]),
771
- ...parent.slice(key + 1)
772
- ];
773
- }
774
- return [...new Array(key), doSet()];
775
- }
776
- return doSet(obj);
777
- }
778
- function deleteBy(obj, _path) {
779
- const path = makePathArray(_path);
780
- function doDelete(parent) {
781
- if (!parent) return;
782
- if (path.length === 1) {
783
- const finalPath = path[0];
784
- if (Array.isArray(parent) && typeof finalPath === "number") return parent.filter((_, i) => i !== finalPath);
785
- const { [finalPath]: remove } = parent;
786
- return _objectWithoutProperties(parent, [finalPath].map(toPropertyKey));
787
- }
788
- const key = path.shift();
789
- if (typeof key === "string" || typeof key === "number" && !Array.isArray(parent)) {
790
- if (typeof parent === "object") return _objectSpread2(_objectSpread2({}, parent), {}, { [key]: doDelete(parent[key]) });
791
- }
792
- if (typeof key === "number") {
793
- if (Array.isArray(parent)) {
794
- if (key >= parent.length) return parent;
795
- const prefix = parent.slice(0, key);
796
- return [
797
- ...prefix.length ? prefix : new Array(key),
798
- doDelete(parent[key]),
799
- ...parent.slice(key + 1)
800
- ];
801
- }
802
- }
803
- throw new Error("It seems we have created an infinite loop in deleteBy. ");
804
- }
805
- return doDelete(obj);
806
- }
807
- function makePathArray(str) {
808
- if (Array.isArray(str)) return [...str];
809
- if (typeof str !== "string") throw new Error("Path must be a string.");
810
- return str.replace(/(^\[)|]/gm, "").replace(/\[/g, ".").replace(reLineOfOnlyDigits, intReplace).replace(reDigitsBetweenDots, `.${intReplace}.`).replace(reStartWithDigitThenDot, `${intReplace}.`).replace(reDotWithDigitsToEnd, `.${intReplace}`).replace(reMultipleDots, ".").split(".").map((d) => {
811
- if (d.startsWith(intPrefix)) {
812
- const numStr = d.substring(7);
813
- const num = parseInt(numStr, 10);
814
- if (String(num) === numStr) return num;
815
- return numStr;
816
- }
817
- return d;
818
- });
819
- }
820
- function isNonEmptyArray(obj) {
821
- return !(Array.isArray(obj) && obj.length === 0);
822
- }
823
- function getSyncValidatorArray(cause, options) {
824
- const runValidation = (props) => {
825
- return props.validators.filter(Boolean).map((validator) => {
826
- return {
827
- cause: validator.cause,
828
- validate: validator.fn
829
- };
830
- });
831
- };
832
- return options.validationLogic({
833
- form: options.form,
834
- validators: options.validators,
835
- event: {
836
- type: cause,
837
- fieldName: options.fieldName,
838
- async: false
839
- },
840
- runValidation
841
- });
842
- }
843
- function getAsyncValidatorArray(cause, options) {
844
- const { asyncDebounceMs } = options;
845
- const { onBlurAsyncDebounceMs, onChangeAsyncDebounceMs, onDynamicAsyncDebounceMs } = options.validators || {};
846
- const defaultDebounceMs = asyncDebounceMs !== null && asyncDebounceMs !== void 0 ? asyncDebounceMs : 0;
847
- const runValidation = (props) => {
848
- return props.validators.filter(Boolean).map((validator) => {
849
- const validatorCause = (validator === null || validator === void 0 ? void 0 : validator.cause) || cause;
850
- let debounceMs = defaultDebounceMs;
851
- switch (validatorCause) {
852
- case "change":
853
- debounceMs = onChangeAsyncDebounceMs !== null && onChangeAsyncDebounceMs !== void 0 ? onChangeAsyncDebounceMs : defaultDebounceMs;
854
- break;
855
- case "blur":
856
- debounceMs = onBlurAsyncDebounceMs !== null && onBlurAsyncDebounceMs !== void 0 ? onBlurAsyncDebounceMs : defaultDebounceMs;
857
- break;
858
- case "dynamic":
859
- debounceMs = onDynamicAsyncDebounceMs !== null && onDynamicAsyncDebounceMs !== void 0 ? onDynamicAsyncDebounceMs : defaultDebounceMs;
860
- break;
861
- case "submit":
862
- debounceMs = 0;
863
- break;
864
- }
865
- if (cause === "submit") debounceMs = 0;
866
- return {
867
- cause: validatorCause,
868
- validate: validator.fn,
869
- debounceMs
870
- };
871
- });
872
- };
873
- return options.validationLogic({
874
- form: options.form,
875
- validators: options.validators,
876
- event: {
877
- type: cause,
878
- fieldName: options.fieldName,
879
- async: true
880
- },
881
- runValidation
882
- });
883
- }
884
- function evaluate(objA, objB) {
885
- if (Object.is(objA, objB)) return true;
886
- if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) return false;
887
- if (objA instanceof Date && objB instanceof Date) return objA.getTime() === objB.getTime();
888
- if (objA instanceof Map && objB instanceof Map) {
889
- if (objA.size !== objB.size) return false;
890
- for (const [k, v] of objA) if (!objB.has(k) || !Object.is(v, objB.get(k))) return false;
891
- return true;
892
- }
893
- if (objA instanceof Set && objB instanceof Set) {
894
- if (objA.size !== objB.size) return false;
895
- for (const v of objA) if (!objB.has(v)) return false;
896
- return true;
897
- }
898
- const keysA = Object.keys(objA);
899
- const keysB = Object.keys(objB);
900
- if (keysA.length !== keysB.length) return false;
901
- if (keysA.length === 0 && !Array.isArray(objA) && !Array.isArray(objB) && (Object.getPrototypeOf(objA) !== Object.prototype || Object.getPrototypeOf(objB) !== Object.prototype)) return false;
902
- for (const key of keysA) if (!keysB.includes(key) || !evaluate(objA[key], objB[key])) return false;
903
- return true;
904
- }
905
- function mergeOpts(originalOpts, overrides) {
906
- if (originalOpts === void 0 || originalOpts === null) return overrides;
907
- return _objectSpread2(_objectSpread2({}, originalOpts), overrides);
908
- }
909
- function uuid() {
910
- let i = 0;
911
- let num;
912
- let out = "";
913
- if (!BUFFER || IDX + 16 > 256) {
914
- BUFFER = new Array(256);
915
- i = 256;
916
- while (i--) BUFFER[i] = 256 * Math.random() | 0;
917
- i = 0;
918
- IDX = 0;
919
- }
920
- for (; i < 16; i++) {
921
- num = BUFFER[IDX + i];
922
- if (i === 6) out += HEX[num & 15 | 64];
923
- else if (i === 8) out += HEX[num & 63 | 128];
924
- else out += HEX[num];
925
- if (i & 1 && i > 1 && i < 11) out += "-";
926
- }
927
- IDX++;
928
- return out;
929
- }
930
- var reLineOfOnlyDigits, reDigitsBetweenDots, reStartWithDigitThenDot, reDotWithDigitsToEnd, reMultipleDots, intPrefix, intReplace, isGlobalFormValidationError, determineFormLevelErrorSourceAndValue, determineFieldLevelErrorSourceAndValue, IDX, HEX, BUFFER, throttleFormState;
931
- var init_utils = __esmMin((() => {
932
- init_dist();
933
- init_EventClient();
934
- init_objectSpread2();
935
- init_toPropertyKey();
936
- init_objectWithoutProperties();
937
- reLineOfOnlyDigits = /^(\d+)$/gm;
938
- reDigitsBetweenDots = /\.(\d+)(?=\.)/gm;
939
- reStartWithDigitThenDot = /^(\d+)\./gm;
940
- reDotWithDigitsToEnd = /\.(\d+$)/gm;
941
- reMultipleDots = /\.{2,}/gm;
942
- intPrefix = "__int__";
943
- intReplace = `${intPrefix}$1`;
944
- isGlobalFormValidationError = (error) => {
945
- return !!error && typeof error === "object" && "fields" in error;
946
- };
947
- determineFormLevelErrorSourceAndValue = ({ newFormValidatorError, isPreviousErrorFromFormValidator, previousErrorValue }) => {
948
- if (newFormValidatorError) return {
949
- newErrorValue: newFormValidatorError,
950
- newSource: "form"
951
- };
952
- if (isPreviousErrorFromFormValidator) return {
953
- newErrorValue: void 0,
954
- newSource: void 0
955
- };
956
- if (previousErrorValue) return {
957
- newErrorValue: previousErrorValue,
958
- newSource: "field"
959
- };
960
- return {
961
- newErrorValue: void 0,
962
- newSource: void 0
963
- };
964
- };
965
- determineFieldLevelErrorSourceAndValue = ({ formLevelError, fieldLevelError }) => {
966
- if (fieldLevelError) return {
967
- newErrorValue: fieldLevelError,
968
- newSource: "field"
969
- };
970
- if (formLevelError) return {
971
- newErrorValue: formLevelError,
972
- newSource: "form"
973
- };
974
- return {
975
- newErrorValue: void 0,
976
- newSource: void 0
977
- };
978
- };
979
- IDX = 256;
980
- HEX = [];
981
- while (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);
982
- throttleFormState = liteThrottle((form) => formEventClient.emit("form-state", {
983
- id: form.formId,
984
- state: form.store.state
985
- }), { wait: 300 });
986
- }));
987
- //#endregion
988
- //#region node_modules/.pnpm/@tanstack+form-core@1.32.0/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js
989
- var revalidateLogic, defaultValidationLogic;
990
- var init_ValidationLogic = __esmMin((() => {
991
- init_objectSpread2();
992
- revalidateLogic = ({ mode = "submit", modeAfterSubmission = "change" } = {}) => (props) => {
993
- var _props$validators;
994
- if (Object.keys((_props$validators = props.validators) !== null && _props$validators !== void 0 ? _props$validators : {}).length === 0) return props.runValidation({
995
- validators: [],
996
- form: props.form
997
- });
998
- const dynamicValidator = {
999
- fn: props.event.async ? props.validators["onDynamicAsync"] : props.validators["onDynamic"],
1000
- cause: "dynamic"
1001
- };
1002
- const validatorsToAdd = [];
1003
- if ([props.form.state.submissionAttempts === 0 ? mode : modeAfterSubmission, "submit"].includes(props.event.type)) validatorsToAdd.push(dynamicValidator);
1004
- let defaultValidators = [];
1005
- defaultValidationLogic(_objectSpread2(_objectSpread2({}, props), {}, { runValidation: (vProps) => {
1006
- defaultValidators = vProps.validators;
1007
- } }));
1008
- if (validatorsToAdd.length === 0) return props.runValidation({
1009
- validators: defaultValidators,
1010
- form: props.form
1011
- });
1012
- return props.runValidation({
1013
- validators: [...defaultValidators, ...validatorsToAdd],
1014
- form: props.form
1015
- });
1016
- };
1017
- defaultValidationLogic = (props) => {
1018
- if (!props.validators) return props.runValidation({
1019
- validators: [],
1020
- form: props.form
1021
- });
1022
- const isAsync = props.event.async;
1023
- const onMountValidator = isAsync ? void 0 : {
1024
- fn: props.validators.onMount,
1025
- cause: "mount"
1026
- };
1027
- const onChangeValidator = {
1028
- fn: isAsync ? props.validators.onChangeAsync : props.validators.onChange,
1029
- cause: "change"
1030
- };
1031
- const onBlurValidator = {
1032
- fn: isAsync ? props.validators.onBlurAsync : props.validators.onBlur,
1033
- cause: "blur"
1034
- };
1035
- const onSubmitValidator = {
1036
- fn: isAsync ? props.validators.onSubmitAsync : props.validators.onSubmit,
1037
- cause: "submit"
1038
- };
1039
- const onServerValidator = isAsync ? void 0 : {
1040
- fn: () => void 0,
1041
- cause: "server"
1042
- };
1043
- switch (props.event.type) {
1044
- case "mount": return props.runValidation({
1045
- validators: [onMountValidator],
1046
- form: props.form
1047
- });
1048
- case "submit": return props.runValidation({
1049
- validators: [
1050
- onChangeValidator,
1051
- onBlurValidator,
1052
- onSubmitValidator,
1053
- onServerValidator
1054
- ],
1055
- form: props.form
1056
- });
1057
- case "server": return props.runValidation({
1058
- validators: [],
1059
- form: props.form
1060
- });
1061
- case "blur": return props.runValidation({
1062
- validators: [onBlurValidator, onServerValidator],
1063
- form: props.form
1064
- });
1065
- case "change": return props.runValidation({
1066
- validators: [onChangeValidator, onServerValidator],
1067
- form: props.form
1068
- });
1069
- default: throw new Error(`Unknown validation event type: ${props.event.type}`);
1070
- }
1071
- };
1072
- }));
1073
- //#endregion
1074
- //#region node_modules/.pnpm/@tanstack+form-core@1.32.0/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js
1075
- function prefixSchemaToErrors(issues, formValue) {
1076
- const schema = /* @__PURE__ */ new Map();
1077
- for (const issue of issues) {
1078
- var _issue$path, _schema$get;
1079
- const issuePath = (_issue$path = issue.path) !== null && _issue$path !== void 0 ? _issue$path : [];
1080
- let currentFormValue = formValue;
1081
- let path = "";
1082
- for (let i = 0; i < issuePath.length; i++) {
1083
- const pathSegment = issuePath[i];
1084
- if (pathSegment === void 0) continue;
1085
- const segment = typeof pathSegment === "object" ? pathSegment.key : pathSegment;
1086
- const segmentAsNumber = Number(segment);
1087
- if (Array.isArray(currentFormValue) && !Number.isNaN(segmentAsNumber)) path += `[${segmentAsNumber}]`;
1088
- else path += (i > 0 ? "." : "") + String(segment);
1089
- if (typeof currentFormValue === "object" && currentFormValue !== null) currentFormValue = currentFormValue[segment];
1090
- else currentFormValue = void 0;
1091
- }
1092
- schema.set(path, ((_schema$get = schema.get(path)) !== null && _schema$get !== void 0 ? _schema$get : []).concat(issue));
1093
- }
1094
- return Object.fromEntries(schema);
1095
- }
1096
- var transformFormIssues, standardSchemaValidators, isStandardSchemaValidator;
1097
- var init_standardSchemaValidator = __esmMin((() => {
1098
- init_asyncToGenerator();
1099
- transformFormIssues = (issues, formValue) => {
1100
- const schemaErrors = prefixSchemaToErrors(issues, formValue);
1101
- return {
1102
- form: schemaErrors,
1103
- fields: schemaErrors
1104
- };
1105
- };
1106
- standardSchemaValidators = {
1107
- validate({ value, validationSource }, schema) {
1108
- const result = schema["~standard"].validate(value);
1109
- if (result instanceof Promise) throw new Error("async function passed to sync validator");
1110
- if (!result.issues) return;
1111
- if (validationSource === "field") return result.issues;
1112
- return transformFormIssues(result.issues, value);
1113
- },
1114
- validateAsync({ value, validationSource }, schema) {
1115
- return _asyncToGenerator(function* () {
1116
- const result = yield schema["~standard"].validate(value);
1117
- if (!result.issues) return;
1118
- if (validationSource === "field") return result.issues;
1119
- return transformFormIssues(result.issues, value);
1120
- })();
1121
- }
1122
- };
1123
- isStandardSchemaValidator = (validator) => !!validator && "~standard" in validator;
1124
- }));
1125
- //#endregion
1126
- //#region node_modules/.pnpm/@tanstack+form-core@1.32.0/node_modules/@tanstack/form-core/dist/esm/metaHelper.js
1127
- function metaHelper(formApi) {
1128
- function bumpArrayVersion(field) {
1129
- var _formApi$getFieldMeta;
1130
- const currentMeta = (_formApi$getFieldMeta = formApi.getFieldMeta(field)) !== null && _formApi$getFieldMeta !== void 0 ? _formApi$getFieldMeta : defaultFieldMeta;
1131
- formApi.setFieldMeta(field, _objectSpread2(_objectSpread2({}, currentMeta), {}, { _arrayVersion: (currentMeta._arrayVersion || 0) + 1 }));
1132
- }
1133
- function handleArrayMove(field, fromIndex, toIndex) {
1134
- bumpArrayVersion(field);
1135
- const affectedFields = getAffectedFields(field, fromIndex, "move", toIndex);
1136
- const startIndex = Math.min(fromIndex, toIndex);
1137
- const endIndex = Math.max(fromIndex, toIndex);
1138
- for (let i = startIndex; i <= endIndex; i++) affectedFields.push(getFieldPath(field, i));
1139
- const fromFields = Object.keys(formApi.fieldInfo).reduce((fieldMap, fieldKey) => {
1140
- if (fieldKey.startsWith(getFieldPath(field, fromIndex))) fieldMap.set(fieldKey, formApi.getFieldMeta(fieldKey));
1141
- return fieldMap;
1142
- }, /* @__PURE__ */ new Map());
1143
- shiftMeta(affectedFields, fromIndex < toIndex ? "up" : "down");
1144
- Object.keys(formApi.fieldInfo).filter((fieldKey) => fieldKey.startsWith(getFieldPath(field, toIndex))).forEach((fieldKey) => {
1145
- const fromKey = fieldKey.replace(getFieldPath(field, toIndex), getFieldPath(field, fromIndex));
1146
- const fromMeta = fromFields.get(fromKey);
1147
- if (fromMeta) formApi.setFieldMeta(fieldKey, fromMeta);
1148
- });
1149
- }
1150
- function handleArrayRemove(field, index) {
1151
- bumpArrayVersion(field);
1152
- shiftMeta(getAffectedFields(field, index, "remove"), "up");
1153
- }
1154
- function handleArraySwap(field, index, secondIndex) {
1155
- bumpArrayVersion(field);
1156
- getAffectedFields(field, index, "swap", secondIndex).forEach((fieldKey) => {
1157
- if (!fieldKey.toString().startsWith(getFieldPath(field, index))) return;
1158
- const swappedKey = fieldKey.toString().replace(getFieldPath(field, index), getFieldPath(field, secondIndex));
1159
- const [meta1, meta2] = [formApi.getFieldMeta(fieldKey), formApi.getFieldMeta(swappedKey)];
1160
- if (meta1) formApi.setFieldMeta(swappedKey, meta1);
1161
- if (meta2) formApi.setFieldMeta(fieldKey, meta2);
1162
- });
1163
- }
1164
- function handleArrayInsert(field, insertIndex) {
1165
- bumpArrayVersion(field);
1166
- const affectedFields = getAffectedFields(field, insertIndex, "insert");
1167
- shiftMeta(affectedFields, "down");
1168
- affectedFields.forEach((fieldKey) => {
1169
- if (fieldKey.toString().startsWith(getFieldPath(field, insertIndex))) formApi.setFieldMeta(fieldKey, getEmptyFieldMeta());
1170
- });
1171
- }
1172
- function getFieldPath(field, index) {
1173
- return `${field}[${index}]`;
1174
- }
1175
- function getAffectedFields(field, index, mode, secondIndex) {
1176
- const affectedFieldKeys = [getFieldPath(field, index)];
1177
- switch (mode) {
1178
- case "swap":
1179
- affectedFieldKeys.push(getFieldPath(field, secondIndex));
1180
- break;
1181
- case "move": {
1182
- const [startIndex, endIndex] = [Math.min(index, secondIndex), Math.max(index, secondIndex)];
1183
- for (let i = startIndex; i <= endIndex; i++) affectedFieldKeys.push(getFieldPath(field, i));
1184
- break;
1185
- }
1186
- default: {
1187
- const currentValue = formApi.getFieldValue(field);
1188
- const fieldItems = Array.isArray(currentValue) ? currentValue.length : 0;
1189
- for (let i = index + 1; i < fieldItems; i++) affectedFieldKeys.push(getFieldPath(field, i));
1190
- break;
1191
- }
1192
- }
1193
- return Object.keys(formApi.fieldInfo).filter((fieldKey) => affectedFieldKeys.some((key) => fieldKey.startsWith(key)));
1194
- }
1195
- function updateIndex(fieldKey, direction) {
1196
- return fieldKey.replace(/\[(\d+)\]/, (_, num) => {
1197
- const currIndex = parseInt(num, 10);
1198
- return `[${direction === "up" ? currIndex + 1 : Math.max(0, currIndex - 1)}]`;
1199
- });
1200
- }
1201
- function shiftMeta(fields, direction) {
1202
- (direction === "up" ? fields : [...fields].reverse()).forEach((fieldKey) => {
1203
- const nextFieldKey = updateIndex(fieldKey.toString(), direction);
1204
- const nextFieldMeta = formApi.getFieldMeta(nextFieldKey);
1205
- if (nextFieldMeta) formApi.setFieldMeta(fieldKey, nextFieldMeta);
1206
- else formApi.setFieldMeta(fieldKey, getEmptyFieldMeta());
1207
- });
1208
- }
1209
- const getEmptyFieldMeta = () => defaultFieldMeta;
1210
- return {
1211
- bumpArrayVersion,
1212
- handleArrayMove,
1213
- handleArrayRemove,
1214
- handleArraySwap,
1215
- handleArrayInsert
1216
- };
1217
- }
1218
- var defaultFieldMeta;
1219
- var init_metaHelper = __esmMin((() => {
1220
- init_objectSpread2();
1221
- defaultFieldMeta = {
1222
- isValidating: false,
1223
- isTouched: false,
1224
- isBlurred: false,
1225
- isDirty: false,
1226
- isPristine: true,
1227
- isValid: true,
1228
- isDefaultValue: true,
1229
- errors: [],
1230
- errorMap: {},
1231
- errorSourceMap: {},
1232
- _arrayVersion: 0
1233
- };
1234
- }));
1235
- //#endregion
1236
- //#region node_modules/.pnpm/@tanstack+form-core@1.32.0/node_modules/@tanstack/form-core/dist/esm/FormApi.js
1237
- function getDefaultFormState(defaultState) {
1238
- var _defaultState$values, _defaultState$errorMa, _defaultState$fieldMe, _defaultState$isSubmi, _defaultState$isSubmi2, _defaultState$isValid, _defaultState$submiss, _defaultState$isSubmi3, _defaultState$validat;
1239
- return {
1240
- values: (_defaultState$values = defaultState.values) !== null && _defaultState$values !== void 0 ? _defaultState$values : {},
1241
- errorMap: (_defaultState$errorMa = defaultState.errorMap) !== null && _defaultState$errorMa !== void 0 ? _defaultState$errorMa : {},
1242
- fieldMetaBase: (_defaultState$fieldMe = defaultState.fieldMetaBase) !== null && _defaultState$fieldMe !== void 0 ? _defaultState$fieldMe : {},
1243
- isSubmitted: (_defaultState$isSubmi = defaultState.isSubmitted) !== null && _defaultState$isSubmi !== void 0 ? _defaultState$isSubmi : false,
1244
- isSubmitting: (_defaultState$isSubmi2 = defaultState.isSubmitting) !== null && _defaultState$isSubmi2 !== void 0 ? _defaultState$isSubmi2 : false,
1245
- isValidating: (_defaultState$isValid = defaultState.isValidating) !== null && _defaultState$isValid !== void 0 ? _defaultState$isValid : false,
1246
- submissionAttempts: (_defaultState$submiss = defaultState.submissionAttempts) !== null && _defaultState$submiss !== void 0 ? _defaultState$submiss : 0,
1247
- isSubmitSuccessful: (_defaultState$isSubmi3 = defaultState.isSubmitSuccessful) !== null && _defaultState$isSubmi3 !== void 0 ? _defaultState$isSubmi3 : false,
1248
- validationMetaMap: (_defaultState$validat = defaultState.validationMetaMap) !== null && _defaultState$validat !== void 0 ? _defaultState$validat : {
1249
- onChange: void 0,
1250
- onBlur: void 0,
1251
- onSubmit: void 0,
1252
- onMount: void 0,
1253
- onServer: void 0,
1254
- onDynamic: void 0
1255
- }
1256
- };
1257
- }
1258
- function normalizeError$1(rawError) {
1259
- if (rawError) {
1260
- if (isGlobalFormValidationError(rawError)) return {
1261
- formError: normalizeError$1(rawError.form).formError,
1262
- fieldErrors: rawError.fields
1263
- };
1264
- return { formError: rawError };
1265
- }
1266
- return { formError: void 0 };
1267
- }
1268
- function getErrorMapKey$1(cause) {
1269
- switch (cause) {
1270
- case "submit": return "onSubmit";
1271
- case "blur": return "onBlur";
1272
- case "mount": return "onMount";
1273
- case "server": return "onServer";
1274
- case "dynamic": return "onDynamic";
1275
- default: return "onChange";
1276
- }
1277
- }
1278
- var FormApi;
1279
- var init_FormApi = __esmMin((() => {
1280
- init_esm$3();
1281
- init_utils();
1282
- init_ValidationLogic();
1283
- init_standardSchemaValidator();
1284
- init_metaHelper();
1285
- init_EventClient();
1286
- init_objectSpread2();
1287
- init_asyncToGenerator();
1288
- FormApi = class {
1289
- /**
1290
- * Constructs a new `FormApi` instance with the given form options.
1291
- */
1292
- constructor(opts) {
1293
- var _this = this;
1294
- var _opts$formId, _opts$defaultValues, _opts$defaultState;
1295
- this.options = {};
1296
- this.fieldInfo = {};
1297
- this.mount = () => {
1298
- var _this$options$listene, _this$options$listene2;
1299
- const cleanupDevtoolBroadcast = this.store.subscribe(() => {
1300
- throttleFormState(this);
1301
- });
1302
- const cleanupFormStateListener = formEventClient.on("request-form-state", (e) => {
1303
- if (e.payload.id === this._formId) formEventClient.emit("form-api", {
1304
- id: this._formId,
1305
- state: this.store.state,
1306
- options: this.options
1307
- });
1308
- });
1309
- const cleanupFormResetListener = formEventClient.on("request-form-reset", (e) => {
1310
- if (e.payload.id === this._formId) this.reset();
1311
- });
1312
- const cleanupFormForceSubmitListener = formEventClient.on("request-form-force-submit", (e) => {
1313
- if (e.payload.id === this._formId) {
1314
- this._devtoolsSubmissionOverride = true;
1315
- this.handleSubmit();
1316
- this._devtoolsSubmissionOverride = false;
1317
- }
1318
- });
1319
- const cleanup = () => {
1320
- cleanupFormForceSubmitListener();
1321
- cleanupFormResetListener();
1322
- cleanupFormStateListener();
1323
- cleanupDevtoolBroadcast.unsubscribe();
1324
- formEventClient.emit("form-unmounted", { id: this._formId });
1325
- };
1326
- (_this$options$listene = this.options.listeners) === null || _this$options$listene === void 0 || (_this$options$listene2 = _this$options$listene.onMount) === null || _this$options$listene2 === void 0 || _this$options$listene2.call(_this$options$listene, { formApi: this });
1327
- const { onMount } = this.options.validators || {};
1328
- formEventClient.emit("form-api", {
1329
- id: this._formId,
1330
- state: this.store.state,
1331
- options: this.options
1332
- });
1333
- if (!onMount) return cleanup;
1334
- this.validateSync("mount");
1335
- return cleanup;
1336
- };
1337
- this.update = (options) => {
1338
- if (!options) return;
1339
- const oldOptions = this.options;
1340
- this.options = options;
1341
- const shouldUpdateValues = options.defaultValues && !evaluate(options.defaultValues, oldOptions.defaultValues) && !this.state.isTouched;
1342
- const shouldUpdateState = !evaluate(options.defaultState, oldOptions.defaultState) && !this.state.isTouched;
1343
- if (!shouldUpdateValues && !shouldUpdateState) return;
1344
- batch(() => {
1345
- this.baseStore.setState(() => getDefaultFormState(Object.assign({}, this.state, shouldUpdateState ? options.defaultState : {}, shouldUpdateValues ? { values: options.defaultValues } : {})));
1346
- });
1347
- formEventClient.emit("form-api", {
1348
- id: this._formId,
1349
- state: this.store.state,
1350
- options: this.options
1351
- });
1352
- };
1353
- this.reset = (values, opts2) => {
1354
- const { fieldMeta: currentFieldMeta } = this.state;
1355
- const fieldMetaBase = this.resetFieldMeta(currentFieldMeta);
1356
- if (values && !(opts2 === null || opts2 === void 0 ? void 0 : opts2.keepDefaultValues)) this.options = _objectSpread2(_objectSpread2({}, this.options), {}, { defaultValues: values });
1357
- this.baseStore.setState(() => {
1358
- var _ref, _this$options$default;
1359
- let nextValues = (_ref = values !== null && values !== void 0 ? values : this.options.defaultValues) !== null && _ref !== void 0 ? _ref : (_this$options$default = this.options.defaultState) === null || _this$options$default === void 0 ? void 0 : _this$options$default.values;
1360
- if (!values) Object.values(this.fieldInfo).forEach((fieldInfo) => {
1361
- if (fieldInfo.instance && fieldInfo.instance.options.defaultValue !== void 0) nextValues = setBy(nextValues, fieldInfo.instance.name, fieldInfo.instance.options.defaultValue);
1362
- });
1363
- return getDefaultFormState(_objectSpread2(_objectSpread2({}, this.options.defaultState), {}, {
1364
- values: nextValues,
1365
- fieldMetaBase
1366
- }));
1367
- });
1368
- };
1369
- this.validateAllFields = function() {
1370
- var _ref2 = _asyncToGenerator(function* (cause) {
1371
- const fieldValidationPromises = [];
1372
- batch(() => {
1373
- Object.values(_this.fieldInfo).forEach((field) => {
1374
- if (!field.instance) return;
1375
- const fieldInstance = field.instance;
1376
- fieldValidationPromises.push(Promise.resolve().then(() => fieldInstance.validate(cause, { skipFormValidation: true })));
1377
- if (!field.instance.state.meta.isTouched) field.instance.setMeta((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { isTouched: true }));
1378
- });
1379
- });
1380
- return (yield Promise.all(fieldValidationPromises)).flat();
1381
- });
1382
- return function(_x) {
1383
- return _ref2.apply(this, arguments);
1384
- };
1385
- }();
1386
- this.validateArrayFieldsStartingFrom = function() {
1387
- var _ref3 = _asyncToGenerator(function* (field, index, cause) {
1388
- const currentValue = _this.getFieldValue(field);
1389
- const lastIndex = Array.isArray(currentValue) ? Math.max(currentValue.length - 1, 0) : null;
1390
- const fieldKeysToValidate = [`${field}[${index}]`];
1391
- for (let i = index + 1; i <= (lastIndex !== null && lastIndex !== void 0 ? lastIndex : 0); i++) fieldKeysToValidate.push(`${field}[${i}]`);
1392
- const fieldsToValidate = Object.keys(_this.fieldInfo).filter((fieldKey) => fieldKeysToValidate.some((key) => fieldKey.startsWith(key)));
1393
- const fieldValidationPromises = [];
1394
- batch(() => {
1395
- fieldsToValidate.forEach((nestedField) => {
1396
- fieldValidationPromises.push(Promise.resolve().then(() => _this.validateField(nestedField, cause)));
1397
- });
1398
- });
1399
- return (yield Promise.all(fieldValidationPromises)).flat();
1400
- });
1401
- return function(_x2, _x3, _x4) {
1402
- return _ref3.apply(this, arguments);
1403
- };
1404
- }();
1405
- this.validateField = (field, cause) => {
1406
- var _this$fieldInfo$field;
1407
- const fieldInstance = (_this$fieldInfo$field = this.fieldInfo[field]) === null || _this$fieldInfo$field === void 0 ? void 0 : _this$fieldInfo$field.instance;
1408
- if (!fieldInstance) {
1409
- const { hasErrored } = this.validateSync(cause);
1410
- if (hasErrored && !this.options.asyncAlways) {
1411
- var _this$getFieldMeta$er, _this$getFieldMeta;
1412
- return (_this$getFieldMeta$er = (_this$getFieldMeta = this.getFieldMeta(field)) === null || _this$getFieldMeta === void 0 ? void 0 : _this$getFieldMeta.errors) !== null && _this$getFieldMeta$er !== void 0 ? _this$getFieldMeta$er : [];
1413
- }
1414
- return this.validateAsync(cause).then(() => {
1415
- var _this$getFieldMeta$er2, _this$getFieldMeta2;
1416
- return (_this$getFieldMeta$er2 = (_this$getFieldMeta2 = this.getFieldMeta(field)) === null || _this$getFieldMeta2 === void 0 ? void 0 : _this$getFieldMeta2.errors) !== null && _this$getFieldMeta$er2 !== void 0 ? _this$getFieldMeta$er2 : [];
1417
- });
1418
- }
1419
- if (!fieldInstance.state.meta.isTouched) fieldInstance.setMeta((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { isTouched: true }));
1420
- return fieldInstance.validate(cause);
1421
- };
1422
- this.validateSync = (cause) => {
1423
- const validates = getSyncValidatorArray(cause, _objectSpread2(_objectSpread2({}, this.options), {}, {
1424
- form: this,
1425
- validationLogic: this.options.validationLogic || defaultValidationLogic
1426
- }));
1427
- let hasErrored = false;
1428
- const currentValidationErrorMap = {};
1429
- batch(() => {
1430
- var _this$state$errorMap2, _this$state$errorMap3;
1431
- for (const validateObj of validates) {
1432
- var _this$state$errorMap;
1433
- if (!validateObj.validate) continue;
1434
- const { formError, fieldErrors } = normalizeError$1(this.runValidator({
1435
- validate: validateObj.validate,
1436
- value: {
1437
- value: this.state.values,
1438
- formApi: this,
1439
- validationSource: "form"
1440
- },
1441
- type: "validate"
1442
- }));
1443
- const errorMapKey = getErrorMapKey$1(validateObj.cause);
1444
- const allFieldsToProcess = /* @__PURE__ */ new Set([...Object.keys(this.state.fieldMeta), ...Object.keys(fieldErrors || {})]);
1445
- for (const field of allFieldsToProcess) {
1446
- var _this$getFieldMeta3;
1447
- if (this.baseStore.state.fieldMetaBase[field] === void 0 && !(fieldErrors === null || fieldErrors === void 0 ? void 0 : fieldErrors[field])) continue;
1448
- const { errorMap: currentErrorMap, errorSourceMap: currentErrorMapSource } = (_this$getFieldMeta3 = this.getFieldMeta(field)) !== null && _this$getFieldMeta3 !== void 0 ? _this$getFieldMeta3 : defaultFieldMeta;
1449
- const newFormValidatorError = fieldErrors === null || fieldErrors === void 0 ? void 0 : fieldErrors[field];
1450
- const { newErrorValue, newSource } = determineFormLevelErrorSourceAndValue({
1451
- newFormValidatorError,
1452
- isPreviousErrorFromFormValidator: (currentErrorMapSource === null || currentErrorMapSource === void 0 ? void 0 : currentErrorMapSource[errorMapKey]) === "form",
1453
- previousErrorValue: currentErrorMap === null || currentErrorMap === void 0 ? void 0 : currentErrorMap[errorMapKey]
1454
- });
1455
- if (newSource === "form") currentValidationErrorMap[field] = _objectSpread2(_objectSpread2({}, currentValidationErrorMap[field]), {}, { [errorMapKey]: newFormValidatorError });
1456
- if ((currentErrorMap === null || currentErrorMap === void 0 ? void 0 : currentErrorMap[errorMapKey]) !== newErrorValue) this.setFieldMeta(field, (prev = defaultFieldMeta) => _objectSpread2(_objectSpread2({}, prev), {}, {
1457
- errorMap: _objectSpread2(_objectSpread2({}, prev.errorMap), {}, { [errorMapKey]: newErrorValue }),
1458
- errorSourceMap: _objectSpread2(_objectSpread2({}, prev.errorSourceMap), {}, { [errorMapKey]: newSource })
1459
- }));
1460
- }
1461
- if (((_this$state$errorMap = this.state.errorMap) === null || _this$state$errorMap === void 0 ? void 0 : _this$state$errorMap[errorMapKey]) !== formError) this.baseStore.setState((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { errorMap: _objectSpread2(_objectSpread2({}, prev.errorMap), {}, { [errorMapKey]: formError }) }));
1462
- if (formError || fieldErrors) hasErrored = true;
1463
- }
1464
- const submitErrKey = getErrorMapKey$1("submit");
1465
- if (((_this$state$errorMap2 = this.state.errorMap) === null || _this$state$errorMap2 === void 0 ? void 0 : _this$state$errorMap2[submitErrKey]) && cause !== "submit" && !hasErrored) this.baseStore.setState((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { errorMap: _objectSpread2(_objectSpread2({}, prev.errorMap), {}, { [submitErrKey]: void 0 }) }));
1466
- const serverErrKey = getErrorMapKey$1("server");
1467
- if (((_this$state$errorMap3 = this.state.errorMap) === null || _this$state$errorMap3 === void 0 ? void 0 : _this$state$errorMap3[serverErrKey]) && cause !== "server" && !hasErrored) this.baseStore.setState((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { errorMap: _objectSpread2(_objectSpread2({}, prev.errorMap), {}, { [serverErrKey]: void 0 }) }));
1468
- });
1469
- return {
1470
- hasErrored,
1471
- fieldsErrorMap: currentValidationErrorMap
1472
- };
1473
- };
1474
- this.validateAsync = function() {
1475
- var _ref5 = _asyncToGenerator(function* (cause) {
1476
- const validates = getAsyncValidatorArray(cause, _objectSpread2(_objectSpread2({}, _this.options), {}, {
1477
- form: _this,
1478
- validationLogic: _this.options.validationLogic || defaultValidationLogic
1479
- }));
1480
- if (!_this.state.isFormValidating) _this.baseStore.setState((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { isFormValidating: true }));
1481
- const promises = [];
1482
- let fieldErrorsFromFormValidators;
1483
- for (const validateObj of validates) {
1484
- if (!validateObj.validate) continue;
1485
- const key = getErrorMapKey$1(validateObj.cause);
1486
- const fieldValidatorMeta = _this.state.validationMetaMap[key];
1487
- fieldValidatorMeta === null || fieldValidatorMeta === void 0 || fieldValidatorMeta.lastAbortController.abort();
1488
- const controller = new AbortController();
1489
- _this.state.validationMetaMap[key] = { lastAbortController: controller };
1490
- promises.push(new Promise(function() {
1491
- var _ref4 = _asyncToGenerator(function* (resolve) {
1492
- let rawError;
1493
- try {
1494
- rawError = yield new Promise((rawResolve, rawReject) => {
1495
- setTimeout(_asyncToGenerator(function* () {
1496
- if (controller.signal.aborted) return rawResolve(void 0);
1497
- try {
1498
- rawResolve(yield _this.runValidator({
1499
- validate: validateObj.validate,
1500
- value: {
1501
- value: _this.state.values,
1502
- formApi: _this,
1503
- validationSource: "form",
1504
- signal: controller.signal
1505
- },
1506
- type: "validateAsync"
1507
- }));
1508
- } catch (e) {
1509
- rawReject(e);
1510
- }
1511
- }), validateObj.debounceMs);
1512
- });
1513
- } catch (e) {
1514
- rawError = e;
1515
- }
1516
- const { formError, fieldErrors: fieldErrorsFromNormalizeError } = normalizeError$1(rawError);
1517
- if (fieldErrorsFromNormalizeError) fieldErrorsFromFormValidators = fieldErrorsFromFormValidators ? _objectSpread2(_objectSpread2({}, fieldErrorsFromFormValidators), fieldErrorsFromNormalizeError) : fieldErrorsFromNormalizeError;
1518
- const errorMapKey = getErrorMapKey$1(validateObj.cause);
1519
- for (const field of Object.keys(_this.state.fieldMeta)) {
1520
- if (_this.baseStore.state.fieldMetaBase[field] === void 0) continue;
1521
- const fieldMeta = _this.getFieldMeta(field);
1522
- if (!fieldMeta) continue;
1523
- const { errorMap: currentErrorMap, errorSourceMap: currentErrorMapSource } = fieldMeta;
1524
- const { newErrorValue, newSource } = determineFormLevelErrorSourceAndValue({
1525
- newFormValidatorError: fieldErrorsFromFormValidators === null || fieldErrorsFromFormValidators === void 0 ? void 0 : fieldErrorsFromFormValidators[field],
1526
- isPreviousErrorFromFormValidator: (currentErrorMapSource === null || currentErrorMapSource === void 0 ? void 0 : currentErrorMapSource[errorMapKey]) === "form",
1527
- previousErrorValue: currentErrorMap === null || currentErrorMap === void 0 ? void 0 : currentErrorMap[errorMapKey]
1528
- });
1529
- if ((currentErrorMap === null || currentErrorMap === void 0 ? void 0 : currentErrorMap[errorMapKey]) !== newErrorValue) _this.setFieldMeta(field, (prev) => _objectSpread2(_objectSpread2({}, prev), {}, {
1530
- errorMap: _objectSpread2(_objectSpread2({}, prev.errorMap), {}, { [errorMapKey]: newErrorValue }),
1531
- errorSourceMap: _objectSpread2(_objectSpread2({}, prev.errorSourceMap), {}, { [errorMapKey]: newSource })
1532
- }));
1533
- }
1534
- _this.baseStore.setState((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { errorMap: _objectSpread2(_objectSpread2({}, prev.errorMap), {}, { [errorMapKey]: formError }) }));
1535
- resolve(fieldErrorsFromFormValidators ? {
1536
- fieldErrors: fieldErrorsFromFormValidators,
1537
- errorMapKey
1538
- } : void 0);
1539
- });
1540
- return function(_x5) {
1541
- return _ref4.apply(this, arguments);
1542
- };
1543
- }()));
1544
- }
1545
- let results = [];
1546
- const fieldsErrorMap = {};
1547
- if (promises.length) {
1548
- results = yield Promise.all(promises);
1549
- for (const fieldValidationResult of results) if (fieldValidationResult === null || fieldValidationResult === void 0 ? void 0 : fieldValidationResult.fieldErrors) {
1550
- const { errorMapKey } = fieldValidationResult;
1551
- for (const [field, fieldError] of Object.entries(fieldValidationResult.fieldErrors)) fieldsErrorMap[field] = _objectSpread2(_objectSpread2({}, fieldsErrorMap[field] || {}), {}, { [errorMapKey]: fieldError });
1552
- }
1553
- }
1554
- _this.baseStore.setState((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { isFormValidating: false }));
1555
- return fieldsErrorMap;
1556
- });
1557
- return function(_x6) {
1558
- return _ref5.apply(this, arguments);
1559
- };
1560
- }();
1561
- this.validate = (cause) => {
1562
- const { hasErrored, fieldsErrorMap } = this.validateSync(cause);
1563
- if (hasErrored && !this.options.asyncAlways) return fieldsErrorMap;
1564
- return this.validateAsync(cause);
1565
- };
1566
- this._handleSubmit = function() {
1567
- var _ref6 = _asyncToGenerator(function* (submitMeta) {
1568
- var _this$options$listene3, _this$options$listene4;
1569
- _this.baseStore.setState((old) => _objectSpread2(_objectSpread2({}, old), {}, {
1570
- isSubmitted: false,
1571
- submissionAttempts: old.submissionAttempts + 1,
1572
- isSubmitSuccessful: false
1573
- }));
1574
- batch(() => {
1575
- Object.values(_this.fieldInfo).forEach((field) => {
1576
- if (!field.instance) return;
1577
- if (!field.instance.state.meta.isTouched) field.instance.setMeta((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { isTouched: true }));
1578
- });
1579
- });
1580
- const submitMetaArg = submitMeta !== null && submitMeta !== void 0 ? submitMeta : _this.options.onSubmitMeta;
1581
- if (!_this.state.canSubmit && !_this._devtoolsSubmissionOverride) {
1582
- var _this$options$onSubmi, _this$options;
1583
- (_this$options$onSubmi = (_this$options = _this.options).onSubmitInvalid) === null || _this$options$onSubmi === void 0 || _this$options$onSubmi.call(_this$options, {
1584
- value: _this.state.values,
1585
- formApi: _this,
1586
- meta: submitMetaArg
1587
- });
1588
- return;
1589
- }
1590
- _this.baseStore.setState((d) => _objectSpread2(_objectSpread2({}, d), {}, { isSubmitting: true }));
1591
- const done = () => {
1592
- _this.baseStore.setState((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { isSubmitting: false }));
1593
- };
1594
- yield _this.validateAllFields("submit");
1595
- if (!_this.state.isFieldsValid) {
1596
- var _this$options$onSubmi2, _this$options2;
1597
- done();
1598
- (_this$options$onSubmi2 = (_this$options2 = _this.options).onSubmitInvalid) === null || _this$options$onSubmi2 === void 0 || _this$options$onSubmi2.call(_this$options2, {
1599
- value: _this.state.values,
1600
- formApi: _this,
1601
- meta: submitMetaArg
1602
- });
1603
- formEventClient.emit("form-submission", {
1604
- id: _this._formId,
1605
- submissionAttempt: _this.state.submissionAttempts,
1606
- successful: false,
1607
- stage: "validateAllFields",
1608
- errors: Object.values(_this.state.fieldMeta).map((meta) => meta.errors).flat()
1609
- });
1610
- return;
1611
- }
1612
- yield _this.validate("submit");
1613
- if (!_this.state.isValid) {
1614
- var _this$options$onSubmi3, _this$options3;
1615
- done();
1616
- (_this$options$onSubmi3 = (_this$options3 = _this.options).onSubmitInvalid) === null || _this$options$onSubmi3 === void 0 || _this$options$onSubmi3.call(_this$options3, {
1617
- value: _this.state.values,
1618
- formApi: _this,
1619
- meta: submitMetaArg
1620
- });
1621
- formEventClient.emit("form-submission", {
1622
- id: _this._formId,
1623
- submissionAttempt: _this.state.submissionAttempts,
1624
- successful: false,
1625
- stage: "validate",
1626
- errors: _this.state.errors
1627
- });
1628
- return;
1629
- }
1630
- batch(() => {
1631
- Object.values(_this.fieldInfo).forEach((field) => {
1632
- var _field$instance, _field$instance$onSub;
1633
- (_field$instance = field.instance) === null || _field$instance === void 0 || (_field$instance = _field$instance.options.listeners) === null || _field$instance === void 0 || (_field$instance$onSub = _field$instance.onSubmit) === null || _field$instance$onSub === void 0 || _field$instance$onSub.call(_field$instance, {
1634
- value: field.instance.state.value,
1635
- fieldApi: field.instance
1636
- });
1637
- });
1638
- });
1639
- (_this$options$listene3 = _this.options.listeners) === null || _this$options$listene3 === void 0 || (_this$options$listene4 = _this$options$listene3.onSubmit) === null || _this$options$listene4 === void 0 || _this$options$listene4.call(_this$options$listene3, {
1640
- formApi: _this,
1641
- meta: submitMetaArg
1642
- });
1643
- try {
1644
- var _this$options$onSubmi4, _this$options4;
1645
- yield (_this$options$onSubmi4 = (_this$options4 = _this.options).onSubmit) === null || _this$options$onSubmi4 === void 0 ? void 0 : _this$options$onSubmi4.call(_this$options4, {
1646
- value: _this.state.values,
1647
- formApi: _this,
1648
- meta: submitMetaArg
1649
- });
1650
- batch(() => {
1651
- _this.baseStore.setState((prev) => _objectSpread2(_objectSpread2({}, prev), {}, {
1652
- isSubmitted: true,
1653
- isSubmitSuccessful: true
1654
- }));
1655
- formEventClient.emit("form-submission", {
1656
- id: _this._formId,
1657
- submissionAttempt: _this.state.submissionAttempts,
1658
- successful: true
1659
- });
1660
- done();
1661
- });
1662
- } catch (err) {
1663
- _this.baseStore.setState((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { isSubmitSuccessful: false }));
1664
- formEventClient.emit("form-submission", {
1665
- id: _this._formId,
1666
- submissionAttempt: _this.state.submissionAttempts,
1667
- successful: false,
1668
- stage: "inflight",
1669
- onError: err
1670
- });
1671
- done();
1672
- throw err;
1673
- }
1674
- });
1675
- return function(_x7) {
1676
- return _ref6.apply(this, arguments);
1677
- };
1678
- }();
1679
- this.getFieldValue = (field) => getBy(this.state.values, field);
1680
- this.getFieldMeta = (field) => {
1681
- return this.state.fieldMeta[field];
1682
- };
1683
- this.getFieldInfo = (field) => {
1684
- var _this$fieldInfo;
1685
- return (_this$fieldInfo = this.fieldInfo)[field] || (_this$fieldInfo[field] = {
1686
- instance: null,
1687
- validationMetaMap: {
1688
- onChange: void 0,
1689
- onBlur: void 0,
1690
- onSubmit: void 0,
1691
- onMount: void 0,
1692
- onServer: void 0,
1693
- onDynamic: void 0
1694
- }
1695
- });
1696
- };
1697
- this.setFieldMeta = (field, updater) => {
1698
- this.baseStore.setState((prev) => {
1699
- return _objectSpread2(_objectSpread2({}, prev), {}, { fieldMetaBase: _objectSpread2(_objectSpread2({}, prev.fieldMetaBase), {}, { [field]: functionalUpdate(updater, prev.fieldMetaBase[field]) }) });
1700
- });
1701
- };
1702
- this.resetFieldMeta = (fieldMeta) => {
1703
- return Object.keys(fieldMeta).reduce((acc, key) => {
1704
- const fieldKey = key;
1705
- acc[fieldKey] = defaultFieldMeta;
1706
- return acc;
1707
- }, {});
1708
- };
1709
- this.setFieldValue = (field, updater, opts2) => {
1710
- var _opts2$dontUpdateMeta, _opts2$dontRunListene, _opts2$dontValidate;
1711
- const dontUpdateMeta = (_opts2$dontUpdateMeta = opts2 === null || opts2 === void 0 ? void 0 : opts2.dontUpdateMeta) !== null && _opts2$dontUpdateMeta !== void 0 ? _opts2$dontUpdateMeta : false;
1712
- const dontRunListeners = (_opts2$dontRunListene = opts2 === null || opts2 === void 0 ? void 0 : opts2.dontRunListeners) !== null && _opts2$dontRunListene !== void 0 ? _opts2$dontRunListene : false;
1713
- const dontValidate = (_opts2$dontValidate = opts2 === null || opts2 === void 0 ? void 0 : opts2.dontValidate) !== null && _opts2$dontValidate !== void 0 ? _opts2$dontValidate : false;
1714
- batch(() => {
1715
- if (!dontUpdateMeta) this.setFieldMeta(field, (prev) => _objectSpread2(_objectSpread2({}, prev), {}, {
1716
- isTouched: true,
1717
- isDirty: true,
1718
- errorMap: _objectSpread2(_objectSpread2({}, prev === null || prev === void 0 ? void 0 : prev.errorMap), {}, { onMount: void 0 })
1719
- }));
1720
- this.baseStore.setState((prev) => {
1721
- return _objectSpread2(_objectSpread2({}, prev), {}, { values: setBy(prev.values, field, updater) });
1722
- });
1723
- });
1724
- if (!dontRunListeners) {
1725
- var _this$getFieldInfo$in;
1726
- (_this$getFieldInfo$in = this.getFieldInfo(field).instance) === null || _this$getFieldInfo$in === void 0 || _this$getFieldInfo$in.triggerOnChangeListener();
1727
- }
1728
- if (!dontValidate) this.validateField(field, "change");
1729
- };
1730
- this.deleteField = (field) => {
1731
- const fieldsToDelete = [...Object.keys(this.fieldInfo).filter((f) => {
1732
- const fieldStr = field.toString();
1733
- return f !== fieldStr && f.startsWith(fieldStr);
1734
- }), field];
1735
- this.baseStore.setState((prev) => {
1736
- const newState = _objectSpread2({}, prev);
1737
- fieldsToDelete.forEach((f) => {
1738
- newState.values = deleteBy(newState.values, f);
1739
- delete this.fieldInfo[f];
1740
- delete newState.fieldMetaBase[f];
1741
- });
1742
- return newState;
1743
- });
1744
- };
1745
- this.pushFieldValue = (field, value, options) => {
1746
- this.setFieldValue(field, (prev) => [...Array.isArray(prev) ? prev : [], value], options);
1747
- metaHelper(this).bumpArrayVersion(field);
1748
- };
1749
- this.insertFieldValue = function() {
1750
- var _ref7 = _asyncToGenerator(function* (field, index, value, options) {
1751
- var _options$dontValidate;
1752
- _this.setFieldValue(field, (prev) => {
1753
- return [
1754
- ...prev.slice(0, index),
1755
- value,
1756
- ...prev.slice(index)
1757
- ];
1758
- }, mergeOpts(options, { dontValidate: true }));
1759
- const dontValidate = (_options$dontValidate = options === null || options === void 0 ? void 0 : options.dontValidate) !== null && _options$dontValidate !== void 0 ? _options$dontValidate : false;
1760
- if (!dontValidate) yield _this.validateField(field, "change");
1761
- metaHelper(_this).handleArrayInsert(field, index);
1762
- if (!dontValidate) yield _this.validateArrayFieldsStartingFrom(field, index, "change");
1763
- });
1764
- return function(_x8, _x9, _x10, _x11) {
1765
- return _ref7.apply(this, arguments);
1766
- };
1767
- }();
1768
- this.replaceFieldValue = function() {
1769
- var _ref8 = _asyncToGenerator(function* (field, index, value, options) {
1770
- var _options$dontValidate2;
1771
- _this.setFieldValue(field, (prev) => {
1772
- return prev.map((d, i) => i === index ? value : d);
1773
- }, mergeOpts(options, { dontValidate: true }));
1774
- metaHelper(_this).bumpArrayVersion(field);
1775
- if (!((_options$dontValidate2 = options === null || options === void 0 ? void 0 : options.dontValidate) !== null && _options$dontValidate2 !== void 0 ? _options$dontValidate2 : false)) {
1776
- yield _this.validateField(field, "change");
1777
- yield _this.validateArrayFieldsStartingFrom(field, index, "change");
1778
- }
1779
- });
1780
- return function(_x12, _x13, _x14, _x15) {
1781
- return _ref8.apply(this, arguments);
1782
- };
1783
- }();
1784
- this.removeFieldValue = function() {
1785
- var _ref9 = _asyncToGenerator(function* (field, index, options) {
1786
- var _options$dontValidate3;
1787
- const fieldValue = _this.getFieldValue(field);
1788
- const lastIndex = Array.isArray(fieldValue) ? Math.max(fieldValue.length - 1, 0) : null;
1789
- _this.setFieldValue(field, (prev) => {
1790
- return prev.filter((_d, i) => i !== index);
1791
- }, mergeOpts(options, { dontValidate: true }));
1792
- metaHelper(_this).handleArrayRemove(field, index);
1793
- if (lastIndex !== null) {
1794
- const start = `${field}[${lastIndex}]`;
1795
- _this.deleteField(start);
1796
- }
1797
- if (!((_options$dontValidate3 = options === null || options === void 0 ? void 0 : options.dontValidate) !== null && _options$dontValidate3 !== void 0 ? _options$dontValidate3 : false)) {
1798
- yield _this.validateField(field, "change");
1799
- yield _this.validateArrayFieldsStartingFrom(field, index, "change");
1800
- }
1801
- });
1802
- return function(_x16, _x17, _x18) {
1803
- return _ref9.apply(this, arguments);
1804
- };
1805
- }();
1806
- this.swapFieldValues = (field, index1, index2, options) => {
1807
- var _options$dontValidate4;
1808
- this.setFieldValue(field, (prev) => {
1809
- const prev1 = prev[index1];
1810
- const prev2 = prev[index2];
1811
- return setBy(setBy(prev, `${index1}`, prev2), `${index2}`, prev1);
1812
- }, mergeOpts(options, { dontValidate: true }));
1813
- metaHelper(this).handleArraySwap(field, index1, index2);
1814
- if (!((_options$dontValidate4 = options === null || options === void 0 ? void 0 : options.dontValidate) !== null && _options$dontValidate4 !== void 0 ? _options$dontValidate4 : false)) {
1815
- this.validateField(field, "change");
1816
- this.validateField(`${field}[${index1}]`, "change");
1817
- this.validateField(`${field}[${index2}]`, "change");
1818
- }
1819
- };
1820
- this.moveFieldValues = (field, index1, index2, options) => {
1821
- var _options$dontValidate5;
1822
- this.setFieldValue(field, (prev) => {
1823
- const next = [...prev];
1824
- next.splice(index2, 0, next.splice(index1, 1)[0]);
1825
- return next;
1826
- }, mergeOpts(options, { dontValidate: true }));
1827
- metaHelper(this).handleArrayMove(field, index1, index2);
1828
- if (!((_options$dontValidate5 = options === null || options === void 0 ? void 0 : options.dontValidate) !== null && _options$dontValidate5 !== void 0 ? _options$dontValidate5 : false)) {
1829
- this.validateField(field, "change");
1830
- this.validateField(`${field}[${index1}]`, "change");
1831
- this.validateField(`${field}[${index2}]`, "change");
1832
- }
1833
- };
1834
- this.clearFieldValues = (field, options) => {
1835
- var _options$dontValidate6;
1836
- const fieldValue = this.getFieldValue(field);
1837
- const lastIndex = Array.isArray(fieldValue) ? Math.max(fieldValue.length - 1, 0) : null;
1838
- this.setFieldValue(field, [], mergeOpts(options, { dontValidate: true }));
1839
- metaHelper(this).bumpArrayVersion(field);
1840
- if (lastIndex !== null) for (let i = 0; i <= lastIndex; i++) {
1841
- const fieldKey = `${field}[${i}]`;
1842
- this.deleteField(fieldKey);
1843
- }
1844
- if (!((_options$dontValidate6 = options === null || options === void 0 ? void 0 : options.dontValidate) !== null && _options$dontValidate6 !== void 0 ? _options$dontValidate6 : false)) this.validateField(field, "change");
1845
- };
1846
- this.resetField = (field) => {
1847
- this.baseStore.setState((prev) => {
1848
- var _this$getFieldInfo$in2;
1849
- const fieldDefault = (_this$getFieldInfo$in2 = this.getFieldInfo(field).instance) === null || _this$getFieldInfo$in2 === void 0 ? void 0 : _this$getFieldInfo$in2.options.defaultValue;
1850
- const formDefault = getBy(this.options.defaultValues, field);
1851
- const targetValue = fieldDefault !== null && fieldDefault !== void 0 ? fieldDefault : formDefault;
1852
- return _objectSpread2(_objectSpread2({}, prev), {}, {
1853
- fieldMetaBase: _objectSpread2(_objectSpread2({}, prev.fieldMetaBase), {}, { [field]: defaultFieldMeta }),
1854
- values: targetValue !== void 0 ? setBy(prev.values, field, targetValue) : prev.values
1855
- });
1856
- });
1857
- };
1858
- this.setErrorMap = (errorMap) => {
1859
- batch(() => {
1860
- Object.entries(errorMap).forEach(([key, value]) => {
1861
- const errorMapKey = key;
1862
- if (isGlobalFormValidationError(value)) {
1863
- const { formError, fieldErrors } = normalizeError$1(value);
1864
- for (const fieldName of Object.keys(this.fieldInfo)) {
1865
- if (!this.getFieldMeta(fieldName)) continue;
1866
- this.setFieldMeta(fieldName, (prev) => _objectSpread2(_objectSpread2({}, prev), {}, {
1867
- errorMap: _objectSpread2(_objectSpread2({}, prev.errorMap), {}, { [errorMapKey]: fieldErrors === null || fieldErrors === void 0 ? void 0 : fieldErrors[fieldName] }),
1868
- errorSourceMap: _objectSpread2(_objectSpread2({}, prev.errorSourceMap), {}, { [errorMapKey]: "form" })
1869
- }));
1870
- }
1871
- this.baseStore.setState((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { errorMap: _objectSpread2(_objectSpread2({}, prev.errorMap), {}, { [errorMapKey]: formError }) }));
1872
- } else this.baseStore.setState((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { errorMap: _objectSpread2(_objectSpread2({}, prev.errorMap), {}, { [errorMapKey]: value }) }));
1873
- });
1874
- });
1875
- };
1876
- this.getAllErrors = () => {
1877
- return {
1878
- form: {
1879
- errors: this.state.errors,
1880
- errorMap: this.state.errorMap
1881
- },
1882
- fields: Object.entries(this.state.fieldMeta).reduce((acc, [fieldName, fieldMeta]) => {
1883
- if (Object.keys(fieldMeta).length && fieldMeta.errors.length) acc[fieldName] = {
1884
- errors: fieldMeta.errors,
1885
- errorMap: fieldMeta.errorMap
1886
- };
1887
- return acc;
1888
- }, {})
1889
- };
1890
- };
1891
- this.parseValuesWithSchema = (schema) => {
1892
- return standardSchemaValidators.validate({
1893
- value: this.state.values,
1894
- validationSource: "form"
1895
- }, schema);
1896
- };
1897
- this.parseValuesWithSchemaAsync = (schema) => {
1898
- return standardSchemaValidators.validateAsync({
1899
- value: this.state.values,
1900
- validationSource: "form"
1901
- }, schema);
1902
- };
1903
- this.timeoutIds = {
1904
- validations: {},
1905
- listeners: {},
1906
- formListeners: {}
1907
- };
1908
- this._formId = (_opts$formId = opts === null || opts === void 0 ? void 0 : opts.formId) !== null && _opts$formId !== void 0 ? _opts$formId : uuid();
1909
- this._devtoolsSubmissionOverride = false;
1910
- let baseStoreVal = getDefaultFormState(_objectSpread2(_objectSpread2({}, opts === null || opts === void 0 ? void 0 : opts.defaultState), {}, { values: (_opts$defaultValues = opts === null || opts === void 0 ? void 0 : opts.defaultValues) !== null && _opts$defaultValues !== void 0 ? _opts$defaultValues : opts === null || opts === void 0 || (_opts$defaultState = opts.defaultState) === null || _opts$defaultState === void 0 ? void 0 : _opts$defaultState.values }));
1911
- if (opts === null || opts === void 0 ? void 0 : opts.transform) {
1912
- baseStoreVal = opts.transform({ state: baseStoreVal }).state;
1913
- for (const errKey of Object.keys(baseStoreVal.errorMap)) {
1914
- const errKeyMap = baseStoreVal.errorMap[errKey];
1915
- if (errKeyMap === void 0 || !isGlobalFormValidationError(errKeyMap)) continue;
1916
- for (const fieldName of Object.keys(errKeyMap.fields)) {
1917
- var _existingFieldMeta$er, _existingFieldMeta$er2;
1918
- const fieldErr = errKeyMap.fields[fieldName];
1919
- if (fieldErr === void 0) continue;
1920
- const existingFieldMeta = baseStoreVal.fieldMetaBase[fieldName];
1921
- baseStoreVal.fieldMetaBase[fieldName] = _objectSpread2(_objectSpread2({
1922
- isTouched: false,
1923
- isValidating: false,
1924
- isBlurred: false,
1925
- isDirty: false,
1926
- _arrayVersion: 0
1927
- }, existingFieldMeta !== null && existingFieldMeta !== void 0 ? existingFieldMeta : {}), {}, {
1928
- errorSourceMap: _objectSpread2(_objectSpread2({}, (_existingFieldMeta$er = existingFieldMeta === null || existingFieldMeta === void 0 ? void 0 : existingFieldMeta["errorSourceMap"]) !== null && _existingFieldMeta$er !== void 0 ? _existingFieldMeta$er : {}), {}, { onChange: "form" }),
1929
- errorMap: _objectSpread2(_objectSpread2({}, (_existingFieldMeta$er2 = existingFieldMeta === null || existingFieldMeta === void 0 ? void 0 : existingFieldMeta["errorMap"]) !== null && _existingFieldMeta$er2 !== void 0 ? _existingFieldMeta$er2 : {}), {}, { [errKey]: fieldErr })
1930
- });
1931
- }
1932
- }
1933
- }
1934
- this.baseStore = createStore(baseStoreVal);
1935
- let prevBaseStore = void 0;
1936
- this.fieldMetaDerived = createStore((prevVal) => {
1937
- const currBaseStore = this.baseStore.get();
1938
- let originalMetaCount = 0;
1939
- const fieldMeta = {};
1940
- for (const fieldName of Object.keys(currBaseStore.fieldMetaBase)) {
1941
- var _this$getFieldInfo$in3, _this$getFieldInfo2, _fieldErrors;
1942
- const currBaseMeta = currBaseStore.fieldMetaBase[fieldName];
1943
- const prevBaseMeta = prevBaseStore === null || prevBaseStore === void 0 ? void 0 : prevBaseStore.fieldMetaBase[fieldName];
1944
- const prevFieldInfo = prevVal === null || prevVal === void 0 ? void 0 : prevVal[fieldName];
1945
- const curFieldVal = getBy(currBaseStore.values, fieldName);
1946
- let fieldErrors = prevFieldInfo === null || prevFieldInfo === void 0 ? void 0 : prevFieldInfo.errors;
1947
- if (!prevBaseMeta || currBaseMeta.errorMap !== prevBaseMeta.errorMap) {
1948
- var _currBaseMeta$errorMa, _this$getFieldInfo;
1949
- fieldErrors = Object.values((_currBaseMeta$errorMa = currBaseMeta.errorMap) !== null && _currBaseMeta$errorMa !== void 0 ? _currBaseMeta$errorMa : {}).filter((val) => val !== void 0);
1950
- const fieldInstance = (_this$getFieldInfo = this.getFieldInfo(fieldName)) === null || _this$getFieldInfo === void 0 ? void 0 : _this$getFieldInfo.instance;
1951
- if (!fieldInstance || !fieldInstance.options.disableErrorFlat) fieldErrors = fieldErrors.flat(1);
1952
- }
1953
- const isFieldValid = !isNonEmptyArray(fieldErrors);
1954
- const isFieldPristine = !currBaseMeta.isDirty;
1955
- const isDefaultValue = evaluate(curFieldVal, (_this$getFieldInfo$in3 = (_this$getFieldInfo2 = this.getFieldInfo(fieldName)) === null || _this$getFieldInfo2 === void 0 || (_this$getFieldInfo2 = _this$getFieldInfo2.instance) === null || _this$getFieldInfo2 === void 0 ? void 0 : _this$getFieldInfo2.options.defaultValue) !== null && _this$getFieldInfo$in3 !== void 0 ? _this$getFieldInfo$in3 : getBy(this.options.defaultValues, fieldName));
1956
- if (prevFieldInfo && prevFieldInfo.isPristine === isFieldPristine && prevFieldInfo.isValid === isFieldValid && prevFieldInfo.isDefaultValue === isDefaultValue && prevFieldInfo.errors === fieldErrors && currBaseMeta === prevBaseMeta) {
1957
- fieldMeta[fieldName] = prevFieldInfo;
1958
- originalMetaCount++;
1959
- continue;
1960
- }
1961
- fieldMeta[fieldName] = _objectSpread2(_objectSpread2({}, currBaseMeta), {}, {
1962
- errors: (_fieldErrors = fieldErrors) !== null && _fieldErrors !== void 0 ? _fieldErrors : [],
1963
- isPristine: isFieldPristine,
1964
- isValid: isFieldValid,
1965
- isDefaultValue
1966
- });
1967
- }
1968
- if (!Object.keys(currBaseStore.fieldMetaBase).length) return fieldMeta;
1969
- if (prevVal && originalMetaCount === Object.keys(currBaseStore.fieldMetaBase).length) return prevVal;
1970
- prevBaseStore = this.baseStore.get();
1971
- return fieldMeta;
1972
- });
1973
- let prevBaseStoreForStore = void 0;
1974
- this.store = createStore((prevVal) => {
1975
- var _currBaseStore$errorM, _currBaseStore$errorM2, _prevVal$errors, _this$options$canSubm;
1976
- const currBaseStore = this.baseStore.get();
1977
- const currFieldMeta = this.fieldMetaDerived.get();
1978
- const fieldMetaValues = Object.values(currFieldMeta).filter(Boolean);
1979
- const isFieldsValidating = fieldMetaValues.some((field) => field.isValidating);
1980
- const isFieldsValid = fieldMetaValues.every((field) => field.isValid);
1981
- const isTouched = fieldMetaValues.some((field) => field.isTouched);
1982
- const isBlurred = fieldMetaValues.some((field) => field.isBlurred);
1983
- const isDefaultValue = fieldMetaValues.every((field) => field.isDefaultValue);
1984
- const shouldInvalidateOnMount = isTouched && ((_currBaseStore$errorM = currBaseStore.errorMap) === null || _currBaseStore$errorM === void 0 ? void 0 : _currBaseStore$errorM.onMount);
1985
- const isDirty = fieldMetaValues.some((field) => field.isDirty);
1986
- const isPristine = !isDirty;
1987
- const hasOnMountError = Boolean(((_currBaseStore$errorM2 = currBaseStore.errorMap) === null || _currBaseStore$errorM2 === void 0 ? void 0 : _currBaseStore$errorM2.onMount) || fieldMetaValues.some((f) => {
1988
- var _f$errorMap;
1989
- return f === null || f === void 0 || (_f$errorMap = f.errorMap) === null || _f$errorMap === void 0 ? void 0 : _f$errorMap.onMount;
1990
- }));
1991
- const isValidating = !!isFieldsValidating;
1992
- let errors = (_prevVal$errors = prevVal === null || prevVal === void 0 ? void 0 : prevVal.errors) !== null && _prevVal$errors !== void 0 ? _prevVal$errors : [];
1993
- if (!prevBaseStoreForStore || currBaseStore.errorMap !== prevBaseStoreForStore.errorMap) errors = Object.values(currBaseStore.errorMap).reduce((prev, curr) => {
1994
- if (curr === void 0) return prev;
1995
- if (curr && isGlobalFormValidationError(curr)) {
1996
- prev.push(curr.form);
1997
- return prev;
1998
- }
1999
- prev.push(curr);
2000
- return prev;
2001
- }, []);
2002
- const isFormValid = errors.length === 0;
2003
- const isValid = isFieldsValid && isFormValid;
2004
- const submitInvalid = (_this$options$canSubm = this.options.canSubmitWhenInvalid) !== null && _this$options$canSubm !== void 0 ? _this$options$canSubm : false;
2005
- const canSubmit = currBaseStore.submissionAttempts === 0 && !isTouched && !hasOnMountError || !isValidating && !currBaseStore.isSubmitting && isValid || submitInvalid;
2006
- let errorMap = currBaseStore.errorMap;
2007
- if (shouldInvalidateOnMount) {
2008
- errors = errors.filter((err) => err !== currBaseStore.errorMap.onMount);
2009
- errorMap = Object.assign(errorMap, { onMount: void 0 });
2010
- }
2011
- if (prevVal && prevBaseStoreForStore && prevVal.errorMap === errorMap && prevVal.fieldMeta === this.fieldMetaDerived.state && prevVal.errors === errors && prevVal.isFieldsValidating === isFieldsValidating && prevVal.isFieldsValid === isFieldsValid && prevVal.isFormValid === isFormValid && prevVal.isValid === isValid && prevVal.canSubmit === canSubmit && prevVal.isTouched === isTouched && prevVal.isBlurred === isBlurred && prevVal.isPristine === isPristine && prevVal.isDefaultValue === isDefaultValue && prevVal.isDirty === isDirty && evaluate(prevBaseStoreForStore, currBaseStore)) return prevVal;
2012
- const state = _objectSpread2(_objectSpread2({}, currBaseStore), {}, {
2013
- errorMap,
2014
- fieldMeta: this.fieldMetaDerived.state,
2015
- errors,
2016
- isFieldsValidating,
2017
- isFieldsValid,
2018
- isFormValid,
2019
- isValid,
2020
- canSubmit,
2021
- isTouched,
2022
- isBlurred,
2023
- isPristine,
2024
- isDefaultValue,
2025
- isDirty
2026
- });
2027
- prevBaseStoreForStore = this.baseStore.get();
2028
- return state;
2029
- });
2030
- this.handleSubmit = this.handleSubmit.bind(this);
2031
- this.update(opts || {});
2032
- }
2033
- get state() {
2034
- return this.store.state;
2035
- }
2036
- get formId() {
2037
- return this._formId;
2038
- }
2039
- /**
2040
- * @private
2041
- */
2042
- runValidator(props) {
2043
- if (isStandardSchemaValidator(props.validate)) return standardSchemaValidators[props.type](props.value, props.validate);
2044
- return props.validate(props.value);
2045
- }
2046
- handleSubmit(submitMeta) {
2047
- return this._handleSubmit(submitMeta);
2048
- }
2049
- };
2050
- }));
2051
- //#endregion
2052
- //#region node_modules/.pnpm/@tanstack+form-core@1.32.0/node_modules/@tanstack/form-core/dist/esm/FieldApi.js
2053
- function normalizeError(rawError) {
2054
- if (rawError) return rawError;
2055
- }
2056
- function getErrorMapKey(cause) {
2057
- switch (cause) {
2058
- case "submit": return "onSubmit";
2059
- case "blur": return "onBlur";
2060
- case "mount": return "onMount";
2061
- case "server": return "onServer";
2062
- case "dynamic": return "onDynamic";
2063
- default: return "onChange";
2064
- }
2065
- }
2066
- var FieldApi;
2067
- var init_FieldApi = __esmMin((() => {
2068
- init_esm$3();
2069
- init_standardSchemaValidator();
2070
- init_metaHelper();
2071
- init_utils();
2072
- init_ValidationLogic();
2073
- init_objectSpread2();
2074
- init_asyncToGenerator();
2075
- FieldApi = class {
2076
- /**
2077
- * Initializes a new `FieldApi` instance.
2078
- */
2079
- constructor(opts) {
2080
- var _this = this;
2081
- this.options = {};
2082
- this.mount = () => {
2083
- var _this$options$listene, _this$options$listene2;
2084
- if (this.options.defaultValue !== void 0 && !this.getMeta().isTouched) this.form.setFieldValue(this.name, this.options.defaultValue, { dontUpdateMeta: true });
2085
- const info = this.getInfo();
2086
- info.instance = this;
2087
- this.update(this.options);
2088
- const { onMount } = this.options.validators || {};
2089
- if (onMount) {
2090
- const error = this.runValidator({
2091
- validate: onMount,
2092
- value: {
2093
- value: this.state.value,
2094
- fieldApi: this,
2095
- validationSource: "field"
2096
- },
2097
- type: "validate"
2098
- });
2099
- if (error) this.setMeta((prev) => _objectSpread2(_objectSpread2({}, prev), {}, {
2100
- errorMap: _objectSpread2(_objectSpread2({}, prev === null || prev === void 0 ? void 0 : prev.errorMap), {}, { onMount: error }),
2101
- errorSourceMap: _objectSpread2(_objectSpread2({}, prev === null || prev === void 0 ? void 0 : prev.errorSourceMap), {}, { onMount: "field" })
2102
- }));
2103
- }
2104
- (_this$options$listene = this.options.listeners) === null || _this$options$listene === void 0 || (_this$options$listene2 = _this$options$listene.onMount) === null || _this$options$listene2 === void 0 || _this$options$listene2.call(_this$options$listene, {
2105
- value: this.state.value,
2106
- fieldApi: this
2107
- });
2108
- return () => {
2109
- var _this$options$listene3, _this$options$listene4, _this$form$options$li, _this$form$options$li2;
2110
- for (const [key, timeout] of Object.entries(this.timeoutIds.validations)) if (timeout) {
2111
- clearTimeout(timeout);
2112
- this.timeoutIds.validations[key] = null;
2113
- }
2114
- for (const [key, timeout] of Object.entries(this.timeoutIds.listeners)) if (timeout) {
2115
- clearTimeout(timeout);
2116
- this.timeoutIds.listeners[key] = null;
2117
- }
2118
- for (const [key, timeout] of Object.entries(this.timeoutIds.formListeners)) if (timeout) {
2119
- clearTimeout(timeout);
2120
- this.timeoutIds.formListeners[key] = null;
2121
- }
2122
- const fieldInfo = this.form.fieldInfo[this.name];
2123
- if (!fieldInfo) return;
2124
- if (fieldInfo.instance !== this) return;
2125
- for (const [key, validationMeta] of Object.entries(fieldInfo.validationMetaMap)) {
2126
- validationMeta === null || validationMeta === void 0 || validationMeta.lastAbortController.abort();
2127
- fieldInfo.validationMetaMap[key] = void 0;
2128
- }
2129
- this.form.baseStore.setState((prev) => {
2130
- var _prev$fieldMetaBase$t, _prev$fieldMetaBase$t2, _prev$fieldMetaBase$t3, _prev$fieldMetaBase$t4, _prev$fieldMetaBase$t5, _prev$fieldMetaBase$t6;
2131
- return _objectSpread2(_objectSpread2({}, prev), {}, { fieldMetaBase: _objectSpread2(_objectSpread2({}, prev.fieldMetaBase), {}, { [this.name]: _objectSpread2(_objectSpread2({}, defaultFieldMeta), {}, {
2132
- isTouched: (_prev$fieldMetaBase$t = (_prev$fieldMetaBase$t2 = prev.fieldMetaBase[this.name]) === null || _prev$fieldMetaBase$t2 === void 0 ? void 0 : _prev$fieldMetaBase$t2.isTouched) !== null && _prev$fieldMetaBase$t !== void 0 ? _prev$fieldMetaBase$t : defaultFieldMeta.isTouched,
2133
- isBlurred: (_prev$fieldMetaBase$t3 = (_prev$fieldMetaBase$t4 = prev.fieldMetaBase[this.name]) === null || _prev$fieldMetaBase$t4 === void 0 ? void 0 : _prev$fieldMetaBase$t4.isBlurred) !== null && _prev$fieldMetaBase$t3 !== void 0 ? _prev$fieldMetaBase$t3 : defaultFieldMeta.isBlurred,
2134
- isDirty: (_prev$fieldMetaBase$t5 = (_prev$fieldMetaBase$t6 = prev.fieldMetaBase[this.name]) === null || _prev$fieldMetaBase$t6 === void 0 ? void 0 : _prev$fieldMetaBase$t6.isDirty) !== null && _prev$fieldMetaBase$t5 !== void 0 ? _prev$fieldMetaBase$t5 : defaultFieldMeta.isDirty
2135
- }) }) });
2136
- });
2137
- fieldInfo.instance = null;
2138
- (_this$options$listene3 = this.options.listeners) === null || _this$options$listene3 === void 0 || (_this$options$listene4 = _this$options$listene3.onUnmount) === null || _this$options$listene4 === void 0 || _this$options$listene4.call(_this$options$listene3, {
2139
- value: this.state.value,
2140
- fieldApi: this
2141
- });
2142
- (_this$form$options$li = this.form.options.listeners) === null || _this$form$options$li === void 0 || (_this$form$options$li2 = _this$form$options$li.onFieldUnmount) === null || _this$form$options$li2 === void 0 || _this$form$options$li2.call(_this$form$options$li, {
2143
- formApi: this.form,
2144
- fieldApi: this
2145
- });
2146
- };
2147
- };
2148
- this.update = (opts2) => {
2149
- this.options = opts2;
2150
- this.name = opts2.name;
2151
- if (!this.state.meta.isTouched && this.options.defaultValue !== void 0) {
2152
- if (!evaluate(this.form.getFieldValue(this.name), opts2.defaultValue)) this.form.setFieldValue(this.name, opts2.defaultValue, {
2153
- dontUpdateMeta: true,
2154
- dontValidate: true,
2155
- dontRunListeners: true
2156
- });
2157
- }
2158
- if (!this.form.getFieldMeta(this.name)) this.form.setFieldMeta(this.name, this.state.meta);
2159
- };
2160
- this.getValue = () => {
2161
- return this.form.getFieldValue(this.name);
2162
- };
2163
- this.setValue = (updater, options) => {
2164
- this.form.setFieldValue(this.name, updater, mergeOpts(options, {
2165
- dontRunListeners: true,
2166
- dontValidate: true
2167
- }));
2168
- if (!(options === null || options === void 0 ? void 0 : options.dontRunListeners)) this.triggerOnChangeListener();
2169
- if (!(options === null || options === void 0 ? void 0 : options.dontValidate)) this.validate("change");
2170
- };
2171
- this.getMeta = () => this.store.state.meta;
2172
- this.setMeta = (updater) => this.form.setFieldMeta(this.name, updater);
2173
- this.getInfo = () => this.form.getFieldInfo(this.name);
2174
- this.pushValue = (value, options) => {
2175
- this.form.pushFieldValue(this.name, value, mergeOpts(options, { dontRunListeners: true }));
2176
- if (!(options === null || options === void 0 ? void 0 : options.dontRunListeners)) this.triggerOnChangeListener();
2177
- };
2178
- this.insertValue = (index, value, options) => {
2179
- this.form.insertFieldValue(this.name, index, value, mergeOpts(options, { dontRunListeners: true }));
2180
- if (!(options === null || options === void 0 ? void 0 : options.dontRunListeners)) this.triggerOnChangeListener();
2181
- };
2182
- this.replaceValue = (index, value, options) => {
2183
- this.form.replaceFieldValue(this.name, index, value, mergeOpts(options, { dontRunListeners: true }));
2184
- if (!(options === null || options === void 0 ? void 0 : options.dontRunListeners)) this.triggerOnChangeListener();
2185
- };
2186
- this.removeValue = (index, options) => {
2187
- this.form.removeFieldValue(this.name, index, mergeOpts(options, { dontRunListeners: true }));
2188
- if (!(options === null || options === void 0 ? void 0 : options.dontRunListeners)) this.triggerOnChangeListener();
2189
- };
2190
- this.swapValues = (aIndex, bIndex, options) => {
2191
- this.form.swapFieldValues(this.name, aIndex, bIndex, mergeOpts(options, { dontRunListeners: true }));
2192
- if (!(options === null || options === void 0 ? void 0 : options.dontRunListeners)) this.triggerOnChangeListener();
2193
- };
2194
- this.moveValue = (aIndex, bIndex, options) => {
2195
- this.form.moveFieldValues(this.name, aIndex, bIndex, mergeOpts(options, { dontRunListeners: true }));
2196
- if (!(options === null || options === void 0 ? void 0 : options.dontRunListeners)) this.triggerOnChangeListener();
2197
- };
2198
- this.clearValues = (options) => {
2199
- this.form.clearFieldValues(this.name, mergeOpts(options, { dontRunListeners: true }));
2200
- if (!(options === null || options === void 0 ? void 0 : options.dontRunListeners)) this.triggerOnChangeListener();
2201
- };
2202
- this.getLinkedFields = (cause) => {
2203
- const fields = Object.values(this.form.fieldInfo);
2204
- const linkedFields = [];
2205
- for (const field of fields) {
2206
- if (!field.instance) continue;
2207
- const { onChangeListenTo, onBlurListenTo } = field.instance.options.validators || {};
2208
- if (cause === "change" && (onChangeListenTo === null || onChangeListenTo === void 0 ? void 0 : onChangeListenTo.includes(this.name))) linkedFields.push(field.instance);
2209
- if (cause === "blur" && (onBlurListenTo === null || onBlurListenTo === void 0 ? void 0 : onBlurListenTo.includes(this.name))) linkedFields.push(field.instance);
2210
- }
2211
- return linkedFields;
2212
- };
2213
- this.validateSync = (cause, errorFromForm) => {
2214
- var _this$state$meta$erro;
2215
- const validates = getSyncValidatorArray(cause, _objectSpread2(_objectSpread2({}, this.options), {}, {
2216
- form: this.form,
2217
- fieldName: this.name,
2218
- validationLogic: this.form.options.validationLogic || defaultValidationLogic
2219
- }));
2220
- const linkedFieldValidates = this.getLinkedFields(cause).reduce((acc, field) => {
2221
- const fieldValidates = getSyncValidatorArray(cause, _objectSpread2(_objectSpread2({}, field.options), {}, {
2222
- form: field.form,
2223
- fieldName: field.name,
2224
- validationLogic: field.form.options.validationLogic || defaultValidationLogic
2225
- }));
2226
- fieldValidates.forEach((validate) => {
2227
- validate.field = field;
2228
- });
2229
- return acc.concat(fieldValidates);
2230
- }, []);
2231
- let hasErrored = false;
2232
- batch(() => {
2233
- const validateFieldFn = (field, validateObj) => {
2234
- var _field$state$meta$err;
2235
- const errorMapKey = getErrorMapKey(validateObj.cause);
2236
- const fieldLevelError = validateObj.validate ? normalizeError(field.runValidator({
2237
- validate: validateObj.validate,
2238
- value: {
2239
- value: field.store.state.value,
2240
- validationSource: "field",
2241
- fieldApi: field
2242
- },
2243
- type: "validate"
2244
- })) : void 0;
2245
- const formLevelError = errorFromForm[errorMapKey];
2246
- const { newErrorValue, newSource } = determineFieldLevelErrorSourceAndValue({
2247
- formLevelError,
2248
- fieldLevelError
2249
- });
2250
- if (((_field$state$meta$err = field.state.meta.errorMap) === null || _field$state$meta$err === void 0 ? void 0 : _field$state$meta$err[errorMapKey]) !== newErrorValue) field.setMeta((prev) => _objectSpread2(_objectSpread2({}, prev), {}, {
2251
- errorMap: _objectSpread2(_objectSpread2({}, prev.errorMap), {}, { [errorMapKey]: newErrorValue }),
2252
- errorSourceMap: _objectSpread2(_objectSpread2({}, prev.errorSourceMap), {}, { [errorMapKey]: newSource })
2253
- }));
2254
- if (newErrorValue) hasErrored = true;
2255
- };
2256
- for (const validateObj of validates) validateFieldFn(this, validateObj);
2257
- for (const fieldValitateObj of linkedFieldValidates) {
2258
- if (!fieldValitateObj.validate) continue;
2259
- validateFieldFn(fieldValitateObj.field, fieldValitateObj);
2260
- }
2261
- });
2262
- const submitErrKey = getErrorMapKey("submit");
2263
- if (((_this$state$meta$erro = this.state.meta.errorMap) === null || _this$state$meta$erro === void 0 ? void 0 : _this$state$meta$erro[submitErrKey]) && cause !== "submit" && !hasErrored) this.setMeta((prev) => _objectSpread2(_objectSpread2({}, prev), {}, {
2264
- errorMap: _objectSpread2(_objectSpread2({}, prev.errorMap), {}, { [submitErrKey]: void 0 }),
2265
- errorSourceMap: _objectSpread2(_objectSpread2({}, prev.errorSourceMap), {}, { [submitErrKey]: void 0 })
2266
- }));
2267
- return { hasErrored };
2268
- };
2269
- this.validateAsync = function() {
2270
- var _ref2 = _asyncToGenerator(function* (cause, formValidationResultPromise) {
2271
- const validates = getAsyncValidatorArray(cause, _objectSpread2(_objectSpread2({}, _this.options), {}, {
2272
- form: _this.form,
2273
- fieldName: _this.name,
2274
- validationLogic: _this.form.options.validationLogic || defaultValidationLogic
2275
- }));
2276
- const asyncFormValidationResults = yield formValidationResultPromise;
2277
- const linkedFields = _this.getLinkedFields(cause);
2278
- const linkedFieldValidates = linkedFields.reduce((acc, field) => {
2279
- const fieldValidates = getAsyncValidatorArray(cause, _objectSpread2(_objectSpread2({}, field.options), {}, {
2280
- form: field.form,
2281
- fieldName: field.name,
2282
- validationLogic: field.form.options.validationLogic || defaultValidationLogic
2283
- }));
2284
- fieldValidates.forEach((validate) => {
2285
- validate.field = field;
2286
- });
2287
- return acc.concat(fieldValidates);
2288
- }, []);
2289
- const validatesPromises = [];
2290
- const linkedPromises = [];
2291
- const hasAsyncValidators = validates.some((v) => v.validate) || linkedFieldValidates.some((v) => v.validate);
2292
- if (hasAsyncValidators) {
2293
- if (!_this.state.meta.isValidating) _this.setMeta((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { isValidating: true }));
2294
- for (const linkedField of linkedFields) linkedField.setMeta((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { isValidating: true }));
2295
- }
2296
- const validateFieldAsyncFn = (field, validateObj, promises) => {
2297
- const errorMapKey = getErrorMapKey(validateObj.cause);
2298
- const fieldInfo = field.getInfo();
2299
- const fieldValidatorMeta = fieldInfo.validationMetaMap[errorMapKey];
2300
- fieldValidatorMeta === null || fieldValidatorMeta === void 0 || fieldValidatorMeta.lastAbortController.abort();
2301
- const controller = new AbortController();
2302
- fieldInfo.validationMetaMap[errorMapKey] = { lastAbortController: controller };
2303
- promises.push(new Promise(function() {
2304
- var _ref = _asyncToGenerator(function* (resolve) {
2305
- var _asyncFormValidationR;
2306
- let rawError;
2307
- try {
2308
- rawError = yield new Promise((rawResolve, rawReject) => {
2309
- if (field.timeoutIds.validations[validateObj.cause]) clearTimeout(field.timeoutIds.validations[validateObj.cause]);
2310
- field.timeoutIds.validations[validateObj.cause] = setTimeout(_asyncToGenerator(function* () {
2311
- if (controller.signal.aborted) return rawResolve(void 0);
2312
- try {
2313
- rawResolve(yield _this.runValidator({
2314
- validate: validateObj.validate,
2315
- value: {
2316
- value: field.store.state.value,
2317
- fieldApi: field,
2318
- signal: controller.signal,
2319
- validationSource: "field"
2320
- },
2321
- type: "validateAsync"
2322
- }));
2323
- } catch (e) {
2324
- rawReject(e);
2325
- }
2326
- }), validateObj.debounceMs);
2327
- });
2328
- } catch (e) {
2329
- rawError = e;
2330
- }
2331
- if (controller.signal.aborted) return resolve(void 0);
2332
- const fieldLevelError = normalizeError(rawError);
2333
- const { newErrorValue, newSource } = determineFieldLevelErrorSourceAndValue({
2334
- formLevelError: (_asyncFormValidationR = asyncFormValidationResults[field.name]) === null || _asyncFormValidationR === void 0 ? void 0 : _asyncFormValidationR[errorMapKey],
2335
- fieldLevelError
2336
- });
2337
- if (field.getInfo().instance !== field) return resolve(void 0);
2338
- field.setMeta((prev) => {
2339
- return _objectSpread2(_objectSpread2({}, prev), {}, {
2340
- errorMap: _objectSpread2(_objectSpread2({}, prev === null || prev === void 0 ? void 0 : prev.errorMap), {}, { [errorMapKey]: newErrorValue }),
2341
- errorSourceMap: _objectSpread2(_objectSpread2({}, prev.errorSourceMap), {}, { [errorMapKey]: newSource })
2342
- });
2343
- });
2344
- resolve(newErrorValue);
2345
- });
2346
- return function(_x) {
2347
- return _ref.apply(this, arguments);
2348
- };
2349
- }()));
2350
- };
2351
- for (const validateObj of validates) {
2352
- if (!validateObj.validate) continue;
2353
- validateFieldAsyncFn(_this, validateObj, validatesPromises);
2354
- }
2355
- for (const fieldValitateObj of linkedFieldValidates) {
2356
- if (!fieldValitateObj.validate) continue;
2357
- validateFieldAsyncFn(fieldValitateObj.field, fieldValitateObj, linkedPromises);
2358
- }
2359
- let results = [];
2360
- if (validatesPromises.length || linkedPromises.length) {
2361
- results = yield Promise.all(validatesPromises);
2362
- yield Promise.all(linkedPromises);
2363
- }
2364
- if (hasAsyncValidators) {
2365
- _this.setMeta((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { isValidating: false }));
2366
- for (const linkedField of linkedFields) linkedField.setMeta((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { isValidating: false }));
2367
- }
2368
- return results.filter(Boolean);
2369
- });
2370
- return function(_x2, _x3) {
2371
- return _ref2.apply(this, arguments);
2372
- };
2373
- }();
2374
- this.validate = (cause, opts2) => {
2375
- var _fieldsErrorMap$this$;
2376
- if (!this.state.meta.isTouched) return [];
2377
- const { fieldsErrorMap } = (opts2 === null || opts2 === void 0 ? void 0 : opts2.skipFormValidation) ? { fieldsErrorMap: {} } : this.form.validateSync(cause);
2378
- const { hasErrored } = this.validateSync(cause, (_fieldsErrorMap$this$ = fieldsErrorMap[this.name]) !== null && _fieldsErrorMap$this$ !== void 0 ? _fieldsErrorMap$this$ : {});
2379
- if (hasErrored && !this.options.asyncAlways) {
2380
- var _this$getInfo$validat;
2381
- (_this$getInfo$validat = this.getInfo().validationMetaMap[getErrorMapKey(cause)]) === null || _this$getInfo$validat === void 0 || _this$getInfo$validat.lastAbortController.abort();
2382
- return this.state.meta.errors;
2383
- }
2384
- const formValidationResultPromise = (opts2 === null || opts2 === void 0 ? void 0 : opts2.skipFormValidation) ? Promise.resolve({}) : this.form.validateAsync(cause);
2385
- return this.validateAsync(cause, formValidationResultPromise);
2386
- };
2387
- this.handleChange = (updater) => {
2388
- this.setValue(updater);
2389
- };
2390
- this.handleBlur = () => {
2391
- if (!this.state.meta.isTouched) this.setMeta((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { isTouched: true }));
2392
- if (!this.state.meta.isBlurred) this.setMeta((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { isBlurred: true }));
2393
- this.validate("blur");
2394
- this.triggerOnBlurListener();
2395
- };
2396
- this.setErrorMap = (errorMap) => {
2397
- this.setMeta((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { errorMap: _objectSpread2(_objectSpread2({}, prev.errorMap), errorMap) }));
2398
- };
2399
- this.parseValueWithSchema = (schema) => {
2400
- return standardSchemaValidators.validate({
2401
- value: this.state.value,
2402
- validationSource: "field"
2403
- }, schema);
2404
- };
2405
- this.parseValueWithSchemaAsync = (schema) => {
2406
- return standardSchemaValidators.validateAsync({
2407
- value: this.state.value,
2408
- validationSource: "field"
2409
- }, schema);
2410
- };
2411
- this.triggerOnChangeListener = () => {
2412
- var _this$form$options$li3, _this$options$listene5;
2413
- const formDebounceMs = (_this$form$options$li3 = this.form.options.listeners) === null || _this$form$options$li3 === void 0 ? void 0 : _this$form$options$li3.onChangeDebounceMs;
2414
- if (formDebounceMs && formDebounceMs > 0) {
2415
- if (this.timeoutIds.formListeners.change) clearTimeout(this.timeoutIds.formListeners.change);
2416
- this.timeoutIds.formListeners.change = setTimeout(() => {
2417
- var _this$form$options$li4, _this$form$options$li5;
2418
- (_this$form$options$li4 = this.form.options.listeners) === null || _this$form$options$li4 === void 0 || (_this$form$options$li5 = _this$form$options$li4.onChange) === null || _this$form$options$li5 === void 0 || _this$form$options$li5.call(_this$form$options$li4, {
2419
- formApi: this.form,
2420
- fieldApi: this
2421
- });
2422
- }, formDebounceMs);
2423
- } else {
2424
- var _this$form$options$li6, _this$form$options$li7;
2425
- (_this$form$options$li6 = this.form.options.listeners) === null || _this$form$options$li6 === void 0 || (_this$form$options$li7 = _this$form$options$li6.onChange) === null || _this$form$options$li7 === void 0 || _this$form$options$li7.call(_this$form$options$li6, {
2426
- formApi: this.form,
2427
- fieldApi: this
2428
- });
2429
- }
2430
- const fieldDebounceMs = (_this$options$listene5 = this.options.listeners) === null || _this$options$listene5 === void 0 ? void 0 : _this$options$listene5.onChangeDebounceMs;
2431
- if (fieldDebounceMs && fieldDebounceMs > 0) {
2432
- if (this.timeoutIds.listeners.change) clearTimeout(this.timeoutIds.listeners.change);
2433
- this.timeoutIds.listeners.change = setTimeout(() => {
2434
- var _this$options$listene6, _this$options$listene7;
2435
- (_this$options$listene6 = this.options.listeners) === null || _this$options$listene6 === void 0 || (_this$options$listene7 = _this$options$listene6.onChange) === null || _this$options$listene7 === void 0 || _this$options$listene7.call(_this$options$listene6, {
2436
- value: this.state.value,
2437
- fieldApi: this
2438
- });
2439
- }, fieldDebounceMs);
2440
- } else {
2441
- var _this$options$listene8, _this$options$listene9;
2442
- (_this$options$listene8 = this.options.listeners) === null || _this$options$listene8 === void 0 || (_this$options$listene9 = _this$options$listene8.onChange) === null || _this$options$listene9 === void 0 || _this$options$listene9.call(_this$options$listene8, {
2443
- value: this.state.value,
2444
- fieldApi: this
2445
- });
2446
- }
2447
- };
2448
- this.form = opts.form;
2449
- this.name = opts.name;
2450
- this.options = opts;
2451
- this.timeoutIds = {
2452
- validations: {},
2453
- listeners: {},
2454
- formListeners: {}
2455
- };
2456
- this.store = createStore((prevVal) => {
2457
- var _this$form$getFieldMe;
2458
- this.form.store.get();
2459
- const meta = (_this$form$getFieldMe = this.form.getFieldMeta(this.name)) !== null && _this$form$getFieldMe !== void 0 ? _this$form$getFieldMe : _objectSpread2(_objectSpread2({}, defaultFieldMeta), opts.defaultMeta);
2460
- let value = this.form.getFieldValue(this.name);
2461
- if (!meta.isTouched && value === void 0 && this.options.defaultValue !== void 0 && !evaluate(value, this.options.defaultValue)) value = this.options.defaultValue;
2462
- if (prevVal && prevVal.value === value && prevVal.meta === meta) return prevVal;
2463
- return {
2464
- value,
2465
- meta
2466
- };
2467
- });
2468
- }
2469
- /**
2470
- * The current field state.
2471
- */
2472
- get state() {
2473
- return this.store.state;
2474
- }
2475
- /**
2476
- * @private
2477
- */
2478
- runValidator(props) {
2479
- if (isStandardSchemaValidator(props.validate)) return standardSchemaValidators[props.type](props.value, props.validate);
2480
- return props.validate(props.value);
2481
- }
2482
- triggerOnBlurListener() {
2483
- var _this$form$options$li8, _this$options$listene10;
2484
- const formDebounceMs = (_this$form$options$li8 = this.form.options.listeners) === null || _this$form$options$li8 === void 0 ? void 0 : _this$form$options$li8.onBlurDebounceMs;
2485
- if (formDebounceMs && formDebounceMs > 0) {
2486
- if (this.timeoutIds.formListeners.blur) clearTimeout(this.timeoutIds.formListeners.blur);
2487
- this.timeoutIds.formListeners.blur = setTimeout(() => {
2488
- var _this$form$options$li9, _this$form$options$li10;
2489
- (_this$form$options$li9 = this.form.options.listeners) === null || _this$form$options$li9 === void 0 || (_this$form$options$li10 = _this$form$options$li9.onBlur) === null || _this$form$options$li10 === void 0 || _this$form$options$li10.call(_this$form$options$li9, {
2490
- formApi: this.form,
2491
- fieldApi: this
2492
- });
2493
- }, formDebounceMs);
2494
- } else {
2495
- var _this$form$options$li11, _this$form$options$li12;
2496
- (_this$form$options$li11 = this.form.options.listeners) === null || _this$form$options$li11 === void 0 || (_this$form$options$li12 = _this$form$options$li11.onBlur) === null || _this$form$options$li12 === void 0 || _this$form$options$li12.call(_this$form$options$li11, {
2497
- formApi: this.form,
2498
- fieldApi: this
2499
- });
2500
- }
2501
- const fieldDebounceMs = (_this$options$listene10 = this.options.listeners) === null || _this$options$listene10 === void 0 ? void 0 : _this$options$listene10.onBlurDebounceMs;
2502
- if (fieldDebounceMs && fieldDebounceMs > 0) {
2503
- if (this.timeoutIds.listeners.blur) clearTimeout(this.timeoutIds.listeners.blur);
2504
- this.timeoutIds.listeners.blur = setTimeout(() => {
2505
- var _this$options$listene11, _this$options$listene12;
2506
- (_this$options$listene11 = this.options.listeners) === null || _this$options$listene11 === void 0 || (_this$options$listene12 = _this$options$listene11.onBlur) === null || _this$options$listene12 === void 0 || _this$options$listene12.call(_this$options$listene11, {
2507
- value: this.state.value,
2508
- fieldApi: this
2509
- });
2510
- }, fieldDebounceMs);
2511
- } else {
2512
- var _this$options$listene13, _this$options$listene14;
2513
- (_this$options$listene13 = this.options.listeners) === null || _this$options$listene13 === void 0 || (_this$options$listene14 = _this$options$listene13.onBlur) === null || _this$options$listene14 === void 0 || _this$options$listene14.call(_this$options$listene13, {
2514
- value: this.state.value,
2515
- fieldApi: this
2516
- });
2517
- }
2518
- }
2519
- };
2520
- }));
2521
- //#endregion
2522
- //#region node_modules/.pnpm/@tanstack+form-core@1.32.0/node_modules/@tanstack/form-core/dist/esm/index.js
2523
- var init_esm$1 = __esmMin((() => {
2524
- init_FormApi();
2525
- init_FieldApi();
2526
- init_utils();
2527
- init_ValidationLogic();
2528
- }));
2529
- //#endregion
2530
- //#region node_modules/.pnpm/@tanstack+vue-store@0.9.3_vue@3.5.34_typescript@5.9.3_/node_modules/@tanstack/vue-store/dist/esm/index.js
2531
- function useStore(store, selector = (d) => d, options = {}) {
2532
- var _options$equal;
2533
- const slice = ref(selector(store.get()));
2534
- const equal = (_options$equal = options.equal) !== null && _options$equal !== void 0 ? _options$equal : shallow;
2535
- watch(() => store, (value, _oldValue, onCleanup) => {
2536
- const unsub = value.subscribe((s) => {
2537
- const data = selector(s);
2538
- if (equal(toRaw(slice.value), data)) return;
2539
- slice.value = data;
2540
- }).unsubscribe;
2541
- onCleanup(() => {
2542
- unsub();
2543
- });
2544
- }, { immediate: true });
2545
- return readonly(slice);
2546
- }
2547
- function shallow(objA, objB) {
2548
- if (Object.is(objA, objB)) return true;
2549
- if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) return false;
2550
- if (objA instanceof Map && objB instanceof Map) {
2551
- if (objA.size !== objB.size) return false;
2552
- for (const [k, v] of objA) if (!objB.has(k) || !Object.is(v, objB.get(k))) return false;
2553
- return true;
2554
- }
2555
- if (objA instanceof Set && objB instanceof Set) {
2556
- if (objA.size !== objB.size) return false;
2557
- for (const v of objA) if (!objB.has(v)) return false;
2558
- return true;
2559
- }
2560
- if (objA instanceof Date && objB instanceof Date) {
2561
- if (objA.getTime() !== objB.getTime()) return false;
2562
- return true;
2563
- }
2564
- const keysA = Object.keys(objA);
2565
- if (keysA.length !== Object.keys(objB).length) return false;
2566
- for (let i = 0; i < keysA.length; i++) if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) return false;
2567
- return true;
2568
- }
2569
- var init_esm = __esmMin((() => {
2570
- init_lib();
2571
- init_esm$3();
2572
- }));
2573
- //#endregion
2574
- export { FormApi as a, getBy as c, FieldApi as i, isGlobalFormValidationError as l, useStore as n, revalidateLogic as o, init_esm$1 as r, determineFormLevelErrorSourceAndValue as s, init_esm as t };