@remoteoss/remote-flows 0.7.5 → 0.8.1

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 (240) hide show
  1. package/README.md +8 -7
  2. package/dist/{chunk-SXVOPWRB.js → chunk-2J6TOHV5.js} +2 -2
  3. package/dist/{chunk-PCGJH2EO.js → chunk-2VGEHBMK.js} +2 -2
  4. package/dist/{chunk-V5ENHJL2.js → chunk-3GCWEV4G.js} +2 -2
  5. package/dist/{chunk-WT3QZR6I.js → chunk-3LGFQNYW.js} +2 -2
  6. package/dist/chunk-466M4PK7.js +2 -0
  7. package/dist/chunk-466M4PK7.js.map +1 -0
  8. package/dist/chunk-4EX2FBJD.js +2 -0
  9. package/dist/chunk-4EX2FBJD.js.map +1 -0
  10. package/dist/chunk-4F4I7F2P.js +2 -0
  11. package/dist/chunk-4F4I7F2P.js.map +1 -0
  12. package/dist/{chunk-K7CLAEMU.js → chunk-4N3O2DPO.js} +2 -2
  13. package/dist/{chunk-7DM7LDK3.js → chunk-5IREEZLM.js} +2 -2
  14. package/dist/chunk-5PVQUO5Q.js +2 -0
  15. package/dist/chunk-5PVQUO5Q.js.map +1 -0
  16. package/dist/{chunk-VZB5LUZK.js → chunk-62R3GVFU.js} +2 -2
  17. package/dist/{chunk-JTC54RNC.js → chunk-6P4XGSZ6.js} +2 -2
  18. package/dist/chunk-7LZQJ5CL.js +2 -0
  19. package/dist/chunk-7LZQJ5CL.js.map +1 -0
  20. package/dist/{chunk-77WJVEKH.js → chunk-A27ASO7K.js} +2 -2
  21. package/dist/chunk-AEVZ7GEK.js +2 -0
  22. package/dist/chunk-AEVZ7GEK.js.map +1 -0
  23. package/dist/{chunk-MCWVVCIK.js → chunk-AT2QKM6T.js} +2 -2
  24. package/dist/chunk-AYAQLXJH.js +2 -0
  25. package/dist/{chunk-NJPNR4DK.js.map → chunk-AYAQLXJH.js.map} +1 -1
  26. package/dist/{chunk-MC6FNME3.js → chunk-C3KZEPUZ.js} +2 -2
  27. package/dist/{chunk-RUZWAFIN.js → chunk-CKNNZPHW.js} +2 -2
  28. package/dist/{chunk-ZERPSH7S.js → chunk-CQ2QAZBG.js} +2 -2
  29. package/dist/chunk-DPLXEXMO.js +2 -0
  30. package/dist/{chunk-RPEWAKDI.js.map → chunk-DPLXEXMO.js.map} +1 -1
  31. package/dist/chunk-FQNVKX3N.js +2 -0
  32. package/dist/chunk-FQNVKX3N.js.map +1 -0
  33. package/dist/{chunk-ZVMBZK3H.js → chunk-G4NBJTHB.js} +2 -2
  34. package/dist/{chunk-H32UX3PE.js → chunk-HDL43KVH.js} +2 -2
  35. package/dist/chunk-HGLI6PUM.js +2 -0
  36. package/dist/chunk-HGLI6PUM.js.map +1 -0
  37. package/dist/{chunk-Y7P3FLOM.js → chunk-HI4QEV6Y.js} +2 -2
  38. package/dist/{chunk-TIHZZ6IF.js → chunk-HQMY3X2R.js} +2 -2
  39. package/dist/{chunk-CEFYPG7Z.js → chunk-IXVV7KPW.js} +2 -2
  40. package/dist/{chunk-6ZNJ5WMX.js → chunk-IXZAHZ7B.js} +2 -2
  41. package/dist/{chunk-K6GSGFOD.js → chunk-NXZRK6KL.js} +2 -2
  42. package/dist/{chunk-J3ZV4EJ5.js → chunk-OGAVWGSY.js} +2 -2
  43. package/dist/{chunk-2AOR4YZS.js → chunk-OMQXG7HR.js} +2 -2
  44. package/dist/{chunk-SYEPIESJ.js → chunk-OTTIURMN.js} +2 -2
  45. package/dist/{chunk-55OFDAIV.js → chunk-Q5ZUVH3U.js} +2 -2
  46. package/dist/{chunk-4UKKNARJ.js → chunk-R6OW77R6.js} +2 -2
  47. package/dist/{chunk-HCFC46A6.js → chunk-RCS2IOVS.js} +2 -2
  48. package/dist/{chunk-HP4SYBET.js → chunk-S62STPBT.js} +2 -2
  49. package/dist/{chunk-CAM6PYKR.js → chunk-SHFIZENN.js} +2 -2
  50. package/dist/{chunk-SJVHKOCT.js → chunk-SMVJBWB5.js} +2 -2
  51. package/dist/chunk-SRZGBJVA.js +2 -0
  52. package/dist/chunk-SRZGBJVA.js.map +1 -0
  53. package/dist/chunk-T3TTTDSK.js +2 -0
  54. package/dist/chunk-T3TTTDSK.js.map +1 -0
  55. package/dist/{chunk-3QLTEH2U.js → chunk-TKJPLMMP.js} +2 -2
  56. package/dist/{chunk-VTNGEN34.js → chunk-UNTCBVHB.js} +2 -2
  57. package/dist/chunk-V6W2SJ4Z.js +2 -0
  58. package/dist/{chunk-7KQT4QR4.js.map → chunk-V6W2SJ4Z.js.map} +1 -1
  59. package/dist/{chunk-HNMDLN2I.js → chunk-WBFNVJSC.js} +2 -2
  60. package/dist/{chunk-ONH3EBJZ.js → chunk-WDYXTDUA.js} +2 -2
  61. package/dist/{chunk-7NN4M5P2.js → chunk-WFET4MKU.js} +2 -2
  62. package/dist/{chunk-JQOEHEGL.js → chunk-WJA7PQ2J.js} +2 -2
  63. package/dist/{chunk-LVACJZSJ.js → chunk-WOUZK5DW.js} +2 -2
  64. package/dist/{chunk-5ZWCZYSA.js → chunk-YBRKMNHD.js} +2 -2
  65. package/dist/{chunk-XZ5IR7N3.js → chunk-YEPXGH7I.js} +2 -2
  66. package/dist/chunk-YHSNK7WB.js +2 -0
  67. package/dist/chunk-YHSNK7WB.js.map +1 -0
  68. package/dist/{chunk-NVAWIT33.js → chunk-YJRFIIPM.js} +2 -2
  69. package/dist/{chunk-TQYHW6QK.js → chunk-YLO2MGPV.js} +2 -2
  70. package/dist/{chunk-5HFXSPZZ.js → chunk-ZKPPNS6J.js} +2 -2
  71. package/dist/{chunk-WRZ6WHH7.js → chunk-ZPUELAQZ.js} +2 -2
  72. package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
  73. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  74. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
  75. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +1 -1
  76. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  77. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  78. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  79. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
  80. package/dist/flows/ContractAmendment/context.d.ts +2 -2
  81. package/dist/flows/ContractAmendment/hooks.d.ts +1 -1
  82. package/dist/flows/ContractAmendment/hooks.js +1 -1
  83. package/dist/flows/ContractAmendment/index.d.ts +1 -1
  84. package/dist/flows/ContractAmendment/index.js +1 -1
  85. package/dist/flows/ContractAmendment/utils.d.ts +1 -1
  86. package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js +1 -1
  87. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +1 -1
  88. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  89. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +1 -1
  90. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  91. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
  92. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
  93. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.d.ts +2 -0
  94. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  95. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.d.ts +1 -0
  96. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  97. package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.d.ts +2 -0
  98. package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
  99. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.d.ts +2 -1
  100. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  101. package/dist/flows/CostCalculator/Results/CostCalculatorIndirectTax.js +1 -1
  102. package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
  103. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  104. package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.js +1 -1
  105. package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.js +1 -1
  106. package/dist/flows/CostCalculator/api.d.ts +1 -1
  107. package/dist/flows/CostCalculator/api.js +1 -1
  108. package/dist/flows/CostCalculator/components/SalaryField.d.ts +1 -1
  109. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  110. package/dist/flows/CostCalculator/context.d.ts +2 -2
  111. package/dist/flows/CostCalculator/hooks.d.ts +1 -1
  112. package/dist/flows/CostCalculator/hooks.js +1 -1
  113. package/dist/flows/CostCalculator/index.d.ts +2 -2
  114. package/dist/flows/CostCalculator/index.js +1 -1
  115. package/dist/flows/CostCalculator/types.d.ts +1 -1
  116. package/dist/flows/CostCalculator/utils.d.ts +2 -2
  117. package/dist/flows/CostCalculator/utils.js +1 -1
  118. package/dist/flows/Onboarding/OnboardingFlow.d.ts +2 -2
  119. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  120. package/dist/flows/Onboarding/api.d.ts +2 -2
  121. package/dist/flows/Onboarding/api.js +1 -1
  122. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +1 -1
  123. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  124. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +1 -1
  125. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  126. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +2 -2
  127. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  128. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +1 -1
  129. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  130. package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
  131. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +2 -2
  132. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  133. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +1 -1
  134. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  135. package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
  136. package/dist/flows/Onboarding/components/ReviewStep.d.ts +1 -1
  137. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +1 -1
  138. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  139. package/dist/flows/Onboarding/context.d.ts +2 -2
  140. package/dist/flows/Onboarding/hooks.d.ts +2 -2
  141. package/dist/flows/Onboarding/hooks.js +1 -1
  142. package/dist/flows/Onboarding/index.d.ts +2 -2
  143. package/dist/flows/Onboarding/index.js +1 -1
  144. package/dist/flows/Onboarding/types.d.ts +1 -1
  145. package/dist/flows/Onboarding/utils.d.ts +1 -1
  146. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +1 -1
  147. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  148. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +1 -1
  149. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  150. package/dist/flows/Termination/PaidTimeOffForm.d.ts +1 -1
  151. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  152. package/dist/flows/Termination/TerminationBack.js +1 -1
  153. package/dist/flows/Termination/TerminationDetailsForm.d.ts +1 -1
  154. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  155. package/dist/flows/Termination/TerminationFlow.d.ts +1 -1
  156. package/dist/flows/Termination/TerminationFlow.js +1 -1
  157. package/dist/flows/Termination/TerminationForm.d.ts +1 -1
  158. package/dist/flows/Termination/TerminationForm.js +1 -1
  159. package/dist/flows/Termination/TerminationSubmit.js +1 -1
  160. package/dist/flows/Termination/TimeOff.d.ts +1 -1
  161. package/dist/flows/Termination/TimeOff.js +1 -1
  162. package/dist/flows/Termination/context.d.ts +2 -2
  163. package/dist/flows/Termination/hooks.d.ts +1 -1
  164. package/dist/flows/Termination/hooks.js +1 -1
  165. package/dist/flows/Termination/index.d.ts +1 -1
  166. package/dist/flows/Termination/index.js +1 -1
  167. package/dist/flows/Termination/types.d.ts +1 -1
  168. package/dist/index.css +1 -1
  169. package/dist/index.css.map +1 -1
  170. package/dist/index.d.ts +5 -5
  171. package/dist/index.js +1 -1
  172. package/dist/index.js.map +1 -1
  173. package/dist/{remoteFlows-B-p1H61n.d.ts → remoteFlows-Zmw9pCN3.d.ts} +6 -0
  174. package/dist/{types.gen-DSJsKiNm.d.ts → types.gen-CmhEyFhy.d.ts} +50 -6
  175. package/package.json +1 -1
  176. package/dist/chunk-276MJCIE.js +0 -2
  177. package/dist/chunk-276MJCIE.js.map +0 -1
  178. package/dist/chunk-4JZ7V73S.js +0 -2
  179. package/dist/chunk-4JZ7V73S.js.map +0 -1
  180. package/dist/chunk-7KQT4QR4.js +0 -2
  181. package/dist/chunk-E3RHKRLZ.js +0 -2
  182. package/dist/chunk-E3RHKRLZ.js.map +0 -1
  183. package/dist/chunk-FBBUL6AE.js +0 -2
  184. package/dist/chunk-FBBUL6AE.js.map +0 -1
  185. package/dist/chunk-FL5V45BK.js +0 -2
  186. package/dist/chunk-FL5V45BK.js.map +0 -1
  187. package/dist/chunk-FUIAABQ6.js +0 -2
  188. package/dist/chunk-FUIAABQ6.js.map +0 -1
  189. package/dist/chunk-ILMVHOL2.js +0 -2
  190. package/dist/chunk-ILMVHOL2.js.map +0 -1
  191. package/dist/chunk-INS7FVGA.js +0 -2
  192. package/dist/chunk-INS7FVGA.js.map +0 -1
  193. package/dist/chunk-NJPNR4DK.js +0 -2
  194. package/dist/chunk-QM2ADK6C.js +0 -2
  195. package/dist/chunk-QM2ADK6C.js.map +0 -1
  196. package/dist/chunk-RPEWAKDI.js +0 -2
  197. package/dist/chunk-XJDGWTCQ.js +0 -2
  198. package/dist/chunk-XJDGWTCQ.js.map +0 -1
  199. /package/dist/{chunk-SXVOPWRB.js.map → chunk-2J6TOHV5.js.map} +0 -0
  200. /package/dist/{chunk-PCGJH2EO.js.map → chunk-2VGEHBMK.js.map} +0 -0
  201. /package/dist/{chunk-V5ENHJL2.js.map → chunk-3GCWEV4G.js.map} +0 -0
  202. /package/dist/{chunk-WT3QZR6I.js.map → chunk-3LGFQNYW.js.map} +0 -0
  203. /package/dist/{chunk-K7CLAEMU.js.map → chunk-4N3O2DPO.js.map} +0 -0
  204. /package/dist/{chunk-7DM7LDK3.js.map → chunk-5IREEZLM.js.map} +0 -0
  205. /package/dist/{chunk-VZB5LUZK.js.map → chunk-62R3GVFU.js.map} +0 -0
  206. /package/dist/{chunk-JTC54RNC.js.map → chunk-6P4XGSZ6.js.map} +0 -0
  207. /package/dist/{chunk-77WJVEKH.js.map → chunk-A27ASO7K.js.map} +0 -0
  208. /package/dist/{chunk-MCWVVCIK.js.map → chunk-AT2QKM6T.js.map} +0 -0
  209. /package/dist/{chunk-MC6FNME3.js.map → chunk-C3KZEPUZ.js.map} +0 -0
  210. /package/dist/{chunk-RUZWAFIN.js.map → chunk-CKNNZPHW.js.map} +0 -0
  211. /package/dist/{chunk-ZERPSH7S.js.map → chunk-CQ2QAZBG.js.map} +0 -0
  212. /package/dist/{chunk-ZVMBZK3H.js.map → chunk-G4NBJTHB.js.map} +0 -0
  213. /package/dist/{chunk-H32UX3PE.js.map → chunk-HDL43KVH.js.map} +0 -0
  214. /package/dist/{chunk-Y7P3FLOM.js.map → chunk-HI4QEV6Y.js.map} +0 -0
  215. /package/dist/{chunk-TIHZZ6IF.js.map → chunk-HQMY3X2R.js.map} +0 -0
  216. /package/dist/{chunk-CEFYPG7Z.js.map → chunk-IXVV7KPW.js.map} +0 -0
  217. /package/dist/{chunk-6ZNJ5WMX.js.map → chunk-IXZAHZ7B.js.map} +0 -0
  218. /package/dist/{chunk-K6GSGFOD.js.map → chunk-NXZRK6KL.js.map} +0 -0
  219. /package/dist/{chunk-J3ZV4EJ5.js.map → chunk-OGAVWGSY.js.map} +0 -0
  220. /package/dist/{chunk-2AOR4YZS.js.map → chunk-OMQXG7HR.js.map} +0 -0
  221. /package/dist/{chunk-SYEPIESJ.js.map → chunk-OTTIURMN.js.map} +0 -0
  222. /package/dist/{chunk-55OFDAIV.js.map → chunk-Q5ZUVH3U.js.map} +0 -0
  223. /package/dist/{chunk-4UKKNARJ.js.map → chunk-R6OW77R6.js.map} +0 -0
  224. /package/dist/{chunk-HCFC46A6.js.map → chunk-RCS2IOVS.js.map} +0 -0
  225. /package/dist/{chunk-HP4SYBET.js.map → chunk-S62STPBT.js.map} +0 -0
  226. /package/dist/{chunk-CAM6PYKR.js.map → chunk-SHFIZENN.js.map} +0 -0
  227. /package/dist/{chunk-SJVHKOCT.js.map → chunk-SMVJBWB5.js.map} +0 -0
  228. /package/dist/{chunk-3QLTEH2U.js.map → chunk-TKJPLMMP.js.map} +0 -0
  229. /package/dist/{chunk-VTNGEN34.js.map → chunk-UNTCBVHB.js.map} +0 -0
  230. /package/dist/{chunk-HNMDLN2I.js.map → chunk-WBFNVJSC.js.map} +0 -0
  231. /package/dist/{chunk-ONH3EBJZ.js.map → chunk-WDYXTDUA.js.map} +0 -0
  232. /package/dist/{chunk-7NN4M5P2.js.map → chunk-WFET4MKU.js.map} +0 -0
  233. /package/dist/{chunk-JQOEHEGL.js.map → chunk-WJA7PQ2J.js.map} +0 -0
  234. /package/dist/{chunk-LVACJZSJ.js.map → chunk-WOUZK5DW.js.map} +0 -0
  235. /package/dist/{chunk-5ZWCZYSA.js.map → chunk-YBRKMNHD.js.map} +0 -0
  236. /package/dist/{chunk-XZ5IR7N3.js.map → chunk-YEPXGH7I.js.map} +0 -0
  237. /package/dist/{chunk-NVAWIT33.js.map → chunk-YJRFIIPM.js.map} +0 -0
  238. /package/dist/{chunk-TQYHW6QK.js.map → chunk-YLO2MGPV.js.map} +0 -0
  239. /package/dist/{chunk-5HFXSPZZ.js.map → chunk-ZKPPNS6J.js.map} +0 -0
  240. /package/dist/{chunk-WRZ6WHH7.js.map → chunk-ZPUELAQZ.js.map} +0 -0
