@remoteoss/remote-flows 0.4.0 → 0.4.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/dist/{chunk-EEAMZPP6.js → chunk-2IOIRPXX.js} +2 -2
  2. package/dist/{chunk-EB6GZ52C.js → chunk-2YGGLGBG.js} +2 -2
  3. package/dist/{chunk-3NZ6PO4D.js → chunk-3TAUIOLW.js} +2 -2
  4. package/dist/chunk-5I2GCSAL.js +2 -0
  5. package/dist/{chunk-6PU7CB5U.js.map → chunk-5I2GCSAL.js.map} +1 -1
  6. package/dist/{chunk-FNPHFDVW.js → chunk-5NCRPBBP.js} +2 -2
  7. package/dist/chunk-5RPT35EL.js +2 -0
  8. package/dist/{chunk-RVPWK6LS.js.map → chunk-5RPT35EL.js.map} +1 -1
  9. package/dist/chunk-6WFPF53B.js +2 -0
  10. package/dist/{chunk-75R6JZDW.js.map → chunk-6WFPF53B.js.map} +1 -1
  11. package/dist/chunk-7522S3KZ.js +2 -0
  12. package/dist/{chunk-KSD3WMDB.js.map → chunk-7522S3KZ.js.map} +1 -1
  13. package/dist/{chunk-BF7QENCN.js → chunk-ABFF6YSW.js} +2 -2
  14. package/dist/{chunk-HDN4FDPM.js → chunk-BFZQYTQN.js} +2 -2
  15. package/dist/{chunk-FB5J7SRP.js → chunk-BHXNRWYC.js} +2 -2
  16. package/dist/{chunk-QR7BFA7D.js → chunk-CIIUTHY7.js} +2 -2
  17. package/dist/{chunk-WIRFNWEU.js → chunk-CVXZNBHC.js} +2 -2
  18. package/dist/{chunk-MSBG52WO.js → chunk-DBRBPYIF.js} +2 -2
  19. package/dist/{chunk-REFXENXG.js → chunk-DIF7GZA2.js} +2 -2
  20. package/dist/{chunk-XK2VKWS4.js → chunk-EGJR5MXK.js} +2 -2
  21. package/dist/{chunk-Q7JCPGRV.js → chunk-GTXQK2J6.js} +2 -2
  22. package/dist/{chunk-KM4XVL2X.js → chunk-HRIDANZ6.js} +2 -2
  23. package/dist/{chunk-CTTXXEWI.js → chunk-HS3TP43Z.js} +2 -2
  24. package/dist/chunk-HUEFMP54.js +2 -0
  25. package/dist/{chunk-3LLIAVAT.js.map → chunk-HUEFMP54.js.map} +1 -1
  26. package/dist/{chunk-LLIGZSYY.js → chunk-JW2HLB6X.js} +2 -2
  27. package/dist/{chunk-EV5YPN4F.js → chunk-KKM4IXYC.js} +2 -2
  28. package/dist/{chunk-MNO47WC2.js → chunk-L6CLZL2D.js} +2 -2
  29. package/dist/{chunk-2M24UA4Q.js → chunk-LOBYJTDX.js} +2 -2
  30. package/dist/{chunk-3HPG2L62.js → chunk-LU6YNL6P.js} +2 -2
  31. package/dist/{chunk-32RYPLZK.js → chunk-MIALHORP.js} +2 -2
  32. package/dist/chunk-MPMOHDZP.js +2 -0
  33. package/dist/chunk-MPMOHDZP.js.map +1 -0
  34. package/dist/{chunk-PJCUSCO4.js → chunk-NTJN7NCK.js} +2 -2
  35. package/dist/{chunk-XO3JWN33.js → chunk-OYI5OCMY.js} +2 -2
  36. package/dist/{chunk-TLGQADTJ.js → chunk-PRFH5KY7.js} +2 -2
  37. package/dist/{chunk-5Z4FFOUG.js → chunk-PWWX66GV.js} +2 -2
  38. package/dist/{chunk-FUIQ7D6L.js → chunk-R4PWQPR6.js} +2 -2
  39. package/dist/{chunk-4DBVDTD7.js → chunk-RBC6WNYP.js} +2 -2
  40. package/dist/{chunk-OLQH5MUO.js → chunk-S4WAMYEE.js} +2 -2
  41. package/dist/chunk-STEO7MS2.js +2 -0
  42. package/dist/chunk-STEO7MS2.js.map +1 -0
  43. package/dist/chunk-SYYKU72Z.js +2 -0
  44. package/dist/chunk-SYYKU72Z.js.map +1 -0
  45. package/dist/chunk-TC3SWPEN.js +2 -0
  46. package/dist/{chunk-KPHSEIR3.js.map → chunk-TC3SWPEN.js.map} +1 -1
  47. package/dist/{chunk-IBPMQFJD.js → chunk-VCYSWPLV.js} +2 -2
  48. package/dist/{chunk-Y4RXM5DL.js → chunk-VFR5R7GS.js} +2 -2
  49. package/dist/{chunk-GEYFQVQI.js → chunk-WZSGDTVV.js} +2 -2
  50. package/dist/{chunk-O35HIRRS.js → chunk-XTC73RFN.js} +2 -2
  51. package/dist/{chunk-3DQNK6T7.js → chunk-YD3IHRVA.js} +2 -2
  52. package/dist/{chunk-4U36WFL2.js → chunk-YDW7CPPR.js} +2 -2
  53. package/dist/{chunk-RXK4RLF6.js → chunk-YECC5GAT.js} +2 -2
  54. package/dist/chunk-ZKALTI3E.js +2 -0
  55. package/dist/{chunk-TXQGBSCM.js.map → chunk-ZKALTI3E.js.map} +1 -1
  56. package/dist/{chunk-YO4OQIFP.js → chunk-ZOTFG7GS.js} +2 -2
  57. package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
  58. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
  59. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  60. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  61. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
  62. package/dist/flows/ContractAmendment/context.d.ts +3 -0
  63. package/dist/flows/ContractAmendment/index.js +1 -1
  64. package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js +1 -1
  65. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  66. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  67. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
  68. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
  69. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  70. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  71. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  72. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  73. package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.js +1 -1
  74. package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.js +1 -1
  75. package/dist/flows/CostCalculator/components/SalaryField.d.ts +1 -1
  76. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  77. package/dist/flows/CostCalculator/context.d.ts +1 -1
  78. package/dist/flows/CostCalculator/hooks.js +1 -1
  79. package/dist/flows/CostCalculator/index.d.ts +1 -1
  80. package/dist/flows/CostCalculator/index.js +1 -1
  81. package/dist/flows/CostCalculator/utils.d.ts +1 -1
  82. package/dist/flows/CostCalculator/utils.js +1 -1
  83. package/dist/flows/Onboarding/OnboardingFlow.d.ts +1 -1
  84. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  85. package/dist/flows/Onboarding/api.d.ts +1 -1
  86. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +1 -1
  87. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  88. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  89. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +1 -1
  90. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  91. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  92. package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
  93. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +1 -1
  94. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  95. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  96. package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
  97. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  98. package/dist/flows/Onboarding/context.d.ts +1 -1
  99. package/dist/flows/Onboarding/hooks.d.ts +1 -1
  100. package/dist/flows/Onboarding/hooks.js +1 -1
  101. package/dist/flows/Onboarding/index.d.ts +1 -1
  102. package/dist/flows/Onboarding/index.js +1 -1
  103. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  104. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  105. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  106. package/dist/flows/Termination/TerminationBack.js +1 -1
  107. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  108. package/dist/flows/Termination/TerminationFlow.js +1 -1
  109. package/dist/flows/Termination/TerminationForm.js +1 -1
  110. package/dist/flows/Termination/TerminationSubmit.js +1 -1
  111. package/dist/flows/Termination/context.d.ts +3 -0
  112. package/dist/flows/Termination/index.js +1 -1
  113. package/dist/index.d.ts +2 -2
  114. package/dist/index.js +1 -1
  115. package/dist/index.js.map +1 -1
  116. package/dist/{remoteFlows-42q2E5rP.d.ts → remoteFlows-B-p1H61n.d.ts} +8 -0
  117. package/package.json +1 -1
  118. package/dist/chunk-3LLIAVAT.js +0 -2
  119. package/dist/chunk-6PU7CB5U.js +0 -2
  120. package/dist/chunk-75R6JZDW.js +0 -2
  121. package/dist/chunk-G25ZXN6A.js +0 -2
  122. package/dist/chunk-G25ZXN6A.js.map +0 -1
  123. package/dist/chunk-KPHSEIR3.js +0 -2
  124. package/dist/chunk-KSD3WMDB.js +0 -2
  125. package/dist/chunk-QTEZNOV2.js +0 -2
  126. package/dist/chunk-QTEZNOV2.js.map +0 -1
  127. package/dist/chunk-RVPWK6LS.js +0 -2
  128. package/dist/chunk-TXQGBSCM.js +0 -2
  129. package/dist/chunk-VNSF5IOL.js +0 -2
  130. package/dist/chunk-VNSF5IOL.js.map +0 -1
  131. /package/dist/{chunk-EEAMZPP6.js.map → chunk-2IOIRPXX.js.map} +0 -0
  132. /package/dist/{chunk-EB6GZ52C.js.map → chunk-2YGGLGBG.js.map} +0 -0
  133. /package/dist/{chunk-3NZ6PO4D.js.map → chunk-3TAUIOLW.js.map} +0 -0
  134. /package/dist/{chunk-FNPHFDVW.js.map → chunk-5NCRPBBP.js.map} +0 -0
  135. /package/dist/{chunk-BF7QENCN.js.map → chunk-ABFF6YSW.js.map} +0 -0
  136. /package/dist/{chunk-HDN4FDPM.js.map → chunk-BFZQYTQN.js.map} +0 -0
  137. /package/dist/{chunk-FB5J7SRP.js.map → chunk-BHXNRWYC.js.map} +0 -0
  138. /package/dist/{chunk-QR7BFA7D.js.map → chunk-CIIUTHY7.js.map} +0 -0
  139. /package/dist/{chunk-WIRFNWEU.js.map → chunk-CVXZNBHC.js.map} +0 -0
  140. /package/dist/{chunk-MSBG52WO.js.map → chunk-DBRBPYIF.js.map} +0 -0
  141. /package/dist/{chunk-REFXENXG.js.map → chunk-DIF7GZA2.js.map} +0 -0
  142. /package/dist/{chunk-XK2VKWS4.js.map → chunk-EGJR5MXK.js.map} +0 -0
  143. /package/dist/{chunk-Q7JCPGRV.js.map → chunk-GTXQK2J6.js.map} +0 -0
  144. /package/dist/{chunk-KM4XVL2X.js.map → chunk-HRIDANZ6.js.map} +0 -0
  145. /package/dist/{chunk-CTTXXEWI.js.map → chunk-HS3TP43Z.js.map} +0 -0
  146. /package/dist/{chunk-LLIGZSYY.js.map → chunk-JW2HLB6X.js.map} +0 -0
  147. /package/dist/{chunk-EV5YPN4F.js.map → chunk-KKM4IXYC.js.map} +0 -0
  148. /package/dist/{chunk-MNO47WC2.js.map → chunk-L6CLZL2D.js.map} +0 -0
  149. /package/dist/{chunk-2M24UA4Q.js.map → chunk-LOBYJTDX.js.map} +0 -0
  150. /package/dist/{chunk-3HPG2L62.js.map → chunk-LU6YNL6P.js.map} +0 -0
  151. /package/dist/{chunk-32RYPLZK.js.map → chunk-MIALHORP.js.map} +0 -0
  152. /package/dist/{chunk-PJCUSCO4.js.map → chunk-NTJN7NCK.js.map} +0 -0
  153. /package/dist/{chunk-XO3JWN33.js.map → chunk-OYI5OCMY.js.map} +0 -0
  154. /package/dist/{chunk-TLGQADTJ.js.map → chunk-PRFH5KY7.js.map} +0 -0
  155. /package/dist/{chunk-5Z4FFOUG.js.map → chunk-PWWX66GV.js.map} +0 -0
  156. /package/dist/{chunk-FUIQ7D6L.js.map → chunk-R4PWQPR6.js.map} +0 -0
  157. /package/dist/{chunk-4DBVDTD7.js.map → chunk-RBC6WNYP.js.map} +0 -0
  158. /package/dist/{chunk-OLQH5MUO.js.map → chunk-S4WAMYEE.js.map} +0 -0
  159. /package/dist/{chunk-IBPMQFJD.js.map → chunk-VCYSWPLV.js.map} +0 -0
  160. /package/dist/{chunk-Y4RXM5DL.js.map → chunk-VFR5R7GS.js.map} +0 -0
  161. /package/dist/{chunk-GEYFQVQI.js.map → chunk-WZSGDTVV.js.map} +0 -0
  162. /package/dist/{chunk-O35HIRRS.js.map → chunk-XTC73RFN.js.map} +0 -0
  163. /package/dist/{chunk-3DQNK6T7.js.map → chunk-YD3IHRVA.js.map} +0 -0
  164. /package/dist/{chunk-4U36WFL2.js.map → chunk-YDW7CPPR.js.map} +0 -0
  165. /package/dist/{chunk-RXK4RLF6.js.map → chunk-YECC5GAT.js.map} +0 -0
  166. /package/dist/{chunk-YO4OQIFP.js.map → chunk-ZOTFG7GS.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-FUIQ7D6L.js";import"../../../chunk-PGWKJ6FK.js";import"../../../chunk-GEYFQVQI.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-KPHSEIR3.js";import"../../../chunk-P37U34EQ.js";export{a as OnboardingSubmit};
1
+ import{a}from"../../../chunk-R4PWQPR6.js";import"../../../chunk-PGWKJ6FK.js";import"../../../chunk-WZSGDTVV.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-TC3SWPEN.js";import"../../../chunk-P37U34EQ.js";export{a as OnboardingSubmit};
2
2
  //# sourceMappingURL=OnboardingSubmit.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-IBPMQFJD.js";import"../../../chunk-RVPWK6LS.js";import"../../../chunk-PGWKJ6FK.js";import"../../../chunk-QW4JPW6J.js";import"../../../chunk-QTEZNOV2.js";import"../../../chunk-XO3JWN33.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-G25ZXN6A.js";import"../../../chunk-GEYFQVQI.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-VNSF5IOL.js";import"../../../chunk-CNYSTJVL.js";import"../../../chunk-KPHSEIR3.js";import"../../../chunk-P37U34EQ.js";export{a as SelectCountryStep};
1
+ import{a}from"../../../chunk-VCYSWPLV.js";import"../../../chunk-5RPT35EL.js";import"../../../chunk-PGWKJ6FK.js";import"../../../chunk-QW4JPW6J.js";import"../../../chunk-SYYKU72Z.js";import"../../../chunk-OYI5OCMY.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-MPMOHDZP.js";import"../../../chunk-WZSGDTVV.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-STEO7MS2.js";import"../../../chunk-CNYSTJVL.js";import"../../../chunk-TC3SWPEN.js";import"../../../chunk-P37U34EQ.js";export{a as SelectCountryStep};
2
2
  //# sourceMappingURL=SelectCountryStep.js.map
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_query_core from '@tanstack/query-core';
2
- import { J as JSFFieldset } from '../../remoteFlows-42q2E5rP.js';
2
+ import { J as JSFFieldset } from '../../remoteFlows-B-p1H61n.js';
3
3
  import { Meta } from './types.js';
4
4
  import { STEPS } from './utils.js';
5
5
  import { m as EmploymentCreationResponse, n as PostCreateEmployment2Error, p as EmploymentResponse, q as PatchUpdateEmployment2Error, S as SuccessResponse$1, s as PutUpdateBenefitOfferError, i as Employment } from '../../types.gen-DSJsKiNm.js';
@@ -8,7 +8,7 @@ import { Step } from '../useStepState.js';
8
8
  import { STEPS } from './utils.js';
9
9
  import { FieldValues } from 'react-hook-form';
10
10
  import { OnboardingFlowParams, Meta } from './types.js';
11
- import { J as JSFFieldset } from '../../remoteFlows-42q2E5rP.js';
11
+ import { J as JSFFieldset } from '../../remoteFlows-B-p1H61n.js';
12
12
  import '../types.js';
13
13
  import 'yup';
14
14
  import '../../types-Zg1n_9wh.js';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-REFXENXG.js";import"../../chunk-EB6GZ52C.js";import"../../chunk-XIPPSRO6.js";import"../../chunk-TXQGBSCM.js";import"../../chunk-X36OBDKD.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-PWUYHFON.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-G25ZXN6A.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-VNSF5IOL.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as useOnboarding};
