@remoteoss/remote-flows 0.18.1 → 0.19.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.
- package/dist/{chunk-A522V6XF.js → chunk-27PK3DVV.js} +2 -2
- package/dist/{chunk-3O2RD3RK.js → chunk-2EN2X5NU.js} +2 -2
- package/dist/chunk-2ERB4H3T.js +2 -0
- package/dist/chunk-2ERB4H3T.js.map +1 -0
- package/dist/chunk-32GSS4UM.js +2 -0
- package/dist/{chunk-NBCZF2FO.js.map → chunk-32GSS4UM.js.map} +1 -1
- package/dist/{chunk-N5I33LIN.js → chunk-5ISPIMTZ.js} +2 -2
- package/dist/{chunk-U4NWXPI5.js → chunk-5NDSOA6K.js} +2 -2
- package/dist/{chunk-U4NWXPI5.js.map → chunk-5NDSOA6K.js.map} +1 -1
- package/dist/{chunk-ALYKEN3E.js → chunk-5NPHBFW7.js} +2 -2
- package/dist/{chunk-CYKK3LPJ.js → chunk-6F66NTNI.js} +2 -2
- package/dist/{chunk-MRMVBBVZ.js → chunk-6NIRGHFF.js} +2 -2
- package/dist/chunk-6NXC6SLB.js +1 -0
- package/dist/{chunk-A6EYY3FO.js → chunk-73A7SYGH.js} +2 -2
- package/dist/{chunk-MLB2I27G.js → chunk-7CHZ25AS.js} +2 -2
- package/dist/{chunk-4R3ITKOA.js → chunk-7DKOWSJ3.js} +2 -2
- package/dist/{chunk-OZ63OC3N.js → chunk-7EI4E76I.js} +2 -2
- package/dist/{chunk-RZTT3MEP.js → chunk-7SR3FCW6.js} +2 -2
- package/dist/chunk-AHUK7NSK.js +2 -0
- package/dist/chunk-AHUK7NSK.js.map +1 -0
- package/dist/{chunk-BFOGH4SF.js → chunk-AS6DCKEJ.js} +2 -2
- package/dist/{chunk-6NKUEDYP.js → chunk-BE54D4XM.js} +2 -2
- package/dist/{chunk-7P5B6XHM.js → chunk-BM3AKYMT.js} +2 -2
- package/dist/{chunk-H4KE45NG.js → chunk-BZIVYUMH.js} +2 -2
- package/dist/{chunk-EGQJ7UBR.js → chunk-E3QWREZF.js} +1 -1
- package/dist/chunk-E5PSJ75C.js +2 -0
- package/dist/chunk-E5PSJ75C.js.map +1 -0
- package/dist/{chunk-ZSDJZMQW.js → chunk-F2E56YE2.js} +2 -2
- package/dist/{chunk-ZSDJZMQW.js.map → chunk-F2E56YE2.js.map} +1 -1
- package/dist/{chunk-XGEKV3FC.js → chunk-FQPU3JBJ.js} +2 -2
- package/dist/chunk-GC23RRCI.js +2 -0
- package/dist/chunk-GC23RRCI.js.map +1 -0
- package/dist/chunk-GPBU6CQP.js +2 -0
- package/dist/chunk-GPBU6CQP.js.map +1 -0
- package/dist/{chunk-BF2D5O5H.js → chunk-H6NMRBGZ.js} +2 -2
- package/dist/{chunk-A4KEKMEQ.js → chunk-H77RIB6S.js} +2 -2
- package/dist/chunk-INC2YFDP.js +2 -0
- package/dist/chunk-INC2YFDP.js.map +1 -0
- package/dist/{chunk-PHN4XMPV.js → chunk-J7JO4GF4.js} +2 -2
- package/dist/chunk-JBUNDNKJ.js +2 -0
- package/dist/chunk-JBUNDNKJ.js.map +1 -0
- package/dist/{chunk-6ZPISRAG.js → chunk-JIRA6B5O.js} +2 -2
- package/dist/{chunk-56DXHJNR.js → chunk-KVNG6CWQ.js} +2 -2
- package/dist/{chunk-7JQPHRUK.js → chunk-LUUUPLTW.js} +2 -2
- package/dist/{chunk-4B36XRKA.js → chunk-LYF7ISYE.js} +2 -2
- package/dist/chunk-MAHR7HCO.js +2 -0
- package/dist/chunk-MAHR7HCO.js.map +1 -0
- package/dist/chunk-N6G4VZXF.js +2 -0
- package/dist/chunk-N6G4VZXF.js.map +1 -0
- package/dist/{chunk-2VS6B3PC.js → chunk-NNM5M4E3.js} +2 -2
- package/dist/{chunk-7C2Z2EE5.js → chunk-OD37LQSP.js} +2 -2
- package/dist/{chunk-TLC5WQY2.js → chunk-OMECCA6L.js} +2 -2
- package/dist/{chunk-73H6SO2E.js → chunk-P5CLILU4.js} +2 -2
- package/dist/{chunk-CEUBVUKV.js → chunk-P6JDGCDA.js} +2 -2
- package/dist/{chunk-2RZABLV2.js → chunk-PBXZVY22.js} +2 -2
- package/dist/{chunk-ITSQE6EW.js → chunk-PHGCCQZ2.js} +2 -2
- package/dist/{chunk-ZOKSYPOP.js → chunk-PUSPB4CX.js} +2 -2
- package/dist/{chunk-I2A4EFDY.js → chunk-RM3HE733.js} +2 -2
- package/dist/{chunk-GGBEM452.js → chunk-TDQVKDQW.js} +2 -2
- package/dist/{chunk-DCRLPAJL.js → chunk-TPHCKHYD.js} +2 -2
- package/dist/{chunk-63HVO7J5.js → chunk-U4HGV7LP.js} +2 -2
- package/dist/chunk-UH3E6HSQ.js +2 -0
- package/dist/{chunk-QQ7KPOLK.js → chunk-W2PPGQL6.js} +2 -2
- package/dist/{chunk-QXPWESEW.js → chunk-XVTAPI3Z.js} +2 -2
- package/dist/{chunk-NCA3UCCX.js → chunk-Y373YLLS.js} +2 -2
- package/dist/{chunk-JB55FFG6.js → chunk-Y4C57RXK.js} +2 -2
- package/dist/{chunk-V2YORDAL.js → chunk-YDNOMXS7.js} +2 -2
- package/dist/{chunk-53NFLDRX.js → chunk-Z6M74RQ7.js} +2 -2
- package/dist/chunk-ZX5OIIJX.js +1 -0
- package/dist/chunk-ZX5OIIJX.js.map +1 -0
- package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +2 -2
- package/dist/flows/ContractAmendment/hooks.d.ts +1 -1
- package/dist/flows/ContractAmendment/hooks.js +1 -1
- package/dist/flows/ContractAmendment/index.d.ts +1 -1
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractAmendment/utils.d.ts +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +20 -2
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
- package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +1 -1
- package/dist/flows/CostCalculator/api.d.ts +1 -1
- package/dist/flows/CostCalculator/api.js +1 -1
- package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
- package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
- package/dist/flows/CostCalculator/context.d.ts +2 -2
- package/dist/flows/CostCalculator/hooks.d.ts +1 -1
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +2 -2
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.d.ts +2 -2
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +2 -2
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +2 -2
- package/dist/flows/Onboarding/api.js +1 -1
- package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
- package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.d.ts +2 -2
- package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +2 -2
- package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
- package/dist/flows/Onboarding/components/ReviewStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/Onboarding/context.d.ts +2 -2
- package/dist/flows/Onboarding/hooks.d.ts +2 -2
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +2 -2
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Onboarding/types.d.ts +1 -1
- package/dist/flows/Onboarding/utils.d.ts +1 -1
- package/dist/flows/Termination/AdditionalDetailsForm.d.ts +1 -1
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.d.ts +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationBack.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationDialogInfoContent/TerminationDialogInfoContent.d.ts +5 -0
- package/dist/flows/Termination/TerminationDialogInfoContent/TerminationDialogInfoContent.js +2 -0
- package/dist/flows/Termination/TerminationDialogInfoContent/TerminationDialogInfoContent.js.map +1 -0
- package/dist/flows/Termination/TerminationFlow.d.ts +2 -2
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +1 -1
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/TerminationSubmit.js +1 -1
- package/dist/flows/Termination/TimeOff.d.ts +1 -1
- package/dist/flows/Termination/TimeOff.js +1 -1
- package/dist/flows/Termination/context.d.ts +2 -2
- package/dist/flows/Termination/hooks.d.ts +4 -3
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +2 -1
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/json-schemas/employeeComunication.d.ts +1 -0
- package/dist/flows/Termination/json-schemas/employeeComunication.js +1 -1
- package/dist/flows/Termination/json-schemas/jsonSchema.d.ts +17 -1
- package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
- package/dist/flows/Termination/json-schemas/schema.js +1 -1
- package/dist/flows/Termination/json-schemas/terminationDetails.d.ts +16 -0
- package/dist/flows/Termination/json-schemas/terminationDetails.js +1 -1
- package/dist/flows/Termination/types.d.ts +1 -1
- package/dist/flows/api.d.ts +23 -0
- package/dist/flows/api.js +2 -0
- package/dist/flows/api.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internals.js +1 -1
- package/dist/internals.js.map +1 -1
- package/dist/{remoteFlows-BdsVZGGF.d.ts → remoteFlows-DZCgZVnE.d.ts} +1 -1
- package/dist/{types.gen-nWJIP4db.d.ts → types.gen-BbxQoQYr.d.ts} +9 -1
- package/package.json +1 -1
- package/dist/chunk-6GMGXSKN.js +0 -2
- package/dist/chunk-FTW6Z4IF.js +0 -2
- package/dist/chunk-FTW6Z4IF.js.map +0 -1
- package/dist/chunk-JODJFARP.js +0 -2
- package/dist/chunk-JODJFARP.js.map +0 -1
- package/dist/chunk-JUJZENG7.js +0 -2
- package/dist/chunk-JUJZENG7.js.map +0 -1
- package/dist/chunk-M22FKNEY.js +0 -1
- package/dist/chunk-NBCZF2FO.js +0 -2
- package/dist/chunk-UWIFE5LJ.js +0 -2
- package/dist/chunk-UWIFE5LJ.js.map +0 -1
- package/dist/chunk-VX2UC3HG.js +0 -2
- package/dist/chunk-VX2UC3HG.js.map +0 -1
- package/dist/chunk-WWANHPT7.js +0 -2
- package/dist/chunk-WWANHPT7.js.map +0 -1
- /package/dist/{chunk-A522V6XF.js.map → chunk-27PK3DVV.js.map} +0 -0
- /package/dist/{chunk-3O2RD3RK.js.map → chunk-2EN2X5NU.js.map} +0 -0
- /package/dist/{chunk-N5I33LIN.js.map → chunk-5ISPIMTZ.js.map} +0 -0
- /package/dist/{chunk-ALYKEN3E.js.map → chunk-5NPHBFW7.js.map} +0 -0
- /package/dist/{chunk-CYKK3LPJ.js.map → chunk-6F66NTNI.js.map} +0 -0
- /package/dist/{chunk-MRMVBBVZ.js.map → chunk-6NIRGHFF.js.map} +0 -0
- /package/dist/{chunk-M22FKNEY.js.map → chunk-6NXC6SLB.js.map} +0 -0
- /package/dist/{chunk-A6EYY3FO.js.map → chunk-73A7SYGH.js.map} +0 -0
- /package/dist/{chunk-MLB2I27G.js.map → chunk-7CHZ25AS.js.map} +0 -0
- /package/dist/{chunk-4R3ITKOA.js.map → chunk-7DKOWSJ3.js.map} +0 -0
- /package/dist/{chunk-OZ63OC3N.js.map → chunk-7EI4E76I.js.map} +0 -0
- /package/dist/{chunk-RZTT3MEP.js.map → chunk-7SR3FCW6.js.map} +0 -0
- /package/dist/{chunk-BFOGH4SF.js.map → chunk-AS6DCKEJ.js.map} +0 -0
- /package/dist/{chunk-6NKUEDYP.js.map → chunk-BE54D4XM.js.map} +0 -0
- /package/dist/{chunk-7P5B6XHM.js.map → chunk-BM3AKYMT.js.map} +0 -0
- /package/dist/{chunk-H4KE45NG.js.map → chunk-BZIVYUMH.js.map} +0 -0
- /package/dist/{chunk-EGQJ7UBR.js.map → chunk-E3QWREZF.js.map} +0 -0
- /package/dist/{chunk-XGEKV3FC.js.map → chunk-FQPU3JBJ.js.map} +0 -0
- /package/dist/{chunk-BF2D5O5H.js.map → chunk-H6NMRBGZ.js.map} +0 -0
- /package/dist/{chunk-A4KEKMEQ.js.map → chunk-H77RIB6S.js.map} +0 -0
- /package/dist/{chunk-PHN4XMPV.js.map → chunk-J7JO4GF4.js.map} +0 -0
- /package/dist/{chunk-6ZPISRAG.js.map → chunk-JIRA6B5O.js.map} +0 -0
- /package/dist/{chunk-56DXHJNR.js.map → chunk-KVNG6CWQ.js.map} +0 -0
- /package/dist/{chunk-7JQPHRUK.js.map → chunk-LUUUPLTW.js.map} +0 -0
- /package/dist/{chunk-4B36XRKA.js.map → chunk-LYF7ISYE.js.map} +0 -0
- /package/dist/{chunk-2VS6B3PC.js.map → chunk-NNM5M4E3.js.map} +0 -0
- /package/dist/{chunk-7C2Z2EE5.js.map → chunk-OD37LQSP.js.map} +0 -0
- /package/dist/{chunk-TLC5WQY2.js.map → chunk-OMECCA6L.js.map} +0 -0
- /package/dist/{chunk-73H6SO2E.js.map → chunk-P5CLILU4.js.map} +0 -0
- /package/dist/{chunk-CEUBVUKV.js.map → chunk-P6JDGCDA.js.map} +0 -0
- /package/dist/{chunk-2RZABLV2.js.map → chunk-PBXZVY22.js.map} +0 -0
- /package/dist/{chunk-ITSQE6EW.js.map → chunk-PHGCCQZ2.js.map} +0 -0
- /package/dist/{chunk-ZOKSYPOP.js.map → chunk-PUSPB4CX.js.map} +0 -0
- /package/dist/{chunk-I2A4EFDY.js.map → chunk-RM3HE733.js.map} +0 -0
- /package/dist/{chunk-GGBEM452.js.map → chunk-TDQVKDQW.js.map} +0 -0
- /package/dist/{chunk-DCRLPAJL.js.map → chunk-TPHCKHYD.js.map} +0 -0
- /package/dist/{chunk-63HVO7J5.js.map → chunk-U4HGV7LP.js.map} +0 -0
- /package/dist/{chunk-6GMGXSKN.js.map → chunk-UH3E6HSQ.js.map} +0 -0
- /package/dist/{chunk-QQ7KPOLK.js.map → chunk-W2PPGQL6.js.map} +0 -0
- /package/dist/{chunk-QXPWESEW.js.map → chunk-XVTAPI3Z.js.map} +0 -0
- /package/dist/{chunk-NCA3UCCX.js.map → chunk-Y373YLLS.js.map} +0 -0
- /package/dist/{chunk-JB55FFG6.js.map → chunk-Y4C57RXK.js.map} +0 -0
- /package/dist/{chunk-V2YORDAL.js.map → chunk-YDNOMXS7.js.map} +0 -0
- /package/dist/{chunk-53NFLDRX.js.map → chunk-Z6M74RQ7.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/form/fields/CheckBoxField.tsx","../src/components/form/fields/DatePickerField.tsx","../src/components/ui/calendar.tsx","../src/components/ui/popover.tsx","../src/components/ui/file-uploader.tsx","../src/components/form/fields/FileUploadField.tsx","../src/components/form/fields/NumberField.tsx","../src/components/form/fields/RadioGroupField.tsx","../src/components/form/fields/SelectField.tsx","../src/components/form/fields/CountryField.tsx","../src/components/ui/multi-select.tsx","../src/components/ui/command.tsx","../src/components/ui/textarea.tsx","../src/components/form/fields/TextAreaField.tsx","../src/components/form/fields/EmailField.tsx","../src/components/form/fields/HiddenField.tsx","../src/components/form/fields/WorkScheduleField.tsx","../node_modules/@hookform/resolvers/src/validateFieldsNatively.ts","../node_modules/@hookform/resolvers/src/toNestErrors.ts","../node_modules/@hookform/resolvers/yup/src/yup.ts","../src/components/form/fields/workScheduleUtils.ts","../src/components/form/fields/MultiSelectField.tsx","../src/components/form/fields/MoneyField.tsx","../src/components/form/fields/baseFields.tsx","../src/components/form/Statement.tsx","../src/components/form/fields/FieldSetField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Checkbox } from '@/src/components/ui/checkbox';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/src/components/ui/form';\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\nimport { Components, JSFField } from '@/src/types/remoteFlows';\nimport { CheckedState } from '@radix-ui/react-checkbox';\nimport {\n ControllerRenderProps,\n FieldValues,\n useFormContext,\n} from 'react-hook-form';\n\nexport type CheckBoxFieldProps = {\n name: string;\n} & Partial<\n JSFField & {\n onChange?: (checked: any, optionId?: string) => void;\n component?: Components['checkbox'];\n }\n>;\n\nexport function CheckBoxField({\n name,\n defaultValue,\n description,\n label,\n onChange,\n multiple,\n options,\n component,\n ...rest\n}: CheckBoxFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n const handleCheckboxChange = (\n optionId: string,\n checked: boolean,\n field: ControllerRenderProps<FieldValues, string>,\n ) => {\n const currentValues = field.value ? [...field.value] : [];\n\n if (checked) {\n // Add the value if it's not already in the array\n if (!currentValues.includes(optionId)) {\n field.onChange([...currentValues, optionId]);\n }\n } else {\n // Remove the value from the array\n field.onChange(currentValues.filter((value) => value !== optionId));\n }\n };\n\n return (\n <FormField\n control={control}\n name={name}\n defaultValue={defaultValue}\n render={({ field, fieldState }) => {\n const CustomCheckboxField = component || components?.checkbox;\n if (CustomCheckboxField) {\n const customCheckboxFieldProps = {\n name,\n description,\n label,\n defaultValue,\n multiple,\n options,\n ...rest,\n };\n return (\n <CustomCheckboxField\n field={{\n ...field,\n onChange: (evt: any) => {\n if (multiple) {\n const { checked, value } = evt.target;\n handleCheckboxChange(value, checked, field);\n onChange?.(checked);\n return;\n }\n field.onChange(evt);\n onChange?.(evt);\n },\n }}\n fieldState={fieldState}\n fieldData={customCheckboxFieldProps}\n />\n );\n }\n return (\n <FormItem\n data-field={name}\n className={cn(`RemoteFlows__CheckBoxField__Item__${name}`)}\n >\n <FormControl>\n <>\n {options && multiple ? <FormLabel>{label}</FormLabel> : null}\n\n {options && multiple ? (\n options.map((option) => (\n <div key={option.value} className='flex space-x-2'>\n <Checkbox\n id={option.value}\n onCheckedChange={(checked: CheckedState) => {\n handleCheckboxChange(\n option.value,\n checked === true,\n field,\n );\n onChange?.(checked, option.value);\n }}\n checked={field.value?.includes(option.value)}\n className='RemoteFlows__CheckBox__Input'\n />\n <FormLabel\n htmlFor={option.value}\n className='mb-0 RemoteFlows__CheckBox__Label'\n >\n {option.label}\n </FormLabel>\n </div>\n ))\n ) : (\n <div className='flex space-x-2'>\n <Checkbox\n id={name}\n onCheckedChange={(event: CheckedState) => {\n field.onChange(event);\n onChange?.(event);\n }}\n checked={field.value}\n className='RemoteFlows__CheckBox__Input'\n />\n <FormLabel\n htmlFor={name}\n className='mb-0 RemoteFlows__CheckBox__Label'\n >\n {label}\n </FormLabel>\n </div>\n )}\n </>\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { CalendarIcon } from 'lucide-react';\nimport { useFormContext } from 'react-hook-form';\nimport { PopoverClose } from '@radix-ui/react-popover';\n\nimport { Button } from '@/src/components/ui/button';\nimport { Calendar } from '@/src/components/ui/calendar';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/src/components/ui/form';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/src/components/ui/popover';\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\nimport { Components, JSFField } from '@/src/types/remoteFlows';\nimport { getMinStartDate } from '@/src/components/form/utils';\nimport { format } from 'date-fns';\n\nexport type DatePickerFieldProps = JSFField & {\n onChange?: (value: any) => void;\n component?: Components['date'];\n};\n\nexport function DatePickerField({\n description,\n label,\n name,\n minDate,\n onChange,\n component,\n ...rest\n}: DatePickerFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n let minDateValue: Date;\n if (rest.meta?.mot && typeof rest.meta.mot === 'number') {\n minDateValue = getMinStartDate(rest.meta.mot);\n } else if (minDate) {\n minDateValue = new Date(minDate);\n }\n\n return (\n <FormField\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n const CustomDatePickerField = component || components?.date;\n\n if (CustomDatePickerField) {\n const customDatePickerFieldProps = {\n description,\n label,\n name,\n onChange,\n ...(minDateValue && { minDate: minDateValue.toISOString() }),\n ...rest,\n };\n return (\n <CustomDatePickerField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customDatePickerFieldProps}\n />\n );\n }\n return (\n <FormItem\n data-field={name}\n className={`flex flex-col RemoteFlows__DatePickerField__Item__${name}`}\n >\n <FormLabel className='RemoteFlows__DatePickerField__Label'>\n {label}\n </FormLabel>\n <Popover>\n <PopoverTrigger asChild>\n <FormControl>\n <div>\n <Button\n type='button'\n variant={'outline'}\n className={cn(\n 'w-full pl-3 text-left font-normal',\n !field.value && 'text-muted-foreground',\n )}\n data-testid={`date-picker-button-${name}`}\n >\n {field.value && <>{format(field.value, 'yyyy-MM-dd')}</>}\n <CalendarIcon className='ml-auto h-4 w-4 opacity-50' />\n </Button>\n </div>\n </FormControl>\n </PopoverTrigger>\n <PopoverContent\n className={`w-auto p-0 RemoteFlows__DatepickerField__PopoverContent`}\n align='start'\n >\n <Calendar\n mode='single'\n className='RemoteFlows__DatepickerField__Calendar'\n selected={field.value ? new Date(field.value) : undefined}\n onSelect={(date) => {\n field.onChange(date ? format(date, 'yyyy-MM-dd') : null);\n onChange?.(date);\n }}\n defaultMonth={minDateValue}\n components={{\n DayContent: (props) => {\n return (\n <PopoverClose>{props.date.getDate()}</PopoverClose>\n );\n },\n }}\n {...(minDateValue && {\n disabled: (date: Date) => date < minDateValue,\n })}\n />\n </PopoverContent>\n </Popover>\n {description ? (\n <FormDescription>{description}</FormDescription>\n ) : null}\n {fieldState.error && (\n <FormMessage className='RemoteFlows__DatePickerField__Error' />\n )}\n </FormItem>\n );\n }}\n />\n );\n}\n","import * as React from 'react';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { DayPicker } from 'react-day-picker';\n\nimport { cn } from '@/src/lib/utils';\nimport { buttonVariants } from '@/src/components/ui/button';\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: React.ComponentProps<typeof DayPicker>) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn('p-3', className)}\n classNames={{\n months: 'flex flex-col sm:flex-row gap-2',\n month: 'flex flex-col gap-4',\n caption: 'flex justify-center pt-1 relative items-center w-full',\n caption_label: 'text-sm font-medium',\n nav: 'flex items-center gap-1',\n nav_button: cn(\n buttonVariants({ variant: 'outline' }),\n 'size-7 bg-transparent p-0 opacity-50 hover:opacity-100',\n ),\n nav_button_previous: 'absolute left-1',\n nav_button_next: 'absolute right-1',\n table: 'w-full border-collapse space-x-1',\n head_row: 'flex',\n head_cell:\n 'text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]',\n row: 'flex w-full mt-2',\n cell: cn(\n '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 props.mode === 'range'\n ? '[&: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'\n : '[&:has([aria-selected])]:rounded-md',\n ),\n day: cn(\n buttonVariants({ variant: 'ghost' }),\n 'size-8 p-0 font-normal aria-selected:opacity-100',\n ),\n day_range_start:\n 'day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground',\n day_range_end:\n 'day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground',\n day_selected:\n 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n day_today: 'bg-accent text-accent-foreground',\n day_outside:\n 'day-outside text-muted-foreground aria-selected:text-muted-foreground',\n day_disabled: 'text-muted-foreground opacity-50',\n day_range_middle:\n 'aria-selected:bg-accent aria-selected:text-accent-foreground',\n day_hidden: 'invisible',\n ...classNames,\n }}\n components={{\n IconLeft: ({ className, ...props }) => (\n <ChevronLeft className={cn('size-4', className)} {...props} />\n ),\n IconRight: ({ className, ...props }) => (\n <ChevronRight className={cn('size-4', className)} {...props} />\n ),\n }}\n {...props}\n />\n );\n}\n\nexport { Calendar };\n","import * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { cn } from '@/src/lib/utils';\n\nfunction Popover({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot='popover' {...props} />;\n}\n\nfunction PopoverTrigger({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot='popover-trigger' {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = 'center',\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot='popover-content'\n align={align}\n sideOffset={sideOffset}\n className={cn(\n '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',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverAnchor({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot='popover-anchor' {...props} />;\n}\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };\n","import React, { useState, useRef } from 'react';\nimport { Button } from '@/src/components/ui/button';\nimport { Upload, X } from 'lucide-react';\nimport { cn } from '@/src/lib/utils';\n\ntype FileUploaderProps = {\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n className?: string;\n multiple?: boolean;\n};\n\nexport function FileUploader({\n onChange,\n className,\n multiple,\n}: FileUploaderProps) {\n const [files, setFiles] = useState<File[]>([]);\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n inputRef.current?.click();\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (e.target.files && e.target.files.length > 0) {\n const newFiles = Array.from(e.target.files);\n\n setFiles(newFiles);\n onChange(e);\n }\n };\n\n const onRemoveFile = (file: File) => {\n setFiles((prevFiles) => prevFiles.filter((f) => f !== file));\n };\n\n return (\n <div className={cn('flex flex-col items-start gap-4', className)}>\n <input\n type='file'\n ref={inputRef}\n onChange={handleChange}\n className='hidden'\n aria-label='File upload'\n multiple={multiple}\n />\n <Button type='button' onClick={handleClick} className='gap-2'>\n <Upload className='h-4 w-4' />\n Choose File\n </Button>\n {files.length === 0 && (\n <div className='text-sm'>\n {!multiple ? (\n <span className='font-medium'>No file selected.</span>\n ) : (\n <span className='font-medium'>\n No files selected. You can select multiple files\n </span>\n )}\n </div>\n )}\n {files.length > 0 &&\n files.map((file, index) => (\n <div key={index} className='text-sm flex items-center gap-2'>\n Selected file: <span className='font-medium'>{file.name}</span> (\n {Math.round(file.size / 1024)} KB)\n <Button variant='ghost' onClick={() => onRemoveFile(file)}>\n <X />\n </Button>\n </div>\n ))}\n </div>\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\n\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\nimport { Components, JSFField } from '@/src/types/remoteFlows';\nimport { useFormContext } from 'react-hook-form';\nimport { FileUploader } from '../../ui/file-uploader';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '../../ui/form';\n\nconst toBase64 = (file: File): Promise<string> => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = (error) => reject(error);\n });\n};\n\nconst convertFilesToBase64 = async (\n event: React.ChangeEvent<HTMLInputElement>,\n) => {\n const files = event.target.files ? Array.from(event.target.files) : [];\n\n const base64Files = await Promise.all(\n files.map(async (file) => {\n const base64 = await toBase64(file);\n return {\n name: file.name,\n content: base64.split(',')[1],\n };\n }),\n );\n return base64Files;\n};\n\nexport type FileUploadFieldProps = JSFField & {\n onChange?: (value: any) => void;\n multiple?: boolean;\n component?: Components['file'];\n};\n\nexport function FileUploadField({\n name,\n description,\n label,\n multiple,\n onChange,\n component,\n ...rest\n}: FileUploadFieldProps) {\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 CustomFileUploadField = component || components?.file;\n if (CustomFileUploadField) {\n const customFileUploadFieldProps = {\n name,\n description,\n label,\n multiple,\n ...rest,\n };\n return (\n <CustomFileUploadField\n field={{\n ...field,\n value: null,\n onChange: async (value: any) => {\n const files = await convertFilesToBase64(value);\n field.onChange(files);\n onChange?.(files);\n },\n }}\n fieldState={fieldState}\n fieldData={customFileUploadFieldProps}\n />\n );\n }\n return (\n <FormItem\n data-field={name}\n className={`RemoteFlows__FileUpload__Item__${name}`}\n >\n <FormLabel className='RemoteFlows__FileUpload__Label'>\n {label}\n </FormLabel>\n <FormControl>\n <FileUploader\n onChange={async (\n event: React.ChangeEvent<HTMLInputElement>,\n ) => {\n const files = await convertFilesToBase64(event);\n field.onChange(files);\n onChange?.(files);\n }}\n multiple={multiple}\n className={cn('RemoteFlows__FileUpload__Input')}\n />\n </FormControl>\n {description && (\n <div className='flex items-center justify-between'>\n <FormDescription className='RemoteFlows__FileUpload__Description'>\n {description}\n </FormDescription>\n </div>\n )}\n {fieldState.error && (\n <FormMessage className='RemoteFlows__FileUpload__Error' />\n )}\n </FormItem>\n );\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useFormFields } from '@/src/context';\nimport { useFormContext } from 'react-hook-form';\nimport { FormField } from '../../ui/form';\nimport { TextField, TextFieldProps } from './TextField';\nimport { Components } from '@/src/types/remoteFlows';\n\nexport type NumberFieldProps = TextFieldProps & {\n component?: Components['number'];\n};\n\nexport function NumberField(props: NumberFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n const CustomNumberField = props.component || components?.number;\n\n if (CustomNumberField) {\n return (\n <FormField\n control={control}\n name={props.name}\n render={({ field, fieldState }) => {\n return (\n <CustomNumberField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n props.onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={props}\n />\n );\n }}\n />\n );\n }\n\n return (\n <TextField {...props} type='text' inputMode='decimal' pattern='^[0-9.]*$' />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Fragment } from 'react';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/src/components/ui/form';\nimport { RadioGroup, RadioGroupItem } from '@/src/components/ui/radio-group';\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\nimport { Components, JSFField } from '@/src/types/remoteFlows';\nimport { useFormContext } from 'react-hook-form';\n\ntype RadioGroupFieldProps = JSFField & {\n onChange?: (value: any) => void;\n component?: Components['radio'];\n};\n\nexport function RadioGroupField({\n name,\n defaultValue,\n description,\n label,\n options,\n onChange,\n component,\n ...rest\n}: RadioGroupFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n return (\n <FormField\n control={control}\n name={name}\n defaultValue={defaultValue}\n render={({ field, fieldState }) => {\n const CustomRadioGroupField = component || components?.radio;\n if (CustomRadioGroupField) {\n const customRadioGroupFieldProps = {\n name,\n defaultValue,\n description,\n label,\n options,\n ...rest,\n };\n return (\n <CustomRadioGroupField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customRadioGroupFieldProps}\n />\n );\n }\n\n return (\n <FormItem\n className={cn(\n 'space-y-3',\n `RemoteFlows__RadioGroupField__Item__${name}`,\n )}\n data-field={name}\n >\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <RadioGroup\n aria-label={label || name}\n onValueChange={(value: string) => {\n field.onChange(value);\n onChange?.(value);\n }}\n value={field.value}\n className='flex flex-col space-y-3'\n >\n {options?.map((option) => (\n <Fragment key={option.value}>\n <FormItem\n data-field={name}\n className='flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item'\n >\n <FormControl>\n <RadioGroupItem\n value={option.value}\n className='RemoteFlows__RadioField__Input'\n disabled={option.disabled}\n />\n </FormControl>\n <div>\n <FormLabel className='font-normal mb-0 RemoteFlows__RadioField__Label'>\n {option.label}\n </FormLabel>\n {option.description && (\n <FormDescription className='mt-2'>\n {option.description}\n </FormDescription>\n )}\n </div>\n </FormItem>\n </Fragment>\n ))}\n </RadioGroup>\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@/src/components/ui/select';\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';\n\ntype SelectFieldProps = JSFField & {\n placeholder?: string;\n options: Array<{ value: string | number; label: string }>;\n className?: string;\n onChange?: (value: any) => void;\n component?: Components['select'];\n};\n\nexport function SelectField({\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n component,\n ...rest\n}: SelectFieldProps) {\n const { control } = useFormContext();\n const { components } = useFormFields();\n\n return (\n <FormField\n defaultValue={defaultValue}\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n const CustomSelectField = component || components?.select;\n if (CustomSelectField) {\n const customSelectFieldProps = {\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n ...rest,\n };\n return (\n <CustomSelectField\n field={{\n ...field,\n onChange: (value: string | number) => {\n const maybeCastValue =\n rest.jsonType === 'number' ? Number(value) : value;\n field.onChange(maybeCastValue);\n onChange?.(maybeCastValue);\n },\n }}\n fieldState={fieldState}\n fieldData={customSelectFieldProps}\n />\n );\n }\n\n return (\n <FormItem\n data-field={name}\n className={`RemoteFlows__SelectField__Item__${name}`}\n >\n <FormLabel className='RemoteFlows__SelectField__Label'>\n {label}\n </FormLabel>\n <FormControl>\n <div className='relative'>\n <Select\n value={field.value || ''}\n onValueChange={(value: string) => {\n // For some reason react-hook-form converts option values from numbers to strings.\n // If a value can be cast to a number, the field in the form state should use the numeric type instead.\n const maybeCastValue =\n rest.jsonType === 'number' ? Number(value) : value;\n field.onChange(maybeCastValue);\n onChange?.(maybeCastValue);\n }}\n >\n <SelectTrigger\n className='RemoteFlows__SelectField__Trigger'\n aria-invalid={Boolean(fieldState.error)}\n aria-label={label}\n >\n <span className='absolute'>\n <SelectValue placeholder={label} />\n </span>\n </SelectTrigger>\n <SelectContent className='RemoteFlows__SelectField__Content'>\n <SelectGroup className='RemoteFlows__SelectField__Group'>\n {options.map((option) => (\n <SelectItem\n key={option.value}\n value={option.value}\n className='RemoteFlows__SelectField__SelectItem'\n >\n {option.label}\n </SelectItem>\n ))}\n </SelectGroup>\n </SelectContent>\n </Select>\n </div>\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useState } 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 { MultiSelect } from '../../ui/multi-select';\n\ntype CountryFieldProps = JSFField & {\n options: Array<{ value: string; label: string }>;\n onChange?: (value: any) => void;\n $meta: {\n regions: Record<string, string[]>;\n subregions: Record<string, string[]>;\n };\n component?: Components['countries'];\n};\n\nexport function CountryField({\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n $meta,\n component,\n ...rest\n}: CountryFieldProps) {\n const { control } = useFormContext();\n const { components } = useFormFields();\n const [selected, setSelected] = useState<any[]>([]);\n\n return (\n <FormField\n defaultValue={defaultValue}\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n const CustomSelectField = component || components?.countries;\n\n if (CustomSelectField) {\n const customSelectFieldProps = {\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n $meta,\n ...rest,\n };\n return (\n <CustomSelectField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customSelectFieldProps}\n />\n );\n }\n\n const countryOptions = [\n ...Object.entries($meta?.regions || {}).map(([key, value]) => ({\n value,\n label: key,\n category: 'Regions',\n })),\n ...Object.entries($meta?.subregions || {}).map(([key, value]) => ({\n value,\n label: key,\n category: 'Subregions',\n })),\n ...options.map((option) => ({\n ...option,\n value: option.value,\n label: option.label,\n category: 'Countries',\n })),\n ];\n\n const handleChange = (rawValues: any[]) => {\n const values = rawValues.map(({ value }) => value);\n field.onChange(values);\n onChange?.(values);\n setSelected(rawValues);\n };\n\n return (\n <FormItem\n data-field={name}\n className={`RemoteFlows__CountryField__Item__${name}`}\n >\n <FormLabel className='RemoteFlows__CountryField__Label'>\n {label}\n </FormLabel>\n <FormControl>\n <MultiSelect\n options={countryOptions}\n selected={selected}\n onChange={handleChange}\n {...rest}\n />\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","import { Fragment, useState } from 'react';\nimport { Check, ChevronDownIcon, X } from 'lucide-react';\n\nimport { Button } from '@/src/components/ui/button';\nimport { Badge } from '@/src/components/ui/badge';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandList,\n CommandSeparator,\n} from '@/src/components/ui/command';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/src/components/ui/popover';\nimport { cn } from '@/src/lib/utils';\n\nexport type Option = {\n label: string;\n value: string | string[];\n category?: string;\n};\n\ninterface MultiSelectProps {\n options: Option[];\n selected: Option[];\n onChange: (options: Option[]) => void;\n placeholder?: string;\n}\n\nexport function MultiSelect({\n options,\n selected,\n onChange,\n placeholder,\n ...props\n}: MultiSelectProps) {\n const [open, setOpen] = useState(false);\n const handleUnselect = (option: Option) => {\n onChange(selected.filter((item) => item.value !== option.value));\n };\n\n const hasCategories = options.some((option) => option.category);\n\n const groupedOptions = options.reduce(\n (groups, option) => {\n const category = option.category || 'Uncategorized';\n if (!groups[category]) {\n groups[category] = [];\n }\n groups[category].push(option);\n return groups;\n },\n {} as Record<string, Option[]>,\n );\n\n return (\n <Popover open={open} onOpenChange={setOpen} {...props}>\n <PopoverTrigger>\n <Button\n variant='outline'\n role='combobox'\n aria-expanded={open}\n className='w-full justify-between font-normal'\n type='button'\n >\n <div className='flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center'>\n {selected.length > 0 ? (\n selected.map((option) => {\n return (\n <Badge\n key={option.label}\n variant='secondary'\n className='mr-1 mb-1'\n >\n {option.label}\n <div\n role='button'\n tabIndex={0}\n aria-label={`remove ${option.label}`}\n className='ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer'\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n handleUnselect(option);\n }\n }}\n onMouseDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n onClick={() => handleUnselect(option)}\n >\n <X className='h-3 w-3 text-muted-foreground hover:text-foreground' />\n </div>\n </Badge>\n );\n })\n ) : (\n <span className='text-foreground'>{placeholder}</span>\n )}\n </div>\n <ChevronDownIcon className='size-4' />\n </Button>\n </PopoverTrigger>\n <PopoverContent align='start' className='w-full p-0'>\n <Command>\n <CommandList>\n <CommandEmpty>No item found.</CommandEmpty>\n {Object.entries(groupedOptions).map(\n ([category, categoryOptions], index) => (\n <Fragment key={category}>\n {index > 0 && <CommandSeparator />}\n <CommandGroup heading={hasCategories ? category : undefined}>\n {categoryOptions.map((option) => {\n const isSelected = selected.some(\n (item) => item.value === option.value,\n );\n return (\n <CommandItem\n key={option.label}\n onSelect={() => {\n onChange(\n isSelected\n ? selected.filter(\n (item) => item.value !== option.value,\n )\n : [...selected, option],\n );\n }}\n >\n <Check\n className={cn(\n 'mr-2 h-4 w-4',\n isSelected ? 'opacity-100' : 'opacity-0',\n )}\n />\n {option.label}\n </CommandItem>\n );\n })}\n </CommandGroup>\n </Fragment>\n ),\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n}\n","import * as React from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { SearchIcon } from 'lucide-react';\n\nimport { cn } from '@/src/lib/utils';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '@/src/components/ui/dialog';\n\nfunction Command({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot='command'\n className={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandDialog({\n title = 'Command Palette',\n description = 'Search for a command to run...',\n children,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string;\n description?: string;\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className='sr-only'>\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent className='overflow-hidden p-0'>\n <Command className='[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5'>\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction CommandInput({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div\n data-slot='command-input-wrapper'\n className='flex h-9 items-center gap-2 border-b px-3'\n >\n <SearchIcon className='size-4 shrink-0 opacity-50' />\n <CommandPrimitive.Input\n data-slot='command-input'\n className={cn(\n 'placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CommandList({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot='command-list'\n className={cn(\n 'max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot='command-empty'\n className='py-6 text-center text-sm'\n {...props}\n />\n );\n}\n\nfunction CommandGroup({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot='command-group'\n className={cn(\n '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',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot='command-separator'\n className={cn('bg-border -mx-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot='command-item'\n className={cn(\n \"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\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandShortcut({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot='command-shortcut'\n className={cn(\n 'text-muted-foreground ml-auto text-xs tracking-widest',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","import * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\nconst Textarea = React.forwardRef<\n HTMLTextAreaElement,\n React.ComponentProps<'textarea'>\n>(({ className, ...props }, ref) => {\n return (\n <textarea\n className={cn(\n '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',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n});\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\n\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\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 { Textarea } from '../../ui/textarea';\n\nexport type TextAreaFieldProps = JSFField & {\n onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n maxLength?: number;\n component?: Components['textarea'];\n};\n\nexport function TextAreaField({\n name,\n description,\n label,\n onChange,\n maxLength,\n component,\n ...rest\n}: TextAreaFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n return (\n <FormField\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n const CustomTextAreaField = component || components?.textarea;\n if (CustomTextAreaField) {\n const customTextAreaFieldProps = {\n name,\n description,\n label,\n maxLength,\n ...rest,\n };\n return (\n <CustomTextAreaField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customTextAreaFieldProps}\n />\n );\n }\n\n const valueLength = field.value?.length ?? 0;\n return (\n <FormItem\n data-field={name}\n className={`RemoteFlows__TextArea__Item__${name}`}\n >\n <FormLabel className='RemoteFlows__TextArea__Label'>\n {label}\n </FormLabel>\n <FormControl>\n <Textarea\n {...field}\n value={field.value ?? ''}\n onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) => {\n field.onChange(event);\n onChange?.(event);\n }}\n className={cn(\n fieldState.error &&\n 'border-red-500 focus-visible:ring-red-500',\n 'RemoteFlows__TextArea__Input',\n )}\n placeholder={label}\n />\n </FormControl>\n {(description || maxLength) && (\n <div className='flex items-center justify-between'>\n {description && (\n <FormDescription className='RemoteFlows__TextArea__Description'>\n {description}\n </FormDescription>\n )}\n {maxLength && (\n <span className='text-sm ml-auto RemoteFlows__TextArea__MaxLength'>\n {valueLength}/{maxLength}\n </span>\n )}\n </div>\n )}\n {fieldState.error && (\n <FormMessage className='RemoteFlows__TextArea__Error' />\n )}\n </FormItem>\n );\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useFormFields } from '@/src/context';\nimport { useFormContext } from 'react-hook-form';\nimport { FormField } from '../../ui/form';\nimport { TextField, TextFieldProps } from './TextField';\nimport { Components } from '@/src/types/remoteFlows';\n\ntype EmailFieldProps = TextFieldProps & {\n component?: Components['email'];\n};\n\nexport function EmailField(props: EmailFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n const CustomEmailField = props.component || components?.email;\n\n if (CustomEmailField) {\n return (\n <FormField\n control={control}\n name={props.name}\n render={({ field, fieldState }) => {\n return (\n <CustomEmailField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n props.onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={props}\n />\n );\n }}\n />\n );\n }\n\n return <TextField {...props} type='email' />;\n}\n","import { useFormContext } from 'react-hook-form';\nimport { FormField } from '../../ui/form';\nimport { Field } from '@/src/flows/types';\n\nexport function HiddenField(props: Field) {\n const { control } = useFormContext();\n\n return (\n <FormField\n control={control}\n name={props.name}\n render={({ field }) => {\n return <input {...field} type='hidden' />;\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState } from 'react';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport { useForm, useFormContext, useFieldArray } from 'react-hook-form';\nimport * as yup from 'yup';\n\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { useFormFields } from '@/src/context';\nimport { Form, FormField } from '@/src/components/ui/form';\nimport { Components } from '@/src/types/remoteFlows';\nimport { Button } from '@/src/components/ui/button';\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from '@/src/components/ui/dialog';\n\nimport {\n buildWorkScheduleSummary,\n calculateHours,\n calculateTotalWorkHours,\n DailySchedule,\n DAYS_OF_THE_WEEK,\n getShortWeekday,\n} from './workScheduleUtils';\nimport { CheckBoxField } from './CheckBoxField';\nimport { TextField } from './TextField';\n\ntype WorkScheduleFieldProps = JSFField & {\n name: string;\n default: DailySchedule[];\n onChange?: (value: any) => void;\n component?: Components['work-schedule'];\n};\n\ntype WorkScheduleFormData = {\n schedule: DailySchedule[];\n};\n\ntype WorkScheduleSelectionProps = {\n defaultSchedule: DailySchedule[];\n onSubmit: (data: WorkScheduleFormData['schedule']) => void;\n};\n\nconst fieldSchema = yup.object({\n day: yup.string().required(),\n checked: yup.boolean().required(),\n start_time: yup\n .string()\n .matches(/^([01]\\d|2[0-3]):([0-5]\\d)$/, 'Invalid time format (HH:mm)')\n .when('checked', {\n is: true,\n then: (schema) => schema.required('Required'),\n otherwise: (schema) => schema.optional().nullable(),\n }),\n end_time: yup\n .string()\n .matches(/^([01]\\d|2[0-3]):([0-5]\\d)$/, 'Invalid time format (HH:mm)')\n .when('checked', {\n is: true,\n then: (schema) => schema.required('Required'),\n otherwise: (schema) => schema.optional().nullable(),\n }),\n hours: yup.number().default(0),\n break_duration_minutes: yup.string().default('0'),\n});\n\nconst formSchema = yup.object({\n schedule: yup.array(fieldSchema),\n});\n\nfunction WorkScheduleSelectionForm({\n defaultSchedule,\n onSubmit,\n}: WorkScheduleSelectionProps) {\n const [openDialog, setOpenDialog] = useState(false);\n\n const transformedSchedule = DAYS_OF_THE_WEEK.map((day) => {\n const existingSchedule = defaultSchedule.find(\n (schedule) =>\n schedule.day.toLowerCase() === getShortWeekday(day).toLowerCase() ||\n schedule.day.toLowerCase() === day.toLowerCase(),\n );\n\n if (existingSchedule) {\n return {\n ...existingSchedule,\n day: getShortWeekday(day),\n checked: true,\n };\n }\n\n return {\n // We just need to override the day and checked. The rest of the fields are the same for every day.\n ...defaultSchedule[0],\n checked: false,\n day: getShortWeekday(day),\n };\n });\n\n const form = useForm<WorkScheduleFormData>({\n defaultValues: {\n schedule: transformedSchedule,\n },\n resolver: yupResolver(formSchema) as any,\n });\n\n const { handleSubmit, watch, reset, control, formState } = form;\n\n const { fields } = useFieldArray({\n name: 'schedule',\n control,\n });\n\n const watchedSchedule = watch('schedule');\n\n function handleSubmitWorkingHours(data: WorkScheduleFormData) {\n // We can only send the days that are checked.\n const schedule = data.schedule\n .filter(({ checked }) => checked)\n .map((day) => ({\n ...day,\n hours: calculateHours(day),\n }));\n\n onSubmit(schedule);\n setOpenDialog(false);\n }\n\n function handleCancel() {\n reset();\n setOpenDialog(false);\n }\n\n return (\n <div className='flex items-center justify-between'>\n <Dialog open={openDialog} onOpenChange={setOpenDialog}>\n <DialogTrigger asChild>\n <Button\n variant={'link'}\n className='flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger'\n >\n Edit Schedule\n </Button>\n </DialogTrigger>\n <DialogContent className='max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content'>\n <DialogHeader>\n <DialogTitle className='RemoteFlows__WorkScheduleSelectionForm__Title'>\n Edit employee working hours\n </DialogTitle>\n </DialogHeader>\n\n <Form {...form}>\n <form className='space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form'>\n <div className='rounded-lg'>\n <p className='text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description'>\n The times displayed are in the employee's time zone in the\n 24-hour format.\n </p>\n\n <div className='grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header'>\n <div className='col-span-2'></div>\n <div className='col-span-3 text-center'>START</div>\n <div className='col-span-1 text-center'></div>\n <div className='col-span-3 text-center'>END</div>\n <div className='col-span-2 text-center'>HOURS</div>\n {/* <div className=\"col-span-2 text-center\">ACTIONS</div> */}\n </div>\n\n <div className='RemoteFlows__WorkScheduleSelectionForm__Rows'>\n {fields.map((field, index) => {\n const currentDay = watchedSchedule[index];\n const calculatedHours = calculateHours(currentDay);\n\n return (\n <React.Fragment key={field.id}>\n <div className='grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours'>\n <div className='col-span-2 flex items-center gap-3'>\n <CheckBoxField\n label={field.day}\n name={`schedule.${index}.checked`}\n />\n </div>\n <div className='col-span-3'>\n <TextField\n name={`schedule.${index}.start_time`}\n includeErrorMessage={false}\n />\n </div>\n <div className='col-span-1 text-center text-gray-500'>\n to\n </div>\n <div className='col-span-3'>\n <TextField\n name={`schedule.${index}.end_time`}\n includeErrorMessage={false}\n />\n </div>\n <div className='col-span-2 text-center text-gray-600'>\n {isNaN(calculatedHours)\n ? '-'\n : `${calculatedHours} hours`}\n </div>\n </div>\n\n <div className='grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break'>\n <div className='col-span-2 text-gray-500'>Break</div>\n <div className='col-span-2'>\n <TextField\n name={`schedule.${index}.break_duration_minutes`}\n includeErrorMessage={false}\n />\n </div>\n <div className='col-span-2 text-gray-500'>\n minutes\n </div>\n <div className='col-span-4'></div>\n </div>\n </React.Fragment>\n );\n })}\n </div>\n </div>\n\n {Object.keys(formState.errors).length > 0 && (\n <p className='text-destructive text-sm mb-0'>\n Invalid time format (HH:mm)\n </p>\n )}\n\n <div className='flex gap-4 pt-4'>\n <Button\n type='button'\n className='reset-button'\n variant='outline'\n onClick={handleCancel}\n >\n Cancel\n </Button>\n <Button\n type='button'\n className='submit-button'\n onClick={handleSubmit(handleSubmitWorkingHours)}\n >\n Save Schedule\n </Button>\n </div>\n </form>\n </Form>\n </DialogContent>\n </Dialog>\n </div>\n );\n}\n\nexport function WorkScheduleField(props: WorkScheduleFieldProps) {\n const { components } = useFormFields();\n const { setValue, control, watch } = useFormContext();\n const watchedSchedule = watch(props.name);\n const [currentSchedule, setCurrentSchedule] =\n useState<DailySchedule[]>(watchedSchedule);\n\n const { workHoursSummary, breakSummary } =\n buildWorkScheduleSummary(currentSchedule);\n const totalWorkHours = calculateTotalWorkHours(currentSchedule);\n\n useEffect(() => {\n setValue(props.name, currentSchedule);\n }, [currentSchedule, props.name, setValue]);\n\n function onSubmit(data: WorkScheduleFormData['schedule']) {\n setCurrentSchedule(data);\n }\n\n const CustomWorkScheduleField =\n props.component || components?.['work-schedule'];\n\n if (CustomWorkScheduleField) {\n return (\n <FormField\n control={control}\n name={props.name}\n render={({ field, fieldState }) => {\n return (\n <CustomWorkScheduleField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n props.onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={{\n ...props,\n // @ts-expect-error - defaultFormattedValue is not part of fieldData. It's generated in this component.\n defaultFormattedValue: {\n workHoursSummary,\n breakSummary,\n totalWorkHours,\n },\n }}\n />\n );\n }}\n />\n );\n }\n\n return (\n <div className={`flex flex-col gap-3 RemoteFlows__WorkScheduleField`}>\n <p className={`text-sm RemoteFlows__WorkScheduleField__Title`}>\n Work hours\n </p>\n <div className='flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary'>\n <p\n className='text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours'\n dangerouslySetInnerHTML={{\n __html: workHoursSummary.join(', '),\n }}\n />\n\n <p className='text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break'>\n {breakSummary.join()}\n </p>\n <p className='text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total'>\n Total of <span>{totalWorkHours}</span> hours per week\n </p>\n <WorkScheduleSelectionForm\n defaultSchedule={currentSchedule}\n onSubmit={onSubmit}\n />\n </div>\n </div>\n );\n}\n","import {\n FieldError,\n FieldErrors,\n FieldValues,\n Ref,\n ResolverOptions,\n get,\n} from 'react-hook-form';\n\nconst setCustomValidity = (\n ref: Ref,\n fieldPath: string,\n errors: FieldErrors,\n) => {\n if (ref && 'reportValidity' in ref) {\n const error = get(errors, fieldPath) as FieldError | undefined;\n ref.setCustomValidity((error && error.message) || '');\n\n ref.reportValidity();\n }\n};\n\n// Native validation (web only)\nexport const validateFieldsNatively = <TFieldValues extends FieldValues>(\n errors: FieldErrors,\n options: ResolverOptions<TFieldValues>,\n): void => {\n for (const fieldPath in options.fields) {\n const field = options.fields[fieldPath];\n if (field && field.ref && 'reportValidity' in field.ref) {\n setCustomValidity(field.ref, fieldPath, errors);\n } else if (field && field.refs) {\n field.refs.forEach((ref: HTMLInputElement) =>\n setCustomValidity(ref, fieldPath, errors),\n );\n }\n }\n};\n","import {\n Field,\n FieldErrors,\n FieldValues,\n InternalFieldName,\n ResolverOptions,\n get,\n set,\n} from 'react-hook-form';\nimport { validateFieldsNatively } from './validateFieldsNatively';\n\nexport const toNestErrors = <TFieldValues extends FieldValues>(\n errors: FieldErrors,\n options: ResolverOptions<TFieldValues>,\n): FieldErrors<TFieldValues> => {\n options.shouldUseNativeValidation && validateFieldsNatively(errors, options);\n\n const fieldErrors = {} as FieldErrors<TFieldValues>;\n for (const path in errors) {\n const field = get(options.fields, path) as Field['_f'] | undefined;\n const error = Object.assign(errors[path] || {}, {\n ref: field && field.ref,\n });\n\n if (isNameInFieldArray(options.names || Object.keys(errors), path)) {\n const fieldArrayErrors = Object.assign({}, get(fieldErrors, path));\n\n set(fieldArrayErrors, 'root', error);\n set(fieldErrors, path, fieldArrayErrors);\n } else {\n set(fieldErrors, path, error);\n }\n }\n\n return fieldErrors;\n};\n\nconst isNameInFieldArray = (\n names: InternalFieldName[],\n name: InternalFieldName,\n) => {\n const path = escapeBrackets(name);\n return names.some((n) => escapeBrackets(n).match(`^${path}\\\\.\\\\d+`));\n};\n\n/**\n * Escapes special characters in a string to be used in a regex pattern.\n * it removes the brackets from the string to match the `set` method.\n *\n * @param input - The input string to escape.\n * @returns The escaped string.\n */\nfunction escapeBrackets(input: string): string {\n return input.replace(/\\]|\\[/g, '');\n}\n","import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport {\n FieldError,\n FieldValues,\n Resolver,\n appendErrors,\n} from 'react-hook-form';\nimport * as Yup from 'yup';\n\n/**\n * Why `path!` ? because it could be `undefined` in some case\n * https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string\n */\nfunction parseErrorSchema(\n error: Yup.ValidationError,\n validateAllFieldCriteria: boolean,\n) {\n return (error.inner || []).reduce<Record<string, FieldError>>(\n (previous, error) => {\n if (!previous[error.path!]) {\n previous[error.path!] = { message: error.message, type: error.type! };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[error.path!].types;\n const messages = types && types[error.type!];\n\n previous[error.path!] = appendErrors(\n error.path!,\n validateAllFieldCriteria,\n previous,\n error.type!,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n },\n {},\n );\n}\n\n/**\n * Creates a resolver for react-hook-form using Yup schema validation\n * @param {Yup.ObjectSchema<TFieldValues> | ReturnType<typeof Yup.lazy<Yup.ObjectSchema<TFieldValues>>>} schema - Yup validation schema\n * @param {Parameters<(typeof schema)['validate']>[1]} schemaOptions - Options to pass to Yup's validate/validateSync\n * @param {Object} resolverOptions - Additional resolver configuration\n * @param {('async' | 'sync')} [resolverOptions.mode] - Validation mode\n * @param {boolean} [resolverOptions.raw] - If true, returns raw values instead of validated results\n * @returns {Resolver<Yup.InferType<typeof schema>>} A resolver function compatible with react-hook-form\n * @example\n * const schema = Yup.object({\n * name: Yup.string().required(),\n * age: Yup.number().required(),\n * });\n *\n * useForm({\n * resolver: yupResolver(schema)\n * });\n */\nexport function yupResolver<TFieldValues extends FieldValues>(\n schema:\n | Yup.ObjectSchema<TFieldValues>\n | ReturnType<typeof Yup.lazy<Yup.ObjectSchema<TFieldValues>>>,\n schemaOptions: Parameters<(typeof schema)['validate']>[1] = {},\n resolverOptions: {\n mode?: 'async' | 'sync';\n raw?: boolean;\n } = {},\n): Resolver<Yup.InferType<typeof schema>> {\n return async (values, context, options) => {\n try {\n if (schemaOptions.context && process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n \"You should not used the yup options context. Please, use the 'useForm' context object instead\",\n );\n }\n\n const result = await schema[\n resolverOptions.mode === 'sync' ? 'validateSync' : 'validate'\n ](\n values,\n Object.assign({ abortEarly: false }, schemaOptions, { context }),\n );\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.raw ? Object.assign({}, values) : result,\n errors: {},\n };\n } catch (e: any) {\n if (!e.inner) {\n throw e;\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n e,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n };\n}\n","import groupBy from 'lodash.groupby';\nimport capitalize from 'lodash.capitalize';\n\nconst MINUTES_IN_HOUR = 60;\n\nexport const DAYS_OF_THE_WEEK = [\n 'monday',\n 'tuesday',\n 'wednesday',\n 'thursday',\n 'friday',\n 'saturday',\n 'sunday',\n] as const;\n\nexport type DailySchedule = {\n day: string;\n start_time: string;\n end_time: string;\n hours: number;\n break_duration_minutes: string;\n checked: boolean;\n};\n\n/**\n * Convert break duration in minutes to hours and minutes\n * @param breakDuration - Break duration in minutes\n * @returns Break duration in hours and minutes\n */\nfunction convertBreakDurationToHours(breakDuration: number) {\n if (breakDuration < 60) {\n return `${breakDuration}m`;\n }\n\n const hours = Math.floor(breakDuration / MINUTES_IN_HOUR);\n const minutes = breakDuration % MINUTES_IN_HOUR;\n\n if (minutes > 0) {\n return `${hours}h${minutes}m`;\n }\n\n return `${hours}h`;\n}\n\n/**\n * Calculate total work hours from daily schedules\n * @param dailySchedules - Daily schedules\n * @returns Total work hours\n */\nexport function calculateTotalWorkHours(dailySchedules: DailySchedule[]) {\n const totalWorkHours = dailySchedules.reduce((total, daySchedule) => {\n const sum = daySchedule.hours + total;\n return sum;\n }, 0);\n\n return Number(totalWorkHours.toFixed(2));\n}\n\n/**\n * Find the last consecutive day in a schedule (used to summarize work hours)\n * @param startDay - The starting day\n * @param dailySchedule - The daily schedule\n * @returns The last consecutive day\n */\nfunction findLastConsecutiveDay(\n startDay: string,\n dailySchedule: DailySchedule[],\n): Weekday | null {\n const daysScheduled = dailySchedule.map(\n ({ day }: DailySchedule) => day.toLowerCase() as Weekday,\n );\n\n let idx = daysScheduled.indexOf(startDay as Weekday);\n let day: Weekday | null = null;\n\n while (idx < daysScheduled.length && !day) {\n const currentDay = daysScheduled[idx];\n const nextDay = daysScheduled[idx + 1];\n\n const nextDayIdx = DAYS_OF_THE_WEEK.indexOf(currentDay) + 1;\n const isNextDay = DAYS_OF_THE_WEEK[nextDayIdx] === nextDay;\n\n if (!isNextDay) {\n day = currentDay;\n }\n\n idx += 1;\n }\n\n return day;\n}\n\n/**\n * Check if a day schedule should be summarized\n * @param daySchedule - The day schedule\n * @returns True if the day schedule should be summarized\n */\nfunction shouldSummarizeSchedule(daySchedule: DailySchedule) {\n return (\n daySchedule.start_time &&\n daySchedule.end_time &&\n (typeof daySchedule.hours === 'number'\n ? daySchedule.hours\n : Number.parseInt(daySchedule.hours)) > 0\n );\n}\n\n/**\n * Check if break duration should be summarized\n * @param daySchedule - The day schedule\n * @returns True if the break duration should be summarized\n */\nfunction shouldSummarizeBreaks(daySchedule: DailySchedule) {\n return Number.parseInt(daySchedule.break_duration_minutes) > 0;\n}\n\n/**\n * Build the work schedule summary\n * @param dailySchedules - The daily schedules\n * @returns The work schedule summary\n */\nexport function buildWorkScheduleSummary(dailySchedules: DailySchedule[]) {\n const activeScheduleDays = dailySchedules.filter(shouldSummarizeSchedule);\n\n const groupedWorkHours = groupBy(activeScheduleDays, (dailySchedule) => {\n return `${dailySchedule.start_time}|${dailySchedule.end_time}`;\n });\n\n const activeBreakDays = dailySchedules.filter(shouldSummarizeBreaks);\n const groupedBreaks = groupBy(activeBreakDays, 'break_duration_minutes');\n\n const workHoursSummary = Object.keys(groupedWorkHours).map(\n (scheduleTimes) => {\n const sameDailySchedule = groupedWorkHours[scheduleTimes];\n const startDay = sameDailySchedule[0].day;\n const [start_time, end_time] = scheduleTimes.split('|');\n const timeSummary = `from <span>${start_time.replace(':', 'h')}</span> to <span>${end_time.replace(':', 'h')}</span>`;\n\n const lastConsecutiveDay = findLastConsecutiveDay(\n startDay,\n sameDailySchedule,\n );\n const lastConsecutiveDayIdx = lastConsecutiveDay\n ? sameDailySchedule.findIndex(\n (dailySchedule) => dailySchedule.day === lastConsecutiveDay,\n )\n : -1;\n const allDaysAreConsecutive =\n lastConsecutiveDayIdx === sameDailySchedule.length - 1;\n\n if (sameDailySchedule.length === 1) {\n return `${capitalize(startDay)}, ${timeSummary}`;\n }\n\n if (!allDaysAreConsecutive || !lastConsecutiveDay) {\n return sameDailySchedule.reduce((summary, dailySchedule, idx) => {\n const day = capitalize(dailySchedule.day);\n if (idx === sameDailySchedule.length - 1) {\n return `${summary}and ${day}, ${timeSummary}`;\n }\n\n return `${summary}<span>${day}</span>, `;\n }, '');\n }\n\n return `<span>${capitalize(startDay)}</span> to <span>${capitalize(lastConsecutiveDay)}</span>, ${timeSummary}`;\n },\n );\n\n const breakSummary = Object.keys(groupedBreaks)\n .reverse()\n .map((breakDuration, idx) => {\n const isFirstGroup = idx === 0;\n const sameDailyBreaks = groupedBreaks[breakDuration];\n const breakString = convertBreakDurationToHours(\n parseInt(breakDuration, 10),\n );\n\n if (Object.keys(groupedBreaks).length === 1) {\n return `With ${breakString} daily breaks`;\n }\n\n if (sameDailyBreaks.length === 1) {\n const breakText = `${breakString} break on ${capitalize(sameDailyBreaks[0].day)}.`;\n return isFirstGroup ? `With ${breakText}` : breakText;\n }\n\n return sameDailyBreaks.reduce(\n (summary, dailySchedule, breakIdx) => {\n const day = capitalize(dailySchedule.day);\n\n if (breakIdx === 0) {\n return `${summary} ${day}`;\n }\n\n if (breakIdx === sameDailyBreaks.length - 1) {\n return `${summary}, and ${day}.`;\n }\n\n return `${summary}, ${day}`;\n },\n isFirstGroup\n ? `With ${breakString} break on`\n : `${breakString} break on`,\n );\n });\n\n return { workHoursSummary, breakSummary };\n}\n\n// Calculate hours for each day\nexport function calculateHours(day: DailySchedule) {\n const { checked, start_time, end_time, break_duration_minutes } = day;\n if (!checked) return 0;\n\n const [startHour, startMin] = start_time.split(':').map(Number);\n const [endHour, endMin] = end_time.split(':').map(Number);\n\n const startTotalMin = startHour * 60 + startMin;\n const endTotalMin = endHour * 60 + endMin;\n const workMinutes =\n endTotalMin -\n startTotalMin -\n Number.parseInt(break_duration_minutes || '0');\n\n const hours = workMinutes / 60;\n return hours === Math.floor(hours) ? hours : Number(hours.toFixed(2));\n}\n\ntype Weekday = (typeof DAYS_OF_THE_WEEK)[number];\n\nconst dayMap: Record<Weekday, string> = {\n monday: 'Mon',\n tuesday: 'Tue',\n wednesday: 'Wed',\n thursday: 'Thu',\n friday: 'Fri',\n saturday: 'Sat',\n sunday: 'Sun',\n};\n\nexport function getShortWeekday(fullName: Weekday): string {\n return dayMap[fullName];\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\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 { MultiSelect } from '../../ui/multi-select';\nimport { useState } from 'react';\n\ntype MultiSelectFieldProps = JSFField & {\n placeholder?: string;\n options: Array<{ value: string; label: string }>;\n className?: string;\n onChange?: (value: any) => void;\n component?: Components['select'];\n};\n\nexport function MultiSelectField({\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n component,\n ...rest\n}: MultiSelectFieldProps) {\n const { control } = useFormContext();\n const { components } = useFormFields();\n const [selected, setSelected] = useState<any[]>();\n\n return (\n <FormField\n defaultValue={defaultValue}\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n const CustomSelectField = component || components?.['multi-select'];\n if (CustomSelectField) {\n const customSelectFieldProps = {\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n ...rest,\n };\n return (\n <CustomSelectField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customSelectFieldProps}\n />\n );\n }\n\n const selectedOptions =\n selected ||\n options.filter((option) => field.value.includes(option.value));\n\n return (\n <FormItem\n data-field={name}\n className={`RemoteFlows__SelectField__Item__${name}`}\n >\n <FormLabel className='RemoteFlows__SelectField__Label'>\n {label}\n </FormLabel>\n <FormControl>\n <MultiSelect\n options={options}\n selected={selectedOptions}\n onChange={(rawValues: any[]) => {\n const values = rawValues.map(({ value }) => value);\n field.onChange(values);\n onChange?.(values);\n setSelected(rawValues);\n }}\n {...rest}\n />\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","import {\n NumberField,\n NumberFieldProps,\n} from '@/src/components/form/fields/NumberField';\n\n// TODO: We use the number field and the the number type is what the partner overrides\n// TODO: this needs to be changed in the future with the changes from https://github.com/remoteoss/remote-flows/pull/128\nexport const MoneyField = (props: NumberFieldProps) => {\n return <NumberField maxLength={15} {...props} />;\n};\n","import { CheckBoxField } from './CheckBoxField';\nimport { DatePickerField } from './DatePickerField';\nimport { FileUploadField } from './FileUploadField';\nimport { NumberField } from './NumberField';\nimport { RadioGroupField } from './RadioGroupField';\nimport { SelectField } from './SelectField';\nimport { CountryField } from './CountryField';\nimport { TextAreaField } from './TextAreaField';\nimport { TextField } from './TextField';\nimport { EmailField } from './EmailField';\nimport { HiddenField } from './HiddenField';\nimport { WorkScheduleField } from './WorkScheduleField';\nimport { MultiSelectField } from './MultiSelectField';\nimport { MoneyField } from './MoneyField';\nimport { SupportedTypes } from './types';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\n\nexport const baseFields: Record<\n Exclude<SupportedTypes, 'fieldset' | 'fieldset-flat'>,\n React.ComponentType<$TSFixMe>\n> = {\n checkbox: CheckBoxField,\n text: TextField,\n email: EmailField,\n money: MoneyField,\n select: SelectField,\n 'multi-select': MultiSelectField,\n radio: RadioGroupField,\n number: NumberField,\n file: FileUploadField,\n date: DatePickerField,\n textarea: TextAreaField,\n countries: CountryField,\n hidden: HiddenField,\n 'work-schedule': WorkScheduleField,\n};\n","import { Alert, AlertDescription, AlertTitle } from '@/src/components/ui/alert';\nimport { useFormFields } from '@/src/context';\nimport { AlertCircle } from 'lucide-react';\n\nexport type StatementProps = {\n title?: string;\n description: string;\n severity: 'warning' | 'error' | 'success' | 'info' | 'neutral' | 'time';\n};\n\nexport function Statement({ title, description, severity }: StatementProps) {\n const { components } = useFormFields();\n\n if (components?.statement) {\n const CustomStatement = components?.statement;\n return (\n <CustomStatement\n data={{\n title,\n description,\n severity,\n }}\n />\n );\n }\n\n return (\n <Alert variant='warning'>\n <AlertCircle className='h-4 w-4' />\n {title && <AlertTitle>{title}</AlertTitle>}\n <AlertDescription>{description}</AlertDescription>\n </Alert>\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { baseFields } from '@/src/components/form/fields/baseFields';\nimport { cn, sanitizeHtml } from '@/src/lib/utils';\nimport { SupportedTypes } from './types';\nimport {\n $TSFixMe,\n Components,\n FieldSetToggleComponentProps,\n} from '@/src/types/remoteFlows';\nimport { Statement, StatementProps } from '@/src/components/form/Statement';\nimport { useFormContext } from 'react-hook-form';\nimport { Fragment, useEffect, useRef } from 'react';\nimport { useFormFields } from '@/src/context';\nimport { Button } from '@/src/components/ui/button';\n\ntype FieldBase = {\n label: string;\n name: string;\n description: string;\n Component?: React.ComponentType<any>;\n inputType: SupportedTypes;\n multiple?: boolean;\n};\n\ntype FieldWithOptions = FieldBase & {\n type: 'select' | 'radio';\n options: Array<{ value: string; label: string }>;\n};\n\ntype FieldWithoutOptions = FieldBase & {\n type: Exclude<SupportedTypes, 'select' | 'radio'>;\n options?: never;\n};\n\ntype Field = FieldWithOptions | FieldWithoutOptions;\n\ntype FieldSetFeatures = {\n toggle?: {\n enabled: boolean;\n defaultExpanded?: boolean;\n stateField?: string;\n labels?: {\n expand: string;\n collapse: string;\n };\n className?: string;\n };\n};\n\nexport type FieldSetProps = {\n label: string;\n name: string;\n description: string;\n fields: Field[];\n features?: FieldSetFeatures;\n components: Components;\n statement?: StatementProps;\n isFlatFieldset: boolean;\n extra?: React.ReactNode;\n variant: 'outset' | 'inset';\n};\n\nconst DefaultToggleButton = ({\n isExpanded,\n onToggle,\n className,\n ...props\n}: FieldSetToggleComponentProps) => (\n <Button\n type='button'\n className={cn(\n 'RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton',\n className,\n )}\n variant='default'\n onClick={onToggle}\n {...props}\n >\n {isExpanded ? 'Remove' : 'Define'}\n </Button>\n);\n\nexport function FieldSetField({\n label,\n name,\n fields,\n description,\n components,\n statement,\n isFlatFieldset,\n extra,\n variant = 'outset',\n features,\n}: FieldSetProps) {\n const { watch, setValue, trigger, formState } = useFormContext();\n const { components: formComponents } = useFormFields();\n\n // Get expanded state from form state if stateField is provided\n const stateField = features?.toggle?.stateField;\n const isExpanded = stateField\n ? watch(stateField)\n : (features?.toggle?.defaultExpanded ?? true);\n\n const fieldNames = fields.map(\n ({ name: fieldName }) => `${name}.${fieldName}`,\n );\n const watchedValues = watch(fieldNames);\n const prevValuesRef = useRef<string[]>(watchedValues);\n const triggerTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n const toggleExpanded = () => {\n if (stateField) {\n setValue(stateField, !isExpanded);\n }\n };\n\n useEffect(() => {\n const currentValues = watchedValues;\n const previousValues = prevValuesRef.current;\n const hasBeenSubmitted = formState.isSubmitted || formState.submitCount > 0;\n\n // Check if any value has changed\n let hasChanged = false;\n for (let i = 0; i < currentValues.length; i++) {\n if (\n currentValues[i] !== undefined &&\n previousValues[i] !== currentValues[i]\n ) {\n hasChanged = true;\n // This is to prevent the form from triggering validation too many times\n break;\n }\n }\n // If changes detected and we haven't triggered yet, run trigger\n if (hasChanged && hasBeenSubmitted) {\n // We need to debounce the validation trigger so that tests don't freeze\n if (triggerTimeoutRef.current) {\n clearTimeout(triggerTimeoutRef.current);\n }\n triggerTimeoutRef.current = setTimeout(() => {\n trigger();\n }, 50);\n }\n\n prevValuesRef.current = [...currentValues];\n\n return () => {\n if (triggerTimeoutRef.current) {\n clearTimeout(triggerTimeoutRef.current);\n }\n };\n }, [watchedValues, trigger, formState.isSubmitted, formState.submitCount]);\n\n const ToggleComponent = formComponents?.fieldsetToggle || DefaultToggleButton;\n const contentId = `${name}-content`;\n const headerId = `${name}-header`;\n\n return (\n <fieldset\n className={cn(\n 'border-1 border-input p-4 rounded-xl',\n `RemoteFlows__FieldSetField`,\n `RemoteFlows__FieldSetField__${name}`,\n )}\n >\n <legend\n className={cn(\n 'text-sm font-semibold px-2',\n variant === 'inset' && 'hidden',\n )}\n >\n {label}\n </legend>\n {variant === 'inset' && (\n <div\n className='RemoteFlows__FieldSetField__Header'\n id={headerId}\n data-state={isExpanded ? 'expanded' : 'collapsed'}\n aria-expanded={isExpanded}\n >\n <h3 className={cn('RemoteFlows__FieldSetField__Title')}>{label}</h3>\n {features?.toggle?.enabled && (\n <ToggleComponent\n isExpanded={isExpanded}\n onToggle={toggleExpanded}\n aria-expanded={isExpanded}\n aria-controls={contentId}\n aria-label={`${isExpanded ? 'Hide' : 'Show'} ${label}`}\n className={cn(\n 'RemoteFlows__FieldSetField__Toggle',\n features.toggle?.className,\n )}\n >\n {isExpanded\n ? (features.toggle.labels?.collapse ?? 'Remove')\n : (features.toggle.labels?.expand ?? 'Define')}\n </ToggleComponent>\n )}\n </div>\n )}\n {isExpanded && (\n <div id={contentId} aria-labelledby={headerId} role='region'>\n {description ? (\n <div\n className='mb-5 RemoteFlows__FieldSetField__Description'\n dangerouslySetInnerHTML={{ __html: sanitizeHtml(description) }}\n />\n ) : null}\n <div className='grid gap-4'>\n {fields.map((field: $TSFixMe) => {\n if (field.calculateDynamicProperties) {\n field = {\n ...field,\n ...(field.calculateDynamicProperties(watchedValues, field) ||\n {}),\n };\n }\n let FieldComponent =\n baseFields[\n field.type as Exclude<\n SupportedTypes,\n 'fieldset' | 'fieldset-flat'\n >\n ];\n\n if (field.isVisible === false || field.deprecated) {\n return null; // Skip hidden or deprecated fields\n }\n\n if (field.Component) {\n const { Component } = field as {\n Component: React.ComponentType<any>;\n };\n return <Component key={field.name} {...field} />;\n }\n\n if (field.type === 'select' && field.multiple) {\n FieldComponent = baseFields['multi-select'];\n }\n\n return (\n <Fragment\n key={`${isFlatFieldset ? field.name : `${name}.${field.name}`}`}\n >\n <FieldComponent\n {...field}\n name={`${isFlatFieldset ? field.name : `${name}.${field.name}`}`}\n component={components?.[field.type as SupportedTypes]}\n />\n {field.extra ? field.extra : null}\n </Fragment>\n );\n })}\n {extra ? extra : null}\n {statement ? <Statement {...statement} /> : null}\n </div>\n </div>\n )}\n </fieldset>\n );\n}\n"],"mappings":"glBA+EY,OAyBE,YAAAA,GAzBF,OAAAC,EA8BQ,QAAAC,OA9BR,oBAlDL,SAASC,GAAc,CAC5B,KAAAC,EACA,aAAAC,EACA,YAAAC,EACA,MAAAC,EACA,SAAAC,EACA,SAAAC,EACA,QAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAuB,CACrB,GAAM,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAC/B,CAAE,QAAAC,CAAQ,EAAIC,EAAe,EAE7BC,EAAuBC,EAAA,CAC3BC,EACAC,EACAC,IACG,CACH,IAAMC,EAAgBD,EAAM,MAAQ,CAAC,GAAGA,EAAM,K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A,EAAM,UAAW,CACnB,GAAM,CAAE,UAAAG,EAAU,EAAIH,EAGtB,OAAO9C,EAACiD,GAAA,CAA4B,GAAGH,GAAhBA,EAAM,IAAiB,CAChD,CAEA,OAAIA,EAAM,OAAS,UAAYA,EAAM,WACnCC,GAAiBC,GAAW,cAAc,GAI1C/C,GAACiD,GAAA,CAGC,UAAAlD,EAAC+C,GAAA,CACE,GAAGD,EACJ,KAAM,GAAG7B,EAAiB6B,EAAM,KAAO,GAAGlC,CAAI,IAAIkC,EAAM,IAAI,EAAE,GAC9D,UAAW/B,IAAa+B,EAAM,IAAsB,EACtD,EACCA,EAAM,MAAQA,EAAM,MAAQ,OAPxB,GAAG7B,EAAiB6B,EAAM,KAAO,GAAGlC,CAAI,IAAIkC,EAAM,IAAI,EAAE,EAQ/D,CAEJ,CAAC,EACA5B,GAAgB,KAChBF,EAAYhB,EAACmD,GAAA,CAAW,GAAGnC,EAAW,EAAK,MAC9C,GACF,GAEJ,CAEJ,CAlLgBb,EAAAO,GAAA","names":["Fragment","jsx","jsxs","CheckBoxField","name","defaultValue","description","label","onChange","multiple","options","component","rest","components","useFormFields","control","useFormContext","handleCheckboxChange","__name","optionId","checked","field","currentValues","value","FormField","fieldState","CustomCheckboxField","customCheckboxFieldProps","evt","FormItem","cn","FormControl","FormLabel","option","Checkbox","event","FormDescription","FormMessage","CalendarIcon","PopoverClose","ChevronLeft","ChevronRight","DayPicker","jsx","Calendar","className","classNames","showOutsideDays","props","DayPicker","cn","buttonVariants","__name","ChevronLeft","ChevronRight","PopoverPrimitive","jsx","Popover","props","__name","PopoverTrigger","PopoverContent","className","align","sideOffset","cn","format","Fragment","jsx","jsxs","DatePickerField","description","label","name","minDate","onChange","component","rest","components","useFormFields","control","useFormContext","minDateValue","getMinStartDate","FormField","field","fieldState","CustomDatePickerField","customDatePickerFieldProps","__name","value","FormItem","FormLabel","Popover","PopoverTrigger","FormControl","Button","cn","format","CalendarIcon","PopoverContent","Calendar","date","props","PopoverClose","FormDescription","FormMessage","useState","useRef","Upload","X","jsx","jsxs","FileUploader","onChange","className","multiple","files","setFiles","useState","inputRef","useRef","handleClick","__name","e","handleChange","newFiles","onRemoveFile","file","prevFiles","f","cn","Button","Upload","index","X","jsx","jsxs","toBase64","__name","file","resolve","reject","reader","error","convertFilesToBase64","event","files","base64","FileUploadField","name","description","label","multiple","onChange","component","rest","components","useFormFields","control","useFormContext","FormField","field","fieldState","CustomFileUploadField","customFileUploadFieldProps","value","FormItem","FormLabel","FormControl","FileUploader","cn","FormDescription","FormMessage","jsx","NumberField","props","components","useFormFields","control","useFormContext","CustomNumberField","FormField","field","fieldState","__name","value","TextField","Fragment","jsx","jsxs","RadioGroupField","name","defaultValue","description","label","options","onChange","component","rest","components","useFormFields","control","useFormContext","FormField","field","fieldState","CustomRadioGroupField","customRadioGroupFieldProps","__name","value","FormItem","cn","FormLabel","FormControl","RadioGroup","option","Fragment","RadioGroupItem","FormDescription","FormMessage","jsx","jsxs","SelectField","label","name","options","defaultValue","description","onChange","component","rest","control","useFormContext","components","useFormFields","FormField","field","fieldState","CustomSelectField","customSelectFieldProps","__name","value","maybeCastValue","FormItem","FormLabel","FormControl","Select","SelectTrigger","SelectValue","SelectContent","SelectGroup","option","SelectItem","FormDescription","FormMessage","useState","Fragment","useState","Check","ChevronDownIcon","X","CommandPrimitive","SearchIcon","jsx","jsxs","Command","className","props","CommandPrimitive","cn","__name","CommandList","className","props","jsx","CommandPrimitive","cn","__name","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","jsx","jsxs","MultiSelect","options","selected","onChange","placeholder","props","open","setOpen","useState","handleUnselect","__name","option","item","hasCategories","groupedOptions","groups","category","Popover","PopoverTrigger","Button","Badge","e","X","ChevronDownIcon","PopoverContent","Command","CommandList","CommandEmpty","categoryOptions","index","Fragment","CommandSeparator","CommandGroup","isSelected","CommandItem","Check","cn","jsx","jsxs","CountryField","label","name","options","defaultValue","description","onChange","$meta","component","rest","control","useFormContext","components","useFormFields","selected","setSelected","useState","FormField","field","fieldState","CustomSelectField","customSelectFieldProps","__name","value","countryOptions","key","option","handleChange","rawValues","values","FormItem","FormLabel","FormControl","MultiSelect","FormDescription","FormMessage","React","jsx","Textarea","className","props","ref","cn","jsx","jsxs","TextAreaField","name","description","label","onChange","maxLength","component","rest","components","useFormFields","control","useFormContext","FormField","field","fieldState","CustomTextAreaField","customTextAreaFieldProps","__name","value","valueLength","FormItem","FormLabel","FormControl","Textarea","event","cn","FormDescription","FormMessage","jsx","EmailField","props","components","useFormFields","control","useFormContext","CustomEmailField","FormField","field","fieldState","__name","value","TextField","jsx","HiddenField","props","control","useFormContext","FormField","field","__name","React","useEffect","useState","setCustomValidity","ref","fieldPath","errors","error","get","message","reportValidity","validateFieldsNatively","options","fields","field","refs","forEach","toNestErrors","shouldUseNativeValidation","fieldErrors","path","Object","assign","isNameInFieldArray","names","keys","fieldArrayErrors","set","name","escapeBrackets","some","n","match","input","replace","yupResolver","schema","schemaOptions","resolverOptions","values","context","options","Promise","resolve","process","env","NODE_ENV","console","warn","mode","Object","assign","abortEarly","then","result","shouldUseNativeValidation","validateFieldsNatively","raw","errors","e","r","u","_catch","inner","toNestErrors","error","validateAllFieldCriteria","criteriaMode","reduce","previous","path","message","type","types","messages","appendErrors","concat","reject","yup","groupBy","capitalize","MINUTES_IN_HOUR","DAYS_OF_THE_WEEK","convertBreakDurationToHours","breakDuration","hours","minutes","__name","calculateTotalWorkHours","dailySchedules","totalWorkHours","total","daySchedule","findLastConsecutiveDay","startDay","dailySchedule","daysScheduled","day","idx","currentDay","nextDay","nextDayIdx","shouldSummarizeSchedule","shouldSummarizeBreaks","buildWorkScheduleSummary","activeScheduleDays","groupedWorkHours","groupBy","activeBreakDays","groupedBreaks","workHoursSummary","scheduleTimes","sameDailySchedule","start_time","end_time","timeSummary","lastConsecutiveDay","allDaysAreConsecutive","capitalize","summary","breakSummary","isFirstGroup","sameDailyBreaks","breakString","breakText","breakIdx","calculateHours","checked","break_duration_minutes","startHour","startMin","endHour","endMin","startTotalMin","dayMap","getShortWeekday","fullName","jsx","jsxs","fieldSchema","__name","schema","formSchema","WorkScheduleSelectionForm","defaultSchedule","onSubmit","openDialog","setOpenDialog","useState","transformedSchedule","DAYS_OF_THE_WEEK","day","existingSchedule","schedule","getShortWeekday","form","useForm","o","handleSubmit","watch","reset","control","formState","fields","useFieldArray","watchedSchedule","handleSubmitWorkingHours","data","checked","calculateHours","handleCancel","Dialog","DialogTrigger","Button","DialogContent","DialogHeader","DialogTitle","Form","field","index","currentDay","calculatedHours","React","CheckBoxField","TextField","WorkScheduleField","props","components","useFormFields","setValue","useFormContext","currentSchedule","setCurrentSchedule","workHoursSummary","breakSummary","buildWorkScheduleSummary","totalWorkHours","calculateTotalWorkHours","useEffect","CustomWorkScheduleField","FormField","fieldState","value","useState","jsx","jsxs","MultiSelectField","label","name","options","defaultValue","description","onChange","component","rest","control","useFormContext","components","useFormFields","selected","setSelected","useState","FormField","field","fieldState","CustomSelectField","customSelectFieldProps","__name","value","selectedOptions","option","FormItem","FormLabel","FormControl","MultiSelect","rawValues","values","FormDescription","FormMessage","jsx","MoneyField","__name","props","NumberField","baseFields","CheckBoxField","TextField","EmailField","MoneyField","SelectField","MultiSelectField","RadioGroupField","NumberField","FileUploadField","DatePickerField","TextAreaField","CountryField","HiddenField","WorkScheduleField","AlertCircle","jsx","jsxs","Statement","title","description","severity","components","useFormFields","CustomStatement","Alert","AlertCircle","AlertTitle","AlertDescription","__name","Fragment","useEffect","useRef","jsx","jsxs","DefaultToggleButton","__name","isExpanded","onToggle","className","props","Button","cn","FieldSetField","label","name","fields","description","components","statement","isFlatFieldset","extra","variant","features","watch","setValue","trigger","formState","useFormContext","formComponents","useFormFields","stateField","fieldNames","fieldName","watchedValues","prevValuesRef","useRef","triggerTimeoutRef","toggleExpanded","useEffect","currentValues","previousValues","hasBeenSubmitted","hasChanged","i","ToggleComponent","contentId","headerId","sanitizeHtml","field","FieldComponent","baseFields","Component","Fragment","Statement"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/form/fields/CheckBoxField.tsx","../src/components/form/fields/DatePickerField.tsx","../src/components/ui/calendar.tsx","../src/components/ui/popover.tsx","../src/components/ui/file-uploader.tsx","../src/components/form/fields/FileUploadField.tsx","../src/components/form/fields/NumberField.tsx","../src/components/form/fields/RadioGroupField.tsx","../src/components/form/fields/SelectField.tsx","../src/components/form/fields/CountryField.tsx","../src/components/ui/multi-select.tsx","../src/components/ui/command.tsx","../src/components/ui/textarea.tsx","../src/components/form/fields/TextAreaField.tsx","../src/components/form/fields/EmailField.tsx","../src/components/form/fields/HiddenField.tsx","../src/components/form/fields/WorkScheduleField.tsx","../node_modules/@hookform/resolvers/src/validateFieldsNatively.ts","../node_modules/@hookform/resolvers/src/toNestErrors.ts","../node_modules/@hookform/resolvers/yup/src/yup.ts","../src/components/form/fields/workScheduleUtils.ts","../src/components/form/fields/MultiSelectField.tsx","../src/components/form/fields/MoneyField.tsx","../src/components/form/fields/baseFields.tsx","../src/components/form/Statement.tsx","../src/components/form/fields/FieldSetField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Checkbox } from '@/src/components/ui/checkbox';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/src/components/ui/form';\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\nimport { Components, JSFField } from '@/src/types/remoteFlows';\nimport { CheckedState } from '@radix-ui/react-checkbox';\nimport {\n ControllerRenderProps,\n FieldValues,\n useFormContext,\n} from 'react-hook-form';\n\nexport type CheckBoxFieldProps = {\n name: string;\n} & Partial<\n JSFField & {\n onChange?: (checked: any, optionId?: string) => void;\n component?: Components['checkbox'];\n }\n>;\n\nexport function CheckBoxField({\n name,\n defaultValue,\n description,\n label,\n onChange,\n multiple,\n options,\n component,\n ...rest\n}: CheckBoxFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n const handleCheckboxChange = (\n optionId: string,\n checked: boolean,\n field: ControllerRenderProps<FieldValues, string>,\n ) => {\n const currentValues = field.value ? [...field.value] : [];\n\n if (checked) {\n // Add the value if it's not already in the array\n if (!currentValues.includes(optionId)) {\n field.onChange([...currentValues, optionId]);\n }\n } else {\n // Remove the value from the array\n field.onChange(currentValues.filter((value) => value !== optionId));\n }\n };\n\n return (\n <FormField\n control={control}\n name={name}\n defaultValue={defaultValue}\n render={({ field, fieldState }) => {\n const CustomCheckboxField = component || components?.checkbox;\n if (CustomCheckboxField) {\n const customCheckboxFieldProps = {\n name,\n description,\n label,\n defaultValue,\n multiple,\n options,\n ...rest,\n };\n return (\n <CustomCheckboxField\n field={{\n ...field,\n onChange: (evt: any) => {\n if (multiple) {\n const { checked, value } = evt.target;\n handleCheckboxChange(value, checked, field);\n onChange?.(checked);\n return;\n }\n field.onChange(evt);\n onChange?.(evt);\n },\n }}\n fieldState={fieldState}\n fieldData={customCheckboxFieldProps}\n />\n );\n }\n return (\n <FormItem\n data-field={name}\n className={cn(`RemoteFlows__CheckBoxField__Item__${name}`)}\n >\n <FormControl>\n <>\n {options && multiple ? <FormLabel>{label}</FormLabel> : null}\n\n {options && multiple ? (\n options.map((option) => (\n <div key={option.value} className='flex space-x-2'>\n <Checkbox\n id={option.value}\n onCheckedChange={(checked: CheckedState) => {\n handleCheckboxChange(\n option.value,\n checked === true,\n field,\n );\n onChange?.(checked, option.value);\n }}\n checked={field.value?.includes(option.value)}\n className='RemoteFlows__CheckBox__Input'\n />\n <FormLabel\n htmlFor={option.value}\n className='mb-0 RemoteFlows__CheckBox__Label'\n >\n {option.label}\n </FormLabel>\n </div>\n ))\n ) : (\n <div className='flex space-x-2'>\n <Checkbox\n id={name}\n onCheckedChange={(event: CheckedState) => {\n field.onChange(event);\n onChange?.(event);\n }}\n checked={field.value}\n className='RemoteFlows__CheckBox__Input'\n />\n <FormLabel\n htmlFor={name}\n className='mb-0 RemoteFlows__CheckBox__Label'\n >\n {label}\n </FormLabel>\n </div>\n )}\n </>\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { CalendarIcon } from 'lucide-react';\nimport { useFormContext } from 'react-hook-form';\nimport { PopoverClose } from '@radix-ui/react-popover';\n\nimport { Button } from '@/src/components/ui/button';\nimport { Calendar } from '@/src/components/ui/calendar';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/src/components/ui/form';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/src/components/ui/popover';\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\nimport { Components, JSFField } from '@/src/types/remoteFlows';\nimport { getMinStartDate } from '@/src/components/form/utils';\nimport { format } from 'date-fns';\n\nexport type DatePickerFieldProps = JSFField & {\n onChange?: (value: any) => void;\n component?: Components['date'];\n};\n\nexport function DatePickerField({\n description,\n label,\n name,\n minDate,\n onChange,\n component,\n ...rest\n}: DatePickerFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n let minDateValue: Date;\n if (rest.meta?.mot && typeof rest.meta.mot === 'number') {\n minDateValue = getMinStartDate(rest.meta.mot);\n } else if (minDate) {\n minDateValue = new Date(minDate);\n }\n\n return (\n <FormField\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n const CustomDatePickerField = component || components?.date;\n\n if (CustomDatePickerField) {\n const customDatePickerFieldProps = {\n description,\n label,\n name,\n onChange,\n ...(minDateValue && { minDate: minDateValue.toISOString() }),\n ...rest,\n };\n return (\n <CustomDatePickerField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customDatePickerFieldProps}\n />\n );\n }\n return (\n <FormItem\n data-field={name}\n className={`flex flex-col RemoteFlows__DatePickerField__Item__${name}`}\n >\n <FormLabel className='RemoteFlows__DatePickerField__Label'>\n {label}\n </FormLabel>\n <Popover>\n <PopoverTrigger asChild>\n <FormControl>\n <div>\n <Button\n type='button'\n variant={'outline'}\n className={cn(\n 'w-full pl-3 text-left font-normal',\n !field.value && 'text-muted-foreground',\n )}\n data-testid={`date-picker-button-${name}`}\n >\n {field.value && <>{format(field.value, 'yyyy-MM-dd')}</>}\n <CalendarIcon className='ml-auto h-4 w-4 opacity-50' />\n </Button>\n </div>\n </FormControl>\n </PopoverTrigger>\n <PopoverContent\n className={`w-auto p-0 RemoteFlows__DatepickerField__PopoverContent`}\n align='start'\n >\n <Calendar\n mode='single'\n className='RemoteFlows__DatepickerField__Calendar'\n selected={field.value ? new Date(field.value) : undefined}\n onSelect={(date) => {\n field.onChange(date ? format(date, 'yyyy-MM-dd') : null);\n onChange?.(date);\n }}\n defaultMonth={minDateValue}\n components={{\n DayContent: (props) => {\n return (\n <PopoverClose>{props.date.getDate()}</PopoverClose>\n );\n },\n }}\n {...(minDateValue && {\n disabled: (date: Date) => date < minDateValue,\n })}\n />\n </PopoverContent>\n </Popover>\n {description ? (\n <FormDescription>{description}</FormDescription>\n ) : null}\n {fieldState.error && (\n <FormMessage className='RemoteFlows__DatePickerField__Error' />\n )}\n </FormItem>\n );\n }}\n />\n );\n}\n","import * as React from 'react';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { DayPicker } from 'react-day-picker';\n\nimport { cn } from '@/src/lib/utils';\nimport { buttonVariants } from '@/src/components/ui/button';\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: React.ComponentProps<typeof DayPicker>) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn('p-3', className)}\n classNames={{\n months: 'flex flex-col sm:flex-row gap-2',\n month: 'flex flex-col gap-4',\n caption: 'flex justify-center pt-1 relative items-center w-full',\n caption_label: 'text-sm font-medium',\n nav: 'flex items-center gap-1',\n nav_button: cn(\n buttonVariants({ variant: 'outline' }),\n 'size-7 bg-transparent p-0 opacity-50 hover:opacity-100',\n ),\n nav_button_previous: 'absolute left-1',\n nav_button_next: 'absolute right-1',\n table: 'w-full border-collapse space-x-1',\n head_row: 'flex',\n head_cell:\n 'text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]',\n row: 'flex w-full mt-2',\n cell: cn(\n '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 props.mode === 'range'\n ? '[&: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'\n : '[&:has([aria-selected])]:rounded-md',\n ),\n day: cn(\n buttonVariants({ variant: 'ghost' }),\n 'size-8 p-0 font-normal aria-selected:opacity-100',\n ),\n day_range_start:\n 'day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground',\n day_range_end:\n 'day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground',\n day_selected:\n 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n day_today: 'bg-accent text-accent-foreground',\n day_outside:\n 'day-outside text-muted-foreground aria-selected:text-muted-foreground',\n day_disabled: 'text-muted-foreground opacity-50',\n day_range_middle:\n 'aria-selected:bg-accent aria-selected:text-accent-foreground',\n day_hidden: 'invisible',\n ...classNames,\n }}\n components={{\n IconLeft: ({ className, ...props }) => (\n <ChevronLeft className={cn('size-4', className)} {...props} />\n ),\n IconRight: ({ className, ...props }) => (\n <ChevronRight className={cn('size-4', className)} {...props} />\n ),\n }}\n {...props}\n />\n );\n}\n\nexport { Calendar };\n","import * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { cn } from '@/src/lib/utils';\n\nfunction Popover({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot='popover' {...props} />;\n}\n\nfunction PopoverTrigger({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot='popover-trigger' {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = 'center',\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot='popover-content'\n align={align}\n sideOffset={sideOffset}\n className={cn(\n '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',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverAnchor({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot='popover-anchor' {...props} />;\n}\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };\n","import React, { useState, useRef } from 'react';\nimport { Button } from '@/src/components/ui/button';\nimport { Upload, X } from 'lucide-react';\nimport { cn } from '@/src/lib/utils';\n\ntype FileUploaderProps = {\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n className?: string;\n multiple?: boolean;\n};\n\nexport function FileUploader({\n onChange,\n className,\n multiple,\n}: FileUploaderProps) {\n const [files, setFiles] = useState<File[]>([]);\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n inputRef.current?.click();\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (e.target.files && e.target.files.length > 0) {\n const newFiles = Array.from(e.target.files);\n\n setFiles(newFiles);\n onChange(e);\n }\n };\n\n const onRemoveFile = (file: File) => {\n setFiles((prevFiles) => prevFiles.filter((f) => f !== file));\n };\n\n return (\n <div className={cn('flex flex-col items-start gap-4', className)}>\n <input\n type='file'\n ref={inputRef}\n onChange={handleChange}\n className='hidden'\n aria-label='File upload'\n multiple={multiple}\n />\n <Button type='button' onClick={handleClick} className='gap-2'>\n <Upload className='h-4 w-4' />\n Choose File\n </Button>\n {files.length === 0 && (\n <div className='text-sm'>\n {!multiple ? (\n <span className='font-medium'>No file selected.</span>\n ) : (\n <span className='font-medium'>\n No files selected. You can select multiple files\n </span>\n )}\n </div>\n )}\n {files.length > 0 &&\n files.map((file, index) => (\n <div key={index} className='text-sm flex items-center gap-2'>\n Selected file: <span className='font-medium'>{file.name}</span> (\n {Math.round(file.size / 1024)} KB)\n <Button variant='ghost' onClick={() => onRemoveFile(file)}>\n <X />\n </Button>\n </div>\n ))}\n </div>\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\n\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\nimport { Components, JSFField } from '@/src/types/remoteFlows';\nimport { useFormContext } from 'react-hook-form';\nimport { FileUploader } from '../../ui/file-uploader';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '../../ui/form';\n\nconst toBase64 = (file: File): Promise<string> => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = (error) => reject(error);\n });\n};\n\nconst convertFilesToBase64 = async (\n event: React.ChangeEvent<HTMLInputElement>,\n) => {\n const files = event.target.files ? Array.from(event.target.files) : [];\n\n const base64Files = await Promise.all(\n files.map(async (file) => {\n const base64 = await toBase64(file);\n return {\n name: file.name,\n content: base64.split(',')[1],\n };\n }),\n );\n return base64Files;\n};\n\nexport type FileUploadFieldProps = JSFField & {\n onChange?: (value: any) => void;\n multiple?: boolean;\n component?: Components['file'];\n};\n\nexport function FileUploadField({\n name,\n description,\n label,\n multiple,\n onChange,\n component,\n ...rest\n}: FileUploadFieldProps) {\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 CustomFileUploadField = component || components?.file;\n if (CustomFileUploadField) {\n const customFileUploadFieldProps = {\n name,\n description,\n label,\n multiple,\n ...rest,\n };\n return (\n <CustomFileUploadField\n field={{\n ...field,\n value: null,\n onChange: async (value: any) => {\n const files = await convertFilesToBase64(value);\n field.onChange(files);\n onChange?.(files);\n },\n }}\n fieldState={fieldState}\n fieldData={customFileUploadFieldProps}\n />\n );\n }\n return (\n <FormItem\n data-field={name}\n className={`RemoteFlows__FileUpload__Item__${name}`}\n >\n <FormLabel className='RemoteFlows__FileUpload__Label'>\n {label}\n </FormLabel>\n <FormControl>\n <FileUploader\n onChange={async (\n event: React.ChangeEvent<HTMLInputElement>,\n ) => {\n const files = await convertFilesToBase64(event);\n field.onChange(files);\n onChange?.(files);\n }}\n multiple={multiple}\n className={cn('RemoteFlows__FileUpload__Input')}\n />\n </FormControl>\n {description && (\n <div className='flex items-center justify-between'>\n <FormDescription className='RemoteFlows__FileUpload__Description'>\n {description}\n </FormDescription>\n </div>\n )}\n {fieldState.error && (\n <FormMessage className='RemoteFlows__FileUpload__Error' />\n )}\n </FormItem>\n );\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useFormFields } from '@/src/context';\nimport { useFormContext } from 'react-hook-form';\nimport { FormField } from '../../ui/form';\nimport { TextField, TextFieldProps } from './TextField';\nimport { Components } from '@/src/types/remoteFlows';\n\nexport type NumberFieldProps = TextFieldProps & {\n component?: Components['number'];\n};\n\nexport function NumberField(props: NumberFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n const CustomNumberField = props.component || components?.number;\n\n if (CustomNumberField) {\n return (\n <FormField\n control={control}\n name={props.name}\n render={({ field, fieldState }) => {\n return (\n <CustomNumberField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n props.onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={props}\n />\n );\n }}\n />\n );\n }\n\n return (\n <TextField {...props} type='text' inputMode='decimal' pattern='^[0-9.]*$' />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Fragment } from 'react';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/src/components/ui/form';\nimport { RadioGroup, RadioGroupItem } from '@/src/components/ui/radio-group';\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\nimport { Components, JSFField } from '@/src/types/remoteFlows';\nimport { useFormContext } from 'react-hook-form';\n\ntype RadioGroupFieldProps = JSFField & {\n onChange?: (value: any) => void;\n component?: Components['radio'];\n};\n\nexport function RadioGroupField({\n name,\n defaultValue,\n description,\n label,\n options,\n onChange,\n component,\n ...rest\n}: RadioGroupFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n return (\n <FormField\n control={control}\n name={name}\n defaultValue={defaultValue}\n render={({ field, fieldState }) => {\n const CustomRadioGroupField = component || components?.radio;\n if (CustomRadioGroupField) {\n const customRadioGroupFieldProps = {\n name,\n defaultValue,\n description,\n label,\n options,\n ...rest,\n };\n return (\n <CustomRadioGroupField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customRadioGroupFieldProps}\n />\n );\n }\n\n return (\n <FormItem\n className={cn(\n 'space-y-3',\n `RemoteFlows__RadioGroupField__Item__${name}`,\n )}\n data-field={name}\n >\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <RadioGroup\n aria-label={label || name}\n onValueChange={(value: string) => {\n field.onChange(value);\n onChange?.(value);\n }}\n value={field.value}\n className='flex flex-col space-y-3'\n >\n {options?.map((option) => (\n <Fragment key={option.value}>\n <FormItem\n data-field={name}\n className='flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item'\n >\n <FormControl>\n <RadioGroupItem\n value={option.value}\n className='RemoteFlows__RadioField__Input'\n disabled={option.disabled}\n />\n </FormControl>\n <div>\n <FormLabel className='font-normal mb-0 RemoteFlows__RadioField__Label'>\n {option.label}\n </FormLabel>\n {option.description && (\n <FormDescription className='mt-2'>\n {option.description}\n </FormDescription>\n )}\n </div>\n </FormItem>\n </Fragment>\n ))}\n </RadioGroup>\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@/src/components/ui/select';\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';\n\ntype SelectFieldProps = JSFField & {\n placeholder?: string;\n options: Array<{ value: string | number; label: string }>;\n className?: string;\n onChange?: (value: any) => void;\n component?: Components['select'];\n};\n\nexport function SelectField({\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n component,\n ...rest\n}: SelectFieldProps) {\n const { control } = useFormContext();\n const { components } = useFormFields();\n\n return (\n <FormField\n defaultValue={defaultValue}\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n const CustomSelectField = component || components?.select;\n if (CustomSelectField) {\n const customSelectFieldProps = {\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n ...rest,\n };\n return (\n <CustomSelectField\n field={{\n ...field,\n onChange: (value: string | number) => {\n const maybeCastValue =\n rest.jsonType === 'number' ? Number(value) : value;\n field.onChange(maybeCastValue);\n onChange?.(maybeCastValue);\n },\n }}\n fieldState={fieldState}\n fieldData={customSelectFieldProps}\n />\n );\n }\n\n return (\n <FormItem\n data-field={name}\n className={`RemoteFlows__SelectField__Item__${name}`}\n >\n <FormLabel className='RemoteFlows__SelectField__Label'>\n {label}\n </FormLabel>\n <FormControl>\n <div className='relative'>\n <Select\n value={field.value || ''}\n onValueChange={(value: string) => {\n // For some reason react-hook-form converts option values from numbers to strings.\n // If a value can be cast to a number, the field in the form state should use the numeric type instead.\n const maybeCastValue =\n rest.jsonType === 'number' ? Number(value) : value;\n field.onChange(maybeCastValue);\n onChange?.(maybeCastValue);\n }}\n >\n <SelectTrigger\n className='RemoteFlows__SelectField__Trigger'\n aria-invalid={Boolean(fieldState.error)}\n aria-label={label}\n >\n <span className='absolute'>\n <SelectValue placeholder={label} />\n </span>\n </SelectTrigger>\n <SelectContent className='RemoteFlows__SelectField__Content'>\n <SelectGroup className='RemoteFlows__SelectField__Group'>\n {options.map((option) => (\n <SelectItem\n key={option.value}\n value={option.value}\n className='RemoteFlows__SelectField__SelectItem'\n >\n {option.label}\n </SelectItem>\n ))}\n </SelectGroup>\n </SelectContent>\n </Select>\n </div>\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useState } 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 { MultiSelect } from '../../ui/multi-select';\n\ntype CountryFieldProps = JSFField & {\n options: Array<{ value: string; label: string }>;\n onChange?: (value: any) => void;\n $meta: {\n regions: Record<string, string[]>;\n subregions: Record<string, string[]>;\n };\n component?: Components['countries'];\n};\n\nexport function CountryField({\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n $meta,\n component,\n ...rest\n}: CountryFieldProps) {\n const { control } = useFormContext();\n const { components } = useFormFields();\n const [selected, setSelected] = useState<any[]>([]);\n\n return (\n <FormField\n defaultValue={defaultValue}\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n const CustomSelectField = component || components?.countries;\n\n if (CustomSelectField) {\n const customSelectFieldProps = {\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n $meta,\n ...rest,\n };\n return (\n <CustomSelectField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customSelectFieldProps}\n />\n );\n }\n\n const countryOptions = [\n ...Object.entries($meta?.regions || {}).map(([key, value]) => ({\n value,\n label: key,\n category: 'Regions',\n })),\n ...Object.entries($meta?.subregions || {}).map(([key, value]) => ({\n value,\n label: key,\n category: 'Subregions',\n })),\n ...options.map((option) => ({\n ...option,\n value: option.value,\n label: option.label,\n category: 'Countries',\n })),\n ];\n\n const handleChange = (rawValues: any[]) => {\n const values = rawValues.map(({ value }) => value);\n field.onChange(values);\n onChange?.(values);\n setSelected(rawValues);\n };\n\n return (\n <FormItem\n data-field={name}\n className={`RemoteFlows__CountryField__Item__${name}`}\n >\n <FormLabel className='RemoteFlows__CountryField__Label'>\n {label}\n </FormLabel>\n <FormControl>\n <MultiSelect\n options={countryOptions}\n selected={selected}\n onChange={handleChange}\n {...rest}\n />\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","import { Fragment, useState } from 'react';\nimport { Check, ChevronDownIcon, X } from 'lucide-react';\n\nimport { Button } from '@/src/components/ui/button';\nimport { Badge } from '@/src/components/ui/badge';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandList,\n CommandSeparator,\n} from '@/src/components/ui/command';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/src/components/ui/popover';\nimport { cn } from '@/src/lib/utils';\n\nexport type Option = {\n label: string;\n value: string | string[];\n category?: string;\n};\n\ninterface MultiSelectProps {\n options: Option[];\n selected: Option[];\n onChange: (options: Option[]) => void;\n placeholder?: string;\n}\n\nexport function MultiSelect({\n options,\n selected,\n onChange,\n placeholder,\n ...props\n}: MultiSelectProps) {\n const [open, setOpen] = useState(false);\n const handleUnselect = (option: Option) => {\n onChange(selected.filter((item) => item.value !== option.value));\n };\n\n const hasCategories = options.some((option) => option.category);\n\n const groupedOptions = options.reduce(\n (groups, option) => {\n const category = option.category || 'Uncategorized';\n if (!groups[category]) {\n groups[category] = [];\n }\n groups[category].push(option);\n return groups;\n },\n {} as Record<string, Option[]>,\n );\n\n return (\n <Popover open={open} onOpenChange={setOpen} {...props}>\n <PopoverTrigger>\n <Button\n variant='outline'\n role='combobox'\n aria-expanded={open}\n className='w-full justify-between font-normal'\n type='button'\n >\n <div className='flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center'>\n {selected.length > 0 ? (\n selected.map((option) => {\n return (\n <Badge\n key={option.label}\n variant='secondary'\n className='mr-1 mb-1'\n >\n {option.label}\n <div\n role='button'\n tabIndex={0}\n aria-label={`remove ${option.label}`}\n className='ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer'\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n handleUnselect(option);\n }\n }}\n onMouseDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n onClick={() => handleUnselect(option)}\n >\n <X className='h-3 w-3 text-muted-foreground hover:text-foreground' />\n </div>\n </Badge>\n );\n })\n ) : (\n <span className='text-foreground'>{placeholder}</span>\n )}\n </div>\n <ChevronDownIcon className='size-4' />\n </Button>\n </PopoverTrigger>\n <PopoverContent align='start' className='w-full p-0'>\n <Command>\n <CommandList>\n <CommandEmpty>No item found.</CommandEmpty>\n {Object.entries(groupedOptions).map(\n ([category, categoryOptions], index) => (\n <Fragment key={category}>\n {index > 0 && <CommandSeparator />}\n <CommandGroup heading={hasCategories ? category : undefined}>\n {categoryOptions.map((option) => {\n const isSelected = selected.some(\n (item) => item.value === option.value,\n );\n return (\n <CommandItem\n key={option.label}\n onSelect={() => {\n onChange(\n isSelected\n ? selected.filter(\n (item) => item.value !== option.value,\n )\n : [...selected, option],\n );\n }}\n >\n <Check\n className={cn(\n 'mr-2 h-4 w-4',\n isSelected ? 'opacity-100' : 'opacity-0',\n )}\n />\n {option.label}\n </CommandItem>\n );\n })}\n </CommandGroup>\n </Fragment>\n ),\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n}\n","import * as React from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { SearchIcon } from 'lucide-react';\n\nimport { cn } from '@/src/lib/utils';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '@/src/components/ui/dialog';\n\nfunction Command({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot='command'\n className={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandDialog({\n title = 'Command Palette',\n description = 'Search for a command to run...',\n children,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string;\n description?: string;\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className='sr-only'>\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent className='overflow-hidden p-0'>\n <Command className='[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5'>\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction CommandInput({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div\n data-slot='command-input-wrapper'\n className='flex h-9 items-center gap-2 border-b px-3'\n >\n <SearchIcon className='size-4 shrink-0 opacity-50' />\n <CommandPrimitive.Input\n data-slot='command-input'\n className={cn(\n 'placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CommandList({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot='command-list'\n className={cn(\n 'max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot='command-empty'\n className='py-6 text-center text-sm'\n {...props}\n />\n );\n}\n\nfunction CommandGroup({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot='command-group'\n className={cn(\n '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',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot='command-separator'\n className={cn('bg-border -mx-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot='command-item'\n className={cn(\n \"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\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandShortcut({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot='command-shortcut'\n className={cn(\n 'text-muted-foreground ml-auto text-xs tracking-widest',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","import * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\nconst Textarea = React.forwardRef<\n HTMLTextAreaElement,\n React.ComponentProps<'textarea'>\n>(({ className, ...props }, ref) => {\n return (\n <textarea\n className={cn(\n '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',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n});\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\n\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\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 { Textarea } from '../../ui/textarea';\n\nexport type TextAreaFieldProps = JSFField & {\n onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n maxLength?: number;\n component?: Components['textarea'];\n};\n\nexport function TextAreaField({\n name,\n description,\n label,\n onChange,\n maxLength,\n component,\n ...rest\n}: TextAreaFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n return (\n <FormField\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n const CustomTextAreaField = component || components?.textarea;\n if (CustomTextAreaField) {\n const customTextAreaFieldProps = {\n name,\n description,\n label,\n maxLength,\n ...rest,\n };\n return (\n <CustomTextAreaField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customTextAreaFieldProps}\n />\n );\n }\n\n const valueLength = field.value?.length ?? 0;\n return (\n <FormItem\n data-field={name}\n className={`RemoteFlows__TextArea__Item__${name}`}\n >\n <FormLabel className='RemoteFlows__TextArea__Label'>\n {label}\n </FormLabel>\n <FormControl>\n <Textarea\n {...field}\n value={field.value ?? ''}\n onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) => {\n field.onChange(event);\n onChange?.(event);\n }}\n className={cn(\n fieldState.error &&\n 'border-red-500 focus-visible:ring-red-500',\n 'RemoteFlows__TextArea__Input',\n )}\n placeholder={label}\n />\n </FormControl>\n {(description || maxLength) && (\n <div className='flex items-center justify-between'>\n {description && (\n <FormDescription className='RemoteFlows__TextArea__Description'>\n {description}\n </FormDescription>\n )}\n {maxLength && (\n <span className='text-sm ml-auto RemoteFlows__TextArea__MaxLength'>\n {valueLength}/{maxLength}\n </span>\n )}\n </div>\n )}\n {fieldState.error && (\n <FormMessage className='RemoteFlows__TextArea__Error' />\n )}\n </FormItem>\n );\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useFormFields } from '@/src/context';\nimport { useFormContext } from 'react-hook-form';\nimport { FormField } from '../../ui/form';\nimport { TextField, TextFieldProps } from './TextField';\nimport { Components } from '@/src/types/remoteFlows';\n\ntype EmailFieldProps = TextFieldProps & {\n component?: Components['email'];\n};\n\nexport function EmailField(props: EmailFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n const CustomEmailField = props.component || components?.email;\n\n if (CustomEmailField) {\n return (\n <FormField\n control={control}\n name={props.name}\n render={({ field, fieldState }) => {\n return (\n <CustomEmailField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n props.onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={props}\n />\n );\n }}\n />\n );\n }\n\n return <TextField {...props} type='email' />;\n}\n","import { useFormContext } from 'react-hook-form';\nimport { FormField } from '../../ui/form';\nimport { Field } from '@/src/flows/types';\n\nexport function HiddenField(props: Field) {\n const { control } = useFormContext();\n\n return (\n <FormField\n control={control}\n name={props.name}\n render={({ field }) => {\n return <input {...field} type='hidden' />;\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState } from 'react';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport { useForm, useFormContext, useFieldArray } from 'react-hook-form';\nimport * as yup from 'yup';\n\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { useFormFields } from '@/src/context';\nimport { Form, FormField } from '@/src/components/ui/form';\nimport { Components } from '@/src/types/remoteFlows';\nimport { Button } from '@/src/components/ui/button';\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from '@/src/components/ui/dialog';\n\nimport {\n buildWorkScheduleSummary,\n calculateHours,\n calculateTotalWorkHours,\n DailySchedule,\n DAYS_OF_THE_WEEK,\n getShortWeekday,\n} from './workScheduleUtils';\nimport { CheckBoxField } from './CheckBoxField';\nimport { TextField } from './TextField';\n\ntype WorkScheduleFieldProps = JSFField & {\n name: string;\n default: DailySchedule[];\n onChange?: (value: any) => void;\n component?: Components['work-schedule'];\n};\n\ntype WorkScheduleFormData = {\n schedule: DailySchedule[];\n};\n\ntype WorkScheduleSelectionProps = {\n defaultSchedule: DailySchedule[];\n onSubmit: (data: WorkScheduleFormData['schedule']) => void;\n};\n\nconst fieldSchema = yup.object({\n day: yup.string().required(),\n checked: yup.boolean().required(),\n start_time: yup\n .string()\n .matches(/^([01]\\d|2[0-3]):([0-5]\\d)$/, 'Invalid time format (HH:mm)')\n .when('checked', {\n is: true,\n then: (schema) => schema.required('Required'),\n otherwise: (schema) => schema.optional().nullable(),\n }),\n end_time: yup\n .string()\n .matches(/^([01]\\d|2[0-3]):([0-5]\\d)$/, 'Invalid time format (HH:mm)')\n .when('checked', {\n is: true,\n then: (schema) => schema.required('Required'),\n otherwise: (schema) => schema.optional().nullable(),\n }),\n hours: yup.number().default(0),\n break_duration_minutes: yup.string().default('0'),\n});\n\nconst formSchema = yup.object({\n schedule: yup.array(fieldSchema),\n});\n\nfunction WorkScheduleSelectionForm({\n defaultSchedule,\n onSubmit,\n}: WorkScheduleSelectionProps) {\n const [openDialog, setOpenDialog] = useState(false);\n\n const transformedSchedule = DAYS_OF_THE_WEEK.map((day) => {\n const existingSchedule = defaultSchedule.find(\n (schedule) =>\n schedule.day.toLowerCase() === getShortWeekday(day).toLowerCase() ||\n schedule.day.toLowerCase() === day.toLowerCase(),\n );\n\n if (existingSchedule) {\n return {\n ...existingSchedule,\n day: getShortWeekday(day),\n checked: true,\n };\n }\n\n return {\n // We just need to override the day and checked. The rest of the fields are the same for every day.\n ...defaultSchedule[0],\n checked: false,\n day: getShortWeekday(day),\n };\n });\n\n const form = useForm<WorkScheduleFormData>({\n defaultValues: {\n schedule: transformedSchedule,\n },\n resolver: yupResolver(formSchema) as any,\n });\n\n const { handleSubmit, watch, reset, control, formState } = form;\n\n const { fields } = useFieldArray({\n name: 'schedule',\n control,\n });\n\n const watchedSchedule = watch('schedule');\n\n function handleSubmitWorkingHours(data: WorkScheduleFormData) {\n // We can only send the days that are checked.\n const schedule = data.schedule\n .filter(({ checked }) => checked)\n .map((day) => ({\n ...day,\n hours: calculateHours(day),\n }));\n\n onSubmit(schedule);\n setOpenDialog(false);\n }\n\n function handleCancel() {\n reset();\n setOpenDialog(false);\n }\n\n return (\n <div className='flex items-center justify-between'>\n <Dialog open={openDialog} onOpenChange={setOpenDialog}>\n <DialogTrigger asChild>\n <Button\n variant={'link'}\n className='flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger'\n >\n Edit Schedule\n </Button>\n </DialogTrigger>\n <DialogContent className='max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content'>\n <DialogHeader>\n <DialogTitle className='RemoteFlows__WorkScheduleSelectionForm__Title'>\n Edit employee working hours\n </DialogTitle>\n </DialogHeader>\n\n <Form {...form}>\n <form className='space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form'>\n <div className='rounded-lg'>\n <p className='text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description'>\n The times displayed are in the employee's time zone in the\n 24-hour format.\n </p>\n\n <div className='grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header'>\n <div className='col-span-2'></div>\n <div className='col-span-3 text-center'>START</div>\n <div className='col-span-1 text-center'></div>\n <div className='col-span-3 text-center'>END</div>\n <div className='col-span-2 text-center'>HOURS</div>\n {/* <div className=\"col-span-2 text-center\">ACTIONS</div> */}\n </div>\n\n <div className='RemoteFlows__WorkScheduleSelectionForm__Rows'>\n {fields.map((field, index) => {\n const currentDay = watchedSchedule[index];\n const calculatedHours = calculateHours(currentDay);\n\n return (\n <React.Fragment key={field.id}>\n <div className='grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours'>\n <div className='col-span-2 flex items-center gap-3'>\n <CheckBoxField\n label={field.day}\n name={`schedule.${index}.checked`}\n />\n </div>\n <div className='col-span-3'>\n <TextField\n name={`schedule.${index}.start_time`}\n includeErrorMessage={false}\n />\n </div>\n <div className='col-span-1 text-center text-gray-500'>\n to\n </div>\n <div className='col-span-3'>\n <TextField\n name={`schedule.${index}.end_time`}\n includeErrorMessage={false}\n />\n </div>\n <div className='col-span-2 text-center text-gray-600'>\n {isNaN(calculatedHours)\n ? '-'\n : `${calculatedHours} hours`}\n </div>\n </div>\n\n <div className='grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break'>\n <div className='col-span-2 text-gray-500'>Break</div>\n <div className='col-span-2'>\n <TextField\n name={`schedule.${index}.break_duration_minutes`}\n includeErrorMessage={false}\n />\n </div>\n <div className='col-span-2 text-gray-500'>\n minutes\n </div>\n <div className='col-span-4'></div>\n </div>\n </React.Fragment>\n );\n })}\n </div>\n </div>\n\n {Object.keys(formState.errors).length > 0 && (\n <p className='text-destructive text-sm mb-0'>\n Invalid time format (HH:mm)\n </p>\n )}\n\n <div className='flex gap-4 pt-4'>\n <Button\n type='button'\n className='reset-button'\n variant='outline'\n onClick={handleCancel}\n >\n Cancel\n </Button>\n <Button\n type='button'\n className='submit-button'\n onClick={handleSubmit(handleSubmitWorkingHours)}\n >\n Save Schedule\n </Button>\n </div>\n </form>\n </Form>\n </DialogContent>\n </Dialog>\n </div>\n );\n}\n\nexport function WorkScheduleField(props: WorkScheduleFieldProps) {\n const { components } = useFormFields();\n const { setValue, control, watch } = useFormContext();\n const watchedSchedule = watch(props.name);\n const [currentSchedule, setCurrentSchedule] =\n useState<DailySchedule[]>(watchedSchedule);\n\n const { workHoursSummary, breakSummary } =\n buildWorkScheduleSummary(currentSchedule);\n const totalWorkHours = calculateTotalWorkHours(currentSchedule);\n\n useEffect(() => {\n setValue(props.name, currentSchedule);\n }, [currentSchedule, props.name, setValue]);\n\n function onSubmit(data: WorkScheduleFormData['schedule']) {\n setCurrentSchedule(data);\n }\n\n const CustomWorkScheduleField =\n props.component || components?.['work-schedule'];\n\n if (CustomWorkScheduleField) {\n return (\n <FormField\n control={control}\n name={props.name}\n render={({ field, fieldState }) => {\n return (\n <CustomWorkScheduleField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n props.onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={{\n ...props,\n // @ts-expect-error - defaultFormattedValue is not part of fieldData. It's generated in this component.\n defaultFormattedValue: {\n workHoursSummary,\n breakSummary,\n totalWorkHours,\n },\n }}\n />\n );\n }}\n />\n );\n }\n\n return (\n <div className={`flex flex-col gap-3 RemoteFlows__WorkScheduleField`}>\n <p className={`text-sm RemoteFlows__WorkScheduleField__Title`}>\n Work hours\n </p>\n <div className='flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary'>\n <p\n className='text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours'\n dangerouslySetInnerHTML={{\n __html: workHoursSummary.join(', '),\n }}\n />\n\n <p className='text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break'>\n {breakSummary.join()}\n </p>\n <p className='text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total'>\n Total of <span>{totalWorkHours}</span> hours per week\n </p>\n <WorkScheduleSelectionForm\n defaultSchedule={currentSchedule}\n onSubmit={onSubmit}\n />\n </div>\n </div>\n );\n}\n","import {\n FieldError,\n FieldErrors,\n FieldValues,\n Ref,\n ResolverOptions,\n get,\n} from 'react-hook-form';\n\nconst setCustomValidity = (\n ref: Ref,\n fieldPath: string,\n errors: FieldErrors,\n) => {\n if (ref && 'reportValidity' in ref) {\n const error = get(errors, fieldPath) as FieldError | undefined;\n ref.setCustomValidity((error && error.message) || '');\n\n ref.reportValidity();\n }\n};\n\n// Native validation (web only)\nexport const validateFieldsNatively = <TFieldValues extends FieldValues>(\n errors: FieldErrors,\n options: ResolverOptions<TFieldValues>,\n): void => {\n for (const fieldPath in options.fields) {\n const field = options.fields[fieldPath];\n if (field && field.ref && 'reportValidity' in field.ref) {\n setCustomValidity(field.ref, fieldPath, errors);\n } else if (field && field.refs) {\n field.refs.forEach((ref: HTMLInputElement) =>\n setCustomValidity(ref, fieldPath, errors),\n );\n }\n }\n};\n","import {\n Field,\n FieldErrors,\n FieldValues,\n InternalFieldName,\n ResolverOptions,\n get,\n set,\n} from 'react-hook-form';\nimport { validateFieldsNatively } from './validateFieldsNatively';\n\nexport const toNestErrors = <TFieldValues extends FieldValues>(\n errors: FieldErrors,\n options: ResolverOptions<TFieldValues>,\n): FieldErrors<TFieldValues> => {\n options.shouldUseNativeValidation && validateFieldsNatively(errors, options);\n\n const fieldErrors = {} as FieldErrors<TFieldValues>;\n for (const path in errors) {\n const field = get(options.fields, path) as Field['_f'] | undefined;\n const error = Object.assign(errors[path] || {}, {\n ref: field && field.ref,\n });\n\n if (isNameInFieldArray(options.names || Object.keys(errors), path)) {\n const fieldArrayErrors = Object.assign({}, get(fieldErrors, path));\n\n set(fieldArrayErrors, 'root', error);\n set(fieldErrors, path, fieldArrayErrors);\n } else {\n set(fieldErrors, path, error);\n }\n }\n\n return fieldErrors;\n};\n\nconst isNameInFieldArray = (\n names: InternalFieldName[],\n name: InternalFieldName,\n) => {\n const path = escapeBrackets(name);\n return names.some((n) => escapeBrackets(n).match(`^${path}\\\\.\\\\d+`));\n};\n\n/**\n * Escapes special characters in a string to be used in a regex pattern.\n * it removes the brackets from the string to match the `set` method.\n *\n * @param input - The input string to escape.\n * @returns The escaped string.\n */\nfunction escapeBrackets(input: string): string {\n return input.replace(/\\]|\\[/g, '');\n}\n","import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport {\n FieldError,\n FieldValues,\n Resolver,\n appendErrors,\n} from 'react-hook-form';\nimport * as Yup from 'yup';\n\n/**\n * Why `path!` ? because it could be `undefined` in some case\n * https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string\n */\nfunction parseErrorSchema(\n error: Yup.ValidationError,\n validateAllFieldCriteria: boolean,\n) {\n return (error.inner || []).reduce<Record<string, FieldError>>(\n (previous, error) => {\n if (!previous[error.path!]) {\n previous[error.path!] = { message: error.message, type: error.type! };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[error.path!].types;\n const messages = types && types[error.type!];\n\n previous[error.path!] = appendErrors(\n error.path!,\n validateAllFieldCriteria,\n previous,\n error.type!,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n },\n {},\n );\n}\n\n/**\n * Creates a resolver for react-hook-form using Yup schema validation\n * @param {Yup.ObjectSchema<TFieldValues> | ReturnType<typeof Yup.lazy<Yup.ObjectSchema<TFieldValues>>>} schema - Yup validation schema\n * @param {Parameters<(typeof schema)['validate']>[1]} schemaOptions - Options to pass to Yup's validate/validateSync\n * @param {Object} resolverOptions - Additional resolver configuration\n * @param {('async' | 'sync')} [resolverOptions.mode] - Validation mode\n * @param {boolean} [resolverOptions.raw] - If true, returns raw values instead of validated results\n * @returns {Resolver<Yup.InferType<typeof schema>>} A resolver function compatible with react-hook-form\n * @example\n * const schema = Yup.object({\n * name: Yup.string().required(),\n * age: Yup.number().required(),\n * });\n *\n * useForm({\n * resolver: yupResolver(schema)\n * });\n */\nexport function yupResolver<TFieldValues extends FieldValues>(\n schema:\n | Yup.ObjectSchema<TFieldValues>\n | ReturnType<typeof Yup.lazy<Yup.ObjectSchema<TFieldValues>>>,\n schemaOptions: Parameters<(typeof schema)['validate']>[1] = {},\n resolverOptions: {\n mode?: 'async' | 'sync';\n raw?: boolean;\n } = {},\n): Resolver<Yup.InferType<typeof schema>> {\n return async (values, context, options) => {\n try {\n if (schemaOptions.context && process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n \"You should not used the yup options context. Please, use the 'useForm' context object instead\",\n );\n }\n\n const result = await schema[\n resolverOptions.mode === 'sync' ? 'validateSync' : 'validate'\n ](\n values,\n Object.assign({ abortEarly: false }, schemaOptions, { context }),\n );\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.raw ? Object.assign({}, values) : result,\n errors: {},\n };\n } catch (e: any) {\n if (!e.inner) {\n throw e;\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n e,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n };\n}\n","import groupBy from 'lodash.groupby';\nimport capitalize from 'lodash.capitalize';\n\nconst MINUTES_IN_HOUR = 60;\n\nexport const DAYS_OF_THE_WEEK = [\n 'monday',\n 'tuesday',\n 'wednesday',\n 'thursday',\n 'friday',\n 'saturday',\n 'sunday',\n] as const;\n\nexport type DailySchedule = {\n day: string;\n start_time: string;\n end_time: string;\n hours: number;\n break_duration_minutes: string;\n checked: boolean;\n};\n\n/**\n * Convert break duration in minutes to hours and minutes\n * @param breakDuration - Break duration in minutes\n * @returns Break duration in hours and minutes\n */\nfunction convertBreakDurationToHours(breakDuration: number) {\n if (breakDuration < 60) {\n return `${breakDuration}m`;\n }\n\n const hours = Math.floor(breakDuration / MINUTES_IN_HOUR);\n const minutes = breakDuration % MINUTES_IN_HOUR;\n\n if (minutes > 0) {\n return `${hours}h${minutes}m`;\n }\n\n return `${hours}h`;\n}\n\n/**\n * Calculate total work hours from daily schedules\n * @param dailySchedules - Daily schedules\n * @returns Total work hours\n */\nexport function calculateTotalWorkHours(dailySchedules: DailySchedule[]) {\n const totalWorkHours = dailySchedules.reduce((total, daySchedule) => {\n const sum = daySchedule.hours + total;\n return sum;\n }, 0);\n\n return Number(totalWorkHours.toFixed(2));\n}\n\n/**\n * Find the last consecutive day in a schedule (used to summarize work hours)\n * @param startDay - The starting day\n * @param dailySchedule - The daily schedule\n * @returns The last consecutive day\n */\nfunction findLastConsecutiveDay(\n startDay: string,\n dailySchedule: DailySchedule[],\n): Weekday | null {\n const daysScheduled = dailySchedule.map(\n ({ day }: DailySchedule) => day.toLowerCase() as Weekday,\n );\n\n let idx = daysScheduled.indexOf(startDay as Weekday);\n let day: Weekday | null = null;\n\n while (idx < daysScheduled.length && !day) {\n const currentDay = daysScheduled[idx];\n const nextDay = daysScheduled[idx + 1];\n\n const nextDayIdx = DAYS_OF_THE_WEEK.indexOf(currentDay) + 1;\n const isNextDay = DAYS_OF_THE_WEEK[nextDayIdx] === nextDay;\n\n if (!isNextDay) {\n day = currentDay;\n }\n\n idx += 1;\n }\n\n return day;\n}\n\n/**\n * Check if a day schedule should be summarized\n * @param daySchedule - The day schedule\n * @returns True if the day schedule should be summarized\n */\nfunction shouldSummarizeSchedule(daySchedule: DailySchedule) {\n return (\n daySchedule.start_time &&\n daySchedule.end_time &&\n (typeof daySchedule.hours === 'number'\n ? daySchedule.hours\n : Number.parseInt(daySchedule.hours)) > 0\n );\n}\n\n/**\n * Check if break duration should be summarized\n * @param daySchedule - The day schedule\n * @returns True if the break duration should be summarized\n */\nfunction shouldSummarizeBreaks(daySchedule: DailySchedule) {\n return Number.parseInt(daySchedule.break_duration_minutes) > 0;\n}\n\n/**\n * Build the work schedule summary\n * @param dailySchedules - The daily schedules\n * @returns The work schedule summary\n */\nexport function buildWorkScheduleSummary(dailySchedules: DailySchedule[]) {\n const activeScheduleDays = dailySchedules.filter(shouldSummarizeSchedule);\n\n const groupedWorkHours = groupBy(activeScheduleDays, (dailySchedule) => {\n return `${dailySchedule.start_time}|${dailySchedule.end_time}`;\n });\n\n const activeBreakDays = dailySchedules.filter(shouldSummarizeBreaks);\n const groupedBreaks = groupBy(activeBreakDays, 'break_duration_minutes');\n\n const workHoursSummary = Object.keys(groupedWorkHours).map(\n (scheduleTimes) => {\n const sameDailySchedule = groupedWorkHours[scheduleTimes];\n const startDay = sameDailySchedule[0].day;\n const [start_time, end_time] = scheduleTimes.split('|');\n const timeSummary = `from <span>${start_time.replace(':', 'h')}</span> to <span>${end_time.replace(':', 'h')}</span>`;\n\n const lastConsecutiveDay = findLastConsecutiveDay(\n startDay,\n sameDailySchedule,\n );\n const lastConsecutiveDayIdx = lastConsecutiveDay\n ? sameDailySchedule.findIndex(\n (dailySchedule) => dailySchedule.day === lastConsecutiveDay,\n )\n : -1;\n const allDaysAreConsecutive =\n lastConsecutiveDayIdx === sameDailySchedule.length - 1;\n\n if (sameDailySchedule.length === 1) {\n return `${capitalize(startDay)}, ${timeSummary}`;\n }\n\n if (!allDaysAreConsecutive || !lastConsecutiveDay) {\n return sameDailySchedule.reduce((summary, dailySchedule, idx) => {\n const day = capitalize(dailySchedule.day);\n if (idx === sameDailySchedule.length - 1) {\n return `${summary}and ${day}, ${timeSummary}`;\n }\n\n return `${summary}<span>${day}</span>, `;\n }, '');\n }\n\n return `<span>${capitalize(startDay)}</span> to <span>${capitalize(lastConsecutiveDay)}</span>, ${timeSummary}`;\n },\n );\n\n const breakSummary = Object.keys(groupedBreaks)\n .reverse()\n .map((breakDuration, idx) => {\n const isFirstGroup = idx === 0;\n const sameDailyBreaks = groupedBreaks[breakDuration];\n const breakString = convertBreakDurationToHours(\n parseInt(breakDuration, 10),\n );\n\n if (Object.keys(groupedBreaks).length === 1) {\n return `With ${breakString} daily breaks`;\n }\n\n if (sameDailyBreaks.length === 1) {\n const breakText = `${breakString} break on ${capitalize(sameDailyBreaks[0].day)}.`;\n return isFirstGroup ? `With ${breakText}` : breakText;\n }\n\n return sameDailyBreaks.reduce(\n (summary, dailySchedule, breakIdx) => {\n const day = capitalize(dailySchedule.day);\n\n if (breakIdx === 0) {\n return `${summary} ${day}`;\n }\n\n if (breakIdx === sameDailyBreaks.length - 1) {\n return `${summary}, and ${day}.`;\n }\n\n return `${summary}, ${day}`;\n },\n isFirstGroup\n ? `With ${breakString} break on`\n : `${breakString} break on`,\n );\n });\n\n return { workHoursSummary, breakSummary };\n}\n\n// Calculate hours for each day\nexport function calculateHours(day: DailySchedule) {\n const { checked, start_time, end_time, break_duration_minutes } = day;\n if (!checked) return 0;\n\n const [startHour, startMin] = start_time.split(':').map(Number);\n const [endHour, endMin] = end_time.split(':').map(Number);\n\n const startTotalMin = startHour * 60 + startMin;\n const endTotalMin = endHour * 60 + endMin;\n const workMinutes =\n endTotalMin -\n startTotalMin -\n Number.parseInt(break_duration_minutes || '0');\n\n const hours = workMinutes / 60;\n return hours === Math.floor(hours) ? hours : Number(hours.toFixed(2));\n}\n\ntype Weekday = (typeof DAYS_OF_THE_WEEK)[number];\n\nconst dayMap: Record<Weekday, string> = {\n monday: 'Mon',\n tuesday: 'Tue',\n wednesday: 'Wed',\n thursday: 'Thu',\n friday: 'Fri',\n saturday: 'Sat',\n sunday: 'Sun',\n};\n\nexport function getShortWeekday(fullName: Weekday): string {\n return dayMap[fullName];\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\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 { MultiSelect } from '../../ui/multi-select';\nimport { useState } from 'react';\n\ntype MultiSelectFieldProps = JSFField & {\n placeholder?: string;\n options: Array<{ value: string; label: string }>;\n className?: string;\n onChange?: (value: any) => void;\n component?: Components['select'];\n};\n\nexport function MultiSelectField({\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n component,\n ...rest\n}: MultiSelectFieldProps) {\n const { control } = useFormContext();\n const { components } = useFormFields();\n const [selected, setSelected] = useState<any[]>();\n\n return (\n <FormField\n defaultValue={defaultValue}\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n const CustomSelectField = component || components?.['multi-select'];\n if (CustomSelectField) {\n const customSelectFieldProps = {\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n ...rest,\n };\n return (\n <CustomSelectField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customSelectFieldProps}\n />\n );\n }\n\n const selectedOptions =\n selected ||\n options.filter((option) => field.value.includes(option.value));\n\n return (\n <FormItem\n data-field={name}\n className={`RemoteFlows__SelectField__Item__${name}`}\n >\n <FormLabel className='RemoteFlows__SelectField__Label'>\n {label}\n </FormLabel>\n <FormControl>\n <MultiSelect\n options={options}\n selected={selectedOptions}\n onChange={(rawValues: any[]) => {\n const values = rawValues.map(({ value }) => value);\n field.onChange(values);\n onChange?.(values);\n setSelected(rawValues);\n }}\n {...rest}\n />\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","import {\n NumberField,\n NumberFieldProps,\n} from '@/src/components/form/fields/NumberField';\n\n// TODO: We use the number field and the the number type is what the partner overrides\n// TODO: this needs to be changed in the future with the changes from https://github.com/remoteoss/remote-flows/pull/128\nexport const MoneyField = (props: NumberFieldProps) => {\n return <NumberField maxLength={15} {...props} />;\n};\n","import { CheckBoxField } from './CheckBoxField';\nimport { DatePickerField } from './DatePickerField';\nimport { FileUploadField } from './FileUploadField';\nimport { NumberField } from './NumberField';\nimport { RadioGroupField } from './RadioGroupField';\nimport { SelectField } from './SelectField';\nimport { CountryField } from './CountryField';\nimport { TextAreaField } from './TextAreaField';\nimport { TextField } from './TextField';\nimport { EmailField } from './EmailField';\nimport { HiddenField } from './HiddenField';\nimport { WorkScheduleField } from './WorkScheduleField';\nimport { MultiSelectField } from './MultiSelectField';\nimport { MoneyField } from './MoneyField';\nimport { SupportedTypes } from './types';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\n\nexport const baseFields: Record<\n Exclude<SupportedTypes, 'fieldset' | 'fieldset-flat'>,\n React.ComponentType<$TSFixMe>\n> = {\n checkbox: CheckBoxField,\n text: TextField,\n email: EmailField,\n money: MoneyField,\n select: SelectField,\n 'multi-select': MultiSelectField,\n radio: RadioGroupField,\n number: NumberField,\n file: FileUploadField,\n date: DatePickerField,\n textarea: TextAreaField,\n countries: CountryField,\n hidden: HiddenField,\n 'work-schedule': WorkScheduleField,\n};\n","import { Alert, AlertDescription, AlertTitle } from '@/src/components/ui/alert';\nimport { useFormFields } from '@/src/context';\nimport { AlertCircle } from 'lucide-react';\n\nexport type StatementProps = {\n title?: string;\n description: string;\n severity: 'warning' | 'error' | 'success' | 'info' | 'neutral' | 'time';\n};\n\nexport function Statement({ title, description, severity }: StatementProps) {\n const { components } = useFormFields();\n\n if (components?.statement) {\n const CustomStatement = components?.statement;\n return (\n <CustomStatement\n data={{\n title,\n description,\n severity,\n }}\n />\n );\n }\n\n return (\n <Alert variant='warning'>\n <AlertCircle className='h-4 w-4' />\n {title && <AlertTitle>{title}</AlertTitle>}\n {description && <AlertDescription>{description}</AlertDescription>}\n </Alert>\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { baseFields } from '@/src/components/form/fields/baseFields';\nimport { cn, sanitizeHtml } from '@/src/lib/utils';\nimport { SupportedTypes } from './types';\nimport {\n $TSFixMe,\n Components,\n FieldSetToggleComponentProps,\n} from '@/src/types/remoteFlows';\nimport { Statement, StatementProps } from '@/src/components/form/Statement';\nimport { useFormContext } from 'react-hook-form';\nimport { Fragment, useEffect, useRef } from 'react';\nimport { useFormFields } from '@/src/context';\nimport { Button } from '@/src/components/ui/button';\n\ntype FieldBase = {\n label: string;\n name: string;\n description: string;\n Component?: React.ComponentType<any>;\n inputType: SupportedTypes;\n multiple?: boolean;\n};\n\ntype FieldWithOptions = FieldBase & {\n type: 'select' | 'radio';\n options: Array<{ value: string; label: string }>;\n};\n\ntype FieldWithoutOptions = FieldBase & {\n type: Exclude<SupportedTypes, 'select' | 'radio'>;\n options?: never;\n};\n\ntype Field = FieldWithOptions | FieldWithoutOptions;\n\ntype FieldSetFeatures = {\n toggle?: {\n enabled: boolean;\n defaultExpanded?: boolean;\n stateField?: string;\n labels?: {\n expand: string;\n collapse: string;\n };\n className?: string;\n };\n};\n\nexport type FieldSetProps = {\n label: string;\n name: string;\n description: string;\n fields: Field[];\n features?: FieldSetFeatures;\n components: Components;\n statement?: StatementProps;\n isFlatFieldset: boolean;\n extra?: React.ReactNode;\n variant: 'outset' | 'inset';\n};\n\nconst DefaultToggleButton = ({\n isExpanded,\n onToggle,\n className,\n ...props\n}: FieldSetToggleComponentProps) => (\n <Button\n type='button'\n className={cn(\n 'RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton',\n className,\n )}\n variant='default'\n onClick={onToggle}\n {...props}\n >\n {isExpanded ? 'Remove' : 'Define'}\n </Button>\n);\n\nexport function FieldSetField({\n label,\n name,\n fields,\n description,\n components,\n statement,\n isFlatFieldset,\n extra,\n variant = 'outset',\n features,\n}: FieldSetProps) {\n const { watch, setValue, trigger, formState } = useFormContext();\n const { components: formComponents } = useFormFields();\n\n // Get expanded state from form state if stateField is provided\n const stateField = features?.toggle?.stateField;\n const isExpanded = stateField\n ? watch(stateField)\n : (features?.toggle?.defaultExpanded ?? true);\n\n const fieldNames = fields.map(\n ({ name: fieldName }) => `${name}.${fieldName}`,\n );\n const watchedValues = watch(fieldNames);\n const prevValuesRef = useRef<string[]>(watchedValues);\n const triggerTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n const toggleExpanded = () => {\n if (stateField) {\n setValue(stateField, !isExpanded);\n }\n };\n\n useEffect(() => {\n const currentValues = watchedValues;\n const previousValues = prevValuesRef.current;\n const hasBeenSubmitted = formState.isSubmitted || formState.submitCount > 0;\n\n // Check if any value has changed\n let hasChanged = false;\n for (let i = 0; i < currentValues.length; i++) {\n if (\n currentValues[i] !== undefined &&\n previousValues[i] !== currentValues[i]\n ) {\n hasChanged = true;\n // This is to prevent the form from triggering validation too many times\n break;\n }\n }\n // If changes detected and we haven't triggered yet, run trigger\n if (hasChanged && hasBeenSubmitted) {\n // We need to debounce the validation trigger so that tests don't freeze\n if (triggerTimeoutRef.current) {\n clearTimeout(triggerTimeoutRef.current);\n }\n triggerTimeoutRef.current = setTimeout(() => {\n trigger();\n }, 50);\n }\n\n prevValuesRef.current = [...currentValues];\n\n return () => {\n if (triggerTimeoutRef.current) {\n clearTimeout(triggerTimeoutRef.current);\n }\n };\n }, [watchedValues, trigger, formState.isSubmitted, formState.submitCount]);\n\n const ToggleComponent = formComponents?.fieldsetToggle || DefaultToggleButton;\n const contentId = `${name}-content`;\n const headerId = `${name}-header`;\n\n return (\n <fieldset\n className={cn(\n 'border-1 border-input p-4 rounded-xl',\n `RemoteFlows__FieldSetField`,\n `RemoteFlows__FieldSetField__${name}`,\n )}\n >\n <legend\n className={cn(\n 'text-sm font-semibold px-2',\n variant === 'inset' && 'hidden',\n )}\n >\n {label}\n </legend>\n {variant === 'inset' && (\n <div\n className='RemoteFlows__FieldSetField__Header'\n id={headerId}\n data-state={isExpanded ? 'expanded' : 'collapsed'}\n aria-expanded={isExpanded}\n >\n <h3 className={cn('RemoteFlows__FieldSetField__Title')}>{label}</h3>\n {features?.toggle?.enabled && (\n <ToggleComponent\n isExpanded={isExpanded}\n onToggle={toggleExpanded}\n aria-expanded={isExpanded}\n aria-controls={contentId}\n aria-label={`${isExpanded ? 'Hide' : 'Show'} ${label}`}\n className={cn(\n 'RemoteFlows__FieldSetField__Toggle',\n features.toggle?.className,\n )}\n >\n {isExpanded\n ? (features.toggle.labels?.collapse ?? 'Remove')\n : (features.toggle.labels?.expand ?? 'Define')}\n </ToggleComponent>\n )}\n </div>\n )}\n {isExpanded && (\n <div id={contentId} aria-labelledby={headerId} role='region'>\n {description ? (\n <div\n className='mb-5 RemoteFlows__FieldSetField__Description'\n dangerouslySetInnerHTML={{ __html: sanitizeHtml(description) }}\n />\n ) : null}\n <div className='grid gap-4'>\n {fields.map((field: $TSFixMe) => {\n if (field.calculateDynamicProperties) {\n field = {\n ...field,\n ...(field.calculateDynamicProperties(watchedValues, field) ||\n {}),\n };\n }\n let FieldComponent =\n baseFields[\n field.type as Exclude<\n SupportedTypes,\n 'fieldset' | 'fieldset-flat'\n >\n ];\n\n if (field.isVisible === false || field.deprecated) {\n return null; // Skip hidden or deprecated fields\n }\n\n if (field.Component) {\n const { Component } = field as {\n Component: React.ComponentType<any>;\n };\n return <Component key={field.name} {...field} />;\n }\n\n if (field.type === 'select' && field.multiple) {\n FieldComponent = baseFields['multi-select'];\n }\n\n return (\n <Fragment\n key={`${isFlatFieldset ? field.name : `${name}.${field.name}`}`}\n >\n <FieldComponent\n {...field}\n name={`${isFlatFieldset ? field.name : `${name}.${field.name}`}`}\n component={components?.[field.type as SupportedTypes]}\n />\n {field.extra ? field.extra : null}\n </Fragment>\n );\n })}\n {extra ? extra : null}\n {statement ? <Statement {...statement} /> : null}\n </div>\n </div>\n )}\n </fieldset>\n );\n}\n"],"mappings":"glBA+EY,OAyBE,YAAAA,GAzBF,OAAAC,EA8BQ,QAAAC,OA9BR,oBAlDL,SAASC,GAAc,CAC5B,KAAAC,EACA,aAAAC,EACA,YAAAC,EACA,MAAAC,EACA,SAAAC,EACA,SAAAC,EACA,QAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAuB,CACrB,GAAM,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAC/B,CAAE,QAAAC,CAAQ,EAAIC,EAAe,EAE7BC,EAAuBC,EAAA,CAC3BC,EACAC,EACAC,IACG,CACH,IAAMC,EAAgBD,EAAM,MAAQ,CAAC,GAAGA,EAAM,KAAK,EAAI,CAAC,EAEpDD,EAEGE,EAAc,SAASH,CAAQ,GAClCE,EAAM,SAAS,CAAC,GAAGC,EAAeH,CAAQ,CAAC,EAI7CE,EAAM,SAASC,EAAc,OAAQC,GAAUA,IAAUJ,CAAQ,CAAC,CAEtE,EAhB6B,wBAkB7B,OACElB,EAACuB,EAAA,CACC,QAAST,EACT,KAAMX,EACN,aAAcC,EACd,OAAQ,CAAC,CAAE,MAAAgB,EAAO,WAAAI,CAAW,IAAM,CACjC,IAAMC,EAAsBf,GAAaE,GAAY,SACrD,GAAIa,EAAqB,CACvB,IAAMC,EAA2B,CAC/B,KAAAvB,EACA,YAAAE,EACA,MAAAC,EACA,aAAAF,EACA,SAAAI,EACA,QAAAC,EACA,GAAGE,CACL,EACA,OACEX,EAACyB,EAAA,CACC,MAAO,CACL,GAAGL,EACH,SAAUH,EAACU,GAAa,CACtB,GAAInB,EAAU,CACZ,GAAM,CAAE,QAAAW,EAAS,MAAAG,CAAM,EAAIK,EAAI,OAC/BX,EAAqBM,EAAOH,EAASC,CAAK,EAC1Cb,IAAWY,CAAO,EAClB,MACF,CACAC,EAAM,SAASO,CAAG,EAClBpB,IAAWoB,CAA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,SAAAhB,EACIgB,EAAS,OAAO,QAAQ,UAAY,SACpCA,EAAS,OAAO,QAAQ,QAAU,SACzC,GAEJ,EAEDhB,GACCH,GAAC,OAAI,GAAI0C,GAAW,kBAAiBC,GAAU,KAAK,SACjD,UAAA9B,EACCd,EAAC,OACC,UAAU,+CACV,wBAAyB,CAAE,OAAQ6C,GAAa/B,CAAW,CAAE,EAC/D,EACE,KACJb,GAAC,OAAI,UAAU,aACZ,UAAAY,EAAO,IAAKiC,GAAoB,CAC3BA,EAAM,6BACRA,EAAQ,CACN,GAAGA,EACH,GAAIA,EAAM,2BAA2Bf,EAAee,CAAK,GACvD,CAAC,CACL,GAEF,IAAIC,GACFC,GACEF,EAAM,IAIR,EAEF,GAAIA,EAAM,YAAc,IAASA,EAAM,WACrC,OAAO,KAGT,GAAIA,EAAM,UAAW,CACnB,GAAM,CAAE,UAAAG,EAAU,EAAIH,EAGtB,OAAO9C,EAACiD,GAAA,CAA4B,GAAGH,GAAhBA,EAAM,IAAiB,CAChD,CAEA,OAAIA,EAAM,OAAS,UAAYA,EAAM,WACnCC,GAAiBC,GAAW,cAAc,GAI1C/C,GAACiD,GAAA,CAGC,UAAAlD,EAAC+C,GAAA,CACE,GAAGD,EACJ,KAAM,GAAG7B,EAAiB6B,EAAM,KAAO,GAAGlC,CAAI,IAAIkC,EAAM,IAAI,EAAE,GAC9D,UAAW/B,IAAa+B,EAAM,IAAsB,EACtD,EACCA,EAAM,MAAQA,EAAM,MAAQ,OAPxB,GAAG7B,EAAiB6B,EAAM,KAAO,GAAGlC,CAAI,IAAIkC,EAAM,IAAI,EAAE,EAQ/D,CAEJ,CAAC,EACA5B,GAAgB,KAChBF,EAAYhB,EAACmD,GAAA,CAAW,GAAGnC,EAAW,EAAK,MAC9C,GACF,GAEJ,CAEJ,CAlLgBb,EAAAO,GAAA","names":["Fragment","jsx","jsxs","CheckBoxField","name","defaultValue","description","label","onChange","multiple","options","component","rest","components","useFormFields","control","useFormContext","handleCheckboxChange","__name","optionId","checked","field","currentValues","value","FormField","fieldState","CustomCheckboxField","customCheckboxFieldProps","evt","FormItem","cn","FormControl","FormLabel","option","Checkbox","event","FormDescription","FormMessage","CalendarIcon","PopoverClose","ChevronLeft","ChevronRight","DayPicker","jsx","Calendar","className","classNames","showOutsideDays","props","DayPicker","cn","buttonVariants","__name","ChevronLeft","ChevronRight","PopoverPrimitive","jsx","Popover","props","__name","PopoverTrigger","PopoverContent","className","align","sideOffset","cn","format","Fragment","jsx","jsxs","DatePickerField","description","label","name","minDate","onChange","component","rest","components","useFormFields","control","useFormContext","minDateValue","getMinStartDate","FormField","field","fieldState","CustomDatePickerField","customDatePickerFieldProps","__name","value","FormItem","FormLabel","Popover","PopoverTrigger","FormControl","Button","cn","format","CalendarIcon","PopoverContent","Calendar","date","props","PopoverClose","FormDescription","FormMessage","useState","useRef","Upload","X","jsx","jsxs","FileUploader","onChange","className","multiple","files","setFiles","useState","inputRef","useRef","handleClick","__name","e","handleChange","newFiles","onRemoveFile","file","prevFiles","f","cn","Button","Upload","index","X","jsx","jsxs","toBase64","__name","file","resolve","reject","reader","error","convertFilesToBase64","event","files","base64","FileUploadField","name","description","label","multiple","onChange","component","rest","components","useFormFields","control","useFormContext","FormField","field","fieldState","CustomFileUploadField","customFileUploadFieldProps","value","FormItem","FormLabel","FormControl","FileUploader","cn","FormDescription","FormMessage","jsx","NumberField","props","components","useFormFields","control","useFormContext","CustomNumberField","FormField","field","fieldState","__name","value","TextField","Fragment","jsx","jsxs","RadioGroupField","name","defaultValue","description","label","options","onChange","component","rest","components","useFormFields","control","useFormContext","FormField","field","fieldState","CustomRadioGroupField","customRadioGroupFieldProps","__name","value","FormItem","cn","FormLabel","FormControl","RadioGroup","option","Fragment","RadioGroupItem","FormDescription","FormMessage","jsx","jsxs","SelectField","label","name","options","defaultValue","description","onChange","component","rest","control","useFormContext","components","useFormFields","FormField","field","fieldState","CustomSelectField","customSelectFieldProps","__name","value","maybeCastValue","FormItem","FormLabel","FormControl","Select","SelectTrigger","SelectValue","SelectContent","SelectGroup","option","SelectItem","FormDescription","FormMessage","useState","Fragment","useState","Check","ChevronDownIcon","X","CommandPrimitive","SearchIcon","jsx","jsxs","Command","className","props","CommandPrimitive","cn","__name","CommandList","className","props","jsx","CommandPrimitive","cn","__name","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","jsx","jsxs","MultiSelect","options","selected","onChange","placeholder","props","open","setOpen","useState","handleUnselect","__name","option","item","hasCategories","groupedOptions","groups","category","Popover","PopoverTrigger","Button","Badge","e","X","ChevronDownIcon","PopoverContent","Command","CommandList","CommandEmpty","categoryOptions","index","Fragment","CommandSeparator","CommandGroup","isSelected","CommandItem","Check","cn","jsx","jsxs","CountryField","label","name","options","defaultValue","description","onChange","$meta","component","rest","control","useFormContext","components","useFormFields","selected","setSelected","useState","FormField","field","fieldState","CustomSelectField","customSelectFieldProps","__name","value","countryOptions","key","option","handleChange","rawValues","values","FormItem","FormLabel","FormControl","MultiSelect","FormDescription","FormMessage","React","jsx","Textarea","className","props","ref","cn","jsx","jsxs","TextAreaField","name","description","label","onChange","maxLength","component","rest","components","useFormFields","control","useFormContext","FormField","field","fieldState","CustomTextAreaField","customTextAreaFieldProps","__name","value","valueLength","FormItem","FormLabel","FormControl","Textarea","event","cn","FormDescription","FormMessage","jsx","EmailField","props","components","useFormFields","control","useFormContext","CustomEmailField","FormField","field","fieldState","__name","value","TextField","jsx","HiddenField","props","control","useFormContext","FormField","field","__name","React","useEffect","useState","setCustomValidity","ref","fieldPath","errors","error","get","message","reportValidity","validateFieldsNatively","options","fields","field","refs","forEach","toNestErrors","shouldUseNativeValidation","fieldErrors","path","Object","assign","isNameInFieldArray","names","keys","fieldArrayErrors","set","name","escapeBrackets","some","n","match","input","replace","yupResolver","schema","schemaOptions","resolverOptions","values","context","options","Promise","resolve","process","env","NODE_ENV","console","warn","mode","Object","assign","abortEarly","then","result","shouldUseNativeValidation","validateFieldsNatively","raw","errors","e","r","u","_catch","inner","toNestErrors","error","validateAllFieldCriteria","criteriaMode","reduce","previous","path","message","type","types","messages","appendErrors","concat","reject","yup","groupBy","capitalize","MINUTES_IN_HOUR","DAYS_OF_THE_WEEK","convertBreakDurationToHours","breakDuration","hours","minutes","__name","calculateTotalWorkHours","dailySchedules","totalWorkHours","total","daySchedule","findLastConsecutiveDay","startDay","dailySchedule","daysScheduled","day","idx","currentDay","nextDay","nextDayIdx","shouldSummarizeSchedule","shouldSummarizeBreaks","buildWorkScheduleSummary","activeScheduleDays","groupedWorkHours","groupBy","activeBreakDays","groupedBreaks","workHoursSummary","scheduleTimes","sameDailySchedule","start_time","end_time","timeSummary","lastConsecutiveDay","allDaysAreConsecutive","capitalize","summary","breakSummary","isFirstGroup","sameDailyBreaks","breakString","breakText","breakIdx","calculateHours","checked","break_duration_minutes","startHour","startMin","endHour","endMin","startTotalMin","dayMap","getShortWeekday","fullName","jsx","jsxs","fieldSchema","__name","schema","formSchema","WorkScheduleSelectionForm","defaultSchedule","onSubmit","openDialog","setOpenDialog","useState","transformedSchedule","DAYS_OF_THE_WEEK","day","existingSchedule","schedule","getShortWeekday","form","useForm","o","handleSubmit","watch","reset","control","formState","fields","useFieldArray","watchedSchedule","handleSubmitWorkingHours","data","checked","calculateHours","handleCancel","Dialog","DialogTrigger","Button","DialogContent","DialogHeader","DialogTitle","Form","field","index","currentDay","calculatedHours","React","CheckBoxField","TextField","WorkScheduleField","props","components","useFormFields","setValue","useFormContext","currentSchedule","setCurrentSchedule","workHoursSummary","breakSummary","buildWorkScheduleSummary","totalWorkHours","calculateTotalWorkHours","useEffect","CustomWorkScheduleField","FormField","fieldState","value","useState","jsx","jsxs","MultiSelectField","label","name","options","defaultValue","description","onChange","component","rest","control","useFormContext","components","useFormFields","selected","setSelected","useState","FormField","field","fieldState","CustomSelectField","customSelectFieldProps","__name","value","selectedOptions","option","FormItem","FormLabel","FormControl","MultiSelect","rawValues","values","FormDescription","FormMessage","jsx","MoneyField","__name","props","NumberField","baseFields","CheckBoxField","TextField","EmailField","MoneyField","SelectField","MultiSelectField","RadioGroupField","NumberField","FileUploadField","DatePickerField","TextAreaField","CountryField","HiddenField","WorkScheduleField","AlertCircle","jsx","jsxs","Statement","title","description","severity","components","useFormFields","CustomStatement","Alert","AlertCircle","AlertTitle","AlertDescription","__name","Fragment","useEffect","useRef","jsx","jsxs","DefaultToggleButton","__name","isExpanded","onToggle","className","props","Button","cn","FieldSetField","label","name","fields","description","components","statement","isFlatFieldset","extra","variant","features","watch","setValue","trigger","formState","useFormContext","formComponents","useFormFields","stateField","fieldNames","fieldName","watchedValues","prevValuesRef","useRef","triggerTimeoutRef","toggleExpanded","useEffect","currentValues","previousValues","hasBeenSubmitted","hasChanged","i","ToggleComponent","contentId","headerId","sanitizeHtml","field","FieldComponent","baseFields","Component","Fragment","Statement"]}
|