package/README.md CHANGED
@@ -74,13 +74,14 @@ The example app will be available at `http://localhost:3001`. The server handles
74
74
 
75
75
  The `RemoteFlows` component serves as a provider for authentication and theming.
76
76
 
77
- | Prop | Type | Required | Description |
78
- | ------------- | ----------------------------------------------------------- | -------- | --------------------------------------------------------- |
79
- | `auth` | `() => Promise<{ accessToken: string, expiresIn: number }>` | Yes | Function to fetch authentication token |
80
- | `environment` | `'partners' \| 'production' \| 'sandbox' \| 'staging'` | No | Environment to use for API calls (defaults to production) |
81
- | `theme` | `ThemeOptions` | No | Custom theme configuration |
82
- | `components` | `Components` | No | Custom field components for form rendering |
83
- | `proxy` | `{ url: string, headers?: Record<string, string> }` | No | Configuration for API request proxy with optional headers |
77
+ | Prop | Type | Required | Description |
78
+ | ------------- | ----------------------------------------------------------- | -------- | ------------------------------------------------------------------------------- |
79
+ | `auth` | `() => Promise<{ accessToken: string, expiresIn: number }>` | Yes | Function to fetch authentication token |
80
+ | `authId` | `'default' \| 'client' \|` | No | Id to differenciate between client token authentication and company based token |
81
+ | `environment` | `'partners' \| 'production' \| 'sandbox' \| 'staging'` | No | Environment to use for API calls (defaults to production) |
82
+ | `theme` | `ThemeOptions` | No | Custom theme configuration |
83
+ | `components` | `Components` | No | Custom field components for form rendering |
84
+ | `proxy` | `{ url: string, headers?: Record<string, string> }` | No | Configuration for API request proxy with optional headers |
84
85
 