1
+ import{a}from"../../chunk-DIF7GZA2.js";import"../../chunk-2YGGLGBG.js";import"../../chunk-XIPPSRO6.js";import"../../chunk-ZKALTI3E.js";import"../../chunk-X36OBDKD.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-PWUYHFON.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as useOnboarding};
2
2
  //# sourceMappingURL=hooks.js.map
@@ -12,7 +12,7 @@ import '../useStepState.js';
12
12
  import 'react-hook-form';
13
13
  import './utils.js';
14
14
  import '../types.js';
15
- import '../../remoteFlows-42q2E5rP.js';
15
+ import '../../remoteFlows-B-p1H61n.js';
16
16
  import 'yup';
17
17
  import '../../types-Zg1n_9wh.js';
18
18
  import './components/BasicInformationStep.js';
@@ -1,2 +1,2 @@
1
- import"../../chunk-GULCZWSK.js";import{a}from"../../chunk-HDN4FDPM.js";import"../../chunk-7TOZZQQJ.js";import"../../chunk-IBPMQFJD.js";import"../../chunk-Q7JCPGRV.js";import"../../chunk-4U36WFL2.js";import"../../chunk-5Z4FFOUG.js";import"../../chunk-MSBG52WO.js";import"../../chunk-RVPWK6LS.js";import"../../chunk-FNPHFDVW.js";import"../../chunk-FUIQ7D6L.js";import"../../chunk-KFVOK5X5.js";import"../../chunk-PGWKJ6FK.js";import"../../chunk-REFXENXG.js";import"../../chunk-EB6GZ52C.js";import"../../chunk-XIPPSRO6.js";import"../../chunk-TXQGBSCM.js";import"../../chunk-X36OBDKD.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-PWUYHFON.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-QTEZNOV2.js";import"../../chunk-XO3JWN33.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-G25ZXN6A.js";import"../../chunk-GEYFQVQI.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-VNSF5IOL.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as OnboardingFlow};
1
+ import"../../chunk-GULCZWSK.js";import{a}from"../../chunk-BFZQYTQN.js";import"../../chunk-7TOZZQQJ.js";import"../../chunk-VCYSWPLV.js";import"../../chunk-GTXQK2J6.js";import"../../chunk-YDW7CPPR.js";import"../../chunk-PWWX66GV.js";import"../../chunk-DBRBPYIF.js";import"../../chunk-5RPT35EL.js";import"../../chunk-5NCRPBBP.js";import"../../chunk-R4PWQPR6.js";import"../../chunk-KFVOK5X5.js";import"../../chunk-PGWKJ6FK.js";import"../../chunk-DIF7GZA2.js";import"../../chunk-2YGGLGBG.js";import"../../chunk-XIPPSRO6.js";import"../../chunk-ZKALTI3E.js";import"../../chunk-X36OBDKD.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-PWUYHFON.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-SYYKU72Z.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as OnboardingFlow};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-4DBVDTD7.js";import"../../chunk-KSD3WMDB.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-QTEZNOV2.js";import"../../chunk-XO3JWN33.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-G25ZXN6A.js";import"../../chunk-GEYFQVQI.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-VNSF5IOL.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as AdditionalDetailsForm};
1
+ import{a}from"../../chunk-RBC6WNYP.js";import"../../chunk-7522S3KZ.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-SYYKU72Z.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as AdditionalDetailsForm};
2
2
  //# sourceMappingURL=AdditionalDetailsForm.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-XK2VKWS4.js";import"../../chunk-KSD3WMDB.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-QTEZNOV2.js";import"../../chunk-XO3JWN33.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-G25ZXN6A.js";import"../../chunk-GEYFQVQI.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-VNSF5IOL.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as EmployeeCommunicationForm};
1
+ import{a}from"../../chunk-EGJR5MXK.js";import"../../chunk-7522S3KZ.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-SYYKU72Z.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as EmployeeCommunicationForm};
2
2
  //# sourceMappingURL=EmployeeComunicationForm.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-QR7BFA7D.js";import"../../chunk-KSD3WMDB.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-QTEZNOV2.js";import"../../chunk-XO3JWN33.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-G25ZXN6A.js";import"../../chunk-GEYFQVQI.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-VNSF5IOL.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as PaidTimeOffForm};
1
+ import{a}from"../../chunk-CIIUTHY7.js";import"../../chunk-7522S3KZ.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-SYYKU72Z.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as PaidTimeOffForm};
2
2
  //# sourceMappingURL=PaidTimeOffForm.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-BF7QENCN.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-GEYFQVQI.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as TerminationBack};
1
+ import{a}from"../../chunk-ABFF6YSW.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as TerminationBack};
2
2
  //# sourceMappingURL=TerminationBack.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-O35HIRRS.js";import"../../chunk-KSD3WMDB.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-QTEZNOV2.js";import"../../chunk-XO3JWN33.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-G25ZXN6A.js";import"../../chunk-GEYFQVQI.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-VNSF5IOL.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as TerminationDetailsForm};
1
+ import{a}from"../../chunk-XTC73RFN.js";import"../../chunk-7522S3KZ.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-SYYKU72Z.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as TerminationDetailsForm};
2
2
  //# sourceMappingURL=TerminationDetailsForm.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-TLGQADTJ.js";import"../../chunk-LLIGZSYY.js";import"../../chunk-SYEPIESJ.js";import"../../chunk-6O3WKNSB.js";import"../../chunk-HSW5HMHH.js";import"../../chunk-VX2UC3HG.js";import"../../chunk-XSHHMBMT.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-JODJFARP.js";import"../../chunk-WWANHPT7.js";import"../../chunk-W5DG5WWJ.js";import"../../chunk-S4XU4SE7.js";import"../../chunk-4DBVDTD7.js";import"../../chunk-XK2VKWS4.js";import"../../chunk-QR7BFA7D.js";import"../../chunk-BF7QENCN.js";import"../../chunk-O35HIRRS.js";import"../../chunk-KSD3WMDB.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-PWUYHFON.js";import"../../chunk-VTNGEN34.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-QTEZNOV2.js";import"../../chunk-XO3JWN33.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-G25ZXN6A.js";import"../../chunk-GEYFQVQI.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-VNSF5IOL.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as TerminationFlow};
1
+ import{a}from"../../chunk-PRFH5KY7.js";import"../../chunk-JW2HLB6X.js";import"../../chunk-SYEPIESJ.js";import"../../chunk-6O3WKNSB.js";import"../../chunk-HSW5HMHH.js";import"../../chunk-VX2UC3HG.js";import"../../chunk-XSHHMBMT.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-JODJFARP.js";import"../../chunk-WWANHPT7.js";import"../../chunk-W5DG5WWJ.js";import"../../chunk-S4XU4SE7.js";import"../../chunk-RBC6WNYP.js";import"../../chunk-EGJR5MXK.js";import"../../chunk-CIIUTHY7.js";import"../../chunk-ABFF6YSW.js";import"../../chunk-XTC73RFN.js";import"../../chunk-7522S3KZ.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-PWUYHFON.js";import"../../chunk-VTNGEN34.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-SYYKU72Z.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as TerminationFlow};
2
2
  //# sourceMappingURL=TerminationFlow.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-KSD3WMDB.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-QTEZNOV2.js";import"../../chunk-XO3JWN33.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-G25ZXN6A.js";import"../../chunk-GEYFQVQI.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-VNSF5IOL.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as TerminationForm};