85
86
  ### Custom Field Components
86
87
 
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-TIHZZ6IF.js";import{a as c}from"./chunk-HCFC46A6.js";import{a as e}from"./chunk-J3ZV4EJ5.js";import{a as m}from"./chunk-PCGJH2EO.js";import{a as r}from"./chunk-Y7P3FLOM.js";import{a as o}from"./chunk-TVZAFTPT.js";import{a as n}from"./chunk-P37U34EQ.js";import{useId as f}from"react";import{jsx as s}from"react/jsx-runtime";function k({employmentId:d,countryCode:C,options:p,render:A}){let t=c({employmentId:d,countryCode:C,options:p}),i=f();return s(o.Provider,{value:{formId:i,contractAmendmentBag:t},children:A({contractAmendmentBag:t,components:{Form:r,SubmitButton:a,ConfirmationForm:m,BackButton:e}})})}n(k,"ContractAmendmentFlow");export{k as a};
2
- //# sourceMappingURL=chunk-SXVOPWRB.js.map
1
+ import{a}from"./chunk-HQMY3X2R.js";import{a as c}from"./chunk-RCS2IOVS.js";import{a as e}from"./chunk-OGAVWGSY.js";import{a as m}from"./chunk-2VGEHBMK.js";import{a as r}from"./chunk-HI4QEV6Y.js";import{a as o}from"./chunk-TVZAFTPT.js";import{a as n}from"./chunk-P37U34EQ.js";import{useId as f}from"react";import{jsx as s}from"react/jsx-runtime";function k({employmentId:d,countryCode:C,options:p,render:A}){let t=c({employmentId:d,countryCode:C,options:p}),i=f();return s(o.Provider,{value:{formId:i,contractAmendmentBag:t},children:A({contractAmendmentBag:t,components:{Form:r,SubmitButton:a,ConfirmationForm:m,BackButton:e}})})}n(k,"ContractAmendmentFlow");export{k as a};
2
+ //# sourceMappingURL=chunk-2J6TOHV5.js.map
@@ -1,2 +1,2 @@
1
- import{f as m,g as a}from"./chunk-RPEWAKDI.js";import{c as n}from"./chunk-N6SBUVA6.js";import{b as i}from"./chunk-TVZAFTPT.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function w({onSubmit:d,onError:c,onSuccess:l}){let{contractAmendment:{stepState:u,isSubmitting:f,onSubmit:C,fields:p},formId:A}=i(),e=m({defaultValues:u.values?.form}),F=o(async r=>{let S=n(r,p,{isPartialValidation:!1});await d?.(S);let t=await C(r);t.error?c?.(t.error):await l?.(t.data)},"handleSubmit");return f?null:s(a,{...e,children:s("form",{id:A,onSubmit:e.handleSubmit(F),className:"RemoteFlows__ContractAmendmentConfirmationForm"})})}o(w,"ContractAmendmentConfirmationForm");export{w as a};
2
- //# sourceMappingURL=chunk-PCGJH2EO.js.map
1
+ import{f as m,g as a}from"./chunk-DPLXEXMO.js";import{c as n}from"./chunk-N6SBUVA6.js";import{b as i}from"./chunk-TVZAFTPT.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function w({onSubmit:d,onError:c,onSuccess:l}){let{contractAmendment:{stepState:u,isSubmitting:f,onSubmit:C,fields:p},formId:A}=i(),e=m({defaultValues:u.values?.form}),F=o(async r=>{let S=n(r,p,{isPartialValidation:!1});await d?.(S);let t=await C(r);t.error?c?.(t.error):await l?.(t.data)},"handleSubmit");return f?null:s(a,{...e,children:s("form",{id:A,onSubmit:e.handleSubmit(F),className:"RemoteFlows__ContractAmendmentConfirmationForm"})})}o(w,"ContractAmendmentConfirmationForm");export{w as a};
2
+ //# sourceMappingURL=chunk-2VGEHBMK.js.map
@@ -1,2 +1,2 @@
1
- import{a as P}from"./chunk-WWANHPT7.js";import{a as h}from"./chunk-2Y22JKVE.js";import{a as S}from"./chunk-XFD3ULUF.js";import{a as F}from"./chunk-S4XU4SE7.js";import{a as y}from"./chunk-Z5WMKCRJ.js";import{a as V}from"./chunk-QW4JPW6J.js";import{b as p}from"./chunk-276MJCIE.js";import{a as T}from"./chunk-PJBAQZ6G.js";import{d as _}from"./chunk-3ZWDIEEM.js";import{c as s}from"./chunk-N6SBUVA6.js";import{a as e}from"./chunk-P37U34EQ.js";import{createHeadlessForm as g,modify as x}from"@remoteoss/json-schema-form";import{useMutation as A,useQuery as K}from"@tanstack/react-query";import L from"lodash.omitby";import q from"lodash.isnull";import z from"lodash.omit";function R(o){return{confidential:"",customer_informed_employee:"",customer_informed_employee_date:"",customer_informed_employee_description:"",personal_email:"",termination_reason:void 0,reason_description:"",termination_reason_files:[],will_challenge_termination:"",will_challenge_termination_description:null,agrees_to_pto_amount:"",agrees_to_pto_amount_notes:null,acknowledge_termination_procedure:!1,additional_comments:"",proposed_termination_date:"",risk_assessment_reasons:[],timesheet_file:void 0,...o}}e(R,"buildInitialValues");var B=e(()=>{let{client:o}=_();return A({mutationFn:e(n=>p({client:o,headers:{Authorization:""},body:n}),"mutationFn")})},"useCreateTermination"),I=e(({formValues:o,jsfModify:n,step:m})=>K({queryKey:["rmt-flows-termination-schema",m],queryFn:e(()=>h[m]??S,"queryFn"),select:e(({data:u})=>{let i=u?.schema||{};if(n){let{schema:d}=x(i,n);i=d}return g(i||{},{initialValues:o||{}})},"select")}),"useTerminationSchema"),ue=e(({employmentId:o,options:n})=>{let{fieldValues:m,setFieldValues:u,stepState:i,previousStep:f,nextStep:d}=T(F),k={...i.values?.[i.currentStep.name],...m},{data:r,isLoading:w}=I({formValues:k,jsfModify:n?.jsfModify,step:i.currentStep.name}),l=g(P.data.schema),c=B(),{mutateAsync:b}=V(c);async function C(a){if(!o)throw new Error("Employment id is missing");if(r){let t=s(a,l.fields,{isPartialValidation:!0}),{customer_informed_employee:j}=t,D=j==="yes"?{employee_awareness:{date:t.customer_informed_employee_date,note:t.customer_informed_employee_description}}:void 0,H=y(t,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),J=z(H,"customer_informed_employee_date","customer_informed_employee_description"),O=L({...J,...D},q);return b({employment_id:o,termination_details:O,type:"termination"})}}e(C,"onSubmit");function M(){f()}e(M,"back");function v(){d()}e(v,"next");let E=R({...i.values?.employee_communication,...i.values?.termination_details,...i.values?.paid_time_off,...i.values?.additional_information});return{employmentId:o,stepState:i,fields:r?.fields||[],isLoading:w,isSubmitting:c.isPending,initialValues:E,handleValidation:e(a=>{if(r){let t=s(a,r?.fields);return r?.handleValidation(t)}return null},"handleValidation"),checkFieldUpdates:e(a=>{if(l){let t=s(a,l?.fields,{isPartialValidation:!0});u(t)}},"checkFieldUpdates"),parseFormValues:e(a=>s(a,l.fields,{isPartialValidation:!0}),"parseFormValues"),onSubmit:C,back:M,next:v}},"useTermination");export{ue as a};
2
- //# sourceMappingURL=chunk-V5ENHJL2.js.map
1
+ import{a as P}from"./chunk-WWANHPT7.js";import{a as h}from"./chunk-2Y22JKVE.js";import{a as S}from"./chunk-XFD3ULUF.js";import{a as F}from"./chunk-S4XU4SE7.js";import{a as y}from"./chunk-Z5WMKCRJ.js";import{a as V}from"./chunk-QW4JPW6J.js";import{b as p}from"./chunk-FQNVKX3N.js";import{a as T}from"./chunk-PJBAQZ6G.js";import{d as _}from"./chunk-3ZWDIEEM.js";import{c as s}from"./chunk-N6SBUVA6.js";import{a as e}from"./chunk-P37U34EQ.js";import{createHeadlessForm as g,modify as x}from"@remoteoss/json-schema-form";import{useMutation as A,useQuery as K}from"@tanstack/react-query";import L from"lodash.omitby";import q from"lodash.isnull";import z from"lodash.omit";function R(o){return{confidential:"",customer_informed_employee:"",customer_informed_employee_date:"",customer_informed_employee_description:"",personal_email:"",termination_reason:void 0,reason_description:"",termination_reason_files:[],will_challenge_termination:"",will_challenge_termination_description:null,agrees_to_pto_amount:"",agrees_to_pto_amount_notes:null,acknowledge_termination_procedure:!1,additional_comments:"",proposed_termination_date:"",risk_assessment_reasons:[],timesheet_file:void 0,...o}}e(R,"buildInitialValues");var B=e(()=>{let{client:o}=_();return A({mutationFn:e(n=>p({client:o,headers:{Authorization:""},body:n}),"mutationFn")})},"useCreateTermination"),I=e(({formValues:o,jsfModify:n,step:m})=>K({queryKey:["rmt-flows-termination-schema",m],queryFn:e(()=>h[m]??S,"queryFn"),select:e(({data:u})=>{let i=u?.schema||{};if(n){let{schema:d}=x(i,n);i=d}return g(i||{},{initialValues:o||{}})},"select")}),"useTerminationSchema"),ue=e(({employmentId:o,options:n})=>{let{fieldValues:m,setFieldValues:u,stepState:i,previousStep:f,nextStep:d}=T(F),k={...i.values?.[i.currentStep.name],...m},{data:r,isLoading:w}=I({formValues:k,jsfModify:n?.jsfModify,step:i.currentStep.name}),l=g(P.data.schema),c=B(),{mutateAsync:b}=V(c);async function C(a){if(!o)throw new Error("Employment id is missing");if(r){let t=s(a,l.fields,{isPartialValidation:!0}),{customer_informed_employee:j}=t,D=j==="yes"?{employee_awareness:{date:t.customer_informed_employee_date,note:t.customer_informed_employee_description}}:void 0,H=y(t,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),J=z(H,"customer_informed_employee_date","customer_informed_employee_description"),O=L({...J,...D},q);return b({employment_id:o,termination_details:O,type:"termination"})}}e(C,"onSubmit");function M(){f()}e(M,"back");function v(){d()}e(v,"next");let E=R({...i.values?.employee_communication,...i.values?.termination_details,...i.values?.paid_time_off,...i.values?.additional_information});return{employmentId:o,stepState:i,fields:r?.fields||[],isLoading:w,isSubmitting:c.isPending,initialValues:E,handleValidation:e(a=>{if(r){let t=s(a,r?.fields);return r?.handleValidation(t)}return null},"handleValidation"),checkFieldUpdates:e(a=>{if(l){let t=s(a,l?.fields,{isPartialValidation:!0});u(t)}},"checkFieldUpdates"),parseFormValues:e(a=>s(a,l.fields,{isPartialValidation:!0}),"parseFormValues"),onSubmit:C,back:M,next:v}},"useTermination");export{ue as a};
2
+ //# sourceMappingURL=chunk-3GCWEV4G.js.map
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-PGWKJ6FK.js";import{b as u}from"./chunk-CAM6PYKR.js";import{b as i}from"./chunk-3ZWDIEEM.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as m}from"react/jsx-runtime";function f({children:o,onClick:a,...n}){let{onboardingBag:{back:c,isEmploymentReadOnly:B}}=s(),{components:d}=i(),r=t(p=>{B||c(),a?.(p)},"onBackHandler"),e=d?.button;return e?m(e,{...n,onClick:r,children:o}):m(u,{...n,onClick:r,children:o})}t(f,"OnboardingBack");export{f as a};
2
- //# sourceMappingURL=chunk-WT3QZR6I.js.map
1
+ import{b as s}from"./chunk-PGWKJ6FK.js";import{b as u}from"./chunk-SHFIZENN.js";import{b as i}from"./chunk-3ZWDIEEM.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as m}from"react/jsx-runtime";function f({children:o,onClick:a,...n}){let{onboardingBag:{back:c,isEmploymentReadOnly:B}}=s(),{components:d}=i(),r=t(p=>{B||c(),a?.(p)},"onBackHandler"),e=d?.button;return e?m(e,{...n,onClick:r,children:o}):m(u,{...n,onClick:r,children:o})}t(f,"OnboardingBack");export{f as a};
2
+ //# sourceMappingURL=chunk-3LGFQNYW.js.map
@@ -0,0 +1,2 @@
1
+ import{a as m,b as d,c as p}from"./chunk-SRZGBJVA.js";import{a as l}from"./chunk-G4NBJTHB.js";import{b as i}from"./chunk-SHFIZENN.js";import{b as r}from"./chunk-HGLI6PUM.js";import{a as o}from"./chunk-P37U34EQ.js";import{Info as v}from"lucide-react";import{Fragment as c,jsx as e,jsxs as t}from"react/jsx-runtime";function w({contributionsTotal:u,currency:a,contributionsBreakdown:n}){let f=d();return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[e("h3",{className:"font-medium text-primary-foreground",children:"Employer Contributions"}),e("span",{className:"font-semibold text-lg",children:r(u,a)})]}),n?t(c,{children:[e(l,{className:"mb-3"}),e("div",{className:"space-y-3 pl-2",children:n.map((s,g)=>t("div",{className:"flex justify-between items-start text-sm",children:[t("div",{className:"flex items-start gap-2",children:[e("span",{children:s.name}),s.description&&e(m,{content:t(c,{children:[e("span",{children:s.description}),s.zendesk_article_url&&e(p,{zendeskId:s.zendesk_article_id,zendeskURL:s.zendesk_article_url,Trigger:e("button",{onClick:()=>{let k=s.zendesk_article_id;f.setSearchParams({articleId:k||""})},className:"text-blue-500 hover:underline block mt-1 text-xs bg-transparent border-none cursor-pointer p-0",children:"Learn more"})})]}),children:t(i,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[e(v,{className:"h-3 w-3 text-gray-400"}),e("span",{className:"sr-only",children:"Info"})]})})]}),e("span",{children:r(s.amount,a)})]},g))})]}):null]})}o(w,"CostCalculatorContributionsBreakdown");export{w as a};
2
+ //# sourceMappingURL=chunk-466M4PK7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.tsx"],"sourcesContent":["import { Info } from 'lucide-react';\n\nimport { BasicTooltip } from '@/src/components/ui/basic-tooltip';\n\nimport { Button } from '@/src/components/ui/button';\nimport { Separator } from '@/src/components/ui/separator';\nimport { formatCurrency } from '@/src/lib/utils';\nimport { ZendeskDrawer } from '@/src/components/shared/zendesk-drawer/ZendeskDrawer';\nimport { useRouter } from '@/src/lib/router';\n\ntype CostCalculatorContributionsBreakdownProps = {\n contributionsTotal: number;\n currency: string;\n contributionsBreakdown:\n | {\n name: string;\n description: string | null;\n amount: number;\n zendesk_article_url: string | null;\n zendesk_article_id: string | null;\n }[]\n | undefined;\n};\n\nexport function CostCalculatorContributionsBreakdown({\n contributionsTotal,\n currency,\n contributionsBreakdown,\n}: CostCalculatorContributionsBreakdownProps) {\n const router = useRouter();\n return (\n <div>\n <div className=\"flex justify-between items-center mb-2\">\n <h3 className=\"font-medium text-primary-foreground\">\n Employer Contributions\n </h3>\n <span className=\"font-semibold text-lg\">\n {formatCurrency(contributionsTotal, currency)}\n </span>\n </div>\n {contributionsBreakdown ? (\n <>\n <Separator className=\"mb-3\" />\n <div className=\"space-y-3 pl-2\">\n {contributionsBreakdown.map((contribution, index) => (\n <div\n key={index}\n className=\"flex justify-between items-start text-sm\"\n >\n <div className=\"flex items-start gap-2\">\n <span>{contribution.name}</span>\n {contribution.description && (\n <BasicTooltip\n content={\n <>\n <span>{contribution.description}</span>\n {contribution.zendesk_article_url && (\n <ZendeskDrawer\n zendeskId={\n contribution.zendesk_article_id as string\n }\n zendeskURL={\n contribution.zendesk_article_url as string\n }\n Trigger={\n <button\n onClick={() => {\n const articleId =\n contribution.zendesk_article_id;\n\n router.setSearchParams({\n articleId: articleId || '',\n });\n }}\n className=\"text-blue-500 hover:underline block mt-1 text-xs bg-transparent border-none cursor-pointer p-0\"\n >\n Learn more\n </button>\n }\n />\n )}\n </>\n }\n >\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-4 w-4 p-0\"\n >\n <Info className=\"h-3 w-3 text-gray-400\" />\n <span className=\"sr-only\">Info</span>\n </Button>\n </BasicTooltip>\n )}\n </div>\n <span>{formatCurrency(contribution.amount, currency)}</span>\n </div>\n ))}\n </div>\n </>\n ) : null}\n </div>\n );\n}\n"],"mappings":"sNAAA,OAAS,QAAAA,MAAY,eAgCf,OAsBkB,YAAAC,EArBhB,OAAAC,EADF,QAAAC,MAAA,oBARC,SAASC,EAAqC,CACnD,mBAAAC,EACA,SAAAC,EACA,uBAAAC,CACF,EAA8C,CAC5C,IAAMC,EAASC,EAAU,EACzB,OACEN,EAAC,OACC,UAAAA,EAAC,OAAI,UAAU,yCACb,UAAAD,EAAC,MAAG,UAAU,sCAAsC,kCAEpD,EACAA,EAAC,QAAK,UAAU,wBACb,SAAAQ,EAAeL,EAAoBC,CAAQ,EAC9C,GACF,EACCC,EACCJ,EAAAF,EAAA,CACE,UAAAC,EAACS,EAAA,CAAU,UAAU,OAAO,EAC5BT,EAAC,OAAI,UAAU,iBACZ,SAAAK,EAAuB,IAAI,CAACK,EAAcC,IACzCV,EAAC,OAEC,UAAU,2CAEV,UAAAA,EAAC,OAAI,UAAU,yBACb,UAAAD,EAAC,QAAM,SAAAU,EAAa,KAAK,EACxBA,EAAa,aACZV,EAACY,EAAA,CACC,QACEX,EAAAF,EAAA,CACE,UAAAC,EAAC,QAAM,SAAAU,EAAa,YAAY,EAC/BA,EAAa,qBACZV,EAACa,EAAA,CACC,UACEH,EAAa,mBAEf,WACEA,EAAa,oBAEf,QACEV,EAAC,UACC,QAAS,IAAM,CACb,IAAMc,EACJJ,EAAa,mBAEfJ,EAAO,gBAAgB,CACrB,UAAWQ,GAAa,EAC1B,CAAC,CACH,EACA,UAAU,iGACX,sBAED,EAEJ,GAEJ,EAGF,SAAAb,EAACc,EAAA,CACC,QAAQ,QACR,KAAK,OACL,UAAU,cAEV,UAAAf,EAACgB,EAAA,CAAK,UAAU,wBAAwB,EACxChB,EAAC,QAAK,UAAU,UAAU,gBAAI,GAChC,EACF,GAEJ,EACAA,EAAC,QAAM,SAAAQ,EAAeE,EAAa,OAAQN,CAAQ,EAAE,IAjDhDO,CAkDP,CACD,EACH,GACF,EACE,MACN,CAEJ,CA/EgBM,EAAAf,EAAA","names":["Info","Fragment","jsx","jsxs","CostCalculatorContributionsBreakdown","contributionsTotal","currency","contributionsBreakdown","router","useRouter","formatCurrency","Separator","contribution","index","BasicTooltip","ZendeskDrawer","articleId","Button","Info","__name"]}
@@ -0,0 +1,2 @@
1
+ import{a as Ye}from"./chunk-A27ASO7K.js";import{a as V}from"./chunk-IXZAHZ7B.js";import{a as be,b as O}from"./chunk-SHFIZENN.js";import{b as S}from"./chunk-3ZWDIEEM.js";import{a as ne,b as ie,c as _,d as Je,e as qe,f as je,g as Ke,h as P,i as R,j as N,k as w,l as D,m as I}from"./chunk-DPLXEXMO.js";import{e as Ge,g as Ue}from"./chunk-N6SBUVA6.js";import{a as u,e as se}from"./chunk-HGLI6PUM.js";import{a as o}from"./chunk-P37U34EQ.js";import{Fragment as Ko}from"react";import*as Xe from"react";import*as re from"@radix-ui/react-checkbox";import{Check as jt}from"lucide-react";import{jsx as Se}from"react/jsx-runtime";var le=Xe.forwardRef(({className:e,...t},r)=>Se(re.Root,{ref:r,className:u("peer h-4 w-4 shrink-0 rounded-sm border border-input ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-checkbox data-[state=checked]:text-primary",e),...t,children:Se(re.Indicator,{className:u("flex items-center justify-center text-current"),children:Se(jt,{className:"h-4 w-4"})})}));le.displayName=re.Root.displayName;import{Fragment as Kt,jsx as A,jsxs as me}from"react/jsx-runtime";function ce({name:e,defaultValue:t,description:r,label:a,onChange:s,multiple:n,options:p,component:g,...F}){let{components:c}=S(),{control:i}=_(),f=o((d,m,v)=>{let l=v.value?[...v.value]:[];m?l.includes(d)||v.onChange([...l,d]):v.onChange(l.filter(y=>y!==d))},"handleCheckboxChange");return A(P,{control:i,name:e,defaultValue:t,render:({field:d,fieldState:m})=>{let v=g||c?.checkbox;if(v){let l={name:e,description:r,label:a,defaultValue:t,multiple:n,options:p,...F};return A(v,{field:{...d,onChange:o(y=>{if(n){let{checked:C,value:b}=y.target;f(b,C,d),s?.(C);return}d.onChange(y),s?.(y)},"onChange")},fieldState:m,fieldData:l})}return me(R,{"data-field":e,className:u(`RemoteFlows__CheckBoxField__Item__${e}`),children:[A(w,{children:me(Kt,{children:[p&&n?A(N,{children:a}):null,p&&n?p.map(l=>me("div",{className:"flex space-x-2",children:[A(le,{id:l.value,onCheckedChange:y=>{f(l.value,y===!0,d),s?.(y,l.value)},checked:d.value?.includes(l.value),className:"RemoteFlows__CheckBox__Input"}),A(N,{htmlFor:l.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:l.label})]},l.value)):me("div",{className:"flex space-x-2",children:[A(le,{id:e,onCheckedChange:l=>{d.onChange(l),s?.(l)},checked:d.value,className:"RemoteFlows__CheckBox__Input"}),A(N,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label",children:a})]})]})}),r&&A(D,{children:r}),m.error&&A(I,{})]})}})}o(ce,"CheckBoxField");import{CalendarIcon as Zt}from"lucide-react";import{PopoverClose as eo}from"@radix-ui/react-popover";import{ChevronLeft as Yt,ChevronRight as Xt}from"lucide-react";import{DayPicker as Qt}from"react-day-picker";import{jsx as Pe}from"react/jsx-runtime";function Qe({className:e,classNames:t,showOutsideDays:r=!0,...a}){return Pe(Qt,{showOutsideDays:r,className:u("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:u(be({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:u("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",a.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:u(be({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:o(({className:s,...n})=>Pe(Yt,{className:u("size-4",s),...n}),"IconLeft"),IconRight:o(({className:s,...n})=>Pe(Xt,{className:u("size-4",s),...n}),"IconRight")},...a})}o(Qe,"Calendar");import*as z from"@radix-ui/react-popover";import{jsx as de}from"react/jsx-runtime";function pe({...e}){return de(z.Root,{"data-slot":"popover",...e})}o(pe,"Popover");function ue({...e}){return de(z.Trigger,{"data-slot":"popover-trigger",...e})}o(ue,"PopoverTrigger");function fe({className:e,align:t="center",sideOffset:r=4,...a}){return de(z.Portal,{children:de(z.Content,{"data-slot":"popover-content",align:t,sideOffset:r,className:u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...a})})}o(fe,"PopoverContent");import{format as Ze}from"date-fns";import{Fragment as to,jsx as W,jsxs as Ne}from"react/jsx-runtime";function et({description:e,label:t,name:r,minDate:a,onChange:s,component:n,...p}){let{components:g}=S(),{control:F}=_(),c;return p.meta?.mot&&typeof p.meta.mot=="number"?c=Ue(p.meta.mot):a&&(c=new Date(a)),W(P,{control:F,name:r,render:({field:i,fieldState:f})=>{let d=n||g?.date;if(d){let m={description:e,label:t,name:r,onChange:s,...c&&{minDate:c.toISOString()},...p};return W(d,{field:{...i,onChange:o(v=>{i.onChange(v),s?.(v)},"onChange")},fieldState:f,fieldData:m})}return Ne(R,{"data-field":r,className:`flex flex-col RemoteFlows__DatePickerField__Item__${r}`,children:[W(N,{className:"RemoteFlows__DatePickerField__Label",children:t}),Ne(pe,{children:[W(ue,{asChild:!0,children:W(w,{children:W("div",{children:Ne(O,{type:"button",variant:"outline",className:u("w-full pl-3 text-left font-normal",!i.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${r}`,children:[i.value&&W(to,{children:Ze(i.value,"yyyy-MM-dd")}),W(Zt,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),W(fe,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:W(Qe,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:i.value?new Date(i.value):void 0,onSelect:m=>{i.onChange(m?Ze(m,"yyyy-MM-dd"):null),s?.(m)},defaultMonth:c,components:{DayContent:o(m=>W(eo,{children:m.date.getDate()}),"DayContent")},...c&&{disabled:o(m=>m<c,"disabled")}})})]}),e?W(D,{children:e}):null,f.error&&W(I,{className:"RemoteFlows__DatePickerField__Error"})]})}})}o(et,"DatePickerField");import{cva as oo}from"class-variance-authority";import{jsx as ke}from"react/jsx-runtime";var ro=oo("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-card bg-warning border-warning-border [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function tt({className:e,variant:t,...r}){return ke("div",{"data-slot":"alert",role:"alert",className:u(ro({variant:t}),e),...r})}o(tt,"Alert");function ot({className:e,...t}){return ke("div",{"data-slot":"alert-title",className:u("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}o(ot,"AlertTitle");function rt({className:e,...t}){return ke("div",{"data-slot":"alert-description",className:u("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}o(rt,"AlertDescription");import{AlertCircle as ao}from"lucide-react";import{jsx as ge,jsxs as no}from"react/jsx-runtime";function Fe({title:e,description:t,severity:r}){let{components:a}=S();if(a?.statement){let s=a?.statement;return ge(s,{data:{title:e,description:t,severity:r}})}return no(tt,{variant:"warning",children:[ge(ao,{className:"h-4 w-4"}),e&&ge(ot,{children:e}),ge(rt,{children:t})]})}o(Fe,"Statement");import{Fragment as io,useEffect as so,useRef as at}from"react";import{jsx as ae,jsxs as Re}from"react/jsx-runtime";function we({label:e,name:t,fields:r,description:a,components:s,statement:n,isFlatFieldset:p,extra:g}){let{watch:F,trigger:c,formState:i}=_(),f=r.map(({name:l})=>`${t}.${l}`),d=F(f),m=at(d),v=at(null);return so(()=>{let l=d,y=m.current,C=i.isSubmitted||i.submitCount>0,b=!1;for(let k=0;k<l.length;k++)if(l[k]!==void 0&&y[k]!==l[k]){b=!0;break}return b&&C&&(v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{c()},50)),m.current=[...l],()=>{v.current&&clearTimeout(v.current)}},[d,c,i.isSubmitted,i.submitCount]),Re("fieldset",{className:u("border-1 border-input p-4 rounded-xl",`RemoteFlows__FieldSetField__${t}`),children:[ae("legend",{className:"text-sm font-semibold px-2",children:e}),a?ae("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:a}}):null,Re("div",{className:"grid gap-4",children:[r.map(l=>{l.calculateDynamicProperties&&(l={...l,...l.calculateDynamicProperties(d,l)||{}});let y=X[l.type];if(l.isVisible===!1||l.deprecated)return null;if(l.Component){let{Component:C}=l;return ae(C,{...l},l.name)}return l.type==="select"&&l.multiple&&(y=X["multi-select"]),Re(io,{children:[ae(y,{...l,name:`${p?l.name:`${t}.${l.name}`}`,component:s?.[l.type]}),l.extra?l.extra:null]},`${p?l.name:`${t}.${l.name}`}`)}),g||null,n?ae(Fe,{...n}):null]})]})}o(we,"FieldSetField");import{useState as lo,useRef as mo}from"react";import{Upload as co,X as po}from"lucide-react";import{jsx as U,jsxs as De}from"react/jsx-runtime";function nt({onChange:e,className:t,multiple:r}){let[a,s]=lo([]),n=mo(null),p=o(c=>{c.preventDefault(),n.current?.click()},"handleClick"),g=o(c=>{if(c.target.files&&c.target.files.length>0){let i=Array.from(c.target.files);s(i),e(c)}},"handleChange"),F=o(c=>{s(i=>i.filter(f=>f!==c))},"onRemoveFile");return De("div",{className:u("flex flex-col items-start gap-4",t),children:[U("input",{type:"file",ref:n,onChange:g,className:"hidden","aria-label":"File upload",multiple:r}),De(O,{type:"button",onClick:p,className:"gap-2",children:[U(co,{className:"h-4 w-4"}),"Choose File"]}),a.length===0&&U("div",{className:"text-sm",children:r?U("span",{className:"font-medium",children:"No files selected. You can select multiple files"}):U("span",{className:"font-medium",children:"No file selected."})}),a.length>0&&a.map((c,i)=>De("div",{className:"text-sm flex items-center gap-2",children:["Selected file: ",U("span",{className:"font-medium",children:c.name})," (",Math.round(c.size/1024)," KB)",U(O,{variant:"ghost",onClick:()=>F(c),children:U(po,{})})]},i))]})}o(nt,"FileUploader");import{jsx as J,jsxs as fo}from"react/jsx-runtime";var uo=o(e=>new Promise((t,r)=>{let a=new FileReader;a.readAsDataURL(e),a.onload=()=>t(a.result),a.onerror=s=>r(s)}),"toBase64"),it=o(async e=>{let t=e.target.files?Array.from(e.target.files):[];return await Promise.all(t.map(async a=>{let s=await uo(a);return{name:a.name,content:s.split(",")[1]}}))},"convertFilesToBase64");function st({name:e,description:t,label:r,multiple:a,onChange:s,component:n,...p}){let{components:g}=S(),{control:F}=_();return J(P,{control:F,name:e,render:({field:c,fieldState:i})=>{let f=n||g?.file;if(f){let d={name:e,description:t,label:r,multiple:a,...p};return J(f,{field:{...c,value:null,onChange:o(async m=>{let v=await it(m);c.onChange(v),s?.(v)},"onChange")},fieldState:i,fieldData:d})}return fo(R,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`,children:[J(N,{className:"RemoteFlows__FileUpload__Label",children:r}),J(w,{children:J(nt,{onChange:async d=>{let m=await it(d);c.onChange(m),s?.(m)},multiple:a,className:u("RemoteFlows__FileUpload__Input")})}),t&&J("div",{className:"flex items-center justify-between",children:J(D,{className:"RemoteFlows__FileUpload__Description",children:t})}),i.error&&J(I,{className:"RemoteFlows__FileUpload__Error"})]})}})}o(st,"FileUploadField");import{jsx as Te}from"react/jsx-runtime";function ve(e){let{components:t}=S(),{control:r}=_(),a=e.component||t?.number;return a?Te(P,{control:r,name:e.name,render:({field:s,fieldState:n})=>Te(a,{field:{...s,onChange:o(p=>{s.onChange(p),e.onChange?.(p)},"onChange")},fieldState:n,fieldData:e})}):Te(V,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}o(ve,"NumberField");import{Fragment as Fo}from"react";import*as Q from"@radix-ui/react-radio-group";import{CircleIcon as go}from"lucide-react";import{jsx as ye}from"react/jsx-runtime";function lt({className:e,...t}){return ye(Q.Root,{"data-slot":"radio-group",className:u("grid gap-3",e),...t})}o(lt,"RadioGroup");function mt({className:e,...t}){return ye(Q.Item,{"data-slot":"radio-group-item",className:u("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:ye(Q.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:ye(go,{className:"fill-radio absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}o(mt,"RadioGroupItem");import{jsx as E,jsxs as Ie}from"react/jsx-runtime";function ct({name:e,defaultValue:t,description:r,label:a,options:s,onChange:n,component:p,...g}){let{components:F}=S(),{control:c}=_();return E(P,{control:c,name:e,defaultValue:t,render:({field:i,fieldState:f})=>{let d=p||F?.radio;if(d){let m={name:e,defaultValue:t,description:r,label:a,options:s,...g};return E(d,{field:{...i,onChange:o(v=>{i.onChange(v),n?.(v)},"onChange")},fieldState:f,fieldData:m})}return Ie(R,{className:u("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),"data-field":e,children:[E(N,{children:a}),E(w,{children:E(lt,{"aria-label":a||e,onValueChange:m=>{i.onChange(m),n?.(m)},value:i.value,className:"flex flex-col space-y-3",children:s?.map(m=>E(Fo,{children:Ie(R,{"data-field":e,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[E(w,{children:E(mt,{value:m.value,className:"RemoteFlows__RadioField__Input",disabled:m.disabled})}),Ie("div",{children:[E(N,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:m.label}),m.description&&E(D,{className:"mt-2",children:m.description})]})]})},m.value))})}),r&&E(D,{children:r}),f.error&&E(I,{})]})}})}o(ct,"RadioGroupField");import*as x from"@radix-ui/react-select";import{CheckIcon as vo,ChevronDownIcon as dt,ChevronUpIcon as yo}from"lucide-react";import{jsx as T,jsxs as Me}from"react/jsx-runtime";function pt({...e}){return T(x.Root,{"data-slot":"select",...e})}o(pt,"Select");function ut({...e}){return T(x.Group,{"data-slot":"select-group",...e})}o(ut,"SelectGroup");function ft({...e}){return T(x.Value,{"data-slot":"select-value",...e})}o(ft,"SelectValue");function gt({className:e,children:t,...r}){return Me(x.Trigger,{"data-slot":"select-trigger",className:u("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex w-full items-center justify-between rounded-xl border bg-transparent px-4 py-7 text-sm whitespace-nowrap transition-[color] outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","focus-visible:border-focused",e),...r,children:[t,T(x.Icon,{asChild:!0,className:"absolute right-4",children:T(dt,{className:"size-4"})})]})}o(gt,"SelectTrigger");function Ft({className:e,children:t,position:r="popper",...a}){return T(x.Portal,{children:Me(x.Content,{"data-slot":"select-content",className:u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-xl border",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...a,children:[T(ho,{}),T(x.Viewport,{className:u(r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),T(_o,{})]})})}o(Ft,"SelectContent");function vt({className:e,children:t,...r}){return Me(x.Item,{"data-slot":"select-item",className:u("focus:bg-accent focus:text-accent-foreground min-h-11 justify-between [&_svg:not([class*='text-'])]:text-muted-foreground flex w-full cursor-default items-center gap-2 py-2 px-4 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[T(x.ItemText,{children:t}),T("span",{className:"flex size-3.5 items-center justify-center",children:T(x.ItemIndicator,{children:T(vo,{className:"size-4"})})})]})}o(vt,"SelectItem");function ho({className:e,...t}){return T(x.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:u("flex cursor-default items-center justify-center py-1",e),...t,children:T(yo,{className:"size-4"})})}o(ho,"SelectScrollUpButton");function _o({className:e,...t}){return T(x.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:u("flex cursor-default items-center justify-center py-1",e),...t,children:T(dt,{className:"size-4"})})}o(_o,"SelectScrollDownButton");import{jsx as L,jsxs as yt}from"react/jsx-runtime";function ht({label:e,name:t,options:r,defaultValue:a,description:s,onChange:n,component:p,...g}){let{control:F}=_(),{components:c}=S();return L(P,{defaultValue:a,control:F,name:t,render:({field:i,fieldState:f})=>{let d=p||c?.select;if(d){let m={label:e,name:t,options:r,defaultValue:a,description:s,onChange:n,...g};return L(d,{field:{...i,onChange:o(v=>{let l=g.jsonType==="number"?Number(v):v;i.onChange(l),n?.(l)},"onChange")},fieldState:f,fieldData:m})}return yt(R,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[L(N,{className:"RemoteFlows__SelectField__Label",children:e}),L(w,{children:L("div",{className:"relative",children:yt(pt,{value:i.value||"",onValueChange:m=>{let v=g.jsonType==="number"?Number(m):m;i.onChange(v),n?.(v)},children:[L(gt,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!f.error,"aria-label":e,children:L("span",{className:"absolute",children:L(ft,{placeholder:e})})}),L(Ft,{className:"RemoteFlows__SelectField__Content",children:L(ut,{className:"RemoteFlows__SelectField__Group",children:r.map(m=>L(vt,{value:m.value,className:"RemoteFlows__SelectField__SelectItem",children:m.label},m.value))})})]})})}),s&&L(D,{children:s}),f.error&&L(I,{})]})}})}o(ht,"SelectField");import{useState as wo}from"react";import{Fragment as So,useState as Po}from"react";import{Check as No,ChevronDownIcon as ko,X as Ro}from"lucide-react";import{Command as Z}from"cmdk";import{SearchIcon as ln}from"lucide-react";import*as M from"@radix-ui/react-dialog";import{XIcon as xo}from"lucide-react";import{jsx as G,jsxs as $e}from"react/jsx-runtime";function We({...e}){return G(M.Root,{"data-slot":"dialog",...e})}o(We,"Dialog");function _t({...e}){return G(M.Trigger,{"data-slot":"dialog-trigger",...e})}o(_t,"DialogTrigger");function Co({...e}){return G(M.Portal,{"data-slot":"dialog-portal",...e})}o(Co,"DialogPortal");function bo({className:e,...t}){return G(M.Overlay,{"data-slot":"dialog-overlay",className:u("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}o(bo,"DialogOverlay");function Le({className:e,children:t,...r}){return $e(Co,{"data-slot":"dialog-portal",children:[G(bo,{}),$e(M.Content,{"data-slot":"dialog-content",className:u("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,$e(M.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 RemoteFlows__Dialog__Close",children:[G(xo,{}),G("span",{className:"sr-only",children:"Close"})]})]})]})}o(Le,"DialogContent");function Ee({className:e,...t}){return G("div",{"data-slot":"dialog-header",className:u("flex flex-col gap-2 text-center sm:text-left",e),...t})}o(Ee,"DialogHeader");function He({className:e,...t}){return G(M.Title,{"data-slot":"dialog-title",className:u("text-lg leading-none font-semibold",e),...t})}o(He,"DialogTitle");import{jsx as ee,jsxs as pn}from"react/jsx-runtime";function xt({className:e,...t}){return ee(Z,{"data-slot":"command",className:u("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}o(xt,"Command");function Ct({className:e,...t}){return ee(Z.List,{"data-slot":"command-list",className:u("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}o(Ct,"CommandList");function bt({...e}){return ee(Z.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}o(bt,"CommandEmpty");function St({className:e,...t}){return ee(Z.Group,{"data-slot":"command-group",className:u("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}o(St,"CommandGroup");function Pt({className:e,...t}){return ee(Z.Separator,{"data-slot":"command-separator",className:u("bg-border -mx-1 h-px",e),...t})}o(Pt,"CommandSeparator");function Nt({className:e,...t}){return ee(Z.Item,{"data-slot":"command-item",className:u("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}o(Nt,"CommandItem");import{jsx as H,jsxs as te}from"react/jsx-runtime";function he({options:e,selected:t,onChange:r,placeholder:a,...s}){let[n,p]=Po(!1),g=o(i=>{r(t.filter(f=>f.value!==i.value))},"handleUnselect"),F=e.some(i=>i.category),c=e.reduce((i,f)=>{let d=f.category||"Uncategorized";return i[d]||(i[d]=[]),i[d].push(f),i},{});return te(pe,{open:n,onOpenChange:p,...s,children:[H(ue,{children:te(O,{variant:"outline",role:"combobox","aria-expanded":n,className:"w-full justify-between font-normal",type:"button",children:[H("div",{className:"flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center",children:t.length>0?t.map(i=>te(Ye,{variant:"secondary",className:"mr-1 mb-1",children:[i.label,H("div",{role:"button",tabIndex:0,"aria-label":`remove ${i.label}`,className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",onKeyDown:f=>{f.key==="Enter"&&g(i)},onMouseDown:f=>{f.preventDefault(),f.stopPropagation()},onClick:()=>g(i),children:H(Ro,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},i.label)):H("span",{className:"text-foreground",children:a})}),H(ko,{className:"size-4"})]})}),H(fe,{align:"start",className:"w-full p-0",children:H(xt,{children:te(Ct,{children:[H(bt,{children:"No item found."}),Object.entries(c).map(([i,f],d)=>te(So,{children:[d>0&&H(Pt,{}),H(St,{heading:F?i:void 0,children:f.map(m=>{let v=t.some(l=>l.value===m.value);return te(Nt,{onSelect:()=>{r(v?t.filter(l=>l.value!==m.value):[...t,m])},children:[H(No,{className:u("mr-2 h-4 w-4",v?"opacity-100":"opacity-0")}),m.label]},m.label)})})]},i))]})})})]})}o(he,"MultiSelect");import{jsx as q,jsxs as Do}from"react/jsx-runtime";function kt({label:e,name:t,options:r,defaultValue:a,description:s,onChange:n,$meta:p,component:g,...F}){let{control:c}=_(),{components:i}=S(),[f,d]=wo([]);return q(P,{defaultValue:a,control:c,name:t,render:({field:m,fieldState:v})=>{let l=g||i?.countries;if(l){let b={label:e,name:t,options:r,defaultValue:a,description:s,onChange:n,$meta:p,...F};return q(l,{field:{...m,onChange:o(k=>{m.onChange(k),n?.(k)},"onChange")},fieldState:v,fieldData:b})}let y=[...Object.entries(p?.regions||{}).map(([b,k])=>({value:k,label:b,category:"Regions"})),...Object.entries(p?.subregions||{}).map(([b,k])=>({value:k,label:b,category:"Subregions"})),...r.map(b=>({...b,value:b.value,label:b.label,category:"Countries"}))],C=o(b=>{let k=b.map(({value:qt})=>qt);m.onChange(k),n?.(k),d(b)},"handleChange");return Do(R,{"data-field":t,className:`RemoteFlows__CountryField__Item__${t}`,children:[q(N,{className:"RemoteFlows__CountryField__Label",children:e}),q(w,{children:q(he,{options:y,selected:f,onChange:C,...F})}),s&&q(D,{children:s}),v.error&&q(I,{})]})}})}o(kt,"CountryField");import*as Rt from"react";import{jsx as To}from"react/jsx-runtime";var Be=Rt.forwardRef(({className:e,...t},r)=>To("textarea",{className:u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...t}));Be.displayName="Textarea";import{jsx as j,jsxs as Oe}from"react/jsx-runtime";function wt({name:e,description:t,label:r,onChange:a,maxLength:s,component:n,...p}){let{components:g}=S(),{control:F}=_();return j(P,{control:F,name:e,render:({field:c,fieldState:i})=>{let f=n||g?.textarea;if(f){let m={name:e,description:t,label:r,maxLength:s,...p};return j(f,{field:{...c,onChange:o(v=>{c.onChange(v),a?.(v)},"onChange")},fieldState:i,fieldData:m})}let d=c.value?.length??0;return Oe(R,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`,children:[j(N,{className:"RemoteFlows__TextArea__Label",children:r}),j(w,{children:j(Be,{...c,value:c.value??"",onChange:m=>{c.onChange(m),a?.(m)},className:u(i.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:r})}),(t||s)&&Oe("div",{className:"flex items-center justify-between",children:[t&&j(D,{className:"RemoteFlows__TextArea__Description",children:t}),s&&Oe("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength",children:[d,"/",s]})]}),i.error&&j(I,{className:"RemoteFlows__TextArea__Error"})]})}})}o(wt,"TextAreaField");import{jsx as Ve}from"react/jsx-runtime";function Dt(e){let{components:t}=S(),{control:r}=_(),a=e.component||t?.email;return a?Ve(P,{control:r,name:e.name,render:({field:s,fieldState:n})=>Ve(a,{field:{...s,onChange:o(p=>{s.onChange(p),e.onChange?.(p)},"onChange")},fieldState:n,fieldData:e})}):Ve(V,{...e,type:"email"})}o(Dt,"EmailField");import{jsx as Tt}from"react/jsx-runtime";function It(e){let{control:t}=_();return Tt(P,{control:t,name:e.name,render:({field:r})=>Tt("input",{...r,type:"hidden"})})}o(It,"HiddenField");import Ho,{useEffect as Bo,useState as Vt}from"react";var Mt=o((e,t,r)=>{if(e&&"reportValidity"in e){let a=ne(r,t);e.setCustomValidity(a&&a.message||""),e.reportValidity()}},"r"),Ae=o((e,t)=>{for(let r in t.fields){let a=t.fields[r];a&&a.ref&&"reportValidity"in a.ref?Mt(a.ref,r,e):a&&a.refs&&a.refs.forEach(s=>Mt(s,r,e))}},"o"),Wt=o((e,t)=>{t.shouldUseNativeValidation&&Ae(e,t);let r={};for(let a in e){let s=ne(t.fields,a),n=Object.assign(e[a]||{},{ref:s&&s.ref});if(Io(t.names||Object.keys(e),a)){let p=Object.assign({},ne(r,a));ie(p,"root",n),ie(r,a,p)}else ie(r,a,n)}return r},"s"),Io=o((e,t)=>{let r=$t(t);return e.some(a=>$t(a).match(`^${r}\\.\\d+`))},"i");function $t(e){return e.replace(/\]|\[/g,"")}o($t,"n");function Lt(e,t,r){return t===void 0&&(t={}),r===void 0&&(r={}),function(a,s,n){try{return Promise.resolve(function(p,g){try{var F=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[r.mode==="sync"?"validateSync":"validate"](a,Object.assign({abortEarly:!1},t,{context:s}))).then(function(c){return n.shouldUseNativeValidation&&Ae({},n),{values:r.raw?Object.assign({},a):c,errors:{}}}))}catch(c){return g(c)}return F&&F.then?F.then(void 0,g):F}(0,function(p){if(!p.inner)throw p;return{values:{},errors:Wt((g=p,F=!n.shouldUseNativeValidation&&n.criteriaMode==="all",(g.inner||[]).reduce(function(c,i){if(c[i.path]||(c[i.path]={message:i.message,type:i.type}),F){var f=c[i.path].types,d=f&&f[i.type];c[i.path]=Je(i.path,F,c,i.type,d?[].concat(d,i.message):i.message)}return c},{})),n)};var g,F}))}catch(p){return Promise.reject(p)}}}o(Lt,"o");import*as $ from"yup";import Et from"lodash.groupby";import oe from"lodash.capitalize";var Ht=60,_e=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function Mo(e){if(e<60)return`${e}m`;let t=Math.floor(e/Ht),r=e%Ht;return r>0?`${t}h${r}m`:`${t}h`}o(Mo,"convertBreakDurationToHours");function Bt(e){let t=e.reduce((r,a)=>a.hours+r,0);return Number(t.toFixed(2))}o(Bt,"calculateTotalWorkHours");function $o(e,t){let r=t.map(({day:n})=>n.toLowerCase()),a=r.indexOf(e),s=null;for(;a<r.length&&!s;){let n=r[a],p=r[a+1],g=_e.indexOf(n)+1;_e[g]===p||(s=n),a+=1}return s}o($o,"findLastConsecutiveDay");function Wo(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}o(Wo,"shouldSummarizeSchedule");function Lo(e){return Number.parseInt(e.break_duration_minutes)>0}o(Lo,"shouldSummarizeBreaks");function Ot(e){let t=e.filter(Wo),r=Et(t,g=>`${g.start_time}|${g.end_time}`),a=e.filter(Lo),s=Et(a,"break_duration_minutes"),n=Object.keys(r).map(g=>{let F=r[g],c=F[0].day,[i,f]=g.split("|"),d=`from <span>${i.replace(":","h")}</span> to <span>${f.replace(":","h")}</span>`,m=$o(c,F),l=(m?F.findIndex(y=>y.day===m):-1)===F.length-1;return F.length===1?`${oe(c)}, ${d}`:!l||!m?F.reduce((y,C,b)=>{let k=oe(C.day);return b===F.length-1?`${y}and ${k}, ${d}`:`${y}<span>${k}</span>, `},""):`<span>${oe(c)}</span> to <span>${oe(m)}</span>, ${d}`}),p=Object.keys(s).reverse().map((g,F)=>{let c=F===0,i=s[g],f=Mo(parseInt(g,10));if(Object.keys(s).length===1)return`With ${f} daily breaks`;if(i.length===1){let d=`${f} break on ${oe(i[0].day)}.`;return c?`With ${d}`:d}return i.reduce((d,m,v)=>{let l=oe(m.day);return v===0?`${d} ${l}`:v===i.length-1?`${d}, and ${l}.`:`${d}, ${l}`},c?`With ${f} break on`:`${f} break on`)});return{workHoursSummary:n,breakSummary:p}}o(Ot,"buildWorkScheduleSummary");function ze(e){let{checked:t,start_time:r,end_time:a,break_duration_minutes:s}=e;if(!t)return 0;let[n,p]=r.split(":").map(Number),[g,F]=a.split(":").map(Number),c=n*60+p,d=(g*60+F-c-Number.parseInt(s||"0"))/60;return d===Math.floor(d)?d:Number(d.toFixed(2))}o(ze,"calculateHours");var Eo={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function xe(e){return Eo[e]}o(xe,"getShortWeekday");import{jsx as h,jsxs as B}from"react/jsx-runtime";var Oo=$.object({day:$.string().required(),checked:$.boolean().required(),start_time:$.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:o(e=>e.required("Required"),"then"),otherwise:o(e=>e.optional().nullable(),"otherwise")}),end_time:$.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:o(e=>e.required("Required"),"then"),otherwise:o(e=>e.optional().nullable(),"otherwise")}),hours:$.number().default(0),break_duration_minutes:$.string().default("0")}),Vo=$.object({schedule:$.array(Oo)});function Ao({defaultSchedule:e,onSubmit:t}){let[r,a]=Vt(!1),s=_e.map(l=>{let y=e.find(C=>C.day.toLowerCase()===xe(l).toLowerCase()||C.day.toLowerCase()===l.toLowerCase());return y?{...y,day:xe(l),checked:!0}:{...e[0],checked:!1,day:xe(l)}}),n=je({defaultValues:{schedule:s},resolver:Lt(Vo)}),{handleSubmit:p,watch:g,reset:F,control:c,formState:i}=n,{fields:f}=qe({name:"schedule",control:c}),d=g("schedule");function m(l){let y=l.schedule.filter(({checked:C})=>C).map(C=>({...C,hours:ze(C)}));t(y),a(!1)}o(m,"handleSubmitWorkingHours");function v(){F(),a(!1)}return o(v,"handleCancel"),h("div",{className:"flex items-center justify-between",children:B(We,{open:r,onOpenChange:a,children:[h(_t,{asChild:!0,children:h(O,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),B(Le,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[h(Ee,{children:h(He,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),h(Ke,{...n,children:B("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[B("div",{className:"rounded-lg",children:[h("p",{className:"text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description",children:"The times displayed are in the employee's time zone in the 24-hour format."}),B("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[h("div",{className:"col-span-2"}),h("div",{className:"col-span-3 text-center",children:"START"}),h("div",{className:"col-span-1 text-center"}),h("div",{className:"col-span-3 text-center",children:"END"}),h("div",{className:"col-span-2 text-center",children:"HOURS"})]}),h("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:f.map((l,y)=>{let C=d[y],b=ze(C);return B(Ho.Fragment,{children:[B("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[h("div",{className:"col-span-2 flex items-center gap-3",children:h(ce,{label:l.day,name:`schedule.${y}.checked`})}),h("div",{className:"col-span-3",children:h(V,{name:`schedule.${y}.start_time`,includeErrorMessage:!1})}),h("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),h("div",{className:"col-span-3",children:h(V,{name:`schedule.${y}.end_time`,includeErrorMessage:!1})}),h("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(b)?"-":`${b} hours`})]}),B("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[h("div",{className:"col-span-2 text-gray-500",children:"Break"}),h("div",{className:"col-span-2",children:h(V,{name:`schedule.${y}.break_duration_minutes`,includeErrorMessage:!1})}),h("div",{className:"col-span-2 text-gray-500",children:"minutes"}),h("div",{className:"col-span-4"})]})]},l.id)})})]}),Object.keys(i.errors).length>0&&h("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),B("div",{className:"flex gap-4 pt-4",children:[h(O,{type:"button",className:"reset-button",variant:"outline",onClick:v,children:"Cancel"}),h(O,{type:"button",className:"submit-button",onClick:p(m),children:"Save Schedule"})]})]})})]})]})})}o(Ao,"WorkScheduleSelectionForm");function At(e){let{components:t}=S(),{setValue:r,control:a,watch:s}=_(),n=s(e.name),[p,g]=Vt(n),{workHoursSummary:F,breakSummary:c}=Ot(p),i=Bt(p);Bo(()=>{r(e.name,p)},[p,e.name,r]);function f(m){g(m)}o(f,"onSubmit");let d=e.component||t?.["work-schedule"];return d?h(P,{control:a,name:e.name,render:({field:m,fieldState:v})=>h(d,{field:{...m,onChange:o(l=>{m.onChange(l),e.onChange?.(l)},"onChange")},fieldState:v,fieldData:{...e,defaultFormattedValue:{workHoursSummary:F,breakSummary:c,totalWorkHours:i}}})}):B("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[h("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),B("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[h("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:F.join(", ")}}),h("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:c.join()}),B("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",h("span",{children:i})," hours per week"]}),h(Ao,{defaultSchedule:p,onSubmit:f})]})]})}o(At,"WorkScheduleField");import{useState as zo}from"react";import{jsx as K,jsxs as Go}from"react/jsx-runtime";function zt({label:e,name:t,options:r,defaultValue:a,description:s,onChange:n,component:p,...g}){let{control:F}=_(),{components:c}=S(),[i,f]=zo();return K(P,{defaultValue:a,control:F,name:t,render:({field:d,fieldState:m})=>{let v=p||c?.["multi-select"];if(v){let y={label:e,name:t,options:r,defaultValue:a,description:s,onChange:n,...g};return K(v,{field:{...d,onChange:o(C=>{d.onChange(C),n?.(C)},"onChange")},fieldState:m,fieldData:y})}let l=i||r.filter(y=>d.value.includes(y.value));return Go(R,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[K(N,{className:"RemoteFlows__SelectField__Label",children:e}),K(w,{children:K(he,{options:r,selected:l,onChange:y=>{let C=y.map(({value:b})=>b);d.onChange(C),n?.(C),f(y)},...g})}),s&&K(D,{children:s}),m.error&&K(I,{})]})}})}o(zt,"MultiSelectField");import{jsx as Uo}from"react/jsx-runtime";var Gt=o(e=>Uo(ve,{maxLength:15,...e}),"MoneyField");var X={checkbox:ce,text:V,email:Dt,money:Gt,select:ht,"multi-select":zt,radio:ct,number:ve,file:st,fieldset:we,"fieldset-flat":we,date:et,textarea:wt,countries:kt,hidden:It,"work-schedule":At};import{useEffect as Jo}from"react";import{Fragment as qo,jsx as Ce,jsxs as jo}from"react/jsx-runtime";function Ut({name:e,value:t,description:r,statement:a,label:s}){let{setValue:n}=_();return Jo(()=>{n(e,t)},[]),Ce("div",{children:a?jo(qo,{children:[Ce("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${e}`,dangerouslySetInnerHTML:{__html:se(a?.title||s)}}),Ce("p",{className:`text-xs RemoteFlows__ForcedValue__Description__${e}`,dangerouslySetInnerHTML:{__html:se(a?.description)}})]}):Ce("p",{className:`text-xs RemoteFlows__ForcedValue__Description__${e}`,dangerouslySetInnerHTML:{__html:se(r)}})})}o(Ut,"ForcedValueField");import{Fragment as Xo,jsx as Y,jsxs as Jt}from"react/jsx-runtime";function Yo(e){return e.const!==void 0&&e.const===e.default&&e.inputType!=="checkbox"&&e.inputType!=="hidden"}o(Yo,"checkFieldHasForcedValue");var Fs=o(({fields:e,fieldsets:t,fieldValues:r,components:a})=>{if(!e||e.length===0)return null;let s=t&&r?Ge({fields:e,fieldsets:t,values:r}):e;return Y(Xo,{children:s.map(n=>{if(n.calculateDynamicProperties&&(n={...n,...n.calculateDynamicProperties(r,n)||{}}),n.isVisible===!1||n.deprecated)return null;if(Yo(n))return Y(Ut,{name:n.name,description:n.description,value:n.const,statement:n.statement,label:n.label},n.name);if(n.Component){let{Component:g}=n;return Y(g,{...n},n.name)}let p=X[n.type];return n.type==="select"&&n.multiple&&(p=X["multi-select"]),n.type==="fieldset"?Y(p,{...n,components:a},n.name):n.type==="fieldset-flat"?Y(p,{...n,components:a,isFlatFieldset:!0},n.name):p?Jt(Ko,{children:[Y(p,{...n,component:a&&a[n.type]}),n.statement?Y(Fe,{...n.statement}):null,n.extra?n.extra:null]},n.name):Jt("p",{className:"error",children:["Field type ",n.type," not supported"]})})})},"JSONSchemaFormFields");export{Fs as a};
2
+ //# sourceMappingURL=chunk-4EX2FBJD.js.map