1
+ import{a}from"../../chunk-7522S3KZ.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-SYYKU72Z.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as TerminationForm};
2
2
  //# sourceMappingURL=TerminationForm.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-LLIGZSYY.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-GEYFQVQI.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as TerminationSubmit};
1
+ import{a}from"../../chunk-JW2HLB6X.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as TerminationSubmit};
2
2
  //# sourceMappingURL=TerminationSubmit.js.map
@@ -1,12 +1,15 @@
1
1
  import { O as OffboardingResponse, B as PostCreateOffboardingError } from '../../types.gen-DSJsKiNm.js';
2
2
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
3
3
  import * as react from 'react';
4
+ import '../../remoteFlows-B-p1H61n.js';
4
5
  import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-B6HWH-rZ.js';
5
6
  import { Step } from '../useStepState.js';
6
7
  import { useTermination } from './hooks.js';
7
8
  import { TerminationFormValues } from './types.js';
8
9
  import { StepTerminationKeys } from './utils.js';
9
10
  import 'react-hook-form';
11
+ import 'yup';
12
+ import '../../types-Zg1n_9wh.js';
10
13
  import '../types.js';
11
14
 
12
15
  declare const TerminationContext: react.Context<{
@@ -1,2 +1,2 @@
1
- import"../../chunk-M22FKNEY.js";import{a}from"../../chunk-TLGQADTJ.js";import"../../chunk-LLIGZSYY.js";import"../../chunk-SYEPIESJ.js";import"../../chunk-6O3WKNSB.js";import"../../chunk-HSW5HMHH.js";import"../../chunk-VX2UC3HG.js";import"../../chunk-XSHHMBMT.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-JODJFARP.js";import"../../chunk-WWANHPT7.js";import"../../chunk-W5DG5WWJ.js";import"../../chunk-S4XU4SE7.js";import"../../chunk-4DBVDTD7.js";import"../../chunk-XK2VKWS4.js";import"../../chunk-QR7BFA7D.js";import"../../chunk-BF7QENCN.js";import"../../chunk-O35HIRRS.js";import"../../chunk-KSD3WMDB.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-PWUYHFON.js";import"../../chunk-VTNGEN34.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-QTEZNOV2.js";import"../../chunk-XO3JWN33.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-G25ZXN6A.js";import"../../chunk-GEYFQVQI.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-VNSF5IOL.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as TerminationFlow};
1
+ import"../../chunk-M22FKNEY.js";import{a}from"../../chunk-PRFH5KY7.js";import"../../chunk-JW2HLB6X.js";import"../../chunk-SYEPIESJ.js";import"../../chunk-6O3WKNSB.js";import"../../chunk-HSW5HMHH.js";import"../../chunk-VX2UC3HG.js";import"../../chunk-XSHHMBMT.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-JODJFARP.js";import"../../chunk-WWANHPT7.js";import"../../chunk-W5DG5WWJ.js";import"../../chunk-S4XU4SE7.js";import"../../chunk-RBC6WNYP.js";import"../../chunk-EGJR5MXK.js";import"../../chunk-CIIUTHY7.js";import"../../chunk-ABFF6YSW.js";import"../../chunk-XTC73RFN.js";import"../../chunk-7522S3KZ.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-PWUYHFON.js";import"../../chunk-VTNGEN34.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-SYYKU72Z.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as TerminationFlow};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -26,8 +26,8 @@ import { ContractAmendmentParams } from './flows/ContractAmendment/types.js';
26
26
  import { ValidationError } from 'yup';
27
27
  import * as react_jsx_runtime from 'react/jsx-runtime';
28
28
  import { PropsWithChildren } from 'react';
29
- import { R as RemoteFlowsSDKProps } from './remoteFlows-42q2E5rP.js';
30
- export { $ as $TSFixMe, B as ButtonComponentProps, C as Components, F as FieldComponentProps, S as StatementComponentProps } from './remoteFlows-42q2E5rP.js';
29
+ import { R as RemoteFlowsSDKProps } from './remoteFlows-B-p1H61n.js';
30
+ export { $ as $TSFixMe, B as ButtonComponentProps, C as Components, F as FieldComponentProps, S as StatementComponentProps } from './remoteFlows-B-p1H61n.js';
31
31
  export { F as FieldError, N as NormalizedFieldError } from './mutations-B6HWH-rZ.js';
32
32
  import './flows/types.js';
33
33
  import '@remoteoss/json-schema-form';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import"./chunk-M22FKNEY.js";import{a as tr}from"./chunk-TLGQADTJ.js";import"./chunk-LLIGZSYY.js";import"./chunk-SYEPIESJ.js";import"./chunk-6O3WKNSB.js";import"./chunk-HSW5HMHH.js";import"./chunk-VX2UC3HG.js";import"./chunk-XSHHMBMT.js";import"./chunk-XFD3ULUF.js";import"./chunk-JODJFARP.js";import"./chunk-WWANHPT7.js";import"./chunk-W5DG5WWJ.js";import"./chunk-S4XU4SE7.js";import"./chunk-4DBVDTD7.js";import"./chunk-XK2VKWS4.js";import"./chunk-QR7BFA7D.js";import"./chunk-BF7QENCN.js";import"./chunk-O35HIRRS.js";import"./chunk-KSD3WMDB.js";import"./chunk-MRYRNB7Y.js";import"./chunk-GULCZWSK.js";import{a as or}from"./chunk-HDN4FDPM.js";import"./chunk-7TOZZQQJ.js";import"./chunk-IBPMQFJD.js";import"./chunk-Q7JCPGRV.js";import"./chunk-4U36WFL2.js";import"./chunk-5Z4FFOUG.js";import"./chunk-MSBG52WO.js";import"./chunk-RVPWK6LS.js";import"./chunk-FNPHFDVW.js";import"./chunk-FUIQ7D6L.js";import"./chunk-KFVOK5X5.js";import"./chunk-PGWKJ6FK.js";import"./chunk-REFXENXG.js";import"./chunk-EB6GZ52C.js";import"./chunk-XIPPSRO6.js";import"./chunk-YJXRJTOH.js";import{a as E}from"./chunk-MNO47WC2.js";import"./chunk-WIRFNWEU.js";import"./chunk-3NZ6PO4D.js";import"./chunk-YO4OQIFP.js";import"./chunk-32RYPLZK.js";import"./chunk-PJCUSCO4.js";import"./chunk-EEAMZPP6.js";import"./chunk-FB5J7SRP.js";import{a as R}from"./chunk-Y4RXM5DL.js";import{a as z}from"./chunk-3HPG2L62.js";import{a as T}from"./chunk-KM4XVL2X.js";import"./chunk-A7ZJQCNU.js";import{a as B}from"./chunk-EV5YPN4F.js";import{a as _}from"./chunk-DYB3RWP7.js";import{a as F}from"./chunk-75R6JZDW.js";import"./chunk-KSHK3ZPX.js";import{b as y,d as P}from"./chunk-2M24UA4Q.js";import"./chunk-OLQH5MUO.js";import"./chunk-UPRUP24B.js";import"./chunk-TXQGBSCM.js";import"./chunk-X36OBDKD.js";import"./chunk-WVJDCDGZ.js";import{d as k}from"./chunk-MC6FNME3.js";import"./chunk-PWUYHFON.js";import{a as er}from"./chunk-3DQNK6T7.js";import{a as H}from"./chunk-RXK4RLF6.js";import{a as ar}from"./chunk-SX5W3CBP.js";import{a as J,b as rr}from"./chunk-VTNGEN34.js";import"./chunk-QW4JPW6J.js";import"./chunk-Z4FTX74F.js";import{a as p}from"./chunk-276MJCIE.js";import"./chunk-PJBAQZ6G.js";import"./chunk-CTTXXEWI.js";import{a as G}from"./chunk-3LLIAVAT.js";import{a as Z}from"./chunk-6PU7CB5U.js";import"./chunk-QTEZNOV2.js";import"./chunk-XO3JWN33.js";import"./chunk-CFIJKJXD.js";import"./chunk-G25ZXN6A.js";import"./chunk-GEYFQVQI.js";import{a as g,c as v}from"./chunk-3ZWDIEEM.js";import"./chunk-VNSF5IOL.js";import"./chunk-CNYSTJVL.js";import"./chunk-TVZAFTPT.js";import{c as C}from"./chunk-KPHSEIR3.js";import{a as e}from"./chunk-P37U34EQ.js";import{QueryClient as L,QueryClientProvider as q}from"@tanstack/react-query";function l(r){let a=document.documentElement;Object.keys(r).forEach(t=>{let o=r[t];o&&a.style.setProperty(t,o)})}e(l,"setCssProperties");function S(r){let a={};return Object.keys(r).forEach(t=>{a[`--${t}`]=r[t]}),a}e(S,"mapThemeColors");function N(r){return{"--spacing":r}}e(N,"mapThemeSpacing");function O(r){return{"--radius":r}}e(O,"mapThemeBorderRadius");function j(r){return{"--fontSizeBase":r.fontSizeBase}}e(j,"mapThemeFont");function h(r){r?.colors&&l(S(r.colors)),r?.spacing&&l(N(r.spacing)),r?.borderRadius&&l(O(r.borderRadius)),r?.font&&l(j(r.font))}e(h,"applyTheme");import{createContext as D,useEffect as I,useMemo as A}from"react";import{jsx as V}from"react/jsx-runtime";var K=D({theme:{}});function u(r){I(()=>{r.theme&&Object.keys(r.theme).length>0&&h(r.theme)},[r.theme]);let a=A(()=>({theme:r.theme}),[r.theme]);return V(K.Provider,{value:a,children:r.children})}e(u,"ThemeProvider");var m={partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com",sandbox:"https://gateway.remote-sandbox.com",staging:"https://gateway.niceremote.com"};import{createClient as U}from"@hey-api/client-fetch";import{useQuery as W}from"@tanstack/react-query";import{useRef as w}from"react";function M(r){try{return new URL(r),!0}catch{return!1}}e(M,"isValidUrl");var f=e(({auth:r,options:a})=>{let t=w(null),{refetch:o}=W({queryKey:["auth"],queryFn:r,enabled:!1}),c=a?.environment?m[a?.environment]:"https://gateway.remote.com",s=p.getConfig(),x="0.4.0",d=!!a?.proxy&&M(a.proxy.url);return a?.proxy&&!d&&console.error("Invalid proxy URL provided. Using default base URL."),w(U({...s,headers:{...s.headers,...d?a?.proxy?.headers:{},"X-Client-Name":"remote-flows-sdk","X-Client-Version":x},baseUrl:d?a.proxy?.url:c,auth:e(async()=>{function b(i){return!i||Date.now()+6e4>i}if(e(b,"hasTokenExpired"),!t.current||b(t.current.expiresAt)){let{data:i}=await o();i&&(t.current={accessToken:i.accessToken,expiresAt:Date.now()+i.expiresIn*1e3})}return t.current?.accessToken},"auth")}))},"useAuth");import{jsx as n}from"react/jsx-runtime";var Q=new L;function X({children:r,auth:a,proxy:t,environment:o}){let c=f({auth:a,options:{proxy:t,environment:o}});return n(v.Provider,{value:{client:c.current},children:r})}e(X,"RemoteFlowContextWrapper");function Y({children:r,components:a}){return n(g.Provider,{value:a?{components:a}:{components:{}},children:r})}e(Y,"FormFieldsProvider");function $({auth:r,children:a,components:t,theme:o,proxy:c,environment:s}){return n(q,{client:Q,children:n(Y,{components:t,children:n(X,{auth:r,proxy:c,environment:s,children:n(u,{theme:o,children:a})})})})}e($,"RemoteFlows");export{G as ContractAmendmentConfirmationForm,er as ContractAmendmentFlow,Z as ContractAmendmentForm,H as ContractAmendmentSubmit,B as CostCalculatorDisclaimer,F as CostCalculatorFlow,R as CostCalculatorForm,z as CostCalculatorResetButton,E as CostCalculatorResults,T as CostCalculatorSubmitButton,or as OnboardingFlow,$ as RemoteFlows,tr as TerminationFlow,y as buildCostCalculatorEstimationPayload,_ as disclaimerData,C as transformYupErrorsIntoObject,ar as useContractAmendment,P as useCostCalculator,k as useCostCalculatorEstimationPdf,J as useEmploymentQuery,rr as useTimeOffQuery};
1
+ import"./chunk-M22FKNEY.js";import{a as or}from"./chunk-PRFH5KY7.js";import"./chunk-JW2HLB6X.js";import"./chunk-SYEPIESJ.js";import"./chunk-6O3WKNSB.js";import"./chunk-HSW5HMHH.js";import"./chunk-VX2UC3HG.js";import"./chunk-XSHHMBMT.js";import"./chunk-XFD3ULUF.js";import"./chunk-JODJFARP.js";import"./chunk-WWANHPT7.js";import"./chunk-W5DG5WWJ.js";import"./chunk-S4XU4SE7.js";import"./chunk-RBC6WNYP.js";import"./chunk-EGJR5MXK.js";import"./chunk-CIIUTHY7.js";import"./chunk-ABFF6YSW.js";import"./chunk-XTC73RFN.js";import"./chunk-7522S3KZ.js";import"./chunk-MRYRNB7Y.js";import"./chunk-GULCZWSK.js";import{a as ir}from"./chunk-BFZQYTQN.js";import"./chunk-7TOZZQQJ.js";import"./chunk-VCYSWPLV.js";import"./chunk-GTXQK2J6.js";import"./chunk-YDW7CPPR.js";import"./chunk-PWWX66GV.js";import"./chunk-DBRBPYIF.js";import"./chunk-5RPT35EL.js";import"./chunk-5NCRPBBP.js";import"./chunk-R4PWQPR6.js";import"./chunk-KFVOK5X5.js";import"./chunk-PGWKJ6FK.js";import"./chunk-DIF7GZA2.js";import"./chunk-2YGGLGBG.js";import"./chunk-XIPPSRO6.js";import"./chunk-YJXRJTOH.js";import{a as S}from"./chunk-L6CLZL2D.js";import"./chunk-CVXZNBHC.js";import"./chunk-3TAUIOLW.js";import"./chunk-ZOTFG7GS.js";import"./chunk-MIALHORP.js";import"./chunk-NTJN7NCK.js";import"./chunk-2IOIRPXX.js";import"./chunk-BHXNRWYC.js";import{a as T}from"./chunk-VFR5R7GS.js";import{a as _}from"./chunk-LU6YNL6P.js";import{a as z}from"./chunk-HRIDANZ6.js";import"./chunk-A7ZJQCNU.js";import{a as E}from"./chunk-KKM4IXYC.js";import{a as B}from"./chunk-DYB3RWP7.js";import{a as R}from"./chunk-6WFPF53B.js";import"./chunk-KSHK3ZPX.js";import{b as k,d as F}from"./chunk-LOBYJTDX.js";import"./chunk-S4WAMYEE.js";import"./chunk-UPRUP24B.js";import"./chunk-ZKALTI3E.js";import"./chunk-X36OBDKD.js";import"./chunk-WVJDCDGZ.js";import{d as C}from"./chunk-MC6FNME3.js";import"./chunk-PWUYHFON.js";import{a as tr}from"./chunk-YD3IHRVA.js";import{a as J}from"./chunk-YECC5GAT.js";import{a as er}from"./chunk-SX5W3CBP.js";import{a as rr,b as ar}from"./chunk-VTNGEN34.js";import"./chunk-QW4JPW6J.js";import"./chunk-Z4FTX74F.js";import{a as g}from"./chunk-276MJCIE.js";import"./chunk-PJBAQZ6G.js";import"./chunk-HS3TP43Z.js";import{a as Z}from"./chunk-HUEFMP54.js";import{a as H}from"./chunk-5I2GCSAL.js";import"./chunk-SYYKU72Z.js";import"./chunk-OYI5OCMY.js";import"./chunk-CFIJKJXD.js";import"./chunk-MPMOHDZP.js";import"./chunk-WZSGDTVV.js";import{a as v,c as u}from"./chunk-3ZWDIEEM.js";import"./chunk-STEO7MS2.js";import"./chunk-CNYSTJVL.js";import"./chunk-TVZAFTPT.js";import{c as P,d as h}from"./chunk-TC3SWPEN.js";import{a as e}from"./chunk-P37U34EQ.js";import{QueryClient as q,QueryClientProvider as Q}from"@tanstack/react-query";function l(r){let a=document.documentElement;Object.keys(r).forEach(t=>{let o=r[t];o&&a.style.setProperty(t,o)})}e(l,"setCssProperties");function N(r){let a={};return Object.keys(r).forEach(t=>{a[`--${t}`]=r[t]}),a}e(N,"mapThemeColors");function O(r){return{"--spacing":r}}e(O,"mapThemeSpacing");function j(r){return{"--radius":r}}e(j,"mapThemeBorderRadius");function D(r){return{"--fontSizeBase":r.fontSizeBase}}e(D,"mapThemeFont");function m(r){r?.colors&&l(N(r.colors)),r?.spacing&&l(O(r.spacing)),r?.borderRadius&&l(j(r.borderRadius)),r?.font&&l(D(r.font))}e(m,"applyTheme");import{createContext as I,useEffect as A,useMemo as K}from"react";import{jsx as U}from"react/jsx-runtime";var V=I({theme:{}});function w(r){A(()=>{r.theme&&Object.keys(r.theme).length>0&&m(r.theme)},[r.theme]);let a=K(()=>({theme:r.theme}),[r.theme]);return U(V.Provider,{value:a,children:r.children})}e(w,"ThemeProvider");var f={partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com",sandbox:"https://gateway.remote-sandbox.com",staging:"https://gateway.niceremote.com"};import{createClient as W}from"@hey-api/client-fetch";import{useQuery as M}from"@tanstack/react-query";import{useRef as x}from"react";function L(r){try{return new URL(r),!0}catch{return!1}}e(L,"isValidUrl");var b=e(({auth:r,options:a})=>{let t=x(null),{refetch:o}=M({queryKey:["auth"],queryFn:r,enabled:!1}),c=a?.environment?f[a?.environment]:"https://gateway.remote.com",s=g.getConfig(),p="0.4.2-alpha.0";a?.environment&&a?.environment!=="production"&&h(p);let d=!!a?.proxy&&L(a.proxy.url);return a?.proxy&&!d&&console.error("Invalid proxy URL provided. Using default base URL."),x(W({...s,headers:{...s.headers,...d?a?.proxy?.headers:{},"X-Client-Name":"remote-flows-sdk","X-Client-Version":p},baseUrl:d?a.proxy?.url:c,auth:e(async()=>{function y(i){return!i||Date.now()+6e4>i}if(e(y,"hasTokenExpired"),!t.current||y(t.current.expiresAt)){let{data:i}=await o();i&&(t.current={accessToken:i.accessToken,expiresAt:Date.now()+i.expiresIn*1e3})}return t.current?.accessToken},"auth")}))},"useAuth");import{jsx as n}from"react/jsx-runtime";var X=new q;function Y({children:r,auth:a,proxy:t,environment:o}){let c=b({auth:a,options:{proxy:t,environment:o}});return n(u.Provider,{value:{client:c.current},children:r})}e(Y,"RemoteFlowContextWrapper");function $({children:r,components:a}){return n(v.Provider,{value:a?{components:a}:{components:{}},children:r})}e($,"FormFieldsProvider");function G({auth:r,children:a,components:t,theme:o,proxy:c,environment:s}){return n(Q,{client:X,children:n($,{components:t,children:n(Y,{auth:r,proxy:c,environment:s,children:n(w,{theme:o,children:a})})})})}e(G,"RemoteFlows");export{Z as ContractAmendmentConfirmationForm,tr as ContractAmendmentFlow,H as ContractAmendmentForm,J as ContractAmendmentSubmit,E as CostCalculatorDisclaimer,R as CostCalculatorFlow,T as CostCalculatorForm,_ as CostCalculatorResetButton,S as CostCalculatorResults,z as CostCalculatorSubmitButton,ir as OnboardingFlow,G as RemoteFlows,or as TerminationFlow,k as buildCostCalculatorEstimationPayload,B as disclaimerData,P as transformYupErrorsIntoObject,er as useContractAmendment,F as useCostCalculator,C as useCostCalculatorEstimationPdf,rr as useEmploymentQuery,ar as useTimeOffQuery};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n options: {\n proxy,\n environment,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n children,\n components,\n theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n proxy={proxy}\n environment={environment}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\n proxy: RemoteFlowsSDKProps['proxy'];\n}>;\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n}: {\n auth: () => Promise<AuthResponse>;\n options?: Options;\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth'],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION;\n const isValidProxy = !!options?.proxy && isValidUrl(options.proxy.url);\n\n if (options?.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options?.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"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","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","proxy","environment","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
1
+ {"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n options: {\n proxy,\n environment,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n children,\n components,\n theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n proxy={proxy}\n environment={environment}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { debug } from './lib/utils';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\n proxy: RemoteFlowsSDKProps['proxy'];\n}>;\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n}: {\n auth: () => Promise<AuthResponse>;\n options?: Options;\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth'],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION || 'unknown';\n\n if (options?.environment && options?.environment !== 'production') {\n debug(npmPackageVersion);\n }\n\n const isValidProxy = !!options?.proxy && isValidUrl(options.proxy.url);\n\n if (options?.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options?.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"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","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","debug","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","proxy","environment","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
@@ -65,6 +65,7 @@ type JSFField = {
65
65
  value: string;
66
66
  label: string;
67
67
  description?: string;
68
+ disabled?: boolean;
68
69
  }>;
69
70
  defaultValue?: string | number;
70
71
  minDate?: string;
@@ -152,5 +153,12 @@ type RemoteFlowsSDKProps = Omit<ThemeProviderProps, 'children'> & {
152
153
  };
153
154
  };
154
155
  type $TSFixMe = any;
156
+ declare global {
157
+ interface Window {
158
+ RemoteFlowsSDK?: {
159
+ version: string;
160
+ };
161
+ }
162
+ }
155
163
 
156
164
  export type { $TSFixMe as $, ButtonComponentProps as B, Components as C, FieldComponentProps as F, JSFFieldset as J, RemoteFlowsSDKProps as R, StatementComponentProps as S, JSFField as a };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remoteoss/remote-flows",
3
- "version": "0.4.0",
3
+ "version": "0.4.2-alpha.0",
4
4
  "scripts": {
5
5
  "build": "NODE_ENV=production tsup",
6
6
  "ci": "npm run build && npm run check-format && npm run check-exports && npm run lint && npm run test",
@@ -1,2 +0,0 @@
1
- import{a as m}from"./chunk-VNSF5IOL.js";import{c as n}from"./chunk-CNYSTJVL.js";import{b as a}from"./chunk-TVZAFTPT.js";import{a as o}from"./chunk-P37U34EQ.js";import{useForm as S}from"react-hook-form";import{jsx as i}from"react/jsx-runtime";function w({onSubmit:s,onError:d,onSuccess:c}){let{contractAmendment:{stepState:l,isSubmitting:u,onSubmit:f,fields:C},formId:p}=a(),e=S({defaultValues:l.values?.form}),A=o(async r=>{let F=n(r,C,{isPartialValidation:!1});await s?.(F);let t=await f(r);t.error?d?.(t.error):await c?.(t.data)},"handleSubmit");return u?null:i(m,{...e,children:i("form",{id:p,onSubmit:e.handleSubmit(A),className:"RemoteFlows__ContractAmendmentConfirmationForm"})})}o(w,"ContractAmendmentConfirmationForm");export{w as a};
2
- //# sourceMappingURL=chunk-3LLIAVAT.js.map
@@ -1,2 +0,0 @@
1
- import{a as p}from"./chunk-QTEZNOV2.js";import{b as l}from"./chunk-CFIJKJXD.js";import{a as f}from"./chunk-VNSF5IOL.js";import{c as u}from"./chunk-CNYSTJVL.js";import{b as F}from"./chunk-TVZAFTPT.js";import{a as r}from"./chunk-P37U34EQ.js";import{useEffect as P}from"react";import{useForm as R}from"react-hook-form";import{jsx as a}from"react/jsx-runtime";var w=["effective_date","reason_for_change","reason_for_change_description","additional_comments","additional_comments_toggle"];function x({onSubmit:_,onError:m,onSuccess:b}){let{formId:A,contractAmendment:{checkFieldUpdates:C,fields:s,onSubmit:h,stepState:S,initialValues:i,handleValidation:g}}=F(),y=l(g),e=R({resolver:y,defaultValues:S.values?.form||i,shouldUnregister:!0,mode:"onBlur"});P(()=>{let t=e?.watch(o=>{(Object.keys(e.formState.dirtyFields).length>0||e.formState.isDirty)&&C(o)});return()=>t?.unsubscribe()},[]);let V=r(async t=>{let o=!1;for(let[c,v]of Object.entries(t))if(!w.includes(c)&&i[c]!==v){o=!0;break}if(!o)return m?.({message:"no_changes_detected_contract_details"});let d=u(t,s,{isPartialValidation:!1});await _?.(d);let n=await h(t);n.error?m?.(n.error):await b?.(n.data)},"handleSubmit");return a(f,{...e,children:a("form",{id:A,"data-testid":"contract-amendment-form",onSubmit:e.handleSubmit(V),className:"space-y-4 RemoteFlows__ContractAmendmentForm",children:a(p,{fields:s})})})}r(x,"ContractAmendmentForm");export{x as a};
2
- //# sourceMappingURL=chunk-6PU7CB5U.js.map
@@ -1,2 +0,0 @@
1
- import{a as s}from"./chunk-KSHK3ZPX.js";import{c as l,d as n}from"./chunk-2M24UA4Q.js";import{b as a}from"./chunk-CFIJKJXD.js";import{a as r}from"./chunk-P37U34EQ.js";import{useId as p}from"react";import{useForm as y}from"react-hook-form";import{jsx as d}from"react/jsx-runtime";var h=r(({estimationOptions:e=l,defaultValues:o={countryRegionSlug:"",currencySlug:"",salary:""},options:i,render:u,version:c="standard"})=>{let C=p(),t=n({defaultRegion:o.countryRegionSlug,estimationOptions:e,version:c,options:i}),m=a(t.handleValidation),g=y({resolver:m,defaultValues:{country:o?.countryRegionSlug,currency:o?.currencySlug,region:"",salary:o?.salary},shouldUnregister:!1,mode:"onBlur"});return d(s.Provider,{value:{form:g,formId:C,costCalculatorBag:t},children:u(t)})},"CostCalculatorFlow");export{h as a};
2
- //# sourceMappingURL=chunk-75R6JZDW.js.map
@@ -1,2 +0,0 @@
1
- import{b as u}from"./chunk-3ZWDIEEM.js";import{b as F,c as f,d as x,e as _,f as g,g as b}from"./chunk-VNSF5IOL.js";import{a as c}from"./chunk-KPHSEIR3.js";import{a as i}from"./chunk-P37U34EQ.js";import{useFormContext as N}from"react-hook-form";import{jsx as y}from"react/jsx-runtime";function C({className:o,type:r,...t}){return y("input",{type:r,"data-slot":"input",className:c("shadow-xs border-input file:text-foreground placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-xl border bg-transparent px-4 py-7 text-sm transition-[color] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-focused","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",o),...t})}i(C,"Input");import{jsx as e,jsxs as D}from"react/jsx-runtime";function q({name:o,description:r,label:t,type:v,onChange:s,component:R,includeErrorMessage:T=!0,additionalProps:w={},maxLength:l,...h}){let{components:I}=u(),{control:P}=N();return e(F,{control:P,name:o,render:({field:n,fieldState:m})=>{let d=R||I?.text;if(d){let a={name:o,description:r,label:t,type:v,onChange:s,metadata:w,maxLength:l,...h};return e(d,{field:{...n,onChange:i(p=>{n.onChange(p),s?.(p)},"onChange")},fieldState:m,fieldData:a})}return D(f,{"data-field":o,className:`RemoteFlows__TextField__Item__${o}`,children:[t&&e(x,{className:"RemoteFlows__TextField__Label",children:t}),e(_,{children:e(C,{...n,value:n.value??"",onChange:a=>{n.onChange(a),s?.(a)},className:"RemoteFlows__TextField__Input",placeholder:t,maxLength:l})}),r&&e(g,{className:"RemoteFlows__TextField__Description",children:r}),T&&m.error&&e(b,{className:"RemoteFlows__TextField__Error"})]})}})}i(q,"TextField");export{q as a};
2
- //# sourceMappingURL=chunk-G25ZXN6A.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/form/fields/TextField.tsx","../src/components/ui/input.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\n\nimport { useFormFields } from '@/src/context';\nimport { Components, JSFField } from '@/src/types/remoteFlows';\nimport { useFormContext } from 'react-hook-form';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '../../ui/form';\nimport { Input } from '../../ui/input';\n\nexport type TextFieldProps = React.ComponentProps<'input'> & {\n name: string;\n} & Partial<\n JSFField & {\n onChange?: (value: any) => void;\n component?: Components['text'];\n includeErrorMessage?: boolean;\n additionalProps?: Record<string, unknown>;\n }\n >;\n\nexport function TextField({\n name,\n description,\n label,\n type,\n onChange,\n component,\n includeErrorMessage = true,\n additionalProps = {},\n maxLength,\n ...rest\n}: TextFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n return (\n <FormField\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n const CustomTextField = component || components?.text;\n if (CustomTextField) {\n const customTextFieldProps = {\n name,\n description,\n label,\n type,\n onChange,\n metadata: additionalProps,\n maxLength,\n ...rest,\n };\n return (\n <CustomTextField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customTextFieldProps}\n />\n );\n }\n\n return (\n <FormItem\n data-field={name}\n className={`RemoteFlows__TextField__Item__${name}`}\n >\n {label && (\n <FormLabel className=\"RemoteFlows__TextField__Label\">\n {label}\n </FormLabel>\n )}\n <FormControl>\n <Input\n {...field}\n value={field.value ?? ''}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n field.onChange(event);\n onChange?.(event);\n }}\n className=\"RemoteFlows__TextField__Input\"\n placeholder={label}\n maxLength={maxLength}\n />\n </FormControl>\n {description && (\n <FormDescription className=\"RemoteFlows__TextField__Description\">\n {description}\n </FormDescription>\n )}\n {includeErrorMessage && fieldState.error && (\n <FormMessage className=\"RemoteFlows__TextField__Error\" />\n )}\n </FormItem>\n );\n }}\n />\n );\n}\n","import * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\nfunction Input({ className, type, ...props }: React.ComponentProps<'input'>) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n 'shadow-xs border-input file:text-foreground placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-xl border bg-transparent px-4 py-7 text-sm transition-[color] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n 'focus-visible:border-focused',\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Input };\n"],"mappings":"mMAKA,OAAS,kBAAAA,MAAsB,kBCC3B,cAAAC,MAAA,oBAFJ,SAASC,EAAM,CAAE,UAAAC,EAAW,KAAAC,EAAM,GAAGC,CAAM,EAAkC,CAC3E,OACEJ,EAAC,SACC,KAAMG,EACN,YAAU,QACV,UAAWE,EACT,6WACA,+BACA,yGACAH,CACF,EACC,GAAGE,EACN,CAEJ,CAdSE,EAAAL,EAAA,SDwDG,cAAAM,EAeF,QAAAC,MAfE,oBAjCL,SAASC,EAAU,CACxB,KAAAC,EACA,YAAAC,EACA,MAAAC,EACA,KAAAC,EACA,SAAAC,EACA,UAAAC,EACA,oBAAAC,EAAsB,GACtB,gBAAAC,EAAkB,CAAC,EACnB,UAAAC,EACA,GAAGC,CACL,EAAmB,CACjB,GAAM,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAC/B,CAAE,QAAAC,CAAQ,EAAIC,EAAe,EAEnC,OACEhB,EAACiB,EAAA,CACC,QAASF,EACT,KAAMZ,EACN,OAAQ,CAAC,CAAE,MAAAe,EAAO,WAAAC,CAAW,IAAM,CACjC,IAAMC,EAAkBZ,GAAaK,GAAY,KACjD,GAAIO,EAAiB,CACnB,IAAMC,EAAuB,CAC3B,KAAAlB,EACA,YAAAC,EACA,MAAAC,EACA,KAAAC,EACA,SAAAC,EACA,SAAUG,EACV,UAAAC,EACA,GAAGC,CACL,EACA,OACEZ,EAACoB,EAAA,CACC,MAAO,CACL,GAAGF,EACH,SAAUI,EAACC,GAAe,CACxBL,EAAM,SAASK,CAAK,EACpBhB,IAAWgB,CAAK,CAClB,EAHU,WAIZ,EACA,WAAYJ,EACZ,UAAWE,EACb,CAEJ,CAEA,OACEpB,EAACuB,EAAA,CACC,aAAYrB,EACZ,UAAW,iCAAiCA,CAAI,GAE/C,UAAAE,GACCL,EAACyB,EAAA,CAAU,UAAU,gCAClB,SAAApB,EACH,EAEFL,EAAC0B,EAAA,CACC,SAAA1B,EAAC2B,EAAA,CACE,GAAGT,EACJ,MAAOA,EAAM,OAAS,GACtB,SAAWU,GAA+C,CACxDV,EAAM,SAASU,CAAK,EACpBrB,IAAWqB,CAAK,CAClB,EACA,UAAU,gCACV,YAAavB,EACb,UAAWM,EACb,EACF,EACCP,GACCJ,EAAC6B,EAAA,CAAgB,UAAU,sCACxB,SAAAzB,EACH,EAEDK,GAAuBU,EAAW,OACjCnB,EAAC8B,EAAA,CAAY,UAAU,gCAAgC,GAE3D,CAEJ,EACF,CAEJ,CAnFgBR,EAAApB,EAAA","names":["useFormContext","jsx","Input","className","type","props","cn","__name","jsx","jsxs","TextField","name","description","label","type","onChange","component","includeErrorMessage","additionalProps","maxLength","rest","components","useFormFields","control","useFormContext","FormField","field","fieldState","CustomTextField","customTextFieldProps","__name","value","FormItem","FormLabel","FormControl","Input","event","FormDescription","FormMessage"]}
@@ -1,2 +0,0 @@
1
- import{a as i}from"./chunk-P37U34EQ.js";import{clsx as e}from"clsx";import{twMerge as a}from"tailwind-merge";function c(...n){return a(e(n))}i(c,"cn");function m(n,t="\u20AC"){if(!n)return"-";let r=n/100;return`${t}${r.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}i(m,"formatCurrency");var s=i(n=>{let t={};return n.inner.forEach(r=>{r.path!==void 0&&(t[r.path]={type:r.type,errors:r.errors,inner:r.inner.map(o=>s(o))})}),t},"transformYupErrorsIntoObject");export{c as a,m as b,s as c};
2
- //# sourceMappingURL=chunk-KPHSEIR3.js.map
@@ -1,2 +0,0 @@
1
- import{b as f}from"./chunk-MRYRNB7Y.js";import{a as l}from"./chunk-QTEZNOV2.js";import{b as s}from"./chunk-CFIJKJXD.js";import{a}from"./chunk-VNSF5IOL.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as y}from"react";import{useForm as T}from"react-hook-form";import{jsx as e}from"react/jsx-runtime";function A({fields:m,onSubmit:d}){let{formId:F,terminationBag:o}=f(),u=s(o.handleValidation),i=T({resolver:u,defaultValues:o?.initialValues,shouldUnregister:!1,mode:"onBlur"});y(()=>{let p=i?.watch(r=>{Object.keys(r).some(t=>r[t]!==o?.initialValues?.[t])&&o?.checkFieldUpdates(r)});return()=>p?.unsubscribe()},[]);let c=m||(o?.fields??[]);return e(a,{...i,children:e("form",{id:F,onSubmit:i.handleSubmit(d),className:"space-y-4 RemoteFlows__TerminationForm",children:e(l,{fields:c})})})}n(A,"TerminationForm");export{A as a};
2
- //# sourceMappingURL=chunk-KSD3WMDB.js.map
@@ -1,2 +0,0 @@
1
- import{a as Oe}from"./chunk-XO3JWN33.js";import{a as A}from"./chunk-G25ZXN6A.js";import{a as he,b as B}from"./chunk-GEYFQVQI.js";import{b as C}from"./chunk-3ZWDIEEM.js";import{a as Ae,b as x,c as k,d as P,e as N,f as R,g as D}from"./chunk-VNSF5IOL.js";import{e as He,g as Be}from"./chunk-CNYSTJVL.js";import{a as p}from"./chunk-KPHSEIR3.js";import{a as o}from"./chunk-P37U34EQ.js";import{Fragment as jo}from"react";import*as ze from"react";import*as te from"@radix-ui/react-checkbox";import{Check as $t}from"lucide-react";import{jsx as _e}from"react/jsx-runtime";var re=ze.forwardRef(({className:e,...t},r)=>_e(te.Root,{ref:r,className:p("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:_e(te.Indicator,{className:p("flex items-center justify-center text-current"),children:_e($t,{className:"h-4 w-4"})})}));re.displayName=te.Root.displayName;import{useFormContext as Et}from"react-hook-form";import{Fragment as Ht,jsx as O,jsxs as ae}from"react/jsx-runtime";function ne({name:e,defaultValue:t,description:r,label:n,onChange:s,multiple:i,options:d,component:F,...v}){let{components:c}=C(),{control:l}=Et(),f=o((m,a,g)=>{let u=g.value?[...g.value]:[];a?u.includes(m)||g.onChange([...u,m]):g.onChange(u.filter(y=>y!==m))},"handleCheckboxChange");return O(x,{control:l,name:e,defaultValue:t,render:({field:m,fieldState:a})=>{let g=F||c?.checkbox;if(g){let u={name:e,description:r,label:n,defaultValue:t,multiple:i,options:d,...v};return O(g,{field:{...m,onChange:o(y=>{if(i){let{checked:b,value:S}=y.target;f(S,b,m),s?.(b);return}m.onChange(y),s?.(y)},"onChange")},fieldState:a,fieldData:u})}return ae(k,{"data-field":e,className:p(`RemoteFlows__CheckBoxField__Item__${e}`),children:[O(N,{children:ae(Ht,{children:[d&&i?O(P,{children:n}):null,d&&i?d.map(u=>ae("div",{className:"flex space-x-2",children:[O(re,{id:u.value,onCheckedChange:y=>{f(u.value,y===!0,m),s?.(y,u.value)},checked:m.value?.includes(u.value),className:"RemoteFlows__CheckBox__Input"}),O(P,{htmlFor:u.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:u.label})]},u.value)):ae("div",{className:"flex space-x-2",children:[O(re,{id:e,onCheckedChange:u=>{m.onChange(u),s?.(u)},checked:m.value,className:"RemoteFlows__CheckBox__Input"}),O(P,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label",children:n})]})]})}),r&&O(R,{children:r}),a.error&&O(D,{})]})}})}o(ne,"CheckBoxField");import{CalendarIcon as zt}from"lucide-react";import{useFormContext as Vt}from"react-hook-form";import{PopoverClose as Gt}from"@radix-ui/react-popover";import{ChevronLeft as Bt,ChevronRight as At}from"lucide-react";import{DayPicker as Ot}from"react-day-picker";import{jsx as Ce}from"react/jsx-runtime";function Ve({className:e,classNames:t,showOutsideDays:r=!0,...n}){return Ce(Ot,{showOutsideDays:r,className:p("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:p(he({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:p("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",n.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:p(he({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,...i})=>Ce(Bt,{className:p("size-4",s),...i}),"IconLeft"),IconRight:o(({className:s,...i})=>Ce(At,{className:p("size-4",s),...i}),"IconRight")},...n})}o(Ve,"Calendar");import*as z from"@radix-ui/react-popover";import{jsx as ie}from"react/jsx-runtime";function se({...e}){return ie(z.Root,{"data-slot":"popover",...e})}o(se,"Popover");function le({...e}){return ie(z.Trigger,{"data-slot":"popover-trigger",...e})}o(le,"PopoverTrigger");function me({className:e,align:t="center",sideOffset:r=4,...n}){return ie(z.Portal,{children:ie(z.Content,{"data-slot":"popover-content",align:t,sideOffset:r,className:p("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),...n})})}o(me,"PopoverContent");import{format as Ge}from"date-fns";import{Fragment as Ut,jsx as M,jsxs as xe}from"react/jsx-runtime";function Ue({description:e,label:t,name:r,minDate:n,onChange:s,component:i,...d}){let{components:F}=C(),{control:v}=Vt(),c;return d.meta?.mot&&typeof d.meta.mot=="number"?c=Be(d.meta.mot):n&&(c=new Date(n)),M(x,{control:v,name:r,render:({field:l,fieldState:f})=>{let m=i||F?.date;if(m){let a={description:e,label:t,name:r,onChange:s,...c&&{minDate:c.toISOString()},...d};return M(m,{field:{...l,onChange:o(g=>{l.onChange(g),s?.(g)},"onChange")},fieldState:f,fieldData:a})}return xe(k,{"data-field":r,className:`flex flex-col RemoteFlows__DatePickerField__Item__${r}`,children:[M(P,{className:"RemoteFlows__DatePickerField__Label",children:t}),xe(se,{children:[M(le,{asChild:!0,children:M(N,{children:M("div",{children:xe(B,{type:"button",variant:"outline",className:p("w-full pl-3 text-left font-normal",!l.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${r}`,children:[l.value&&M(Ut,{children:Ge(l.value,"yyyy-MM-dd")}),M(zt,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),M(me,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:M(Ve,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:l.value?new Date(l.value):void 0,onSelect:a=>{l.onChange(a?Ge(a,"yyyy-MM-dd"):null),s?.(a)},defaultMonth:c,components:{DayContent:o(a=>M(Gt,{children:a.date.getDate()}),"DayContent")},...c&&{disabled:o(a=>a<c,"disabled")}})})]}),e?M(R,{children:e}):null,f.error&&M(D,{className:"RemoteFlows__DatePickerField__Error"})]})}})}o(Ue,"DatePickerField");import{cva as Jt}from"class-variance-authority";import{jsx as be}from"react/jsx-runtime";var qt=Jt("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 Je({className:e,variant:t,...r}){return be("div",{"data-slot":"alert",role:"alert",className:p(qt({variant:t}),e),...r})}o(Je,"Alert");function qe({className:e,...t}){return be("div",{"data-slot":"alert-title",className:p("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}o(qe,"AlertTitle");function Ke({className:e,...t}){return be("div",{"data-slot":"alert-description",className:p("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}o(Ke,"AlertDescription");import{AlertCircle as Kt}from"lucide-react";import{jsx as ce,jsxs as Yt}from"react/jsx-runtime";function de({title:e,description:t,severity:r}){let{components:n}=C();if(n?.statement){let s=n?.statement;return ce(s,{data:{title:e,description:t,severity:r}})}return Yt(Je,{variant:"warning",children:[ce(Kt,{className:"h-4 w-4"}),e&&ce(qe,{children:e}),ce(Ke,{children:t})]})}o(de,"Statement");import{useFormContext as Xt}from"react-hook-form";import{useEffect as Qt,useRef as Ye}from"react";import{jsx as pe,jsxs as Xe}from"react/jsx-runtime";import{createElement as Zt}from"react";function Se({label:e,name:t,fields:r,description:n,components:s,statement:i,isFlatFieldset:d}){let{watch:F,trigger:v}=Xt(),c=r.map(({name:a})=>`${t}.${a}`),l=F(c),f=Ye(l),m=Ye(null);return Qt(()=>{let a=l,g=f.current,u=!1;for(let y=0;y<a.length;y++)if(a[y]!==void 0&&g[y]!==a[y]){u=!0;break}return u&&(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{v()},50)),f.current=[...a],()=>{m.current&&clearTimeout(m.current)}},[l,v]),Xe("fieldset",{className:p("border-1 border-input p-4 rounded-xl",`RemoteFlows__FieldSetField__${t}`),children:[pe("legend",{className:"text-sm font-semibold px-2",children:e}),n?pe("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:n}}):null,Xe("div",{className:"grid gap-4",children:[r.map(a=>{let g=oe[a.type];if(a.isVisible===!1||a.deprecated)return null;if(a.Component){let{Component:u}=a;return pe(u,{...a},a.name)}return Zt(g,{...a,key:a.name,name:`${d?a.name:`${t}.${a.name}`}`,component:s?.[a.type]})}),i?pe(de,{...i}):null]})]})}o(Se,"FieldSetField");import{useFormContext as ro}from"react-hook-form";import{useState as jt,useRef as eo}from"react";import{Upload as to,X as oo}from"lucide-react";import{jsx as G,jsxs as Pe}from"react/jsx-runtime";function Qe({onChange:e,className:t,multiple:r}){let[n,s]=jt([]),i=eo(null),d=o(c=>{c.preventDefault(),i.current?.click()},"handleClick"),F=o(c=>{if(c.target.files&&c.target.files.length>0){let l=Array.from(c.target.files);s(l),e(c)}},"handleChange"),v=o(c=>{s(l=>l.filter(f=>f!==c))},"onRemoveFile");return Pe("div",{className:p("flex flex-col items-start gap-4",t),children:[G("input",{type:"file",ref:i,onChange:F,className:"hidden","aria-label":"File upload",multiple:r}),Pe(B,{type:"button",onClick:d,className:"gap-2",children:[G(to,{className:"h-4 w-4"}),"Choose File"]}),n.length===0&&G("div",{className:"text-sm",children:r?G("span",{className:"font-medium",children:"No files selected. You can select multiple files"}):G("span",{className:"font-medium",children:"No file selected."})}),n.length>0&&n.map((c,l)=>Pe("div",{className:"text-sm flex items-center gap-2",children:["Selected file: ",G("span",{className:"font-medium",children:c.name})," (",Math.round(c.size/1024)," KB)",G(B,{variant:"ghost",onClick:()=>v(c),children:G(oo,{})})]},l))]})}o(Qe,"FileUploader");import{jsx as U,jsxs as no}from"react/jsx-runtime";var ao=o(e=>new Promise((t,r)=>{let n=new FileReader;n.readAsDataURL(e),n.onload=()=>t(n.result),n.onerror=s=>r(s)}),"toBase64"),Ze=o(async e=>{let t=e.target.files?Array.from(e.target.files):[];return await Promise.all(t.map(async n=>{let s=await ao(n);return{name:n.name,content:s.split(",")[1]}}))},"convertFilesToBase64");function je({name:e,description:t,label:r,multiple:n,onChange:s,component:i,...d}){let{components:F}=C(),{control:v}=ro();return U(x,{control:v,name:e,render:({field:c,fieldState:l})=>{let f=i||F?.file;if(f){let m={name:e,description:t,label:r,multiple:n,...d};return U(f,{field:{...c,value:null,onChange:o(async a=>{let g=await Ze(a);c.onChange(g),s?.(g)},"onChange")},fieldState:l,fieldData:m})}return no(k,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`,children:[U(P,{className:"RemoteFlows__FileUpload__Label",children:r}),U(N,{children:U(Qe,{onChange:async m=>{let a=await Ze(m);c.onChange(a),s?.(a)},multiple:n,className:p("RemoteFlows__FileUpload__Input")})}),t&&U("div",{className:"flex items-center justify-between",children:U(R,{className:"RemoteFlows__FileUpload__Description",children:t})}),l.error&&U(D,{className:"RemoteFlows__FileUpload__Error"})]})}})}o(je,"FileUploadField");import{useFormContext as io}from"react-hook-form";import{jsx as ke}from"react/jsx-runtime";function ue(e){let{components:t}=C(),{control:r}=io(),n=e.component||t?.number;return n?ke(x,{control:r,name:e.name,render:({field:s,fieldState:i})=>ke(n,{field:{...s,onChange:o(d=>{s.onChange(d),e.onChange?.(d)},"onChange")},fieldState:i,fieldData:e})}):ke(A,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}o(ue,"NumberField");import*as X from"@radix-ui/react-radio-group";import{CircleIcon as so}from"lucide-react";import{jsx as fe}from"react/jsx-runtime";function et({className:e,...t}){return fe(X.Root,{"data-slot":"radio-group",className:p("grid gap-3",e),...t})}o(et,"RadioGroup");function tt({className:e,...t}){return fe(X.Item,{"data-slot":"radio-group-item",className:p("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:fe(X.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:fe(so,{className:"fill-radio absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}o(tt,"RadioGroupItem");import{useFormContext as lo}from"react-hook-form";import{Fragment as mo,jsx as $,jsxs as Ne}from"react/jsx-runtime";function ot({name:e,defaultValue:t,description:r,label:n,options:s,onChange:i,component:d,...F}){let{components:v}=C(),{control:c}=lo();return $(x,{control:c,name:e,defaultValue:t,render:({field:l,fieldState:f})=>{let m=d||v?.radio;if(m){let a={name:e,defaultValue:t,description:r,label:n,options:s,...F};return $(m,{field:{...l,onChange:o(g=>{l.onChange(g),i?.(g)},"onChange")},fieldState:f,fieldData:a})}return Ne(k,{className:p("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),"data-field":e,children:[$(P,{children:n}),$(N,{children:$(et,{"aria-label":n||e,onValueChange:a=>{l.onChange(a),i?.(a)},value:l.value,className:"flex flex-col space-y-3",children:s?.map(a=>$(mo,{children:Ne(k,{"data-field":e,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[$(N,{children:$(tt,{value:a.value,className:"RemoteFlows__RadioField__Input"})}),Ne("div",{children:[$(P,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:a.label}),a.description&&$(R,{className:"mt-2",children:a.description})]})]},a.value)}))})}),r&&$(R,{children:r}),f.error&&$(D,{})]})}})}o(ot,"RadioGroupField");import*as _ from"@radix-ui/react-select";import{CheckIcon as co,ChevronDownIcon as rt,ChevronUpIcon as po}from"lucide-react";import{jsx as w,jsxs as Re}from"react/jsx-runtime";function at({...e}){return w(_.Root,{"data-slot":"select",...e})}o(at,"Select");function nt({...e}){return w(_.Group,{"data-slot":"select-group",...e})}o(nt,"SelectGroup");function it({...e}){return w(_.Value,{"data-slot":"select-value",...e})}o(it,"SelectValue");function st({className:e,children:t,...r}){return Re(_.Trigger,{"data-slot":"select-trigger",className:p("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,w(_.Icon,{asChild:!0,className:"absolute right-4",children:w(rt,{className:"size-4"})})]})}o(st,"SelectTrigger");function lt({className:e,children:t,position:r="popper",...n}){return w(_.Portal,{children:Re(_.Content,{"data-slot":"select-content",className:p("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,...n,children:[w(uo,{}),w(_.Viewport,{className:p(r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),w(fo,{})]})})}o(lt,"SelectContent");function mt({className:e,children:t,...r}){return Re(_.Item,{"data-slot":"select-item",className:p("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:[w(_.ItemText,{children:t}),w("span",{className:"flex size-3.5 items-center justify-center",children:w(_.ItemIndicator,{children:w(co,{className:"size-4"})})})]})}o(mt,"SelectItem");function uo({className:e,...t}){return w(_.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:p("flex cursor-default items-center justify-center py-1",e),...t,children:w(po,{className:"size-4"})})}o(uo,"SelectScrollUpButton");function fo({className:e,...t}){return w(_.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:p("flex cursor-default items-center justify-center py-1",e),...t,children:w(rt,{className:"size-4"})})}o(fo,"SelectScrollDownButton");import{useFormContext as go}from"react-hook-form";import{jsx as W,jsxs as ct}from"react/jsx-runtime";function dt({label:e,name:t,options:r,defaultValue:n,description:s,onChange:i,component:d,...F}){let{control:v}=go(),{components:c}=C();return W(x,{defaultValue:n,control:v,name:t,render:({field:l,fieldState:f})=>{let m=d||c?.select;if(m){let a={label:e,name:t,options:r,defaultValue:n,description:s,onChange:i,...F};return W(m,{field:{...l,onChange:o(g=>{let u=!isNaN(Number(g))&&typeof g!="boolean"?Number(g):g;l.onChange(u),i?.(u)},"onChange")},fieldState:f,fieldData:a})}return ct(k,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[W(P,{className:"RemoteFlows__SelectField__Label",children:e}),W(N,{children:W("div",{className:"relative",children:ct(at,{value:l.value||"",onValueChange:a=>{let g=!isNaN(Number(a))&&typeof a!="boolean"?Number(a):a;l.onChange(g),i?.(g)},children:[W(st,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!f.error,"aria-label":e,children:W("span",{className:"absolute",children:W(it,{placeholder:e})})}),W(lt,{className:"RemoteFlows__SelectField__Content",children:W(nt,{className:"RemoteFlows__SelectField__Group",children:r.map(a=>W(mt,{value:a.value,className:"RemoteFlows__SelectField__SelectItem",children:a.label},a.value))})})]})})}),s&&W(R,{children:s}),f.error&&W(D,{})]})}})}o(dt,"SelectField");import{useState as So}from"react";import{useFormContext as Po}from"react-hook-form";import{Fragment as ho,useState as _o}from"react";import{Check as Co,ChevronDownIcon as xo,X as bo}from"lucide-react";import{Command as Q}from"cmdk";import{SearchIcon as pn}from"lucide-react";import*as T from"@radix-ui/react-dialog";import{XIcon as Fo}from"lucide-react";import{jsx as V,jsxs as we}from"react/jsx-runtime";function De({...e}){return V(T.Root,{"data-slot":"dialog",...e})}o(De,"Dialog");function pt({...e}){return V(T.Trigger,{"data-slot":"dialog-trigger",...e})}o(pt,"DialogTrigger");function vo({...e}){return V(T.Portal,{"data-slot":"dialog-portal",...e})}o(vo,"DialogPortal");function yo({className:e,...t}){return V(T.Overlay,{"data-slot":"dialog-overlay",className:p("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(yo,"DialogOverlay");function Te({className:e,children:t,...r}){return we(vo,{"data-slot":"dialog-portal",children:[V(yo,{}),we(T.Content,{"data-slot":"dialog-content",className:p("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,we(T.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:[V(Fo,{}),V("span",{className:"sr-only",children:"Close"})]})]})]})}o(Te,"DialogContent");function Ie({className:e,...t}){return V("div",{"data-slot":"dialog-header",className:p("flex flex-col gap-2 text-center sm:text-left",e),...t})}o(Ie,"DialogHeader");function Me({className:e,...t}){return V(T.Title,{"data-slot":"dialog-title",className:p("text-lg leading-none font-semibold",e),...t})}o(Me,"DialogTitle");import{jsx as Z,jsxs as Fn}from"react/jsx-runtime";function ut({className:e,...t}){return Z(Q,{"data-slot":"command",className:p("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}o(ut,"Command");function ft({className:e,...t}){return Z(Q.List,{"data-slot":"command-list",className:p("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}o(ft,"CommandList");function gt({...e}){return Z(Q.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}o(gt,"CommandEmpty");function Ft({className:e,...t}){return Z(Q.Group,{"data-slot":"command-group",className:p("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(Ft,"CommandGroup");function vt({className:e,...t}){return Z(Q.Separator,{"data-slot":"command-separator",className:p("bg-border -mx-1 h-px",e),...t})}o(vt,"CommandSeparator");function yt({className:e,...t}){return Z(Q.Item,{"data-slot":"command-item",className:p("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(yt,"CommandItem");import{jsx as E,jsxs as j}from"react/jsx-runtime";function ge({options:e,selected:t,onChange:r,placeholder:n,...s}){let[i,d]=_o(!1),F=o(l=>{r(t.filter(f=>f.value!==l.value))},"handleUnselect"),v=e.some(l=>l.category),c=e.reduce((l,f)=>{let m=f.category||"Uncategorized";return l[m]||(l[m]=[]),l[m].push(f),l},{});return j(se,{open:i,onOpenChange:d,...s,children:[E(le,{children:j(B,{variant:"outline",role:"combobox","aria-expanded":i,className:"w-full justify-between font-normal",type:"button",children:[E("div",{className:"flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center",children:t.length>0?t.map(l=>j(Oe,{variant:"secondary",className:"mr-1 mb-1",children:[l.label,E("div",{role:"button",tabIndex:0,"aria-label":`remove ${l.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"&&F(l)},onMouseDown:f=>{f.preventDefault(),f.stopPropagation()},onClick:()=>F(l),children:E(bo,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},l.label)):E("span",{className:"text-foreground",children:n})}),E(xo,{className:"size-4"})]})}),E(me,{align:"start",className:"w-full p-0",children:E(ut,{children:j(ft,{children:[E(gt,{children:"No item found."}),Object.entries(c).map(([l,f],m)=>j(ho,{children:[m>0&&E(vt,{}),E(Ft,{heading:v?l:void 0,children:f.map(a=>{let g=t.some(u=>u.value===a.value);return j(yt,{onSelect:()=>{r(g?t.filter(u=>u.value!==a.value):[...t,a])},children:[E(Co,{className:p("mr-2 h-4 w-4",g?"opacity-100":"opacity-0")}),a.label]},a.label)})})]},l))]})})})]})}o(ge,"MultiSelect");import{jsx as J,jsxs as ko}from"react/jsx-runtime";function ht({label:e,name:t,options:r,defaultValue:n,description:s,onChange:i,$meta:d,component:F,...v}){let{control:c}=Po(),{components:l}=C(),[f,m]=So([]);return J(x,{defaultValue:n,control:c,name:t,render:({field:a,fieldState:g})=>{let u=F||l?.countries;if(u){let S={label:e,name:t,options:r,defaultValue:n,description:s,onChange:i,$meta:d,...v};return J(u,{field:{...a,onChange:o(L=>{a.onChange(L),i?.(L)},"onChange")},fieldState:g,fieldData:S})}let y=[...Object.entries(d?.regions||{}).map(([S,L])=>({value:L,label:S,category:"Regions"})),...Object.entries(d?.subregions||{}).map(([S,L])=>({value:L,label:S,category:"Subregions"})),...r.map(S=>({...S,value:S.value,label:S.label,category:"Countries"}))],b=o(S=>{let L=S.map(({value:Lt})=>Lt);a.onChange(L),i?.(L),m(S)},"handleChange");return ko(k,{"data-field":t,className:`RemoteFlows__CountryField__Item__${t}`,children:[J(P,{className:"RemoteFlows__CountryField__Label",children:e}),J(N,{children:J(ge,{options:y,selected:f,onChange:b,...v})}),s&&J(R,{children:s}),g.error&&J(D,{})]})}})}o(ht,"CountryField");import{useFormContext as Ro}from"react-hook-form";import*as _t from"react";import{jsx as No}from"react/jsx-runtime";var We=_t.forwardRef(({className:e,...t},r)=>No("textarea",{className:p("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}));We.displayName="Textarea";import{jsx as q,jsxs as Le}from"react/jsx-runtime";function Ct({name:e,description:t,label:r,onChange:n,maxLength:s,component:i,...d}){let{components:F}=C(),{control:v}=Ro();return q(x,{control:v,name:e,render:({field:c,fieldState:l})=>{let f=i||F?.textarea;if(f){let a={name:e,description:t,label:r,maxLength:s,...d};return q(f,{field:{...c,onChange:o(g=>{c.onChange(g),n?.(g)},"onChange")},fieldState:l,fieldData:a})}let m=c.value?.length??0;return Le(k,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`,children:[q(P,{className:"RemoteFlows__TextArea__Label",children:r}),q(N,{children:q(We,{...c,value:c.value??"",onChange:a=>{c.onChange(a),n?.(a)},className:p(l.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:r})}),(t||s)&&Le("div",{className:"flex items-center justify-between",children:[t&&q(R,{className:"RemoteFlows__TextArea__Description",children:t}),s&&Le("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength",children:[m,"/",s]})]}),l.error&&q(D,{className:"RemoteFlows__TextArea__Error"})]})}})}o(Ct,"TextAreaField");import{useFormContext as wo}from"react-hook-form";import{jsx as $e}from"react/jsx-runtime";function xt(e){let{components:t}=C(),{control:r}=wo(),n=e.component||t?.email;return n?$e(x,{control:r,name:e.name,render:({field:s,fieldState:i})=>$e(n,{field:{...s,onChange:o(d=>{s.onChange(d),e.onChange?.(d)},"onChange")},fieldState:i,fieldData:e})}):$e(A,{...e,type:"email"})}o(xt,"EmailField");import{useFormContext as Do}from"react-hook-form";import{jsx as bt}from"react/jsx-runtime";function St(e){let{control:t}=Do();return bt(x,{control:t,name:e.name,render:({field:r})=>bt("input",{...r,type:"hidden"})})}o(St,"HiddenField");import $o,{useEffect as Eo,useState as wt}from"react";import{yupResolver as Ho}from"@hookform/resolvers/yup";import{useForm as Bo,useFormContext as Ao,useFieldArray as Oo}from"react-hook-form";import*as I from"yup";import Pt from"lodash.groupby";import ee from"lodash.capitalize";var kt=60,Fe=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function To(e){if(e<60)return`${e}m`;let t=Math.floor(e/kt),r=e%kt;return r>0?`${t}h${r}m`:`${t}h`}o(To,"convertBreakDurationToHours");function Nt(e){let t=e.reduce((r,n)=>n.hours+r,0);return Number(t.toFixed(2))}o(Nt,"calculateTotalWorkHours");function Io(e,t){let r=t.map(({day:i})=>i.toLowerCase()),n=r.indexOf(e),s=null;for(;n<r.length&&!s;){let i=r[n],d=r[n+1],F=Fe.indexOf(i)+1;Fe[F]===d||(s=i),n+=1}return s}o(Io,"findLastConsecutiveDay");function Mo(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}o(Mo,"shouldSummarizeSchedule");function Wo(e){return Number.parseInt(e.break_duration_minutes)>0}o(Wo,"shouldSummarizeBreaks");function Rt(e){let t=e.filter(Mo),r=Pt(t,F=>`${F.start_time}|${F.end_time}`),n=e.filter(Wo),s=Pt(n,"break_duration_minutes"),i=Object.keys(r).map(F=>{let v=r[F],c=v[0].day,[l,f]=F.split("|"),m=`from <span>${l.replace(":","h")}</span> to <span>${f.replace(":","h")}</span>`,a=Io(c,v),u=(a?v.findIndex(y=>y.day===a):-1)===v.length-1;return v.length===1?`${ee(c)}, ${m}`:!u||!a?v.reduce((y,b,S)=>{let L=ee(b.day);return S===v.length-1?`${y}and ${L}, ${m}`:`${y}<span>${L}</span>, `},""):`<span>${ee(c)}</span> to <span>${ee(a)}</span>, ${m}`}),d=Object.keys(s).reverse().map((F,v)=>{let c=v===0,l=s[F],f=To(parseInt(F,10));if(Object.keys(s).length===1)return`With ${f} daily breaks`;if(l.length===1){let m=`${f} break on ${ee(l[0].day)}.`;return c?`With ${m}`:m}return l.reduce((m,a,g)=>{let u=ee(a.day);return g===0?`${m} ${u}`:g===l.length-1?`${m}, and ${u}.`:`${m}, ${u}`},c?`With ${f} break on`:`${f} break on`)});return{workHoursSummary:i,breakSummary:d}}o(Rt,"buildWorkScheduleSummary");function Ee(e){let{checked:t,start_time:r,end_time:n,break_duration_minutes:s}=e;if(!t)return 0;let[i,d]=r.split(":").map(Number),[F,v]=n.split(":").map(Number),c=i*60+d,m=(F*60+v-c-Number.parseInt(s||"0"))/60;return m===Math.floor(m)?m:Number(m.toFixed(2))}o(Ee,"calculateHours");var Lo={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function ve(e){return Lo[e]}o(ve,"getShortWeekday");import{jsx as h,jsxs as H}from"react/jsx-runtime";var zo=I.object({day:I.string().required(),checked:I.boolean().required(),start_time:I.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:I.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:I.number().default(0),break_duration_minutes:I.string().default("0")}),Vo=I.object({schedule:I.array(zo)});function Go({defaultSchedule:e,onSubmit:t}){let[r,n]=wt(!1),s=Fe.map(u=>{let y=e.find(b=>b.day.toLowerCase()===ve(u).toLowerCase()||b.day.toLowerCase()===u.toLowerCase());return y?{...y,day:ve(u),checked:!0}:{...e[0],checked:!1,day:ve(u)}}),i=Bo({defaultValues:{schedule:s},resolver:Ho(Vo)}),{handleSubmit:d,watch:F,reset:v,control:c,formState:l}=i,{fields:f}=Oo({name:"schedule",control:c}),m=F("schedule");function a(u){let y=u.schedule.filter(({checked:b})=>b).map(b=>({...b,hours:Ee(b)}));t(y),n(!1)}o(a,"handleSubmitWorkingHours");function g(){v(),n(!1)}return o(g,"handleCancel"),h("div",{className:"flex items-center justify-between",children:H(De,{open:r,onOpenChange:n,children:[h(pt,{asChild:!0,children:h(B,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),H(Te,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[h(Ie,{children:h(Me,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),h(Ae,{...i,children:H("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[H("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."}),H("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((u,y)=>{let b=m[y],S=Ee(b);return H($o.Fragment,{children:[H("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(ne,{label:u.day,name:`schedule.${y}.checked`})}),h("div",{className:"col-span-3",children:h(A,{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(A,{name:`schedule.${y}.end_time`,includeErrorMessage:!1})}),h("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(S)?"-":`${S} hours`})]}),H("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(A,{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"})]})]},u.id)})})]}),Object.keys(l.errors).length>0&&h("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),H("div",{className:"flex gap-4 pt-4",children:[h(B,{type:"button",className:"reset-button",variant:"outline",onClick:g,children:"Cancel"}),h(B,{type:"button",className:"submit-button",onClick:d(a),children:"Save Schedule"})]})]})})]})]})})}o(Go,"WorkScheduleSelectionForm");function Dt(e){let{components:t}=C(),{setValue:r,control:n,watch:s}=Ao(),i=s(e.name),[d,F]=wt(i),{workHoursSummary:v,breakSummary:c}=Rt(d),l=Nt(d);Eo(()=>{r(e.name,d)},[d,e.name,r]);function f(a){F(a)}o(f,"onSubmit");let m=e.component||t?.["work-schedule"];return m?h(x,{control:n,name:e.name,render:({field:a,fieldState:g})=>h(m,{field:{...a,onChange:o(u=>{a.onChange(u),e.onChange?.(u)},"onChange")},fieldState:g,fieldData:{...e,defaultFormattedValue:{workHoursSummary:v,breakSummary:c,totalWorkHours:l}}})}):H("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[h("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),H("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:v.join(", ")}}),h("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:c.join()}),H("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",h("span",{children:l})," hours per week"]}),h(Go,{defaultSchedule:d,onSubmit:f})]})]})}o(Dt,"WorkScheduleField");import{useFormContext as Uo}from"react-hook-form";import{useState as Jo}from"react";import{jsx as K,jsxs as qo}from"react/jsx-runtime";function Tt({label:e,name:t,options:r,defaultValue:n,description:s,onChange:i,component:d,...F}){let{control:v}=Uo(),{components:c}=C(),[l,f]=Jo();return K(x,{defaultValue:n,control:v,name:t,render:({field:m,fieldState:a})=>{let g=d||c?.["multi-select"];if(g){let y={label:e,name:t,options:r,defaultValue:n,description:s,onChange:i,...F};return K(g,{field:{...m,onChange:o(b=>{m.onChange(b),i?.(b)},"onChange")},fieldState:a,fieldData:y})}let u=l||r.filter(y=>m.value.includes(y.value));return qo(k,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[K(P,{className:"RemoteFlows__SelectField__Label",children:e}),K(N,{children:K(ge,{options:r,selected:u,onChange:y=>{let b=y.map(({value:S})=>S);m.onChange(b),i?.(b),f(y)},...F})}),s&&K(R,{children:s}),a.error&&K(D,{})]})}})}o(Tt,"MultiSelectField");import{jsx as Ko}from"react/jsx-runtime";var It=o(e=>Ko(ue,{maxLength:15,...e}),"MoneyField");var oe={checkbox:ne,text:A,email:xt,money:It,select:dt,"multi-select":Tt,radio:ot,number:ue,file:je,fieldset:Se,"fieldset-flat":Se,date:Ue,textarea:Ct,countries:ht,hidden:St,"work-schedule":Dt};import{useEffect as Yo}from"react";import{useFormContext as Xo}from"react-hook-form";import{Fragment as Qo,jsx as ye,jsxs as Zo}from"react/jsx-runtime";function Mt({name:e,value:t,description:r,statement:n}){let{setValue:s}=Xo();return Yo(()=>{s(e,t)},[]),ye("div",{children:n?Zo(Qo,{children:[ye("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${e}`,dangerouslySetInnerHTML:{__html:n?.title}}),ye("p",{className:`text-xs RemoteFlows__ForcedValue__Description__${e}`,dangerouslySetInnerHTML:{__html:n?.description}})]}):ye("p",{className:`text-xs RemoteFlows__ForcedValue__Description__${e}`,dangerouslySetInnerHTML:{__html:r}})})}o(Mt,"ForcedValueField");import{Fragment as tr,jsx as Y,jsxs as Wt}from"react/jsx-runtime";function er(e){return e.const!==void 0&&e.const===e.default&&e.inputType!=="checkbox"&&e.inputType!=="hidden"}o(er,"checkFieldHasForcedValue");var ps=o(({fields:e,fieldsets:t,fieldValues:r,components:n})=>{if(!e||e.length===0)return null;let s=t&&r?He({fields:e,fieldsets:t,values:r}):e;return Y(tr,{children:s.map(i=>{if(i.isVisible===!1||i.deprecated)return null;if(er(i))return Y(Mt,{name:i.name,description:i.description,value:i.const,statement:i.statement},i.name);if(i.Component){let{Component:F}=i;return Y(F,{...i},i.name)}let d=oe[i.inputType];return i.inputType==="select"&&i.multiple&&(d=oe["multi-select"]),i.inputType==="fieldset"?Y(d,{...i,components:n}):i.inputType==="fieldset-flat"?Y(d,{...i,components:n,isFlatFieldset:!0}):d?Wt(jo,{children:[Y(d,{...i,component:n&&n[i.inputType]}),i.statement?Y(de,{...i.statement}):null]},i.name):Wt("p",{className:"error",children:["Field type ",i.inputType," not supported"]})})})},"JSONSchemaFormFields");export{ps as a};
2
- //# sourceMappingURL=chunk-QTEZNOV2.js.map