{"version":3,"sources":["hooks/useQuery.tsx","store/actions/RateActions.ts","store/actions/CreateActions.ts","store/actions/ConsolidatedActions.ts","store/actions/AppActions.ts","components/Tables/_StatusCell.tsx","store/actions/FlowActions.ts","util/index.ts","components/Bar/ControlBar.tsx","components/Modals/ShipmentDetailsModal/styles.tsx","components/Buttons/CustomIconButton.tsx","util/pagination.ts","components/Cards/AddressSummaryCard.tsx","pages/auth/_LogoMessage.tsx","components/Inputs/_RenderInput.tsx","store/useBalanceStore.ts","util/rateYear.ts","util/removeStress.ts","config/index.ts","util/formatPrice.ts","components/Tables/DataGrid.tsx","assets/logo.svg","util/axios.ts","pages/customer/CreateOrUpdateCustomer/CustomerDocuments.tsx","store/WalletStore.ts","components/Modals/ConfirmActionDialog.tsx","components/Tables/CarrierService.tsx","store/useRateStore.ts","hooks/useTheme.tsx","components/Bar/RateOrSendControl.tsx","store/newstore/useNotificationStore.ts","components/Inputs/EnterpriseOperations.tsx","components/Inputs/ChannelInput.tsx","hooks/useStyles.tsx","pages/shipments/components.tsx","components/Tables/Controls/SaveButton/index.tsx","hooks/usePagination.tsx","components/Inputs/InputForms/PhoneNumberInput.tsx","components/Buttons/IOSSwitch.tsx","components/Inputs/InputSearchAddress.tsx","hooks/useInputSearchAddress.tsx","hooks/useLabels.tsx","pages/customer/CreateOrUpdateCustomer/useCustomerForm.tsx","components/Buttons/GoToDetailIconButton.tsx","js-scripts/loadGMaps.ts","components/Modals/_TrakingContainer.tsx","pages/customer/CreateOrUpdateCustomer/style.ts","pages/customer/ProspectsTable/useProspects.tsx","pages/customer/CreateOrUpdateCustomer/DocumentDetailModal.tsx","pages/documents/UploadDocumentBtn.tsx","pages/documents/styles.ts","pages/documents/useDocumentsForm.tsx","components/Forms/DropdownPaper/index.tsx","util/validators.ts","components/Forms/Client/ClientRate/useGetColumns.tsx","components/Forms/Permissions/helpers.ts","components/Forms/Notifications/NotificationRow.tsx","components/Tables/_AddressCell.tsx","util/preview.ts","components/Headings/index.tsx","pages/documents/DocumentsForm.tsx","context/DrawContext.tsx","components/Tables/Pagination/styles.tsx","components/Tables/Pagination/Pagination.tsx","components/Tables/Controls/AddButton/styles.tsx","components/Tables/Controls/AddButton/AddButton.tsx","store/newstore/usePurchaseStore.ts","assets/carriers/castores-logo.jpg","assets/carriers/dhl-logo.png","assets/carriers/estafeta-logo.png","assets/carriers/fedex-logo.png","assets/carriers/grupo-logo.png","assets/carriers/ivoy-logo.png","assets/carriers/jr-logo.png","assets/carriers/odm-logo.png","assets/carriers/planeacion-logo.png","assets/carriers/potosinos-logo.png","assets/carriers/redpack-logo.png","assets/carriers/tresguerras-logo.png","assets/carriers/zubut-logo.png","assets/carriers/happymile-logo.svg","assets/carriers/paquetexpress-logo.png","assets/logo-dark.svg","assets/carriers/pitic-logo.jpg","assets/carriers/halcon-logo.png","assets/carriers/sendex-logo.png","util/logos.ts","assets/carriers/borzo-logo.png","components/Tables/_MenuActionsButton.tsx","components/Guard/OnlyIf.tsx","components/Tabs/useStyles.ts","components/Tables/ShipmentTables/TableShipmentSend.tsx","components/Inputs/PackageTypeField.tsx","store/newstore/useReportExportsStore.ts","store/actions/ActionTypes.ts","hooks/useCurrentFlow.ts","components/Inputs/InputSearchContact.tsx","hooks/usePermissions.tsx","store/reducers/FlowReducer.ts","store/reducers/DataReducer.ts","store/reducers/AppReducer.ts","store/reducers/PickUpReducer.ts","store/reducers/SendReducer.ts","store/reducers/RateReducer.ts","store/reducers/CreateReducer.ts","store/reducers/ConsolidatedReducer.ts","store/reducers/agents/CreateorUpdateCustomerReducer.ts","store/reducers/agents/SimulatedUserReducer.ts","store/reducers/MultiSendReducer.ts","store/store.ts","components/Inputs/InputSearchPackage.tsx","hooks/useInputSearchPackages.tsx","components/Inputs/PackageContentField.tsx","components/Cards/InfoPickUpCard.tsx","components/Modals/ShipmentDetailsModal/useShipmentDetails.tsx","components/Tables/_TableControls.tsx","hooks/usePickupAvailability.tsx","pages/customer/ProspectsTable/columns.tsx","components/Forms/ServicesSelector/Selector.tsx","pages/customer/CreateOrUpdateCustomer/CreateOrUpdateClientControl.tsx","components/Modals/_LabelContainer.tsx","components/Maps/StaticMap.tsx","components/Modals/ShipmentDetailsModal/PackagesDetail.tsx","components/Modals/ShipmentDetailsModal/EditLabelFields.tsx","components/Modals/ShipmentDetailsModal/FilesLabelManual.tsx","components/Modals/ShipmentDetailsModal/ShipmentDetailsContent.tsx","assets/googlemapsicon.png","components/Maps/AutoCompleteMaps.tsx","components/Modals/ShipmentDetailsModal/ModalComponents.tsx","components/Modals/ShipmentDetailsModal/ShipmentDetailsModal.tsx","pages/tracking/styles.tsx","pages/tracking/ShipmentTracking.tsx","util/capitalize.ts","store/actions/agents/CreateorUpdateCustomerActions.ts","store/actions/agents/SimulateUserActions.ts","util/cellStatusColor.ts","components/Tabs/MenuTabs.tsx","pages/main/MainPage.tsx","components/Cards/AddressCardRate.tsx","components/Tables/TablePackagesCU.tsx","components/Cards/PackageCard.tsx","components/Containers/Rate.tsx","components/Cards/AddressCard.tsx","store/newstore/usePackagesStore.ts","components/Containers/Send.tsx","components/Containers/PickUp.tsx","assets/csv/template.csv","components/Containers/MultiSendLabel/index.tsx","store/ReportStore.ts","components/Inputs/EnterpriseType.tsx","components/Inputs/InputSearchAgentInitials.tsx","components/Forms/SignUpForm.tsx","components/Forms/Client/ClientForm.tsx","components/Forms/Client/ClientFiscalForm.tsx","components/Forms/ServicesSelector/columns.tsx","components/Forms/ServicesSelector/index.tsx","hooks/useServices.tsx","components/Forms/Client/ClientReports/ReportTableConfig/useReporTable.styles.ts","components/Forms/Client/ClientReports/ReportTableConfig/ColumnsReportConfig.tsx","components/Forms/Client/ClientReports/ReportTableConfig/options.ts","components/Forms/Client/ClientReports/ReportTableConfig/hooks/useOptions.tsx","components/Forms/Client/ClientReports/ReportTableConfig/GuidesRow.tsx","components/Forms/Client/ClientReports/ReportTableConfig/OverweightRow.tsx","components/Forms/Client/ClientReports/ReportTableConfig/InsuranceRow.tsx","components/Forms/Client/ClientReports/ClientReportsConfig.tsx","pages/customer/CreateOrUpdateCustomer/CreateOrUpdateCustomer.tsx","components/Tabs/CustomerFormTabs.tsx","pages/customer/CreateOrUpdateProspect/control.tsx","pages/customer/CreateOrUpdateProspect/index.tsx","pages/profile/styles.ts","pages/profile/ProfileRates.tsx","pages/profile/ProfileContract.tsx","pages/customer/CreateOrUpdateCustomer/CustomerFormPage.tsx","pages/customer/DocumentsPage/styles.ts","pages/customer/DocumentsPage/DocumentsPage.tsx","pages/profile/ProfileData.tsx","components/Tabs/ProfileTabs.tsx","pages/profile/ProfilePage.tsx","Routes.tsx","assets/menu/index.ts","assets/menu/home-hover.svg","assets/menu/home.svg","components/MenuIcons/MenuIcons.tsx","components/Navigation/LDrawer.tsx","components/Navigation/TopNavComponents/NotificationTopNav.tsx","components/Inputs/CustomerSelector/index.tsx","components/Navigation/TopNav/styles.ts","components/Navigation/TopNav/TopNav.tsx","components/ContentForCard/AddressCollapse.tsx","components/Maps/Map.tsx","components/Cards/RCard.tsx","components/Navigation/RDrawer.tsx","components/Navigation/SnackBarToast.tsx","components/Buttons/GradientButton.tsx","components/Inputs/PasswordInput.tsx","pages/auth/_CopyRight.tsx","pages/auth/SignInPage.tsx","pages/auth/CreatePasswordPage.tsx","pages/auth/ForgotPasswordPage.tsx","pages/loader/LoaderPage.tsx","components/Modals/ServerUpdatedModal.tsx","components/Modals/HomeNotificationModal.tsx","MuiClassNameSetup.js","App.tsx","reportWebVitals.ts","context/_GlobalContext.tsx","index.tsx","context/AuthContext.tsx","store/actions/PickUpActions.ts","store/actions/DataActions.ts","store/actions/SendActions.ts"],"names":["useQuery","URLSearchParams","useLocation","search","setAddressRate","address","target","dispatch","type","SET_DESTINATION_ADDRESS_RATE","SET_ORIGIN_ADDRESS_RATE","CAN_CONTINUE_TO_RATE_RATE","resetRate","RESET_RATE","addPkgRate","pkg","ADD_PACKAGE_RATE","removePackageRate","id","REMOVE_PACKAGE_RATE","updatePkgRate","payload","UPDATE_COLUMN_PACKAGE_RATE","triggerValidationsRate","status","TRIGGER_VALIDATE_BEFORE_RATE_RATE","setValidateFormPkgsRate","SET_FORM_PACKAGES_VALID_RATE","toggleOriginAddressComponent","TOGGLE_ORIGIN_ADDRESS_COMPONENT","toggleDestinationAddressComponent","TOGGLE_DESTINATION_ADDRESS_COMPONENT","resetCreate","RESET_CREATE","setAddressCreate","contacts","SET_DESTINATION_ADDRESS_CREATE","SET_ORIGIN_ADDRESS_CREATE","CAN_CONTINUE_TO_CREATE_CREATE","triggerValidationsCreate","TRIGGER_VALIDATE_BEFORE_CREATE_CREATE","resetConsolidated","RESET_CONSOLIDATED","startConsolidated","START_CONSOLIDATED","setConsolidatedDestinationForm","form","SET_CONSOLIDATED_DESTINATION_FORM","setConsolidatedOriginForm","SET_CONSOLIDATED_ORIGIN_FORM","setConsolidatedSpecials","SET_CONSOLIDATED_SPECIALS","cancelConsolidated","CANCEL_CONSOLIDATED","setOptionCosolidated","option","SET_OPTION_CONSOLIDATED","setPickUpConsolidated","SET_PICK_UP_CONSOLIDATED","setDeliverConsolidated","SET_DELIVER_CONSOLIDATED","postConsolidate","async","getStore","send","flow","rate","create","consolidated","currentFlow","origin","originAddressSend","destination","destinationAddressSend","originAddressRate","destinationAddressRate","originRequirements","requirements","destinationRequirements","specials","items","currentPackagesRate","currentPackagesSend","currentPackagesCreate","axios","post","error","console","log","resetApp","RESET_FLOW","RESET_SEND","RESET_PICKUP","RESET_LABELS_PICKUP","RESET_SIMULATED_USER","CLEAR_ADDRESS_DATA","editPackage","WILL_EDIT_PACKAGE","clearPackageToEdit","RESET_PACKAGE_TO_EDIT","setMapCoordinates","coordinates","SET_MAPS_COORDINATES","setDestinationMapCoordinates","SET_DESTINATION_COORDINATES","setGoogleMapsScriptStatus","SET_GOOGLE_MAPS_SCRIPT","setGoogleMap","map","SET_GOOGLE_MAP","setGoogleMapsMarker","marker","SET_GOOGLE_MAPS_MARKER","setGoogleMapsDestinationMarker","SET_GOOGLE_MAPS_DESTINATION_MARKER","setGoogleMapsPolyline","path","SET_GOOGLE_MAPS_POLYLINE","StatusCell","_ref","rectangle","backgroundColor","_jsx","style","getCellStatusColor","fontWeight","padding","borderRadius","textAlign","margin","minWidth","overflow","width","lineHeight","maxWidth","children","initFlow","INIT_FLOW","resetFlow","filterCarrierFlow","filter","data","FILTER_CARRIER_FLOW","services","sortCarrierFlow","sort","SORT_CARRIER_FLOW","disableInsuranceServicesFlow","DISABLE_GLOBAL_INSURANCE_FLOW","enableInsuranceServicesFlow","ENABLE_GLOBAL_INSURANCE_FLOW","setPackageContentOptions","options","SET_CONTENT_OPTIONS","setUninsurablePackages","uninsurablePackages","SET_UNINSURABLE_PACKAGES","showInsuranceServicesFlow","show","SHOW_GLOBAL_INSURANCE_FLOW","resetFilteredServicesFlow","SET_FILTERED_SERVICES","MUIDataGridTranslations","noRowsLabel","noResultsOverlayLabel","errorOverlayDefaultLabel","toolbarDensity","toolbarDensityLabel","toolbarDensityCompact","toolbarDensityStandard","toolbarDensityComfortable","toolbarColumns","toolbarColumnsLabel","toolbarFilters","toolbarFiltersLabel","toolbarFiltersTooltipHide","toolbarFiltersTooltipShow","toolbarFiltersTooltipActive","count","concat","toolbarExport","toolbarExportLabel","toolbarExportCSV","columnsPanelTextFieldLabel","columnsPanelTextFieldPlaceholder","columnsPanelDragIconLabel","columnsPanelShowAllButton","columnsPanelHideAllButton","filterPanelAddFilter","filterPanelDeleteIconLabel","filterPanelOperators","filterPanelOperatorAnd","filterPanelOperatorOr","filterPanelColumns","filterPanelInputLabel","filterPanelInputPlaceholder","filterOperatorContains","filterOperatorEquals","filterOperatorStartsWith","filterOperatorEndsWith","filterOperatorIs","filterOperatorNot","filterOperatorAfter","filterOperatorOnOrAfter","filterOperatorBefore","filterOperatorOnOrBefore","filterValueAny","filterValueTrue","filterValueFalse","columnMenuLabel","columnMenuShowColumns","columnMenuFilter","columnMenuHideColumn","columnMenuUnsort","columnMenuSortAsc","columnMenuSortDesc","columnHeaderFiltersTooltipActive","columnHeaderFiltersLabel","columnHeaderSortIconLabel","footerRowSelected","toLocaleString","footerTotalRows","footerTotalVisibleRows","visibleCount","totalCount","checkboxSelectionHeaderName","booleanCellTrueLabel","booleanCellFalseLabel","REGEX_POSITIVE_FLOAT_NUMBERS","useStyles","makeStyles","theme","root","height","position","bottom","background","border","boxSizing","spacing","left","transform","color","palette","white","main","zIndex","onHiddenCard","continueBtn","boxShadow","cursor","font","fontSize","disabled","opacity","ControlBar","props","classes","rCardStatus","useContext","DrawContext","_jsxs","Grid","container","justifyContent","alignItems","className","clsx","item","xs","onClick","onLeftControl","close","X","size","ArrowLeft","Divider","orientation","flexItem","onContinue","isLoading","CircularProgress","rightText","ArrowRight","styles","closeButton","right","top","grey","paper","radiusCard","marginTop","sectionTitle","leftSide","rightSide","box","display","gap","carrierBox","maxHeight","guideIdBox","paddingTop","guideData","marginLeft","marginRight","boxWithBorder","signImg","objectFit","signFile","package","marginBottom","merchandise","card","tableHead","notificationBox","paddingLeft","files","borderBottom","largeBtn","smallBtn","btns","immediateBillingBtn","flexDirection","primary","CustomIconButton","Button","reload","url","page","arguments","length","undefined","elements","args","mutate","CustomersPagination","URL","Table","reloadTable","this","LabelsPagination","Items","InputSearch","_len2","Array","_key2","reloadInputSearch","AddressesPagination","Transformer","addr","alias","scope","street","number","suite_number","city","business_name","neighborhood","state","zip_code","country","tax_id","reference","reference_streets","customer","name","owner","_len3","_key3","AddressSummaryCard","_props$isToBranch","_props$isToBranch2","_props$address11","_props$address12","_props$address12$busi","_props$address13","_props$address14","_props$address15","_props$address16","_props$address17","_props$address18","_props$address19","_props$address20","_props$address21","_props$address22","_props$address23","_props$address23$cont","_props$address24","_props$address24$cont","_props$address25","_props$address25$cont","cardClasses","useCardStyles","useDispatch","showSpecials","setShowSpecials","useState","formatAddress","capitalizeAll","toLowerCase","fullAddress","useMemo","_props$address","_props$address2","_props$address3","_props$address4","_props$address5","_props$address6","_props$address7","_formatAddress","_props$address8","_props$address9","_props$address10","street2","maneuvers_field_name","useRef","three_mts_distance","pickup_description","useEffect","showTitle","HeadingTwo","text","destinationBranchIsAvailable","minHeight","FormControlLabel","control","Checkbox","isToBranch","disable","checked","value","onChange","e","setIsToBranch","label","toUpperCase","carrier","onlyAddress","contact","TextTwo","capitalize","phone_number","email","isConsolidating","Accordion","expanded","prev","AccordionSummary","expandIcon","ChevronDown","Typography","variant","React","Fragment","event","stopPropagation","onFocus","IOSSwitch","AccordionDetails","FormControl","Controller","as","Select","Boolean","errors","current","native","rules","required","defaultValue","FormHelperText","message","TextField","multiline","minRows","placeholder","helperText","title","LogoMessage","src","getLogoByCarrierName","alt","align","component","subtitle","inputRoot","icon","RenderInput","hideIcon","for","includes","Home","User","Box","params","errorMessage","useBalanceStore","set","customerHasBalance","customer_modality","CustomerModality","BALANCE","MIXED","shouldDisplayBalance","serviceDescription","availableBalance","hasBalance","getRateCurrentYear","Date","getMonth","getFullYear","toString","removeStress","_text$normalize$repla","normalize","replace","LOGROCKET_ENABLE","process","LOGROCKET_KEY","END_POINT","END_POINT_WS","END_POINT_RATES","END_POINT_PAYMENTS","formatPrice","amount","Intl","NumberFormat","currency","maximumFractionDigits","format","DataGrid","BaseDataGrid","disableDensitySelector","localeText","components","Pagination","instance","baseURL","waitFor","ms","Promise","resolve","setTimeout","PollingStatus","checkAndRefreshToken","response","reqToken","config","headers","resToken","localStorage","setItem","interceptors","use","location","pollingResponse","get","DONE","Error","final","results","reject","labels","_error$response","getItem","removeItem","window","href","instanceRate","timeOut","instancePayment","STATUS_REF","approved","pending","rejected","STATUS_PAYLOAD","Validado","Pendiente","Rechazado","NAME_REF","ine","DocumentNameType","INE","tax","TAX","proof","PROOF_ADDRESS","constitutive_act","CONSTITUTIVE_ACT","assembly_act","ASSEMBLY_ACT","all","onlyMoral","CustomerDocuments","_ref3","_prospect$business_na","_prospect$business_na2","_customer$business_na","useParams","history","useHistory","rows","setRows","setData","openDetail","setOpenDetail","setFiles","loadingSubmit","setLoadingSubmit","getProspect","prospect","loading","loadingProspect","updateDocument","useProspects","loadingCustomer","useCustomerForm","isProfile","pathname","isCustomerView","onSubmit","useCallback","formData","prospectID","document_type","goToDetail","documentData","updateRows","requiredDocs","business_type","Entity","PHYSICAL","result","Object","entries","documents","key","_","_ref2","columns","resultColumns","field","headerName","flex","renderCell","row","push","UploadDocumentBtn","rowData","GoToDetailIconButton","Skeleton","direction","nameContainer","HeadingOne","toLocaleUpperCase","rowHeight","autoHeight","disableSelectionOnClick","hideFooter","DocumentDetailModal","isOpen","handleOpen","useWalletStore","walletDialog","toggleWalletDialog","currentBusiness","setCurrentBusiness","produce","draft","isEditing","setIsEditing","isPreinvoicesEditing","setIsPreinvoicesEditing","currentBusinessEditing","setCurrentBusinessEditing","currentBusinessItem","preinvoicePaymentData","setPreinvoicePaymentData","preinvoice","users","setUsers","reportFolioForRebill","setReportFolioForRebill","reportFolio","isRegisteringPayment","setIsRegisteringPayment","reset","contentContainer","btn","cancelCross","Transition","forwardRef","ref","Slide","ConfirmActionDialog","onClose","bodyText","handleClickConfirm","handleClickCancel","confirmBtnLabel","cancelBtnLabel","hideCancelBtn","actionType","setActionType","Dialog","open","TransitionComponent","keepMounted","DialogTitle","DialogContent","DialogContentText","DialogActions","handleCancel","handleConfirm","carrierLogo","carrierService","CarrierService","_Fragment","service","useRateStore","setServices","rateService","setRateService","selectedCarrier","setSelectedCarrier","setService","carrierOptions","setCarrierOptions","servicesOptions","setServicesOptions","proposals","setProposals","zones","setZones","zonesCost","setZonesCost","rates","setRates","dinamicRows","setDinamicRows","weights","setWeights","ranges","setRanges","clientRates","setClientRates","setUrl","years","setYears","useTheme","initialTheme","generateClassName","createGenerateClassName","disableGlobal","seed","currentTheme","setCurrentTheme","themeV4","createTheme","mode","default","typography","h4","h5","breakpoints","values","sm","md","lg","xl","MuiButton","styleOverrides","textTransform","borderColor","outlined","MuiIconButton","MuiFab","MuiPaper","backgroundImage","MuiSelect","MuiTextField","defaultProps","MuiFilledInput","select","MuiBottomNavigation","MuiPaginationItem","textPrimary","MuiAutocomplete","popper","listbox","MuiList","MuiMenuList","MuiDialog","MuiAccordion","shape","esES","toggleTheme","RateOrSendControl","useSelector","labelsPickup","addressPickUp","datePickUp","endTimePickUp","startTimePickUp","pickup","setOrigin","setDestination","pkgs","setPackages","firstStep","lastStep","CheckCircle","Package","MapPin","useNotificationStore","notificationsQueue","setNotificationQueue","notification","clearNotificationsQueue","setNotificationDefaultList","notifications","enterpriseOperationsOptions","EnterpriseOperations","_props$defaultValue","render","propsown","Autocomplete","openOnFocus","getOptionLabel","getOptionSelected","renderInput","_props$errors","_props$errors2","_props$errors2$enterp","enterprise_operations","autoComplete","PaperComponent","paperProps","DropdownPaper","channelOptions","ChannelInput","currentUser","AuthContext","localChannelOptions","setChannelOptions","f","role","UserRole","AGENT","ROOT","_props$errors2$channe","channel","maxWidthContainerCard","maxWidthContainer","cardStyles","hardColor","softColor","bottomBorderOnly","btnAddAutocompleteStyles","btnAdd","iconAdd","withoutStyles","useAddBtnAutocompleteStyles","btnAutocompleteClasses","tableStyles","justifySelf","paddingRight","optionSelected","borderTopLeftRadius","borderTopRightRadius","tableMUIContainer","tableMUIEmpty","tableMUIPagination","tableMUIHeaderColumn","borderLeft","input","useTableStyles","tableClasses","modalStyles","useModalStyles","modalClasses","_props$classes","_props$classes2","other","MuiDialogTitle","disableTypography","IconButton","withStyles","MuiDialogContent","paperFullScreen","scrollPaper","SaveButton","redirectTo","noIcon","SaveIcon","SendIcon","Truck","Eye","Edit","FOR_ACCOUNT_STATUS","usePagination","limit","param","transformer","queryParams","querySearch","canHaveActions","query","updateState","total","initialFetch","setNotification","simulatedUser","simulatedCustomer","isRootOrAgent","usePermissions","matchLabels","useRouteMatch","matchBusiness","fetcher","prevState","endpoint","_len","_key","queryValue","queryIndex","join","severity","isValidating","useSWR","i","queryName","revalidateOnFocus","onPageChange","details","keys","from","parseInt","inputContainer","transition","fontFamily","outline","borderRadious","PhoneNumberInput","setError","clearErrors","phoneNumber","useWatch","setErrorMessage","_errors$name","isValidPhoneNumber","_errors$name2","_errors$name3","phoneRef","_phoneRef$current","blur","PhoneInputWithCountrySelect","defaultCountry","switchBase","common","track","redTrack","dark","focusVisible","useRed","Switch","focusVisibleClassName","disableRipple","showAddBtn","PlusButtonAutoComplete","fullWidth","onMouseDown","preventDefault","callBack","saveCurrentFields","isCreating","PlusIcon","idForNewAddresses","filterOptionsAddress","createFilterOptions","trim","stringify","JSON","InputSearchAddress","setAddr","simpleAddr","setSimpleAddr","showError","setShowError","firstTimeMounted","setQuery","queryDebounce","useDebounce","addresses","updateParam","pms","updateParams","simpleData","simpleAddresses","sort_order","sort_by","user_id","setSimpleData","can","updateData","fetch","isMounted","parse","asURLSearchParams","paramsAsString","a","temporalAddresses","sortedData","sortData","b","scopeA","scopeB","useInputSearchAddress","isTouchedPickup","isTouchedSend","originQuery","destinationQuery","isTouchedRate","originAddressCreate","destinationAddressCreate","isTouchedCreate","setAddressQuery","setAddressSend","customer_id","isRating","isPickingUp","find","add","_addresses$find","_addresses$find2","isPickingUpFromDelivery","_addresses$find3","_defaultValue$contact","_addresses$find4","_defaultValue$contact2","setAddressPickUp","selectOnFocus","clearOnBlur","onAddButton","onInputChange","_event$nativeEvent$ta","nativeEvent","filterOptions","filtered","inputValue","groupBy","_option$alias","isCreatingCustomer","Tooltip","placement","address_type","EditIcon","noOptionsText","useLabels","pageSize","DISPERSION_TYPE_REF","CustomerDispersionType","GLOBAL","RESTRICTED","fromDispersion","editing","setEditing","setLoading","posting","setPosting","setCustomer","responseError","setResponseError","isCustomer","isRoot","setRCardStatus","servicesInfoDraftCUCustomer","cuCustomer","shallow","fetchCustomer","_DISPERSION_TYPE_REF$","axiosInstance","eo","set_of_operations","last_name","dispersion_type","setServicesCUCustomer","s","getCarrierName","err","goBack","getNewServices","onlyEstafeta","previousServicesIds","_item$carrier","CARRIERS","ESTAFETA","saveRates","estafetaNewServices","toSavedService","forEach","rates_service_description","year","customerId","proposal_id","volume","save","_form$reports","reports","r","_r$schema","schema","success","put","setSimulatedCustomer","_err$response","_err$response$data","_err$response2","_err$response3","_err$response4","isAxiosError","description","some","_err$response5","messages","flat","getPayloadServices","payloadServices","enabled","min_stock","price_list","discount","reissue_price","irregular_delivery_price","insurance_percentage","formatPayload","_data$company_type","_data$validation_stat","_DISPERSION_TYPE_REF$2","_payload$reports","guidesRowOfReport","overweightRowOdReport","insuranceRowOfReport","company_type","webpage","validation_status","business_address","external_number","internal_number","modality","conditions","billing","required_fiscal_information","hasSameFileSet","report_file_type","ReportFileType","SAME_FILE","_data$seller","pre_invoice_days","every","seller_id","seller","Search","loadGMaps","callback","document","getElementById","script","createElement","body","appendChild","onload","trakingContainer","down","windth","EventItem","events","index","listKey","TimelineItem","TimelineSeparator","TimelineDot","TimelineConnector","TimelineContent","TrackingContainer","_eventList$reverse","followUp","eventList","FEDEX","reverse","REDPACK","Timeline","moment","createdAt","PAQUETEXPRESS","DHL","SENDEX","FollowUpLabelStatus","REGISTERED","DELIVERED","CANCELLED","boxSpacing","leftArrow","saveButton","prospects","setProspects","setProspect","getProspects","_data$phone_number","prospectId","saveProspect","cb","INFO_FIELDS","FIELD_LABEL_REF","second_last_name","company_name","companny_name","admin_name","denomination","date","public_deed","notary_number","public_notary","date_of_issue","validity","names","titleContainer","btnContainer","headerContainer","statusBox","_data$description","handleSubmit","useForm","editableFields","resulFields","fullScreen","handleClose","file_type","_errors$item$name","isSubmitting","saveDocument","useDocumentsForm","handleUpload","formatImg","_resultFile$url","_resultFile$type","_resultFile$name","resultFile","file","blob","fileItem","File","assign","createObjectURL","reader","FileReader","onDrop","acceptedFile","newFile","getRootProps","getInputProps","useDropzone","noDrag","maxFiles","multiple","upload","btnLoader","UploadIcon","setIsLoading","setIsSubmitting","documentsData","setDocumentsData","getDocuments","token","_data$documents","_data$documents2","_data$documents3","_data$documents4","_data$documents5","ineData","taxData","proof_address","proofAddressData","constitutiveActData","assemblyActData","prospect_type","resultRows","_error$response$data","FormData","append","updatedData","_error$response2","_error$response2$data","_error$response3","_error$response3$data","Paper","Validators","RFC","Email","PhoneNumber","AddressAlias","AddressBusinessName","ShortBusinessName","LongBusinessName","Country","ZipCode","Neighborhood","City","State","Street","Number","ReferenceStreets","ContactName","isURL","EstafetaValidator","BusinessName","InternalNumber","ExternalNumber","ServicesRateName","ServicesName","ServicesModalityName","removeModalityIfPresent","NO_CREDIT","PREPAID","CONSUMPTION","getModality","formatServiceToRateName","NEXT_DAY","split","isNaN","useGetColumns","selectedProposal","setSelectedProposal","setColumns","selectedYear","setSelectedYear","fromUser","formattedServices","_services$map","_item$estafetaService","estafetaServiceName","setPrices","usePurchaseStore","getAllServices","fetchRates","_selected$","_selected$$proposals","_selected$0$proposals","_proposalToRate$rates","_proposalToRate$zones","range","copyZones","proposal","copyZonesCost","serviceState","selected","_item$estafetaService2","prop","modalityValue","proposalToRate","formattedZones","rangeVolumes","to","editable","_rate$rangeVolumes","formattedInfo","internalServiceName","weight","cost","zone","getClientRates","_response$data$rate_c","_rateProposal$","_rateProposal$$prices","_rateProposal$2","_rateProposal$2$price","_rateProposal$2$price2","_rateProposal$0$propo","yearRef","rate_configs","selectedServiceByUser","formattedCustomerRates","_item$service","rateProposal","formattedItem","_formattedItem$servic","prices","volumeItem","proposal_name","formatClientRatesInformation","ser","price","_price$rangeVolumes","_selected$zones","now","resetValues","syncClientRate","proposalId","getRateYears","yearsList","deleteRate","clientRatesId","rateConfigId","isProspect","delete","rate_config_id","_error$response4","_error$response4$data","setIsFromUpdate","Modules","Permissions","numberOfPermissions","PresetType","presets","Biller","permission","Billing","NoAccess","SC","Show","repeat","Administrator","Custom","Dispersion","presetOptions","preset","permissionOptions","module","NotificationStatusOption","STATUS_OPTIONS","ANY","DEFAULT_MODALITY","phoneInput","NotificationRow","_defaultValues$active","_originAddressSend$co","_originAddressSend$co2","_destinationAddressSe","_destinationAddressSe2","_originAddressSend$co3","_originAddressSend$co4","_destinationAddressSe3","_destinationAddressSe4","_originAddressSend$co5","_destinationAddressSe5","defaultValues","canEdit","isActive","setIsActive","active","phoneFieldName","phoneFieldValue","matchSendFlow","_errors$phoneFieldNam","_errors$phoneFieldNam2","disableClearable","guide_status","AddressCell","_props$address$contac","withoutAlias","splitTextIntoLines","maxCharactersPerLine","lines","first","words","line","substr","word","TextOne","_ref4","DocumentsForm","detailDocument","setDetailDocument","uploadedFiles","_rows$filter","_NAME_REF$params$row$2","_NAME_REF$params$row$","valueGetter","comment","getRowId","createContext","mobileLeftDrawerStatus","mobileRigthDrawerStatus","toggleLeftDrawer","toggleRightDrawer","helpDialogStatus","toggleHelpDialogStatus","showNotification","setShowNotification","showBarLogo","toggleBarLogo","setAvailableBalance","apiRef","useGridApiContext","useGridSelector","gridPageSelector","pageCount","gridPageCountSelector","BasePagination","setPage","AddButton","disabledTooltip","Plus","dispersion","customerServices","availableServices","servicesChargesOptionList","additionalCharges","setDispersion","setCarrier","setServicesAvailable","addService","deleteServiceSelected","serviceId","setServiceQuantity","quantity","original_quantity","setServicePrice","setCustomerId","setBusiness","business","paymentType","paymentMethod","cfdiUse","cfdiUseDescription","setPaymentMethod","setPaymentType","setCfdiUse","setCfdiDescription","setTaxRegimen","taxRegimen","tax_regimen","setCustomerServices","setOrder","order","setId","setType","setServicesChargesOptionList","servicesCharges","setAdditionalCharges","addAdditionalCharge","additionalCharge","_state$additionalChar","updateAdditionalCharge","chargeId","iva","_state$additionalChar2","charge","removeAdditionalCharge","_state$additionalChar3","castoresLogo","dhlLogo","estafetaLogo","fedexLogo","grupoLogo","ivoyLogo","jrLogo","odmLogo","planeacionaduanera","potosinosLogo","redpackLogo","tresGuerrasLogo","zubutLogo","encaminoLogoWhite","happymileLogo","paquetexpress","encaminoLogoDark","piticLogo","halconLogo","sendexLogo","IVOY","JR","PLANEACION","POTOSINOS","TRESGUERRAS","UBER","PITIC","RADIOTRANSPORTES","RHINO","HALCON","EXPRESS","MenuActionButton","showAlert","onDelete","onEdit","onDeleteText","deleteModalMessage","onEditText","setOpen","deleteText","editText","del","handleEdit","handleDelete","Trash2","OnlyIf","tabBorder","borderRight","getColumnsProps","hideColumns","hideDate","getServiceDescription","fromOrderSummary","serviceCellDescription","service_description","service_id","disableTouchListener","created_at","unshift","follow_up","topSide","TableShipmentSend","isSummaryPickUp","setSelectionModelPickUp","createdLabels","isEdittingPickup","selectionModelPickUp","werePreselectedLabelsAdded","selectionModel","setSelectionModel","parcelNumbers","carrierPickup","paramsAccordingToFlow","showDetails","setShowDetails","SSR","setSSR","currentRows","setCurrentRows","currentCarriers","setCurrentCarriers","serviceSend","toSet","d","parcel_number","addLabelPickup","_services","carriers","Set","resetLabelsPickup","setCarrierPickUp","labelsList","packages","setLabelsPickup","InputLabel","TableControls","linkToAdd","setFilteredRows","ShipmentDetailsModal","_item$user","user","checkboxSelection","disableColumnFilter","onSelectionModelChange","newSelectionModel","filterModel","columnField","operatorValue","onRowClick","p","paginationMode","rowCount","rowsPerPageOptions","_item$user2","_services$find$servic","_services$find","PackageTypeField","setOptions","getSATTypesCatalog","SATTypes","packaging","_props$errors2$packag","autoFocus","package_type","fieldName","useReportExportsStore","reportExports","setReportExports","removeReportExports","spreadsheet_id","ADD_ADDRESS_IN_FLOW","SET_UNIQUE_CARRIER_SERVICES_FLOW","SET_BATCH_ID","SET_RATE_ID","SET_FORM_PACKAGES_VALID_SEND","SET_ORIGIN_ADDRESS_SEND","SET_DESTINATION_ADDRESS_SEND","SWIPE_ADDRESS_SEND","SET_ORIGIN_CONTACT_SEND","SET_DESTINATION_CONTACT_SEND","ADD_PACKAGE_SEND","REMOVE_PACKAGE_SEND","ADD_MERCHANDISE_PACKAGE_SEND","SET_SERVICE_SEND","CAN_CONTINUE_TO_RATE_SEND","CAN_CONTINUE_TO_SUMMARY_SEND","TRIGGER_VALIDATE_BEFORE_RATE_SEND","UPDATE_COLUMN_PACKAGE_SEND","SET_INSURANCE_ON_SUMMARY","SET_ADDRESS_QUERY","RESET_SERVICE_SEND","SET_FORMATTED_ADDRESS","SET_ESTAFETA_OUTPUT_TYPE","SET_SAVE_ESTAFETA_OUTPUT_TYPE","SET_EXTRA_INFORMATION","SET_USE_TRADING","SET_NOTIFICATIONS","RESET_PACKAGES","SET_CARRIER_MULTISEND","SET_SERVICE_MULTISEND","RESET_MULTISEND","FETCH_PICKUPS","SET_PICKUP_DETAILS","UPDATE_PICKUP_DETAILS","UPDATE_PICKUP","CANCEL_PICKUP","SET_STATUS_PICKUP","SET_REASON_PICKUP","SET_CARRIER_FOLIO_PICKUP","CAN_CONTINUE_TO_EDIT_PICKUP","SET_ADDRESS_PICKUP","SET_CONTACT_PICKUP","ADD_LABEL_PICKUP","SET_LABELS_PICKUP","REMOVE_LABEL_PICKUP","SET_INDICATIONS_PICKUP","SET_EXTRA_INDICATIONS_PICKUP","SET_DATE_PICKUP","SET_TIME_PICKUP","TRIGGER_VALIDATE_BEFORE_SUMMARY_PICKUP","CAN_CONTINUE_TO_SUMMARY_PICKUP","SET_CARRRIER_PICKUP","CAN_MOVE_TO_BOOKLET_PICKUP","SET_INSURANCE_FOR_PICKUP","SET_PICKUP_SUPERVISOR","SET_PICKUP_NOTES","ADD_PACKAGE_CREATE","REMOVE_PACKAGE_CREATE","UPDATE_COLUMN_PACKAGE_CREATE","SET_FORM_PACKAGES_VALID_CREATE","SET_CARRIERS_CONSOLIDATED","FETCH_ADDRESSES_DATA","FETCH_PACKAGES_DATA","ADD_ADDRESS_DATA","ADD_PACKAGE_TEMP_DATA","EDIT_PACKAGE_TEMP_DATA","REMOVE_PACKAGE","FETCH_SUCCESS_DATA","FETCH_INIT_DATA","FETCH_FAIL_DATA","CLEAR_ERROR_FETCH_DATA","POST_RATE_DATA","POST_GUIDE_DATA","POST_PICKUP_DATA","CLEAR_SERVICES_DATA","CLEAR_PARCEL_NUMBERS","SET_CARRIERS","SET_SERVICES_CUCUSTOMER","SET_SIMULATED_USER","SET_SIMULATED_CUSTOMER_SIMULATED_USER","TRIGGER_ERRORS_SIMULATED_USER","CLEAR_ERROR_SIMULATED_USER","ContactPhoneType","BusinessStatus","ServiceTag","ShipmentSourceType","NotificationType","ReportType","SchemaType","ConditionTypeReport","ReportName","ReportSubType","ReportDateMonthly","ReportDateBiweekly","ReportDateWeekly","PreInvoiceDays","ReportNumber","PaymentConditions","BillingSchema","CustomerReportsReview","ProspectValidationStatus","Channel","useCurrentFlow","isSending","filterOptionsContact","idForNewContact","InputSearchContact","availableContactsPickUp","availableDestinationContactsSend","availableOriginContactsSend","availableDestinationContactsCreate","availableOriginContactsCreate","setContact","contactOptions","setContactOptions","setContactSend","arrow","disableFocusListener","disableHoverListener","type_phone_number","setContactPickup","newContactValue","currentPermissions","m","isAgent","isSeller","SELLER","CUSTOMER","isAgentOrCustomer","isClient","CLIENT","isBiller","BILLER","canUseEnvios","canUseLibreta","initialState","addingAddressTarget","disableGlobalInsuranceFlow","showGlobalInsuranceFlow","uniqueCarriers","filteredServicesFlow","isShowingDHL","indexDHL","contentOptions","FlowReducer","nextState","action","fs","total_cost","estimated_delivery_date","isSame","isBefore","findIndex","c","pickupMessage","totalCost","errorMessageData","DataReducer","addressCoordinates","destinationCoordinates","editingPackage","isLoadedGoogleMapsScript","destinationMarker","pathPolyline","AppReducer","indicationsPickUp","extraIndicationsPickUp","canContinueToSummaryPickUp","canMoveToBookletPickup","pickUpStatus","pickUpReason","pickUpCarrierFolio","pickupSupervisor","pickupNotes","canContinueToEditPickUp","pickups","insuranceForOrder","PickUpReducer","l","indications","extra_indications","time","_draft$addressPickUp","PickupStatus","carrierFolio","reason","_draft$addressPickUp2","EXCEPTED","originFormattedAddress","destinationFormattedAddress","estafetaOutputType","wantsToSaveOutputTypeForEstafeta","canContinueToRateSend","canContinueToSummarySend","areFormPkgsValidSend","showInsuranceOnSummary","batchId","rateId","additionalInfo","SendReducer","_draft$currentPackage","pkg_id","_draft$originAddressS","_draft$destinationAdd","temp","tempContacts","_draft$currentPackage2","merchandiseId","merchandiseIndex","outputType","canContinueToRateRate","areFormPkgsValidRate","originAddressComponent","destinationAddressComponent","RateReducer","canContinueToCreateCreate","canContinueToRateCreate","areFormPkgsValidCreate","CreateReducer","_draft$originAddressC","willBeConsolidated","currentCarriersConsolidated","optionConsolidated","useOriginRequirements","useDestinationRequirements","selectedCarriers","ConsolidatedReducer","createOrCustomerReducer","canPostSimulatedUser","isTouchedSimulatedUser","SimulatedUserReducer","carrierMultiSend","serviceMultiSend","multiSendReducer","rootReducer","combineReducers","multisend","MultiSendReducer","app","CreateOrUpdateCustomerReducer","enhancer","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","trace","compose","applyMiddleware","thunk","mainStore","createStore","useReduxSelector","toISOString","insurance","measurement","content","filterOptionsPackage","idForNewPackage","InputSearchPackage","useInputSearchPackages","setPkg","setDisable","shouldDisable","autoHighlight","canAddPkg","addPkgSend","handleChangePackage","PackageContentField","setValue","setRequireDescription","packageId","fieldError","setContentOptions","getPackagingContent","_data$filter","can_be_assured","insurance_description","newTitle","shouldValidate","updatePkgSend","_errors$package_conte","package_content","formWidth","InfoPickUpCard","withoutTitle","addPickup","isEditingPickup","extraIndications","setExtraIndications","debounceExtraIndications","setExtraIndicationsPickUp","shouldBeDisabled","PENDING","setIndicationsPickUp","maxRows","useShipmentDetails","selectedBusiness","setSelectedBusiness","pdf","setLabelPDF","errorPDF","setErrorPDF","loadingPDF","setLoadingPDF","loadingData","setLoadingData","setUpdatedData","businessList","setBusinessList","canHaveBusinessActions","fetchGuideDetails","isManual","carrierValue","guideId","guideRes","locale","resultData","getBusiness","business_id","putLabelBusiness","addCharges","_error$response$data$","_error$response2$data2","confirmReused","reused","usePickupAvailability","fedexAvailability","setFedexAvailability","checkFedexAvailability","_data$options","zipCode","formatData","_item$pickup_date","pickup_date","STATUS_LABELS","PROSPECTING","VALIDATED","DOCUMENTATION","REGISTER","validado_pero_pendiente_tarifas","customerTableColumns","prospect_id","buttonBackground","sortable","menuProps","Selector","isEstafeta","selectedService","Archive","CreateOrUpdateClientControl","generalInfo","legalInfo","addRateStep","rateInfo","Folder","ShoppingCart","DollarSign","labelContainer","noPDFTextContainer","fontStyle","LabelContainer","PDFObject","StaticMap","latitude","longitude","parameters","PackagesDetail","_item$measurement","_item$insurance","_item$description","PackageIcon","TableContainer","TableHead","TableRow","TableCell","TableBody","unit_code","EditLabelFields","compensation","notes","maxLength","fileContainer","linkText","textDecoration","iconContainer","fullWith","FileLink","downloadName","fileName","at","ListItem","Link","download","Download","FilesLabelManual","List","NOTIFICATION_FIELDS","shipping_mode","ShipmentDetailsContent","_updatedData$packages2","_dataWithPackagesId$p","_updatedData$notifica5","_updatedData$notifica6","_updatedData$notifica7","_updatedData$notifica8","_updatedData$notifica9","_updatedData$notifica10","_updatedData$files","_updatedData$files2","_updatedData$files3","getValues","loadingPostEdit","setLoadingPostEdit","immediateSchema","setImmediateSchema","openConfirmDialog","setOpenConfirmDialog","dataWithPackagesId","_updatedData$packages","subItem","deliveredTime","_updatedData$events","_updatedData$events2","_updatedData$events2$","paramId","_location$state","_location$state2","shouldDisplayPdf","EXPIRED","formatUrlParameters","_item$address","replaceAll","_updatedData$destinat","_updatedData$destinat2","_updatedData$origin$l","_updatedData$origin$l2","lat","lng","originCoordinates","createdAtDate","_moment$format","alignContent","tracking_number","EventAvailableIcon","can_edit_business","IMMEDIATE","immediate_billing","notified_reused","sign_delivery","received_by_name","isEditLabel","_updatedData$notifica","_updatedData$notifica2","_updatedData$notifica3","_updatedData$notifica4","contactIdShipper","notification_contacts","SHIPPPER","contact_id","contactIdRecipient","RECIPIENT","user_active","user_alias","user_phone_number","user_guide_status","contact_active","contact_alias","contact_phone_number","contact_guide_status","endIcon","Save","_item$alias","_updatedData$origin","_updatedData$origin$c","_updatedData$origin$c2","_item$alias2","_updatedData$destinat3","_updatedData$destinat4","_updatedData$destinat5","paddingBottom","LinearProgress","_item$type","AutoCompleteMaps","searchItemRef","place","setPlace","autocomplete","google","maps","places","componentRestrictions","setFields","bindTo","addListener","getPlace","geometry","infoForCallBack","address_components","addressType","types","searchCallback","inputRef","InputProps","startAdornment","InputAdornment","sx","googleMapsIcon","dividers","useTrackingStyles","carrierContainer","loader","ShipmentTracking","setGuideData","_guideData$events","_guideData$events2","_guideData$events2$fi","getTracking","guide","str","charAt","slice","_str$trim$toLowerCase","setSimulatedUser","triggerErrorSimulatedUser","clearErrorsSimulatedUser","COLORS","ShipmentStatusRef","FACILITY","SCANNED","TRANSIT","EXCEPTION","ABORT","FINALIZED","PickupStatusRef","SCHEDULED","RESCHEDULED","ROUTED","PARTIAL","COLLECTED","InvoiceStatus","LabelPaymentStatus","CustomerPaymentStatus","DispersionStatus","ABOUT_TO_CANCEL","ABOUT_TO_EXPIRE","ORANCE","REJECTED","RED","LIGHTBLUE","PRE_CANCELLED","BLUE","PAID","LIQUIDATED","ACTIVE","GREEN","VIOLET","GREY","menuOption","menuOptionSelected","MenuTabs","booklets","enabledTabs","booklet","tabs","currentTab","BottomNavigation","newValue","route","showLabels","tabName","BottomNavigationAction","logo","MainPage","appear","in","mountOnEnter","unmountOnExit","caption","AddressCardRate","searchWithMaps","setSearchWithMaps","_p$locality","postal_code","street_number","locality","sublocality_level_1","administrative_area_level_1","columnLabel","rowContainer","irregularLabel","dimensionsCell","inputAdorment","alignSelf","actionButtons","borderBottomRightRadius","borderRightColor","borderBottomLeftRadius","TableCellWithOutPadding","TablePackagesCU","register","formState","isValid","showInsurance","setValidateFormPkgsSend","isContentUninsurable","pkgContent","stickyHeader","column","_column$minWidth","_column$width","_column$maxWidth","packageToRateId","hover","tabIndex","_errors$pkgs","_errors$pkgs$i","_errors$pkgs2","_errors$pkgs$i2","_errors$pkgs$i2$quant","_row$quantity","_column$width2","_errors$pkgs3","_errors$pkgs$i3","_errors$pkgs4","_errors$pkgs$i4","_errors$pkgs$i4$lengt","_errors$pkgs5","_errors$pkgs$i5","_errors$pkgs6","_errors$pkgs$i6","_errors$pkgs$i6$width","_errors$pkgs7","_errors$pkgs$i7","_errors$pkgs8","_errors$pkgs$i8","_errors$pkgs$i8$heigh","_errors$pkgs9","_errors$pkgs$i9","_errors$pkgs10","_errors$pkgs$i10","_errors$pkgs$i10$meas","_errors$pkgs11","_errors$pkgs$i11","_errors$pkgs12","_errors$pkgs$i12","_errors$pkgs$i12$weig","_errors$pkgs13","_errors$pkgs$i13","_errors$pkgs14","_errors$pkgs$i14","_errors$pkgs$i14$insu","_column$width3","_row$type","_column$maxWidth2","_column$minWidth2","_column$maxWidth3","_column$width4","min","max","pattern","parseFloat","htmlFor","inputProps","endAdornment","ButtonGroup","removePackageSend","XSquare","is_irregular_delivery","t","PackageCard","currentPackages","addInsurance","setAddInsurance","setInsuranceOnSummary","labelPlacement","Rate","wantsToMove","setWantsToMove","Fade","timeout","canContinueWhenRating","AddressCard","usePackagesStore","hasOldContent","setHasOldContent","convertBtn","centerFab","Send","setReset","triggerValidationsSend","_item$merchandise","packageItem","checkPackageContent","hasOld","_item$merchandise2","localSearch","canContinueWhenSending","confirm","_item$content","_item$content$toLower","resetCreatedLabels","getUserBalance","Fab","swipeAddressSend","RefreshCcw","resetSend","inputTimes","linkTerms","terms","PickUp","_fedexAvailability$mo","_fedexAvailability$mo2","_fedexAvailability$mo3","_fedexAvailability$mo4","_fedexAvailability$mo5","_fedexAvailability$mo6","_fedexAvailability$mo7","_fedexAvailability$mo8","_fedexAvailability$mo9","_fedexAvailability$mo10","_fedexAvailability$mo11","_fedexAvailability$mo12","_fedexAvailability$mo13","_fedexAvailability$mo14","_fedexAvailability$mo15","_fedexAvailability$mo16","_fedexAvailability$mo17","_fedexAvailability$mo18","_fedexAvailability$mo19","_fedexAvailability$mo20","_fedexAvailability$mo21","_fedexAvailability$mo22","_fedexAvailability$mo23","_fedexAvailability$mo24","_fedexAvailability$mo25","infoRef","fedexRef","triggerValidationsPickup","setTimePickUp","itemId","dataItem","_labelsPickup$","isFedex","_infoRef$current","scrollIntoView","behavior","DatePicker","setDatePickUp","minDate","toDate","customInput","minTime","setHours","setMinutes","earliest_times","maxTime","showTimeSelect","showTimeSelectOnly","timeIntervals","timeCaption","dateFormat","latest_times","canContinueWhenPickingUp","resetPickup","registerPlugin","FilePondPluginFileValidateType","downloadButons","wrapper","MultiSendLabel","finished","setFinished","setSuccess","templateCsv","FilePond","allowMultiple","allowFileTypeValidation","acceptedFileTypes","fileValidateTypeLabelExpectedTypesMap","fileValidateTypeLabelExpectedTypes","labelIdle","allowRevert","server","metadata","load","progress","abort","source","axiosOriginal","CancelToken","method","cancelToken","onUploadProgress","lengthComputable","loaded","then","_response$data","_response$data2","_response$data3","catch","thrown","isCancel","cancel","useReportStore","overweigthReportNumber","setOverweightReportNumber","insuranceReportNumber","setInsuranceReportNumber","guidesCutoffDate","setGuidesCutoffDate","overweightCutoffDate","setoverweightCutoffDate","insuranceCutoffDate","setInsirancetCutoffDate","enterpriseTypeOptions","EnterpriseType","_props$errors2$compan","SearchAgentInitials","agents","setAgents","defaultValueProspect","limitTags","_props$errors2$seller","lastName","SignUpForm","_errors$business_name","_errors$last_name","_errors$email","_initialValues$compan","_initialValues$set_of","_errors$webpage","_STATUS_LABELS$initia","oldBussinesName","oldEmail","initialValues","disableSpecial","isCustomerPage","isProspectPage","enterpriseOpsProspectTitle","companyTypeProspectTitle","channelProspectTitle","minLength","validate","bn","_errors$business_type","_errors$validation_st","ClientForm","customID","blocked","handleStatus","cfdi","spaceWithCollapse","MODALITY_OPTIONS","TRACKING","INDEPENDENT","DISPERSION_TYPE_OPTIONS","BILLING_OPTIONS","ClientFiscalForm","_initialValues$disper","_capitalize3","_initialValues$report","_initialValues$report2","_capitalize4","_initialValues$report3","_initialValues$report4","clearSchema","hasPrepaid","_item$name","_capitalize","CASH","SEVEN_DAYS","FIFTEEN_DAYS","TWENTYTWO_DAYS","THIRTY_DAYS","SIXTY_DAYS","_ref5","_capitalize2","_ref6","RenderIsEnabled","editableCols","customerBalance","renderEditCell","handleChange","setEditCellValue","EnabledEditCheckboxCell","_params$row$tariff_na","borderBottomStyle","tariff_name","EnabledInputCell","_params$row$tariff_na2","EnabledEditInputCell","valueFormatter","valueFormatted","NotSuitableForRates","table","settingsContainer","helpText","ServicesTable","onCreateRateFromDispersion","fields","remove","useFieldArray","selectedServices","updateSelectedServices","updateCarrier","removeService","tariffsList","setSelectedService","servicesMap","updateServicesMap","updateLoading","setTariffsList","coolCarrierName","toAdd","serviceIndex","extra","getTariffs","newCarrierServices","serviceToMove","newSelectedServices","basePath","useServices","addedServices","setAddedServices","selectedRate","setSelectedRate","volumeForEstafetaRate","setVolumeForEstafetaRate","_carrier$value","hasFetchRates","tariffsOptions","_tariffsList$filter","_carrier$value2","done","setDone","showControlls","goToRate","_row$carrier","disableButton","ESTAFETA_TRACKING","ESTAFETA_PICKUP","ESTAFETA_TRACKING_PICKUP","getColumns","_selectedServices$ind","rateServiceName","existingRate","_existingRate$id","_service$rates_servic","currentYear","handleEditCellChangeCommitted","oldservices","serviceToUpdate","nextValue","selectAndFormatService","_tariff$percentage_in","_tariff$name","tariff","percentage_increase","_service$rates_servic2","_existingRate$prices$","_existingRate$prices$2","_existingRate$proposa","onEditCellPropsChange","small","big","medium","extraxBig","VeritcalBar","ColumnsReportsConfig","subtypeOptions","CURRENT_MONTH","PREVIOUS_MONTH","BIWEEK","WEEK","cutOptions","WEEKLY","BIWEEKLY","MONTHLY","cutOptionsOverweightSupplier","monthDateOptions","DAY_1","DAY_6","DAY_12","DAY_16","DAY_22","DAY_26","DAY_31","weeklyDateOptions","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY","biweeklyDateOptions","FIRST_WEEK","reviewOptions","INMEDIATE","THREE_DAYS","FIVE_DAYS","billingOptions","ONE_DAY","TWO_DAYS","PURCHASE_ORDER","useOptions","dateOptions","setDateOptions","subtype","setSubtype","setDate","reportNunberOptions","setReportNunberOptions","handleDateOptions","cutoffDate","dateValue","handleSubtypes","defautlValues","sub_type","handleReportNumber","reportNumber","num","GuidesRow","hasFilledValues","_initialValues$date","ONE","guides_schema","guides_date","guides_subtype","guides_conditions_report","guides_pre_invoice_days","REPORT_FILE_TYPE_OPTIONS","OverweightRow","_initialValues$name","overweightTypeName","reportFileType","guidesDate","reportNameConfigForOverweight","canNotEditCutData","OVERWEIGHTS","ONLY_OVERWEIGHTS","OVERWEIGHTS_AND_INSURANCES","LABELS_AND_INSURANCES","TWO","_option$num","overweight_reportNumber","OVERWEIGHTS_SUPPLIER","overweight_schema","overweight_date","_ref7","overweight_subtype","_ref8","overweight_conditions_report","_ref9","overweight_pre_invoice_days","InsuranceRow","ONLY_LABELS","THREE","LABELS_AND_OVERWEIGHTS","insurance_reportNumber","ALL","ONLY_INSURANCES","insurance_schema","insurance_date","insurance_subtype","insurance_conditions_report","_option$title","insurance_pre_invoice_days","tableContainer","ClientReportsConfig","LABELS","INSURANCES","CreateOrUpdateCustomer","_location$state4","setOldEmail","setBusinessName","guidesType","setGuidesType","overweighType","setOverweightType","insuranceType","setInsuranceType","isOpenDialog","setIsOpenDialog","formPayload","setFormPayload","setGuidesRowOfReport","setOverweightRwOfReport","setInsuranceRowOfReport","reportsRef","servicessRef","fromCreateDispersion","setStatus","setBlocked","trigger","watch","overweight_name","_overweight_name$valu","guidesSubtype","guidesCondition","guidesPreinvoice","overweightSubtype","overweightDate","overweightConditions","overweightPreinvoice","insuranceSubtype","insuranceDate","insuranceCondition","insurancePreinvoice","setGuidesCutConfig","setCutoffDate","_reportsRef$current","_servicessRef$current","_location$state3","fromDispersionQuery","ServicesSelector","newServices","newEstafetaServices","_location$state5","add_services_to_users","_location$state6","CustomerTabs","tab","formContainer","CreateOrUpdateProspect","_prospect$services","CreateOrUpdateProspectControl","dataContainer","ratesContainer","subsectionTitle","uploadBtn","ProfileRates","ratesList","setRatesList","inactivesRatesList","setInactivesRatesList","expandActivePDF","setExpandActivePDF","saveTariff","_selectedRate$carrier","axiosInstante","ratesOptions","list","countMap","reduce","acc","duplicates","_Object$keys","proposalOptions","hasProposalsToChoose","FileText","getRatesFiles","_data$tariffs","_data$tariffs2","tariffs","inactive","_currentUser$services","_currentUser$services2","_currentUser$services3","_ratesList$filter","carrierHasMoreThanOneRate","_option$service","_option$name","ExpandMoreIcon","ProfileContract","CustomerFormPage","_enabledTabs$index","isCustomerForm","customerBooklets","prospectBooklets","_location$pathname","Component","DocumentsPage","ProfileData","_customer$id","_customer$phone_numbe","getCustomer","_currentUser$customer","_currentUser$customer2","bookletOption","bookletOptionSelected","ProfileTabs","ProfilePage","CreateOrUpdatePackagePage","lazy","CreateOrUpdateAddressPage","SummaryPage","RatePage","ResultPage","ConsolidatedPage","ShipmentPage","UpdateLabelPage","CreateOrUpdateShipmentPage","BookletPage","CreateOrUpdateUserPage","CreateOrUpdateGroupPage","ConsolidatedResultPage","CustomerPage","AgentsPage","CreateOrUpdateAgentPage","CreateDispersionPage","DispersePage","CreateIssuePage","PackagingPage","BookletWallet","CreateFiscalPage","PreinvoiceFiscalResume","PendingPayments","CreditNoteRegister","PaymentRegister","DisperseBalance","ClientRate","CreateGuide","CreateSimpleAddress","PurchaseLabelsPage","BillingData","PurchaseConfirm","routes","exact","permissionKey","SendContainer","RateContainer","PickUpContainer","roles","Routes","Route","Redirect","memo","homeHover","home","fill","xmlns","RateIcon","PickupIcon","HistoryIcon","NotebookIcon","fillRule","clipRule","ClientsIcon","AgentsIcon","BillingIcon","rootList","paperLeftDrawer","homeIcon","menuImages","LDrawer","resetBusinessTabs","matchesLG","useMediaQuery","leftMenu","clearAddressesData","Hidden","mdUp","SwipeableDrawer","anchor","onOpen","smDown","Drawer","NotificationTopNav","clearNotifications","anchorEl","setAnchorEl","currentTarget","Badge","badgeContent","overlap","NotificationIcon","Menu","MenuListProps","MenuItem","_notification$callBac","call","PERMISSIONS_NAME_REF","groups","group","disperse","PERMISSIONS_VALUE_REF","canRead","canCreateUpdateDelete","none","CustomerSelector","matchRoutes","store","customers","setCustomers","customerUsers","setCustomerUsers","searchQuery","setSearchQuery","debounceCustomer","currentRoute","_routes$filter","_route$path","_route$path2","_history$location$pat","indexOf","isFormWithAutocompleteFields","getCustomerBalance","remaining","getCustomerUsers","usersWithPermissions","usersPermissions","_data$data","_data$data$find","userBalance","customerData","_simulatedUser$custom","_route$permissionKey$","_routeItemParts$","_routeItemParts$2","routeItemParts","permissionModule","permissionType","permissions","first_name","_result$data","_result$data$customer","balance","grow","helpButton","menuButton","up","brand","alpha","searchIcon","pointerEvents","inputInput","transitions","sectionDesktop","sectionMobile","appBar","avatar","customerSelector","balanceData","divider","TopNav","setAuth","clearUser","matchClients","matchClient","matchAgent","matchAgents","matchOrder","matchSummary","matchRate","matchFiscalForm","matchFiscalSummary","matchGroupForm","matchProspects","matchProspect","matchDispersion","mobileMoreAnchorEl","setMobileMoreAnchorEl","isMenuOpen","isMobileMenuOpen","handleMobileMenuClose","handleMenuClose","menuTop","instanceAPI","defaults","userMenu","anchorOrigin","vertical","horizontal","transformOrigin","renderMobileMenu","AppBar","Toolbar","edge","MenuIcon","visibility","FontAwesomeIcon","faWallet","Avatar","MoreIcon","heading","pxToRem","secondaryHeading","secondary","addressCard","AddressCollapse","setExpanded","panel","isExpanded","Math","ceil","Maps","mapsDivRef","Map","center","zoom","gestureHandling","setDraggable","setZoom","setCenter","setPosition","Marker","animation","Animation","DROP","Polyline","geodesic","strokeColor","strokeOpacity","strokeWeight","setMap","anchorPoint","Point","draggable","crossOnDrag","evt","latLng","overflowX","RCard","mounted","Card","mobileContainer","desktopContainer","paperRightDrawer","rightDrawButton","RDrawer","SnackBarToast","clearError","Snackbar","autoHideDuration","Alert","GradientButton","styled","eyeContainer","PasswordInput","setShow","toggle","EyeOffIcon","EyeIcon","CopyRight","signIn","forgotPassword","SignInPage","_errors$password","setCurrentUser","rememberSession","setRememberSession","password","rel","userDetails","CreatePasswordPage","_errors$confirm_passw","validateToken","isSubmitted","confirm_password","ForgotPasswordPage","emailSent","setEmailSent","bkLine","LoaderPage","colorPrimary","titleText","textContent","dialogContent","borderTop","dialogActions","buttonConfirm","ServerUpdatedModal","onConfirm","disableEscapeKeyDown","HomeNotificationModal","_notification$title","_notification$message","onFinish","setConfirm","hideCheckbox","EXPIRED_DISPERSION","handleReadNotification","Radio","ClassNameGenerator","configure","componentName","mainContainer","App","setIsCheckingIsAuth","isCheckingIsAuth","isAuth","clearNotificationQueue","showServerUpdateAlert","setShowServerUpdateAlert","showDispersionAlert","setShowDispersionAlert","notificationAlert","setNotificationAlert","checkForNewerVersion","lastVersion","version","currentVersion","setInterval","MINUTE","clearInterval","handler","visibilityState","addEventListener","removeEventListener","socket","io","on","newDispersions","isArray","disconnect","intervalId","report","LogRocket","init","identify","StyledEngineProvider","injectFirst","StylesProvider","ThemeProvider","CssBaseline","Router","handleRealod","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","defaultPermissions","client","defaultUser","default_address","rate_price","GlobalContext","setMobileLeftDrawerStatus","setMobileRigthDrawerStatus","setHelpDialogStatus","setShowBarLogo","setIsAuth","setCurrentPermissions","updateUser","nextPermissions","Provider","auth","ReactDOM","Suspense","fallback","updatePickupDetails","setPickUpReason","setPickUpCarrierFolio","setPickUpSupervisor","setPickupNotes","setInsuranceForPickupOrder","addTempAddress","addTempPackage","postRate","_send$destinationAddr","_rate$destinationAddr","_send$originAddressSe","_rate$originAddressRa","_send$originAddressSe2","_rate$originAddressRa2","_send$destinationAddr2","_rate$destinationAddr2","_send$destinationAddr3","_rate$destinationAddr3","_send$destinationAddr4","_rate$destinationAddr4","_send$destinationAddr5","_rate$destinationAddr5","_send$originAddressSe3","_rate$originAddressRa3","ensuredPackages","pkgsPaylod","finalInsurance","_p$quantity","_p$is_irregular_deliv3","_p$is_irregular_deliv4","_p$is_irregular_deliv","_p$is_irregular_deliv2","toFixed","sendFlow","dcoords","ocoords","neighborhood_orgin","state_destination","city_destination","neighborhood_destionation","zip_destination","zip_origin","coordinates_destination","coordinates_origin","neighborhood_origin","neighborhood_destination","localCarriers","batch_id","encamino","_error$response3$data2","postPickUp","notify","_pickup$addressPickUp","_pickup$addressPickUp2","_pickup$addressPickUp3","_pickup$addressPickUp4","_pickup$addressPickUp5","_pickup$addressPickUp6","_pickup$addressPickUp7","_pickup$addressPickUp8","_pickup$addressPickUp9","_pickup$addressPickUp10","_pickup$addressPickUp11","_payload$location","_payload$location2","_payload$location3","resultLocation","parcel_numbers","earliest_time","toTimeString","latest_time","contact_name","collect_in","street1","street3","_error$response5","_error$response5$data","userId","postLabel","_send$destinationAddr34","_send$destinationAddr35","_send$originAddressSe34","_send$originAddressSe35","_send$originAddressSe36","_send$destinationAddr36","_send$originAddressSe37","_send$destinationAddr37","_send$originAddressSe4","_send$destinationAddr6","_send$originAddressSe5","_send$originAddressSe6","_send$originAddressSe7","_send$originAddressSe8","_send$originAddressSe9","_send$originAddressSe10","_send$originAddressSe11","_send$originAddressSe12","_send$originAddressSe13","_send$originAddressSe14","_send$originAddressSe15","_send$originAddressSe16","_send$originAddressSe17","_send$originAddressSe18","_send$originAddressSe19","_send$originAddressSe20","_send$originAddressSe21","_send$originAddressSe22","_send$originAddressSe23","_send$originAddressSe24","_send$originAddressSe25","_send$originAddressSe26","_send$originAddressSe27","_send$originAddressSe28","_send$originAddressSe29","_send$originAddressSe30","_send$originAddressSe31","_send$originAddressSe32","_send$originAddressSe33","_send$destinationAddr7","_send$destinationAddr8","_send$destinationAddr9","_send$destinationAddr10","_send$destinationAddr11","_send$destinationAddr12","_send$destinationAddr13","_send$destinationAddr14","_send$destinationAddr15","_send$destinationAddr16","_send$destinationAddr17","_send$destinationAddr18","_send$destinationAddr19","_send$destinationAddr20","_send$destinationAddr21","_send$destinationAddr22","_send$destinationAddr23","_send$destinationAddr24","_send$destinationAddr25","_send$destinationAddr26","_send$destinationAddr27","_send$destinationAddr28","_send$destinationAddr29","_send$destinationAddr30","_send$destinationAddr31","_send$destinationAddr32","_send$destinationAddr33","_send$serviceSend","_send$serviceSend2","_send$serviceSend3","_p$type","_p$content","_p$content$toLowerCas","_serviceSend$carrier","_p$is_irregular_deliv5","packageType","payloadData","merchandiseList","product_code","formattedOriginType","extension","formattedDestinationType","use_trading","rate_id","origin_info","destination_info","wants_to_save_output_type","output_type","streetOrigin","streetDestination","streetOrigin1","streetOrigin2","streetOrigin3","streetDestination1","streetDestination2","streetDestination3","_send$destinationAddr38","_send$destinationAddr39","ocurre_office","additional_info","label_price","overweight_price","parcelNumber","_error$response$statu","_error$response6","_error$response7","_error$response7$data","_error$response8","_error$response8$data","errorStatus","errorDescription","code","_error$response9","_error$response9$data","setCarriersList","addMerchandisePkgSend","setServiceSend","resetServiceSend","setExtraInformation","setNotificationsContacts","setEstafetaOutputType","setSaveEstafetaOutputType"],"mappings":"8GAAA,8CAEe,SAASA,IACvB,OAAO,IAAIC,gBAAgBC,cAAcC,OAC1C,C,gxFCgBO,MAAMC,EAAiBA,CAACC,EAAgCC,IAC9DC,IAGCA,EADc,gBAAXD,EACM,CAAEE,KAAMC,KAA8BJ,WAEtC,CAAEG,KAAME,KAAyBL,YAE3CE,EAAS,CAAEC,KAAMG,KAA4B,EAGjCC,EAAYA,KACjB,CAAEJ,KAAMK,OAGHC,EAAcC,GAAkBR,IAC5CA,EAAS,CAAEC,KAAMQ,IAAkBD,QACnCR,EAAS,CAAEC,KAAMG,KAA4B,EAGjCM,EAAqBC,GAAYX,IAC7CA,EAAS,CAAEC,KAAMW,KAAqBD,OACtCX,EAAS,CAAEC,KAAMG,KAA4B,EAEjCS,EAAgBA,CAACF,EAAqBG,KAC3C,CAAEb,KAAMc,KAA4BJ,KAAIG,YAGnCE,EAA0BC,IAC/B,CAAEhB,KAAMiB,KAAmCD,WAGtCE,EAA2BF,GAAqBjB,IAC5DA,EAAS,CAAEC,KAAMmB,KAA8BH,WAC/CjB,EAAS,CAAEC,KAAMG,KAA4B,EAGjCiB,EAA+BA,KACpC,CAAEpB,KAAMqB,OAGHC,EAAoCA,KACzC,CAAEtB,KAAMuB,OCzCHC,EAAcA,KACnB,CAAExB,KAAMyB,OAGHC,EACZA,CAAC7B,EAAgCC,EAAkC6B,IAClE5B,IAECA,EADc,gBAAXD,EACM,CAAEE,KAAM4B,KAAgC/B,UAAS8B,YAE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chunk.js","sourcesContent":["import { useLocation } from 'react-router';\n\nexport default function useQuery() {\n\treturn new URLSearchParams(useLocation().search);\n}\n\n","import { Dispatch } from 'redux';\nimport {\n\tSET_DESTINATION_ADDRESS_RATE,\n\tSET_ORIGIN_ADDRESS_RATE,\n\tRESET_RATE,\n\tADD_PACKAGE_RATE,\n\tREMOVE_PACKAGE_RATE,\n\tUPDATE_COLUMN_PACKAGE_RATE,\n\tTRIGGER_VALIDATE_BEFORE_RATE_RATE,\n\tCAN_CONTINUE_TO_RATE_RATE,\n\tSET_FORM_PACKAGES_VALID_RATE,\n\tRateActions,\n\tPackage,\n\tPayloadPackageRequest,\n\tAddressRequest,\n\tID,\n\tTOGGLE_ORIGIN_ADDRESS_COMPONENT,\n\tTOGGLE_DESTINATION_ADDRESS_COMPONENT,\n} from './ActionTypes';\n\nexport const setAddressRate = (address: AddressRequest | null, target: 'destination' | 'origin') => (\n\tdispatch: Dispatch\n) => {\n\tif (target === 'destination') {\n\t\tdispatch({ type: SET_DESTINATION_ADDRESS_RATE, address });\n\t} else {\n\t\tdispatch({ type: SET_ORIGIN_ADDRESS_RATE, address });\n\t}\n\tdispatch({ type: CAN_CONTINUE_TO_RATE_RATE });\n};\n\nexport const resetRate = (): RateActions => {\n\treturn { type: RESET_RATE };\n};\n\nexport const addPkgRate = (pkg: Package) => (dispatch: Dispatch) => {\n\tdispatch({ type: ADD_PACKAGE_RATE, pkg });\n\tdispatch({ type: CAN_CONTINUE_TO_RATE_RATE });\n};\n\nexport const removePackageRate = (id: ID) => (dispatch: Dispatch) => {\n\tdispatch({ type: REMOVE_PACKAGE_RATE, id });\n\tdispatch({ type: CAN_CONTINUE_TO_RATE_RATE });\n};\nexport const updatePkgRate = (id: string | number, payload: PayloadPackageRequest): RateActions => {\n\treturn { type: UPDATE_COLUMN_PACKAGE_RATE, id, payload };\n};\n\nexport const triggerValidationsRate = (status: boolean): RateActions => {\n\treturn { type: TRIGGER_VALIDATE_BEFORE_RATE_RATE, status };\n};\n\nexport const setValidateFormPkgsRate = (status: boolean) => (dispatch: Dispatch) => {\n\tdispatch({ type: SET_FORM_PACKAGES_VALID_RATE, status });\n\tdispatch({ type: CAN_CONTINUE_TO_RATE_RATE });\n};\n\nexport const toggleOriginAddressComponent = (): RateActions => {\n\treturn { type: TOGGLE_ORIGIN_ADDRESS_COMPONENT }\n}\n\nexport const toggleDestinationAddressComponent = (): RateActions => {\n\treturn { type: TOGGLE_DESTINATION_ADDRESS_COMPONENT }\n}","import { Dispatch } from 'redux';\nimport {\n\tSET_DESTINATION_ADDRESS_CREATE,\n\tSET_ORIGIN_ADDRESS_CREATE,\n\tRESET_CREATE,\n\tADD_PACKAGE_CREATE,\n\tREMOVE_PACKAGE_CREATE,\n\tUPDATE_COLUMN_PACKAGE_CREATE,\n\tTRIGGER_VALIDATE_BEFORE_CREATE_CREATE,\n\tCAN_CONTINUE_TO_CREATE_CREATE,\n\tSET_FORM_PACKAGES_VALID_CREATE,\n\tCreateActions,\n\tPackage,\n\tContact,\n\tPayloadPackageRequest,\n\tAddressRequest,\n\tID,\n\tTOGGLE_ORIGIN_ADDRESS_COMPONENT,\n\tTOGGLE_DESTINATION_ADDRESS_COMPONENT\n} from './ActionTypes';\n\nexport const resetCreate = (): CreateActions => {\n\treturn { type: RESET_CREATE };\n};\n\nexport const setAddressCreate =\n\t(address: AddressRequest | null, target: 'destination' | 'origin', contacts: Contact[]) =>\n\t(dispatch: Dispatch) => {\n\t\tif (target === 'destination') {\n\t\t\tdispatch({ type: SET_DESTINATION_ADDRESS_CREATE, address, contacts });\n\t\t} else {\n\t\t\tdispatch({ type: SET_ORIGIN_ADDRESS_CREATE, address, contacts });\n\t\t}\n\t\tdispatch({ type: CAN_CONTINUE_TO_CREATE_CREATE });\n\t};\n\nexport const addPkgCreate = (pkg: Package) => (dispatch: Dispatch) => {\n\tdispatch({ type: ADD_PACKAGE_CREATE, pkg });\n\tdispatch({ type: CAN_CONTINUE_TO_CREATE_CREATE });\n};\n\nexport const removePackageCreate = (id: ID) => (dispatch: Dispatch) => {\n\tdispatch({ type: REMOVE_PACKAGE_CREATE, id });\n\tdispatch({ type: CAN_CONTINUE_TO_CREATE_CREATE });\n};\nexport const updatePkgCreate = (\n\tid: string | number,\n\tpayload: PayloadPackageRequest\n): CreateActions => {\n\treturn { type: UPDATE_COLUMN_PACKAGE_CREATE, id, payload };\n};\n\nexport const triggerValidationsCreate = (status: boolean): CreateActions => {\n\treturn { type: TRIGGER_VALIDATE_BEFORE_CREATE_CREATE, status };\n};\n\nexport const setValidateFormPkgsCreate =\n\t(status: boolean) => (dispatch: Dispatch) => {\n\t\tdispatch({ type: SET_FORM_PACKAGES_VALID_CREATE, status });\n\t\tdispatch({ type: CAN_CONTINUE_TO_CREATE_CREATE });\n\t};\n\nexport const toggleOriginAddress = (): CreateActions => {\n\treturn { type: TOGGLE_ORIGIN_ADDRESS_COMPONENT };\n};\n\nexport const toggleDestinationAddress = (): CreateActions => {\n\treturn { type: TOGGLE_DESTINATION_ADDRESS_COMPONENT };\n};\n","import axios from '../../util/axios';\nimport { Dispatch } from 'redux';\nimport { RootStore } from '../store';\nimport {\n\tRESET_CONSOLIDATED,\n\tSTART_CONSOLIDATED,\n\tSET_CARRIERS_CONSOLIDATED,\n\tSET_CONSOLIDATED_DESTINATION_FORM,\n\tSET_CONSOLIDATED_ORIGIN_FORM,\n\tSET_CONSOLIDATED_SPECIALS,\n\tConsolidatedActions,\n\tCANCEL_CONSOLIDATED,\n\tSET_OPTION_CONSOLIDATED,\n\tSET_PICK_UP_CONSOLIDATED,\n\tSET_DELIVER_CONSOLIDATED,\n\tID\n} from './ActionTypes';\n\nexport const resetConsolidated = (): ConsolidatedActions => {\n\treturn { type: RESET_CONSOLIDATED };\n};\n\nexport const startConsolidated = (): ConsolidatedActions => {\n\treturn { type: START_CONSOLIDATED };\n};\n\nexport const setCarriersConsolidated = (carriers: string[]): ConsolidatedActions => {\n\treturn { type: SET_CARRIERS_CONSOLIDATED, carriers };\n};\n\nexport const setConsolidatedDestinationForm = (form: any): ConsolidatedActions => {\n\treturn { type: SET_CONSOLIDATED_DESTINATION_FORM, form };\n};\n\nexport const setConsolidatedOriginForm = (form: any): ConsolidatedActions => {\n\treturn { type: SET_CONSOLIDATED_ORIGIN_FORM, form };\n};\n\nexport const setConsolidatedSpecials = (form: any): ConsolidatedActions => {\n\treturn { type: SET_CONSOLIDATED_SPECIALS, form };\n};\n\nexport const cancelConsolidated = (): ConsolidatedActions => {\n\treturn { type: CANCEL_CONSOLIDATED };\n};\n\nexport const setOptionCosolidated = (option: ID): ConsolidatedActions => {\n\treturn { type: SET_OPTION_CONSOLIDATED, option };\n};\n\nexport const setPickUpConsolidated = (status: boolean): ConsolidatedActions => {\n\treturn { type: SET_PICK_UP_CONSOLIDATED, status };\n};\n\nexport const setDeliverConsolidated = (status: boolean): ConsolidatedActions => {\n\treturn { type: SET_DELIVER_CONSOLIDATED, status };\n};\n\nexport const postConsolidate =\n\t() => async (dispatch: Dispatch, getStore: () => RootStore) => {\n\t\tconst { send, flow, rate, create, consolidated } = getStore();\n\t\tconst payload: any = {};\n\t\tif (flow.currentFlow === 'send') {\n\t\t\tpayload.origin = {\n\t\t\t\t...send.originAddressSend\n\t\t\t};\n\t\t\tpayload.destination = {\n\t\t\t\t...send.destinationAddressSend\n\t\t\t};\n\t\t} else {\n\t\t\t// Rate\n\t\t\tpayload.origin = {\n\t\t\t\t...rate.originAddressRate\n\t\t\t};\n\t\t\tpayload.destination = {\n\t\t\t\t...rate.destinationAddressRate\n\t\t\t};\n\t\t}\n\n\t\tif (consolidated.originRequirements) {\n\t\t\tpayload.origin.requirements = consolidated.originRequirements;\n\t\t}\n\n\t\tif (consolidated.destinationRequirements) {\n\t\t\tpayload.destination.requirements = consolidated.destinationRequirements;\n\t\t}\n\n\t\tpayload.specials = consolidated.specials;\n\n\t\tpayload.items =\n\t\t\tflow.currentFlow === 'rate'\n\t\t\t\t? rate.currentPackagesRate\n\t\t\t\t: flow.currentFlow === 'send'\n\t\t\t\t? send.currentPackagesSend\n\t\t\t\t: create.currentPackagesCreate;\n\n\t\ttry {\n\t\t\tawait axios.post('/api/rate', payload);\n\t\t} catch (error) {\n\t\t\tconsole.log('Consolidated actions', error);\n\t\t}\n\t};\n","//import { Dispatch } from 'redux';\n// import axios from '../../util/axios';\n// import { RootStore } from '../store';\nimport { Dispatch } from 'redux';\nimport {\n\tAppActions,\n\tSET_MAPS_COORDINATES,\n\tRESET_PACKAGE_TO_EDIT,\n\tWILL_EDIT_PACKAGE,\n\tPackage,\n\tSET_GOOGLE_MAPS_SCRIPT,\n\tSET_GOOGLE_MAP,\n\tSET_GOOGLE_MAPS_MARKER,\n\tRESET_FLOW,\n\tRESET_SEND,\n\tRESET_PICKUP,\n\t// RESET_CUCUSTOMER,\n\tRESET_SIMULATED_USER,\n\tRESET_LABELS_PICKUP,\n\tRESET_RATE,\n\tRESET_CONSOLIDATED,\n\tSET_DESTINATION_COORDINATES,\n\tSET_GOOGLE_MAPS_DESTINATION_MARKER,\n\tSET_GOOGLE_MAPS_POLYLINE,\n\tCLEAR_ADDRESS_DATA\n} from './ActionTypes';\n\n/**\n * When log in with other account, trigger this function because\n * the stored data could not match with the real data\n * IMPORTANT add the new redux stores here in order to work properly\n */\n\nexport const resetApp = () => async (dispatch: Dispatch) => {\n\tdispatch({ type: RESET_FLOW });\n\tdispatch({ type: RESET_SEND });\n\tdispatch({ type: RESET_PICKUP });\n\tdispatch({ type: RESET_LABELS_PICKUP });\n\tdispatch({ type: RESET_RATE });\n\tdispatch({ type: RESET_CONSOLIDATED });\n\t// dispatch({ type: RESET_CUCUSTOMER });\n\tdispatch({ type: RESET_SIMULATED_USER });\n\tdispatch({ type: CLEAR_ADDRESS_DATA });\n};\n\n/**\n * Click on edit and redirect to the form\n */\nexport const editPackage = (pkg: Package): AppActions => {\n\treturn { type: WILL_EDIT_PACKAGE, pkg };\n};\n\n/**\n * Once the package is used\n */\nexport const clearPackageToEdit = (): AppActions => {\n\treturn { type: RESET_PACKAGE_TO_EDIT };\n};\n\nexport const setMapCoordinates = (coordinates: null | { lat: number; lng: number }): AppActions => {\n\treturn { type: SET_MAPS_COORDINATES, coordinates };\n};\n\nexport const setDestinationMapCoordinates = (\n\tcoordinates: null | { lat: number; lng: number }\n): AppActions => {\n\treturn { type: SET_DESTINATION_COORDINATES, coordinates };\n};\n\n/**\n * Google maps script\n */\nexport const setGoogleMapsScriptStatus = (status: boolean): AppActions => {\n\treturn { type: SET_GOOGLE_MAPS_SCRIPT, status };\n};\n\nexport const setGoogleMap = (map: google.maps.Map | null): AppActions => {\n\treturn { type: SET_GOOGLE_MAP, map };\n};\n\nexport const setGoogleMapsMarker = (marker: google.maps.Marker | null): AppActions => {\n\treturn { type: SET_GOOGLE_MAPS_MARKER, marker };\n};\n\nexport const setGoogleMapsDestinationMarker = (marker: google.maps.Marker | null): AppActions => {\n\treturn { type: SET_GOOGLE_MAPS_DESTINATION_MARKER, marker };\n};\n\nexport const setGoogleMapsPolyline = (path: google.maps.Polyline | null): AppActions => {\n\treturn { type: SET_GOOGLE_MAPS_POLYLINE, path };\n};\n","import React from 'react';\nimport { getCellStatusColor } from '~util/cellStatusColor';\n\ninterface Props {\n\tstatus: string;\n\trectangle?: boolean;\n\tbackgroundColor?: string;\n}\n\nconst StatusCell: React.FC = ({ status, rectangle, backgroundColor }) => {\n\treturn (\n\t\t\n\t\t\t{status}\n\t\t\n\t);\n};\n\nexport default StatusCell;\n","import { Dispatch } from 'redux';\nimport { RootStore } from '../store';\nimport {\n\tFlowActions,\n\tINIT_FLOW,\n\tFlow,\n\tRESET_FLOW,\n\tADD_ADDRESS_IN_FLOW,\n\tFILTER_CARRIER_FLOW,\n\tSORT_CARRIER_FLOW,\n\tDISABLE_GLOBAL_INSURANCE_FLOW,\n\tENABLE_GLOBAL_INSURANCE_FLOW,\n\tSHOW_GLOBAL_INSURANCE_FLOW,\n\tSET_FILTERED_SERVICES,\n\tSET_UNINSURABLE_PACKAGES,\n\tSET_CONTENT_OPTIONS\n} from './ActionTypes';\n\nexport const initFlow = (flow: Flow): FlowActions => {\n\treturn { type: INIT_FLOW, flow };\n};\n\nexport const resetFlow = (): FlowActions => {\n\treturn { type: RESET_FLOW };\n};\n\n// FIXME delete? it was not exported\n// Add and addres and know if it is for origin or destination\nexport const addAddressInFlow = (target: 'origin' | 'destination' | 'none'): FlowActions => {\n\treturn { type: ADD_ADDRESS_IN_FLOW, for: target };\n};\n\n/**\n * Apply filter by carrier name\n */\nexport const filterCarrierFlow =\n\t(filter: string) => async (dispatch: Dispatch, getStore: () => RootStore) => {\n\t\tconst { data } = getStore();\n\t\tdispatch({ type: FILTER_CARRIER_FLOW, filter, services: data.services });\n\t};\n\n/**\n * Apply sort\n */\nexport const sortCarrierFlow = (sort: number): FlowActions => {\n\treturn { type: SORT_CARRIER_FLOW, sort };\n};\n\n/**\n * When there is no insurance applied\n */\nexport const disableInsuranceServicesFlow = (): FlowActions => {\n\treturn { type: DISABLE_GLOBAL_INSURANCE_FLOW };\n};\n\n/**\n * When in the table the insurance applies\n */\nexport const enableInsuranceServicesFlow = (): FlowActions => {\n\treturn { type: ENABLE_GLOBAL_INSURANCE_FLOW };\n};\n\n/**\n * Set list of content options\n */\nexport const setPackageContentOptions = (options: string[]) => {\n\treturn { type: SET_CONTENT_OPTIONS, options };\n};\n/**\n * Set list of uninsurable content\n * */\nexport const setUninsurablePackages = (uninsurablePackages: string) => {\n\treturn { type: SET_UNINSURABLE_PACKAGES, uninsurablePackages };\n};\n\n/**\n * Apply global insurance in the rate results page\n */\nexport const showInsuranceServicesFlow = (show: boolean): FlowActions => {\n\treturn { type: SHOW_GLOBAL_INSURANCE_FLOW, show };\n};\n\nexport const resetFilteredServicesFlow =\n\t() => async (dispatch: Dispatch, getStore: () => RootStore) => {\n\t\tconst { data } = getStore();\n\t\tdispatch({ type: SET_FILTERED_SERVICES, services: data.services });\n\t};\n","export const MUIDataGridTranslations = {\n\t// Root\n\tnoRowsLabel: 'Sin información',\n\tnoResultsOverlayLabel: 'No se encontraron resultados',\n\terrorOverlayDefaultLabel: 'Ocurrió un error',\n\n\t// Density selector toolbar button text\n\ttoolbarDensity: 'Acomodo',\n\ttoolbarDensityLabel: 'Acomodo',\n\ttoolbarDensityCompact: 'Pequeña',\n\ttoolbarDensityStandard: 'Mediana',\n\ttoolbarDensityComfortable: 'Larga',\n\n\t// Columns selector toolbar button text\n\ttoolbarColumns: 'Columnas',\n\ttoolbarColumnsLabel: 'Seleccionar Columnas',\n\n\t// Filters toolbar button text\n\ttoolbarFilters: 'Filtros',\n\ttoolbarFiltersLabel: 'Mostar Filtros',\n\ttoolbarFiltersTooltipHide: 'Esconder Filtros',\n\ttoolbarFiltersTooltipShow: 'Mostrar Filtros',\n\ttoolbarFiltersTooltipActive: (count: number) => (count !== 1 ? `${count} filtros activos` : `${count} filtro activo`),\n\n\t// Export selector toolbar button text\n\ttoolbarExport: 'Exportar',\n\ttoolbarExportLabel: 'Exportat',\n\ttoolbarExportCSV: 'Descargar como CSV',\n\n\t// Columns panel text\n\tcolumnsPanelTextFieldLabel: 'Encontrar Columna',\n\tcolumnsPanelTextFieldPlaceholder: 'Título de columna',\n\tcolumnsPanelDragIconLabel: 'Reorder column',\n\tcolumnsPanelShowAllButton: 'Mostar todo',\n\tcolumnsPanelHideAllButton: 'Esconder Todo',\n\n\t// Filter panel text\n\tfilterPanelAddFilter: 'Agregar filtro',\n\tfilterPanelDeleteIconLabel: 'Delete',\n\tfilterPanelOperators: 'Operadores',\n\tfilterPanelOperatorAnd: 'And',\n\tfilterPanelOperatorOr: 'Or',\n\tfilterPanelColumns: 'Columnas',\n\tfilterPanelInputLabel: 'Valor',\n\tfilterPanelInputPlaceholder: 'Valor filtrado',\n\n\t// Filter operators text\n\tfilterOperatorContains: 'contiene',\n\tfilterOperatorEquals: 'es igual',\n\tfilterOperatorStartsWith: 'comienza con',\n\tfilterOperatorEndsWith: 'termina con',\n\tfilterOperatorIs: 'es',\n\tfilterOperatorNot: 'no es',\n\tfilterOperatorAfter: 'is after',\n\tfilterOperatorOnOrAfter: 'is on or after',\n\tfilterOperatorBefore: 'is before',\n\tfilterOperatorOnOrBefore: 'is on or before',\n\n\t// Filter values text\n\tfilterValueAny: 'any',\n\tfilterValueTrue: 'true',\n\tfilterValueFalse: 'false',\n\n\t// Column menu text\n\tcolumnMenuLabel: 'Menú',\n\tcolumnMenuShowColumns: 'Mostrar columnas',\n\tcolumnMenuFilter: 'Filtrar',\n\tcolumnMenuHideColumn: 'Esconder',\n\tcolumnMenuUnsort: 'Desordenar',\n\tcolumnMenuSortAsc: 'Ordenar ASC',\n\tcolumnMenuSortDesc: 'Ordenar DESC',\n\n\t// Column header text\n\tcolumnHeaderFiltersTooltipActive: (count: number) =>\n\t\tcount !== 1 ? `${count} filtros activos` : `${count} filtro activo`,\n\tcolumnHeaderFiltersLabel: 'Mostrar filtros',\n\tcolumnHeaderSortIconLabel: 'Sort',\n\n\t// Rows selected footer text\n\tfooterRowSelected: (count: number) =>\n\t\tcount !== 1 ? `${count.toLocaleString()} filas seleccionadas` : `${count.toLocaleString()} fila seleccionada`,\n\n\t// Total rows footer text\n\tfooterTotalRows: 'Registros Totales',\n\n\t// Total visible rows footer text\n\tfooterTotalVisibleRows: (visibleCount: number, totalCount: number) =>\n\t\t`${visibleCount.toLocaleString()} de ${totalCount.toLocaleString()}`,\n\n\t// Checkbox selection text\n\tcheckboxSelectionHeaderName: 'Checkbox selection',\n\n\t// Boolean cell text\n\tbooleanCellTrueLabel: 'true',\n\tbooleanCellFalseLabel: 'false',\n};\nexport const REGEX_POSITIVE_FLOAT_NUMBERS = /^[0-9]+(\\.\\d+)?$/;\n","import React, { useContext, ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { Grid, Divider, CircularProgress } from '@mui/material';\nimport { ArrowLeft, ArrowRight, X } from 'react-feather';\nimport DrawContext from '~context/DrawContext';\nimport { makeStyles } from '@mui/styles';\nimport { Theme } from '@mui/material/styles';\n\n// https://glassmorphism.com/\n\nconst useStyles = makeStyles((theme: Theme) => {\n\treturn {\n\t\troot: {\n\t\t\theight: 65,\n\t\t\tposition: 'fixed',\n\t\t\tbottom: 30,\n\n\t\t\twidth: '80%',\n\t\t\tminWidth: 200,\n\t\t\tmaxWidth: 850,\n\t\t\tbackground: 'rgba(66, 66, 66, 0.95)',\n\t\t\tborder: '1px solid rgba(255, 255, 255, 0.2)',\n\t\t\tboxSizing: 'border-box',\n\t\t\tborderRadius: theme.spacing(1),\n\t\t\t//backdropFilter: 'blur(5px)', // Disabled because not supported\n\t\t\tleft: '50%',\n\t\t\ttransform: 'translateX(-63%)',\n\n\t\t\t'@media screen and (max-width: 1400px)': {\n\t\t\t\ttransform: 'translateX(-50%)'\n\t\t\t},\n\n\t\t\t'& hr': {\n\t\t\t\tmargin: theme.spacing(-2, 0.5)\n\t\t\t},\n\t\t\t'& button': {\n\t\t\t\tcolor: theme.palette.white.main\n\t\t\t},\n\n\t\t\tzIndex: 1201\n\t\t},\n\n\t\tonHiddenCard: {\n\t\t\ttransform: 'translateX(-48%)'\n\t\t},\n\n\t\tcontinueBtn: {\n\t\t\tbackground: 'linear-gradient(180deg, #57BBD8 0%, #0088D5 100%), #57BBD8',\n\t\t\tborder: '1px solid rgba(199, 199, 199, 0.1)',\n\t\t\tboxSizing: 'border-box',\n\t\t\tboxShadow: '0px 4px 4px rgba(0, 0, 0, 0.1)',\n\t\t\tborderRadius: '0px 8px 8px 0px',\n\t\t\theight: '100%',\n\t\t\t//minWidth: 150,\n\t\t\twidth: '100%'\n\t\t},\n\t\tcursor: {\n\t\t\tcursor: 'pointer'\n\t\t},\n\t\tfont: {\n\t\t\tfontWeight: 'bold',\n\t\t\tfontSize: 15\n\t\t},\n\t\tdisabled: {\n\t\t\topacity: 0.8,\n\t\t\tcursor: 'auto',\n\t\t\tcolor: '#f2f2f2'\n\t\t}\n\t};\n});\n\ninterface Props {\n\tonContinue: () => void;\n\tclose?: boolean; // to render close btn insted of left arrow\n\tisLoading?: boolean; // to change the right text\n\tonLeftControl: () => void;\n\trightText: string;\n\tchildren: ReactNode;\n\tdisabled?: boolean;\n}\n\n/**\n * This is the wrapper for controls in the Control Bar\n */\n\nconst ControlBar: React.FC = (props) => {\n\tconst classes = useStyles();\n\tconst { rCardStatus } = useContext(DrawContext);\n\n\treturn (\n\t\t\n\t\t\t{/* Left most */}\n\t\t\t\n\t\t\t\t{props.close ? : }\n\t\t\t\t   \n\t\t\t\t\n\t\t\t\n\t\t\t{/* Controls */}\n\t\t\t\n\t\t\t\t{props.children}\n\t\t\t\n\t\t\t{/* Continue */}\n\t\t\t {\n\t\t\t\t\tif (props.disabled) return;\n\t\t\t\t\tprops.onContinue();\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{props.isLoading ? :

   {props.rightText}

}\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default ControlBar;\n","import { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { radiusCard } from '~hooks/useStyles';\n\nexport const styles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tmargin: 0,\n\t\tpadding: theme.spacing(1)\n\t},\n\tcloseButton: {\n\t\tposition: 'absolute',\n\t\tright: theme.spacing(4),\n\t\ttop: theme.spacing(4),\n\t\tcolor: theme.palette.grey[500]\n\t}\n}));\n\nexport const useStyles = makeStyles((theme: Theme) => ({\n\tcontainer: {\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tborderRadius: radiusCard,\n\t\tpadding: theme.spacing(3),\n\t\tmarginTop: 20,\n\t\t'&>h4': {\n\t\t\tmargin: `${theme.spacing(2)} 0 ${theme.spacing(2)} ${theme.spacing(2)}`,\n\t\t\twidth: '100%',\n\t\t\ttextAlign: 'left'\n\t\t}\n\t},\n\tsectionTitle: {\n\t\tfontSize: '18px'\n\t},\n\tleftSide: {\n\t\tpadding: `0 ${theme.spacing(2)}`\n\t},\n\trightSide: {\n\t\tpadding: `0 ${theme.spacing(2)} ${theme.spacing(2)} ${theme.spacing(5)}`\n\t},\n\tbox: {\n\t\tpadding: `${theme.spacing(2)} 0`,\n\t\twidth: '100%',\n\t\t'&>h5': {\n\t\t\tdisplay: 'flex',\n\t\t\talignItems: 'center',\n\t\t\tgap: '4px',\n\t\t\twidth: '100%'\n\t\t}\n\t},\n\tcarrierBox: {\n\t\tdisplay: 'flex',\n\t\tgap: '6px',\n\t\talignItems: 'center',\n\t\t'& > div:nth-child(1)': {\n\t\t\tmaxWidth: '92px !important',\n\t\t\tmaxHeight: '64px !important',\n\t\t\t'@media (min-width: 1300px)': {\n\t\t\t\tmaxWidth: '156px !important',\n\t\t\t\tmaxHeight: '74px !important'\n\t\t\t}\n\t\t}\n\t},\n\tguideIdBox: {\n\t\tfontWeight: 400,\n\t\tpaddingTop: '4px',\n\t\t'&>h5': {\n\t\t\tdisplay: 'flex',\n\t\t\talignItems: 'center',\n\t\t\tgap: '4px',\n\t\t\twidth: '100%',\n\t\t\tfontSize: '20px !important',\n\t\t\t'@media (min-width: 1300px)': {\n\t\t\t\tfontSize: '24px !important'\n\t\t\t}\n\t\t}\n\t},\n\tguideData: {\n\t\tpadding: `${theme.spacing(3)} 0 0`,\n\t\tfontSize: '14px',\n\t\t'&>p': {\n\t\t\tdisplay: 'flex',\n\t\t\talignItems: 'center',\n\t\t\tmargin: 0,\n\t\t\tcolor: 'rgba(255, 255, 255, 0.7)',\n\t\t\t'&>span': {\n\t\t\t\tfontWeight: 700,\n\t\t\t\tmarginLeft: '4px',\n\t\t\t\tcolor: '#FFF'\n\t\t\t},\n\t\t\t'&>svg': {\n\t\t\t\tmarginRight: '12px',\n\t\t\t\twidth: '18px'\n\t\t\t}\n\t\t}\n\t},\n\tboxWithBorder: {\n\t\tborder: '1px solid rgba(255, 255, 255, 0.2)',\n\t\tfilter: 'drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.08))',\n\t\tborderRadius: '8px',\n\t\tpadding: theme.spacing(2),\n\t\tmargin: `${theme.spacing(2)} 0`,\n\n\t\t'& p': {\n\t\t\tfontWeight: 500,\n\t\t\tfontSize: '16px'\n\t\t}\n\t},\n\tsignImg: {\n\t\twidth: '100%',\n\t\tbackground: '#f2f2f2',\n\t\tobjectFit: 'contain',\n\t\tmarginTop: theme.spacing(2)\n\t},\n\tsignFile: {\n\t\twidth: '100%',\n\t\tmargin: 0,\n\t\t'& > li': {\n\t\t\tmargin: 0,\n\t\t\tpadding: 0\n\t\t}\n\t},\n\tpackage: {\n\t\tpadding: `${theme.spacing(2)} 0 0 0`,\n\t\t'&>p': {\n\t\t\tcolor: 'rgba(255, 255, 255, 0.7)',\n\t\t\tmarginBottom: 0\n\t\t},\n\t\t'& span': {\n\t\t\tmarginLeft: '4px',\n\t\t\tfontWeight: 700,\n\t\t\tcolor: '#fff'\n\t\t},\n\t\t'& div': {\n\t\t\tfontWeight: 700,\n\t\t\tcolor: '#fff'\n\t\t}\n\t},\n\tmerchandise: {\n\t\tbackgroundColor: '#181818',\n\t\t'& td, th': {\n\t\t\tborder: 'none !important'\n\t\t},\n\t\t'& th': {\n\t\t\tpadding: '8px 16px'\n\t\t},\n\t\tborderRadius: '8px'\n\t},\n\tcard: {\n\t\tpadding: theme.spacing(4),\n\t\tmarginTop: theme.spacing(4)\n\t},\n\ttableHead: {\n\t\tfontSize: '12px',\n\t\tcolor: '#ffffffb3'\n\t},\n\tnotificationBox: {\n\t\tpadding: `${theme.spacing(2)} 0`,\n\t\t'& > div': {\n\t\t\tpaddingLeft: 0\n\t\t},\n\t\t'& .PhoneInputInput': {\n\t\t\tbackgroundColor: 'inherit !important'\n\t\t}\n\t},\n\taddress: {\n\t\t'&>div': {\n\t\t\tpadding: `${theme.spacing(2)} 0`\n\t\t},\n\t\t'& h5': {\n\t\t\tfontSize: '20px'\n\t\t}\n\t},\n\tfiles: {\n\t\tpaddingTop: theme.spacing(2),\n\t\t'& table td:nth-child(2)': {\n\t\t\tdisplay: 'flex',\n\t\t\tjustifyContent: 'flex-end',\n\t\t\t'& svg': {\n\t\t\t\tbackgroundColor: '#919eab29',\n\t\t\t\tpadding: '6px',\n\t\t\t\tborderRadius: '50px',\n\t\t\t\twidth: '32px',\n\t\t\t\theight: '32px',\n\t\t\t\tcursor: 'pointer',\n\t\t\t\tcolor: '#fff'\n\t\t\t}\n\t\t},\n\t\t'& th, td': {\n\t\t\tborderBottom: '1px solid #ffffff1a',\n\t\t\tboxShadow: 'none'\n\t\t}\n\t},\n\tlargeBtn: {\n\t\tminWidth: '230px'\n\t},\n\tsmallBtn: {},\n\tbtns: {\n\t\tbackground: 'linear-gradient(180deg, #57BBD8 0%, #0088D5 100%), #57BBD8',\n\t\tcolor: 'white',\n\t\t'&:disabled': {\n\t\t\tcolor: '#f2f2f2',\n\t\t\topacity: 0.7\n\t\t},\n\t\tpadding: '10px 24px'\n\t},\n\timmediateBillingBtn: {\n\t\tmarginTop: '10px'\n\t}\n}));\n","import { Button } from '@mui/material';\nimport React from 'react';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\n\ninterface Props {\n\tonClick?: () => void;\n\t[x: string]: any;\n}\n\nconst useStyles = makeStyles((theme: Theme) => {\n\treturn {\n\t\troot: {\n\t\t\tdisplay: 'flex',\n\t\t\tflexDirection: 'column',\n\t\t\t'& p': {\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tflexDirection: 'column',\n\t\t\t\t'&:hover': {\n\t\t\t\t\tcolor: theme.palette.primary.main\n\t\t\t\t},\n\t\t\t\tfontSize: 11\n\t\t\t},\n\t\t\tborder: 'none !important'\n\t\t}\n\t};\n});\n\n/**\n * Este botón tiene por defecto el icono arriba y el texto abajo\n */\n\nconst CustomIconButton: React.FC = (props) => {\n\tconst classes = useStyles();\n\n\treturn (\n\t\t\n\t);\n};\n\nexport default CustomIconButton;\n","import { mutate } from 'swr';\nimport { Address } from '../store/actions/ActionTypes';\n\nexport function reload(url: string, page: Page = 1, elements: number, args: any[] = []) {\n\t// console.log('reload', [url, page, elements, ...args]);\n\tmutate([url, page, elements, ...args]);\n}\n\ntype Page = string | number;\n\nexport const CustomersPagination = {\n\tURL: '/api/customers',\n\tTable: 20,\n\n\treloadTable: function (page: Page = 1) {\n\t\treload(this.URL, page, this.Table);\n\t}\n};\n\nexport const LabelsPagination = {\n\tURL: '/api/labels',\n\tTable: 80,\n\n\treloadTable: function (page: Page = 1) {\n\t\treload(this.URL, page, this.Table);\n\t}\n};\n\nexport const AgentsPagination = {\n\tURL: '/api/agents',\n\tTable: 20,\n\n\treloadTable: function (page: Page = 1, ...args: any[]) {\n\t\treload(this.URL, page, this.Table, args);\n\t}\n};\n\nexport const Items = {\n\tURL: '/api/items',\n\tInputSearch: 250,\n\tTable: 20,\n\n\treloadTable: function (page: Page = 1, ...args: any[]) {\n\t\treload(this.URL, page, this.Table, args);\n\t},\n\treloadInputSearch: function (page: Page = 1) {\n\t\treload(this.URL, page, this.InputSearch);\n\t}\n};\n\nexport const PickupPagination = {\n\tTable: 10\n};\n\nexport const AddressesPagination = {\n\tURL: '/api/addresses',\n\tInputSearch: 800,\n\tTable: 20,\n\n\tTransformer: (addr: any): Address => ({\n\t\tid: addr.address.id,\n\t\taddress: addr.address.address,\n\t\talias: addr.address.alias,\n\t\tscope:\n\t\t\taddr.scope.scope === 'global' ? 'global' : addr.scope.scope === 'user' ? 'Personal' : 'group',\n\t\tcoordinates: addr.address.coordinates,\n\t\tstreet: addr.address.street,\n\t\tnumber: addr.address.number,\n\t\tsuite_number: addr.address.suite_number,\n\t\tcity: addr.address.city,\n\t\tbusiness_name: addr.address.business_name,\n\t\tneighborhood: addr.address.neighborhood,\n\t\tstate: addr.address.state,\n\t\tzip_code: addr.address.zip_code,\n\t\tcountry: addr.address.country,\n\t\ttax_id: addr.address.tax_id,\n\t\tcontacts: addr.address.contacts,\n\t\treference: addr.address.reference,\n\t\treference_streets: addr.address.reference_streets,\n\t\tcustomer: { id: addr.scope.customer.id, name: addr.scope.customer.name },\n\t\towner: addr.scope.owner ? { id: addr.scope.owner.id, name: addr.scope.owner.name } : null\n\t}),\n\n\treloadTable: function (page: Page = 1, ...args: any[]) {\n\t\treload(this.URL, page, this.Table, args);\n\t},\n\treloadInputSearch: function (page: Page = 1) {\n\t\treload(this.URL, page, this.InputSearch);\n\t}\n};\n","import React, { useRef, useState, useEffect, useMemo } from 'react';\nimport clsx from 'clsx';\nimport {\n\tAccordion,\n\tAccordionDetails,\n\tAccordionSummary,\n\tFormControl,\n\tFormControlLabel,\n\tFormHelperText,\n\tGrid,\n\tSelect,\n\tTextField,\n\tTypography,\n\tCheckbox\n} from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { Controller } from 'react-hook-form';\nimport { ChevronDown } from 'react-feather';\nimport { useDispatch } from 'react-redux';\nimport IOSSwitch from '../Buttons/IOSSwitch';\n\nimport { useCardStyles } from '../../hooks/useStyles';\n\nimport { AddressRequest } from '../../store/actions/ActionTypes';\nimport { setPickUpConsolidated, setDeliverConsolidated } from '../../store/actions/';\nimport { HeadingTwo, TextTwo } from '~components/Headings';\nimport capitalize, { capitalizeAll } from '~util/capitalize';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tpadding: theme.spacing(3)\n\t\t// '&>*': {\n\t\t// \tmarginTop: theme.spacing(2)\n\t\t// }\n\t}\n}));\ninterface Props {\n\ttype: 'Origen' | 'Destino' | 'Recolectar en';\n\taddress: AddressRequest | null;\n\tshowTitle: boolean;\n\tisConsolidating?: boolean;\n\t// React Hook Form\n\tcontrol?: any;\n\terrors?: any;\n\tonlyAddress?: boolean;\n\tcarrier?: string;\n\tdestinationBranchIsAvailable?: boolean;\n\tsetIsToBranch?: (is: boolean) => void;\n\tisToBranch?: { value: boolean; disable: boolean };\n}\n\nconst AddressSummaryCard: React.FC = (props) => {\n\tconst classes = useStyles();\n\tconst { cardClasses } = useCardStyles();\n\tconst dispatch = useDispatch();\n\n\tconst [showSpecials, setShowSpecials] = useState(false);\n\n\tconst formatAddress = (address?: string) => {\n\t\treturn !address ? '' : capitalizeAll(address?.toLowerCase());\n\t};\n\n\tconst fullAddress = useMemo(\n\t\t() =>\n\t\t\t!props.address?.address && !props.address?.street\n\t\t\t\t? ''\n\t\t\t\t: props.address?.address && !props.address?.number\n\t\t\t\t? formatAddress(props.address?.address)\n\t\t\t\t: !!props.address?.street\n\t\t\t\t? `${formatAddress(props.address?.street)} ${formatAddress(props.address?.street2) ?? ''}${\n\t\t\t\t\t\tprops.address?.number ? ' #' + props.address?.number + ',' : ','\n\t\t\t\t }`\n\t\t\t\t: formatAddress(props.address.address),\n\t\t[props]\n\t);\n\n\tconst maneuvers_field_name = useRef(\n\t\t`${props.type === 'Destino' ? 'destination' : 'origin'}_maneuvers`\n\t);\n\tconst three_mts_distance = useRef(\n\t\t`${props.type === 'Destino' ? 'destination' : 'origin'}_three_meter_distance`\n\t);\n\tconst pickup_description = useRef(\n\t\t`${props.type === 'Destino' ? 'destination' : 'origin'}_pickup_description`\n\t);\n\n\tuseEffect(() => {\n\t\tif (props.type === 'Destino') {\n\t\t\tdispatch(setDeliverConsolidated(showSpecials));\n\t\t} else {\n\t\t\tdispatch(setPickUpConsolidated(showSpecials));\n\t\t}\n\t}, [showSpecials, dispatch, props.type]);\n\n\treturn (\n\t\t\n\t\t\t{props.showTitle && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{props.destinationBranchIsAvailable && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t props.setIsToBranch && props.setIsToBranch(e.target.checked)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlabel={
Entrega sucursal en destino
}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t
\n\t\t\t\t\t)}\n\t\t\t\t
\n\t\t\t)}\n\t\t\t\n\t\t\t\t{props.address?.business_name ? props.address?.business_name?.toUpperCase() : ''}\n\t\t\t\t
\n\t\t\t\t{`${props.address?.city ? props.address?.city + ', ' : ''} ${\n\t\t\t\t\tprops.address?.state ? props.address?.state + ', ' : ''\n\t\t\t\t}México, CP:${props.address?.zip_code !== '00000' ? props.address?.zip_code : ' S/D'}`}\n\t\t\t\t
\n\t\t\t\t{`${fullAddress} ${\n\t\t\t\t\tprops.address?.suite_number ? `Int. ${props.address.suite_number}` : ''\n\t\t\t\t} ${\n\t\t\t\t\tprops.address?.neighborhood && props.carrier !== 'dhl'\n\t\t\t\t\t\t? `Col. ${props.address?.neighborhood}`\n\t\t\t\t\t\t: ''\n\t\t\t\t}`}\n\t\t\t
\n\t\t\t{((!props.onlyAddress && props.address?.contact) || props.showTitle) && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{`${capitalize(props.address?.contact?.name)}`}\n\t\t\t\t\t
\n\t\t\t\t\t{`Tel: ${props.address?.contact?.phone_number || 'S/D'}`}\n\t\t\t\t\t
\n\t\t\t\t\t{`Correo: ${props.address?.contact?.email || 'S/D'}`}\n\t\t\t\t
\n\t\t\t)}\n\t\t\t{props.isConsolidating && (\n\t\t\t\t\n\t\t\t\t\t setShowSpecials((prev) => !prev)}\n\t\t\t\t\t>\n\t\t\t\t\t\t}>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{props.type === 'Destino' ? (\n\t\t\t\t\t\t\t\t\t'Entrega a domicilio'\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tRecolección   \n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t event.stopPropagation()}\n\t\t\t\t\t\t\t\tonFocus={(event) => event.stopPropagation()}\n\t\t\t\t\t\t\t\tcontrol={\n\t\t\t\t\t\t\t\t\t setShowSpecials((prev) => !prev)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlabel='SÍ'\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t¿Requiere maniobras de {props.type === 'Destino' ? 'des' : null}carga?\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\trules={{\n\t\t\t\t\t\t\t\t\t\t\t\trequired: showSpecials ? 'Seleccione' : false\n\t\t\t\t\t\t\t\t\t\t\t\t//pattern: {}, nah\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\tname={maneuvers_field_name.current}\n\t\t\t\t\t\t\t\t\t\t\tcontrol={props.control}\n\t\t\t\t\t\t\t\t\t\t\tdefaultValue=''\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{props.errors && props.errors[maneuvers_field_name.current]\n\t\t\t\t\t\t\t\t\t\t\t\t? props.errors[maneuvers_field_name.current].message\n\t\t\t\t\t\t\t\t\t\t\t\t: null}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t¿La mercancía se {props.type === 'Destino' ? 'entrega' : 'recolecta'} a no más\n\t\t\t\t\t\t\t\t\t\tde 3 metros de distancia de donde se estaciona el vehículo?\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\trules={{\n\t\t\t\t\t\t\t\t\t\t\t\trequired: showSpecials ? 'Seleccione' : false\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\tname={three_mts_distance.current}\n\t\t\t\t\t\t\t\t\t\t\tcontrol={props.control}\n\t\t\t\t\t\t\t\t\t\t\tdefaultValue=''\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{props.errors && props.errors[three_mts_distance.current]\n\t\t\t\t\t\t\t\t\t\t\t\t? props.errors[three_mts_distance.current].message\n\t\t\t\t\t\t\t\t\t\t\t\t: null}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tDescribe cómo y dónde sería la{' '}\n\t\t\t\t\t\t\t\t\t\t{props.type === 'Destino' ? 'entrega' : 'recolección'}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\trules={{\n\t\t\t\t\t\t\t\t\t\t\trequired: showSpecials ? 'Proporcione una descripción' : false\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tname={pickup_description.current}\n\t\t\t\t\t\t\t\t\t\tcontrol={props.control}\n\t\t\t\t\t\t\t\t\t\tdefaultValue=''\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t
\n\t);\n};\n\nexport default AddressSummaryCard;\n","import React from 'react';\nimport { Grid, Typography } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { getLogoByCarrierName } from '../../util/logos';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\ttitle: {\n\t\tfontSize: 22\n\t}\n}));\n\ninterface Props {\n\ttext: string;\n\tsubtitle?: string;\n}\n\nconst LogoMessage: React.FC = (props) => {\n\tconst classes = useStyles();\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\tencamino\n\t\t\t\n\t\t\t\n\t\t\t\t{props.text}\n\t\t\t\n\t\t\t\n\t\t\t\t{props.subtitle}\n\t\t\t\n\t\t\n\t);\n};\n\nexport default LogoMessage;\n","import React from 'react';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { Grid, TextField } from '@mui/material';\nimport { /*Plus as PlusIcon,*/ Home, User, Box } from 'react-feather';\nimport { AutocompleteRenderInputParams } from '@material-ui/lab';\n//import { Link } from 'react-router-dom';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\tinputRoot: {\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tborderRadius: theme.spacing(1)\n\t},\n\t// iconButton: {\n\t// \tpadding: 10,\n\t// },\n\ticon: {\n\t\t//paddingTop: theme.spacing(2),\n\t\tmarginRight: '4px'\n\t}\n}));\n\ninterface Props {\n\tfor: 'addressOrigin' | 'contactOrigin' | 'addressDestination' | 'contactDestination' | 'package';\n\tlabel: string;\n\terror: boolean;\n\terrorMessage: string;\n\thideIcon?: boolean;\n\n\t//for renderInput, for normal use unneded\n\tparams?: AutocompleteRenderInputParams;\n\tdisabled?: boolean;\n}\n\n/**\n * The textfield for each autocomplete\n */\nconst RenderInput: React.FC = (props) => {\n\tconst classes = useStyles();\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t{/* Icono */}\n\t\t\t\t{!props.hideIcon && (\n\t\t\t\t\t\n\t\t\t\t\t\t{props.for.includes('address') && }\n\t\t\t\t\t\t{props.for.includes('contact') && }\n\t\t\t\t\t\t{props.for === 'package' && }\n\t\t\t\t\t\n\t\t\t\t)}\n\n\t\t\t\t{/* Input */}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t{/* Plus Btn */}\n\t\t\t\t{/* \n\t\t\t\t\t{props.link && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\t{props.onClick && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t */}\n\t\t\t\n\t\t\n\t);\n};\n\nexport default RenderInput;\n","import { create } from 'zustand';\nimport { CustomerModality } from './actions/ActionTypes';\n// import produce from 'immer';\n\ntype ShouldDisplayBalanceProps = {\n\t// isRootOrAgent: boolean;\n\tserviceDescription?: string;\n\tavailableBalance: number | null;\n\thasBalance: boolean;\n};\n\ntype HasBalanceProps = { customer_modality?: CustomerModality; [key: string]: any } | null;\n\ninterface Balance {\n\tcustomerHasBalance: (customer: HasBalanceProps) => boolean;\n\tshouldDisplayBalance: (props: ShouldDisplayBalanceProps) => boolean;\n}\n\nconst useBalanceStore = create((set) => ({\n\tcustomerHasBalance: (customer: HasBalanceProps) =>\n\t\tBoolean(\n\t\t\tcustomer?.customer_modality &&\n\t\t\t\t(customer?.customer_modality === CustomerModality.BALANCE ||\n\t\t\t\t\tcustomer?.customer_modality === CustomerModality.MIXED)\n\t\t),\n\tshouldDisplayBalance: ({\n\t\t// isRootOrAgent,\n\t\tserviceDescription,\n\t\tavailableBalance,\n\t\thasBalance\n\t}: ShouldDisplayBalanceProps) =>\n\t\thasBalance &&\n\t\t((serviceDescription && !serviceDescription?.includes('Prepago')) || !serviceDescription) &&\n\t\tavailableBalance !== null &&\n\t\tavailableBalance > 0\n}));\n\nexport default useBalanceStore;\n","// Year that corresponds to the current rate\nexport const getRateCurrentYear = () => {\n\treturn new Date().getMonth() + 1 <= 1\n\t\t? (new Date().getFullYear() - 1).toString()\n\t\t: new Date().getFullYear().toString();\n};\n","export const removeStress = (text?: string) => {\n\treturn text?.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '') ?? '';\n};\n","const DEV_URL = 'https://stage.api.encamino.com';\nconst DEV_URL_WS = 'ws://stage.api.encamino.com';\nconst DEV_URL_RATES = 'https://stage.drive.api.encamino.com';\nconst DEV_PAYMENTS_URL = 'https://stage.wallet.api.encamino.com';\n\nexport const LOGROCKET_ENABLE =\n\tprocess.env.REACT_APP_ENABLE_LOGROCKET === '1' && process.env.NODE_ENV === 'production';\n\nexport const LOGROCKET_KEY = process.env.REACT_APP_LOGROCKET_KEY || '';\n\nexport const END_POINT =\n\tprocess.env.NODE_ENV === 'production' ? process.env.REACT_APP_URL_API : DEV_URL;\n\nexport const END_POINT_WS =\n\tprocess.env.NODE_ENV === 'production' ? process.env.REACT_APP_URL_API_WS : DEV_URL_WS;\n\nexport const END_POINT_RATES =\n\tprocess.env.NODE_ENV === 'production' ? process.env.REACT_APP_RATES_URL : DEV_URL_RATES;\n\nexport const END_POINT_PAYMENTS =\n\tprocess.env.NODE_ENV === 'production' ? process.env.REACT_APP_PAYMENTS_URL : DEV_PAYMENTS_URL;\n","export function formatPrice(amount: number) {\n\treturn new Intl.NumberFormat('es-MX', {\n\t\tstyle: 'currency',\n\t\tcurrency: 'MXN',\n\t\tmaximumFractionDigits: 2\n\t}).format(amount);\n}\n","import { DataGrid as BaseDataGrid, DataGridProps } from '@mui/x-data-grid';\n\nimport { MUIDataGridTranslations } from '~util/index';\nimport { Pagination } from './Pagination';\nimport './DataGrid.css';\n\ntype Props = Omit;\n\nexport default function DataGrid(props: Props) {\n\treturn (\n\t\t\n\t);\n}\n","export default __webpack_public_path__ + \"static/media/logo.01bc4c3a.svg\";","import axios, { AxiosResponse } from 'axios';\nimport { END_POINT, END_POINT_PAYMENTS, END_POINT_RATES } from '../config';\n\nconst instance = axios.create({\n\tbaseURL: END_POINT\n});\n\nconst waitFor = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nenum PollingStatus {\n\tQUEUED = 'QUEUED',\n\tPROCESSING = 'PROCESSING',\n\tDONE = 'DONE'\n}\n\nconst checkAndRefreshToken = (response: AxiosResponse) => {\n\tconst reqToken = response.config.headers['Authorization'];\n\tconst resToken = response.headers['token'];\n\n\tif (resToken && !reqToken?.includes(resToken)) {\n\t\tlocalStorage.setItem('auth', resToken);\n\t}\n};\n\ninstance.interceptors.response.use(\n\tasync (response) => {\n\t\t// This means we have to do some polling logic\n\t\tif (response.status === 202) {\n\t\t\tconst url = response.headers.location;\n\t\t\tlet pollingResponse = await instance.get(url);\n\n\t\t\twhile (pollingResponse.data.status !== PollingStatus.DONE) {\n\t\t\t\tawait waitFor(5000);\n\t\t\t\tpollingResponse = await instance.get(url);\n\t\t\t}\n\n\t\t\tif (pollingResponse.data.status === 'Failed') {\n\t\t\t\tthrow new Error('Operation failed');\n\t\t\t} else {\n\t\t\t\tconst final = await instance.get(url);\n\n\t\t\t\tif (final.data.results.errors.length > 0) {\n\t\t\t\t\treturn Promise.reject(final.data.results.errors[0]);\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\t...final,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tlabels: final.data.results.labels\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn response;\n\t},\n\t(error) => {\n\t\tif (error.response?.status === 401 && localStorage.getItem('auth')) {\n\t\t\tlocalStorage.removeItem('auth');\n\t\t\twindow.location.href = '/login';\n\t\t}\n\n\t\treturn Promise.reject(error);\n\t}\n);\n\nexport default instance;\n\nexport const instanceRate = axios.create({\n\tbaseURL: END_POINT_RATES\n});\n\nconst timeOut = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\ninstanceRate.interceptors.response.use(async (response) => {\n\t// Refresh toeen if it is expired\n\tcheckAndRefreshToken(response);\n\n\t// This means we have to do some polling logic\n\tif (response.status === 202) {\n\t\tconst url = response.headers.location;\n\t\tlet pollingResponse = await instanceRate.get(url);\n\n\t\twhile (pollingResponse.data.status !== PollingStatus.DONE) {\n\t\t\tawait timeOut(5000);\n\t\t\tpollingResponse = await instanceRate.get(url);\n\t\t}\n\n\t\tif (pollingResponse.data.status === 'Failed') {\n\t\t\tthrow new Error('Operation failed');\n\t\t} else {\n\t\t\tconst final = await instanceRate.get(url);\n\n\t\t\tif (final.data.results.errors.length > 0) {\n\t\t\t\treturn Promise.reject(final.data.results.errors[0]);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...final,\n\t\t\t\tdata: {\n\t\t\t\t\tlabels: final.data.results.labels\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\treturn response;\n});\n\nexport const instancePayment = axios.create({\n\tbaseURL: END_POINT_PAYMENTS\n});\n\ninstancePayment.interceptors.response.use(async (response) => {\n\t// Refresh toeen if it is expired\n\tcheckAndRefreshToken(response);\n\n\t// This means we have to do some polling logic\n\tif (response.status === 202) {\n\t\tconst url = response.headers.location;\n\t\tlet pollingResponse = await instancePayment.get(url);\n\n\t\twhile (pollingResponse.data.status !== PollingStatus.DONE) {\n\t\t\tawait timeOut(5000);\n\t\t\tpollingResponse = await instancePayment.get(url);\n\t\t}\n\n\t\tif (pollingResponse.data.status === 'Failed') {\n\t\t\tthrow new Error('Operation failed');\n\t\t} else {\n\t\t\tconst final = await instancePayment.get(url);\n\n\t\t\tif (final.data.results.errors.length > 0) {\n\t\t\t\treturn Promise.reject(final.data.results.errors[0]);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...final,\n\t\t\t\tdata: {\n\t\t\t\t\tlabels: final.data.results.labels\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\treturn response;\n});\n","// Libraries\nimport { Fragment, useState, useMemo, useCallback, useEffect } from 'react';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { Skeleton } from '@mui/material';\nimport { Grid } from '@mui/material';\nimport { DataGrid, GridCellParams, GridColumns } from '@mui/x-data-grid';\nimport clsx from 'clsx';\n// Hooks\nimport useStyles from './style';\nimport { useCardStyles } from '~hooks/useStyles';\nimport useProspects from '../ProspectsTable/useProspects';\n// Components\nimport StatusCell from '~components/Tables/_StatusCell';\nimport DocumentDetailModal from './DocumentDetailModal';\nimport { HeadingOne, TextTwo } from '~components/Headings';\n// Utils\nimport { getCellStatusColor } from '~util/cellStatusColor';\nimport { DocumentNameType, Entity } from '~store/actions/ActionTypes';\nimport UploadDocumentBtn, { DocumentFileType } from '~pages/documents/UploadDocumentBtn';\nimport GoToDetailIconButton from '~components/Buttons/GoToDetailIconButton';\nimport { CustomerDocumentType } from '~store/actions/ActionTypes';\nimport useCustomerForm from './useCustomerForm';\nimport { MUIDataGridTranslations } from '~util/index';\n\nexport const STATUS_REF: { [key: string]: string } = {\n\tapproved: 'Aprobado',\n\tpending: 'Pendiente',\n\trejected: 'Rechazado'\n};\n\nconst STATUS_PAYLOAD: { [key: string]: string } = {\n\tValidado: 'approved',\n\tPendiente: 'pending',\n\tRechazado: 'rejected'\n};\n\nexport type DocumentRow = {\n\tstatus: string;\n\ttype?: string;\n\turl: string;\n\tcomment?: string;\n\tname: string;\n};\n\nexport const NAME_REF: { [key: string]: string } = {\n\tine: DocumentNameType.INE,\n\ttax: DocumentNameType.TAX,\n\tproof: DocumentNameType.PROOF_ADDRESS,\n\tconstitutive_act: DocumentNameType.CONSTITUTIVE_ACT,\n\tassembly_act: DocumentNameType.ASSEMBLY_ACT\n};\n\nconst all = ['ine', 'tax', 'proof'];\nconst onlyMoral = ['constitutive_act', 'assembly_act'];\n\nconst CustomerDocuments = () => {\n\tconst classes = useStyles();\n\tconst params: { id?: string } = useParams();\n\tconst { cardClasses } = useCardStyles();\n\tconst history = useHistory();\n\tconst [rows, setRows] = useState([]);\n\tconst [data, setData] = useState(null);\n\tconst [openDetail, setOpenDetail] = useState(false);\n\tconst [files, setFiles] = useState([]);\n\tconst [loadingSubmit, setLoadingSubmit] = useState(false);\n\n\tconst { getProspect, prospect, loading: loadingProspect, updateDocument } = useProspects();\n\tconst {\n\t\tloading: loadingCustomer,\n\t\t// editing,\n\t\t// posting,\n\t\tcustomer\n\t} = useCustomerForm();\n\n\tconst isProfile = useMemo(() => history.location.pathname.includes('perfil'), [history]);\n\tconst isCustomerView = useMemo(() => history.location.pathname.includes('cliente'), [history]);\n\n\tconst onSubmit = useCallback(\n\t\tasync (formData: any) => {\n\t\t\tif (!params?.id) return;\n\t\t\tsetLoadingSubmit(true);\n\n\t\t\tconst payload = {\n\t\t\t\t...formData,\n\t\t\t\tprospectID: params?.id,\n\t\t\t\tdocument_type: data?.document_type,\n\t\t\t\tstatus: STATUS_PAYLOAD[formData?.status]\n\t\t\t};\n\t\t\tawait updateDocument(params?.id, payload, () => {\n\t\t\t\tsetLoadingSubmit(false);\n\t\t\t\tsetOpenDetail(false);\n\t\t\t});\n\t\t},\n\t\t[updateDocument, data, params?.id]\n\t);\n\n\tconst goToDetail = (documentData: CustomerDocumentType) => {\n\t\tif (!documentData?.url) return;\n\t\tsetData(documentData);\n\t\tsetOpenDetail(true);\n\t};\n\n\tuseEffect(() => {\n\t\tif (isCustomerView) return;\n\t\tif (params.id) {\n\t\t\tgetProspect(params.id);\n\t\t}\n\t}, [params.id, getProspect, isCustomerView]);\n\n\tconst updateRows = useCallback(() => {\n\t\tif (!prospect) return;\n\t\tconst requiredDocs = prospect?.business_type === Entity.PHYSICAL ? all : [...all, ...onlyMoral];\n\t\tconst result = Object.entries(prospect?.documents)\n\t\t\t.filter(([key, _]) => requiredDocs?.includes(key))\n\t\t\t.map(([key, value]) => {\n\t\t\t\treturn {\n\t\t\t\t\t...value,\n\t\t\t\t\tname: key,\n\t\t\t\t\tid: key\n\t\t\t\t};\n\t\t\t});\n\t\t// @ts-ignore\n\t\tsetRows(result);\n\t}, [prospect]);\n\n\tuseEffect(() => {\n\t\tif (prospect?.documents) {\n\t\t\tupdateRows();\n\t\t} else {\n\t\t\tsetRows([]);\n\t\t}\n\t}, [prospect, updateRows]);\n\n\tconst columns = useMemo(() => {\n\t\tconst resultColumns = [\n\t\t\t{\n\t\t\t\tfield: 'documents',\n\t\t\t\theaderName: 'Documento',\n\t\t\t\tflex: 1.5,\n\t\t\t\trenderCell: (params: GridCellParams) => (\n\t\t\t\t\t goToDetail(params.row)}>{NAME_REF[params.row.name]}\n\t\t\t\t)\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: 'status',\n\t\t\t\theaderName: 'Estatus',\n\t\t\t\tflex: 0.75,\n\t\t\t\talign: 'center',\n\t\t\t\trenderCell: (params: GridCellParams) =>\n\t\t\t\t\tSTATUS_REF[params.row.status] && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: 'created_date',\n\t\t\t\theaderName: 'Fecha de creación',\n\t\t\t\tflex: 0.75\n\t\t\t}\n\t\t\t// {\n\t\t\t// \tfield: 'last_update',\n\t\t\t// \theaderName: 'última actualización',\n\t\t\t// \tflex: 0.75\n\t\t\t// }\n\t\t];\n\t\tif (!isProfile) {\n\t\t\tresultColumns.push({\n\t\t\t\tfield: 'actions',\n\t\t\t\theaderName: 'Acciones',\n\t\t\t\tflex: 0.5,\n\t\t\t\trenderCell: (params: GridCellParams) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t goToDetail(params.row)} />\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn resultColumns;\n\t}, [isProfile, files, updateRows]);\n\n\tif (loadingProspect || loadingCustomer) {\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t{/* TODO: global status for documents ? */}\n\t\t\t\t\t\t{/* \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t */}\n\t\t\t\t\t\n\t\t\t\t\t{!isProfile && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\n\n\t\t\t\t{/* {!isProfile && (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t console.log('Mandar por wapp')}>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t console.log('Copiar link')}>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)} */}\n\t\t\t\n\n\t\t\t\n\t\t\t\t}\n\t\t\t\t\tautoHeight\n\t\t\t\t\tdisableSelectionOnClick\n\t\t\t\t\tloading={loadingProspect || loadingCustomer || loadingSubmit}\n\t\t\t\t\thideFooter\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t\n\t\t\n\t);\n};\n\nexport default CustomerDocuments;\n","import { create } from 'zustand';\nimport produce from 'immer';\nimport { NewBusiness, User } from './actions/ActionTypes';\n\nexport type PreinvoiceBusiness = {\n\tcfdi_use: string;\n\tpayment_method: string;\n\tpayment_type: string;\n\ttax_regimen: string;\n\torder?: string;\n};\n\ntype WalletData = {\n\twalletDialog: boolean;\n\ttoggleWalletDialog: () => void;\n\n\tcurrentBusiness: NewBusiness[] | null;\n\tsetCurrentBusiness: (currentBusiness: NewBusiness[] | null) => void;\n\tisEditing: boolean;\n\tsetIsEditing: (isEditing: boolean) => void;\n\tisPreinvoicesEditing: boolean;\n\tsetIsPreinvoicesEditing: (isPreinvoicesEditing: boolean) => void;\n\tcurrentBusinessEditing: NewBusiness | null;\n\tsetCurrentBusinessEditing: (currentBusinessItem: NewBusiness) => void;\n\tpreinvoicePaymentData: PreinvoiceBusiness | null;\n\tsetPreinvoicePaymentData: (preinvoice: PreinvoiceBusiness | null) => void;\n\tusers: User[] | null;\n\tsetUsers: (users: User[]) => void;\n\treportFolioForRebill: string | null;\n\tsetReportFolioForRebill: (reportFolio: string | null) => void;\n\tisRegisteringPayment: boolean;\n\tsetIsRegisteringPayment: (isRegisteringPayment: boolean) => void;\n\treset: () => void;\n};\n\nconst useWalletStore = create((set) => ({\n\twalletDialog: false,\n\ttoggleWalletDialog: () => set((state) => ({ walletDialog: !state.walletDialog })),\n\tcurrentBusiness: null,\n\tsetCurrentBusiness: (currentBusiness: NewBusiness[] | null) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.currentBusiness = currentBusiness;\n\t\t\t})\n\t\t),\n\tisEditing: false,\n\tsetIsEditing: (isEditing: boolean) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.isEditing = isEditing;\n\t\t\t})\n\t\t),\n\tisPreinvoicesEditing: false,\n\tsetIsPreinvoicesEditing: (isPreinvoicesEditing: boolean) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.isPreinvoicesEditing = isPreinvoicesEditing;\n\t\t\t})\n\t\t),\n\tcurrentBusinessEditing: null,\n\tsetCurrentBusinessEditing: (currentBusinessItem: NewBusiness) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.currentBusinessEditing = currentBusinessItem;\n\t\t\t})\n\t\t),\n\tpreinvoicePaymentData: null,\n\tsetPreinvoicePaymentData: (preinvoice: PreinvoiceBusiness | null) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.preinvoicePaymentData = preinvoice;\n\t\t\t})\n\t\t),\n\tusers: null,\n\tsetUsers: (users: User[] | null) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.users = users;\n\t\t\t})\n\t\t),\n\treportFolioForRebill: null,\n\tsetReportFolioForRebill: (reportFolio: string | null) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.reportFolioForRebill = reportFolio;\n\t\t\t})\n\t\t),\n\tisRegisteringPayment: false,\n\tsetIsRegisteringPayment: (isRegisteringPayment: boolean) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.isRegisteringPayment = isRegisteringPayment;\n\t\t\t})\n\t\t),\n\treset: () =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.isEditing = false;\n\t\t\t\tdraft.isPreinvoicesEditing = false;\n\t\t\t\tdraft.currentBusinessEditing = null;\n\t\t\t\tdraft.preinvoicePaymentData = null;\n\t\t\t\tdraft.users = null;\n\t\t\t\tdraft.reportFolioForRebill = null;\n\t\t\t\tdraft.isRegisteringPayment = false;\n\t\t\t})\n\t\t)\n}));\n\nexport default useWalletStore;\n","import { useState, forwardRef, ReactElement, Ref, ReactNode } from 'react';\nimport {\n\tDialog,\n\tDialogTitle,\n\tDialogContent,\n\tDialogContentText,\n\tDialogActions,\n\tButton,\n\tSlide,\n\tCircularProgress\n} from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { TransitionProps } from '@mui/material/transitions';\nimport { X } from 'react-feather';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\tspacing: {\n\t\tpadding: `0 ${theme.spacing(3)}`\n\t},\n\tcontentContainer: {\n\t\tminWidth: '380px',\n\t\tpadding: `0 ${theme.spacing(3)}`\n\t},\n\tbtn: {\n\t\tpadding: theme.spacing(3)\n\t},\n\tcancelCross: {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'flex-end',\n\t\t'& div': {\n\t\t\tmargin: '8px 8px 0 0',\n\t\t\tcursor: 'pointer',\n\t\t\twidth: '14px',\n\t\t\theight: '14px',\n\t\t\t'& svg:hover': {\n\t\t\t\tbackgroundColor: 'rgba(255, 255, 255, 0.08)',\n\t\t\t\tborderRadius: '50%',\n\t\t\t\tcolor: 'white'\n\t\t\t}\n\t\t}\n\t}\n}));\n\ntype DialogProps = {\n\tisOpen: boolean;\n\tonClose: () => void;\n\ttitle?: string;\n\tbodyText: string;\n\thandleClickConfirm: () => void;\n\thandleClickCancel?: () => void;\n\tconfirmBtnLabel?: string;\n\tcancelBtnLabel?: string;\n\tloading?: boolean;\n\thideCancelBtn?: boolean;\n\tchildren?: ReactNode;\n};\n\nconst Transition = forwardRef(function Transition(\n\tprops: TransitionProps & { children: ReactElement },\n\tref: Ref\n) {\n\treturn ;\n});\n\nconst ConfirmActionDialog = ({\n\tisOpen,\n\tonClose,\n\ttitle,\n\tbodyText,\n\thandleClickConfirm,\n\thandleClickCancel,\n\tconfirmBtnLabel,\n\tcancelBtnLabel,\n\tloading,\n\thideCancelBtn,\n\tchildren\n}: DialogProps) => {\n\tconst classes = useStyles();\n\n\tconst [actionType, setActionType] = useState<'confirm' | 'cancel'>();\n\n\tconst handleConfirm = () => {\n\t\tsetActionType('confirm');\n\t\thandleClickConfirm();\n\t};\n\n\tconst handleCancel = () => {\n\t\tsetActionType('cancel');\n\t\thandleClickCancel ? handleClickCancel() : onClose();\n\t};\n\n\treturn (\n\t\t\n\t\t\t
\n\t\t\t\t
onClose()}>\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t{title && {title}}\n\t\t\t\n\t\t\t\t{bodyText}\n\t\t\t\t{children ? children : null}\n\t\t\t\n\t\t\t\n\t\t\t\t{!hideCancelBtn && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default ConfirmActionDialog;\n","import { FC } from 'react';\nimport { makeStyles } from '@mui/styles';\nimport { getLogoByCarrierName } from '../../util/logos';\n\nconst useStyles = makeStyles(() => ({\n\troot: {\n\t\tdisplay: 'flex',\n\t\talignItems: 'center',\n\t\tjustifyContent: 'center',\n\t\tbackgroundColor: 'white',\n\t\tcolor: 'black',\n\t\tfontSize: 15,\n\t\ttextAlign: 'center',\n\t\tpadding: 7,\n\t\tborderRadius: 20,\n\t\tfontWeight: 'bold',\n\t\tmaxWidth: 156,\n\t\theight: 74\n\t},\n\tcarrierLogo: {\n\t\twidth: '90%',\n\t\tminWidth: 84,\n\t\tmargin: '0 auto',\n\t\theight: 'auto',\n\t\tmaxHeight: 100\n\t},\n\tcarrierService: {\n\t\tfontSize: 10,\n\t\twidth: '100%',\n\t\ttextAlign: 'center',\n\t\tmarginTop: 2\n\t}\n}));\n\ninterface Props {\n\tcarrier: string;\n\tservice?: string;\n}\nconst CarrierService: FC = (props) => {\n\tconst classes = useStyles();\n\n\treturn (\n\t\t<>\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t

{props.service ? 'Servicio: ' + props.service : null}

\n\t\t\n\t);\n};\n\nexport default CarrierService;\n","import produce from 'immer';\nimport { create } from 'zustand';\nimport { GridColDef } from '@mui/x-data-grid';\n\ntype RateData = {\n\tservices: RateServices | null;\n\tsetServices: (services: RateServices) => void;\n\tselectedCarrier: string;\n\tsetSelectedCarrier: (selectedCarrier: string) => void;\n\tservice: string;\n\tsetService: (service: string) => void;\n\trateService: RateService | null;\n\tsetRateService: (service: RateService | null) => void;\n\tcarrierOptions: string;\n\tsetCarrierOptions: (carrierOptions: string) => void;\n\tservicesOptions: RateOptions | null;\n\tsetServicesOptions: (servicesOptions: RateOptions) => void;\n\tproposals: Proposals | null;\n\tsetProposals: (proposals: Proposals) => void;\n\tzones: GridColDef[] | null;\n\tsetZones: (zones: GridColDef[]) => void;\n\tzonesCost: any[] | null;\n\tsetZonesCost: (zonesCost: any[]) => void;\n\trates: RateRanges | null;\n\tsetRates: (rates: RateRanges | []) => void;\n\tdinamicRows: any[];\n\tsetDinamicRows: (rates: any[]) => void;\n\tweights: any[] | null;\n\tsetWeights: (weights: any[]) => void;\n\tranges: any[] | [];\n\tsetRanges: (ranges: any[]) => void;\n\tclientRates: RateConfigs | null;\n\tsetClientRates: (clientRates: RateConfigs | null) => void;\n\turl: string;\n\tsetUrl: (url: string) => void;\n\tyears: { id: string; name: string }[];\n\tsetYears: (years: { id: string; name: string }[]) => void;\n};\n\nconst useRateStore = create((set) => ({\n\tservices: null,\n\tsetServices: (services: RateServices) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.services = services;\n\t\t\t})\n\t\t),\n\trateService: null,\n\tsetRateService: (rateService: RateService | null) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.rateService = rateService;\n\t\t\t})\n\t\t),\n\tselectedCarrier: '',\n\tsetSelectedCarrier: (selectedCarrier: string) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.selectedCarrier = selectedCarrier;\n\t\t\t})\n\t\t),\n\tservice: '',\n\tsetService: (service: string) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.service = service;\n\t\t\t})\n\t\t),\n\tcarrierOptions: '',\n\tsetCarrierOptions: (carrierOptions: string) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.carrierOptions = carrierOptions;\n\t\t\t})\n\t\t),\n\tservicesOptions: null,\n\tsetServicesOptions: (servicesOptions: RateOptions) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.servicesOptions = servicesOptions;\n\t\t\t})\n\t\t),\n\tproposals: null,\n\tsetProposals: (proposals: Proposals) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.proposals = proposals;\n\t\t\t})\n\t\t),\n\tzones: null,\n\tsetZones: (zones: GridColDef[]) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.zones = zones;\n\t\t\t})\n\t\t),\n\tzonesCost: null,\n\tsetZonesCost: (zonesCost: any[]) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.zonesCost = zonesCost;\n\t\t\t})\n\t\t),\n\trates: null,\n\tsetRates: (rates: RateRanges | []) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.rates = rates;\n\t\t\t})\n\t\t),\n\tdinamicRows: [],\n\tsetDinamicRows: (dinamicRows: any[]) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.dinamicRows = dinamicRows;\n\t\t\t})\n\t\t),\n\tweights: null,\n\tsetWeights: (weights: any[]) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.weights = weights;\n\t\t\t})\n\t\t),\n\tranges: [],\n\tsetRanges: (ranges: any[]) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.ranges = ranges;\n\t\t\t})\n\t\t),\n\tclientRates: null,\n\tsetClientRates: (clientRates: RateConfigs | null) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.clientRates = clientRates;\n\t\t\t})\n\t\t),\n\turl: '',\n\tsetUrl: (url: string) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.url = url;\n\t\t\t})\n\t\t),\n\tyears: [],\n\tsetYears: (years: { id: string; name: string }[]) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.years = years;\n\t\t\t})\n\t\t)\n}));\n\nexport default useRateStore;\n","import { useState, useCallback } from 'react';\nimport { createGenerateClassName } from '@mui/styles';\nimport { createTheme } from '@mui/material/styles';\nimport { Theme } from '@mui/material/styles';\nimport { esES } from '@mui/material/locale';\n\ndeclare module '@mui/styles' {\n\tinterface DefaultTheme extends Theme {}\n}\n\ndeclare module '@mui/material/styles' {\n\tinterface Palette {\n\t\twhite: Palette['primary'];\n\t}\n\n\tinterface PaletteOptions {\n\t\twhite?: PaletteOptions['primary'];\n\t}\n}\n\nexport const useTheme = (initialTheme?: boolean) => {\n\t// const defaultTheme = createTheme();\n\tconst generateClassName = createGenerateClassName({\n\t\t// By enabling this option, if you have non-MUI elements (e.g. `
`)\n\t\t// using MUI classes (e.g. `.MuiButton`) they will lose styles.\n\t\t// Make sure to convert them to use `styled()` or `` first.\n\t\tdisableGlobal: true,\n\t\t// Class names will receive this seed to avoid name collisions.\n\t\tseed: 'mui-jss'\n\t});\n\tconst [currentTheme, setCurrentTheme] = useState(!!initialTheme);\n\n\t// const gap = (spacing: number) => parseInt(defaultTheme.spacing(spacing), 10);\n\n\tconst themeV4 = createTheme(\n\t\t{\n\t\t\tpalette: {\n\t\t\t\tmode: currentTheme ? 'light' : 'dark',\n\t\t\t\tprimary: {\n\t\t\t\t\tmain: '#4ec0df'\n\t\t\t\t},\n\t\t\t\tbackground: {\n\t\t\t\t\tdefault: '#181818',\n\t\t\t\t\tpaper: '#212121'\n\t\t\t\t},\n\t\t\t\terror: {\n\t\t\t\t\tmain: '#aa3e3d'\n\t\t\t\t},\n\t\t\t\twhite: {\n\t\t\t\t\tmain: '#fafafa'\n\t\t\t\t}\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\th4: {\n\t\t\t\t\tfontWeight: 'bold'\n\t\t\t\t},\n\t\t\t\th5: {\n\t\t\t\t\tfontWeight: 'bold'\n\t\t\t\t}\n\t\t\t},\n\t\t\tbreakpoints: {\n\t\t\t\tvalues: {\n\t\t\t\t\txs: 0,\n\t\t\t\t\tsm: 600,\n\t\t\t\t\tmd: 900,\n\t\t\t\t\tlg: 1300,\n\t\t\t\t\txl: 1536\n\t\t\t\t}\n\t\t\t},\n\t\t\tcomponents: {\n\t\t\t\tMuiButton: {\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\troot: {\n\t\t\t\t\t\t\ttextTransform: 'capitalize',\n\t\t\t\t\t\t\tborderRadius: 8,\n\t\t\t\t\t\t\tpadding: '5px 15px',\n\t\t\t\t\t\t\t'&:hover': {\n\t\t\t\t\t\t\t\tborderColor: 'inherit'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\toutlined: {\n\t\t\t\t\t\t\tborder: '1px solid #fafafa',\n\t\t\t\t\t\t\tcolor: '#fafafa',\n\t\t\t\t\t\t\t'&:hover': {\n\t\t\t\t\t\t\t\tborderColor: 'inherit'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tMuiIconButton: {\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\troot: {\n\t\t\t\t\t\t\tcolor: 'inherit'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tMuiFab: {\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\troot: {\n\t\t\t\t\t\t\ttextTransform: 'capitalize'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tMuiPaper: {\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\troot: {\n\t\t\t\t\t\t\tbackgroundColor: '#212121 !important',\n\t\t\t\t\t\t\tcolor: '#f2f2f2',\n\t\t\t\t\t\t\tbackgroundImage: 'none'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tMuiSelect: {\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\troot: {\n\t\t\t\t\t\t\tbackgroundColor: '#353535',\n\t\t\t\t\t\t\t'& ul': {\n\t\t\t\t\t\t\t\tbackgroundColor: '#353535'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tMuiTextField: {\n\t\t\t\t\tdefaultProps: {\n\t\t\t\t\t\tvariant: 'standard'\n\t\t\t\t\t},\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\troot: {\n\t\t\t\t\t\t\t'& input': {\n\t\t\t\t\t\t\t\t// paddingBottom: '5px'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tMuiFilledInput: {\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\troot: {\n\t\t\t\t\t\t\t'& input': {\n\t\t\t\t\t\t\t\tpadding: '27px 12px 8px'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tselect: {\n\t\t\t\t\t\t\t\tpadding: '27px 12px 8px'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\tMuiBottomNavigation: {\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\troot: {\n\t\t\t\t\t\t\tbackgroundColor: '#181818'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tMuiPaginationItem: {\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\troot: {\n\t\t\t\t\t\t\ttextPrimary: '#4ec0df'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tMuiAutocomplete: {\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\troot: {\n\t\t\t\t\t\t\tcolor: 'white',\n\t\t\t\t\t\t\t'& .MuiAutocomplete-inputRoot[class*=\"MuiFilledInput-root\"]': {\n\t\t\t\t\t\t\t\tpaddingTop: '16px !important'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tpopper: {\n\t\t\t\t\t\t\tcolor: '#f2f2f2'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tlistbox: {\n\t\t\t\t\t\t\tbackgroundColor: 'inherit'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tMuiList: {\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\troot: {\n\t\t\t\t\t\t\tbackgroundColor: '#212121 !important',\n\t\t\t\t\t\t\tcolor: '#f2f2f2'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tMuiMenuList: {\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\troot: {\n\t\t\t\t\t\t\tbackgroundColor: '#212121 !important',\n\t\t\t\t\t\t\tcolor: '#f2f2f2'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tMuiDialog: {\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\tpaper: {\n\t\t\t\t\t\t\t// backgroundColor: '#212121 !important',\n\t\t\t\t\t\t\t// color: '#f2f2f2',\n\t\t\t\t\t\t\tbackgroundImage: 'none'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tMuiAccordion: {\n\t\t\t\t\tstyleOverrides: {\n\t\t\t\t\t\troot: {\n\t\t\t\t\t\t\t// backgroundColor: '#212121 !important',\n\t\t\t\t\t\t\t// color: '#f2f2f2',\n\t\t\t\t\t\t\tbackgroundImage: 'none'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tshape: {\n\t\t\t\tborderRadius: 8\n\t\t\t}\n\t\t\t// props: {}\n\t\t\t// gap,\n\t\t\t// spacing: {\n\t\t\t// \t0: gap(0),\n\t\t\t// \t1: gap(1),\n\t\t\t// \t2: gap(2),\n\t\t\t// \t3: gap(3),\n\t\t\t// \t4: gap(4),\n\t\t\t// \t5: gap(5)\n\t\t\t// }\n\t\t},\n\t\tesES\n\t);\n\n\t// const themeV5 = createTheme(\n\t// \t{\n\t// \t\tpalette: {\n\t// \t\t\tmode: currentTheme ? 'light' : 'dark',\n\t// \t\t\tprimary: {\n\t// \t\t\t\tmain: '#4ec0df'\n\t// \t\t\t},\n\t// \t\t\tbackground: {\n\t// \t\t\t\tdefault: '#181818',\n\t// \t\t\t\tpaper: '#212121'\n\t// \t\t\t},\n\t// \t\t\terror: {\n\t// \t\t\t\tmain: '#aa3e3d'\n\t// \t\t\t}\n\t// \t\t},\n\t// \t\ttypography: {\n\t// \t\t\th4: {\n\t// \t\t\t\tfontWeight: 'bold'\n\t// \t\t\t},\n\t// \t\t\th5: {\n\t// \t\t\t\tfontWeight: 'bold'\n\t// \t\t\t}\n\t// \t\t},\n\t// \t\tbreakpoints: {\n\t// \t\t\tvalues: {\n\t// \t\t\t\txs: 0,\n\t// \t\t\t\tsm: 600,\n\t// \t\t\t\tmd: 900,\n\t// \t\t\t\tlg: 1300,\n\t// \t\t\t\txl: 1536\n\t// \t\t\t}\n\t// \t\t},\n\t// \t\toverrides: {\n\t// \t\t\tMuiButton: {\n\t// \t\t\t\troot: {\n\t// \t\t\t\t\ttextTransform: 'capitalize'\n\t// \t\t\t\t}\n\t// \t\t\t},\n\t// \t\t\tMuiFab: {\n\t// \t\t\t\troot: {\n\t// \t\t\t\t\ttextTransform: 'capitalize'\n\t// \t\t\t\t}\n\t// \t\t\t},\n\t// \t\t\tMuiSelect: {\n\t// \t\t\t\troot: {\n\t// \t\t\t\t\tbackgroundColor: '#353535',\n\t// \t\t\t\t\t'& ul': {\n\t// \t\t\t\t\t\tbackgroundColor: '#353535'\n\t// \t\t\t\t\t}\n\t// \t\t\t\t}\n\t// \t\t\t}\n\t// \t\t},\n\t// \t\tshape: {\n\t// \t\t\tborderRadius: 8\n\t// \t\t},\n\t// \t\tprops: {}\n\t// \t},\n\t// \tesES\n\t// );\n\n\tconst toggleTheme = useCallback(() => {\n\t\tsetCurrentTheme((prev) => !prev);\n\t}, []);\n\n\treturn { themeV4, toggleTheme, currentTheme, generateClassName, theme: themeV4 };\n};\n","import React, { useState, useEffect, useMemo } from 'react';\nimport { useSelector } from 'react-redux';\nimport { Grid } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { Home, CheckCircle, MapPin, Package } from 'react-feather';\nimport { RootStore } from '../../store/store';\n\nconst useStyles = makeStyles((theme: Theme) => {\n\treturn {\n\t\tfont: {\n\t\t\tfontWeight: 'bold',\n\t\t\tfontSize: 15\n\t\t}\n\t};\n});\n\nconst RateOrSendControl: React.FC = () => {\n\tconst classes = useStyles();\n\n\tconst { currentFlow } = useSelector((state: RootStore) => state.flow);\n\tconst { originAddressSend, destinationAddressSend, currentPackagesSend } = useSelector(\n\t\t(state: RootStore) => state.send\n\t);\n\tconst { originAddressRate, destinationAddressRate, currentPackagesRate } = useSelector(\n\t\t(state: RootStore) => state.rate\n\t);\n\tconst { labelsPickup, addressPickUp, datePickUp, endTimePickUp, startTimePickUp } = useSelector(\n\t\t(state: RootStore) => state.pickup\n\t);\n\n\tconst [origin, setOrigin] = useState(false);\n\tconst [destination, setDestination] = useState(false);\n\tconst [pkgs, setPackages] = useState(false);\n\n\tuseEffect(() => {\n\t\tsetOrigin(\n\t\t\tBoolean(\n\t\t\t\t(originAddressRate && currentFlow === 'rate') ||\n\t\t\t\t\t(currentFlow === 'send' && originAddressSend && originAddressSend.contact) ||\n\t\t\t\t\t(currentFlow === 'pickup' && addressPickUp && addressPickUp.contact)\n\t\t\t)\n\t\t);\n\t}, [originAddressRate, originAddressSend, addressPickUp, currentFlow]);\n\n\tuseEffect(() => {\n\t\tsetDestination(\n\t\t\tBoolean(\n\t\t\t\t(destinationAddressRate && currentFlow === 'rate') ||\n\t\t\t\t\t(currentFlow === 'send' && destinationAddressSend) ||\n\t\t\t\t\t(currentFlow === 'pickup' && datePickUp && endTimePickUp && startTimePickUp)\n\t\t\t)\n\t\t);\n\t}, [\n\t\tdestinationAddressRate,\n\t\tdestinationAddressSend,\n\t\tcurrentFlow,\n\t\tdatePickUp,\n\t\tendTimePickUp,\n\t\tstartTimePickUp\n\t]);\n\n\tuseEffect(() => {\n\t\tsetPackages(\n\t\t\t(currentPackagesRate.length > 0 && currentFlow === 'rate') ||\n\t\t\t\t(currentFlow === 'send' && currentPackagesSend.length > 0) ||\n\t\t\t\t(currentFlow === 'pickup' && labelsPickup.length > 0)\n\t\t);\n\t}, [currentPackagesRate.length, currentPackagesSend.length, labelsPickup.length, currentFlow]);\n\n\tconst firstStep = useMemo(\n\t\t() => (currentFlow === 'pickup' ? pkgs : origin),\n\t\t[pkgs, origin, currentFlow]\n\t);\n\tconst lastStep = useMemo(\n\t\t() => (currentFlow === 'pickup' ? origin : pkgs),\n\t\t[pkgs, origin, currentFlow]\n\t);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t{firstStep ? (\n\t\t\t\t\t\n\t\t\t\t) : currentFlow === 'pickup' ? (\n\t\t\t\t\t\n\t\t\t\t) : (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t  {currentFlow === 'pickup' ? 'Guías' : 'Origen'}\n\t\t\t\n\t\t\t\n\t\t\t\t{destination ? : }\n\t\t\t\t  {currentFlow === 'pickup' ? 'Dirección' : 'Destino'}\n\t\t\t\n\t\t\t\n\t\t\t\t{lastStep ? (\n\t\t\t\t\t\n\t\t\t\t) : currentFlow === 'pickup' ? (\n\t\t\t\t\t\n\t\t\t\t) : (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t  {currentFlow === 'pickup' ? 'Indicaciones' : 'Empaques'}\n\t\t\t\n\t\t\n\t);\n};\n\nexport default RateOrSendControl;\n","import { create } from 'zustand';\nimport produce from 'immer';\n\ntype Notification = {\n\tmessage: string;\n\tdate: Date;\n\tcallBack?: () => void;\n};\n\ninterface NotificationStore {\n\tnotificationsQueue: Notification[];\n\tsetNotificationQueue: (notification: Notification) => void;\n\tsetNotificationDefaultList: (notifications: Notification[]) => void;\n\tclearNotificationsQueue: () => void;\n}\n\nconst useNotificationStore = create((set) => ({\n\tnotificationsQueue: [],\n\tsetNotificationQueue: (notification: Notification) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.notificationsQueue.push(notification);\n\t\t\t})\n\t\t),\n\tclearNotificationsQueue: () =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.notificationsQueue = [];\n\t\t\t})\n\t\t),\n\tsetNotificationDefaultList: (notifications: Notification[]) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.notificationsQueue = notifications;\n\t\t\t})\n\t\t)\n}));\n\nexport default useNotificationStore;\n","import React from 'react';\nimport { TextField } from '@mui/material';\nimport { Autocomplete } from '@material-ui/lab';\nimport { Controller, FieldErrors, Control } from 'react-hook-form';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\n\nexport const enterpriseOperationsOptions = [\n\t{ title: 'Alimentos/bebidas', value: 'food' },\n\t{ title: 'Industria Agropecuaria', value: 'agriculture' },\n\t{ title: 'Marketing/Publicidad', value: 'marketing' },\n\t{ title: 'Automotriz', value: 'automotive' },\n\t{ title: 'Salud', value: 'health' },\n\t{ title: 'Inmobiliaria', value: 'real_estate' },\n\t{ title: 'Electrónica/Tecnología', value: 'technology' },\n\t{ title: 'Educación', value: 'education' },\n\t{ title: 'Servicios Profesionales', value: 'professional' },\n\t{ title: 'Servicios Gubernamentales', value: 'government' },\n\t{ title: 'Organización Civil', value: 'non_profit' },\n\t{ title: 'Transportación', value: 'transport' },\n\t{ title: 'Moda', value: 'fashion' },\n\t{ title: 'Otro', value: 'other' } // DO NOT DELETE this value\n];\n\ninterface Props {\n\t// Function to pass the selected value\n\tcontrol: Control;\n\terrors: FieldErrors;\n\tdefaultValue?: { title: string; value: string };\n\tdisabled?: boolean;\n}\n\n/**\n * Autocomplete for 'Tipo de empresa'\n */\nconst EnterpriseOperations: React.FC = (props) => {\n\treturn (\n\t\t (\n\t\t\t\t option.title}\n\t\t\t\t\tgetOptionSelected={(option, value) => option.title === value.title}\n\t\t\t\t\tonChange={(_, data) => onChange(data)}\n\t\t\t\t\tdisabled={props.disabled}\n\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\tname='enterprise_operations'\n\t\t\tcontrol={props.control}\n\t\t\t// rules={{ required: 'Ingrese el giro de la empresa' }}\n\t\t\tdefaultValue={!!props.defaultValue?.value ? props.defaultValue : null}\n\t\t/>\n\t);\n};\n\nexport default EnterpriseOperations;\n","import React, { useEffect, useState, useContext } from 'react';\nimport { TextField } from '@mui/material';\nimport { Autocomplete } from '@material-ui/lab';\nimport { Controller, FieldErrors, Control } from 'react-hook-form';\nimport AuthContext from '~context/AuthContext';\nimport { UserRole } from '~store/actions/ActionTypes';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\n\nexport const channelOptions = [\n\t{ title: 'Vendedor', value: 'vendor' },\n\t{ title: 'Facebook', value: 'facebook' },\n\t{ title: 'Grupo de Facebook', value: 'facebook_group' },\n\t{ title: 'Instagram', value: 'instagram' },\n\t{ title: 'Google', value: 'google' },\n\t{ title: 'Agencia MKTG', value: 'agency_mktg' },\n\t{ title: 'Empresa Desarrollo', value: 'company_dev' },\n\t{ title: 'Recomendación', value: 'recommendation' },\n\t{ title: 'Evento', value: 'event' },\n\t{ title: 'Otro', value: 'other' }\n];\n\ninterface Props {\n\t// Function to pass the selected value\n\tcontrol: Control;\n\terrors: FieldErrors;\n\tdefaultValue?: { title: string; value: string };\n}\n\n/**\n * Autocomplete for 'Cómo no encontraste?'\n */\nconst ChannelInput: React.FC = (props) => {\n\tconst { currentUser } = useContext(AuthContext);\n\n\tconst [localChannelOptions, setChannelOptions] = useState(\n\t\tchannelOptions.filter((f) => f.value !== 'vendor')\n\t);\n\n\tuseEffect(() => {\n\t\tif (currentUser.role === UserRole.AGENT || currentUser.role === UserRole.ROOT) {\n\t\t\tsetChannelOptions((prev) => [{ title: 'Vendedor', value: 'vendor' }, ...prev]);\n\t\t}\n\t}, [currentUser.role]);\n\n\treturn (\n\t\t (\n\t\t\t\t option.title}\n\t\t\t\t\tgetOptionSelected={(option, value) => option.title === value.title}\n\t\t\t\t\tonChange={(_, data) => onChange(data)}\n\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\tname='channel'\n\t\t\tcontrol={props.control}\n\t\t\t// rules={{ required: 'Ingresé el medio por el cual se enteró de Encamino' }}\n\t\t\tdefaultValue={props.defaultValue ? props.defaultValue : null}\n\t\t/>\n\t);\n};\n\nexport default ChannelInput;\n","import { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\n\nexport const radiusCard = 20;\nexport const maxWidthContainerCard = 960;\nexport const maxWidthContainer = 1200;\n\n//TODO revisar si el padding tambien se puede factorizar\n// TODO remove the root class\n\nconst cardStyles = makeStyles((theme: Theme) => ({\n\t// Obscuro\n\tcard: {\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tborderRadius: radiusCard\n\t},\n\thardColor: {\n\t\tbackgroundColor: theme.palette.background.default\n\t},\n\tsoftColor: {\n\t\tbackgroundColor: theme.palette.background.paper\n\t},\n\t// Clarito\n\troot: {\n\t\tborderRadius: radiusCard,\n\t\tbackgroundColor: theme.palette.background.paper\n\t},\n\tbottomBorderOnly: {\n\t\tborderRadius: '0 0 20px 20px'\n\t}\n}));\n\nexport const useCardStyles = () => {\n\tconst cardClasses = cardStyles();\n\treturn { cardClasses };\n};\n\n//=============================================================\n\nconst btnAddAutocompleteStyles = makeStyles((theme: Theme) => ({\n\tbtnAdd: {\n\t\t//marginTop: 20,\n\t\tcolor: theme.palette.primary.main,\n\t\tjustifyContent: 'flex-start',\n\t\theight: 45,\n\t\tbackgroundColor: 'inherit'\n\t},\n\ticonAdd: {\n\t\tcolor: theme.palette.primary.main,\n\t\tbackgroundColor: 'rgba(255, 255, 255, 0.08)',\n\t\tpadding: 3\n\t},\n\twithoutStyles: {\n\t\tborder: 0,\n\t\tbackground: 'transparent',\n\t\tcolor: '#ABABAC',\n\t\t'&:hover': {\n\t\t\tcolor: 'white',\n\t\t\tcursor: 'pointer'\n\t\t},\n\t\t'&:disabled': {\n\t\t\t'&:hover': {\n\t\t\t\tcolor: '#ABABAC',\n\t\t\t\tcursor: 'auto'\n\t\t\t}\n\t\t}\n\t}\n}));\nexport const useAddBtnAutocompleteStyles = () => {\n\tconst btnAutocompleteClasses = btnAddAutocompleteStyles();\n\treturn { btnAutocompleteClasses };\n};\n\n//=============================================================\n\nconst tabsStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\twidth: '100%',\n\t\tborderRadius: '20px 20px 0 0',\n\t\t'&>*': {\n\t\t\tflex: 1,\n\t\t\tmaxWidth: 'unset',\n\t\t\tfontWeight: 700,\n\t\t\tjustifySelf: 'flex-start'\n\t\t}\n\t},\n\toption: {\n\t\twidth: 150,\n\t\tborderBottom: 'solid 0.9px rgb(81, 81, 81)',\n\t\tpaddingLeft: 0,\n\t\tpaddingRight: 0\n\t\t// '& > span:nth-child(1)': {\n\t\t// \tborderRight: '1px solid #505050'\n\t\t// }\n\t},\n\tlabel: {\n\t\tfontSize: 25\n\t},\n\toptionSelected: {\n\t\tborderBottom: 'solid 4px ' + theme.palette.primary.main,\n\t\tbackgroundColor: '#4d4d4d',\n\t\tborderTopLeftRadius: '20px',\n\t\tborderTopRightRadius: '20px'\n\t}\n}));\n\nexport const useTabsStyles = () => {\n\tconst tabsClasses = tabsStyles();\n\treturn { tabsClasses };\n};\n\n//=============================================================\n\nconst tableStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\t'& p[data-type=\"uppercase\"]': {\n\t\t\ttextTransform: 'uppercase'\n\t\t},\n\t\t'& div[data-type=\"uppercase\"]': {\n\t\t\ttextTransform: 'uppercase'\n\t\t},\n\t\ttableMUIContainer: {\n\t\t\tmarginTop: theme.spacing(2),\n\t\t\tborder: '1px solid rgb(88, 87, 87) !important',\n\t\t\tboxShadow: 'none !important',\n\t\t\tborderRadius: '8px',\n\t\t\tcolor: 'white !important',\n\t\t\t'& *': {\n\t\t\t\tcolor: 'white !important'\n\t\t\t},\n\t\t\t'& th': {\n\t\t\t\tborderBottom: '1px solid rgba(81, 81, 81, 1)'\n\t\t\t},\n\t\t\t'& td': {\n\t\t\t\tborderBottom: '1px solid rgba(81, 81, 81, 1)'\n\t\t\t}\n\t\t},\n\t\ttableMUIEmpty: {\n\t\t\theight: '124px',\n\t\t\tcolor: 'white !important'\n\t\t},\n\t\ttableMUIPagination: {\n\t\t\tdisplay: 'inline-block',\n\t\t\tmargin: '0',\n\t\t\tcolor: 'white !important',\n\t\t\t'& td': {\n\t\t\t\tborderBottom: '1px solid rgba(81, 81, 81, 1)'\n\t\t\t}\n\t\t},\n\t\ttableMUIHeaderColumn: {\n\t\t\tborderLeft: '2px solid white',\n\t\t\tpaddingLeft: '12px',\n\t\t\tcolor: 'white !important'\n\t\t}\n\t},\n\t'& div[data-type=\"uppercase\"] input': {\n\t\ttextTransform: 'uppercase'\n\t},\n\t'& input[data-type=\"capitalize\"]': {\n\t\ttextTransform: 'capitalize'\n\t},\n\t'& p[data-type=\"capitalize\"]': {\n\t\ttextTransform: 'capitalize'\n\t},\n\t'& div[data-type=\"capitalize\"]': {\n\t\ttextTransform: 'capitalize'\n\t},\n\tinput: {\n\t\t'& input': {\n\t\t\ttextTransform: 'uppercase'\n\t\t}\n\t},\n\ttableMUIContainer: {\n\t\tmarginTop: theme.spacing(2),\n\t\tborder: '1px solid rgb(88, 87, 87) !important',\n\t\tboxShadow: 'none !important',\n\t\tborderRadius: '8px',\n\t\tbackground: `${theme.palette.background.paper} !important`,\n\t\tcolor: 'white !important',\n\t\t'& *': {\n\t\t\tcolor: 'white !important'\n\t\t},\n\t\t'& th': {\n\t\t\tborderBottom: '1px solid rgba(81, 81, 81, 1)',\n\t\t\tpaddingRight: '0 !important'\n\t\t},\n\t\t'& td': {\n\t\t\tborderBottom: '1px solid rgba(81, 81, 81, 1)',\n\t\t\tpaddingRight: '0 !important'\n\t\t}\n\t},\n\ttableMUIEmpty: {\n\t\theight: '124px'\n\t},\n\ttableMUIPagination: {\n\t\tdisplay: 'inline-block',\n\t\tmargin: '0',\n\t\tcolor: 'white !important',\n\t\t'& td': {\n\t\t\tborderBottom: '1px solid rgba(81, 81, 81, 1)'\n\t\t}\n\t},\n\ttableMUIHeaderColumn: {\n\t\tborderLeft: '2px solid white',\n\t\tpaddingLeft: '12px'\n\t}\n}));\n\nexport const useTableStyles = () => {\n\tconst tableClasses = tableStyles();\n\treturn { tableClasses };\n};\n\n//=============================================================\n\nconst modalStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tpadding: theme.spacing(3),\n\t\t'& p': {\n\t\t\tmargin: 0\n\t\t}\n\t}\n}));\n\nexport const useModalStyles = () => {\n\tconst modalClasses = modalStyles();\n\treturn { modalClasses };\n};\n","import { Theme } from '@mui/material/styles';\nimport { makeStyles, withStyles } from '@mui/styles';\nimport { forwardRef, Ref, ReactElement } from 'react';\nimport { IconButton, Typography, Slide } from '@mui/material';\nimport {\n\tDialog as MuiDialog,\n\tDialogTitle as MuiDialogTitle,\n\tDialogContent as MuiDialogContent\n} from '@mui/material';\nimport { TransitionProps } from '@mui/material/transitions';\nimport { X } from 'react-feather';\n\nexport const styles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tmargin: 0,\n\t\tpadding: theme.spacing(1)\n\t},\n\tcloseButton: {\n\t\tposition: 'absolute',\n\t\tright: theme.spacing(3),\n\t\ttop: theme.spacing(3),\n\t\tcolor: theme.palette.grey[500]\n\t}\n}));\n\n// interface DialogTitleProps extends WithStyles {\n// \tchildren: ReactNode;\n// \tonClose: () => void;\n// }\n\nexport const Transition = forwardRef(function Transition(\n\tprops: TransitionProps & { children: ReactElement },\n\tref: Ref\n) {\n\treturn ;\n});\n\nexport const DialogTitle = (props: any) => {\n\tconst { children, onClose, ...other } = props;\n\treturn (\n\t\t\n\t\t\t{children}\n\t\t\t{onClose ? (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t) : null}\n\t\t\n\t);\n};\n\nexport const DialogContent = withStyles((theme: Theme) => ({\n\troot: {\n\t\tpadding: `0 ${theme.spacing(2)} !important`,\n\t\tbackgroundColor: theme.palette.background.default\n\t}\n}))(MuiDialogContent);\n\nexport const Dialog = withStyles(() => ({\n\tpaperFullScreen: {\n\t\twidth: '85%',\n\t\tmaxWidth: '1300px'\n\t},\n\tscrollPaper: {\n\t\tjustifyContent: 'flex-end'\n\t}\n}))(MuiDialog);\n","import { Button, ButtonProps, CircularProgress } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\nimport {\n\tArrowRight,\n\tArrowLeft,\n\tSave as SaveIcon,\n\tSend as SendIcon,\n\tTruck,\n\tEye,\n\tEdit\n} from 'react-feather';\n\nconst useStyles = makeStyles((theme) => ({\n\tbtn: {\n\t\tcolor: '#fff',\n\t\tbackground: 'linear-gradient(180deg, #57BBD8 0%, #0088D5 100%), #57BBD8 !important',\n\t\t'&:hover': {\n\t\t\tbackground: '#1A84BF !important'\n\t\t},\n\t\tborderRadius: '8px',\n\t\tpadding: `${theme.spacing(1.5)} ${theme.spacing(2.5)}`,\n\t\tminWidth: 120\n\t},\n\ttext: {\n\t\tpadding: '0 6px'\n\t}\n}));\n\ninterface Props extends ButtonProps {\n\tredirectTo?: string;\n\tchildren?: string;\n\tisLoading?: boolean;\n\ticon?: 'save' | 'arrow' | 'package' | 'create-guide' | 'arrow_left' | 'pickup' | 'eye' | 'edit';\n\tnoIcon?: boolean;\n}\n\nexport default function SaveButton({\n\tredirectTo,\n\tchildren,\n\ticon,\n\tisLoading,\n\tnoIcon,\n\t...props\n}: Props) {\n\tconst classes = useStyles();\n\n\treturn (\n\t\t\n\t);\n}\n","import useSWR from 'swr';\nimport { useState, useContext, useCallback } from 'react';\nimport { useHistory, useRouteMatch } from 'react-router-dom';\nimport useQuery from './useQuery';\nimport axios from '../util/axios';\nimport { GridCallbackDetails } from '@mui/x-data-grid';\nimport DrawContext from '~context/DrawContext';\nimport { useSelector } from 'react-redux';\nimport { RootStore } from '~store/store';\nimport usePermissions from './usePermissions';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction logger(useSWRNext: any) {\n\treturn (key: string, fetcher: () => void, config: any) => {\n\t\t// Add logger to the original fetcher.\n\t\tconst extendedFetcher = (...args: any) => {\n\t\t\t// @ts-ignore\n\t\t\treturn fetcher(...args);\n\t\t};\n\n\t\t// Execute the hook with the new fetcher.\n\t\treturn useSWRNext(key, extendedFetcher, config);\n\t};\n}\n\nconst FOR_ACCOUNT_STATUS = 'for_account_status';\ninterface Props {\n\t/**\n\t * URL to send the request to recover the resources\n\t *\n\t * Example: /api/items\n\t */\n\turl: string;\n\n\t/**\n\t * The query parameter we send in the request to tell the server\n\t * how many resources to send us back\n\t *\n\t * Example: limit: 50 => /api/items?limit=50\n\t */\n\tlimit?: number;\n\n\t/**\n\t * Query parameter that we will watch with react-router to fetch another\n\t * page\n\t *\n\t * Example: param: itemPage => /items?itemPage=2\n\t */\n\tparam: string;\n\n\t/**\n\t * Optional parameter that allow us to specify how to transform the response\n\t * from the server to one format to another\n\t *\n\t * Example: response: { service_id: 1 } => { id: response.service_id }\n\t */\n\ttransformer?: (value: any) => T;\n\n\t/**\n\t * Query params that we will keep track of to send to the server\n\t */\n\tqueryParams?: string[];\n\n\t/**\n\t * Query params for search\n\t */\n\tquerySearch?: string;\n\n\t/**\n\t * Optional parameter for permissions\n\t */\n\tcanHaveActions?: boolean;\n}\n\ninterface PaginationState {\n\t/**\n\t * Keeps track of whether this if the first time we're making a fetch call\n\t */\n\tinitialFetch: boolean;\n\n\t/**\n\t * State to keep tracking of whether or not we're fetching something from\n\t * the server\n\t */\n\t// loading: boolean;\n\n\t/**\n\t * The total amount of resources that the server has for this endpoint\n\t */\n\ttotal: number;\n}\n\n/**\n * usePagination Hook\n *\n * @param\n * @returns\n */\nexport default function usePagination({\n\turl,\n\tlimit,\n\tparam,\n\ttransformer,\n\tqueryParams,\n\tquerySearch,\n\tcanHaveActions\n}: Props) {\n\t// Query parameters for the server\n\t// const [queryParams, setQueryParams] = useState('');\n\tconst query = useQuery();\n\tconst history = useHistory();\n\tconst [state, updateState] = useState({ total: 0, initialFetch: true });\n\tconst { setNotification } = useContext(DrawContext);\n\tconst { simulatedUser, simulatedCustomer } = useSelector(\n\t\t(state: RootStore) => state.simulatedUser\n\t);\n\tconst { isRootOrAgent } = usePermissions();\n\n\tlet matchLabels = useRouteMatch('/envios');\n\tlet matchBusiness = useRouteMatch('/centro-costos');\n\n\tconst fetcher = useCallback(\n\t\tasync (\n\t\t\turl: string,\n\t\t\tpage: string | number,\n\t\t\t// perPage: string | number,\n\t\t\t...params: string[]\n\t\t) => {\n\t\t\tupdateState((prevState) => ({ ...prevState, loading: true }));\n\t\t\tlet endpoint = url;\n\t\t\tif (!queryParams?.includes('page')) {\n\t\t\t\tendpoint = `${url}?page=${page}`;\n\t\t\t}\n\n\t\t\tif (!!queryParams && !!params?.length) {\n\t\t\t\tendpoint +=\n\t\t\t\t\t(endpoint.includes('=') ? '&' : '?') +\n\t\t\t\t\tparams\n\t\t\t\t\t\t.map((queryValue, queryIndex) => {\n\t\t\t\t\t\t\tconst value: string =\n\t\t\t\t\t\t\t\ttypeof queryValue === 'number' ? (queryValue as number)?.toString() : queryValue;\n\t\t\t\t\t\t\tif (queryValue === FOR_ACCOUNT_STATUS) {\n\t\t\t\t\t\t\t\treturn `${FOR_ACCOUNT_STATUS}=true`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!value) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (value.includes('=')) {\n\t\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn `${queryParams[queryIndex]}=${value}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.filter((param) => Boolean(param))\n\t\t\t\t\t\t.join('&');\n\t\t\t}\n\n\t\t\t// TODO: which other route needs customer_id (even with user_id)\n\t\t\tif (\n\t\t\t\t(isRootOrAgent && matchBusiness && !endpoint.includes('customer_id')) ||\n\t\t\t\tcanHaveActions === false\n\t\t\t)\n\t\t\t\treturn;\n\t\t\ttry {\n\t\t\t\tconst response = await axios.get(endpoint);\n\t\t\t\t// Keep reference of total of elements so we can display in the DataGrid\n\t\t\t\tconst state = { total: response.data.total } as PaginationState;\n\t\t\t\tstate.initialFetch = false;\n\t\t\t\tupdateState(state);\n\t\t\t\treturn transformer ? response.data.data.map(transformer) : response.data.data;\n\t\t\t} catch (error) {\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: `Hubo un error al obtener ${matchBusiness ? 'las razones sociales' : matchLabels ? 'las guías' : 'la información'\n\t\t\t\t\t\t}.`,\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[isRootOrAgent, queryParams, matchBusiness, matchLabels, transformer]\n\t);\n\n\t// The key for the request will be base on url + number of page\n\tconst { data, error, isValidating, mutate } = useSWR(\n\t\t() => {\n\t\t\tconst key = [url, query.get(param) || 1];\n\n\t\t\tif (!queryParams) {\n\t\t\t\treturn key;\n\t\t\t}\n\n\t\t\t// ?carrier=estafeta\n\t\t\tfor (let i = 0; i < queryParams.length; ++i) {\n\t\t\t\tconst queryName = queryParams[i];\n\t\t\t\tif (\n\t\t\t\t\tquery.get(queryName) !== null &&\n\t\t\t\t\tqueryName !== 'user_id' &&\n\t\t\t\t\tqueryName !== 'customer_id'\n\t\t\t\t) {\n\t\t\t\t\tkey.push(query.get(queryName) as string | number);\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (queryName === 'user_id' && !!simulatedUser) {\n\t\t\t\t\tkey.push(simulatedUser?.id);\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (\n\t\t\t\t\tqueryName === 'customer_id' &&\n\t\t\t\t\t!!simulatedCustomer &&\n\t\t\t\t\t!key?.includes('user_id')\n\t\t\t\t) {\n\t\t\t\t\tkey.push(simulatedCustomer?.id);\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (queryName === FOR_ACCOUNT_STATUS) {\n\t\t\t\t\tkey.push(FOR_ACCOUNT_STATUS);\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (queryName === 'limit' && limit) {\n\t\t\t\t\tkey.push(limit);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!!querySearch && !key?.includes(querySearch)) {\n\t\t\t\t\tkey.push(`query=${querySearch}`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!!querySearch && !key?.includes(querySearch)) {\n\t\t\t\t\tkey.push(`query=${querySearch}`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn key;\n\t\t},\n\t\tfetcher,\n\t\t{ revalidateOnFocus: false }\n\t);\n\n\tfunction onPageChange(page: number, details: GridCallbackDetails) {\n\t\t// We get the query parameters from the current URL in the browser\n\t\tconst keys = Array.from(query.keys());\n\n\t\t// This case covers for example when go to a page without specifying the pagination param\n\t\t// For example if we go to: /paquetes\n\t\tif (!keys.includes(param)) {\n\t\t\tkeys.push(param);\n\t\t}\n\n\t\tlet url = keys\n\t\t\t.map((key) => {\n\t\t\t\t// If current key matches the one for this paginator, then we modify it\n\t\t\t\tif (key === param) {\n\t\t\t\t\t// DataGrid works with based-0 index for the pagination, that's why we add 1\n\t\t\t\t\treturn `${key}=${page + 1}`;\n\t\t\t\t}\n\n\t\t\t\t// If there is other params, we leave as they are\n\t\t\t\treturn `${key}=${query.get(key)}`;\n\t\t\t})\n\t\t\t.join('&');\n\n\t\t// Replace the current url to cause the fetch of the given module\n\t\thistory.replace(`${history.location.pathname}?${url}`);\n\t}\n\n\treturn {\n\t\ttotal: state.total,\n\t\tdata: data,\n\t\tloading: isValidating,\n\t\tonPageChange,\n\t\tpage: parseInt(query.get(param) || '1', 10) - 1,\n\t\tinitialFetch: state.initialFetch,\n\t\terror,\n\t\tmutate\n\t};\n}\n","import React, { MutableRefObject, useEffect, useMemo, useRef, useState } from 'react';\nimport { Controller, Control, FieldErrors } from 'react-hook-form';\nimport { Typography } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\nimport 'react-phone-number-input/style.css';\nimport PhoneInputWithCountrySelect from 'react-phone-number-input';\nimport { isValidPhoneNumber } from 'react-phone-number-input';\nimport { ErrorOption, useWatch } from 'react-hook-form';\n\ninterface Props {\n\tdisabled?: boolean;\n\tcontrol: Control;\n\terrors: FieldErrors;\n\tname: string;\n\tdefaultValue?: string;\n\trequired?: boolean;\n\tsetError?: (name: string, error: ErrorOption) => void;\n\tclearErrors?: (name?: string | string[] | undefined) => void;\n\terror?: Record;\n}\n\nconst useStyles = makeStyles((theme) => ({\n\tinputContainer: {\n\t\tbackgroundColor: '#353535',\n\t\tborderTopLeftRadius: '8px',\n\t\tborderTopRightRadius: '8px',\n\t\t'& div': {\n\t\t\tbackgroundColor: '#353535',\n\t\t\tborderTopLeftRadius: '8px',\n\t\t\tborderTopRightRadius: '8px',\n\t\t\ttransition: 'none',\n\t\t\t'& > input': {\n\t\t\t\tbackgroundColor: '#353535 !important',\n\t\t\t\tcolor: '#fff !important',\n\t\t\t\tfontFamily: 'Roboto !important',\n\t\t\t\tfontSize: '14px !important',\n\t\t\t\tpadding: '30px 12px 10px',\n\t\t\t\tborder: 'none',\n\t\t\t\tborderBottom: '1px solid #c5c5c5',\n\t\t\t\tborderTopRightRadius: '8px',\n\t\t\t\t'&:focus': {\n\t\t\t\t\tborderBottom: '1px solid #03b2cb',\n\t\t\t\t\toutline: 'none'\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t'& > div > div:nth-child(1)': {\n\t\t\t'& > div:nth-child(2)': {\n\t\t\t\tborderRadius: 0\n\t\t\t}\n\t\t},\n\t\t'& .PhoneInputCountry': {\n\t\t\tpaddingLeft: theme.spacing(2),\n\t\t\tborderBottom: '1px solid #c5c5c5',\n\t\t\tmarginRight: 0,\n\t\t\t'& > .PhoneInputCountryIcon': {\n\t\t\t\tborderRadious: '0 !important'\n\t\t\t}\n\t\t},\n\t\t'& .PhoneInput--disabled': {\n\t\t\topacity: 0.5\n\t\t}\n\t}\n}));\n\nconst PhoneNumberInput: React.FC = ({\n\tdisabled,\n\terrors,\n\tdefaultValue,\n\tcontrol,\n\tname,\n\trequired = true,\n\tsetError,\n\tclearErrors,\n\terror\n}) => {\n\tconst classes = useStyles();\n\tconst phoneNumber: string | undefined = useWatch({\n\t\tcontrol,\n\t\tname,\n\t\tdefaultValue\n\t});\n\tconst [errorMessage, setErrorMessage] = useState(null);\n\n\tuseEffect(() => {\n\t\tif (!required) {\n\t\t\tclearErrors && clearErrors(name);\n\t\t\tsetErrorMessage(null);\n\t\t\treturn;\n\t\t}\n\t\tif (phoneNumber && !isValidPhoneNumber(phoneNumber)) {\n\t\t\tsetError &&\n\t\t\t\tsetError(name, {\n\t\t\t\t\ttype: 'custom',\n\t\t\t\t\tmessage: 'El teléfono es inválido.'\n\t\t\t\t});\n\t\t\tsetErrorMessage('El teléfono es inválido.');\n\t\t} else if (!!errors[name] && errors[name]?.type !== 'custom') {\n\t\t\tsetError &&\n\t\t\t\tsetError(name, {\n\t\t\t\t\ttype: 'custom',\n\t\t\t\t\tmessage: errors[name]?.message\n\t\t\t\t});\n\t\t\tsetErrorMessage(errors[name]?.message);\n\t\t} else if (!!error) {\n\t\t\tsetError &&\n\t\t\t\tsetError(name, {\n\t\t\t\t\ttype: 'custom',\n\t\t\t\t\tmessage: error?.message\n\t\t\t\t});\n\t\t\tsetErrorMessage(error?.message);\n\t\t} else {\n\t\t\tclearErrors && clearErrors(name);\n\t\t\tsetErrorMessage(null);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [phoneNumber, errors, name, required]);\n\n\tconst label = useMemo(() => `Teléfono${required ? ' *' : ''}`, [required]);\n\n\tconst phoneRef: MutableRefObject = useRef(null);\n\n\tuseEffect(() => {\n\t\t!!phoneRef.current && phoneRef.current?.blur();\n\t}, [phoneRef]);\n\n\treturn (\n\t\t
\n\t\t\t
\n\t\t\t\t (\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tonChange(value);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t/>\n\t\t\t
\n\t\t\t{!disabled && !!errorMessage && (\n\t\t\t\t\n\t\t\t\t\t{errorMessage}\n\t\t\t\t\n\t\t\t)}\n\t\t
\n\t);\n};\n\nexport default PhoneNumberInput;\n","import { withStyles } from '@mui/styles';\nimport { Theme } from '@mui/material/styles';\nimport Switch, { /*SwitchClassKey,*/ SwitchProps } from '@mui/material/Switch';\n// interface Styles extends Partial> {\n// \tfocusVisible?: string;\n// }\n\ninterface Props extends SwitchProps {\n\tclasses: any; //Styles;\n\tuseRed?: boolean;\n}\n\nconst IOSSwitch = withStyles((theme: Theme) => ({\n\tswitchBase: {\n\t\t'&$checked': {\n\t\t\ttransform: 'translateX(16px)',\n\t\t\tcolor: theme.palette.common.white,\n\t\t\t'& + $track': {\n\t\t\t\tbackgroundColor: '#52d869',\n\t\t\t\topacity: 1,\n\t\t\t\tborder: 'none'\n\t\t\t}\n\t\t}\n\t\t// '&$focusVisible $thumb': {\n\t\t// \tcolor: '#52d869',\n\t\t// \tborder: '6px solid #fff'\n\t\t// }\n\t},\n\ttrack: {\n\t\t// borderRadius: 26 / 2,\n\t\tborder: `1px solid ${theme.palette.grey[400]}`,\n\t\tbackgroundColor: theme.palette.grey[50],\n\t\topacity: 1\n\t\t// transition: theme.transitions.create(['background-color', 'border'])\n\t},\n\tredTrack: {\n\t\t// borderRadius: 26 / 2,\n\t\tborder: `1px solid ${theme.palette.grey[400]}`,\n\t\tbackgroundColor: theme.palette.error.dark,\n\t\topacity: 1\n\t\t// transition: theme.transitions.create(['background-color', 'border'])\n\t},\n\tchecked: {\n\t\tcolor: theme.palette.error.main\n\t},\n\tfocusVisible: {}\n}))(({ classes, useRed, ...props }: Props) => {\n\treturn (\n\t\t\n\t);\n});\n\nexport default IOSSwitch;\n","import React, { useEffect, useRef, useState } from 'react';\nimport { useDebounce } from 'use-debounce';\nimport { Autocomplete } from '@material-ui/lab';\nimport { createFilterOptions } from '@mui/material';\nimport { useDispatch } from 'react-redux';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { Button, Grid, IconButton, Tooltip, Typography } from '@mui/material';\nimport { Plus as PlusIcon, Edit as EditIcon } from 'react-feather';\n\nimport RenderInput from './_RenderInput';\n\nimport { useAddBtnAutocompleteStyles } from '../../hooks/useStyles';\nimport useInputSearchAddress from '~hooks/useInputSearchAddress';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\n\nimport {\n\tsetAddressPickUp,\n\tsetAddressRate,\n\tsetAddressSend,\n\tsetAddressQuery,\n\tsetAddressCreate\n} from '~store/actions';\nimport { AddressRequest, NewAddress } from '~store/actions/ActionTypes';\nimport { useSelector } from '~store/store';\nimport usePermissions from '~hooks/usePermissions';\n\n//FIXME This can only be fixed when the issue get resolved\n// https://github.com/mui-org/material-ui/issues/20991\n// UPDATE: Now is posiblle\n// TODO change\nlet showAddBtn = true;\n\ninterface PlsBtnAutoComplete {\n\tcallBack?: () => void;\n\ttarget: 'origin' | 'destination';\n\tisCreating?: boolean;\n\tchildren: React.ReactNode;\n\tsaveCurrentFields?: () => void;\n}\n\n// https://stackoverflow.com/questions/59291614/how-can-i-create-a-clickable-first-option-in-material-ui-labs-autocomplete\nconst PlusButtonAutoComplete: React.FC = (props) => {\n\tconst history = useHistory();\n\tconst { btnAutocompleteClasses } = useAddBtnAutocompleteStyles();\n\tconst { id } = useParams<{ id?: string }>();\n\n\treturn (\n\t\t\n\t\t\t{showAddBtn && (\n\t\t\t\t {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}}\n\t\t\t\t\tclassName={btnAutocompleteClasses.btnAdd}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tif (props.callBack) {\n\t\t\t\t\t\t\tprops.callBack();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprops.saveCurrentFields && props.saveCurrentFields();\n\t\t\t\t\t\tif (props.isCreating) {\n\t\t\t\t\t\t\tlet url = `/direccion-simple?target=${props.target}`;\n\t\t\t\t\t\t\thistory.push(id ? url.concat(`&labelId=${id}`) : url);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\thistory.push(`/direccion?target=${props.target}`);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t) => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisableRipple\n\t\t\t\t\t\tclassName={btnAutocompleteClasses.iconAdd}\n\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t  Agregar nueva dirección\n\t\t\t\t\n\t\t\t)}\n\t\t\t{props.children}\n\t\t\n\t);\n};\n\n// to handle add address\nconst idForNewAddresses = 'newAddresses';\n\n// Filter search for Address, to find by anything\nconst filterOptionsAddress = createFilterOptions({\n\ttrim: true,\n\tstringify: (option) => JSON.stringify(option)\n});\n\ninterface Props {\n\tfor: 'addressOrigin' | 'addressDestination';\n\tlabel: string; //pass to the render input\n\tisRating?: boolean; // when rating, to show or no the add btn\n\tisPickingUp?: boolean; // when pickup, to show or no the add btn\n\tisCreating?: boolean; //when creating guide\n\tisCreatingCustomer?: boolean; // when creating and customer, to dispatch to the correct redux\n\tonAddButton?: () => void; // callback when click on add new address\n\treset?: boolean;\n\tisPickingUpFromDelivery?: boolean;\n\tdisabled?: boolean;\n\tsaveCurrentFields?: () => void;\n\tfromAddressForm?: boolean;\n}\n\n/**\n * Autocomplete for search address\n */\nconst InputSearchAddress: React.FC = (props) => {\n\tconst dispatch = useDispatch();\n\tconst history = useHistory();\n\tconst { id } = useParams<{ id?: string }>();\n\n\tconst [addr, setAddr] = useState(null);\n\tconst [simpleAddr, setSimpleAddr] = useState(null);\n\tconst [showError, setShowError] = useState(false);\n\tconst firstTimeMounted = useRef(true);\n\n\tconst { btnAutocompleteClasses } = useAddBtnAutocompleteStyles();\n\tconst { isRootOrAgent } = usePermissions();\n\tconst [query, setQuery] = useState('');\n\tconst [queryDebounce] = useDebounce(query, 300);\n\tconst { simulatedUser } = useSelector((state) => state.simulatedUser);\n\tconst {\n\t\tdata: addresses,\n\t\tupdateParam,\n\t\tparams: pms,\n\t\tupdateParams,\n\t\tsimpleData: simpleAddresses\n\t} = useInputSearchAddress({ isRootOrAgent });\n\n\tconst { currentFlow } = useSelector((state) => state.flow);\n\tconst { addressPickUp, isTouchedPickup, labelsPickup } = useSelector((state) => state.pickup);\n\tconst {\n\t\toriginAddressSend,\n\t\tdestinationAddressSend,\n\t\tisTouchedSend,\n\t\toriginQuery,\n\t\tdestinationQuery\n\t} = useSelector((state) => state.send);\n\tconst { originAddressRate, destinationAddressRate, isTouchedRate } = useSelector(\n\t\t(state) => state.rate\n\t);\n\tconst { originAddressCreate, destinationAddressCreate, isTouchedCreate } = useSelector(\n\t\t(state) => state.create\n\t);\n\n\t//Se resetean los campos\n\tuseEffect(() => {\n\t\tif (props.reset) {\n\t\t\t// resetSend()\n\t\t\tconst target = props.for === 'addressDestination' ? 'destination' : 'origin';\n\t\t\tdispatch(setAddressQuery(null, target));\n\t\t\tdispatch(setAddressSend(null, 'origin', []));\n\t\t\tdispatch(setAddressSend(null, 'destination', []));\n\t\t\tdispatch(setAddressCreate(null, 'destination', []));\n\t\t\tdispatch(setAddressCreate(null, 'origin', []));\n\t\t}\n\t}, [props.reset, dispatch, props.for]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\tcurrentFlow !== 'send' &&\n\t\t\tcurrentFlow !== 'pickup' &&\n\t\t\tcurrentFlow !== 'rate' &&\n\t\t\tcurrentFlow !== 'create' &&\n\t\t\t!firstTimeMounted.current\n\t\t)\n\t\t\treturn;\n\n\t\tconst target = props.for === 'addressDestination' ? 'destination' : 'origin';\n\t\tif (queryDebounce.length === 0) {\n\t\t\tupdateParam('query', undefined);\n\t\t\tif (currentFlow === 'send') dispatch(setAddressQuery(null, target));\n\t\t} else {\n\t\t\tupdateParam('query', queryDebounce);\n\t\t\tif (currentFlow === 'send') dispatch(setAddressQuery(queryDebounce, target));\n\t\t}\n\t}, [queryDebounce, updateParam, currentFlow, dispatch, props.for]);\n\n\tuseEffect(() => {\n\t\tif (simulatedUser && simulatedUser.id !== pms.user_id) {\n\t\t\tupdateParams((prevState) => ({\n\t\t\t\t...prevState,\n\t\t\t\trows: [],\n\t\t\t\tparams: {\n\t\t\t\t\t...prevState.params,\n\t\t\t\t\tpage: 0,\n\t\t\t\t\tuser_id: simulatedUser.id,\n\t\t\t\t\tcustomer_id: undefined,\n\t\t\t\t\tquery: undefined\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tif (!simulatedUser && pms.user_id !== undefined) {\n\t\t\tupdateParams((prevState) => ({\n\t\t\t\t...prevState,\n\t\t\t\trows: [],\n\t\t\t\tparams: {\n\t\t\t\t\t...prevState.params,\n\t\t\t\t\tpage: 0,\n\t\t\t\t\tuser_id: undefined,\n\t\t\t\t\tquery: undefined\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t}, [simulatedUser, pms.user_id, updateParams]);\n\n\t// Show add button\n\tif (props.isRating || props.isPickingUp || props.isCreating) {\n\t\tshowAddBtn = false;\n\t}\n\n\t// Clear error\n\tuseEffect(() => {\n\t\tif (\n\t\t\t(currentFlow === 'rate' && !isTouchedRate) ||\n\t\t\t(currentFlow === 'send' && !isTouchedSend) ||\n\t\t\t(currentFlow === 'pickup' && !isTouchedPickup)\n\t\t) {\n\t\t\tsetShowError(false);\n\t\t}\n\t}, [currentFlow, isTouchedRate, isTouchedSend, isTouchedPickup]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\tcurrentFlow === 'create' &&\n\t\t\tisTouchedCreate &&\n\t\t\t(!originAddressCreate || !destinationAddressCreate)\n\t\t) {\n\t\t\tsetShowError(true);\n\t\t}\n\t}, [currentFlow, isTouchedCreate, destinationAddressCreate, originAddressCreate]);\n\n\tuseEffect(() => {\n\t\tif (currentFlow === 'create') {\n\t\t\tconst simpleAddr = simpleAddresses?.find((a) => a.id === addr?.id);\n\t\t\tsetSimpleAddr(simpleAddr || null);\n\t\t}\n\t}, [addr?.id, currentFlow, simpleAddresses]);\n\n\t/**\n\t * Set Default Value\n\t * This turns complicated because setaddr will dipatch to the value\n\t * and get looped\n\t */\n\tuseEffect(() => {\n\t\tif (!firstTimeMounted.current) return;\n\t\tif (currentFlow === 'pickup' && addressPickUp) {\n\t\t\t// PICKUP\n\t\t\tsetAddr(addresses.find((a) => a.id === addressPickUp.id) as NewAddress);\n\t\t} else if (currentFlow === 'send') {\n\t\t\tif (props.for === 'addressDestination' && destinationAddressSend) {\n\t\t\t\tsetAddr(addresses.find((a) => a.id === destinationAddressSend.id) as NewAddress);\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetAddr(null);\n\t\t\t\t}\n\t\t\t} else if (props.for === 'addressOrigin' && originAddressSend) {\n\t\t\t\tsetAddr(addresses.find((a) => a.id === originAddressSend.id) as NewAddress);\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetAddr(null);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (currentFlow === 'rate') {\n\t\t\t// RATE\n\t\t\tlet add = null;\n\t\t\tif (props.for === 'addressDestination' && destinationAddressRate) {\n\t\t\t\tadd = addresses.find((a) => a.id === destinationAddressRate.id);\n\t\t\t} else if (props.for === 'addressOrigin' && originAddressRate) {\n\t\t\t\tadd = addresses.find((a) => a.id === originAddressRate.id);\n\t\t\t}\n\t\t\tsetAddr(add ? add : null);\n\t\t} else if (currentFlow === 'create') {\n\t\t\t// MANUAL\n\t\t\tlet add = null;\n\t\t\tif (props.for === 'addressDestination' && destinationAddressCreate) {\n\t\t\t\tadd = (addresses.find((a) => a.address === destinationAddressCreate.address) ??\n\t\t\t\t\tdestinationAddressCreate) as NewAddress;\n\t\t\t} else if (props.for === 'addressOrigin' && originAddressCreate) {\n\t\t\t\tadd = (addresses.find((a) => a.address === originAddressCreate.address) ??\n\t\t\t\t\toriginAddressCreate) as NewAddress;\n\t\t\t}\n\t\t\tsetAddr(add ? add : null);\n\t\t}\n\n\t\tif (currentFlow === 'send') {\n\t\t\t// SEND\n\t\t\tconst target = props.for === 'addressDestination' ? 'destination' : 'origin';\n\t\t\tif (target === 'origin' && originQuery) {\n\t\t\t\tupdateParam('query', originQuery);\n\t\t\t\tsetQuery(originQuery!);\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetQuery('');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (target === 'destination' && destinationQuery) {\n\t\t\t\tupdateParam('query', destinationQuery);\n\t\t\t\tsetQuery(destinationQuery!);\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetQuery('');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfirstTimeMounted.current = false;\n\t}, [\n\t\tcurrentFlow,\n\t\taddressPickUp,\n\t\taddresses,\n\t\tprops.for,\n\t\toriginAddressSend,\n\t\tdestinationAddressSend,\n\t\toriginAddressRate,\n\t\tdestinationAddressRate,\n\t\toriginQuery,\n\t\tdestinationQuery,\n\t\tsetQuery,\n\t\tupdateParam,\n\t\tprops.reset,\n\t\toriginAddressCreate,\n\t\tdestinationAddressCreate\n\t]);\n\n\t// handle changes for the swap btn when sending or when it resets\n\tuseEffect(() => {\n\t\tif (firstTimeMounted.current) return;\n\t\tif (currentFlow === 'send') {\n\t\t\t// SEND\n\t\t\tif (props.for === 'addressDestination') {\n\t\t\t\tif (destinationAddressSend) {\n\t\t\t\t\tsetAddr(addresses.find((a) => a.id === destinationAddressSend.id) as NewAddress);\n\t\t\t\t} else {\n\t\t\t\t\tsetAddr(null);\n\t\t\t\t}\n\t\t\t\t//parra resetear al cambiar de user\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetAddr(null);\n\t\t\t\t}\n\t\t\t} else if (props.for === 'addressOrigin') {\n\t\t\t\tif (originAddressSend && !props.isPickingUpFromDelivery) {\n\t\t\t\t\tsetAddr(addresses.find((a) => a.id === originAddressSend.id) as NewAddress);\n\t\t\t\t} else if (!originAddressSend) {\n\t\t\t\t\tsetAddr(null);\n\t\t\t\t}\n\t\t\t\t//parra resetear al cambiar de user\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetAddr(null);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (currentFlow === 'rate') {\n\t\t\t// RATE\n\t\t\tif (props.for === 'addressDestination') {\n\t\t\t\tif (destinationAddressRate) {\n\t\t\t\t\tsetAddr(addresses.find((a) => a.id === destinationAddressRate.id) as NewAddress);\n\t\t\t\t} else {\n\t\t\t\t\tsetAddr(null);\n\t\t\t\t}\n\t\t\t} else if (props.for === 'addressOrigin') {\n\t\t\t\tif (originAddressRate) {\n\t\t\t\t\tsetAddr(addresses.find((a) => a.id === originAddressRate.id) as NewAddress);\n\t\t\t\t} else {\n\t\t\t\t\tsetAddr(null);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (currentFlow === 'pickup') {\n\t\t\t// PICKUP\n\t\t\tif (addressPickUp) {\n\t\t\t\tconst result = addresses.find((a) => a.id === addressPickUp.id) as NewAddress;\n\t\t\t\tresult && setAddr(result);\n\t\t\t} else {\n\t\t\t\tsetAddr(null);\n\t\t\t}\n\t\t} else if (currentFlow === 'create') {\n\t\t\t// MANUAL\n\t\t\tif (!addresses.length) return;\n\t\t\tif (props.for === 'addressDestination') {\n\t\t\t\tif (destinationAddressCreate) {\n\t\t\t\t\tconst defaultValue = (addresses.find((a) =>\n\t\t\t\t\t\tdestinationAddressCreate?.id\n\t\t\t\t\t\t\t? destinationAddressCreate.id === a.id\n\t\t\t\t\t\t\t: destinationAddressCreate.address === a.address ||\n\t\t\t\t\t\t\t destinationAddressCreate.business_name === a.alias\n\t\t\t\t\t) ?? destinationAddressCreate) as NewAddress;\n\t\t\t\t\tdispatch(\n\t\t\t\t\t\tsetAddressCreate(destinationAddressCreate, 'destination', defaultValue?.contacts ?? [])\n\t\t\t\t\t);\n\t\t\t\t\tsetAddr(defaultValue);\n\t\t\t\t} else {\n\t\t\t\t\tsetAddr(null);\n\t\t\t\t}\n\t\t\t} else if (props.for === 'addressOrigin') {\n\t\t\t\tif (originAddressCreate) {\n\t\t\t\t\tconst defaultValue = (addresses.find((a) =>\n\t\t\t\t\t\toriginAddressCreate?.id\n\t\t\t\t\t\t\t? originAddressCreate.id === a.id\n\t\t\t\t\t\t\t: originAddressCreate.address === a.address ||\n\t\t\t\t\t\t\t originAddressCreate.business_name === a.alias\n\t\t\t\t\t) ?? originAddressCreate) as NewAddress;\n\t\t\t\t\tdispatch(setAddressCreate(originAddressCreate, 'origin', defaultValue?.contacts ?? []));\n\t\t\t\t\tsetAddr(defaultValue);\n\t\t\t\t} else {\n\t\t\t\t\tsetAddr(null);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\tcurrentFlow,\n\t\tprops.for,\n\t\tdestinationAddressSend,\n\t\toriginAddressSend,\n\t\taddresses,\n\t\tdestinationAddressRate,\n\t\toriginAddressRate,\n\t\taddressPickUp,\n\t\tprops.reset,\n\t\tprops.isPickingUpFromDelivery,\n\t\toriginAddressCreate,\n\t\tdestinationAddressCreate\n\t]);\n\n\t// Load default value for picking up from summary sending\n\tuseEffect(() => {\n\t\tif (currentFlow === 'send' && originAddressSend && props.isPickingUpFromDelivery) {\n\t\t\tconst address = addresses.find((a) => a.id === originAddressSend.id);\n\t\t\tsetAddr(address as NewAddress);\n\t\t\taddress &&\n\t\t\t\tdispatch(\n\t\t\t\t\tsetAddressPickUp(\n\t\t\t\t\t\t{ ...address, contact: originAddressSend?.contact } as AddressRequest,\n\t\t\t\t\t\toriginAddressSend?.contacts || []\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}\n\t}, [currentFlow, originAddressSend, props.isPickingUpFromDelivery, addresses, dispatch]);\n\n\treturn (\n\t\t (\n\t\t\t\t\n\t\t\t\t\t{paperProps.children}\n\t\t\t\t\n\t\t\t)}\n\t\t\tonInputChange={(event) => {\n\t\t\t\tif (event && event.type === 'change') {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tsetQuery(event.nativeEvent.target?.value);\n\t\t\t\t}\n\t\t\t}}\n\t\t\tfilterOptions={(options, params) => {\n\t\t\t\tconst filtered = filterOptionsAddress(options, params);\n\t\t\t\tif (props.isRating || props.isPickingUp) {\n\t\t\t\t\treturn filtered;\n\t\t\t\t}\n\t\t\t\tif (params.inputValue !== '' && filtered.length === 0) {\n\t\t\t\t\tshowAddBtn = false; //hide the btn and suggest a new option\n\t\t\t\t\tfiltered.push({\n\t\t\t\t\t\talias: 'Agregar Dirección',\n\t\t\t\t\t\tzip_code: params.inputValue,\n\t\t\t\t\t\taddress: '',\n\t\t\t\t\t\tbusiness_name: '',\n\t\t\t\t\t\tcity: '',\n\t\t\t\t\t\tcontacts: [],\n\t\t\t\t\t\tid: idForNewAddresses,\n\t\t\t\t\t\tneighborhood: '',\n\t\t\t\t\t\tscope: 'Personal',\n\t\t\t\t\t\tstate: '',\n\t\t\t\t\t\tcoordinates: '',\n\t\t\t\t\t\tcountry: '',\n\t\t\t\t\t\tnumber: '',\n\t\t\t\t\t\tstreet: '',\n\t\t\t\t\t\treference: '',\n\t\t\t\t\t\treference_streets: '',\n\t\t\t\t\t\ttax_id: ''\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tshowAddBtn = true;\n\t\t\t\t}\n\n\t\t\t\treturn filtered;\n\t\t\t}}\n\t\t\t// when defaults, custom equals | value.id === idForNewAddresses for new address\n\t\t\tgetOptionSelected={(option, value) => {\n\t\t\t\treturn option?.id === value?.id || value?.id === idForNewAddresses;\n\t\t\t}}\n\t\t\t// filter address options for pickup in summary sending\n\t\t\toptions={\n\t\t\t\tprops.isPickingUpFromDelivery\n\t\t\t\t\t? addresses.filter((item) => item.state === originAddressSend?.state)\n\t\t\t\t\t: props.isPickingUp\n\t\t\t\t\t? props.isPickingUp && labelsPickup.length > 0\n\t\t\t\t\t\t? addresses.filter((item) => item.state === labelsPickup[0].origin.state)\n\t\t\t\t\t\t: addresses\n\t\t\t\t\t: addresses\n\t\t\t}\n\t\t\tgroupBy={(option) => option.scope}\n\t\t\t// The options that are shown\n\t\t\tgetOptionLabel={(option) =>\n\t\t\t\t`${option.alias?.toUpperCase() || option.address || option.business_name || ''} - ${\n\t\t\t\t\toption.zip_code\n\t\t\t\t}`\n\t\t\t}\n\t\t\tdisabled={props.disabled}\n\t\t\trenderInput={(params) => {\n\t\t\t\treturn (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t{!props.isPickingUpFromDelivery && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\t\tprops.saveCurrentFields && props.saveCurrentFields();\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst target =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tprops.for === 'addressDestination' ? 'destination' : 'origin';\n\t\t\t\t\t\t\t\t\t\t\t\t\tlet url =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcurrentFlow === 'create' &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsimpleAddr?.address_type === 'address_label_manual'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? `/direccion-simple/${addr!.id}?target=${target}`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: `/direccion/${addr!.id}?target=${target}`;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (id) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\turl = url.concat(`&labelId=${id}`);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (pms.query) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\turl = url.concat(`&query=${pms.query}`);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\thistory.push(url);\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)}\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t}}\n\t\t\tnoOptionsText='No se encontraron direcciones'\n\t\t\tvalue={addr}\n\t\t\tonChange={(_, value) => {\n\t\t\t\tif (typeof value !== 'string') {\n\t\t\t\t\tif (value?.id === idForNewAddresses) {\n\t\t\t\t\t\t// To automatically add the new address for origin or destination\n\t\t\t\t\t\t//dispatch(addAddressInFlow(props.for === 'addressDestination' ? 'destination' : 'origin'));\n\t\t\t\t\t\tprops.saveCurrentFields && props.saveCurrentFields();\n\t\t\t\t\t\tconst target = props.for === 'addressDestination' ? 'destination' : 'origin';\n\t\t\t\t\t\tlet url = props.isCreating\n\t\t\t\t\t\t\t? `/direccion-simple?target=${target}`\n\t\t\t\t\t\t\t: `/direccion?target=${target}`;\n\t\t\t\t\t\tif (id) {\n\t\t\t\t\t\t\turl = url.concat(`&labelId=${id}`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\thistory.push(url);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetAddr(value);\n\t\t\t\t\t\tlet addr: AddressRequest | null = null;\n\t\t\t\t\t\tif (value) {\n\t\t\t\t\t\t\taddr = {\n\t\t\t\t\t\t\t\tid: value.id,\n\t\t\t\t\t\t\t\tcoordinates: value.coordinates,\n\t\t\t\t\t\t\t\talias: value.alias,\n\t\t\t\t\t\t\t\tstreet: value.street,\n\t\t\t\t\t\t\t\tcity: value.city,\n\t\t\t\t\t\t\t\tbusiness_name: value.business_name,\n\t\t\t\t\t\t\t\tneighborhood: value.neighborhood,\n\t\t\t\t\t\t\t\tstate: value.state,\n\t\t\t\t\t\t\t\tzip_code: value.zip_code,\n\t\t\t\t\t\t\t\tcountry: value.country,\n\t\t\t\t\t\t\t\tnumber: value.number as string,\n\t\t\t\t\t\t\t\treference: value.reference as string,\n\t\t\t\t\t\t\t\treference_streets: value.reference_streets as string,\n\t\t\t\t\t\t\t\tsuite_number: value.suite_number as string,\n\t\t\t\t\t\t\t\tcontact: null,\n\t\t\t\t\t\t\t\ttax_id: value.tax_id\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (props.isPickingUp) {\n\t\t\t\t\t\t\tdispatch(setAddressPickUp(addr, value?.contacts || []));\n\t\t\t\t\t\t} else if (currentFlow === 'cucustomer') {\n\t\t\t\t\t\t\t// TODO fix the type\n\t\t\t\t\t\t\t// dispatch(setAddressInfoDraftCUCustomer(addr as any));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (props.for === 'addressDestination') {\n\t\t\t\t\t\t\t\tif (props.isRating) {\n\t\t\t\t\t\t\t\t\tdispatch(setAddressRate(addr, 'destination'));\n\t\t\t\t\t\t\t\t} else if (props.isCreating) {\n\t\t\t\t\t\t\t\t\tdispatch(setAddressCreate(addr, 'destination', value?.contacts || []));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdispatch(setAddressSend(addr, 'destination', value?.contacts || []));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (props.for === 'addressOrigin') {\n\t\t\t\t\t\t\t\tif (props.isRating) {\n\t\t\t\t\t\t\t\t\tdispatch(setAddressRate(addr, 'origin'));\n\t\t\t\t\t\t\t\t} else if (props.isCreating) {\n\t\t\t\t\t\t\t\t\tdispatch(setAddressCreate(addr, 'origin', value?.contacts || []));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdispatch(setAddressSend(addr, 'origin', value?.contacts || []));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}}\n\t\t/>\n\t);\n};\n\nexport default InputSearchAddress;\n","import { useMemo, useState, useCallback, useEffect, useContext } from 'react';\nimport { NewAddress, Address, AddressRequest } from '../store/actions/ActionTypes';\nimport { AddressesPagination } from '../util/pagination';\nimport axios from '~util/axios';\nimport { useSelector, RootStore } from '~store/store';\nimport DrawContext from '~context/DrawContext';\nimport usePermissions from './usePermissions';\n\nexport type SortBy = 'created_at';\nexport type SortOrder = 'desc';\n\ntype AddressParams = {\n\tpage: number;\n\tlimit: number;\n\n\tsort_by: SortBy;\n\tsort_order: SortOrder;\n\tuser_id?: number;\n\tquery?: string;\n};\n\ntype Data = {\n\trows: Array
;\n\ttotal: number;\n\tloading: boolean;\n\tparams: AddressParams;\n};\n\ntype Props = {\n\tisRootOrAgent: boolean;\n};\n\nexport default function useInputSearchAddreses({ isRootOrAgent }: Props) {\n\tconst [data, setData] = useState({\n\t\trows: [],\n\t\ttotal: 0,\n\t\tloading: true,\n\t\tparams: {\n\t\t\tpage: 0,\n\t\t\tlimit: 20,\n\n\t\t\tsort_order: 'desc',\n\t\t\tsort_by: 'created_at',\n\t\t\tuser_id: undefined,\n\t\t\tquery: undefined\n\t\t}\n\t});\n\tconst [simpleData, setSimpleData] = useState();\n\n\tconst { currentFlow } = useSelector((state: RootStore) => state.flow);\n\n\tconst { setNotification } = useContext(DrawContext);\n\tconst { can } = usePermissions();\n\tconst canHaveActions = can('canRead.addresses');\n\n\tconst updateData = useCallback(\n\t\t(key: T, value: Data[T]) =>\n\t\t\tsetData((prevState) => ({\n\t\t\t\t...prevState,\n\t\t\t\t[key]: value\n\t\t\t})),\n\t\t[setData]\n\t);\n\n\tconst updateParam = useCallback(\n\t\t(key: T, value: AddressParams[T]) =>\n\t\t\tsetData((prevState) => ({\n\t\t\t\t...prevState,\n\t\t\t\tparams: {\n\t\t\t\t\t...prevState.params,\n\t\t\t\t\t[key]: value\n\t\t\t\t}\n\t\t\t})),\n\t\t[setData]\n\t);\n\n\tconst fetch = useCallback(async () => {\n\t\tlet isMounted = true;\n\t\tupdateData('loading', true);\n\n\t\tif (isRootOrAgent && data.params.user_id === undefined) {\n\t\t\tupdateData('loading', false);\n\t\t\treturn;\n\t\t}\n\n\t\tif (data.params.query) {\n\t\t\tdata.params.limit = 1_000;\n\t\t}\n\n\t\tconst params = JSON.parse(JSON.stringify(data.params));\n\t\tconst asURLSearchParams = new URLSearchParams(params);\n\t\tasURLSearchParams.set('page', params.page + 1);\n\t\tconst paramsAsString = asURLSearchParams.toString();\n\n\t\tif (currentFlow === 'create') {\n\t\t\tconst addresses: SimpleAddress[] = [];\n\t\t\ttry {\n\t\t\t\tconst response = await axios.get(\n\t\t\t\t\t`/api/addresses?${paramsAsString}&origin_request=label_manual`\n\t\t\t\t);\n\t\t\t\tconst data = response.data;\n\t\t\t\tif (isMounted) {\n\t\t\t\t\tdata.data.map((addr: { address: SimpleAddress }) => {\n\t\t\t\t\t\treturn addresses.push(addr.address);\n\t\t\t\t\t});\n\t\t\t\t\tsetSimpleData(addresses);\n\t\t\t\t\tsetData((prevState) => ({\n\t\t\t\t\t\t...prevState,\n\t\t\t\t\t\tloading: false,\n\t\t\t\t\t\trows: data.data.map((a: SimpleAddress) => AddressesPagination.Transformer(a)),\n\t\t\t\t\t\ttotal: data.total\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'Algo salió mal, por favor contacta al equipo de Encamino',\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (canHaveActions) {\n\t\t\ttry {\n\t\t\t\tconst response = await axios.get(`/api/addresses?${paramsAsString}`);\n\t\t\t\tconst data = response.data;\n\t\t\t\tsetData((prevState) => ({\n\t\t\t\t\t...prevState,\n\t\t\t\t\tloading: false,\n\t\t\t\t\trows: data.data.map((a: AddressRequest) => AddressesPagination.Transformer(a)),\n\t\t\t\t\ttotal: data.total\n\t\t\t\t}));\n\t\t\t} catch (error) {\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'Algo salió mal, por favor contacta al equipo de Encamino',\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn () => {\n\t\t\tisMounted = false;\n\t\t};\n\t}, [updateData, isRootOrAgent, data.params, currentFlow, setNotification, canHaveActions]);\n\n\tconst temporalAddresses = useSelector((state) => state.data.addresses);\n\n\tconst sortedData = useMemo(() => {\n\t\tlet sortData = [...temporalAddresses, ...(data.rows || [])];\n\n\t\tsortData.sort((a: NewAddress, b: NewAddress) => {\n\t\t\tif (!a.scope) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tif (!b.scope) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tconst scopeA = a.scope.toLowerCase(),\n\t\t\t\tscopeB = b.scope.toLowerCase();\n\n\t\t\t// ascending\n\t\t\tif (scopeA < scopeB) return -1;\n\t\t\tif (scopeA > scopeB) return 1;\n\t\t\t// no sorting\n\t\t\treturn 0;\n\t\t});\n\t\treturn sortData;\n\t}, [temporalAddresses, data.rows]);\n\n\tuseEffect(() => {\n\t\tfetch();\n\t}, [fetch]);\n\n\treturn {\n\t\tdata: sortedData,\n\t\tloading: data.loading,\n\t\tupdateParam,\n\t\tfetch,\n\t\tparams: data.params,\n\t\tupdateParams: setData,\n\t\tsimpleData\n\t};\n}\n","import usePagination from './usePagination';\nimport { ShipmentSendResponse } from '~store/actions/ActionTypes';\nimport { LabelsPagination } from '~util/pagination';\n\nexport default function useLabels(queryParams?: string[]) {\n\tconst { data, total, page, loading, onPageChange, initialFetch } =\n\t\tusePagination({\n\t\t\turl: LabelsPagination.URL,\n\t\t\tlimit: LabelsPagination.Table,\n\t\t\tparam: 'page',\n\t\t\tqueryParams\n\t\t});\n\n\treturn {\n\t\tdata: data,\n\t\ttotal: total,\n\t\tloading: loading,\n\t\tonPageChange: onPageChange,\n\t\tpage: page,\n\t\tpageSize: LabelsPagination.Table,\n\t\tinitialFetch\n\t};\n}\n","import { useState, useEffect, useCallback, useContext } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { useHistory } from 'react-router';\nimport axiosInstance, { instanceRate } from '~util/axios';\nimport axios from 'axios';\nimport { initFlow, resetFlow } from '~store/actions';\nimport { enterpriseOperationsOptions } from '~components/Inputs/EnterpriseOperations';\nimport { CARRIERS, getCarrierName } from '~util/logos';\nimport usePermissions from '~hooks/usePermissions';\nimport { useParams } from 'react-router';\nimport DrawContext from '../../../context/DrawContext';\nimport {\n\tBookletServiceForm,\n\tCustomerDispersionType,\n\tCustomerResponse,\n\tReportFileType,\n\tReportItem,\n\tReportName,\n\tSellerResponse\n} from '~store/actions/ActionTypes';\nimport { setServicesCUCustomer, setSimulatedCustomer } from '~store/actions/agents';\nimport { AxiosResponse } from 'axios';\nimport { channelOptions } from '~components/Inputs/ChannelInput';\nimport useQuery from '~hooks/useQuery';\nimport { useSelector } from '~store/store';\nimport { shallow } from 'zustand/shallow';\nimport { getRateCurrentYear } from '~util/rateYear';\n\nexport type ServiceDataItem = {\n\tid: number;\n\tenabled: boolean;\n\tdiscount: number;\n\tmin_stock: number;\n\tprice_list: number;\n\tirregular_delivery_price?: number;\n\treissue_price?: number;\n\tinsurance_percentage?: number;\n};\n\nexport type CustomerFormValues = {\n\t// General Info\n\tname: string;\n\tlast_name: string;\n\temail: string;\n\tphone_number: string;\n\tbusiness_name: string;\n\tcompany_type: { title: string; value: string };\n\tenterprise_operations: { title: string; value: string };\n\tchannel: { title: string; value: string };\n\twebpage: string;\n\tvalidation_status: string;\n\t// Address\n\tcity: string;\n\texternal_number: string;\n\tinternal_number: string;\n\tneighborhood: string;\n\tstate: string;\n\tstreet: string;\n\tzip_code: string;\n\n\t// Fiscal Info\n\tmodality: string;\n\tconditions: string;\n\tbilling: string;\n\treview_reports: string;\n\tdispersion_type: string;\n\n\t// Report\n\treports: [];\n\n\tguides_schema: { title: string } | string;\n\tguides_subtype: string;\n\tguides_date: string;\n\tguides_conditions_report: { title: string } | string;\n\tguides_pre_invoice_days: { title: string } | string;\n\n\t// overweight_schema: string;\n\toverweight_subtype: string;\n\toverweight_date: string;\n\toverweight_conditions_report: { title: string } | string;\n\toverweight_pre_invoice_days: { title: string } | string;\n\toverweight_name: { title: string; value: ReportName };\n\n\t// insurance_schema: string;\n\tinsurance_subtype: string;\n\tinsurance_date: string;\n\tinsurance_conditions_report: { title: string } | string;\n\tinsurance_pre_invoice_days: { title: string } | string;\n\n\treport_file_type?: string;\n\n\tseller: SellerResponse;\n\n\tadd_services_to_users?: boolean;\n\tbusiness_type: string;\n};\n\nexport const DISPERSION_TYPE_REF = [\n\t{ label: 'Global', value: CustomerDispersionType.GLOBAL },\n\t{ label: 'Restrictivo', value: CustomerDispersionType.RESTRICTED }\n];\n\nconst useCustomerForm = (fromDispersion?: boolean) => {\n\tconst dispatch = useDispatch();\n\tconst { id } = useParams<{ id?: string }>();\n\tconst history = useHistory();\n\tconst [editing, setEditing] = useState(true);\n\tconst [loading, setLoading] = useState(true);\n\tconst [posting, setPosting] = useState(false);\n\tconst [customer, setCustomer] = useState();\n\tconst [responseError, setResponseError] = useState(null);\n\n\tconst { isCustomer, isRoot } = usePermissions();\n\tconst query = useQuery();\n\n\tconst { setNotification, setRCardStatus } = useContext(DrawContext);\n\tconst { servicesInfoDraftCUCustomer } = useSelector((state) => state.cuCustomer, shallow);\n\tconst { simulatedCustomer } = useSelector((state) => state.simulatedUser);\n\n\t// Hide the card\n\tuseEffect(() => {\n\t\tsetRCardStatus('HIDDEN');\n\t}, [setRCardStatus]);\n\n\tconst fetchCustomer = useCallback(async () => {\n\t\tif (id) {\n\t\t\tsetEditing(true);\n\t\t\ttry {\n\t\t\t\tconst { data } = await axiosInstance.get(`/api/customer/${id}`);\n\t\t\t\tconst customer = data.contact as any;\n\t\t\t\t// data.company_type = enterpriseTypeOptions.find((et) => et.value === data.company_type);\n\t\t\t\tdata.enterprise_operations = enterpriseOperationsOptions.find(\n\t\t\t\t\t(eo) => eo.value === data.set_of_operations\n\t\t\t\t);\n\t\t\t\tdata.name = customer.name;\n\t\t\t\tdata.last_name = customer.last_name;\n\t\t\t\tdata.email = customer.email;\n\t\t\t\t// data.operation_description = data.description_of_operation;\n\t\t\t\tdata.channel = channelOptions.find((channel) => channel.value === data.channel);\n\n\t\t\t\tdata.dispersion_type = DISPERSION_TYPE_REF.find(\n\t\t\t\t\t(item) => item.value === data?.dispersion_type\n\t\t\t\t)?.label;\n\t\t\t\tsetCustomer(data as CustomerResponse);\n\n\t\t\t\tdispatch(\n\t\t\t\t\tsetServicesCUCustomer(\n\t\t\t\t\t\tdata.services.map((s: any) => ({ ...s, carrier: getCarrierName(s.carrier) }))\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error('Error while fetching customer', err);\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'No se puedo obtener la información, asegurese que exista o tenga los permisos',\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t\thistory.goBack();\n\t\t\t}\n\t\t} else {\n\t\t\tsetEditing(false);\n\t\t\tdispatch(setServicesCUCustomer([]));\n\t\t}\n\t\tdispatch(initFlow('cucustomer'));\n\t\tsetLoading(false);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [id, history]);\n\n\t// Fetch when is editing\n\tuseEffect(() => {\n\t\tfetchCustomer();\n\t}, [fetchCustomer]);\n\n\tconst getNewServices = (onlyEstafeta?: boolean) => {\n\t\tconst previousServicesIds = customer?.services.map((item) => item.id.toString());\n\n\t\treturn servicesInfoDraftCUCustomer.filter(\n\t\t\t(item) =>\n\t\t\t\t!previousServicesIds?.includes(\n\t\t\t\t\ttypeof item.id === 'number' ? item.id.toString() : item.id\n\t\t\t\t) && (onlyEstafeta ? item.carrier?.toLowerCase() === CARRIERS.ESTAFETA : true)\n\t\t);\n\t};\n\n\tconst saveRates = useCallback(\n\t\tasync (customerId: string) => {\n\t\t\tconst estafetaNewServices = getNewServices(true);\n\t\t\tconst toSavedService: BookletServiceForm[] = estafetaNewServices?.filter(\n\t\t\t\t(item) => !item.name.includes('2 Dias')\n\t\t\t);\n\t\t\testafetaNewServices?.forEach(\n\t\t\t\t(service) =>\n\t\t\t\t\t!toSavedService?.find((item) => item.rates_service_description === service.rates_service_description) &&\n\t\t\t\t\ttoSavedService.push(service)\n\t\t\t);\n\n\t\t\tawait Promise.all(\n\t\t\t\ttoSavedService?.map(async (service: any) => {\n\t\t\t\t\tconst year = getRateCurrentYear();\n\t\t\t\t\tconst payload: any = {\n\t\t\t\t\t\tcustomer_id: parseInt(customerId),\n\t\t\t\t\t\tyear,\n\t\t\t\t\t\tproposal_id: service?.proposal_id,\n\t\t\t\t\t\tvolume: service?.volume\n\t\t\t\t\t};\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait instanceRate.post('/rates', payload);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[servicesInfoDraftCUCustomer]\n\t);\n\n\tconst save = useCallback(\n\t\tasync (form: any) => {\n\t\t\tform.reports = form.reports?.map((r: { schema: string; [key: string]: number | string }) => ({\n\t\t\t\t...r,\n\t\t\t\tschema: r.schema?.toLowerCase()\n\t\t\t}));\n\n\t\t\tlet success = true;\n\t\t\tlet customerId;\n\n\t\t\tsetPosting(true);\n\t\t\tlet response: Promise>;\n\t\t\t// Then we want to update\n\t\t\tif (id) {\n\t\t\t\tresponse = axiosInstance.put(`/api/customer/${id}`, form);\n\t\t\t} else {\n\t\t\t\tresponse = axiosInstance.post('/api/customer', form);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst { data } = await response;\n\t\t\t\tcustomerId = id ?? data?.id;\n\n\t\t\t\tif (isCustomer) {\n\t\t\t\t\tsetPosting(false);\n\t\t\t\t\tsetNotification({\n\t\t\t\t\t\tmessage: 'Se actulizó la información correctamente',\n\t\t\t\t\t\tseverity: 'success'\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tsetNotification({\n\t\t\t\t\t\tmessage: id\n\t\t\t\t\t\t\t? 'Se guardaron los cambios correctamente'\n\t\t\t\t\t\t\t: 'Se creó el cliente correctamente',\n\t\t\t\t\t\tseverity: 'success'\n\t\t\t\t\t});\n\n\t\t\t\t\tif (simulatedCustomer?.id === data?.id) {\n\t\t\t\t\t\tdispatch(setSimulatedCustomer(data));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Save customer and return to customer table\n\t\t\t\t\tdispatch(resetFlow());\n\t\t\t\t\tdispatch(setServicesCUCustomer([]));\n\t\t\t\t\thistory.push('/clientes');\n\t\t\t\t}\n\t\t\t} catch (err: any) {\n\t\t\t\tlet message = 'Hubo un error crear al cliente';\n\t\t\t\tif (axios.isAxiosError(err)) {\n\t\t\t\t\tif (err?.response?.data?.description) {\n\t\t\t\t\t\tif (err.response?.data.description.includes('User')) {\n\t\t\t\t\t\t\tmessage = 'Ya existe un usuario con el correo especificado';\n\t\t\t\t\t\t\tsetResponseError('USER_ALREADY_EXISTS');\n\t\t\t\t\t\t} else if (err.response?.data.description.includes('Customer')) {\n\t\t\t\t\t\t\tmessage = 'Ya existe un cliente con el nombre de empresa especificado';\n\t\t\t\t\t\t\tsetResponseError('CUSTOMER_ALREADY_EXISTS');\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\terr.response?.data.description.some((item: { [key: string]: string }) =>\n\t\t\t\t\t\t\t\tObject.keys(item).some((item) => item.includes('report'))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst messages = err.response?.data.description\n\t\t\t\t\t\t\t\t.map((item: { [key: string]: string }) => Object.values(item))\n\t\t\t\t\t\t\t\t.flat();\n\t\t\t\t\t\t\tmessage = messages?.includes('Must be separate file when schema is different')\n\t\t\t\t\t\t\t\t? 'Debe ser un archivo separado cuando el esquema es diferente'\n\t\t\t\t\t\t\t\t: 'Hay un error en los valores de reportes';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsuccess = false;\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: message,\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t\tsetPosting(false);\n\t\t\t}\n\n\t\t\treturn { success, customerId };\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[\n\t\t\tid,\n\t\t\tdispatch,\n\t\t\tisCustomer,\n\t\t\tsetNotification,\n\t\t\thistory,\n\t\t\tcustomer,\n\t\t\tservicesInfoDraftCUCustomer,\n\t\t\tquery,\n\t\t\tfromDispersion,\n\t\t\tsimulatedCustomer?.id\n\t\t]\n\t);\n\n\tconst getPayloadServices = useCallback(() => {\n\t\treturn servicesInfoDraftCUCustomer.map((s) => {\n\t\t\tconst payloadServices = {\n\t\t\t\tid: s.id,\n\t\t\t\tenabled: s.enabled,\n\t\t\t\tmin_stock: s.min_stock,\n\t\t\t\tprice_list: s.price_list,\n\t\t\t\tdiscount: s.discount\n\t\t\t} as ServiceDataItem;\n\t\t\tif (!!s.reissue_price) {\n\t\t\t\tpayloadServices.reissue_price = s.reissue_price;\n\t\t\t}\n\t\t\tif (!!s.irregular_delivery_price) {\n\t\t\t\tpayloadServices.irregular_delivery_price = s.irregular_delivery_price;\n\t\t\t}\n\t\t\tif (!!s.insurance_percentage) {\n\t\t\t\tpayloadServices.insurance_percentage = s.insurance_percentage;\n\t\t\t}\n\t\t\treturn payloadServices;\n\t\t});\n\t}, [servicesInfoDraftCUCustomer]);\n\n\tconst formatPayload = useCallback(\n\t\t({\n\t\t\tdata,\n\t\t\tguidesRowOfReport,\n\t\t\toverweightRowOdReport,\n\t\t\tinsuranceRowOfReport,\n\t\t\tstatus\n\t\t}: {\n\t\t\tdata: CustomerFormValues;\n\t\t\tguidesRowOfReport?: ReportItem;\n\t\t\toverweightRowOdReport?: ReportItem;\n\t\t\tinsuranceRowOfReport?: ReportItem;\n\t\t\tstatus?: string;\n\t\t}) => {\n\t\t\tconst payload: { [key: string]: any } = {\n\t\t\t\t// General Info\n\t\t\t\tname: data.name.trim(),\n\t\t\t\tlast_name: data.last_name.trim(),\n\t\t\t\temail: data.email.trim(),\n\t\t\t\tphone_number: data.phone_number.trim(),\n\t\t\t\tbusiness_name: data.business_name.toUpperCase().trim(),\n\t\t\t\tcompany_type: data.company_type?.value,\n\t\t\t\tset_of_operations: data.enterprise_operations.value,\n\t\t\t\twebpage: data.webpage || undefined,\n\t\t\t\tvalidation_status: data?.validation_status?.toLowerCase(),\n\t\t\t\tbusiness_type: data?.business_type\n\t\t\t};\n\n\t\t\t//Status\n\t\t\tif (status) {\n\t\t\t\tpayload.status = status;\n\t\t\t}\n\n\t\t\tif (data.zip_code && data.neighborhood && data.city && data.state && data.street) {\n\t\t\t\t// Address\n\t\t\t\tpayload.business_address = {\n\t\t\t\t\tzip_code: data.zip_code,\n\t\t\t\t\tneighborhood: data.neighborhood,\n\t\t\t\t\tcity: data.city,\n\t\t\t\t\tstate: data.state,\n\t\t\t\t\tstreet: data.street,\n\t\t\t\t\tnumber: data.external_number,\n\t\t\t\t\tsuite_number: data.internal_number,\n\t\t\t\t\tcountry: 'México'\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (data.channel) {\n\t\t\t\tpayload.channel = data.channel.value;\n\t\t\t}\n\n\t\t\tif (data.modality) {\n\t\t\t\tpayload.modality = data.modality.toLowerCase();\n\t\t\t}\n\n\t\t\tif (data.conditions) {\n\t\t\t\tpayload.conditions = data.conditions;\n\t\t\t}\n\n\t\t\tif (data.billing) {\n\t\t\t\tpayload.billing = data.billing.toLowerCase();\n\t\t\t}\n\n\t\t\t// if (data.review_reports) {\n\t\t\t// \tpayload.review_reports = data.review_reports;\n\t\t\t// }\n\n\t\t\tpayload.required_fiscal_information = false;\n\n\t\t\t// Type of dispersion: global or restrictive\n\t\t\tpayload.dispersion_type = DISPERSION_TYPE_REF.find(\n\t\t\t\t(item) => item.label === data?.dispersion_type\n\t\t\t)?.value;\n\n\t\t\t// Same file config: same values\n\t\t\tconst hasSameFileSet = data.report_file_type === ReportFileType.SAME_FILE;\n\t\t\t//Reports formatted data\n\t\t\tpayload.reports = [\n\t\t\t\t{ ...guidesRowOfReport, report_file_type: data.report_file_type },\n\t\t\t\t{\n\t\t\t\t\t...overweightRowOdReport,\n\t\t\t\t\treport_file_type: data.report_file_type,\n\t\t\t\t\tpre_invoice_days: !hasSameFileSet\n\t\t\t\t\t\t? overweightRowOdReport?.pre_invoice_days\n\t\t\t\t\t\t: guidesRowOfReport?.pre_invoice_days,\n\t\t\t\t\tconditions: !hasSameFileSet\n\t\t\t\t\t\t? overweightRowOdReport?.conditions\n\t\t\t\t\t\t: guidesRowOfReport?.conditions\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...insuranceRowOfReport,\n\t\t\t\t\treport_file_type: data.report_file_type,\n\t\t\t\t\tpre_invoice_days: !hasSameFileSet\n\t\t\t\t\t\t? insuranceRowOfReport?.pre_invoice_days\n\t\t\t\t\t\t: guidesRowOfReport?.pre_invoice_days,\n\t\t\t\t\tconditions: !hasSameFileSet\n\t\t\t\t\t\t? insuranceRowOfReport?.conditions\n\t\t\t\t\t\t: guidesRowOfReport?.conditions\n\t\t\t\t}\n\t\t\t];\n\n\t\t\tpayload.report_file_type = data.report_file_type;\n\n\t\t\tif (\n\t\t\t\t!payload.reports?.every(\n\t\t\t\t\t(item: any) => item.schema && item.pre_invoice_days && item.conditions\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tdelete payload.reports;\n\t\t\t}\n\n\t\t\tpayload.services = getPayloadServices();\n\n\t\t\tif (isRoot) {\n\t\t\t\tpayload.seller_id = data.seller?.id;\n\t\t\t}\n\n\t\t\treturn payload;\n\t\t},\n\t\t[getPayloadServices, isRoot]\n\t);\n\n\treturn {\n\t\tsave,\n\t\tediting,\n\t\tcustomer,\n\t\tposting,\n\t\tresponseError,\n\t\tloading,\n\t\tgetPayloadServices,\n\t\tformatPayload,\n\t\tsaveRates,\n\t\tgetNewServices\n\t};\n};\n\nexport default useCustomerForm;\n","import { IconButton, Tooltip } from '@mui/material/';\nimport { Search } from 'react-feather';\n\nconst GoToDetailIconButton = ({ onClick, title }: { onClick: () => void; title?: string }) => {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default GoToDetailIconButton;\n","const loadGMaps = (callback: () => void) => {\n\tconst existingScript = document.getElementById('googleMaps');\n\tif (!existingScript) {\n\t\tconst script = document.createElement('script');\n\t\tscript.src = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyA9mQ-ghQDAssm31Tonf5dCG0ln0SNXyu0&libraries=places';\n\t\tscript.id = 'googleMaps';\n\t\tdocument.body.appendChild(script);\n\t\tscript.onload = () => {\n\t\t\tif (callback) callback();\n\t\t};\n\t}\n\t// if (existingScript && callback) callback();\n};\nexport default loadGMaps;\n","import { Fragment, FC, ReactNode, useMemo } from 'react';\nimport { Grid } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { radiusCard } from '~hooks/useStyles';\nimport {\n\tTimeline,\n\tTimelineConnector,\n\tTimelineContent,\n\tTimelineDot,\n\tTimelineItem,\n\tTimelineSeparator\n} from '@material-ui/lab';\nimport { FollowUpLabelStatus } from '~util/cellStatusColor';\nimport { EventType } from '~store/actions/ActionTypes';\nimport moment from 'moment';\nimport 'moment/locale/es';\nimport { CARRIERS } from '~util/logos';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\ttrakingContainer: {\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tborderRadius: radiusCard,\n\t\t'& li::before': {\n\t\t\tdisplay: 'none'\n\t\t},\n\t\t[theme.breakpoints.down(943)]: {\n\t\t\t'& > div': {\n\t\t\t\twindth: '100%',\n\t\t\t\t'& div': {\n\t\t\t\t\twindth: '100%',\n\t\t\t\t\tmaxWidth: 'unset'\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}));\ninterface Props {\n\tservice: string;\n\tcarrier: string;\n\tfollowUp: string;\n\n\t// At this moment this works only for zubut\n\tevents?: EventType[];\n}\n\nconst EventItem = ({\n\tevents,\n\tchildren,\n\tindex,\n\tlistKey\n}: {\n\tevents: EventType[];\n\tchildren: ReactNode;\n\tindex: number;\n\tlistKey: string;\n}) => {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t{index === 0 ? (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t) : (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t{index !== events.length - 1 && }\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\n\t\t\t{children}\n\t\t\n\t);\n};\n\nconst TrackingContainer: FC = ({ carrier, service, followUp, events }) => {\n\tconst eventList = useMemo(\n\t\t() => (carrier === CARRIERS.FEDEX ? events : events?.reverse()),\n\t\t[carrier, events]\n\t);\n\tconst classes = useStyles();\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{carrier === CARRIERS.REDPACK && eventList ? (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{eventList.reverse()?.map((e, index) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{e.description || ''}\n\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\t{moment(e.createdAt).format('DD-MM-YYYY hh:mm:ss')}\n\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t
\n\t\t\t\t\t) : null}\n\n\t\t\t\t\t{carrier === CARRIERS.PAQUETEXPRESS && eventList ? (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{eventList?.map((e, index) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{e.description}\n\t\t\t\t\t\t\t\t\t\t

{e.createdAt}

\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t
\n\t\t\t\t\t) : null}\n\n\t\t\t\t\t{carrier === CARRIERS.FEDEX && eventList ? (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{eventList?.map((e, index) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{e.description || ''}\n\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\t{moment(e.createdAt).format('DD-MM-YYYY HH:mm:ss')}\n\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t
\n\t\t\t\t\t) : null}\n\n\t\t\t\t\t{carrier === CARRIERS.DHL && eventList ? (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{eventList?.map((e, index) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{e.description || ''}\n\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\t{moment(e.createdAt, 'YYYY-MM-DD HH:mm:ss').format('DD-MM-YYYY HH:mm:ss')}\n\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t
\n\t\t\t\t\t) : null}\n\n\t\t\t\t\t{carrier === CARRIERS.ESTAFETA && eventList ? (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{eventList?.map((e, index) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t{e.event || ''}\n\t\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\t\t{moment(e.createdAt, 'YYYY-MM-DD HH:mm:ss').format('DD-MM-YYYY HH:mm:ss')}\n\t\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t
\n\t\t\t\t\t) : null}\n\n\t\t\t\t\t{carrier === CARRIERS.SENDEX && eventList ? (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{eventList?.map((e, index) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t{e.description || ''}\n\t\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\t\t{moment(e.createdAt, 'YYYY-MM-DD HH:mm:ss').format('DD-MM-YYYY HH:mm:ss')}\n\t\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t
\n\t\t\t\t\t) : null}\n\n\t\t\t\t\t{![\n\t\t\t\t\t\tCARRIERS.REDPACK,\n\t\t\t\t\t\tCARRIERS.DHL,\n\t\t\t\t\t\tCARRIERS.ESTAFETA,\n\t\t\t\t\t\tCARRIERS.FEDEX,\n\t\t\t\t\t\tCARRIERS.PAQUETEXPRESS,\n\t\t\t\t\t\tCARRIERS.SENDEX\n\t\t\t\t\t].includes(carrier as CARRIERS) && eventList ? (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tRegistrado\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tEn tránsito\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tEntregado\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t) : null}\n\t\t\t\t
\n\t\t\t
\n\t\t\t{/* \n\t\t\t\t\n\t\t\t */}\n\t\t\t{!events && (\n\t\t\t\t

\n\t\t\t\t\tAún no hay eventos registrados\n\t\t\t\t

\n\t\t\t)}\n\t\t
\n\t);\n};\n\nexport default TrackingContainer;\n","import { makeStyles } from '@mui/styles';\nimport { radiusCard } from '~hooks/useStyles';\nimport { maxWidthContainer } from '~hooks/useStyles';\nconst useStyles = makeStyles((theme) => ({\n\troot: {\n\t\twidth: maxWidthContainer,\n\t\tpadding: theme.spacing(3)\n\t},\n\tcontainer: {\n\t\tpadding: theme.spacing(3),\n\t\twidth: '100%',\n\t\tborderRadius: radiusCard\n\t},\n\tboxSpacing: {\n\t\tpadding: `${theme.spacing(1)} 0`\n\t},\n\ttitle: {\n\t\t// padding: `${theme.spacing(3)} 0 0 0 !important`,\n\t\tmarginLeft: '-24px'\n\t},\n\tleftArrow: {\n\t\tcolor: '#57BAD7',\n\t\tbackgroundColor: 'transparent',\n\t\tborder: 'none',\n\t\t'&:focus': {\n\t\t\toutline: 'none'\n\t\t},\n\t\t'&:hover': {\n\t\t\tcursor: 'pointer'\n\t\t}\n\t},\n\tsaveButton: {\n\t\tdisplay: 'flex',\n\t\talignItems: 'center',\n\t\tjustifyContent: 'center',\n\t\tcolor: 'black',\n\t\tbackgroundColor: 'white',\n\t\tborder: 'none',\n\t\tpadding: '10px',\n\t\twidth: '90%',\n\t\tborderRadius: '20px',\n\t\t'&:focus': {\n\t\t\toutline: 'none'\n\t\t},\n\t\t'&:hover': {\n\t\t\tcursor: 'pointer',\n\t\t\tbackgroundColor: 'rgba(200,200,200,.9)'\n\t\t}\n\t},\n\n\t// CustomerDocuments\n\tnameContainer: {\n\t\tpadding: `0 0 ${theme.spacing(3)} 0`\n\t}\n}));\n\nexport default useStyles;\n","import { useCallback, useState, useContext, useEffect } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport axiosInstance from '~util/axios';\nimport axios from 'axios';\nimport DrawContext from '~context/DrawContext';\nimport { useDispatch } from 'react-redux';\nimport { setServicesCUCustomer } from '~store/actions/agents';\nimport { getCarrierName } from '~util/logos';\nimport { ProspectResponseType, ProspectRequestType } from '~store/actions/ActionTypes';\n\nconst useProspects = () => {\n\tconst [prospects, setProspects] = useState(null);\n\tconst [prospect, setProspect] = useState(null);\n\tconst [loading, setLoading] = useState(false);\n\tconst { setNotification } = useContext(DrawContext);\n\tconst history = useHistory();\n\tconst dispatch = useDispatch();\n\n\tconst getProspects = useCallback(async () => {\n\t\tsetLoading(true);\n\t\ttry {\n\t\t\tconst { data } = await axiosInstance.get('/api/prospects');\n\t\t\tsetProspects(data.data);\n\t\t} catch (err) {\n\t\t\tif (axios.isAxiosError(err)) {\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'Hubo un error al obtener los prospectos'\n\t\t\t\t});\n\t\t\t}\n\t\t} finally {\n\t\t\tsetLoading(false);\n\t\t}\n\t}, [setNotification]);\n\n\tconst getProspect = useCallback(\n\t\tasync (prospectId?: string) => {\n\t\t\tsetLoading(true);\n\t\t\ttry {\n\t\t\t\tconst { data } = await axiosInstance.get(`/api/prospect/${prospectId}`);\n\t\t\t\tsetProspect({\n\t\t\t\t\t...data,\n\t\t\t\t\tphone_number:\n\t\t\t\t\t\tdata?.phone_number?.length === 10 ? `+52${data?.phone_number}` : data?.phone_number\n\t\t\t\t});\n\t\t\t\tdata.services &&\n\t\t\t\t\tdispatch(\n\t\t\t\t\t\tsetServicesCUCustomer(\n\t\t\t\t\t\t\tdata.services.map((s: any) => ({ ...s, carrier: getCarrierName(s.carrier) }))\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t} catch (err) {\n\t\t\t\tif (axios.isAxiosError(err)) {\n\t\t\t\t\tsetNotification({\n\t\t\t\t\t\tmessage: 'Hubo un error al obtener los datos del prospecto'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tsetLoading(false);\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[setNotification]\n\t);\n\n\tconst saveProspect = useCallback(\n\t\tasync (payload: ProspectRequestType, prospectId?: string) => {\n\t\t\tsetLoading(true);\n\t\t\ttry {\n\t\t\t\t!prospectId\n\t\t\t\t\t? await axiosInstance.post('/api/prospect', payload)\n\t\t\t\t\t: await axiosInstance.put(`/api/prospect/${prospectId}`, payload);\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: `El prospecto fue ${prospectId ? 'actualizado' : 'creado'} correctamente`,\n\t\t\t\t\tseverity: 'success'\n\t\t\t\t});\n\t\t\t\thistory.push('/prospectos');\n\t\t\t} catch (err) {\n\t\t\t\tif (axios.isAxiosError(err)) {\n\t\t\t\t\tsetNotification({\n\t\t\t\t\t\tmessage: `Hubo un error al ${prospectId ? 'actualizar' : 'crear'} el prospecto`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tsetLoading(false);\n\t\t\t}\n\t\t},\n\t\t[setNotification, history]\n\t);\n\n\tconst updateDocument = useCallback(\n\t\tasync (prospectId: string, payload: any, cb: () => void) => {\n\t\t\ttry {\n\t\t\t\tawait axiosInstance.put(`/api/prospect/document/${prospectId}`, payload);\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'La información se actualizó con éxito',\n\t\t\t\t\tseverity: 'success'\n\t\t\t\t});\n\t\t\t\tcb();\n\t\t\t\tawait getProspect(prospectId);\n\t\t\t} catch (error) {\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'Hubo un error al actualizar la información',\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[setNotification, getProspect]\n\t);\n\n\tuseEffect(() => {\n\t\tgetProspects();\n\t}, [getProspects]);\n\n\treturn { prospects, loading, getProspect, prospect, saveProspect, updateDocument };\n};\n\nexport default useProspects;\n","import { FC, useMemo } from 'react';\nimport { Grid, TextField } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { Autocomplete } from '@material-ui/lab';\nimport { Controller, useForm } from 'react-hook-form';\n// Components\nimport { Transition, DialogTitle, DialogContent, Dialog } from '~pages/shipments/components';\nimport { HeadingTwo } from '~components/Headings';\nimport SaveButton from '~components/Tables/Controls/SaveButton';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\nimport { CustomerDocumentType } from '~store/actions/ActionTypes';\n// Utils\nimport { radiusCard } from '~hooks/useStyles';\nimport { STATUS_REF } from './CustomerDocuments';\n\nconst INFO_FIELDS = [\n\t'document_type',\n\t'file_type',\n\t'file_name',\n\t'url',\n\t'last_update',\n\t'created_date',\n\t'description',\n\t'status',\n\t'id',\n\t'name'\n];\n\nconst FIELD_LABEL_REF: { [key: string]: string } = {\n\tstatus: 'Estatus',\n\t// description: '',\n\t// created_date: '',\n\t// last_update: '',\n\t// comment: 'Razón de rechazo',\n\t// url: '',\n\t// document_type: '',\n\t// file_type:'',\n\t// file_name:'',\n\tlast_name: 'Apellido',\n\tsecond_last_name: 'Segundo Apellido',\n\taddress: 'Dirección',\n\tneighborhood: 'Barrio',\n\tcity: 'Ciudad',\n\tcountry: 'País',\n\tbusiness_name: 'Empresa',\n\tcompany_name: 'Razón Social',\n\tcompanny_name: 'Razón Social',\n\ttax_id: 'RFC',\n\tnumber: 'Número exterior',\n\tsuite_number: 'Número interior',\n\tstate: 'Estado',\n\tstreet: 'Calle',\n\tadmin_name: '',\n\tdenomination: 'Denominación',\n\tdate: 'Fecha',\n\tpublic_deed: '',\n\tnotary_number: '',\n\tpublic_notary: '',\n\tzip_code: 'Código Postal',\n\tdate_of_issue: 'Fecha',\n\tvalidity: 'Válido hasta',\n\tnames: 'Nombre'\n};\n\ninterface Props {\n\tisOpen: boolean; // is shown\n\thandleOpen: (s: boolean) => void;\n\tdata: Partial;\n\tisProfile?: boolean;\n\tonSubmit?: (data: any) => void;\n\tisLoading?: boolean;\n}\n\nexport const useStyles = makeStyles((theme: Theme) => ({\n\tcontainer: {\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tborderRadius: radiusCard,\n\t\tpadding: theme.spacing(3),\n\t\t'&>h4': {\n\t\t\tmargin: `${theme.spacing(2)} 0 ${theme.spacing(2)} ${theme.spacing(2)}`,\n\t\t\twidth: '100%',\n\t\t\ttextAlign: 'left'\n\t\t}\n\t},\n\ttitleContainer: {\n\t\tpadding: '16px'\n\t},\n\tleftSide: {\n\t\tpadding: `0 ${theme.spacing(3)} ${theme.spacing(3)} ${theme.spacing(3)}`\n\t\t// '& > button': {\n\t\t// \twidth: '100%',\n\t\t// \tmarginTop: theme.spacing(2)\n\t\t// }\n\t},\n\tbtnContainer: {\n\t\tpadding: theme.spacing(3)\n\t},\n\theaderContainer: {\n\t\tpadding: `${theme.spacing(3)} 0`,\n\t\t'& button': {\n\t\t\ttop: 10\n\t\t}\n\t},\n\tstatusBox: {\n\t\tpadding: `${theme.spacing(2)} 0 ${theme.spacing(3)} 0`\n\t}\n}));\n\nconst DocumentDetailModal: FC = ({\n\tisOpen,\n\thandleOpen,\n\tdata,\n\tisProfile,\n\tonSubmit,\n\tisLoading\n}: Props) => {\n\tconst classes = useStyles();\n\tconst { handleSubmit, errors, control } = useForm();\n\n\tconst editableFields = useMemo(() => {\n\t\tconst resulFields: any[] = [];\n\t\tif (!data) return [];\n\t\tObject.entries(data).forEach(([key, value]) => {\n\t\t\tif (!INFO_FIELDS.includes(key)) {\n\t\t\t\tresulFields.push({ name: key, label: FIELD_LABEL_REF[key], value });\n\t\t\t}\n\t\t});\n\t\treturn resulFields;\n\t}, [data]);\n\n\tconst handleClose = () => {\n\t\thandleOpen(false);\n\t};\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t handleOpen(false)}>\n\t\t\t\t\t\t\t{data?.description ?? data?.document_type}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{data?.url && (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{!isProfile && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t (\n\t\t\t\t\t\t\t\t\t\t\t\t\t option}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option === value}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tPaperComponent={(paperProps) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{paperProps.children}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={(_, value) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange(value);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\tname='status'\n\t\t\t\t\t\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\t\t\t\t\t\t// rules={{ required: 'Ingresé el rol del colaborador' }}\n\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue={data?.status ? STATUS_REF[data?.status] : null}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{!isProfile && (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{editableFields.map((item) => (\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\trules={{ required: `Ingrese el ${item.label}` }}\n\t\t\t\t\t\t\t\t\t\t\t\tname={item.name}\n\t\t\t\t\t\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue={item.value}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t{onSubmit && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tGuardar\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\n\t);\n};\n\nexport default DocumentDetailModal;\n","import { useMemo, useCallback, Dispatch, SetStateAction } from 'react';\nimport { Tooltip, CircularProgress } from '@mui/material';\nimport { useDropzone } from 'react-dropzone';\nimport { Upload as UploadIcon } from 'react-feather';\n// Hooks\nimport { useStyles } from './styles';\nimport useDocumentsForm from './useDocumentsForm';\n// Utils\nimport { DocumentRow, NAME_REF } from './DocumentsForm';\nimport { DocumentRequestType } from '~store/actions/ActionTypes';\nimport { useTheme } from '~hooks/useTheme';\n\nexport type DocumentFileType = { url: string; type: string; name: string };\n\nconst UploadDocumentBtn = ({\n\trowData,\n\tfiles,\n\tsetFiles,\n\tupdateRows\n}: {\n\trowData: DocumentRow;\n\tfiles: DocumentFileType[] | [];\n\tsetFiles: Dispatch>;\n\tupdateRows?: () => void;\n}) => {\n\tconst classes = useStyles();\n\n\tconst { isSubmitting, saveDocument } = useDocumentsForm();\n\n\tconst disabled = useMemo(() => !!rowData.status, [rowData]);\n\tconst { themeV4 } = useTheme();\n\n\t// Save document\n\tconst handleUpload = useCallback(\n\t\tasync (payload: DocumentRequestType) => {\n\t\t\tawait saveDocument(payload);\n\t\t\tupdateRows && updateRows();\n\t\t},\n\t\t[saveDocument, updateRows]\n\t);\n\n\t// Format files to preview\n\tconst formatImg = useCallback(\n\t\tasync (file: File) => {\n\t\t\tlet resultFile: Partial = {};\n\t\t\tif (file.type.includes('image')) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tconst response = await fetch(file.url);\n\t\t\t\tconst data = await response.blob();\n\t\t\t\tconst fileItem = new File([data], file.name, {\n\t\t\t\t\ttype: file.type\n\t\t\t\t});\n\n\t\t\t\tObject.assign(fileItem, {\n\t\t\t\t\turl: URL.createObjectURL(fileItem)\n\t\t\t\t});\n\n\t\t\t\tconst reader = new FileReader();\n\t\t\t\treader.onload = async function () {\n\t\t\t\t\treader.result &&\n\t\t\t\t\t\t(await handleUpload({\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tfiles: fileItem,\n\t\t\t\t\t\t\tfile_type: fileItem.type,\n\t\t\t\t\t\t\tdocument: NAME_REF[rowData.name]\n\t\t\t\t\t\t}));\n\t\t\t\t};\n\t\t\t\tresultFile = fileItem;\n\t\t\t} else {\n\t\t\t\tconst fileItem = new File([file], file.name, {\n\t\t\t\t\ttype: file.type\n\t\t\t\t});\n\n\t\t\t\tawait handleUpload({\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tfiles: fileItem,\n\t\t\t\t\tfile_type: file.type,\n\t\t\t\t\tdocument: NAME_REF[rowData.name]\n\t\t\t\t});\n\n\t\t\t\tresultFile = file;\n\t\t\t}\n\n\t\t\tsetFiles([\n\t\t\t\t...files,\n\t\t\t\t{ url: resultFile.url ?? '', type: resultFile.type ?? '', name: resultFile.name ?? '' }\n\t\t\t]);\n\t\t},\n\t\t[setFiles, files, handleUpload, rowData.name]\n\t);\n\n\tconst onDrop = useCallback(\n\t\t(acceptedFile: any) => {\n\t\t\tif (!acceptedFile?.length) return;\n\t\t\tconst newFile = { type: acceptedFile[0].type, path: acceptedFile[0].path, url: '' };\n\t\t\tObject.assign(newFile, {\n\t\t\t\turl: URL.createObjectURL(acceptedFile[0])\n\t\t\t});\n\t\t\tformatImg(acceptedFile[0]);\n\t\t},\n\t\t[formatImg]\n\t);\n\n\tconst { getRootProps, getInputProps } = useDropzone({\n\t\tonDrop,\n\t\tnoDrag: true,\n\t\tmaxFiles: 1,\n\t\tmultiple: false\n\t});\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t{!isSubmitting ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t\n\t\t\t\t\t\t{/* Subir archivo */}\n\t\t\t\t\t\n\t\t\t\t) : (\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t)}\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default UploadDocumentBtn;\n","import { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { maxWidthContainer, radiusCard } from '~hooks/useStyles';\n\nexport const useStyles = makeStyles((theme: Theme) => ({\n\tcontainer: {\n\t\twidth: maxWidthContainer,\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tborderRadius: radiusCard,\n\t\tpadding: theme.spacing(3),\n\t\tmarginTop: theme.spacing(3),\n\t\t'& > div': {\n\t\t\tmarginBottom: `${theme.spacing(3)} !important`\n\t\t}\n\t},\n\tupload: {\n\t\tdisplay: 'flex',\n\t\talignItems: 'center',\n\t\tjustifyContent: 'center',\n\t\tpadding: '12px',\n\t\tborder: 'none !important',\n\t\tborderRadius: '50%',\n\t\tcursor: 'pointer',\n\t\tcolor: 'white !important',\n\t\t// '& > span': { marginLeft: theme.spacing(1), fontWeight: 'bold' },\n\t\t'&:hover': {\n\t\t\t// border: `1px solid ${theme.palette.primary.main}`, // #4ec0df\n\t\t\tbackgroundColor: 'rgba(78, 192, 223, 0.08)'\n\t\t}\n\t},\n\tbtnLoader: {\n\t\t// minWidth: '100px',\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'center'\n\t}\n}));\n","import { useCallback, useContext, useEffect, useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport axios from 'axios';\nimport axiosInstance from '~util/axios';\nimport { DocumentRequestType, DocumentResponseType, Entity } from '~store/actions/ActionTypes';\nimport DrawContext from '~context/DrawContext';\nimport { DocumentRow } from './DocumentsForm';\n\nconst all = ['ine', 'tax', 'proof_address'];\nconst onlyMoral = ['constitutive_act', 'assembly_act'];\n\nconst useDocumentsForm = () => {\n\tconst params: { token?: string } = useParams();\n\n\tconst [isLoading, setIsLoading] = useState(false);\n\tconst [isSubmitting, setIsSubmitting] = useState(false);\n\tconst [documentsData, setDocumentsData] = useState(null);\n\tconst [rows, setRows] = useState([]);\n\n\tconst { setNotification } = useContext(DrawContext);\n\n\tconst getDocuments = useCallback(async () => {\n\t\tif (!params?.token) return;\n\t\ttry {\n\t\t\tconst { data } = await axiosInstance.get(`/api/prospect/documents/${params?.token}`);\n\n\t\t\tconst result: DocumentResponseType = {\n\t\t\t\t...data,\n\t\t\t\tdocuments: {\n\t\t\t\t\tine: data.documents?.ine || data.ineData,\n\t\t\t\t\ttax: data.documents?.tax || data.taxData,\n\t\t\t\t\tproof_address: data.documents?.proof_address || data.proofAddressData,\n\t\t\t\t\tconstitutive_act: data.documents?.constitutive_act || data.constitutiveActData,\n\t\t\t\t\tassembly_act: data.documents?.assembly_act || data.assemblyActData\n\t\t\t\t}\n\t\t\t};\n\t\t\tsetDocumentsData(result);\n\t\t\tconst requiredDocs = result?.prospect_type === Entity.PHYSICAL ? all : [...all, ...onlyMoral];\n\t\t\tconst resultRows = Object.entries(result?.documents)\n\t\t\t\t.filter(([key, _]) => requiredDocs?.includes(key))\n\t\t\t\t.map(([key, value]) => ({\n\t\t\t\t\t...value,\n\t\t\t\t\tname: key\n\t\t\t\t}));\n\t\t\tsetRows(resultRows);\n\t\t} catch (error) {\n\t\t\tif (!axios.isAxiosError(error)) return;\n\t\t\tconst errorMessage =\n\t\t\t\terror.response?.data?.message === 'TOKEN_EXPIRED'\n\t\t\t\t\t? 'Este link expiró. Si crees que es un error, comunícate con el equipo de Encamino.'\n\t\t\t\t\t: 'Hubo un error al cargar los documentos';\n\t\t\tsetNotification({\n\t\t\t\tmessage: errorMessage,\n\t\t\t\tseverity: 'error'\n\t\t\t});\n\t\t} finally {\n\t\t\tsetIsLoading(false);\n\t\t}\n\t}, [params?.token, setNotification]);\n\n\tconst saveDocument = useCallback(\n\t\tasync (payload: DocumentRequestType) => {\n\t\t\tsetIsSubmitting(true);\n\t\t\tconst formData = new FormData();\n\t\t\tformData.append('files', payload.files);\n\t\t\tformData.append('file_type', payload.file_type);\n\t\t\tformData.append('document', payload.document);\n\n\t\t\t// TODO: for root and customer profile\n\t\t\ttry {\n\t\t\t\tconst { data } = await axiosInstance.post(`/api/prospect/files/${params?.token}`, formData);\n\t\t\t\tconst updatedData: DocumentResponseType = {\n\t\t\t\t\t...documentsData!,\n\t\t\t\t\tdocuments: { ...data }\n\t\t\t\t};\n\t\t\t\tsetDocumentsData(updatedData);\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'Se subió el documento con éxito',\n\t\t\t\t\tseverity: 'success'\n\t\t\t\t});\n\t\t\t\tsetIsLoading(true);\n\t\t\t\tgetDocuments();\n\t\t\t} catch (error) {\n\t\t\t\tif (!axios.isAxiosError(error)) return;\n\t\t\t\tlet errorMessage = 'Hubo un error al cargar el archivo';\n\t\t\t\tif (error.response?.data?.message === 'WRONG_DATA') {\n\t\t\t\t\terrorMessage = error.response?.data?.description;\n\t\t\t\t}\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: errorMessage,\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tsetIsSubmitting(false);\n\t\t\t}\n\t\t},\n\t\t[params?.token, setNotification, documentsData, getDocuments]\n\t);\n\n\tuseEffect(() => {\n\t\tsetIsLoading(true);\n\t\tgetDocuments();\n\t}, [getDocuments]);\n\n\treturn { isLoading, documentsData, saveDocument, isSubmitting, rows };\n};\n\nexport default useDocumentsForm;\n","import React from 'react';\nimport { Paper } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\n\nconst useStyles = makeStyles((theme) => ({\n\tcontainer: {\n\t\tcolor: `${theme.palette.white.main} !important`,\n\t\tbackgroundColor: '#353535 !important',\n\t\t'& > ul > li > *': {\n\t\t\tbackgroundColor: '#353535 !important',\n\t\t\tcolor: `${theme.palette.white.main} !important`\n\t\t},\n\t\t'& > *': {\n\t\t\tcolor: `${theme.palette.white.main} !important`,\n\t\t\tfontSize: '14px'\n\t\t\t// opacity: 0.7\n\t\t}\n\t}\n}));\n\nconst DropdownPaper = ({ children }: { children: React.ReactNode }) => {\n\tconst classes = useStyles();\n\treturn {children};\n};\n\nexport default DropdownPaper;\n","/* eslint-disable no-useless-escape */\nimport isURL from 'validator/lib/isURL';\n\nexport const Validators = {\n\t// Min-length 12 and Max-length 13\n\tRFC: /^[A-Z&Ñ]{3,4}[0-9]{2}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])[A-Z0-9]{2}[0-9A]$/,\n\n\tEmail:\n\t\t/^(([^'<>()[\\]\\\\óáéíúüïëöäñ.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*))@(([a-zA-Z\\-0-9áéíóúüïëöä]+\\.)+[a-zA-Záéíóúüïëöä]{2,})$/,\n\tPhoneNumber:\n\t\t/^\\s*(((\\+1|1)?( |-)?)?(\\([2-9][0-9]{2}\\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})|((\\+?52)?(1|01)?\\d{10,10}$))\\s*$/,\n\n\tAddressAlias: /^\\s*[A-Za-zÁÉÍÓÚÜÑñáéíóúü\\s0-9,.@#$%&*()-_=+:'\"]{1,60}\\s*$/,\n\tAddressBusinessName: /^\\s*[A-Za-zÁÉÍÓÚÜÑñáéíóú\\s0-9,.@#$%&*()-_=+:'\"]{1,50}\\s*$/,\n\tShortBusinessName: /^\\s*[A-Za-zÁÉÍÓÚÑñáéíóú\\s0-9,.@#$%&*()-_=+:'\"]{1,100}\\s*$/,\n\tLongBusinessName: /^\\s*[A-Za-zÁÉÍÓÚÑñáéíóú\\s0-9,.@#$%&*()-_=+:'\"]{1,250}\\s*$/,\n\tCountry: /^\\s*[A-Za-zÁÉÍÓÚÑñáéíóúü\\s0-9,.@#$%&*()-_=+:'\"]{1,50}\\s*$/,\n\tZipCode: /^\\s*[0-9][0-9][0-9][0-9][0-9]\\s*$/,\n\tNeighborhood: /^\\s*[A-Za-zÁÉÍÓÚÑñáéíóúü\\s0-9,.@#$%&*()-_=+:'\"]{1,50}\\s*$/,\n\tCity: /^\\s*[A-Za-zÁÉÍÓÚÑñáéíóúü\\s0-9,.@#$%&*()-_=+:'\"]{1,50}\\s*$/,\n\tState: /^\\s*[A-Za-zÁÉÍÓÚÑñáéíóúü\\s0-9,.@#$%&*()-_=+:'\"]{1,50}\\s*$/,\n\tStreet: /^\\s*[A-Za-zÁÉÍÓÚÑñáéíóúü\\s0-9,.@#$%&*()-_=+:'\"]{1,60}\\s*$/,\n\tNumber: /^\\s*[A-Za-zÁÉÍÓÚÑñáéíóúü\\s0-9,.@#$%&*()-_=+:'\"]{1,25}\\s*$/,\n\tReferenceStreets: /^\\s*[A-Za-zÁÉÍÓÚÑñáéíóúü\\s0-9,.@#$%&*()-_=+:'\"]{1,360}\\s*$/,\n\tContactName: /^\\s*[A-Za-zÁÉÍÓÚÑñáéíóúü\\s0-9,.@#$%&*()-_=+:'\"]{1,50}\\s*$/,\n\n\tURL: (url: string) => isURL(url)\n};\n\nexport const EstafetaValidator = {\n\tStreet: /^\\s*[^$^|~]{1,25}\\s*$/,\n\tBusinessName: /^\\s*[^$^|~]{1,50}\\s*$/,\n\tInternalNumber: /^\\s*[^$^|~]{1,5}\\s*$/,\n\tExternalNumber: /^\\s*[^$^|~]{1,5}\\s*$/,\n\tContactName: /^\\s*[^$^|~]{1,30}\\s*$/,\n\tPhoneNumber:\n\t\t/^\\s*(((\\+1|1)?( |-)?)?(\\([2-9][0-9]{2}\\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})|((\\+?52)?(1|01)?\\d{10,11}))\\s*$/\n};\n\nexport const DhlValidator = {\n\tCompanyName: /^\\s*[A-Za-zÁÉÍÓÚÑñáéíóúü\\s0-9,.@#$%&*()-_=+:'\"]{2,35}\\s*$/,\n\tPersonName: /^\\s*[A-Za-zÁÉÍÓÚÑñáéíóúü\\s0-9,.@#$%&*()-_=+:'\"]{2,35}\\s*$/,\n\tStreet: /^\\s*[A-Za-zÁÉÍÓÚÑñáéíóúü\\s0-9,.@#$%&*()-_=+:'\"]{1,45}\\s*$/\n};\n","import {\n\tuseEffect,\n\tuseContext,\n\tuseState,\n\tuseCallback,\n\tDispatch,\n\tSetStateAction,\n\tuseMemo\n} from 'react';\nimport { GridColDef } from '@mui/x-data-grid';\nimport { instanceRate } from '~util/axios';\nimport { shallow } from 'zustand/shallow';\nimport DrawContext from '~context/DrawContext';\nimport axios from 'axios';\n//Store\nimport useRateStore from '~store/useRateStore';\nimport { removeStress } from '~util/removeStress';\nimport { usePurchaseStore } from '~store/newstore/usePurchaseStore';\n\nexport enum ServicesRateName {\n\tNEXT_DAY = 'Dia Siguiente',\n\tLOCAL_MESSAGING = 'Mensajeria Local',\n\tLTL = 'LTL'\n}\n\nexport enum ServicesName {\n\tNEXT_DAY = 'Dia Sig.',\n\tLOCAL_MESSAGING = 'Mensajería Local',\n\tLTL = 'LTL / Tarima'\n}\n\nexport enum ServicesModalityName {\n\tNO_CREDIT = 'Sin Crédito',\n\tPREPAID = 'Prepago',\n\tCONSUMPTION = 'Consumo'\n}\n\nfunction getModality(service: string) {\n\tif (service.includes(ServicesModalityName.NO_CREDIT)) return ServicesModalityName.NO_CREDIT;\n\tif (service.includes(ServicesModalityName.PREPAID)) return ServicesModalityName.PREPAID;\n\tif (service.includes(ServicesModalityName.CONSUMPTION)) return ServicesModalityName.CONSUMPTION;\n\n\treturn '';\n}\nexport function removeModalityIfPresent(service: string) {\n\tconst modality = getModality(service);\n\tif (modality) {\n\t\treturn service.replace(modality, '').trim();\n\t}\n\treturn service;\n}\n\nexport function formatServiceToRateName(name: string) {\n\tif (!name) return '';\n\treturn removeStress(name).includes(ServicesRateName.NEXT_DAY)\n\t\t? removeStress(name).replace(ServicesRateName.NEXT_DAY, ServicesName.NEXT_DAY)\n\t\t: name.includes('LTL')\n\t\t\t? 'LTL'\n\t\t\t: name.includes('K')\n\t\t\t\t? removeStress(name)\n\t\t\t\t\t.split(' ')\n\t\t\t\t\t.filter(\n\t\t\t\t\t\t(item) =>\n\t\t\t\t\t\t\t!item.includes('K') &&\n\t\t\t\t\t\t\t(isNaN(parseInt(item)) || item.includes('11:30') || item.includes('12:30'))\n\t\t\t\t\t)\n\t\t\t\t\t.join(' ')\n\t\t\t\t\t.trim()\n\t\t\t\t: removeStress(name);\n}\n\nconst useGetColumns = ({\n\tselectedProposal,\n\tsetSelectedProposal\n}: {\n\tsetSelectedProposal?: Dispatch>;\n\tselectedProposal?: Proposal | null;\n}) => {\n\tconst { setNotification, setRCardStatus } = useContext(DrawContext);\n\tconst [columns, setColumns] = useState([]);\n\tconst [loading, setLoading] = useState(false);\n\tconst [selectedYear, setSelectedYear] = useState<{ value?: string; fromUser: boolean }>({\n\t\tfromUser: false\n\t});\n\tconst [\n\t\tsetServices,\n\t\tservices,\n\t\trateService,\n\t\tsetProposals,\n\t\tsetZones,\n\t\tsetRates,\n\t\tsetRanges,\n\t\tsetZonesCost,\n\t\tsetClientRates,\n\t\tclientRates,\n\t\tsetUrl,\n\t\tservice,\n\t\tsetRateService,\n\t\tyears,\n\t\tsetYears\n\t] = useRateStore(\n\t\t(state) => [\n\t\t\tstate.setServices,\n\t\t\tstate.services,\n\t\t\tstate.rateService,\n\t\t\tstate.setProposals,\n\t\t\tstate.setZones,\n\t\t\tstate.setRates,\n\t\t\tstate.setRanges,\n\t\t\tstate.setZonesCost,\n\t\t\tstate.setClientRates,\n\t\t\tstate.clientRates,\n\t\t\tstate.setUrl,\n\t\t\tstate.service,\n\t\t\tstate.setRateService,\n\t\t\tstate.years,\n\t\t\tstate.setYears\n\t\t],\n\t\tshallow\n\t);\n\n\tconst formattedServices = useMemo(\n\t\t() =>\n\t\t\tservices?.map((item) => ({\n\t\t\t\t...item,\n\t\t\t\testafetaServiceName: formatServiceToRateName(item.estafetaServiceName ?? '')\n\t\t\t})) ?? [],\n\t\t[services]\n\t);\n\n\tconst { setPrices } = usePurchaseStore((state) => ({ setPrices: state.setPrices }));\n\n\tuseEffect(() => {\n\t\tsetRCardStatus('HIDDEN');\n\t}, [setRCardStatus]);\n\n\t//Get all services\n\tconst getAllServices = useCallback(\n\t\tasync (year: string) => {\n\t\t\tsetLoading(true);\n\t\t\ttry {\n\t\t\t\tconst rates = await instanceRate.get(`/rates?year=${year}`);\n\t\t\t\tsetServices(rates.data);\n\t\t\t} catch (error) {\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'Algo salió mal, por favor contacta al equipo de Encamino',\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tsetLoading(false);\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[setServices]\n\t);\n\n\tuseEffect(() => {\n\t\tif (!selectedYear?.value) return;\n\t\tgetAllServices(selectedYear.value);\n\t}, [selectedYear?.value, getAllServices]);\n\n\t// Get rate proposals\n\tconst fetchRates = useCallback(() => {\n\t\tlet range: GridColDef[] = [];\n\t\tlet copyZones: unknown = [];\n\t\tlet proposal: Proposals = [];\n\t\t/**\n\t\t * Arrays getting objects with dynamic keys and values\n\t\t * Example: rates[{[dinamicKey with the same name as the column value]: volume.cost}]\n\t\t */\n\t\tlet copyZonesCost: Record[] = [];\n\t\tlet rates: unknown = [];\n\n\t\t/**\n\t\t * Loop through information and add it to the store to display it in tables\n\t\t */\n\t\tlet serviceState = removeModalityIfPresent(formatServiceToRateName(service));\n\n\t\tconst selected = formattedServices?.filter((item) =>\n\t\t\titem.estafetaServiceName?.includes(serviceState)\n\t\t);\n\t\tif (!selected || !selected[0]) return;\n\n\t\tselected[0]?.proposals?.forEach((prop: Proposal) => {\n\t\t\tconst modalityValue = !service\n\t\t\t\t? ''\n\t\t\t\t: service.includes('LTL')\n\t\t\t\t\t? ''\n\t\t\t\t\t: service.includes(ServicesModalityName.CONSUMPTION)\n\t\t\t\t\t\t? ServicesModalityName.CONSUMPTION\n\t\t\t\t\t\t: service.includes(ServicesModalityName.PREPAID)\n\t\t\t\t\t\t\t? ServicesModalityName.PREPAID\n\t\t\t\t\t\t\t: ServicesModalityName.NO_CREDIT;\n\t\t\tproposal.push({\n\t\t\t\tname: prop?.name.includes('.') ? prop?.name.split('.')[0] : prop?.name,\n\t\t\t\tid: prop?.id,\n\t\t\t\tmodality: modalityValue,\n\t\t\t\trates: prop?.rates,\n\t\t\t\tzones: prop?.zones\n\t\t\t});\n\t\t});\n\n\t\tsetUrl('');\n\t\tsetProposals(proposal);\n\t\tconst proposalToRate = selected[0].proposals?.find(\n\t\t\t(item) => item.name === selectedProposal?.name\n\t\t);\n\n\t\tif (!proposalToRate) {\n\t\t\tsetRates(rates as RateRanges);\n\t\t\tsetRanges(range);\n\t\t\tsetZones(copyZones as GridColDef[]);\n\t\t\tsetZonesCost(copyZonesCost);\n\t\t\tsetColumns([{ field: 'weight', headerName: 'Peso', width: 150 }, ...range]);\n\t\t\treturn;\n\t\t}\n\n\t\tlet formattedZones: Record = {};\n\t\t// Setting ranges for columns\n\t\tif (!proposalToRate?.rates || proposalToRate?.rates.length === 0) return;\n\t\trange = proposalToRate?.rates[0].rangeVolumes.map((ranges: RateRange) => {\n\t\t\treturn {\n\t\t\t\tfield: `${ranges.from}-${ranges.to}`,\n\t\t\t\theaderName: `${ranges.from}-${ranges.to}`,\n\t\t\t\twidth: 150,\n\t\t\t\teditable: true\n\t\t\t};\n\t\t});\n\t\trates = proposalToRate?.rates?.map((rate: Rate) => {\n\t\t\t/**\n\t\t\t * Objects that get dynamic keys and values\n\t\t\t * Example: formattedInfo[dinamicKey with the same name as the column value] = volume.cost;\n\t\t\t */\n\t\t\tlet formattedInfo: Record = {};\n\t\t\trate?.rangeVolumes?.forEach((volume: RateRange) => {\n\t\t\t\tformattedInfo.id = rate.internalServiceName;\n\t\t\t\tformattedInfo.weight = rate.internalServiceName;\n\t\t\t\tformattedInfo[`${volume.from}-${volume.to}`] = volume.cost;\n\t\t\t});\n\t\t\treturn { ...formattedInfo };\n\t\t});\n\n\t\tcopyZones = proposalToRate?.zones?.map((zone: Zone) => {\n\t\t\tformattedZones.id = `${zone.cost}`;\n\t\t\tformattedZones[`${zone.name}`] = `${zone.cost}`;\n\t\t\treturn {\n\t\t\t\tfield: `${zone.name}`,\n\t\t\t\theaderName: `${zone.name}`,\n\t\t\t\twidth: 150\n\t\t\t};\n\t\t});\n\t\tcopyZonesCost.push({ ...formattedZones });\n\t\tcopyZonesCost = copyZonesCost[0] ? [copyZonesCost[0]] : copyZonesCost;\n\n\t\tsetRates(rates as RateRanges);\n\t\tsetRanges(range);\n\t\tsetZones(copyZones as GridColDef[]);\n\t\tsetZonesCost(copyZonesCost);\n\t\tsetColumns([{ field: 'weight', headerName: 'Peso', width: 150 }, ...range]);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\tformattedServices,\n\t\tsetProposals,\n\t\tsetRanges,\n\t\tsetRates,\n\t\tsetZones,\n\t\tsetZonesCost,\n\t\tservice,\n\t\tselectedProposal\n\t]);\n\n\t// Get proposal from a given client\n\tconst getClientRates = useCallback(\n\t\tasync (id: string, year?: string, fromDispersion?: boolean) => {\n\t\t\tsetLoading(true);\n\t\t\tif (!setSelectedProposal) return;\n\t\t\ttry {\n\t\t\t\tconst yearRef = year ? year : selectedYear?.value;\n\t\t\t\tconst response = await instanceRate.get(`/rates/${id}?with_data=true&year=${yearRef}`);\n\t\t\t\tif (!response.data.rate_configs || response.data.rate_configs.length === 0) {\n\t\t\t\t\tsetRateService(null);\n\t\t\t\t\tsetSelectedProposal(undefined);\n\t\t\t\t\tsetClientRates(null);\n\t\t\t\t\tsetUrl('');\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlet selectedServiceByUser = formatServiceToRateName(service ?? '');\n\n\t\t\t\t// rates from the customer\n\t\t\t\tconst formattedCustomerRates = response.data.rate_configs?.map((item: RateConfig) => ({\n\t\t\t\t\t...item,\n\t\t\t\t\tservice: formatServiceToRateName(item.service ?? '')\n\t\t\t\t}));\n\n\t\t\t\tconst rateProposal = formattedCustomerRates?.filter((formattedItem: RateConfig) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tformattedItem.service === selectedServiceByUser ||\n\t\t\t\t\t\t(formattedItem.service && formattedItem?.service?.includes(selectedServiceByUser))\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\tsetClientRates(formattedCustomerRates);\n\t\t\t\tif (fromDispersion) {\n\t\t\t\t\tsetPrices(response.data.rate_configs);\n\t\t\t\t}\n\n\t\t\t\tif (!rateProposal?.length || !rateProposal[0]?.prices?.length) {\n\t\t\t\t\tsetRateService(null);\n\t\t\t\t\tsetSelectedProposal(undefined);\n\t\t\t\t\tsetUrl('');\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst modalityValue = !service\n\t\t\t\t\t? ''\n\t\t\t\t\t: service.includes('LTL')\n\t\t\t\t\t\t? ''\n\t\t\t\t\t\t: service.includes(ServicesModalityName.CONSUMPTION)\n\t\t\t\t\t\t\t? ServicesModalityName.CONSUMPTION\n\t\t\t\t\t\t\t: service.includes(ServicesModalityName.PREPAID)\n\t\t\t\t\t\t\t\t? ServicesModalityName.PREPAID\n\t\t\t\t\t\t\t\t: ServicesModalityName.NO_CREDIT;\n\n\t\t\t\tconst volumeItem = rateProposal[0]?.prices[0]?.rangeVolumes?.find(\n\t\t\t\t\t(item: any) => item?.selected\n\t\t\t\t);\n\t\t\t\tsetSelectedProposal({\n\t\t\t\t\tname: rateProposal[0].proposal_name ?? 'Proposal',\n\t\t\t\t\tid: rateProposal[0].id.toString(),\n\t\t\t\t\tmodality: modalityValue,\n\t\t\t\t\tyear: rateProposal[0].year || '',\n\t\t\t\t\tvolume: `${volumeItem?.from}-${volumeItem?.to}`\n\t\t\t\t});\n\n\t\t\t\tsetRateService({\n\t\t\t\t\tid: rateProposal[0].id,\n\t\t\t\t\tname: rateProposal[0].service,\n\t\t\t\t\turl: rateProposal[0].url\n\t\t\t\t});\n\t\t\t\tsetLoading(false);\n\t\t\t} catch (error) {\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'Hubo un error al obtener las tarifas del cliente, inténtalo más tarde',\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t\tsetLoading(false);\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[setClientRates, setNotification, service, setRateService, setSelectedProposal, selectedYear]\n\t);\n\n\tconst formatClientRatesInformation = useCallback(() => {\n\t\tlet range: GridColDef[] = [];\n\t\tlet copyZones: GridColDef[] = [];\n\t\t/**\n\t\t * Arrays getting objects with dynamic keys and values\n\t\t * Example: rates[{[dinamicKey with the same name as the column value]: volume.cost}]\n\t\t */\n\t\tlet copyZonesCost: Record[] = [];\n\t\tlet rates: unknown = [];\n\t\t/**\n\t\t * Found selected service info\n\t\t */\n\t\tconst selected = clientRates?.find(\n\t\t\t(ser) => ser.id === rateService?.id || ser.id.toString() === selectedProposal?.id\n\t\t);\n\n\t\tif (selected?.url) {\n\t\t\tsetUrl(selected?.url);\n\t\t}\n\t\tif (!selected?.prices) return;\n\t\t//Format information for Data Grid columns\n\t\trange = selected?.prices[0].rangeVolumes.map((ranges: RateRange) => {\n\t\t\treturn {\n\t\t\t\tfield: `${ranges.from}-${ranges.to}`,\n\t\t\t\theaderName: `${ranges.from}-${ranges.to}`,\n\t\t\t\twidth: 150\n\t\t\t};\n\t\t});\n\n\t\t/**\n\t\t * Format information for Data Grid rows\n\t\t */\n\t\trates = selected?.prices.map((price: Rate) => {\n\t\t\t/**\n\t\t\t * Objects that get dynamic keys and values\n\t\t\t * Example: formattedInfo[dinamicKey with the same name as the column value] = volume.cost;\n\t\t\t */\n\t\t\tlet formattedInfo: Record = {};\n\t\t\tprice?.rangeVolumes?.forEach((volume: RateRange) => {\n\t\t\t\tformattedInfo.id = price.internalServiceName;\n\t\t\t\tformattedInfo.weight = price.internalServiceName;\n\t\t\t\tformattedInfo[`${volume.from}-${volume.to}`] = volume.selected\n\t\t\t\t\t? `${volume.cost}`\n\t\t\t\t\t: volume.cost;\n\t\t\t});\n\t\t\treturn { ...formattedInfo };\n\t\t});\n\t\tif (selected) {\n\t\t\t/**\n\t\t\t * Objects that get dynamic keys and values\n\t\t\t * Example: formattedInfo[dinamicKey with the same name as the column value] = volume.cost;\n\t\t\t */\n\t\t\tlet formattedZones: Record = {};\n\t\t\t/**\n\t\t\t * Format information for zones Data Grid rows and columns\n\t\t\t */\n\t\t\tcopyZones = selected?.zones?.map((zone: Zone) => {\n\t\t\t\tformattedZones.id = `${Date.now()}`;\n\t\t\t\tformattedZones[`${zone.name}`] = `${zone.cost}`;\n\t\t\t\treturn {\n\t\t\t\t\tfield: `${zone.name}`,\n\t\t\t\t\theaderName: `${zone.name}`,\n\t\t\t\t\twidth: 150\n\t\t\t\t};\n\t\t\t});\n\t\t\tcopyZonesCost.push({ ...formattedZones });\n\t\t}\n\n\t\tsetRates(rates as RateRanges);\n\t\tsetZones(copyZones);\n\t\tsetZonesCost(copyZonesCost);\n\t\tsetRanges(range);\n\t\tsetColumns([{ field: 'weight', headerName: 'Peso', width: 150 }, ...range]);\n\t}, [\n\t\tclientRates,\n\t\trateService,\n\t\tsetRates,\n\t\tsetUrl,\n\t\tsetZones,\n\t\tsetZonesCost,\n\t\tselectedProposal,\n\t\tsetRanges\n\t]);\n\n\tconst resetValues = () => {\n\t\tsetRates([]);\n\t\tsetClientRates(null);\n\t\tsetColumns([{ field: 'weight', headerName: 'Peso', width: 150 }]);\n\t};\n\n\t// Sync proposals for a customer\n\tconst syncClientRate = useCallback(\n\t\tasync (customerId: string, proposalId: string, volume: string) => {\n\t\t\ttry {\n\t\t\t\tawait instanceRate.put(`/rates/${customerId}/sync/${proposalId}`, { volume });\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'Tarifa actualizada con éxito',\n\t\t\t\t\tseverity: 'success'\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tlet errorMessage = 'Algo salió mal, contactar al equipo de Encamino';\n\t\t\t\tif (axios.isAxiosError(error)) {\n\t\t\t\t\terrorMessage = error.response?.data.message;\n\t\t\t\t\tif (error.response?.data?.errors.length) {\n\t\t\t\t\t\terrorMessage = `${errorMessage}: ${error.response?.data?.errors.join('\\n,')}`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: errorMessage,\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tsetLoading(false);\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[clientRates, setNotification]\n\t);\n\n\tconst setIsFromUpdate = async (\n\t\tcustomerId: string,\n\t\tproposalId: string,\n\t\tvolume: string,\n\t\tyear?: string\n\t) => {\n\t\tawait syncClientRate(customerId, proposalId, volume);\n\t\tawait getClientRates(customerId, year);\n\t};\n\n\tconst getRateYears = useCallback(async () => {\n\t\ttry {\n\t\t\tconst yearsResponse = await instanceRate.get('/rates/years');\n\t\t\tconst yearsList = [...yearsResponse.data].reverse();\n\t\t\tsetYears(yearsList);\n\t\t} catch (error) {\n\t\t\tsetNotification({\n\t\t\t\tmessage: 'Hubo un error al obtener los años',\n\t\t\t\tseverity: 'error'\n\t\t\t});\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tconst deleteRate = useCallback(\n\t\tasync (clientRatesId: string, rateConfigId: string, isProspect?: boolean) => {\n\t\t\tsetLoading(true);\n\t\t\ttry {\n\t\t\t\tconst url = !isProspect ? 'rates' : 'rates/prospect';\n\n\t\t\t\tawait instanceRate.delete(`/${url}/${clientRatesId}`, {\n\t\t\t\t\tdata: { rate_config_id: parseInt(rateConfigId) }\n\t\t\t\t});\n\t\t\t\tresetValues();\n\t\t\t\tsetSelectedProposal && setSelectedProposal(undefined);\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'Se eliminó la tarifa con éxito.',\n\t\t\t\t\tseverity: 'success'\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tlet errorMessage = 'Hubo un error al eliminar la tarifa.';\n\t\t\t\tif (axios.isAxiosError(error)) {\n\t\t\t\t\tif (error.response?.data?.message === 'rate config not found') {\n\t\t\t\t\t\terrorMessage = 'No se encontró la tarifa seleccionada.';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: errorMessage,\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tsetLoading(false);\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[setSelectedProposal]\n\t);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\t!!clientRates &&\n\t\t\tclientRates?.some((item) => item.id.toString() === selectedProposal?.id) &&\n\t\t\t!!selectedProposal\n\t\t) {\n\t\t\tformatClientRatesInformation();\n\t\t} else {\n\t\t\tfetchRates();\n\t\t}\n\t}, [clientRates, selectedProposal, fetchRates, formatClientRatesInformation]);\n\n\tuseEffect(() => {\n\t\tif (!!selectedProposal) {\n\t\t\tfetchRates();\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [selectedProposal]);\n\n\tuseEffect(() => {\n\t\tif (!!years?.length) return;\n\t\tgetRateYears();\n\t}, [getRateYears, years]);\n\n\treturn {\n\t\tcolumns,\n\t\tgetClientRates,\n\t\tresetValues,\n\t\tloading,\n\t\tsyncClientRate,\n\t\tyears,\n\t\tsetSelectedYear,\n\t\tselectedYear,\n\t\tdeleteRate,\n\t\tsetIsFromUpdate,\n\t\tformattedServices,\n\t\tfetchRates\n\t};\n};\n\nexport default useGetColumns;\n","import { Option } from '~components/Forms/Select';\n\n// Important: The order matters\nexport enum Modules {\n\tApps = 'Aplicaciones',\n\tAddressesContacts = 'Direcciones',\n\tAgentsUsersGroups = 'Usuarios y Grupos',\n\tLabels = 'Guías',\n\tItems = 'Empaque',\n\tPickups = 'Recolecciones',\n\tRates = 'Cotizaciones',\n\tDispersion = 'Stock/Inventario',\n\tBilling = 'Facturación'\n}\n\nexport enum Permissions {\n\tEdit = '2',\n\tShow = '1',\n\tNoAccess = '0'\n}\n\nexport const numberOfPermissions = Object.keys(Modules).length;\n\nexport enum PresetType {\n\tAdministrator = 'Administrador',\n\tCustom = 'Personalizado',\n\tBiller = 'Facturación',\n\tSC = 'SC'\n}\n\nexport type PermissionPreset = {\n\tname: PresetType;\n\tpermission: string;\n};\n\nexport const presets: PermissionPreset[] = [\n\t{\n\t\tname: PresetType.Biller,\n\t\tpermission: Object.values(Modules)\n\t\t\t.map((item) => (item === Modules.Billing ? Permissions.Edit : Permissions.NoAccess))\n\t\t\t.join('')\n\t},\n\t{\n\t\tname: PresetType.SC,\n\t\tpermission: Permissions.Show.repeat(numberOfPermissions)\n\t},\n\t{\n\t\tname: PresetType.Administrator,\n\t\tpermission: Permissions.Edit.repeat(numberOfPermissions)\n\t},\n\t{\n\t\tname: PresetType.Custom,\n\t\tpermission: Object.values(Modules)\n\t\t\t.map((item) => (item === Modules.Dispersion ? Permissions.Show : Permissions.Edit))\n\t\t\t.join('')\n\t}\n];\n\nexport const presetOptions = ((): Option[] => {\n\treturn presets.map((preset) => ({\n\t\tlabel: preset.name,\n\t\tvalue: preset.permission\n\t}));\n})();\n\nexport const permissionOptions = (module: string): Option[] => {\n\treturn [\n\t\t{ label: 'Sin acceso', value: Permissions.NoAccess },\n\t\t{ label: 'Visualizar', value: Permissions.Show },\n\t\t{\n\t\t\tlabel:\n\t\t\t\tmodule === 'Guías' || module === 'Recolecciones' || module === 'Cotizaciones'\n\t\t\t\t\t? 'Generar'\n\t\t\t\t\t: module === 'Stock/Inventario'\n\t\t\t\t\t? 'Asignar'\n\t\t\t\t\t: 'Editar',\n\t\t\tvalue: Permissions.Edit\n\t\t\t//subtext: 'Agregar, Eliminar y Modificar'\n\t\t}\n\t];\n};\n","import { useState, useEffect, useMemo } from 'react';\nimport { Grid, Checkbox, TextField } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { Autocomplete } from '@material-ui/lab';\nimport { Controller, Control, FieldErrors, useWatch, ErrorOption } from 'react-hook-form';\nimport { RootStore } from '~store/store';\nimport { useSelector } from 'react-redux';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\nimport { NotificationType } from '~store/actions/ActionTypes';\nimport { useRouteMatch } from 'react-router-dom';\nimport { isValidPhoneNumber } from 'react-phone-number-input';\nimport PhoneNumberInput from '~components/Inputs/InputForms/PhoneNumberInput';\n\nenum NotificationStatusOption {\n\tDELIVERED = 'Entregado',\n\tANY = 'Cualquier movimiento'\n}\n\nconst STATUS_OPTIONS = [NotificationStatusOption.DELIVERED, NotificationStatusOption.ANY];\n// const MODALITY_OPTIONS = ['Todos los envíos', 'Este envío'];\nexport const DEFAULT_MODALITY = 'Este envío';\n\nexport type NotificationsContactsFields = {\n\talias: string;\n\tphone_number: string;\n\tguide_status: string;\n\tshipping_mode: string;\n\tactive: boolean;\n\tuser_id?: number;\n\tcontact_id?: number;\n\ttype?: NotificationType;\n};\n\ntype NotificationProps = {\n\tcontrol: Control;\n\terrors: FieldErrors;\n\tdefaultValues?: NotificationsContactsFields | null;\n\tbackgroundColor?: string;\n\ttype?: 'user' | 'contact';\n\tcanEdit: boolean;\n\tsetError: (name: string, error: ErrorOption) => void;\n\tclearErrors: (name?: string | string[] | undefined) => void;\n};\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tpadding: `${theme.spacing(1)} ${theme.spacing(2)}`,\n\t\t'& > div': {\n\t\t\tpaddingLeft: '12px'\n\t\t},\n\t\t'& > .MuiGrid-item': {\n\t\t\t// padding: '8px',\n\t\t\t'& input': {\n\t\t\t\tpadding: '10px 0'\n\t\t\t},\n\t\t\t'& > div > div > div': {\n\t\t\t\tpaddingRight: '8px'\n\t\t\t}\n\t\t},\n\t\t// phone input\n\t\t'& > .MuiGrid-item:nth-child(4)': {\n\t\t\tmarginTop: '16px'\n\t\t}\n\t},\n\tphoneInput: {\n\t\tbackgroundColor: 'inherit',\n\t\tborderTopLeftRadius: '8px',\n\t\tborderTopRightRadius: '8px',\n\t\t'& div': {\n\t\t\tbackgroundColor: 'inherit !important',\n\t\t\tborderTopLeftRadius: '8px',\n\t\t\tborderTopRightRadius: '8px',\n\t\t\ttransition: 'none',\n\t\t\t'& > input': {\n\t\t\t\tbackgroundColor: 'inherit !important',\n\t\t\t\tcolor: '#fff !important',\n\t\t\t\tfontFamily: 'Roboto !important',\n\t\t\t\tfontSize: '14px !important',\n\t\t\t\t// padding: '30px 12px 10px',\n\t\t\t\tborder: 'none',\n\t\t\t\tborderBottom: '1px solid #c5c5c5',\n\t\t\t\tborderTopRightRadius: '8px',\n\t\t\t\t'&:focus': {\n\t\t\t\t\tborderBottom: '1px solid #c5c5c5',\n\t\t\t\t\toutline: 'none'\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t'& > div > div:nth-child(1)': {\n\t\t\t'& > div:nth-child(2)': {\n\t\t\t\tborderRadius: 0\n\t\t\t}\n\t\t},\n\t\t'& .PhoneInputCountry': {\n\t\t\tborderBottom: '1px solid #c5c5c5',\n\t\t\tmarginRight: 0,\n\t\t\tpaddingRight: '8px',\n\t\t\t'& > .PhoneInputCountryIcon': {\n\t\t\t\tborderRadious: '0 !important'\n\t\t\t}\n\t\t},\n\t\t'& .PhoneInput--disabled': {\n\t\t\topacity: 0.5\n\t\t}\n\t}\n}));\n\nconst NotificationRow = ({\n\tcontrol,\n\terrors,\n\tdefaultValues,\n\tbackgroundColor,\n\ttype,\n\tcanEdit,\n\tsetError,\n\tclearErrors\n}: NotificationProps) => {\n\tconst classes = useStyles();\n\tconst { originAddressSend, destinationAddressSend } = useSelector(\n\t\t(state: RootStore) => state.send\n\t);\n\tconst [isActive, setIsActive] = useState(\n\t\t!canEdit ? defaultValues?.active ?? false : type !== 'user'\n\t);\n\t// const [isEdittingPhone, setToggleEdittingPhone] = useState(false);\n\n\tconst phoneFieldName = useMemo(() => `${type}_phone_number`, [type]);\n\tconst phoneFieldValue: string | undefined = useWatch({\n\t\tname: phoneFieldName,\n\t\tcontrol,\n\t\tdefaultValue: defaultValues?.phone_number\n\t\t\t? defaultValues.phone_number\n\t\t\t: type === 'user'\n\t\t\t? originAddressSend?.contact?.phone_number ?? undefined\n\t\t\t: type === 'contact'\n\t\t\t? destinationAddressSend?.contact?.phone_number ?? undefined\n\t\t\t: undefined\n\t});\n\n\tlet matchSendFlow = useRouteMatch('/resumen');\n\t// const phoneMaxLength = useMemo(\n\t// \t() =>\n\t// \t\tphoneField?.charAt(0) === '+'\n\t// \t\t\t? 13\n\t// \t\t\t: phoneField?.charAt(0) === '5' && phoneField?.charAt(1) === '2'\n\t// \t\t\t? 12\n\t// \t\t\t: 10,\n\t// \t[phoneField]\n\t// );\n\n\tuseEffect(() => {\n\t\tif (phoneFieldValue && !isValidPhoneNumber(phoneFieldValue) && isActive && canEdit) {\n\t\t\tsetError(phoneFieldName, {\n\t\t\t\ttype: 'custom',\n\t\t\t\tmessage: 'El teléfono es inválido'\n\t\t\t});\n\t\t} else if (!!errors[phoneFieldName] && errors[phoneFieldName]?.type !== 'custom') {\n\t\t\tsetError(phoneFieldName, {\n\t\t\t\ttype: 'custom',\n\t\t\t\tmessage: errors[phoneFieldName]?.message\n\t\t\t});\n\t\t} else {\n\t\t\tclearErrors && clearErrors(phoneFieldName);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [phoneFieldValue, phoneFieldName, errors, isActive, canEdit]);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t (\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\tonChange(e.target.checked);\n\t\t\t\t\t\t\t\t\tsetIsActive(e.target.checked);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tdisabled={!canEdit}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tdisabled={!canEdit}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tname={`${type}_alias`}\n\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\t\tdefaultValues?.alias\n\t\t\t\t\t\t\t\t? defaultValues.alias\n\t\t\t\t\t\t\t\t: type === 'user'\n\t\t\t\t\t\t\t\t? originAddressSend?.contact?.name ?? null\n\t\t\t\t\t\t\t\t: type === 'contact'\n\t\t\t\t\t\t\t\t? destinationAddressSend?.contact?.name ?? null\n\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t (\n\t\t\t\t\t\t\t option}\n\t\t\t\t\t\t\t\tgetOptionSelected={(option, value) =>\n\t\t\t\t\t\t\t\t\toption.normalize().toLowerCase() === value.normalize().toLowerCase()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\t\tif (!data) return;\n\t\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tdisableClearable\n\t\t\t\t\t\t\t\tdisabled={!canEdit}\n\t\t\t\t\t\t\t\tPaperComponent={(paperProps) => (\n\t\t\t\t\t\t\t\t\t{paperProps.children}\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tname={`${type}_guide_status`}\n\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\trules={isActive ? { required: 'Selecciona un status' } : {}}\n\t\t\t\t\t\tdefaultValue={defaultValues?.guide_status || NotificationStatusOption.DELIVERED}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t\t{/* \n\t\t\t\t\n\t\t\t\t\t (\n\t\t\t\t\t\t\t option}\n\t\t\t\t\t\t\t\tgetOptionSelected={(option, value) =>\n\t\t\t\t\t\t\t\t\toption.normalize().toLowerCase() === value.normalize().toLowerCase()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\t\tif (!data) return;\n\t\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tdisableClearable\n\t\t\t\t\t\t\t\tdisabled={!canEdit}\n\t\t\t\t\t\t\t\tPaperComponent={(paperProps) => (\n\t\t\t\t\t\t\t\t\t{paperProps.children}\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tname={`${type}_shipping_mode`}\n\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\trules={isActive ? { required: 'Selecciona una modalidad' } : {}}\n\t\t\t\t\t\tdefaultValue={defaultValues?.shipping_mode ?? ''}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t */}\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\n\t\t\t\t\t{/* (\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\tonChange(value);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\t\tdefaultValues?.phone_number\n\t\t\t\t\t\t\t\t? defaultValues.phone_number\n\t\t\t\t\t\t\t\t: type === 'user' && originAddressSend?.contact?.type === ContactPhoneType.MOBILE\n\t\t\t\t\t\t\t\t? originAddressSend?.contact?.phone_number ?? null\n\t\t\t\t\t\t\t\t: type === 'contact' &&\n\t\t\t\t\t\t\t\t destinationAddressSend?.contact?.type === ContactPhoneType.MOBILE\n\t\t\t\t\t\t\t\t? destinationAddressSend?.contact?.phone_number ?? null\n\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t}\n\t\t\t\t\t/> */}\n\t\t\t\t
\n\t\t\t
\n\t\t\t{/* {canEdit && (\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tsetToggleEdittingPhone((prev) => !prev);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t)} */}\n\t\t\n\t);\n};\n\nexport default NotificationRow;\n","import React from 'react';\nimport { Grid } from '@mui/material';\nimport { AddressRequest } from '../../store/actions/ActionTypes';\n\ninterface Props {\n\taddress: AddressRequest;\n\twithoutAlias?: boolean;\n}\n\nconst AddressCell: React.FC = (props) => {\n\treturn (\n\t\t\n\t\t\t{!props.withoutAlias &&
{props.address.alias}
}\n\t\t\t
\n\t\t\t\t{props.address.business_name}\n\t\t\t
\n\t\t\t
{props.address.contact?.name}
\n\t\t
\n\t);\n};\n\nexport default AddressCell;\n","type SplitTextIntoLinesOptions = {\n\ttext: string;\n\tmaxCharactersPerLine: number;\n}\n\nexport function splitTextIntoLines({ text, maxCharactersPerLine }: SplitTextIntoLinesOptions): string[] {\n\tif (text === \"\") {\n\t\treturn [\"\"];\n\t}\n\n\tconst EMPTY_SPACE = 1;\n\tconst lines = [] as string[];\n\tconst [first, ...words] = text.split(' ');\n\tlet line = first;\n\n\tif (words.length === 0 && line.length > maxCharactersPerLine) {\n\t\tlet ref = line;\n\t\tline = line.substr(0, maxCharactersPerLine);\n\t\tlines.push(line);\n\t\tline = ref.substr(maxCharactersPerLine, ref.length - maxCharactersPerLine);\n\t}\n\n\tfor (const word of words) {\n\t\t// We hit this case for example with: { text: \"Bodega 09\", maxCharactersPerLine: 5 }\n\t\tif (line.length > maxCharactersPerLine) {\n\t\t\tlet ref = line;\n\t\t\tline = line.substr(0, maxCharactersPerLine);\n\t\t\tlines.push(line);\n\t\t\tline = ref.substr(maxCharactersPerLine, ref.length - maxCharactersPerLine);\n\t\t}\n\n\t\tif ((line.length + word.length + EMPTY_SPACE) <= maxCharactersPerLine) {\n\t\t\tline += ' ' + word;\n\t\t} else {\n\t\t\tlines.push(line);\n\t\t\tline = word;\n\t\t}\n\t}\n\n\tif (line.length > 0) {\n\t\tif (line.length <= maxCharactersPerLine) lines.push(line);\n\t\tif (lines.length === 0) lines.push(\"\");\n\t}\n\n\treturn lines;\n}\n\n\n","import { CSSProperties } from 'react';\n\nexport const HeadingOne = ({\n\ttext,\n\tstyle,\n\tclasses\n}: {\n\ttext: string;\n\tstyle?: CSSProperties;\n\tclasses?: any;\n}) => {\n\treturn (\n\t\t\n\t\t\t{text}\n\t\t

\n\t);\n};\n\nexport const HeadingTwo = ({\n\ttext,\n\tstyle,\n\tclasses\n}: {\n\ttext: string;\n\tstyle?: CSSProperties;\n\tclasses?: any;\n}) => {\n\treturn (\n\t\t\n\t\t\t{text}\n\t\t

\n\t);\n};\n\nexport const TextOne = ({\n\ttext,\n\tstyle,\n\tclasses\n}: {\n\ttext: string;\n\tstyle?: CSSProperties;\n\tclasses?: any;\n}) => {\n\treturn (\n\t\t

\n\t\t\t{text}\n\t\t

\n\t);\n};\n\nexport const TextTwo = ({\n\ttext,\n\tstyle,\n\tclasses\n}: {\n\ttext: string;\n\tstyle?: CSSProperties;\n\tclasses?: any;\n}) => {\n\treturn (\n\t\t

\n\t\t\t{text}\n\t\t

\n\t);\n};\n","// Libraries\nimport { useMemo, useState } from 'react';\nimport { Grid } from '@mui/material';\nimport { DataGrid, GridCellParams, GridColDef } from '@mui/x-data-grid';\n// Hooks\nimport useDocumentsForm from './useDocumentsForm';\nimport { useStyles } from './styles';\n// Components\nimport { HeadingOne, TextOne } from '~components/Headings';\nimport StatusCell from '~components/Tables/_StatusCell';\nimport UploadDocumentBtn from './UploadDocumentBtn';\n// Utils\nimport { getCellStatusColor } from '~util/cellStatusColor';\nimport { DocumentNameType } from '~store/actions/ActionTypes';\nimport { capitalizeAll } from '~util/capitalize';\nimport DocumentDetailModal from '~pages/customer/CreateOrUpdateCustomer/DocumentDetailModal';\nimport { CustomerDocumentType } from '~store/actions/ActionTypes';\nimport GoToDetailIconButton from '~components/Buttons/GoToDetailIconButton';\n\nexport type DocumentFileType = { url: string; type: string; name: string };\n\nexport type DocumentRow = {\n\tstatus: string;\n\ttype?: string;\n\turl: string;\n\tcomment?: string;\n\tname: string;\n};\n\nconst STATUS_REF: { [key: string]: string } = {\n\tapproved: 'Aprobado',\n\tpending: 'Pendiente',\n\trejected: 'Rechazado'\n};\n\nexport const NAME_REF: { [key: string]: string } = {\n\tine: DocumentNameType.INE,\n\ttax: DocumentNameType.TAX,\n\tproof_address: DocumentNameType.PROOF_ADDRESS,\n\tconstitutive_act: DocumentNameType.CONSTITUTIVE_ACT,\n\tassembly_act: DocumentNameType.ASSEMBLY_ACT\n};\n\nconst DocumentsForm = () => {\n\tconst classes = useStyles();\n\n\tconst [files, setFiles] = useState([]);\n\tconst [openDetail, setOpenDetail] = useState(false);\n\tconst [detailDocument, setDetailDocument] = useState>(null);\n\n\tconst { isSubmitting, isLoading, rows } = useDocumentsForm();\n\n\tconst uploadedFiles = useMemo(\n\t\t() => (!!rows ? rows?.filter((item) => !!item?.url)?.length : 0),\n\t\t[rows]\n\t);\n\n\tconst goToDetail = (props: { url: string; description: string; status: string }) => {\n\t\tif (!props.status) return;\n\t\tsetDetailDocument(props);\n\t\tsetOpenDetail(true);\n\t};\n\n\t// Document table columns\n\tconst columns: GridColDef[] = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tfield: 'documents',\n\t\t\t\theaderName: 'Documento',\n\t\t\t\tflex: 1.5,\n\t\t\t\trenderCell: (params: GridCellParams) => (\n\t\t\t\t\t\n\t\t\t\t\t\t\tgoToDetail({\n\t\t\t\t\t\t\t\turl: params.row.url,\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\tNAME_REF[params.row.name] === 'INE'\n\t\t\t\t\t\t\t\t\t\t? NAME_REF[params.row.name]\n\t\t\t\t\t\t\t\t\t\t: capitalizeAll(NAME_REF[params.row.name] ?? ''),\n\t\t\t\t\t\t\t\tstatus: params.row.status\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{NAME_REF[params.row.name] === 'INE'\n\t\t\t\t\t\t\t? NAME_REF[params.row.name]\n\t\t\t\t\t\t\t: capitalizeAll(NAME_REF[params.row.name] ?? '')}\n\t\t\t\t\t\n\t\t\t\t)\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: 'description',\n\t\t\t\theaderName: 'Comentarios',\n\t\t\t\tflex: 1.5,\n\t\t\t\tvalueGetter: (params) => params.row.comment\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: 'status',\n\t\t\t\theaderName: 'Estatus',\n\t\t\t\tflex: 1,\n\t\t\t\talign: 'center',\n\t\t\t\trenderCell: (params: GridCellParams) => (\n\t\t\t\t\t\n\t\t\t\t\t\t{params.row.status ? (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t\n\t\t\t\t)\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: 'actions',\n\t\t\t\theaderName: 'Acciones',\n\t\t\t\tflex: 0.5,\n\t\t\t\trenderCell: (params: GridCellParams) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{!!params.row.status && (\n\t\t\t\t\t\t\t\t\t goToDetail(params.row)} />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t[files]\n\t);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{/* */}\n\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\t props.name}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\n\t);\n};\n\nexport default DocumentsForm;\n","import { Dispatch, SetStateAction, createContext } from 'react';\n\nexport type rdrawstatus = 'INITIAL' | 'MAPS' | 'SUMMARY_ADDRESS' | 'HIDDEN';\nexport type SnackBarMessage = {\n\tmessage: string;\n\tseverity?: 'warning' | 'error' | 'info' | 'success';\n\ttime?: number;\n};\ninterface Params {\n\tmobileLeftDrawerStatus: boolean;\n\ttoggleLeftDrawer: () => void;\n\n\tmobileRigthDrawerStatus: boolean;\n\ttoggleRightDrawer: () => void;\n\n\thelpDialogStatus: boolean;\n\ttoggleHelpDialogStatus: () => void;\n\n\trCardStatus: rdrawstatus;\n\tsetRCardStatus: Dispatch>;\n\n\tnotification: SnackBarMessage;\n\tsetNotification: Dispatch>;\n\n\tshowNotification: boolean;\n\tsetShowNotification: Dispatch>;\n\n\tshowBarLogo: boolean;\n\ttoggleBarLogo: (a: boolean) => void;\n\n\tavailableBalance: number | null;\n\tsetAvailableBalance: Dispatch>;\n}\n\n/**\n * This context defines the status of\n * TopNav\n * Left sidebar\n * Rigth sidebar\n * Rigth Down sidebar\n */\n\nconst DrawContext = createContext({\n\tmobileLeftDrawerStatus: false,\n\tmobileRigthDrawerStatus: false,\n\ttoggleLeftDrawer: () => {},\n\ttoggleRightDrawer: () => {},\n\thelpDialogStatus: false,\n\ttoggleHelpDialogStatus: () => {},\n\trCardStatus: 'HIDDEN',\n\tsetRCardStatus: () => {},\n\tnotification: { message: '' },\n\tsetNotification: () => {},\n\tshowNotification: false,\n\tsetShowNotification: () => {},\n\tshowBarLogo: false,\n\ttoggleBarLogo: () => {},\n\tavailableBalance: null,\n\tsetAvailableBalance: () => {}\n});\n\nexport default DrawContext;\n","import { makeStyles } from '@mui/styles';\n\nconst useStyles = makeStyles((theme) => ({\n\troot: {\n\t\tcolor: theme.palette.white.main,\n\t\tpadding: theme.spacing(3),\n\t\t'&>*': {\n\t\t\tmarginTop: theme.spacing(2)\n\t\t},\n\t\t'& button': {\n\t\t\tcolor: theme.palette.white.main\n\t\t},\n\t\t'& .Mui-selected': {\n\t\t\tbackgroundColor: `${theme.palette.primary.main} !important`\n\t\t}\n\t}\n}));\n\nexport { useStyles };\n","import { useGridApiContext, useGridSelector, gridPageSelector, gridPageCountSelector } from '@mui/x-data-grid'\nimport { Pagination as BasePagination } from '@material-ui/lab'\nimport { useStyles } from './styles'\n\nexport default function Pagination() {\n const apiRef = useGridApiContext();\n const page = useGridSelector(apiRef, gridPageSelector);\n const pageCount = useGridSelector(apiRef, gridPageCountSelector);\n const classes = useStyles()\n\n return (\n apiRef.current.setPage(value - 1)}\n />\n )\n}\n","import { makeStyles } from '@mui/styles';\n\nconst useStyles = makeStyles((theme) => ({\n\troot: {\n\t\tcolor: '#3f403f !important',\n\t\tbackgroundColor: '#E5E5E5 !important',\n\t\tpaddingLeft: theme.spacing(1.75),\n\t\tpaddingRight: theme.spacing(1.75),\n\t\tminWidth: '100px',\n\t\tdisplay: 'flex',\n\t\talignItems: 'center',\n\t\t'&:hover': {\n\t\t\tcolor: '#4EC0DF'\n\t\t},\n\t\t'& svg': {\n\t\t\tmarginBottom: '2px'\n\t\t},\n\t\t'&:disabled': {\n\t\t\tcolor: 'grey',\n\t\t\topacity: 0.9\n\t\t}\n\t},\n\tlabel: {\n\t\tmarginLeft: '6px'\n\t}\n}));\n\nexport { useStyles };\n","import { Button, ButtonProps, CircularProgress, Tooltip } from '@mui/material';\nimport { Plus } from 'react-feather';\nimport { useDispatch } from 'react-redux';\nimport { useHistory } from 'react-router';\nimport useWalletStore from '~store/WalletStore';\nimport { useStyles } from './styles';\nimport { resetFlow } from '~store/actions';\nimport { shallow } from 'zustand/shallow';\nimport { ReactElement } from 'react';\n\ninterface Props extends ButtonProps {\n\tredirectTo: string;\n\tonClick?: () => void;\n\tlabel?: string;\n\tisLoading?: boolean;\n\tdisabled?: boolean;\n\tdisabledTooltip?: string;\n\ticon?: ReactElement;\n}\n\nexport default function AddButton({\n\tredirectTo,\n\tonClick,\n\tlabel,\n\tisLoading,\n\tdisabled,\n\tdisabledTooltip,\n\ticon,\n\t...props\n}: Props) {\n\tconst classes = useStyles();\n\tconst history = useHistory();\n\tconst dispatch = useDispatch();\n\n\tconst [isPreinvoicesEditing, setIsPreinvoicesEditing, setIsEditing, isEditing] = useWalletStore(\n\t\t(state) => [\n\t\t\tstate.isPreinvoicesEditing,\n\t\t\tstate.setIsPreinvoicesEditing,\n\t\t\tstate.setIsEditing,\n\t\t\tstate.isEditing\n\t\t],\n\t\tshallow\n\t);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t {\n\t\t\t\t\t\t\t\t\tisEditing && setIsEditing(false);\n\t\t\t\t\t\t\t\t\tisPreinvoicesEditing && setIsPreinvoicesEditing(false);\n\t\t\t\t\t\t\t\t\thistory.push(redirectTo);\n\t\t\t\t\t\t\t\t\tdispatch(resetFlow());\n\t\t\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\tvariant='contained'\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t// {...props}\n\t\t\t\t>\n\t\t\t\t\t{isLoading ? (\n\t\t\t\t\t\t\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{icon ? icon : }\n\t\t\t\t\t\t\t{label ? label : 'Nuevo'}\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import { create } from 'zustand';\nimport { Option } from '~components/Forms/Select';\nimport {\n\tNewBusiness,\n\tDispersionService,\n\tAvailableService,\n\tDispersionPurchaseType\n} from '~store/actions/ActionTypes';\n\ntype CreateDispersion = {\n\tid?: string;\n\tservices: DispersionService[];\n\tbusiness?: NewBusiness;\n\tpayment_method?: string;\n\tpayment_type?: string;\n\tcfdi_use?: string;\n\ttax_regimen?: string;\n\torder?: string;\n\tcfdi_use_description?: string;\n};\n\nexport type ServiceCharge = {\n\tid: number;\n\tcarrier: string;\n\ttype: string;\n\tdescription: string;\n\tprice?: number;\n\tquantity: number;\n\tiva: number;\n};\n\nexport type AdditionalCharge = {\n\tid: number;\n\tprice: number;\n\tquantity: number;\n};\n\ntype DispersionState = {\n\tdispersion: CreateDispersion;\n\tsetDispersion: (dispersion: CreateDispersion) => void;\n\tsetServices: (services: DispersionService[]) => void;\n\taddService: (service: DispersionService) => void;\n\tsetServiceQuantity: (serviceId: number, quantity: number) => void;\n\tsetServicePrice: (serviceId: number, price: number) => void;\n\tdeleteServiceSelected: (serviceId: number) => void;\n\tsetBusiness: (business?: NewBusiness) => void;\n\tpaymentMethod?: string;\n\tsetPaymentMethod: (paymentMethod: string) => void;\n\tpaymentType?: string;\n\tsetPaymentType: (paymentType: string) => void;\n\tcfdiUse?: string;\n\tsetCfdiUse: (cfdiUse: string) => void;\n\tcfdiUseDescription?: string;\n\tsetCfdiDescription: (cfdiUseDescription: string) => void;\n\tsetTaxRegimen: (taxRegimen: string) => void;\n\tcarrier?: Option | null;\n\tsetCarrier: (carrier: Option | null) => void;\n\tcustomerServices: AvailableService[];\n\tsetCustomerServices: (customerServices: AvailableService[]) => void;\n\tavailableServices: AvailableService[];\n\tsetServicesAvailable: (availableServices: AvailableService[]) => void;\n\tprices: RateConfig[];\n\tsetPrices: (prices: RateConfig[]) => void;\n\tcustomerId?: number;\n\tsetCustomerId: (customerID: number | undefined) => void;\n\tsetOrder: (order: string) => void;\n\tsetId: (id: string) => void;\n\ttype?: DispersionPurchaseType;\n\tsetType: (newType: DispersionPurchaseType) => void;\n\tservicesChargesOptionList: ServiceCharge[];\n\tsetServicesChargesOptionList: (servicesCharges: ServiceCharge[]) => void;\n\tsetAdditionalCharges: (additionalCharge: ServiceCharge[] | []) => void;\n\tadditionalCharges: ServiceCharge[] | [];\n\taddAdditionalCharge: (additionalCharge: ServiceCharge) => void;\n\tupdateAdditionalCharge: ({\n\t\tchargeId,\n\t\tprice,\n\t\tquantity,\n\t\tiva\n\t}: {\n\t\tchargeId: number;\n\t\tprice: number;\n\t\tquantity: number;\n\t\tiva: number;\n\t}) => void;\n\tremoveAdditionalCharge: (chargeId: number) => void;\n};\n\nexport const usePurchaseStore = create((set) => ({\n\tdispersion: {\n\t\tservices: []\n\t},\n\tcustomerServices: [],\n\tavailableServices: [],\n\tprices: [],\n\tservicesChargesOptionList: [],\n\tadditionalCharges: [],\n\tsetDispersion: (dispersion) => set({ dispersion }),\n\tsetCarrier: (carrier) =>\n\t\tset((state) => ({\n\t\t\tcarrier: carrier\n\t\t})),\n\tsetServicesAvailable: (availableServices) =>\n\t\tset((state) => ({\n\t\t\tavailableServices\n\t\t})),\n\tsetServices: (services) =>\n\t\tset((state) => ({\n\t\t\tdispersion: {\n\t\t\t\t...state.dispersion,\n\t\t\t\tservices\n\t\t\t}\n\t\t})),\n\tsetPrices: (prices) =>\n\t\tset((state) => ({\n\t\t\tprices\n\t\t})),\n\taddService: (service) =>\n\t\tset((state) => ({\n\t\t\tdispersion: {\n\t\t\t\t...state.dispersion,\n\t\t\t\tservices: [...state.dispersion.services, service]\n\t\t\t}\n\t\t})),\n\tdeleteServiceSelected: (serviceId) =>\n\t\tset((state) => ({\n\t\t\tdispersion: {\n\t\t\t\t...state.dispersion,\n\t\t\t\tservices: state.dispersion.services.filter((service) => service.id !== serviceId)\n\t\t\t}\n\t\t})),\n\tsetServiceQuantity: (serviceId, quantity) =>\n\t\tset((state) => ({\n\t\t\tdispersion: {\n\t\t\t\t...state.dispersion,\n\t\t\t\tservices: state.dispersion.services.map((service) => {\n\t\t\t\t\tif (service.id === serviceId) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...service,\n\t\t\t\t\t\t\toriginal_quantity: quantity\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\treturn service;\n\t\t\t\t})\n\t\t\t}\n\t\t})),\n\tsetServicePrice: (serviceId, price) =>\n\t\tset((state) => ({\n\t\t\tdispersion: {\n\t\t\t\t...state.dispersion,\n\t\t\t\tservices: state.dispersion.services.map((service) => {\n\t\t\t\t\tif (service.id === serviceId) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...service,\n\t\t\t\t\t\t\tprice\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\treturn service;\n\t\t\t\t})\n\t\t\t}\n\t\t})),\n\tsetCustomerId: (customerId) =>\n\t\tset((state) => ({\n\t\t\tcustomerId\n\t\t})),\n\tsetBusiness: (business) => {\n\t\tset((state) => ({\n\t\t\tdispersion: {\n\t\t\t\t...state.dispersion,\n\t\t\t\tbusiness\n\t\t\t}\n\t\t}));\n\t\tif (!business) {\n\t\t\tset((_) => ({\n\t\t\t\tpaymentType: undefined,\n\t\t\t\tpaymentMethod: undefined,\n\t\t\t\tcfdiUse: undefined,\n\t\t\t\tcfdiUseDescription: undefined\n\t\t\t}));\n\t\t}\n\t},\n\tpaymentMethod: undefined,\n\tsetPaymentMethod: (paymentMethod) =>\n\t\tset((state) => ({\n\t\t\tpaymentMethod\n\t\t})),\n\tpaymentType: undefined,\n\tsetPaymentType: (paymentType) =>\n\t\tset((state) => ({\n\t\t\tpaymentType\n\t\t})),\n\tcfdiUse: undefined,\n\tsetCfdiUse: (cfdiUse) =>\n\t\tset((state) => ({\n\t\t\tcfdiUse\n\t\t})),\n\tcfdiUseDescription: undefined,\n\tsetCfdiDescription: (cfdiUseDescription) =>\n\t\tset((state) => ({\n\t\t\tcfdiUseDescription\n\t\t})),\n\tsetTaxRegimen: (taxRegimen) =>\n\t\tset((state) => ({\n\t\t\tdispersion: {\n\t\t\t\t...state.dispersion,\n\t\t\t\ttax_regimen: taxRegimen\n\t\t\t}\n\t\t})),\n\tsetCustomerServices: (customerServices) =>\n\t\tset((state) => ({\n\t\t\tcustomerServices\n\t\t})),\n\tsetOrder: (order) =>\n\t\tset((state) => ({\n\t\t\tdispersion: {\n\t\t\t\t...state.dispersion,\n\t\t\t\torder\n\t\t\t}\n\t\t})),\n\tsetId: (id) =>\n\t\tset((state) => ({\n\t\t\tdispersion: {\n\t\t\t\t...state.dispersion,\n\t\t\t\tid\n\t\t\t}\n\t\t})),\n\tsetType: (type) =>\n\t\tset((state) => ({\n\t\t\ttype: type\n\t\t})),\n\tsetServicesChargesOptionList: (servicesCharges) =>\n\t\tset((state) => ({\n\t\t\tservicesChargesOptionList: servicesCharges\n\t\t})),\n\tsetAdditionalCharges: (additionalCharges) =>\n\t\tset((state) => ({\n\t\t\tadditionalCharges: additionalCharges\n\t\t})),\n\taddAdditionalCharge: (additionalCharge) =>\n\t\tset((state) => ({\n\t\t\tadditionalCharges: [...(state.additionalCharges ?? []), additionalCharge]\n\t\t})),\n\tupdateAdditionalCharge: ({\n\t\tchargeId,\n\t\tprice,\n\t\tquantity,\n\t\tiva\n\t}: {\n\t\tchargeId: number;\n\t\tprice: number;\n\t\tquantity: number;\n\t\tiva: number;\n\t}) =>\n\t\tset((state) => ({\n\t\t\tadditionalCharges: state.additionalCharges?.map((charge) => {\n\t\t\t\tif (charge.id === chargeId) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...charge,\n\t\t\t\t\t\tprice,\n\t\t\t\t\t\tquantity,\n\t\t\t\t\t\tiva\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn charge;\n\t\t\t})\n\t\t})),\n\tremoveAdditionalCharge: (chargeId) =>\n\t\tset((state) => ({\n\t\t\tadditionalCharges: state.additionalCharges?.filter((item) => item.id !== chargeId)\n\t\t}))\n}));\n","export default __webpack_public_path__ + \"static/media/castores-logo.36208d85.jpg\";","export default __webpack_public_path__ + \"static/media/dhl-logo.d2af088f.png\";","export default __webpack_public_path__ + \"static/media/estafeta-logo.dfc788b9.png\";","export default __webpack_public_path__ + \"static/media/fedex-logo.fa21b167.png\";","export default __webpack_public_path__ + \"static/media/grupo-logo.dd895d2b.png\";","export default __webpack_public_path__ + \"static/media/ivoy-logo.26f913cd.png\";","export default __webpack_public_path__ + \"static/media/jr-logo.79135aef.png\";","export default __webpack_public_path__ + \"static/media/odm-logo.c7907f7c.png\";","export default __webpack_public_path__ + \"static/media/planeacion-logo.287273b8.png\";","export default __webpack_public_path__ + \"static/media/potosinos-logo.67e7d47f.png\";","export default __webpack_public_path__ + \"static/media/redpack-logo.34a3ade8.png\";","export default __webpack_public_path__ + \"static/media/tresguerras-logo.7781f590.png\";","export default __webpack_public_path__ + \"static/media/zubut-logo.82bc5eaa.png\";","export default __webpack_public_path__ + \"static/media/happymile-logo.24b3a0f1.svg\";","export default __webpack_public_path__ + \"static/media/paquetexpress-logo.8dd38370.png\";","export default __webpack_public_path__ + \"static/media/logo-dark.039559ab.svg\";","export default __webpack_public_path__ + \"static/media/pitic-logo.5963cd0e.jpg\";","export default __webpack_public_path__ + \"static/media/halcon-logo.bee99a79.png\";","export default __webpack_public_path__ + \"static/media/sendex-logo.3048fbe9.png\";","import castoresLogo from '../assets/carriers/castores-logo.jpg';\nimport dhlLogo from '../assets/carriers/dhl-logo.png';\nimport estafetaLogo from '../assets/carriers/estafeta-logo.png';\nimport fedexLogo from '../assets/carriers/fedex-logo.png';\nimport grupoLogo from '../assets/carriers/grupo-logo.png';\nimport ivoyLogo from '../assets/carriers/ivoy-logo.png';\nimport jrLogo from '../assets/carriers/jr-logo.png';\nimport odmLogo from '../assets/carriers/odm-logo.png';\nimport planeacionLogo from '../assets/carriers/planeacion-logo.png';\nimport potosinosLogo from '../assets/carriers/potosinos-logo.png';\nimport redpackLogo from '../assets/carriers/redpack-logo.png';\nimport tresGuerrasLogo from '../assets/carriers/tresguerras-logo.png';\nimport zubutLogo from '../assets/carriers/zubut-logo.png';\nimport happymileLogo from '../assets/carriers/happymile-logo.svg';\nimport paquetexpress from '../assets/carriers/paquetexpress-logo.png';\nimport encaminoLogoDark from '../assets/logo-dark.svg';\nimport encaminoLogoWhite from '../assets/logo.svg';\nimport planeacionaduanera from '../assets/carriers/planeacion-logo.png';\nimport piticLogo from '../assets/carriers/pitic-logo.jpg';\nimport borzoLogo from '../assets/carriers/borzo-logo.png';\nimport halconLogo from '../assets/carriers/halcon-logo.png';\nimport sendexLogo from '../assets/carriers/sendex-logo.png';\n\nexport const getLogoByCarrierName = (carrier: string) => {\n\tswitch (carrier) {\n\t\tcase 'castores':\n\t\t\treturn castoresLogo;\n\t\tcase 'dhl':\n\t\t\treturn dhlLogo;\n\t\tcase 'estafeta':\n\t\t\treturn estafetaLogo;\n\t\tcase 'fedex':\n\t\t\treturn fedexLogo;\n\t\tcase 'grupo':\n\t\t\treturn grupoLogo;\n\t\tcase 'ivoy':\n\t\t\treturn ivoyLogo;\n\t\tcase 'jr':\n\t\t\treturn jrLogo;\n\t\tcase 'odm':\n\t\t\treturn odmLogo;\n\t\tcase 'planeacion':\n\t\t\treturn planeacionLogo;\n\t\tcase 'potosinos':\n\t\t\treturn potosinosLogo;\n\t\tcase 'redpack':\n\t\t\treturn redpackLogo;\n\t\tcase 'tresguerras':\n\t\t\treturn tresGuerrasLogo;\n\t\tcase 'zubut':\n\t\t\treturn zubutLogo;\n\t\tcase 'encamino-white':\n\t\t\treturn encaminoLogoWhite;\n\t\tcase 'happymile':\n\t\t\treturn happymileLogo;\n\t\tcase 'paquetexpress':\n\t\t\treturn paquetexpress;\n\t\tcase 'planeacionaduanera':\n\t\t\treturn planeacionaduanera;\n\t\tcase 'uber':\n\t\t\treturn encaminoLogoDark;\n\t\tcase 'pitic':\n\t\t\treturn piticLogo;\n\t\tcase 'halcon':\n\t\t\treturn halconLogo;\n\t\tcase 'borzo':\n\t\t\treturn borzoLogo;\n\t\tcase 'sendex':\n\t\t\treturn sendexLogo;\n\t\tdefault:\n\t\t\treturn encaminoLogoDark;\n\t}\n};\n\nexport const getCarrierName = (carrier: string): string => {\n\tswitch (carrier) {\n\t\tcase 'castores':\n\t\t\treturn 'Castores';\n\t\tcase 'dhl':\n\t\t\treturn 'DHL';\n\t\tcase 'estafeta':\n\t\t\treturn 'Estafeta';\n\t\tcase 'fedex':\n\t\t\treturn 'FedEx';\n\t\tcase 'grupo':\n\t\t\treturn 'Grupo';\n\t\tcase 'ivoy':\n\t\t\treturn 'iVoy';\n\t\tcase 'jr':\n\t\t\treturn 'Jr';\n\t\tcase 'odm':\n\t\t\treturn 'odm';\n\t\tcase 'planeacion':\n\t\t\treturn 'planeacion';\n\t\tcase 'planeacionaduanera':\n\t\t\treturn 'Planeación Aduanera';\n\t\tcase 'potosinos':\n\t\t\treturn 'Potosinos';\n\t\tcase 'redpack':\n\t\t\treturn 'Redpack';\n\t\tcase 'tresguerras':\n\t\t\treturn 'Tres Guerras';\n\t\tcase 'zubut':\n\t\t\treturn 'Zubut';\n\t\tcase 'happymile':\n\t\t\treturn 'Happymile';\n\t\tcase 'paquetexpress':\n\t\t\treturn 'Paquetexpress';\n\t\tcase 'uber':\n\t\t\treturn 'UBER';\n\t\tcase 'pitic':\n\t\t\treturn 'Pitic';\n\t\tcase 'radio transportes':\n\t\t\treturn 'Radio Transportes';\n\t\tcase 'rhino':\n\t\t\treturn 'Rhino';\n\t\tcase 'halcon':\n\t\t\treturn 'Halcón';\n\t\tcase 'expressenvios':\n\t\t\treturn 'Express Envíos';\n\t\tcase 'borzo':\n\t\t\treturn 'Borzo';\n\t\tcase 'tiog':\n\t\t\treturn 'Tiog';\n\t\tcase 'sendex':\n\t\t\treturn 'Sendex';\n\t\tcase '':\n\t\t\treturn '';\n\t\tdefault:\n\t\t\treturn 'Encamino';\n\t}\n};\n\nexport enum CARRIERS {\n\tBORZO = 'borzo',\n\tDHL = 'dhl',\n\tESTAFETA = 'estafeta',\n\tEXPRESS = 'expressenvios',\n\tFEDEX = 'fedex',\n\tHALCON = 'halcón',\n\tIVOY = 'ivoy',\n\tJR = 'jr',\n\tPAQUETEXPRESS = 'paquetexpress',\n\tPITIC = 'pitic',\n\tPLANEACION = 'planeacionaduanera',\n\tPOTOSINOS = 'potosinos',\n\tRADIOTRANSPORTES = 'radiotransportes',\n\tREDPACK = 'redpack',\n\tRHINO = 'rhino',\n\tSENDEX = 'sendex',\n\tTIOG = 'tiog',\n\tTRESGUERRAS = 'tresguerras',\n\tUBER = 'uber'\n}\n\nexport const carriersRef = {\n\tDHL: CARRIERS.DHL,\n\tESTAFETA: CARRIERS.ESTAFETA,\n\tFEDEX: CARRIERS.FEDEX,\n\tIVOY: CARRIERS.IVOY,\n\tJR: CARRIERS.JR,\n\tPAQUETEXPRESS: CARRIERS.PAQUETEXPRESS,\n\tPLANEACION: CARRIERS.PLANEACION,\n\tPOTOSINOS: CARRIERS.POTOSINOS,\n\tREDPACK: CARRIERS.REDPACK,\n\tTRESGUERRAS: CARRIERS.TRESGUERRAS,\n\tUBER: CARRIERS.UBER,\n\tPITIC: CARRIERS.PITIC,\n\tRADIOTRANSPORTES: CARRIERS.RADIOTRANSPORTES,\n\tRHINO: CARRIERS.RHINO,\n\tHALCON: CARRIERS.HALCON\n};\n\nexport const MANUAL_CARRIER_LIST = [\n\tCARRIERS.EXPRESS,\n\tCARRIERS.HALCON,\n\tCARRIERS.IVOY,\n\tCARRIERS.JR,\n\tCARRIERS.PITIC,\n\tCARRIERS.PLANEACION,\n\tCARRIERS.POTOSINOS,\n\tCARRIERS.TRESGUERRAS,\n\tCARRIERS.UBER,\n\tCARRIERS.RADIOTRANSPORTES,\n\tCARRIERS.RHINO\n];\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAa8AAAB1CAMAAADOZ57OAAAArlBMVEUASP7///8ARv4AQ/4AO/4AQf4APv4AQv4APf61wP8AOv4AOP4ATf4AN/74+/8/Z/6ftv7g5/9wiP5Gc/4ASv4AM/5sj/7z9f/E0v/2+f/q8P+/zv/W4f/S3P/M1//b5P9hg/5Kdv4tY/52k/5Ebv61xv+ovf+Gov5Xev4gW/4UUv7l7P/J0/9+mf6KpP4jXv6VrP6ar/64yP9jfv5ihP4lVv57l/5vkf84a/6ntP51xG1IAAASXklEQVR4nO1daXfqug4Nju0EApR5CEOZx0OhtHT4/3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4QUeHR67jAzgTkef6m1g/JnSsJoPSbdHp4ekavIohhm6e+9PoHVaaTbyVyVElPgXFTfTyF/haoOVoSSOFAAiG7EHp2Cs/0YdBDSRTXD+IEROeFYXadZBjQ93KAClq++3KoxYHLDpDCGT5APTjdPMU4EJ0nB5KamRJJndtFgQmIUwEfp5hsNjPFVe0oOygEOWHrPisRHkSY+ml+kU+JC0EIVIcP9AQw59dr6j0N2Acv4UpSDSemWTyacRI7dKrmOuPtC1QnNGToz1MDFzmI813jSfQnRSmNxmZGtOFxDDKnSvbWMfLOx08vGYpJ4jhGu7aKmkmJtP0Q8kKvqaTsGn2uiE8m6xtUpoQnieYTzN7Bl8TZHsjC2KVOVUkJQsfLtLp6MJHrFYmsaZ9hafOWm8YSRSOXAQZ0KE+uIvnmRUD0etocvxmVsGEKYvt9hJfEW8asrXHUhCPMrgxRElUNVA7rD2sbqPqlkZ42uP+PLlNl85V5JREERwjfRYg7l+bgR806rU/k6eooFRHk43SuUEfEHWH9ilJzeO3CNDge9Nb1uyPo1kS87X/5kLNVFL0Sle8y02eZHJ6aDd29YH8355u0o6kyHr1y1pTGdBsC10zL+J9XvVYPpuqZ6sH7H1eJ7R35uXdDPj9Z2EjlnVkPkAqtVbt8psn7PD6QOyFl78QM5f4HObTAySlSpcjhqhPsgEbi6r8iI2h2+rDa2qM43B2Hf1mL9qzL56AAjXzm3c8wHAF9eMTh+t1YjG6vV7nue6qaL8nMv/7p7X9VnTz7q4/ePQ773nHAIDPwvmPcsdIYS0/JKlEGoDxKhJ3NO1oc5nC9ePu3+e1tZGFtYjabL5Xf+OEA++n9wcnJOjGTSFwAAAABJRU5ErkJggg==\"","import { forwardRef, ReactElement, Ref, useState, useMemo } from 'react';\nimport { Edit, Trash2 } from 'react-feather';\nimport Slide from '@material-ui/core/Slide';\nimport { TransitionProps } from '@mui/material/transitions';\nimport { Grid, IconButton, Tooltip } from '@mui/material';\n// Components\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\n\nconst Transition = forwardRef(function Transition(\n\tprops: TransitionProps & { children?: ReactElement },\n\tref: Ref\n) {\n\treturn ;\n});\n\ntype Props = {\n\t// Optional to not break the current uses of this component\n\tshowAlert?: boolean;\n\tonDelete?: () => any;\n\tonDeleteText?: string;\n\tdeleteModalMessage?: string;\n\tonEdit?: () => any;\n\tonEditText?: string;\n\ttitle?: string;\n\tbody?: string;\n};\n\nconst MenuActionButton = ({\n\tshowAlert = false,\n\tonDelete,\n\tonEdit,\n\tonDeleteText,\n\tdeleteModalMessage,\n\tonEditText,\n\ttitle,\n\tbody\n}: Props) => {\n\tconst [isOpen, setOpen] = useState(false);\n\tconst onOpen = () => setOpen(true);\n\tconst onClose = () => setOpen(false);\n\tconst deleteText = useMemo(() => onDeleteText || 'Eliminar', [onDeleteText]);\n\tconst editText = useMemo(() => onEditText || 'Editar', [onEditText]);\n\n\tconst del = () => {\n\t\tif (onDelete) {\n\t\t\tonDelete();\n\t\t}\n\t\tonClose();\n\t};\n\n\tconst handleDelete = () => {\n\t\tif (showAlert) {\n\t\t\tonOpen();\n\t\t} else {\n\t\t\tdel();\n\t\t}\n\t};\n\n\tconst handleEdit = () => {\n\t\tif (onEdit) {\n\t\t\tonEdit();\n\t\t}\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{title ?? '¿Estás seguro de cancelar la recolección?'}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{body ??\n\t\t\t\t\t\t\t'La siguiente acción cancelará la recolección de manera definitiva y el transportista no pasara por el o los paquetes indicados. ¿Deseas proceder con esta acción?'}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t{onEdit && (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t{onDelete && (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\n\t\t\n\t);\n};\n\nexport default MenuActionButton;\n","import { PermissionsKey } from '~context/AuthContext';\nimport usePermissions from '~hooks/usePermissions';\n\ntype Props = {\n\tpermission: PermissionsKey;\n\tchildren: React.ReactNode;\n};\n\nconst OnlyIf: React.FC = ({ permission, children }) => {\n\tconst { can } = usePermissions();\n\n\t// @ts-ignore\n\tif (!can(permission)) {\n\t\t// @@@ We can allow maybe for customization in this case. Maybe allow\n\t\t// to pass a component or message in case the user can't perform certain\n\t\t// action on the platform.\n\t\treturn null;\n\t}\n\n\treturn
{children}
;\n};\n\nexport default OnlyIf;\n","import { Theme } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\n\nexport const useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tbackgroundColor: `${theme.palette.background.paper}`,\n\t\t// marginTop: '80px',\n\t\twidth: '100%',\n\t\tborderRadius: '20px 20px 0 0',\n\t\t'& button': {\n\t\t\tborderRadius: 'inherit'\n\t\t},\n\t\t'& > *': {\n\t\t\tflex: 1,\n\t\t\tmaxWidth: 'unset',\n\t\t\tfontWeight: 700,\n\t\t\tjustifySelf: 'flex-start'\n\t\t}\n\t},\n\toption: {\n\t\twidth: 150,\n\t\tborderBottom: 'solid 0.9px rgb(81, 81, 81)',\n\t\tbackgroundColor: `${theme.palette.background.paper}`\n\t},\n\tlabel: {\n\t\tfontSize: 25\n\t},\n\toptionSelected: {\n\t\tborderBottom: `solid 4px ${theme.palette.primary.main}`,\n\t\tbackgroundColor: '#4d4d4d',\n\t\tborderTopLeftRadius: '20px',\n\t\tborderTopRightRadius: '20px'\n\t},\n\ttabBorder: {\n\t\tboxSizing: 'border-box',\n\t\tborderBottom: 'solid 0.9px rgb(81, 81, 81)',\n\t\tpaddingLeft: 0,\n\t\tpaddingRight: 0,\n\t\t'& > span:nth-child(1)': {\n\t\t\twidth: '100%',\n\t\t\tborderRight: '1px solid #505050',\n\t\t\tpadding: '4px 0'\n\t\t}\n\t}\n}));\n","import React, {\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n\tSetStateAction,\n\tDispatch,\n\tuseMemo\n} from 'react';\nimport { useHistory } from 'react-router';\nimport { GridColDef } from '@mui/x-data-grid';\nimport {\n\tCircularProgress,\n\tFormControl,\n\tGrid,\n\tInputLabel,\n\tSelect,\n\tTooltip,\n\tTypography\n} from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport clsx from 'clsx';\nimport ShipmentDetailsModal from '../../Modals/ShipmentDetailsModal/ShipmentDetailsModal';\nimport { ShipmentSendResponse } from '../../../store/actions/ActionTypes';\nimport CarrierService from '../CarrierService';\nimport AddressCell from '../_AddressCell';\nimport TableControls from '../_TableControls';\nimport StatusCell from '../_StatusCell';\nimport { HeadingOne } from '~components/Headings';\n\nimport DataGrid from '~components/Tables/DataGrid';\nimport useLabels from '~hooks/useLabels';\nimport { useCardStyles } from '~hooks/useStyles';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootStore } from '~store/store';\nimport {\n\taddLabelPickup,\n\tresetLabelsPickup,\n\tsetCarrierPickUp,\n\tsetLabelsPickup\n} from '~store/actions';\nimport { getCarrierName } from '~util/logos';\nimport { FollowUpLabelStatus } from '~util/cellStatusColor';\nimport useQuery from '~hooks/useQuery';\nimport AuthContext from '~context/AuthContext';\nimport usePermissions from '~hooks/usePermissions';\n//styles\nimport '../../Tables/DataGrid.css';\nimport { GridSelectionModel } from '@mui/x-data-grid';\n\nconst getColumnsProps = ({\n\thideColumns,\n\thideDate,\n\tserviceDescription,\n\tgetServiceDescription,\n\tfromOrderSummary\n}: {\n\thideColumns: boolean;\n\thideDate?: boolean;\n\tserviceDescription?: string;\n\tgetServiceDescription?: (serviceId: string) => string | null;\n\tfromOrderSummary?: boolean;\n}): GridColDef[] => {\n\tconst columns: GridColDef[] = [\n\t\t{\n\t\t\tfield: 'service',\n\t\t\theaderName: 'Servicio',\n\t\t\tflex: 1,\n\t\t\trenderCell: (params) => {\n\t\t\t\tconst serviceCellDescription = !!params.row.service_description\n\t\t\t\t\t? params.row.service_description\n\t\t\t\t\t: !!serviceDescription\n\t\t\t\t\t? serviceDescription\n\t\t\t\t\t: !hideDate && getServiceDescription\n\t\t\t\t\t? getServiceDescription(params.row.service_id)\n\t\t\t\t\t: '';\n\t\t\t\treturn (\n\t\t\t\t\t\n\t\t\t\t\t\t{serviceCellDescription}\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t},\n\t\t\tvalueGetter: (params) => {\n\t\t\t\treturn params.row.service_description;\n\t\t\t}\n\t\t}\n\t];\n\n\tif (!hideDate && fromOrderSummary) {\n\t\tcolumns.push({\n\t\t\tfield: 'created_at',\n\t\t\theaderName: 'Fecha de creación',\n\t\t\tflex: 1,\n\t\t\trenderCell: (params) => {\n\t\t\t\treturn

{new Date(params.row.created_at).toLocaleString('es')}

;\n\t\t\t}\n\t\t});\n\t}\n\tcolumns.push({\n\t\tfield: 'parcel_number',\n\t\theaderName: 'No. Guía',\n\t\tflex: 1.25\n\t});\n\tcolumns.push({\n\t\tfield: 'origin',\n\t\theaderName: 'Origen',\n\t\tflex: 1,\n\t\trenderCell: (params) => {\n\t\t\treturn ;\n\t\t},\n\t\tvalueGetter: (params) => {\n\t\t\treturn JSON.stringify(params.row.origin);\n\t\t}\n\t});\n\n\tcolumns.push({\n\t\tfield: 'destination',\n\t\theaderName: 'Destino',\n\t\tflex: 1,\n\t\trenderCell: (params) => {\n\t\t\treturn ;\n\t\t},\n\t\tvalueGetter: (params) => {\n\t\t\treturn JSON.stringify(params.row.destination);\n\t\t}\n\t});\n\n\tif (!hideColumns) {\n\t\tcolumns.unshift({\n\t\t\tfield: 'carrier',\n\t\t\theaderName: 'Transportista',\n\t\t\twidth: 140,\n\t\t\trenderCell: (params) => {\n\t\t\t\treturn ;\n\t\t\t}\n\t\t});\n\t}\n\n\tif (!hideColumns) {\n\t\tcolumns.push({\n\t\t\tfield: 'status',\n\t\t\theaderName: 'Estatus',\n\t\t\tflex: 1,\n\t\t\trenderCell: (params) => {\n\t\t\t\treturn ;\n\t\t\t}\n\t\t});\n\t}\n\n\treturn columns;\n};\n// TODO use the Actions Columns\n// {\n// \tfield: 'actions',\n// \theaderName: 'Acciones',\n// \twidth: 120,\n// \tsortable: false,\n// \tdisableClickEventBubbling: true,\n// \trenderCell: (params: GridCellParams) => {\n// \t\t// const onClick = () => {\n// \t\t// \tconst api: GridApi = params.api;\n// \t\t// \tconst fields = api\n// \t\t// \t\t.getAllColumns()\n// \t\t// \t\t.map((c) => c.field)\n// \t\t// \t\t.filter((c) => c !== '__check__' && !!c);\n// \t\t// \tconst thisRow = {};\n\n// \t\t// \tfields.forEach((f) => {\n// \t\t// \t\tthisRow[f] = params.getValue(f);\n// \t\t// \t});\n\n// \t\t// \treturn alert(JSON.stringify(thisRow, null, 4));\n// \t\t// };\n// \t\t//onClick={onClick}\n\n// \t\t// return ;\n// \t\treturn ;\n// \t},\n// },\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tpadding: `${theme.spacing(1)} ${theme.spacing(3)}`,\n\t\t'&>*': {\n\t\t\tmarginTop: theme.spacing(1)\n\t\t}\n\t},\n\ttopSide: {\n\t\t'&>*': {\n\t\t\tmarginLeft: theme.spacing(2.4)\n\t\t}\n\t},\n\terrorMessage: {\n\t\tcolor: '#f44336'\n\t}\n}));\n\ninterface Props {\n\tisPickingUp?: boolean;\n\tisSummaryPickUp?: boolean;\n\tcreatedLabels?: ShipmentSendResponse[];\n\tfromOrderSummary?: boolean;\n\tisEdittingPickup?: boolean;\n\tsetSelectionModelPickUp?: Dispatch>;\n\tselectionModelPickUp?: GridSelectionModel;\n}\n\n/**\n * Table for shipments (Lables)\n */\nconst TableShipmentSend: React.FC = ({\n\tisPickingUp,\n\tisSummaryPickUp,\n\tsetSelectionModelPickUp,\n\tcreatedLabels,\n\tfromOrderSummary,\n\tisEdittingPickup,\n\tselectionModelPickUp\n}) => {\n\tconst classes = useStyles();\n\tconst { cardClasses } = useCardStyles();\n\tconst werePreselectedLabelsAdded = useRef(false);\n\n\tconst [selectionModel, setSelectionModel] = useState([]);\n\n\tconst query = useQuery();\n\tconst history = useHistory();\n\tconst dispatch = useDispatch();\n\tconst { isRootOrAgent } = usePermissions();\n\tconst [parcelNumbers] = useState((query.get('parcel_numbers') || '').split(','));\n\n\tconst { isTouchedPickup, labelsPickup, carrierPickup, addressPickUp } = useSelector(\n\t\t(state: RootStore) => state.pickup\n\t);\n\tconst { simulatedUser, simulatedCustomer } = useSelector(\n\t\t(state: RootStore) => state.simulatedUser\n\t);\n\n\tconst paramsAccordingToFlow = useMemo(\n\t\t() =>\n\t\t\tisPickingUp || isSummaryPickUp\n\t\t\t\t? isRootOrAgent\n\t\t\t\t\t? ['user_id', 'carrier', 'for_pickup']\n\t\t\t\t\t: ['carrier', 'for_pickup']\n\t\t\t\t: [],\n\t\t[isPickingUp, isSummaryPickUp, isRootOrAgent]\n\t);\n\tconst { data, loading, total, onPageChange, page, pageSize, initialFetch } =\n\t\tuseLabels(paramsAccordingToFlow);\n\n\tconst [showDetails, setShowDetails] = useState(false);\n\tconst [SSR, setSSR] = useState(null);\n\tconst [currentRows, setCurrentRows] = useState([]);\n\tconst [currentCarriers, setCurrentCarriers] = useState([]);\n\n\tconst { currentUser } = useContext(AuthContext);\n\tconst { serviceSend, currentPackagesSend } = useSelector((state: RootStore) => state.send);\n\n\tconst getServiceDescription = (serviceId: string) => {\n\t\tconst services = isRootOrAgent ? simulatedUser?.services : currentUser?.services;\n\t\treturn (\n\t\t\tservices?.find((item) =>\n\t\t\t\ttypeof item.id === 'number' ? item.id.toString() === serviceId : item.id === serviceId\n\t\t\t)?.service ?? null\n\t\t);\n\t};\n\n\t// Set data\n\tuseEffect(() => {\n\t\tlet isMounted = true;\n\t\tif (data) {\n\t\t\tlet toSet: ShipmentSendResponse[] = [];\n\n\t\t\t// Make sure we're filtering base on the right follow_up status\n\t\t\tif (labelsPickup.length > 0) {\n\t\t\t\tconst [label] = labelsPickup;\n\t\t\t\ttoSet = data.filter(\n\t\t\t\t\t(d) =>\n\t\t\t\t\t\td.follow_up === FollowUpLabelStatus.REGISTERED && d.origin.state === label.origin.state\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\ttoSet = data.filter((d) => d.follow_up === FollowUpLabelStatus.REGISTERED);\n\t\t\t}\n\n\t\t\tif (addressPickUp) {\n\t\t\t\ttoSet = toSet.filter((d) => d.origin.state === addressPickUp.state);\n\t\t\t}\n\n\t\t\tif (isMounted) {\n\t\t\t\tsetCurrentRows(toSet);\n\t\t\t}\n\t\t}\n\t\treturn () => {\n\t\t\tisMounted = false;\n\t\t};\n\t}, [data, labelsPickup, addressPickUp]);\n\n\tuseEffect(() => {\n\t\tif (!werePreselectedLabelsAdded.current && parcelNumbers.length && currentRows.length > 0) {\n\t\t\twerePreselectedLabelsAdded.current = true;\n\t\t\tfor (const label of currentRows) {\n\t\t\t\tif (parcelNumbers.includes(label.parcel_number)) {\n\t\t\t\t\tdispatch(addLabelPickup(label));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [werePreselectedLabelsAdded, currentRows, parcelNumbers, dispatch]);\n\n\t// Set unique carriers\n\tuseEffect(() => {\n\t\tif (isPickingUp) {\n\t\t\tlet carriers: string[] = [];\n\t\t\tlet services: any[] = [];\n\n\t\t\tif (isRootOrAgent) {\n\t\t\t\tservices = !simulatedUser ? [] : simulatedUser.services;\n\t\t\t} else {\n\t\t\t\tservices = currentUser.services;\n\t\t\t}\n\t\t\tcarriers = services?.map((s) => s.carrier);\n\t\t\tif (carriers) carriers = ['', ...carriers];\n\t\t\tsetCurrentCarriers([...new Set(carriers)]);\n\t\t}\n\t}, [isPickingUp, simulatedUser, currentUser, isRootOrAgent]);\n\n\tuseEffect(() => {\n\t\tconst param = 'for_pickup';\n\t\t// We get the query parameters from the current URL in the browser\n\t\tconst keys = Array.from(query.keys());\n\n\t\t// This case covers for example when go to a page without specifying the pagination param\n\t\t// For example if we go to: /paquetes\n\t\tif (!keys.includes(param)) {\n\t\t\tkeys.push(param);\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!keys.includes('user_id') && simulatedUser?.id && isRootOrAgent) {\n\t\t\tkeys.push('user_id');\n\t\t}\n\n\t\tlet url = keys\n\t\t\t.map((key) => {\n\t\t\t\t// If current key matches the one for this paginator, then we modify it\n\t\t\t\tif (key === param) {\n\t\t\t\t\t// DataGrid works with based-0 index for the pagination, that's why we add 1\n\t\t\t\t\treturn `${key}=true`;\n\t\t\t\t}\n\t\t\t\tif (key === 'user_id' && isRootOrAgent) {\n\t\t\t\t\treturn `${key}=${simulatedUser?.id}`;\n\t\t\t\t}\n\t\t\t\t// If there is other params, we leave as they are\n\t\t\t\treturn `${key}=${query.get(key)}`;\n\t\t\t})\n\t\t\t.join('&');\n\n\t\t// Replace the current url to cause the fetch of the given module\n\t\thistory.replace(`${history.location.pathname}?${url}`);\n\t}, [query, history, simulatedUser?.id, isRootOrAgent]);\n\n\t// FIXME\n\t//https://stackoverflow.com/questions/66158526/programmatically-preselecting-a-row-in-material-uis-data-gridreact\n\t// Since I can not preselect the packages it will be reseted every time\n\t// Only if is not in the summary\n\tuseEffect(() => {\n\t\tif (isPickingUp) {\n\t\t\tdispatch(resetLabelsPickup());\n\t\t\tdispatch(setCarrierPickUp(query.get('carrier') || ''));\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [dispatch, isPickingUp]);\n\n\t// Clear selected labels when carrier changes\n\tuseEffect(() => {\n\t\tif (isPickingUp) {\n\t\t\tdispatch(resetLabelsPickup());\n\t\t}\n\t}, [carrierPickup, dispatch, isPickingUp]);\n\n\tuseEffect(() => {\n\t\tif (!simulatedCustomer && isRootOrAgent) {\n\t\t\tsetCurrentRows([]);\n\t\t\tdispatch(setCarrierPickUp(''));\n\t\t}\n\t}, [setCurrentRows, simulatedCustomer, dispatch, isRootOrAgent]);\n\n\tuseEffect(() => {\n\t\tif (isSummaryPickUp && fromOrderSummary && !!createdLabels?.length) {\n\t\t\tconst labelsList: ShipmentSendResponse[] = [];\n\t\t\tcreatedLabels.forEach((item) => {\n\t\t\t\tlabelsList.push({ ...item, packages: currentPackagesSend });\n\t\t\t});\n\t\t\tdispatch(setLabelsPickup(labelsList));\n\t\t}\n\t}, [isSummaryPickUp, fromOrderSummary, createdLabels, currentPackagesSend, dispatch]);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{!isEdittingPickup && (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t{/* Espacio para un filtro */}\n\t\t\t\t{/* FIXME Get on change */}\n\t\t\t\t{isPickingUp && (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t

Seleccione un transportista

\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tTransportista\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\tdispatch(setCarrierPickUp(e.target.value as string));\n\t\t\t\t\t\t\t\t\t\t\t// TODO refactor this function where the keys are recycled\n\t\t\t\t\t\t\t\t\t\t\tconst keys = Array.from(query.keys());\n\n\t\t\t\t\t\t\t\t\t\t\t// This case covers for example when go to a page without specifying the pagination param\n\t\t\t\t\t\t\t\t\t\t\t// For example if we go to: /paquetes\n\t\t\t\t\t\t\t\t\t\t\tif (!keys.includes('carrier')) {\n\t\t\t\t\t\t\t\t\t\t\t\tkeys.push('carrier');\n\t\t\t\t\t\t\t\t\t\t\t\tkeys.push('status');\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tlet url = keys\n\t\t\t\t\t\t\t\t\t\t\t\t.map((key) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// If current key matches the one for this paginator, then we modify it\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (key === 'carrier') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// DataGrid works with based-0 index for the pagination, that's why we add 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn `carrier=${e.target.value as string}`;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (key === 'status') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn 'followup=Registrado';\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (key === 'user_id') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn `user_id=${simulatedUser?.id}`;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// If there is other params, we leave as they are\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn `${key}=${query.get(key)}`;\n\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t.join('&');\n\n\t\t\t\t\t\t\t\t\t\t\t// Replace the current url to cause the fetch of the given module\n\t\t\t\t\t\t\t\t\t\t\thistory.replace(`${history.location.pathname}?${url}`);\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{currentCarriers.map((option: string) => (\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tHorarios de recolección sujetos a términos y condiciones de servicio de cada\n\t\t\t\t\t\t\t\t\ttransportista. El equipo operativo atenderá su solicitud y se le notificará vía\n\t\t\t\t\t\t\t\t\tcorreo electrónico cuando quede concretada.\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t)}\n\t\t\t\t{/* Search and New */}\n\t\t\t\t{/* TODO filter with the currents filtered by the data grid */}\n\t\t\t\t\n\t\t\t\t\t{!isPickingUp && (\n\t\t\t\t\t\t setCurrentRows(data)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t
\n\n\t\t\t setShowDetails(status)}\n\t\t\t/>\n\n\t\t\t{/* Error message */}\n\t\t\t{isTouchedPickup && isPickingUp && selectionModel.length === 0 && (\n\t\t\t\t\n\t\t\t\t\t

Por favor elija al menos un paquete

\n\t\t\t\t
\n\t\t\t)}\n\n\t\t\t\n\t\t\t\t{isPickingUp && carrierPickup !== '' && (\n\t\t\t\t\t item.user?.id === simulatedUser?.id)\n\t\t\t\t\t\t\t\t: currentRows\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowId={(row) => row.parcel_number}\n\t\t\t\t\t\tautoHeight\n\t\t\t\t\t\tdisableSelectionOnClick\n\t\t\t\t\t\tdisableDensitySelector\n\t\t\t\t\t\tcheckboxSelection\n\t\t\t\t\t\tdisableColumnFilter\n\t\t\t\t\t\tonSelectionModelChange={(newSelectionModel) => {\n\t\t\t\t\t\t\tsetSelectionModel(newSelectionModel);\n\t\t\t\t\t\t\tsetSelectionModelPickUp && setSelectionModelPickUp(newSelectionModel);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tselectionModel={selectionModel}\n\t\t\t\t\t\tfilterModel={{\n\t\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcolumnField: 'carrier',\n\t\t\t\t\t\t\t\t\toperatorValue: 'equals',\n\t\t\t\t\t\t\t\t\tvalue: carrierPickup\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonRowClick={(p) => {\n\t\t\t\t\t\t\tsetSSR(p.row as ShipmentSendResponse);\n\t\t\t\t\t\t\tsetShowDetails(true);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tpaginationMode='server'\n\t\t\t\t\t\tpage={loading ? 0 : page}\n\t\t\t\t\t\trowCount={loading ? 0 : currentRows.length}\n\t\t\t\t\t\tpageSize={pageSize}\n\t\t\t\t\t\tonPageChange={onPageChange}\n\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\trowsPerPageOptions={[pageSize]}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{isEdittingPickup && (\n\t\t\t\t\t item.user?.id === simulatedUser?.id)\n\t\t\t\t\t\t\t\t: currentRows\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowId={(row) => row.parcel_number}\n\t\t\t\t\t\tautoHeight\n\t\t\t\t\t\tdisableSelectionOnClick\n\t\t\t\t\t\tdisableDensitySelector\n\t\t\t\t\t\tcheckboxSelection\n\t\t\t\t\t\tdisableColumnFilter\n\t\t\t\t\t\tonSelectionModelChange={(newSelectionModel) => {\n\t\t\t\t\t\t\tif (!setSelectionModelPickUp || !newSelectionModel.length) return;\n\t\t\t\t\t\t\tsetSelectionModelPickUp(newSelectionModel);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tselectionModel={selectionModelPickUp}\n\t\t\t\t\t\tpaginationMode='server'\n\t\t\t\t\t\tpage={loading ? 0 : page}\n\t\t\t\t\t\trowCount={loading ? 0 : currentRows.length}\n\t\t\t\t\t\tpageSize={pageSize}\n\t\t\t\t\t\tonPageChange={onPageChange}\n\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\trowsPerPageOptions={[pageSize]}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{isSummaryPickUp ? (\n\t\t\t\t\tlabelsPickup.length > 0 ? (\n\t\t\t\t\t\t row.parcel_number}\n\t\t\t\t\t\t\tpageSize={10}\n\t\t\t\t\t\t\trows={labelsPickup ?? []}\n\t\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t) : null}\n\t\t\t\t{!isPickingUp && !isSummaryPickUp && !isEdittingPickup && (\n\t\t\t\t\t {\n\t\t\t\t\t\t\tsetSSR(p.row as ShipmentSendResponse);\n\t\t\t\t\t\t\tsetShowDetails(true);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tgetRowId={(row) => row.parcel_number}\n\t\t\t\t\t\tpaginationMode='server'\n\t\t\t\t\t\tpage={loading ? 0 : page}\n\t\t\t\t\t\trowCount={loading ? 0 : total}\n\t\t\t\t\t\trows={initialFetch ? [] : currentRows}\n\t\t\t\t\t\tpageSize={pageSize}\n\t\t\t\t\t\tonPageChange={onPageChange}\n\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\trowsPerPageOptions={[pageSize]}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\n\t\t
\n\t);\n};\n\nexport default TableShipmentSend;\n","import React, { useEffect, useState, useCallback, useContext } from 'react';\nimport { TextField } from '@mui/material';\nimport axios from '~util/axios';\nimport { Autocomplete } from '@material-ui/lab';\nimport { Controller, Control, FieldErrors } from 'react-hook-form';\nimport DrawContext from '../../context/DrawContext';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\n\nexport const options = [\n\t{ title: 'Atado' },\n\t{ title: 'Bidón' },\n\t{ title: 'Bolsa' },\n\t{ title: 'Bulto' },\n\t{ title: 'Caja' },\n\t{ title: 'Costal' },\n\t{ title: 'Cubeta' },\n\t{ title: 'Garrafa' },\n\t{ title: 'Huacal' },\n\t{ title: 'Pieza' },\n\t{ title: 'Reja' },\n\t{ title: 'Rollo' },\n\t{ title: 'Sobre' },\n\t{ title: 'Tambo' },\n\t{ title: 'Tarima' }\n];\n\ninterface Props {\n\tcontrol: Control;\n\terrors: FieldErrors;\n\tautoFocus?: boolean;\n\tdefaultValue?: string;\n\n\tcallBack?: (t: string) => void;\n\n\tfieldName?: string;\n}\n\ntype SATProducts = {\n\tcode: string;\n\tpackaging: string;\n\tdescription: string;\n\tweight_unit: string;\n};\n\nconst PackageTypeField: React.FC = (props) => {\n\tconst [options, setOptions] = useState([]);\n\n\tconst { setNotification } = useContext(DrawContext);\n\n\tconst getSATTypesCatalog = useCallback(async () => {\n\t\ttry {\n\t\t\tconst SATTypes = await axios.get('api/sat/packagingType');\n\t\t\tsetOptions(SATTypes.data);\n\t\t} catch (error) {\n\t\t\tsetNotification({\n\t\t\t\tmessage: 'Algo salió mal. Por favor contacta al equipo de Encamino',\n\t\t\t\tseverity: 'error'\n\t\t\t});\n\t\t}\n\t}, [setNotification]);\n\n\tuseEffect(() => {\n\t\tgetSATTypesCatalog();\n\t}, [getSATTypesCatalog]);\n\n\treturn (\n\t\t (\n\t\t\t\t option.packaging}\n\t\t\t\t\tgetOptionSelected={(option, value) => option.packaging === value.packaging}\n\t\t\t\t\tstyle={{ width: 136 }}\n\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\tif (props.callBack && data?.packaging) {\n\t\t\t\t\t\t\tprops.callBack(data.packaging);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\tname={props.fieldName ? props.fieldName : 'package_type'}\n\t\t\tcontrol={props.control}\n\t\t\trules={{ required: true }}\n\t\t\tdefaultValue={props.defaultValue ? { packaging: props.defaultValue } : null}\n\t\t/>\n\t);\n};\n\nexport default PackageTypeField;\n","import { create } from 'zustand';\nimport produce from 'immer';\n\ntype ExportedReportQueue = {\n\tid: string;\n\tspreadsheet_id: string;\n\tstatus: string;\n\turl: string;\n\ttype?: string;\n};\n\ninterface ReportExport {\n\treportExports: ExportedReportQueue[];\n\tsetReportExports: (reportExports: ExportedReportQueue) => void;\n\tremoveReportExports: (id: string) => void;\n}\n\nconst useReportExportsStore = create((set) => ({\n\treportExports: [],\n\tsetReportExports: (reportExports) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.reportExports.push(reportExports);\n\t\t\t})\n\t\t),\n\tremoveReportExports: (id) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.reportExports = draft.reportExports.filter(\n\t\t\t\t\t(reportExports) => reportExports.spreadsheet_id !== id\n\t\t\t\t);\n\t\t\t})\n\t\t)\n}));\n\nexport default useReportExportsStore;\n","import { MinDataAddress } from '~components/Forms/MiniAddressFrom';\nimport { NotificationsContactsFields } from '~components/Forms/Notifications/NotificationRow';\nimport { FileImg } from '~store/CreateLabelStore';\n\nexport type ID = number | string;\n\n// Flow\nexport const INIT_FLOW = 'INIT_FLOW';\nexport const RESET_FLOW = 'RESET_FLOW';\nexport const ADD_ADDRESS_IN_FLOW = 'ADD_ADDRESS_IN_FLOW';\n\nexport const FILTER_CARRIER_FLOW = 'FILTER_CARRIER_FLOW';\nexport const SORT_CARRIER_FLOW = 'SORT_CARRIER_FLOW';\nexport const SET_UNIQUE_CARRIER_SERVICES_FLOW = 'SET_UNIQUE_CARRIER_SERVICES_FLOW';\nexport const SET_FILTERED_SERVICES = 'SET_FILTERED_SERVICES';\nexport const DISABLE_GLOBAL_INSURANCE_FLOW = 'DISABLE_GLOBAL_INSURANCE_FLOW';\nexport const ENABLE_GLOBAL_INSURANCE_FLOW = 'ENABLE_GLOBAL_INSURANCE_FLOW';\nexport const SHOW_GLOBAL_INSURANCE_FLOW = 'SHOW_GLOBAL_INSURANCE_FLOW';\nexport const SET_UNINSURABLE_PACKAGES = 'SET_UNINSURABLE_PACKAGES';\nexport const SET_CONTENT_OPTIONS = 'SET_CONTENT_OPTIONS';\n\nexport type Flow = 'send' | 'pickup' | 'rate' | 'cucustomer' | 'multisend' | 'create';\nexport type PayloadPackageRequest =\n\t| { quantity: number }\n\t| { insurance: number }\n\t| { type: string }\n\t| { height: number }\n\t| { width: number }\n\t| { length: number }\n\t| { weight: number }\n\t| { description: string }\n\t| { value: number }\n\t| { product_code: string }\n\t| { currency: string }\n\t| { unit_code: string }\n\t| { content: string }\n\t| { is_irregular_delivery: boolean }\n\t| { measurement: string };\n\nexport type FlowActions =\n\t| { type: typeof INIT_FLOW; flow: Flow }\n\t| { type: typeof RESET_FLOW }\n\t| { type: typeof ADD_ADDRESS_IN_FLOW; for: 'origin' | 'destination' | 'none' }\n\t| {\n\t\t\ttype: typeof FILTER_CARRIER_FLOW;\n\t\t\tfilter: string;\n\t\t\tservices: ServiceResponse[];\n\t }\n\t| { type: typeof SORT_CARRIER_FLOW; sort: number }\n\t| { type: typeof DISABLE_GLOBAL_INSURANCE_FLOW }\n\t| { type: typeof ENABLE_GLOBAL_INSURANCE_FLOW }\n\t| { type: typeof SHOW_GLOBAL_INSURANCE_FLOW; show: boolean }\n\t| { type: typeof SET_UNIQUE_CARRIER_SERVICES_FLOW; carriers: string[] }\n\t| { type: typeof SET_FILTERED_SERVICES; services: ServiceResponse[] }\n\t| { type: typeof SET_UNINSURABLE_PACKAGES; uninsurablePackages: string[] }\n\t| { type: typeof SET_CONTENT_OPTIONS; options: string[] };\n\n//=================================================================================\n// Send\nexport const RESET_SEND = 'RESET_SEND';\nexport const SET_BATCH_ID = 'SET_BATCH_ID';\nexport const SET_RATE_ID = 'SET_RATE_ID';\nexport const SET_FORM_PACKAGES_VALID_SEND = 'SET_FORM_PACKAGES_VALID_SEND';\nexport const SET_ORIGIN_ADDRESS_SEND = 'SET_ORIGIN_ADDRESS_SEND';\nexport const SET_DESTINATION_ADDRESS_SEND = 'SET_DESTINATION_ADDRESS_SEND';\nexport const SWIPE_ADDRESS_SEND = 'SWIPE_ADDRESS_SEND';\nexport const SET_ORIGIN_CONTACT_SEND = 'SET_ORIGIN_CONTACT_SEND';\nexport const SET_DESTINATION_CONTACT_SEND = 'SET_DESTINATION_CONTACT_SEND';\nexport const ADD_PACKAGE_SEND = 'ADD_PACKAGE_SEND';\nexport const REMOVE_PACKAGE_SEND = 'REMOVE_PACKAGE_SEND';\nexport const ADD_MERCHANDISE_PACKAGE_SEND = 'ADD_MERCHANDISE_PACKAGE_SEND';\nexport const SET_SERVICE_SEND = 'SET_SERVICE_SEND';\nexport const CAN_CONTINUE_TO_RATE_SEND = 'CAN_CONTINUE_TO_RATE_SEND';\nexport const CAN_CONTINUE_TO_SUMMARY_SEND = 'CAN_CONTINUE_TO_SUMMARY_SEND';\nexport const TRIGGER_VALIDATE_BEFORE_RATE_SEND = 'TRIGGER_VALIDATE_BEFORE_RATE_SEND';\nexport const UPDATE_COLUMN_PACKAGE_SEND = 'UPDATE_COLUMN_PACKAGE_SEND';\nexport const SET_INSURANCE_ON_SUMMARY = 'SET_INSURANCE_ON_SUMMARY';\nexport const SET_ADDRESS_QUERY = 'SET_ADDRESS_QUERY';\nexport const RESET_SERVICE_SEND = 'RESET_SERVICE_SEND';\nexport const SET_FORMATTED_ADDRESS = 'SET_FORMATTED_ADDRESS';\nexport const SET_ESTAFETA_OUTPUT_TYPE = 'SET_ESTAFETA_OUTPUT_TYPE';\nexport const SET_SAVE_ESTAFETA_OUTPUT_TYPE = 'SET_SAVE_ESTAFETA_OUTPUT_TYPE';\nexport const SET_EXTRA_INFORMATION = 'SET_EXTRA_INFORMATION';\nexport const SET_USE_TRADING = 'SET_USE_TRADING';\nexport const SET_NOTIFICATIONS = 'SET_NOTIFICATIONS';\nexport const RESET_PACKAGES = 'RESET_PACKAGES';\n\nexport type SendActions =\n\t| { type: typeof SET_USE_TRADING; value: 'prepaid' | 'regular' }\n\t| {\n\t\t\ttype: typeof SET_ORIGIN_ADDRESS_SEND;\n\t\t\taddress: AddressRequest | null;\n\t\t\tcontacts: Contact[];\n\t }\n\t| {\n\t\t\ttype: typeof SET_DESTINATION_ADDRESS_SEND;\n\t\t\taddress: AddressRequest | null;\n\t\t\tcontacts: Contact[];\n\t }\n\t| { type: typeof SWIPE_ADDRESS_SEND }\n\t| { type: typeof SET_ORIGIN_CONTACT_SEND; contact: Contact | null }\n\t| { type: typeof SET_BATCH_ID; batchId: string | null }\n\t| { type: typeof SET_RATE_ID; rateId: string | null }\n\t| { type: typeof SET_DESTINATION_CONTACT_SEND; contact: Contact | null }\n\t| { type: typeof ADD_PACKAGE_SEND; pkg: Package }\n\t| { type: typeof ADD_MERCHANDISE_PACKAGE_SEND; pkg_id: ID; payload: Merchandise }\n\t| { type: typeof REMOVE_PACKAGE_SEND; id: ID }\n\t| {\n\t\t\ttype: typeof UPDATE_COLUMN_PACKAGE_SEND;\n\t\t\tpkg_id: ID;\n\t\t\tpayload: PayloadPackageRequest;\n\t\t\tmerchandiseId?: string;\n\t }\n\t| { type: typeof SET_SERVICE_SEND; service: ServiceRequest }\n\t| { type: typeof CAN_CONTINUE_TO_RATE_SEND }\n\t| { type: typeof CAN_CONTINUE_TO_SUMMARY_SEND }\n\t| { type: typeof TRIGGER_VALIDATE_BEFORE_RATE_SEND; status: boolean }\n\t| { type: typeof RESET_SEND }\n\t| { type: typeof RESET_SERVICE_SEND }\n\t| { type: typeof SET_FORM_PACKAGES_VALID_SEND; status: boolean }\n\t| { type: typeof SET_INSURANCE_ON_SUMMARY; status: boolean }\n\t| { type: typeof SET_FORMATTED_ADDRESS; destination: any; origin: any }\n\t| {\n\t\t\ttype: typeof SET_ADDRESS_QUERY;\n\t\t\tquery: string | null;\n\t\t\ttarget: 'origin' | 'destination';\n\t }\n\t| { type: typeof SET_ESTAFETA_OUTPUT_TYPE; outputType: string | null }\n\t| {\n\t\t\ttype: typeof SET_EXTRA_INFORMATION;\n\t\t\treference: string;\n\t\t\tadditionalInfo: string;\n\t\t\tbusiness?: NewBusiness;\n\t\t\tchannel?: Channel;\n\t }\n\t| { type: typeof SET_SAVE_ESTAFETA_OUTPUT_TYPE; save: boolean }\n\t| { type: typeof SET_NOTIFICATIONS; notifications: NotificationContacts }\n\t| { type: typeof RESET_PACKAGES };\n\n//=================================================================================\n// MultiSend\nexport const SET_CARRIER_MULTISEND = 'SET_CARRIER_MULTISEND';\nexport const SET_SERVICE_MULTISEND = 'SET_SERVICE_MULTISEND';\nexport const RESET_MULTISEND = 'RESET_MULTISEND';\n\nexport type MultiSendActions =\n\t| { type: typeof SET_CARRIER_MULTISEND; carrier: string | null }\n\t| { type: typeof SET_SERVICE_MULTISEND; service: string | null }\n\t| { type: typeof RESET_MULTISEND };\n\n//=================================================================================\n// Pickup\nexport const FETCH_PICKUPS = 'FETCH_PICKUPS';\nexport const SET_PICKUP_DETAILS = 'SET_PICKUP_DETAILS';\nexport const UPDATE_PICKUP_DETAILS = 'UPDATE_PICKUP_DETAILS';\nexport const UPDATE_PICKUP = 'UPDATE_PICKUP';\nexport const CANCEL_PICKUP = 'CANCEL_PICKUP';\nexport const SET_STATUS_PICKUP = 'SET_STATUS_PICKUP';\nexport const SET_REASON_PICKUP = 'SET_REASON_PICKUP';\nexport const SET_CARRIER_FOLIO_PICKUP = 'SET_CARRIER_FOLIO_PICKUP';\nexport const CAN_CONTINUE_TO_EDIT_PICKUP = 'CAN_CONTINUE_TO_EDIT_PICKUP';\nexport const RESET_PICKUP = 'RESET_PICKUP';\nexport const SET_ADDRESS_PICKUP = 'SET_ADDRESS_PICKUP';\nexport const SET_CONTACT_PICKUP = 'SET_CONTACT_PICKUP';\nexport const RESET_LABELS_PICKUP = 'RESET_LABELS_PICKUP';\nexport const ADD_LABEL_PICKUP = 'ADD_LABEL_PICKUP';\nexport const SET_LABELS_PICKUP = 'SET_LABELS_PICKUP';\nexport const REMOVE_LABEL_PICKUP = 'REMOVE_LABEL_PICKUP';\nexport const SET_INDICATIONS_PICKUP = 'SET_INDICATIONS_PICKUP';\nexport const SET_EXTRA_INDICATIONS_PICKUP = 'SET_EXTRA_INDICATIONS_PICKUP';\nexport const SET_DATE_PICKUP = 'SET_DATE_PICKUP';\nexport const SET_TIME_PICKUP = 'SET_TIME_PICKUP';\nexport const TRIGGER_VALIDATE_BEFORE_SUMMARY_PICKUP = 'TRIGGER_VALIDATE_BEFORE_SUMMARY_PICKUP';\nexport const CAN_CONTINUE_TO_SUMMARY_PICKUP = 'CAN_CONTINUE_TO_SUMMARY_PICKUP';\nexport const SET_CARRRIER_PICKUP = 'SET_CARRRIER_PICKUP';\nexport const CAN_MOVE_TO_BOOKLET_PICKUP = 'CAN_MOVE_TO_BOOKLET_PICKUP';\nexport const SET_INSURANCE_FOR_PICKUP = 'SET_INSURANCE_FOR_PICKUP';\nexport const SET_PICKUP_SUPERVISOR = 'SET_PICKUP_SUPERVISOR';\nexport const SET_PICKUP_NOTES = 'SET_PICKUP_NOTES';\n\nexport type PickUpActions =\n\t| { type: typeof RESET_PICKUP }\n\t| {\n\t\t\ttype: typeof SET_ADDRESS_PICKUP;\n\t\t\taddress: AddressRequest | null;\n\t\t\tcontacts: Contact[];\n\t }\n\t| { type: typeof SET_CONTACT_PICKUP; contact: Contact | null }\n\t| { type: typeof ADD_LABEL_PICKUP; label: ShipmentSendResponse }\n\t| { type: typeof SET_LABELS_PICKUP; labels: ShipmentSendResponse[] }\n\t| { type: typeof REMOVE_LABEL_PICKUP; id: ID }\n\t| { type: typeof SET_STATUS_PICKUP; status: string }\n\t| { type: typeof SET_REASON_PICKUP; reason: string }\n\t| { type: typeof SET_CARRIER_FOLIO_PICKUP; carrierFolio: string }\n\t| { type: typeof SET_PICKUP_SUPERVISOR; pickupSupervisor: string }\n\t| { type: typeof SET_PICKUP_NOTES; pickupNotes: string }\n\t| { type: typeof CAN_CONTINUE_TO_EDIT_PICKUP; isAgent: boolean }\n\t| { type: typeof SET_INDICATIONS_PICKUP; indications: string }\n\t| { type: typeof SET_EXTRA_INDICATIONS_PICKUP; extra_indications: string }\n\t| { type: typeof SET_DATE_PICKUP; date: Date | null }\n\t| { type: typeof SET_TIME_PICKUP; time: Date | null; target: 'start' | 'end' }\n\t| { type: typeof TRIGGER_VALIDATE_BEFORE_SUMMARY_PICKUP; status: boolean }\n\t| { type: typeof CAN_CONTINUE_TO_SUMMARY_PICKUP }\n\t| { type: typeof RESET_LABELS_PICKUP }\n\t| { type: typeof SET_CARRRIER_PICKUP; carrier: string }\n\t| { type: typeof FETCH_PICKUPS; pickups: ShipmentPickUpResponse[] }\n\t| { type: typeof CANCEL_PICKUP; id: ID }\n\t| { type: typeof UPDATE_PICKUP; pickup: ShipmentPickUpResponse }\n\t| { type: typeof CAN_MOVE_TO_BOOKLET_PICKUP; value: boolean }\n\t| { type: typeof SET_PICKUP_DETAILS; id: ID; details: PickUpLabelDetails }\n\t| {\n\t\t\ttype: typeof UPDATE_PICKUP_DETAILS;\n\t\t\tid: ID;\n\t\t\tlabels: ShipmentSendResponse[];\n\t }\n\t| {\n\t\t\ttype: typeof SET_INSURANCE_FOR_PICKUP;\n\t\t\tinsuranceForOrder: boolean;\n\t };\n\n//==============================================================================\n// Rate\nexport const SET_DESTINATION_ADDRESS_RATE = 'SET_DESTINATION_ADDRESS_RATE';\nexport const SET_ORIGIN_ADDRESS_RATE = 'SET_ORIGIN_ADDRESS_RATE';\nexport const RESET_RATE = 'RESET_RATE';\nexport const ADD_PACKAGE_RATE = 'ADD_PACKAGE_RATE';\nexport const REMOVE_PACKAGE_RATE = 'REMOVE_PACKAGE_RATE';\nexport const UPDATE_COLUMN_PACKAGE_RATE = 'UPDATE_COLUMN_PACKAGE_RATE';\nexport const TRIGGER_VALIDATE_BEFORE_RATE_RATE = 'TRIGGER_VALIDATE_BEFORE_RATE_RATE';\nexport const CAN_CONTINUE_TO_RATE_RATE = 'CAN_CONTINUE_TO_RATE_RATE';\nexport const SET_FORM_PACKAGES_VALID_RATE = 'SET_FORM_PACKAGES_VALID_RATE';\nexport const TOGGLE_ORIGIN_ADDRESS_COMPONENT = 'TOGGLE_ORIGIN_ADDRESS_COMPONENT';\nexport const TOGGLE_DESTINATION_ADDRESS_COMPONENT = 'TOGGLE_DESTINATION_ADDRESS_COMPONENT';\n\nexport type RateActions =\n\t| { type: typeof ADD_PACKAGE_RATE; pkg: Package }\n\t| { type: typeof REMOVE_PACKAGE_RATE; id: ID }\n\t| {\n\t\t\ttype: typeof UPDATE_COLUMN_PACKAGE_RATE;\n\t\t\tid: ID;\n\t\t\tpayload: PayloadPackageRequest;\n\t }\n\t| {\n\t\t\ttype: typeof SET_DESTINATION_ADDRESS_RATE;\n\t\t\taddress: AddressRequest | null;\n\t }\n\t| { type: typeof TOGGLE_DESTINATION_ADDRESS_COMPONENT }\n\t| { type: typeof TOGGLE_ORIGIN_ADDRESS_COMPONENT }\n\t| { type: typeof SET_ORIGIN_ADDRESS_RATE; address: AddressRequest | null }\n\t| { type: typeof RESET_RATE }\n\t| { type: typeof TRIGGER_VALIDATE_BEFORE_RATE_RATE; status: boolean }\n\t| { type: typeof CAN_CONTINUE_TO_RATE_RATE }\n\t| { type: typeof SET_FORM_PACKAGES_VALID_RATE; status: boolean };\n\n//==============================================================================\n// Create\nexport const SET_DESTINATION_ADDRESS_CREATE = 'SET_DESTINATION_ADDRESS_CREATE';\nexport const SET_ORIGIN_ADDRESS_CREATE = 'SET_ORIGIN_ADDRESS_CREATE';\nexport const RESET_CREATE = 'RESET_CREATE';\nexport const ADD_PACKAGE_CREATE = 'ADD_PACKAGE_CREATE';\nexport const REMOVE_PACKAGE_CREATE = 'REMOVE_PACKAGE_CREATE';\nexport const UPDATE_COLUMN_PACKAGE_CREATE = 'UPDATE_COLUMN_PACKAGECREATEE';\nexport const TRIGGER_VALIDATE_BEFORE_CREATE_CREATE = 'TRIGGER_VALIDATE_BEFORE_CREATE_CREATE';\nexport const CAN_CONTINUE_TO_CREATE_CREATE = 'CAN_CONTINUE_TO_CREATE_CREATE';\nexport const SET_FORM_PACKAGES_VALID_CREATE = 'SET_FORM_PACKAGES_VALID_CREATE';\nexport const SET_ORIGIN_CONTACT_CREATE = 'SET_ORIGIN_CONTACT_CREATE';\nexport const SET_DESTINATION_CONTACT_CREATE = 'SET_DESTINATION_CONTACT_CREATE';\nexport const CAN_CONTINUE_TO_RATE_CREATE = 'CAN_CONTINUE_TO_RATE_CREATE';\n\nexport type CreateActions =\n\t| { type: typeof ADD_PACKAGE_CREATE; pkg: Package }\n\t| { type: typeof REMOVE_PACKAGE_CREATE; id: ID }\n\t| {\n\t\t\ttype: typeof UPDATE_COLUMN_PACKAGE_CREATE;\n\t\t\tid: ID;\n\t\t\tpayload: PayloadPackageRequest;\n\t }\n\t| { type: typeof TOGGLE_DESTINATION_ADDRESS_COMPONENT }\n\t| { type: typeof TOGGLE_ORIGIN_ADDRESS_COMPONENT }\n\t| {\n\t\t\ttype: typeof SET_ORIGIN_ADDRESS_CREATE;\n\t\t\taddress: AddressRequest | null;\n\t\t\tcontacts: Contact[];\n\t }\n\t| {\n\t\t\ttype: typeof SET_DESTINATION_ADDRESS_CREATE;\n\t\t\taddress: AddressRequest | null;\n\t\t\tcontacts: Contact[];\n\t }\n\t| { type: typeof RESET_CREATE }\n\t| { type: typeof CAN_CONTINUE_TO_RATE_SEND }\n\t| { type: typeof TRIGGER_VALIDATE_BEFORE_CREATE_CREATE; status: boolean }\n\t| { type: typeof CAN_CONTINUE_TO_CREATE_CREATE }\n\t| { type: typeof SET_FORM_PACKAGES_VALID_CREATE; status: boolean };\n\n//==============================================================================\n// Consolidated\n\nexport const RESET_CONSOLIDATED = 'RESET_CONSOLIDATED';\nexport const CANCEL_CONSOLIDATED = 'CANCEL_CONSOLIDATED';\nexport const START_CONSOLIDATED = 'START_CONSOLIDATED';\nexport const SET_CARRIERS_CONSOLIDATED = 'SET_CARRIERS_CONSOLIDATED';\nexport const SET_CONSOLIDATED_ORIGIN_FORM = 'SET_CONSOLIDATED_ORIGIN_FORM';\nexport const SET_CONSOLIDATED_DESTINATION_FORM = 'SET_CONSOLIDATED_DESTINATION_FORM';\nexport const SET_CONSOLIDATED_SPECIALS = 'SET_CONSOLIDATED_SPECIALS';\nexport const TRIGGER_VALIDATE_BEFORE_CONSOLIDATED = 'TRIGGER_VALIDATE_BEFORE_CONSOLIDATED';\nexport const SET_OPTION_CONSOLIDATED = 'SET_OPTION_CONSOLIDATED';\n//export const POST_CONSOLIDATE = 'POST_CONSOLIDATE';\nexport const SET_PICK_UP_CONSOLIDATED = 'SET_PICK_UP_CONSOLIDATED';\nexport const SET_DELIVER_CONSOLIDATED = 'SET_DELIVER_CONSOLIDATED';\n\nexport type ConsolidatedActions =\n\t| { type: typeof RESET_CONSOLIDATED }\n\t| { type: typeof START_CONSOLIDATED }\n\t| { type: typeof CANCEL_CONSOLIDATED }\n\t| { type: typeof SET_CARRIERS_CONSOLIDATED; carriers: string[] }\n\t| { type: typeof SET_CONSOLIDATED_ORIGIN_FORM; form: any }\n\t| { type: typeof SET_CONSOLIDATED_DESTINATION_FORM; form: any }\n\t| { type: typeof SET_CONSOLIDATED_SPECIALS; form: any }\n\t| { type: typeof TRIGGER_VALIDATE_BEFORE_CONSOLIDATED }\n\t| { type: typeof SET_OPTION_CONSOLIDATED; option: ID }\n\t| { type: typeof SET_PICK_UP_CONSOLIDATED; status: boolean }\n\t| { type: typeof SET_DELIVER_CONSOLIDATED; status: boolean };\n//| { type: typeof POST_CONSOLIDATE };\n\n//==============================================================================\n// Data\nexport const FETCH_ADDRESSES_DATA = 'FETCH_ADDRESSES_DATA';\nexport const FETCH_PACKAGES_DATA = 'FETCH_PACKAGES_DATA';\n\nexport const ADD_ADDRESS_DATA = 'ADD_ADDRESS_DATA';\nexport const ADD_PACKAGE_TEMP_DATA = 'ADD_PACKAGE_TEMP_DATA';\nexport const EDIT_PACKAGE_TEMP_DATA = 'EDIT_PACKAGE_TEMP_DATA';\nexport const CLEAR_ADDRESS_DATA = 'CLEAR_ADDRESS_DATA';\n\nexport const REMOVE_PACKAGE = 'REMOVE_PACKAGE';\n\nexport const FETCH_SUCCESS_DATA = 'FETCH_SUCCESS_DATA';\nexport const FETCH_INIT_DATA = 'FETCH_INIT_DATA';\nexport const FETCH_FAIL_DATA = 'FETCH_FAIL_DATA';\nexport const CLEAR_ERROR_FETCH_DATA = 'CLEAR_ERROR_FETCH_DATA';\n\nexport const POST_RATE_DATA = 'POST_RATE_DATA';\nexport const POST_GUIDE_DATA = 'POST_GUIDE_DATA';\nexport const POST_PICKUP_DATA = 'POST_PICKUP_DATA';\nexport const CLEAR_SERVICES_DATA = 'CLEAR_SERVICES_DATA';\nexport const CLEAR_PARCEL_NUMBERS = 'CLEAR_PARCEL_NUMBERS';\n\nexport const FETCH_BUSINESS_DATA = 'FETCH_BUSINESS_DATA';\n\nexport const SET_CARRIERS = 'SET_CARRIERS';\n\nexport type CreatedLabel = {\n\tpdf: string;\n\tparcelNumber: string;\n};\n\nexport type DataActions =\n\t| { type: typeof FETCH_ADDRESSES_DATA; addresses: NewAddress[] }\n\t| { type: typeof FETCH_PACKAGES_DATA; packages: Package[] }\n\t| { type: typeof ADD_ADDRESS_DATA; address: NewAddress }\n\t| { type: typeof ADD_PACKAGE_TEMP_DATA; package: Package }\n\t| { type: typeof CLEAR_ADDRESS_DATA }\n\t| { type: typeof EDIT_PACKAGE_TEMP_DATA; package: Package }\n\t| { type: typeof FETCH_SUCCESS_DATA }\n\t| { type: typeof CLEAR_PARCEL_NUMBERS }\n\t| { type: typeof FETCH_INIT_DATA }\n\t| { type: typeof FETCH_FAIL_DATA; message: string }\n\t| { type: typeof CLEAR_ERROR_FETCH_DATA }\n\t| { type: typeof POST_RATE_DATA; services: ServiceResponse[] }\n\t| { type: typeof POST_GUIDE_DATA; labels: Array; total: number }\n\t| { type: typeof POST_PICKUP_DATA; response: string }\n\t| { type: typeof CLEAR_SERVICES_DATA }\n\t| { type: typeof REMOVE_PACKAGE; id: ID }\n\t| { type: typeof FETCH_BUSINESS_DATA; business: NewBusiness[] }\n\t| { type: typeof SET_CARRIERS; carriers: CarrierList };\n\n// ===============================================================\n// CreateOrUpdateCustomerActions\n\n// export const SET_GENERAL_INFO_DRAFT_CUCUSTOMER = 'SET_GENERAL_INFO_DRAFT_CUCUSTOMER';\n// export const SET_GENERAL_INFO_VALID_CUCUSTOMER = 'SET_GENERAL_INFO_VALID_CUCUSTOMER';\n// export const SET_ADDRESS_INFO_DRAFT_CUCUSTOMER = 'SET_ADDRESS_INFO_DRAFT_CUCUSTOMER';\n// export const SET_TOUCHED_ADDRESS_CUCUSTOMER = 'SET_TOUCHED_ADDRESS_CUCUSTOMER';\n// export const SET_LEGAL_INFO_DRAFT_CUCUSTOMER = 'SET_LEGAL_INFO_DRAFT_CUCUSTOMER';\n// export const SET_EDITING_ADDRESS_CUCUSTOMER = 'SET_EDITING_ADDRESS_CUCUSTOMER';\n// export const SET_LEGAL_INFO_VALID_CUCUSTOMER = 'SET_LEGAL_INFO_VALID_CUCUSTOMER';\nexport const SET_SERVICES_CUCUSTOMER = 'SET_SERVICES_CUCUSTOMER';\n// export const RESET_CUCUSTOMER = 'RESET_CUCUSTOMER';\n\nexport type CreateOrUpdateCustomerActions =\n\t// \t| { type: typeof SET_GENERAL_INFO_DRAFT_CUCUSTOMER; form: any }\n\t// \t| { type: typeof SET_GENERAL_INFO_VALID_CUCUSTOMER; valid: boolean }\n\t// \t| { type: typeof SET_ADDRESS_INFO_DRAFT_CUCUSTOMER; address: NewAddress }\n\t// \t| { type: typeof SET_TOUCHED_ADDRESS_CUCUSTOMER; touched: boolean }\n\t// \t| { type: typeof SET_LEGAL_INFO_DRAFT_CUCUSTOMER; form: any }\n\t// \t| { type: typeof SET_LEGAL_INFO_VALID_CUCUSTOMER; valid: boolean }\n\t{ type: typeof SET_SERVICES_CUCUSTOMER; services: BookletServiceForm[] };\n// \t| { type: typeof SET_EDITING_ADDRESS_CUCUSTOMER; idCustomer: number; idUser: number }\n// \t| { type: typeof RESET_CUCUSTOMER };\n\n//================================================================\n// Simulated UserForm Actions\n\nexport const SET_SIMULATED_USER = 'SET_SIMULATED_USER';\nexport const SET_SIMULATED_CUSTOMER_SIMULATED_USER = 'SET_SIMULATED_CUSTOMER_SIMULATED_USER';\nexport const RESET_SIMULATED_USER = 'RESET_SIMULATED_USER';\nexport const TRIGGER_ERRORS_SIMULATED_USER = 'TRIGGER_ERRORS_SIMULATED_USER';\nexport const CLEAR_ERROR_SIMULATED_USER = 'CLEAR_ERROR_SIMULATED_USER';\n\nexport type SimulatedUserActions =\n\t| { type: typeof SET_SIMULATED_USER; user: UserDetails | null }\n\t| {\n\t\t\ttype: typeof SET_SIMULATED_CUSTOMER_SIMULATED_USER;\n\t\t\tcustomer: CustomerDetails | null;\n\t }\n\t| { type: typeof TRIGGER_ERRORS_SIMULATED_USER }\n\t| { type: typeof CLEAR_ERROR_SIMULATED_USER }\n\t| { type: typeof RESET_SIMULATED_USER };\n\n//================================================================\n\n/**\n * El interno\n */\nexport type ServiceRequest = {\n\tcarrier: string;\n\tservice_description: string;\n\tservice_id: string;\n\t//TODO add badges\n\tinsurance: number;\n\tcost: number;\n\trate_id: number;\n\tcan_service_be_traded: boolean | undefined;\n\treissue: string;\n\tlabel_price?: number;\n\toverweight_price?: number;\n\treissue_price?: number;\n\tirregular_delivery_price?: number;\n\ttag_irregular_delivery?: string;\n\toffice_list?: ServiceOffice[];\n};\n\n/**\n * El interno\n */\nexport enum ContactPhoneType {\n\tOFFICE = 'Oficina',\n\tMOBILE = 'Móvil',\n\tOTHER = 'Otro'\n}\n\nexport type Contact = {\n\tid?: ID;\n\tname: string;\n\tphone_number: string;\n\ttype_phone_number?: string;\n\textension?: string | null;\n\temail: string;\n\ttype: ContactPhoneType | string;\n\tnotification_info?: NotificationsContactsFields | null;\n};\n\nexport type AddressRequest = {\n\tid: ID;\n\talias?: string;\n\ttype?: string;\n\tnumber: string;\n\tsuite_number: string;\n\tcoordinates: string | { lat: number; lng: number };\n\tcity: string;\n\tcountry: string;\n\treference: string;\n\treference_streets: string;\n\tstreet: string;\n\tstreet1?: string;\n\tstreet2?: string;\n\tstreet3?: string;\n\taddress?: string;\n\tbusiness_name: string;\n\tneighborhood: string;\n\tstate: string;\n\tzip_code: string;\n\tcontact: Contact | null;\n\ttax_id: string;\n\tlatitude?: number;\n\tlongitude?: number;\n\tcontacts?: Contact[];\n\tocurre_office?: string;\n};\n\nexport type NewAddress = {\n\tid: ID; //when fetch\n\tuser_id?: number;\n\taddress?: string; //when fetch\n\tcustomer?: { id: number; name: string };\n\talias: string;\n\tscope: 'user' | 'group' | 'global' | 'Personal'; // Personal works when is temp\n\tcoordinates: string;\n\tstreet: string;\n\tnumber: string | null;\n\tsuite_number?: string | null;\n\tcity: string;\n\tbusiness_name: string;\n\tneighborhood: string;\n\tstate: string;\n\tzip_code: string;\n\tcountry: string;\n\treference?: string | null;\n\treference_streets?: string | null;\n\tcontacts: Contact[];\n\ttax_id: string;\n\taddress_type?: string;\n};\n\nexport enum BusinessStatus {\n\tACTIVE = 'active',\n\tMAIN = 'main',\n\tDISABLED = 'disabled'\n}\n\nexport type NewBusiness = {\n\tid?: number;\n\tcustomer_id?: number;\n\ttax_id: string;\n\tbusiness_name: string;\n\tcompany_name: string;\n\tfiscal_address: {\n\t\tneighborhood: string;\n\t\tcity: string;\n\t\tstate: string;\n\t\tnumber: string;\n\t\tsuite_number?: string;\n\t\tstreet: string;\n\t\tzip_code: string;\n\t};\n\ttax_regimen: string;\n\tpayment_type: string;\n\tpayment_method: string;\n\tcfdi_use: string;\n\tusers: User[];\n\tgroups: Group[];\n\tcan_edit_tax_id: boolean;\n\tstatus: BusinessStatus;\n\tnotification_emails: { name: string; email: string }[];\n\tconditions: PaymentConditions;\n\tcompany_name_capital?: string;\n\tcapital_regime?: string;\n\tcreated_at: string;\n\torder?: string | null;\n\tchange_by?: number;\n};\n\nexport type Business = {\n\tid: number;\n\tcreated_at: string;\n\tbusiness_name: string;\n\tcompany_name: string;\n\tgroups: string | Group[];\n\tusers: User[];\n\tstatus: BusinessStatus;\n};\n\nexport type CustomerInfo = {\n\tid: number;\n\tname: string;\n};\n\nexport type Address = NewAddress & {\n\towner: {\n\t\tid: number;\n\t\tname: string;\n\t} | null;\n\tcustomer: CustomerInfo;\n};\n\nexport type ZipCode = {\n\tcode: string;\n\tneighborhood: string;\n\tlocality: string;\n\tstate: string;\n\tmunicipality: string;\n\tcountry: string;\n};\n\nexport type Package = {\n\tid: ID;\n\tpkg_id: ID;\n\talias: string;\n\ttype: string;\n\tcontent: string;\n\theight: number;\n\twidth: number;\n\tlength: number;\n\tweight: number;\n\tmeasurement: 'cm' | 'm';\n\t//Only when request\n\tquantity?: number;\n\tinsurance?: number; // TODO check if this is still valid\n\tcustomer?: CustomerInfo;\n\tcustomer_id?: number;\n\tmerchandise?: Merchandises;\n\tdescription?: string;\n\tis_irregular_delivery?: boolean;\n};\n\nexport type Group = {\n\tid: ID;\n\tname: string;\n\tdescription?: string;\n\tservices: BookletServiceForm[];\n\tusers: User[];\n\tis_business_default?: boolean;\n\tdefault_business_id?: number;\n};\n\nexport type User = {\n\tid: ID;\n\tname: string;\n\tlast_name: string;\n\temail: string;\n\tphone_number: string;\n\textension?: string;\n\tpermissions: string;\n\tcustomer?: { id: number | undefined };\n\tis_business_default?: boolean;\n\tnotifications?: UserNotification;\n};\n\nexport type UserNotification = {\n\tmodality: string;\n\tstatus: string;\n\tis_enable: boolean;\n\twhatsapp_number: string;\n\talias_name?: string;\n\talias_name_label?: string;\n};\n\nexport type Label = {\n\t// del backend\n\tid: ID;\n\tcreated_at: string;\n\tparcel_number: string;\n\tlabel: string;\n\tservice_description: string;\n\tservice_id: string;\n\tcarrier: string;\n};\n\nexport enum ServiceTag {\n\tRESHIPMENT = 'Reexpedición',\n\tOCCURS = 'Ocurre forzoso',\n\tIRREGULAR = 'E. Irregular',\n\tSPECIAL = 'Manejo E.',\n\tOVERWEIGHT = 'Sobrepeso',\n\tPLUS_ZONE = 'Zona Plus',\n\tCOVERAGE_WITH_COST = 'Cobertura Con Costo',\n\tEXTENDED_ZONE = 'Zona Extendida'\n}\n\n/**\n * Respuesta de la API\n */\nexport type ServiceResponse = {\n\tcarrier: string;\n\tcarriers?: string[]; // only when is for consolidated\n\testimated_delivery_date: string;\n\tservice_description: string;\n\tservice_id: string;\n\ttotal_cost: number;\n\testimated_hour: number | null;\n\tinsurance?: number;\n\tinsurance_percentage?: number;\n\trate_id: number;\n\ttags?: { concept: ServiceTag | string; value: number }[];\n\tcan_service_be_traded?: { can_be_traded: boolean; service_id: string };\n\treissue: string;\n\tprices?: Array<{ service_price: number; insurance_price?: number; rate_insurance?: number }>;\n\tweight: number;\n\tremaining_stock?: number;\n\treason_disable?: string;\n\toffice_list?: ServiceOffice[];\n\tdeclared_value?: number;\n};\n\nexport type ServiceOffice = {\n\tcode: string;\n\tname: string;\n\tzip_code: string;\n\tneighborhood: string;\n\tcity: string;\n\tstate: string;\n\tstreet: string;\n\tnumber: string;\n\tcountry: string;\n\tlatitude: string;\n\tlongitude: string;\n};\n\n// General App\n// TODO check where we can put most of this actions that does not belong here\nexport const SET_MAPS_COORDINATES = 'SET_MAPS_COORDINATES';\nexport const SET_DESTINATION_COORDINATES = 'SET_DESTINATION_COORDINATES';\nexport const WILL_EDIT_PACKAGE = 'WILL_EDIT_PACKAGE';\nexport const RESET_PACKAGE_TO_EDIT = 'RESET_PACKAGE_TO_EDIT';\nexport const SET_GOOGLE_MAPS_SCRIPT = 'SET_GOOGLE_MAPS_SCRIPT';\nexport const SET_GOOGLE_MAP = 'SET_GOOGLE_MAP';\nexport const SET_GOOGLE_MAPS_MARKER = 'SET_GOOGLE_MAPS_MARKER';\nexport const SET_GOOGLE_MAPS_DESTINATION_MARKER = 'SET_GOOGLE_MAPS_DESTINATION_MARKER';\nexport const SET_GOOGLE_MAPS_POLYLINE = 'SET_GOOGLE_MAPS_POLYLINE';\n\nexport type AppActions =\n\t| {\n\t\t\ttype: typeof SET_MAPS_COORDINATES;\n\t\t\tcoordinates: null | { lat: number; lng: number };\n\t }\n\t| {\n\t\t\ttype: typeof SET_DESTINATION_COORDINATES;\n\t\t\tcoordinates: null | { lat: number; lng: number };\n\t }\n\t| { type: typeof WILL_EDIT_PACKAGE; pkg: Package }\n\t| { type: typeof RESET_PACKAGE_TO_EDIT }\n\t| { type: typeof SET_GOOGLE_MAPS_SCRIPT; status: boolean }\n\t| { type: typeof SET_GOOGLE_MAP; map: google.maps.Map | null }\n\t| {\n\t\t\ttype: typeof SET_GOOGLE_MAPS_DESTINATION_MARKER;\n\t\t\tmarker: google.maps.Marker | null;\n\t }\n\t| { type: typeof SET_GOOGLE_MAPS_POLYLINE; path: google.maps.Polyline | null }\n\t| { type: typeof SET_GOOGLE_MAPS_MARKER; marker: google.maps.Marker | null };\n\n//=======================================================\nexport type ShipmentRateResponse = {\n\tid: ID;\n\tfolio: string;\n\tcarrier: string;\n\tservice: string;\n\tcreated_at: string;\n\torigin: AddressRequest;\n\tdestination: AddressRequest;\n\tstatus: 'Cancelada' | 'En proceso' | 'Cotización Lista';\n\tactions?: null;\n};\n\nexport type EventType = {\n\tcreatedAt: string;\n\tid: string | number;\n\tevent: number | string;\n\tdescription?: string;\n};\n\nexport enum ShipmentSourceType {\n\tAPI = 'ENCAMINOAPI',\n\tMANUAL = 'ENCAMINOMANUAL'\n}\n\nexport type ShipmentSendResponse = {\n\tid: ID;\n\tcarrier: string;\n\tservice: string;\n\tservice_description: string;\n\tfollow_up: string;\n\tlabel?: string;\n\tcreated_at: string;\n\tparcel_number: string;\n\torigin: AddressRequest;\n\tdestination: AddressRequest;\n\tstatus: string;\n\tevents?: EventType[];\n\tactions?: null;\n\tpackages: any[];\n\tuser?: { id: number; name: string };\n\tquantity?: string;\n\ttype?: string;\n\tcontent?: string;\n\ttracking_number?: string;\n\tservice_id?: number;\n\tadditional_info?: string;\n\tprice?: number;\n\treference?: string;\n\tpdf?: string;\n\tbusiness_id?: number;\n\tfiles?: FileImg[];\n\tcan_edit_business?: boolean;\n\tnotification_contacts?: NotificationContacts;\n\tcompensation?: ShipmentCompensation;\n\tmodality?: ShipmentModality;\n\tnotes?: string;\n\tbilling?: BillingSchema;\n\timmediate_billing?: boolean;\n\tlast_update?: string;\n\tnotified?: boolean;\n\treused?: boolean;\n\tnotified_reused?: boolean;\n\tsource?: ShipmentSourceType;\n\tsign_delivery?: string;\n\treceived_by_name?: string;\n\tcustomer: { business_name: string; id: number };\n};\n\nexport enum NotificationType {\n\tSHIPPPER = 'shipper',\n\tRECIPIENT = 'recipient'\n}\n\nexport type NotificationContacts = [\n\t{\n\t\tuser_id: number;\n\t\tcontact_id: number;\n\t\talias: string;\n\t\tphone_number: string;\n\t\tguide_status: string;\n\t\tshipping_mode: string;\n\t\tactive: boolean;\n\t\ttype?: NotificationType;\n\t},\n\t{\n\t\tcontact_id: number;\n\t\talias: string;\n\t\tphone_number: string;\n\t\tguide_status: string;\n\t\tshipping_mode: string;\n\t\tactive: boolean;\n\t\ttype?: NotificationType;\n\t}\n];\n\nexport enum ShipmentModality {\n\tPAYMENT = 'Cobro',\n\tINCIDENT = 'Incidente',\n\tEXCHANGE = 'Intercambio',\n\tPREPAID = 'Prepago'\n}\n\nexport enum ShipmentCompensation {\n\tLABEL = 'Guía',\n\tLABEL_MERCHANDISE = 'Guía / Mercancía',\n\tMERCHANDISE = 'Mercancía'\n}\n\nexport type ManualLabelResponse = {\n\tid: ID;\n\tcarrier: string;\n\tlabel?: string;\n\tcreated_at: string;\n\torigin_info: AddressRequest;\n\tdestination_info: AddressRequest;\n\tlabels: ManualLabelItem[];\n\tuser_id: number;\n\ttype?: string;\n\tcontent?: string;\n\tadditional_info?: string;\n\treference: string;\n\tservices: ServiceRowData[];\n\tfiles: { path: string; type: string; url: string }[];\n\tcan_edit_services?: boolean;\n};\n\nexport interface ServiceRowData {\n\tquantity: number;\n\tservice_id: number;\n\tprice?: number;\n\ttitle: string;\n\ttype: string;\n\tdeclared_value: number;\n}\n\nexport type ManualLabelItem = {\n\ttracking_number: string;\n\tparcel_number: string;\n\tstatus: string;\n\tid?: number;\n\titems: { type: string; content?: string; quantity: number }[];\n};\n\nexport type PickupEvent = {\n\tstatus: string;\n\tcreatedAt: string;\n\tcarrierFolio?: string;\n\treason?: string;\n};\n\nexport type EventTracking = {\n\tstatus: string;\n\twsStatusSp: string;\n\tdateTime: string;\n\treasonCode?: {\n\t\tcode: string;\n\t\tdescriptionSp: string;\n\t};\n\tpickupsItems?: number;\n\tfolio?: string;\n};\n\nexport type PickupEventTracking = {\n\t[parcelNumber: string]: EventTracking[];\n};\n\nexport type ShipmentPickUpResponse = {\n\tid: ID;\n\tfolio: string;\n\tcarrier: string;\n\tservice: string;\n\tcreated_at: string;\n\tstart_time: string;\n\tend_time: string;\n\ttime: string;\n\torigin: AddressRequest;\n\tdate: string;\n\tstatus: string;\n\t// parcelNumbers\n\tlabels: string[];\n\tdetails: PickUpLabelDetails;\n\t// @@@ Remove this field\n\textra_indications?: string;\n\tevents: PickupEvent[];\n\tevents_tracking: PickupEventTracking;\n\tactions?: null;\n\tcarrier_folio?: string;\n\treason?: string;\n\tindications?: string;\n\tcollect_in?: string;\n\tsupervisor?: string;\n\tnotes?: string;\n\towner?: {\n\t\tid: number;\n\t\tname: string;\n\t\tcustomer: { id: number; name: string };\n\t\temail?: string;\n\t};\n};\n\nexport type ShipmentPickUpDetailResponse = {\n\tid: ID;\n\tfolio: string;\n\tcarrier: string;\n\tservice: string;\n\tcreated_at: string;\n\tstart_time: string;\n\tend_time: string;\n\ttime: string;\n\torigin: AddressRequest;\n\tdate: string;\n\tstatus: string;\n\tlabels: ShipmentSendResponse[];\n\tdetails: PickUpLabelDetails;\n\textra_indications?: string;\n\tevents: PickupEvent[];\n\tevents_tracking: PickupEventTracking;\n\tactions?: null;\n\tcarrier_folio?: string;\n\treason?: string;\n\tindications?: string;\n\tcollect_in?: string;\n\tsupervisor?: string;\n\tnotes?: string;\n\towner?: {\n\t\tid: number;\n\t\tname: string;\n\t\tcustomer: { id: number; name: string };\n\t\temail?: string;\n\t};\n\tvalidated?: boolean;\n};\n\nexport type PickUpLabelDetails = {\n\t[parcelNumber: string]: {\n\t\torigin: AddressRequest;\n\t\tdestination: AddressRequest;\n\t\tpackages: Package[];\n\t};\n};\n\nexport type FedexAvailibityType = {\n\tschedule_day: string;\n\tearliest_times: string[];\n\tlatest_times: string[];\n\tpickup_date: string;\n};\n\nexport type ShipmentClarificationResponse = {\n\tid: ID;\n\tcarrier: string;\n\tservice: string;\n\tcreated_at: string;\n\tasociated_parcel_number: string;\n\tfolio: string;\n\treason: string;\n\tstatus: 'Cancelada' | 'En proceso' | 'Cotización Lista';\n\tactions?: null;\n};\n\nexport type BookletAddressResponse = NewAddress[];\nexport type BookletPackageResponse = Package[];\n\nexport type BookletUserResponse = {\n\tid: number;\n\temail: string;\n\tname: string;\n\tgroup: { id: number; name: string } | null;\n\tphone_number: string;\n\textension: number;\n\tcustomer?: CustomerInfo;\n};\nexport type BookletGroupResponse = {\n\tid: number;\n\tname: string;\n\tdescription: string;\n\tpermissions?: string;\n\tservices?: number[];\n\tusers?: object[];\n\tcustomer?: CustomerInfo;\n};\n\nexport type BookletUserForm = {\n\tid: number;\n\temail: string;\n\tname: string;\n\tphone_number: string;\n\textension?: number;\n\tactions?: null;\n};\n\nexport type BookletServiceForm = {\n\tcarrier: string;\n\tname: string;\n\tid: ID;\n\tmode: string;\n\tactions?: null;\n\t// when manage clients\n\tdiscount?: number;\n\tprice_list?: number;\n\tmin_stock?: number;\n\tenabled?: boolean;\n\tirregular_delivery_price?: number;\n\treissue_price?: number;\n\tinsurance_percentage?: number;\n\tservice?: string;\n\trates_service_description?: string;\n};\n\nexport type Client = {\n\tid: ID;\n\ttax_id: string;\n\tbusiness_name: string;\n\tphone_number: string | null;\n\twebpage: string | null;\n\tcompany_type: 'micro' | 'pequeña' | 'mediana' | 'grande';\n\tservices: {\n\t\tenabled: boolean;\n\t\tdiscount: number;\n\t\tprice_list: number;\n\t}[];\n\tusers: UserResponse[];\n};\n\nexport type Agent = {\n\tid: number;\n\temail: string;\n\tname: string;\n\tlast_name: string;\n\tphone_number: string;\n\textension: string;\n\tpermissions: string;\n\tcustomer_id: number | null;\n\tcustomers: number[];\n\trole: string;\n};\n\nexport type Regimen = {\n\tid: number;\n\tcode: string;\n\tdescription: string;\n\tperson: boolean;\n\tcompany: boolean;\n};\n\nexport type Payment = {\n\tcode: string;\n\tdescription: string;\n};\n\nexport type CapitalRegime = {\n\tcode: string;\n\tdescription: string;\n};\n\nexport type CFDI = {\n\tcode: string;\n\tdescription: string;\n\tperson: boolean;\n\tcompany: boolean;\n};\n\nexport type UserResponse = {\n\tid: ID;\n\temail: string;\n\tname: string;\n\tphone_number: string;\n\tpermissions: string;\n\tdefault_address: string | null;\n\tgroup_id: string | null;\n};\n\nexport enum UserRole {\n\tCUSTOMER = 'customer',\n\tROOT = 'root',\n\tAGENT = 'operator',\n\tCLIENT = 'client',\n\tSELLER = 'seller',\n\tBILLER = 'billing'\n}\n\nexport type CustomerCarriersListType = { label: string; value: string }[];\n\nexport enum CustomerModality {\n\t// Customer has balance or advance payment (show balance tab only)\n\tBALANCE = 'balance',\n\t// Customer has prepaid services (show stock tab only)\n\tPREPAID = 'prepaid',\n\t// Customer has balance and prepaid services (show both tabs)\n\tMIXED = 'mixed',\n\t// Customer has not balance and prepaid services (show none tab)\n\tCREDIT = 'credit'\n}\n\nexport type UserDetails = {\n\tid: number;\n\tcustomer: {\n\t\tid: number;\n\t\tname: string;\n\t\tcustomer_modality?: CustomerModality;\n\t\tcarriers: CustomerCarriersListType;\n\t\tdispersion_type?: CustomerDispersionType;\n\t\treview_reports?: CustomerReportsReview;\n\t} | null;\n\tdefault_address: null | string;\n\temail: string;\n\tgroup: null | number;\n\tname: string;\n\toptions: {\n\t\trate_price: boolean;\n\t\ttheme: boolean;\n\t\testafeta_output_type?: string;\n\t};\n\tpermissions: string;\n\tphone_number: null | string;\n\trole: UserRole;\n\tservices: {\n\t\tcarrier: string;\n\t\tid: number;\n\t\tmode: string;\n\t\tservice: string;\n\t\ttype: string;\n\t}[];\n\tnotification_info?: NotificationsContactsFields | null;\n\tlast_name?: string;\n\tfirst_name?: string;\n};\n\n// TODO change to Response or Details, be consisten on names\nexport type SellerResponse = {\n\tid: number;\n\tname: string;\n\temail?: string;\n\tlastName: string;\n\t// customer_id: number;\n\t// customers: any[]; // TODO check the info\n\t// email: string;\n\t// extension: string | null;\n\t// options: { theme: boolean; rate_price: boolean };\n\t// permissions: string;\n\t// phone_number: null | string;\n\t// role: UserRole.AGENT;\n\t// initials: string; // Autocalculated for the InputSearchAgentIntials\n};\n\n// REPORTS\nexport type ReportItem = {\n\tid?: number;\n\ttype?: string;\n\tname?: ReportName;\n\tsub_type?: string;\n\tschema?: string;\n\tdate?: string;\n\tconditions?: string;\n\tpre_invoice_days?: string;\n\treport_file_type?: string;\n};\n\nexport enum ReportType {\n\tONLY_LABELS = 'solo guías',\n\tONLY_OVERWEIGHTS = 'solo sobrepesos',\n\tONLY_INSURANCES = 'solo seguros',\n\tALL = 'todos',\n\tLABELS_AND_OVERWEIGHTS = 'guías y sobrepesos',\n\tLABELS_AND_INSURANCES = 'guías y seguros',\n\tOVERWEIGHTS_AND_INSURANCES = 'sobrepesos y seguros'\n}\n\nexport enum SchemaType {\n\tIMMEDIATE = 'inmediato',\n\tWEEKLY = 'semanal',\n\tMONTHLY = 'mensual',\n\tBIWEEKLY = 'quincenal',\n\tINDEPENDENT = 'independiente'\n}\n\nexport enum ConditionTypeReport {\n\tINMEDIATE = 'Inmediato',\n\tTHREE_DAYS = '3 días hábiles',\n\tFIVE_DAYS = '5 días hábiles'\n}\n\nexport enum ReportName {\n\tLABELS = 'guías',\n\tOVERWEIGHTS = 'sobrepesos',\n\tOVERWEIGHTS_SUPPLIER = 'sobrepesos_proveedor',\n\tINSURANCES = 'seguros'\n}\n\nexport enum ReportSubType {\n\tCURRENT_MONTH = 'mes actual',\n\tPREVIOUS_MONTH = 'mes anterior',\n\tWEEK = 'semana',\n\tBIWEEK = 'quincena'\n}\n\nexport enum ReportDateMonthly {\n\tDAY_1 = 'día 1 del mes',\n\tDAY_6 = 'día 6 del mes',\n\tDAY_12 = 'día 12 del mes',\n\tDAY_16 = 'día 16 del mes',\n\tDAY_22 = 'día 22 del mes',\n\tDAY_26 = 'día 26 del mes',\n\tDAY_31 = 'último de mes'\n}\n\nexport enum ReportDateBiweekly {\n\tFIRST_WEEK = '1/16'\n}\n\nexport enum ReportDateWeekly {\n\tMONDAY = 'lunes',\n\tTUESDAY = 'martes',\n\tWEDNESDAY = 'miércoles',\n\tTHURSDAY = 'jueves',\n\tFRIDAY = 'viernes',\n\tSATURDAY = 'sábado',\n\tSUNDAY = 'domingo'\n}\n\nexport enum PreInvoiceDays {\n\tINMEDIATE = 'Inmediato',\n\tONE_DAY = '1 día hábil',\n\tTWO_DAYS = '2 días hábiles',\n\tTHREE_DAYS = '3 días hábiles',\n\tPURCHASE_ORDER = 'Orden de compra'\n}\n\nexport enum ReportFileType {\n\tSAME_FILE = 'Mismo archivo',\n\tSEPARATE_FILES = 'Archivos separados'\n}\n\nexport enum ReportNumber {\n\tONE = '1',\n\tTWO = '2',\n\tTHREE = '3'\n}\n\n// -----\n\nexport enum CustomerDispersionType {\n\tGLOBAL = 'global',\n\tRESTRICTED = 'restricted'\n}\n\nexport type CustomerService = {\n\tid: number;\n\tenabled: boolean;\n\tdiscount?: number;\n\tprice_list?: number;\n\tcarrier: string;\n};\n\nexport type CustomerDetails = {\n\tid: number;\n\tname: string;\n\tlast_name: string;\n\tphone_number: string;\n\temail: string;\n\tbusiness_name: string;\n\tcompany_name?: string;\n\twebpage: string;\n\tcompany_type: string;\n\ttax_id?: string;\n\tusers: UserDetails[];\n\tservices: CustomerService[];\n\tbilling: BillingSchema;\n\tcustomer_modality?: CustomerModality;\n\tcarriers: CustomerCarriersListType;\n\tdispersion_type?: CustomerDispersionType;\n\tmodality: string;\n};\n\ntype MinimalAddress = {\n\tcity: string;\n\tneighborhood: string;\n\tnumber: string;\n\tstate: string;\n\tstreet: string;\n\tsuite_number: string;\n\tzip_code: string;\n};\n\nexport enum PaymentConditions {\n\tCASH = 'Contado',\n\tSEVEN_DAYS = '7 días naturales',\n\tFIFTEEN_DAYS = '15 días naturales',\n\tTWENTYTWO_DAYS = '22 días naturales',\n\tTHIRTY_DAYS = '30 días naturales',\n\tSIXTY_DAYS = '60 días naturales'\n}\n\nexport enum BillingSchema {\n\tIMMEDIATE = 'inmediata',\n\tREPORTS = 'reportes'\n}\n\nexport enum CustomerReportsReview {\n\tPLATFORM = 'Revisión Plataforma',\n\tEXCEL = 'Adjuntar Excel'\n}\n\nexport type CustomerResponse = {\n\tseller: SellerResponse;\n\tbusiness_address: MinimalAddress;\n\tbusiness_name: string;\n\tcfdi_description: string;\n\tcompany_name: string;\n\tcompany_type: string;\n\tconditions: PaymentConditions;\n\tcontact: {\n\t\tid: number;\n\t\trole: string;\n\t\temail: string;\n\t\tname: string;\n\t\tphone_number: number;\n\t};\n\tcustomID: string;\n\tdescription_of_operation: string | null;\n\tfiscal_address: MinimalAddress;\n\tid: number;\n\tmodality: string;\n\tpayment_method: string;\n\tpayment_type: string;\n\tphone_number: string;\n\tschema: string;\n\tservices: {\n\t\tcarrier: string;\n\t\tdiscount: number;\n\t\tenabled: boolean;\n\t\tid: number;\n\t\tmin_stock: number;\n\t\tmode: string;\n\t\tprice_list: number;\n\t\tservice: string;\n\t\tirregular_delivery_price?: number;\n\t\treissue_price?: number;\n\t\tinsurance_percentage?: number;\n\t}[];\n\tset_of_operations: string;\n\ttax_id: string;\n\ttokens: string[];\n\treports: ReportItem[];\n\twebpage: string;\n\tstatus: 'ACTIVE' | 'LOCKED';\n\tbilling: BillingSchema;\n\tcustomer_modality?: CustomerModality;\n\treview_reports?: CustomerReportsReview;\n};\n\nexport type GetColumnsProps = {\n\tonEdit?: (id: number) => any;\n\tonDelete?: (id: number) => any;\n};\n\nexport type CustomerDocumentType = {\n\tid: number;\n\tstatus: string;\n\tdescription: string;\n\tcreated_date: string;\n\tlast_update: string;\n\tcomment?: string;\n\tlast_name?: string;\n\tsecond_last_name?: string;\n\turl: string;\n\tdocument_type?: DocumentNameType;\n\tfile_type?: string;\n\tfile_name?: string;\n\taddress?: string;\n\tneighborhood?: string;\n\tcity?: string;\n\tbusiness_name?: string;\n\tcompany_name?: string;\n\ttax_id?: string;\n\tnumber?: string;\n\tsuite_number?: string;\n\tstate?: string;\n\tstreet?: string;\n\tadmin_name?: string;\n\tdenomination?: string;\n\tdate?: string;\n\tpublic_deed?: string;\n\tnotary_number?: string;\n\tpublic_notary?: string;\n};\n\nexport enum ValidationStatus {\n\tREGISTER = 'registro',\n\tPROSPECTING = 'prospección',\n\tDOCUMENTATION = 'documentación',\n\tVALIDATED = 'validado',\n\tVALIDATED_BUT_PENDING_OF_RATES = 'validado_pero_pendiente_tarifas'\n}\n\n// export enum ProspectValidationStatus {\n// \tREGISTER = 'registro',\n// \tPROSPECTING = 'prospección',\n// \tDOCUMENTATION = 'documentación',\n// \tVALIDATED = 'validado'\n// }\n\nexport enum ProspectValidationStatus {\n\tREGISTER = 'registro',\n\tPROSPECTING = 'prospección',\n\tDOCUMENTATION = 'documentación',\n\tVALIDATED = 'validado'\n}\n\nexport enum Entity {\n\tPHYSICAL = 'Persona física',\n\tMORAL = 'Persona moral'\n}\n\nexport enum DocumentNameType {\n\tINE = 'INE',\n\tTAX = 'Constancia de situación fiscal',\n\tPROOF_ADDRESS = 'Comprobante de domicilio',\n\tCONSTITUTIVE_ACT = 'Acta constitutiva',\n\tASSEMBLY_ACT = 'Acta de asamblea'\n}\n\nexport type DocumentResponseType = {\n\tprospect_name: string;\n\tprospect_type: Entity;\n\tdocuments: {\n\t\tine: {\n\t\t\tstatus: string;\n\t\t\turl: string;\n\t\t\tcomment: string;\n\t\t};\n\t\ttax: {\n\t\t\tstatus: string;\n\t\t\turl: string;\n\t\t};\n\t\tproof_address: {\n\t\t\tstatus: string;\n\t\t\turl: string;\n\t\t};\n\t\tconstitutive_act: {\n\t\t\ttype: string;\n\t\t\tstatus: string;\n\t\t\turl: string;\n\t\t};\n\t\tassembly_act: {\n\t\t\tstatus: string;\n\t\t\turl: string;\n\t\t};\n\t};\n};\n\nexport type DocumentRequestType = {\n\tfiles: File;\n\tfile_type: string;\n\tdocument: string;\n};\n\nexport type ProspectDocumentsResponseType = {\n\tine: {\n\t\tnames: string;\n\t\tlast_name: string;\n\t\tsecond_last_name: string;\n\t\tzip_code: string;\n\t\tneighborhood: string;\n\t\tvalidity: string;\n\t\taddress: string;\n\t\tcity: string;\n\t\tstatus: string;\n\t\turl: string;\n\t\tdocument_type: string;\n\t\tcomment: string;\n\t} | null;\n\ttax: {\n\t\tbusiness_name: string;\n\t\tcompany_name: string;\n\t\tnumber: string;\n\t\tsuite_number: string;\n\t\tstreet: string;\n\t\tzip_code: string;\n\t\tneighborhood: string;\n\t\tdate_of_issue: string;\n\t\tcity: string;\n\t\tstate: string;\n\t\tstatus: string;\n\t\turl: string;\n\t\tdocument_type: string;\n\t\tcomment: string;\n\t} | null;\n\tproof: {\n\t\tnumber: string;\n\t\tsuite_number: string;\n\t\tstreet: string;\n\t\tzip_code: string;\n\t\tneighborhood: string;\n\t\tdate_of_issue: string;\n\t\tcity: string;\n\t\tstate: string;\n\t\tstatus: string;\n\t\turl: string;\n\t\tdocument_type: string;\n\t\tcomment: string;\n\t} | null;\n\tconstitutive_act: {\n\t\tbusiness_name: string;\n\t\tdenomination: string;\n\t\tadmin_name: string;\n\t\tdate: string;\n\t\tpublic_deed: string;\n\t\tnotary_number: string;\n\t\tpublic_notary: string;\n\t\tcity: string;\n\t\tstate: string;\n\t\tstatus: string;\n\t\turl: string;\n\t\tdocument_type: string;\n\t\tcomment: string;\n\t} | null;\n};\n\nexport type ProspectResponseType = {\n\tid: number;\n\tprospect_id: string;\n\tname: string;\n\t// email: string;\n\tcontact: {\n\t\tid: number;\n\t\trole: string;\n\t\temail: string;\n\t\tname: string;\n\t\tphone_number: number;\n\t};\n\twebpage: string | null;\n\t// status: 'Registro' | 'Prospección' | 'Documentación' | 'Validado';\n\tvalidation_status: ProspectValidationStatus;\n\tlast_name?: string;\n\tbusiness_name?: string;\n\tbusiness_type?: string;\n\tset_of_operations?: string;\n\tchannel?: string;\n\tagents?: number[];\n\tbusiness_address?: MinDataAddress;\n\tschema: string;\n\tmodality: string;\n\tservices: {\n\t\tcarrier: string;\n\t\tdiscount: number;\n\t\tenabled: boolean;\n\t\tid: number;\n\t\tmin_stock: number;\n\t\tmode: string;\n\t\tprice_list: number;\n\t\tservice: string;\n\t\tirregular_delivery_price?: number;\n\t\treissue_price?: number;\n\t\tinsurance_percentage?: number;\n\t}[];\n\tcfdi_description: string;\n\tcompany_name: string;\n\tcompany_type: string;\n\tconditions: string;\n\tcustomID: string;\n\tdescription_of_operation: string | null;\n\tpayment_method: string;\n\tpayment_type: string;\n\tphone_number: string;\n\ttax_id: string;\n\ttokens: string[];\n\treports: ReportItem[];\n\tdocuments: ProspectDocumentsResponseType;\n};\n\nexport type ProspectRequestType = {\n\tid: number;\n\tname: string;\n\tlast_name?: string;\n\temail: string;\n\twebpage: string | null;\n\t// status: 'Registro' | 'Prospección' | 'Documentación' | 'Validado';\n\tvalidation_status: ProspectValidationStatus;\n\tbusiness_name?: string;\n\tcompany_name: string;\n\tcompany_type: string;\n\tbusiness_type?: Entity; // TODO:\n\tset_of_operations?: string;\n\tchannel?: string;\n\tseller_id: number;\n\n\t// agents?: number[];\n\t// business_address?: MinDataAddress;\n\t// schema: string;\n\t// modality: string;\n\t// services: {\n\t// \tcarrier: string;\n\t// \tdiscount: number;\n\t// \tenabled: boolean;\n\t// \tid: number;\n\t// \tmin_stock: number;\n\t// \tmode: string;\n\t// \tprice_list: number;\n\t// \tservice: string;\n\t// \tirregular_delivery_price?: number;\n\t// \treissue_price?: number;\n\t// \tinsurance_percentage?: number;\n\t// }[];\n\t// cfdi_description: string;\n\t// company_type: string;\n\t// conditions: string;\n\t// customID: string;\n\t// description_of_operation: string | null;\n\t// payment_method: string;\n\t// payment_type: string;\n\t// phone_number: string;\n\t// tax_id: string;\n\t// tokens: string[];\n};\n\n// DISPERSION\n\nexport type DispersionTableResponse = {\n\tassigned_quantity: number;\n\tconsumed_quantity: number;\n\tcreated_by: number;\n\tid: number;\n\tdocument: { invoice_id: string; document_date: string; carrier: string };\n\tinvoice_id: number;\n\tnot_assigned_quantity: number;\n\tremaining_quantity: number;\n\tservice: { id: number; name: string };\n\ttotal_quantity: number;\n\tcurrent_quantity?: number;\n\toriginal_quantity?: number;\n};\n\nexport type SingleDispersionResponse = {\n\tassigned_quantity: number;\n\tconsumed_quantity: number;\n\tcreated_by: number;\n\tdispersions: {\n\t\tid: number;\n\t\tname: string;\n\t\tconsumed_quantity: number;\n\t\tcurrent_quantity: number;\n\t\toriginal_quantity: number;\n\t}[];\n\tdocument: { invoice_id: string; document_date: string };\n\tid: number;\n\tinvoice_id: number;\n\tnot_assigned_quantity: number;\n\tremaining_quantity: number;\n\tservice: { id: number; name: string; carrier: string };\n\ttotal_quantity: number;\n\tupdated_at: number;\n};\n\nexport type DispersionService = {\n\tid: number;\n\toriginal_quantity: number;\n\tprice: number;\n\tname: string;\n\tquantity?: number;\n};\n\nexport type DispersionsResumeItem = {\n\tservice: string;\n\tremaining_quantity: number;\n\tconsumed_quantity: number;\n\tid: number;\n\tpurchased: number;\n\treplacements: number;\n\tto_balance: number;\n\texpired_quantity?: number;\n\tto_assign?: number;\n};\n\nexport type AvailableService = {\n\tcarrier: string;\n\tid: number;\n\tmode: string;\n\tname: string;\n\tservice?: string;\n};\n\nexport type ResponsePurchase = {\n\tcarrier_id: number;\n\tcarrier: string;\n\tbusiness_id: number;\n\tpayment_method: string;\n\tpayment_type: string;\n\tcfdi_use: string;\n\tcustomer_id: number;\n\torder: string;\n\tservices: Array<{\n\t\tid: number;\n\t\tdescription: string;\n\t\tquantity: number;\n\t\tprice: number;\n\t}>;\n};\n\nexport type RateRequest = {\n\tzip_origin?: string;\n\tzip_destination?: string;\n\tcoordinates_destination?: string | { lat: number; lng: number };\n\tcoordinates_origin?: string | { lat: number; lng: number };\n\tneighborhood_origin?: string;\n\tneighborhood_destination?: string;\n\tstate_destination?: string;\n\tcity_destination?: string;\n\tuser_id?: number;\n\tpackages: Package[];\n};\n\nexport enum DispersionPurchaseType {\n\tDEBT = 'debt',\n\tBUYS = 'buys'\n}\n\nexport type ClientBalanceType = {\n\tid: number;\n\tamount: number;\n\tconsumed: number;\n\tremaining: number;\n\tcustomerId: number;\n\tto_assign: number;\n};\n\nexport enum Channel {\n\tAMAZON = 'Amazon',\n\tML = 'Mercado Libre',\n\tIG = 'Instagram',\n\tFB = 'Facebook',\n\tECOMMMERCE = 'e-commerce',\n\tOTHER = 'Otro'\n}\n\nexport type CarrierList = {\n\tlabel: string;\n\tvalue: string;\n}[];\n","import { useMemo } from 'react';\nimport { useSelector } from '~store/store';\n\nexport default function useCurrentFlow() {\n\tconst { currentFlow } = useSelector(state => state.flow);\n\n\tconst isSending = useMemo(() => currentFlow === 'send', [currentFlow]);\n\n\treturn {\n\t\tisSending\n\t}\n}\n","import React, { useEffect, useState } from 'react';\nimport { Button, Grid, IconButton, Tooltip, Typography, createFilterOptions } from '@mui/material';\nimport { Autocomplete } from '@material-ui/lab';\nimport { useDispatch } from 'react-redux';\nimport { useHistory } from 'react-router-dom';\n\nimport RenderInput from './_RenderInput';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\n\nimport { setContactSend, setContactPickup } from '../../store/actions';\nimport { setAddressCreate } from '~store/actions';\n\nimport { AddressRequest, Contact } from '~store/actions/ActionTypes';\nimport { useSelector } from '~store/store';\nimport useCurrentFlow from '~hooks/useCurrentFlow';\nimport { Edit as EditIcon, Plus as PlusIcon } from 'react-feather';\nimport { useAddBtnAutocompleteStyles } from '~hooks/useStyles';\n\n// Filter search for Contact\nconst filterOptionsContact = createFilterOptions({\n\ttrim: true,\n\tstringify: (option) => JSON.stringify(option)\n});\n\n// to handle add address\nconst idForNewContact = 'newContact';\n\ninterface PlsBtnAutoComplete {\n\ttarget: 'origin' | 'destination';\n\taddress?: number | string;\n\tchildren: React.ReactNode;\n}\n\n// https://stackoverflow.com/questions/59291614/how-can-i-create-a-clickable-first-option-in-material-ui-labs-autocomplete\nconst PlusButtonAutoComplete: React.FC = (props) => {\n\tconst history = useHistory();\n\tconst { btnAutocompleteClasses } = useAddBtnAutocompleteStyles();\n\tconst { isSending } = useCurrentFlow();\n\t//const dispatch = useDispatch();\n\n\treturn (\n\t\t\n\t\t\t{isSending && (\n\t\t\t\t {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}}\n\t\t\t\t\tclassName={btnAutocompleteClasses.btnAdd}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\thistory.push(`/direccion/${props.address}?target=${props.target}&contact=newest`);\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t) => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisableRipple\n\t\t\t\t\t\tclassName={btnAutocompleteClasses.iconAdd}\n\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t  Agregar nuevo contacto\n\t\t\t\t\n\t\t\t)}\n\t\t\t{props.children}\n\t\t\n\t);\n};\n\ninterface Props {\n\tfor: 'contactOrigin' | 'contactDestination';\n\tlabel: string; //passed to the render param\n\tisPickingUp?: boolean; // when pickup\n\tisCreating?: boolean;\n\treset?: boolean;\n\tisPickingUpFromDelivery?: boolean;\n\tdisabled?: boolean;\n}\n\n/**\n * Autocomplete for search contact\n */\nconst InputSearchContact: React.FC = (props) => {\n\tconst dispatch = useDispatch();\n\tconst history = useHistory();\n\tconst { isSending } = useCurrentFlow();\n\tconst { btnAutocompleteClasses } = useAddBtnAutocompleteStyles();\n\n\tconst { availableContactsPickUp, isTouchedPickup, addressPickUp } = useSelector(\n\t\t(state) => state.pickup\n\t);\n\tconst {\n\t\tavailableDestinationContactsSend,\n\t\tavailableOriginContactsSend,\n\t\toriginAddressSend,\n\t\tdestinationAddressSend,\n\t\tisTouchedSend\n\t} = useSelector((state) => state.send);\n\tconst {\n\t\tavailableDestinationContactsCreate,\n\t\tavailableOriginContactsCreate,\n\t\toriginAddressCreate,\n\t\tdestinationAddressCreate\n\t} = useSelector((state) => state.create);\n\tconst { currentFlow } = useSelector((state) => state.flow);\n\n\tconst [contact, setContact] = useState(null);\n\tconst [contactOptions, setContactOptions] = useState([]);\n\tconst [showError, setShowError] = useState(false);\n\n\t// handle the error\n\tuseEffect(() => {\n\t\tif (currentFlow === 'pickup' && isTouchedPickup) {\n\t\t\tsetShowError(!Boolean(addressPickUp?.contact));\n\t\t} else if (currentFlow === 'send' && isTouchedSend) {\n\t\t\tif (props.for === 'contactDestination') {\n\t\t\t\tsetShowError(!Boolean(destinationAddressSend?.contact));\n\t\t\t} else if (props.for === 'contactOrigin') {\n\t\t\t\tsetShowError(!Boolean(originAddressSend?.contact));\n\t\t\t}\n\t\t} else if (currentFlow === 'create') {\n\t\t\tif (props.for === 'contactDestination') {\n\t\t\t\tsetShowError(!Boolean(destinationAddressCreate?.contact));\n\t\t\t} else if (props.for === 'contactOrigin') {\n\t\t\t\tsetShowError(!Boolean(originAddressCreate?.contact));\n\t\t\t}\n\t\t}\n\t}, [\n\t\taddressPickUp?.contact,\n\t\tcurrentFlow,\n\t\tisTouchedPickup,\n\t\tprops.for,\n\t\toriginAddressSend?.contact,\n\t\tdestinationAddressSend?.contact,\n\t\tisTouchedSend,\n\t\tdestinationAddressCreate?.contact,\n\t\toriginAddressCreate?.contact\n\t]);\n\n\tuseEffect(() => {\n\t\tif (typeof contact?.id === 'string') {\n\t\t\tsetContact(null);\n\t\t\tdispatch(setContactSend(null, props.for === 'contactOrigin' ? 'origin' : 'destination'));\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// set default value origin\n\tuseEffect(() => {\n\t\tif (currentFlow === 'send' && typeof originAddressSend?.contact?.id !== 'string') {\n\t\t\tif (props.for === 'contactOrigin') {\n\t\t\t\tsetContact(originAddressSend?.contact === undefined ? null : originAddressSend?.contact);\n\t\t\t\t//resetear contacto\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetContact(null);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (currentFlow === 'create') {\n\t\t\tif (props.for === 'contactOrigin') {\n\t\t\t\tsetContact(\n\t\t\t\t\toriginAddressCreate?.contact === undefined ? null : originAddressCreate?.contact\n\t\t\t\t);\n\t\t\t\t//resetear contacto\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetContact(null);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\tcurrentFlow,\n\t\toriginAddressSend?.contact,\n\t\tprops.for,\n\t\tprops.reset,\n\t\toriginAddressCreate?.contact\n\t]);\n\n\t// set default value destination\n\tuseEffect(() => {\n\t\tif (currentFlow === 'send' && typeof destinationAddressSend?.contact?.id !== 'string') {\n\t\t\tif (props.for === 'contactDestination') {\n\t\t\t\tsetContact(\n\t\t\t\t\tdestinationAddressSend?.contact === undefined ? null : destinationAddressSend?.contact\n\t\t\t\t);\n\t\t\t\t//resetear contacto\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetContact(null);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (currentFlow === 'create') {\n\t\t\tif (props.for === 'contactDestination') {\n\t\t\t\tsetContact(\n\t\t\t\t\tdestinationAddressCreate?.contact === undefined ? null : destinationAddressCreate?.contact\n\t\t\t\t);\n\t\t\t\t//resetear contacto\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetContact(null);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [\n\t\tcurrentFlow,\n\t\tdestinationAddressSend?.contact,\n\t\tprops.for,\n\t\tprops.reset,\n\t\tdestinationAddressCreate?.contact\n\t]);\n\n\t// set default value pickup\n\tuseEffect(() => {\n\t\tif (currentFlow === 'pickup') {\n\t\t\tsetContact(addressPickUp?.contact === undefined ? null : addressPickUp?.contact);\n\t\t}\n\t}, [addressPickUp?.contact, currentFlow]);\n\n\t// set options\n\tuseEffect(() => {\n\t\tif (currentFlow === 'pickup') {\n\t\t\tsetContactOptions([...availableContactsPickUp]);\n\t\t} else if (currentFlow === 'send') {\n\t\t\tif (props.for === 'contactDestination') {\n\t\t\t\tsetContactOptions([...availableDestinationContactsSend]);\n\t\t\t\t//resetear contacto\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetContactOptions([]);\n\t\t\t\t}\n\t\t\t} else if (props.for === 'contactOrigin') {\n\t\t\t\tsetContactOptions([...availableOriginContactsSend]);\n\t\t\t\t//resetear contacto\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetContactOptions([]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (currentFlow === 'create') {\n\t\t\tif (props.for === 'contactDestination') {\n\t\t\t\tsetContactOptions([...availableDestinationContactsCreate]);\n\t\t\t\t//resetear contacto\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetContactOptions([]);\n\t\t\t\t}\n\t\t\t} else if (props.for === 'contactOrigin') {\n\t\t\t\tsetContactOptions([...availableOriginContactsCreate]);\n\t\t\t\t//resetear contacto\n\t\t\t\tif (props.reset) {\n\t\t\t\t\tsetContactOptions([]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [\n\t\tprops.for,\n\t\tcurrentFlow,\n\t\tavailableContactsPickUp,\n\t\tavailableDestinationContactsSend,\n\t\tavailableOriginContactsSend,\n\t\tprops.reset,\n\t\tavailableDestinationContactsCreate,\n\t\tavailableOriginContactsCreate\n\t]);\n\n\treturn (\n\t\t 0}\n\t\t\tdisableHoverListener={contactOptions.length > 0}\n\t\t\tdisableTouchListener={contactOptions.length > 0}\n\t\t>\n\t\t\t (\n\t\t\t\t\t\n\t\t\t\t\t\t{paperProps.children}\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\tfilterOptions={(options, params) => {\n\t\t\t\t\tconst filtered = filterOptionsContact(options, params);\n\t\t\t\t\t// Suggest the creation of a new value\n\t\t\t\t\tif (params.inputValue !== '') {\n\t\t\t\t\t\tfiltered.push({\n\t\t\t\t\t\t\temail: '',\n\t\t\t\t\t\t\tid: idForNewContact,\n\t\t\t\t\t\t\tname: 'Agregar nuevo contacto',\n\t\t\t\t\t\t\tphone_number: '',\n\t\t\t\t\t\t\ttype_phone_number: '',\n\t\t\t\t\t\t\ttype: ''\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn filtered;\n\t\t\t\t}}\n\t\t\t\tgetOptionSelected={() => true} //FIXME I cant find the reason why I cant compare as it should be\n\t\t\t\toptions={contactOptions}\n\t\t\t\t// The options that are shown\n\t\t\t\tgetOptionLabel={(option) => `${option.name.toUpperCase()}`}\n\t\t\t\trenderInput={(params) =>\n\t\t\t\t\tisSending ? (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t 0}\n\t\t\t\t\t\t\t\t\terrorMessage={'Seleccione un contacto'}\n\t\t\t\t\t\t\t\t\tparams={params}\n\t\t\t\t\t\t\t\t\thideIcon={props.isPickingUpFromDelivery}\n\t\t\t\t\t\t\t\t\tdisabled={props.disabled}\n\t\t\t\t\t\t\t\t\t{...props}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{!props.isPickingUpFromDelivery && (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\tconst id =\n\t\t\t\t\t\t\t\t\t\t\t\t\tprops.for === 'contactOrigin'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? originAddressSend!.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: destinationAddressSend!.id;\n\t\t\t\t\t\t\t\t\t\t\t\tif (!id) return;\n\t\t\t\t\t\t\t\t\t\t\t\thistory.push(\n\t\t\t\t\t\t\t\t\t\t\t\t\t`/direccion/${id}?target=${\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tprops.for === 'contactOrigin' ? 'origin' : 'destination'\n\t\t\t\t\t\t\t\t\t\t\t\t\t}&contact_id=${contact!.id}`\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\n\t\t\t\t\t) : props.isCreating ? (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t 0}\n\t\t\t\t\t\t\t\t\terrorMessage={'Seleccione un contacto'}\n\t\t\t\t\t\t\t\t\tparams={params}\n\t\t\t\t\t\t\t\t\thideIcon={props.isPickingUpFromDelivery}\n\t\t\t\t\t\t\t\t\tdisabled={props.disabled}\n\t\t\t\t\t\t\t\t\t{...props}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{!props.isPickingUpFromDelivery && (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\tconst id =\n\t\t\t\t\t\t\t\t\t\t\t\t\tprops.for === 'contactOrigin'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? originAddressCreate!.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: destinationAddressCreate!.id;\n\t\t\t\t\t\t\t\t\t\t\t\tif (!id) return;\n\t\t\t\t\t\t\t\t\t\t\t\thistory.push(\n\t\t\t\t\t\t\t\t\t\t\t\t\t`/direccion/${id}?target=${\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tprops.for === 'contactOrigin' ? 'origin' : 'destination'\n\t\t\t\t\t\t\t\t\t\t\t\t\t}&contact_id=${contact!.id}`\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\n\t\t\t\t\t) : props.isPickingUp ? (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t 0}\n\t\t\t\t\t\t\t\t\terrorMessage={'Seleccione un contacto'}\n\t\t\t\t\t\t\t\t\tparams={params}\n\t\t\t\t\t\t\t\t\tdisabled={props.disabled}\n\t\t\t\t\t\t\t\t\t{...props}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{/* \n \n {\n event.preventDefault();\n const id =\n props.for === \"contactOrigin\"\n ? contact!.id\n : destinationAddressSend!.id;\n history.push(\n `/direccion/${id}?target=${\n props.for === \"contactOrigin\"\n ? \"origin\"\n : \"destination\"\n }&contact_id=${contact!.id}`\n );\n }}\n >\n \n \n \n */}\n\t\t\t\t\t\t\n\t\t\t\t\t) : (\n\t\t\t\t\t\t 0}\n\t\t\t\t\t\t\terrorMessage={'Seleccione un contacto'}\n\t\t\t\t\t\t\tparams={params}\n\t\t\t\t\t\t\t{...props}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tvalue={contact}\n\t\t\t\tonChange={(_, value) => {\n\t\t\t\t\tif (typeof value !== 'string') {\n\t\t\t\t\t\tif (value?.id === idForNewContact) {\n\t\t\t\t\t\t\thistory.push('./direccion');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (props.isPickingUp) {\n\t\t\t\t\t\t\t\tdispatch(setContactPickup(value));\n\t\t\t\t\t\t\t} else if (props.isCreating) {\n\t\t\t\t\t\t\t\tsetContact(value);\n\t\t\t\t\t\t\t\tconst newContactValue =\n\t\t\t\t\t\t\t\t\tprops.for === 'contactDestination'\n\t\t\t\t\t\t\t\t\t\t? { ...destinationAddressCreate, contact: value }\n\t\t\t\t\t\t\t\t\t\t: { ...originAddressCreate, contact: value };\n\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\tsetAddressCreate(\n\t\t\t\t\t\t\t\t\t\tnewContactValue as AddressRequest,\n\t\t\t\t\t\t\t\t\t\tprops.for === 'contactDestination' ? 'destination' : 'origin',\n\t\t\t\t\t\t\t\t\t\t[]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\tsetContactSend(\n\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t\tprops.for === 'contactDestination' ? 'destination' : 'origin'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t/>\n\t\t\n\t);\n};\n\nexport default InputSearchContact;\n","import { useContext, useCallback, useMemo } from 'react';\nimport AuthContext, { PermissionsKey } from '~context/AuthContext';\nimport { UserRole } from '~store/actions/ActionTypes';\n\nexport default function usePermissions() {\n\tconst { currentPermissions, currentUser } = useContext(AuthContext);\n\n\tconst can = useCallback(\n\t\t(permission: PermissionsKey) => {\n\t\t\tconst [p, m] = permission.split('.');\n\n\t\t\t// @ts-ignore\n\t\t\treturn currentPermissions[p][m];\n\t\t},\n\t\t[currentPermissions]\n\t);\n\n\tconst isRoot = useMemo(() => currentUser.role === UserRole.ROOT, [currentUser]);\n\tconst isAgent = useMemo(() => currentUser.role === UserRole.AGENT, [currentUser]);\n\tconst isSeller = useMemo(() => currentUser.role === UserRole.SELLER, [currentUser]);\n\tconst isRootOrAgent = useMemo(() => isRoot || isAgent || isSeller, [isRoot, isAgent, isSeller]);\n\tconst isCustomer = useMemo(() => currentUser.role === UserRole.CUSTOMER, [currentUser]);\n\tconst isAgentOrCustomer = useMemo(() => isCustomer || isAgent, [isAgent, isCustomer]);\n\tconst isClient = useMemo(() => currentUser.role === UserRole.CLIENT, [currentUser]);\n\tconst isBiller = useMemo(() => currentUser.role === UserRole.BILLER, [currentUser]);\n\n\tconst canUseEnvios = useMemo(() => {\n\t\treturn can('canRead.label') || can('canRead.pickup');\n\t}, [can]);\n\n\tconst canUseLibreta = useMemo(() => {\n\t\treturn (\n\t\t\tcan('canRead.addresses') ||\n\t\t\tcan('canRead.packages') ||\n\t\t\tcan('canRead.users') ||\n\t\t\tcan('canRead.groups')\n\t\t);\n\t}, [can]);\n\n\treturn {\n\t\tcan,\n\t\tisRoot,\n\t\tisAgent,\n\t\tisRootOrAgent,\n\t\tisAgentOrCustomer,\n\t\tisCustomer,\n\t\tisClient,\n\t\tisBiller,\n\t\tisSeller,\n\t\tcanUseLibreta,\n\t\tcanUseEnvios\n\t};\n}\n","import produce from 'immer';\nimport moment from 'moment';\nimport {\n\tFlowActions,\n\tFlow,\n\tINIT_FLOW,\n\tRESET_FLOW,\n\tADD_ADDRESS_IN_FLOW,\n\tFILTER_CARRIER_FLOW,\n\tSORT_CARRIER_FLOW,\n\tDISABLE_GLOBAL_INSURANCE_FLOW,\n\tENABLE_GLOBAL_INSURANCE_FLOW,\n\tSHOW_GLOBAL_INSURANCE_FLOW,\n\tSET_UNIQUE_CARRIER_SERVICES_FLOW,\n\tSET_FILTERED_SERVICES,\n\tServiceResponse,\n\tSET_UNINSURABLE_PACKAGES,\n\tSET_CONTENT_OPTIONS\n} from '../actions/ActionTypes';\n\nexport type FlowState = {\n\tcurrentFlow: Flow | null;\n\n\t// TODO move to app ?\n\t// If you add an address while sending, none applies when you clic the add btn\n\t// FIXME update: now it is possible\n\taddingAddressTarget: 'origin' | 'destination' | 'none';\n\n\t// When results of rates\n\tdisableGlobalInsuranceFlow: boolean;\n\tshowGlobalInsuranceFlow: boolean;\n\tuniqueCarriers: string[];\n\tfilteredServicesFlow: ServiceResponse[];\n\tisShowingDHL: boolean;\n\tindexDHL: number;\n\tuninsurablePackages: string[];\n\tcontentOptions: string[];\n};\n\nconst initialState: FlowState = {\n\tcurrentFlow: null,\n\taddingAddressTarget: 'none',\n\n\t// Rate Result Page\n\tdisableGlobalInsuranceFlow: true,\n\tshowGlobalInsuranceFlow: false,\n\tuniqueCarriers: [],\n\tfilteredServicesFlow: [],\n\tisShowingDHL: false,\n\tindexDHL: -1,\n\tuninsurablePackages: [],\n\tcontentOptions: []\n};\n\nconst FlowReducer = (state: FlowState = initialState, action: FlowActions): FlowState => {\n\tlet nextState: FlowState;\n\tswitch (action.type) {\n\t\tcase INIT_FLOW:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.currentFlow = action.flow;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase RESET_FLOW:\n\t\t\treturn initialState;\n\t\tcase ADD_ADDRESS_IN_FLOW:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.addingAddressTarget = action.for;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase DISABLE_GLOBAL_INSURANCE_FLOW:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.disableGlobalInsuranceFlow = true;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase ENABLE_GLOBAL_INSURANCE_FLOW:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.disableGlobalInsuranceFlow = false;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SHOW_GLOBAL_INSURANCE_FLOW:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.showGlobalInsuranceFlow = action.show;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase FILTER_CARRIER_FLOW:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.filteredServicesFlow = action.services.filter((fs) => fs.carrier === action.filter);\n\t\t\t\tdraft.isShowingDHL = action.filter === 'dhl';\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SORT_CARRIER_FLOW:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tswitch (action.sort) {\n\t\t\t\t\tcase 0: //price\n\t\t\t\t\t\tdraft.filteredServicesFlow = draft.filteredServicesFlow.sort(\n\t\t\t\t\t\t\t(a, b) => a.total_cost - b.total_cost\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1: //date\n\t\t\t\t\t\tdraft.filteredServicesFlow = draft.filteredServicesFlow.sort((a, b) => {\n\t\t\t\t\t\t\tif (moment(a.estimated_delivery_date).isSame(moment(b.estimated_delivery_date))) {\n\t\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\tmoment(a.estimated_delivery_date).isBefore(moment(b.estimated_delivery_date))\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_UNIQUE_CARRIER_SERVICES_FLOW:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.uniqueCarriers = action.carriers;\n\t\t\t\tdraft.indexDHL = action.carriers.findIndex((c) => c === 'dhl');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_FILTERED_SERVICES:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.filteredServicesFlow = action.services;\n\t\t\t\tdraft.isShowingDHL = false;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_CONTENT_OPTIONS:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.contentOptions = action.options;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_UNINSURABLE_PACKAGES:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.uninsurablePackages = action.uninsurablePackages;\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n\treturn nextState;\n};\n\nexport default FlowReducer;\n","// Guarda las direcciones y packages para el flujo\n\nimport produce from 'immer';\nimport {\n\tADD_ADDRESS_DATA,\n\tADD_PACKAGE_TEMP_DATA,\n\tEDIT_PACKAGE_TEMP_DATA,\n\tCLEAR_ERROR_FETCH_DATA,\n\tCLEAR_SERVICES_DATA,\n\tFETCH_ADDRESSES_DATA,\n\tFETCH_FAIL_DATA,\n\tFETCH_INIT_DATA,\n\tFETCH_PACKAGES_DATA,\n\tFETCH_SUCCESS_DATA,\n\tPOST_GUIDE_DATA,\n\tPOST_PICKUP_DATA,\n\tPOST_RATE_DATA,\n\tPackage,\n\tDataActions,\n\tLabel,\n\tServiceResponse,\n\tNewAddress,\n\tREMOVE_PACKAGE,\n\tCLEAR_ADDRESS_DATA,\n\tCLEAR_PARCEL_NUMBERS,\n\t// CreatedLabel,\n\tShipmentSendResponse,\n\tSET_CARRIERS,\n\tCarrierList\n} from '../actions/ActionTypes';\n\ntype DataState = {\n\taddresses: NewAddress[];\n\tpackages: Package[];\n\t//token: string | null;\n\n\t//del rate\n\tservices: ServiceResponse[];\n\tcreatedLabels: Array;\n\ttotalCost: number;\n\n\t//para pickup\n\tlabels: Label[];\n\tpickupMessage: string;\n\n\terrorMessageData: string;\n\t// when fetching\n\tisLoading: boolean;\n\n\tcarriers: CarrierList;\n};\n\nconst initialState: DataState = {\n\taddresses: [],\n\tpackages: [],\n\tlabels: [],\n\n\tpickupMessage: '',\n\n\tservices: [],\n\tcreatedLabels: [],\n\ttotalCost: 0,\n\n\terrorMessageData: '',\n\t// when fetching\n\tisLoading: false,\n\n\tcarriers: []\n};\n\nconst DataReducer = (state: DataState = initialState, action: DataActions): DataState => {\n\tlet nextState: DataState;\n\tswitch (action.type) {\n\t\tcase FETCH_ADDRESSES_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.addresses = action.addresses;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase FETCH_PACKAGES_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.packages = action.packages;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CLEAR_ADDRESS_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.addresses = [];\n\t\t\t});\n\t\t\tbreak;\n\t\tcase ADD_PACKAGE_TEMP_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.packages.push(action.package);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase EDIT_PACKAGE_TEMP_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tconst index = draft.packages.findIndex((pkg) => pkg.id === action.package.id);\n\t\t\t\tdraft.packages[index] = action.package;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase REMOVE_PACKAGE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.packages = draft.packages.filter((pkg) => pkg.id !== action.id);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase ADD_ADDRESS_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.addresses.push(action.address);\n\t\t\t\tdraft.addresses.sort((a, b) => {\n\t\t\t\t\tif (a.scope < b.scope) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t\tif (a.scope > b.scope) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn 0;\n\t\t\t\t});\n\t\t\t});\n\t\t\tbreak;\n\t\tcase FETCH_INIT_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.isLoading = true;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase FETCH_FAIL_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.isLoading = false;\n\t\t\t\tdraft.errorMessageData = action.message;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase FETCH_SUCCESS_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.isLoading = false;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase POST_RATE_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.services = action.services;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CLEAR_ERROR_FETCH_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.errorMessageData = '';\n\t\t\t});\n\t\t\tbreak;\n\t\tcase POST_GUIDE_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.createdLabels = action.labels;\n\t\t\t\tdraft.totalCost = action.total;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase POST_PICKUP_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.pickupMessage = action.response;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CLEAR_SERVICES_DATA:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.services = [];\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CLEAR_PARCEL_NUMBERS:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.createdLabels = [];\n\t\t\t\tdraft.totalCost = 0;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_CARRIERS:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.carriers = action.carriers;\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n\treturn nextState;\n};\n\nexport default DataReducer;\n","import produce from 'immer';\nimport {\n\tAppActions,\n\tPackage,\n\tSET_MAPS_COORDINATES,\n\tSET_DESTINATION_COORDINATES,\n\tRESET_PACKAGE_TO_EDIT,\n\tWILL_EDIT_PACKAGE,\n\tSET_GOOGLE_MAPS_SCRIPT,\n\tSET_GOOGLE_MAP,\n\tSET_GOOGLE_MAPS_MARKER,\n\tSET_GOOGLE_MAPS_DESTINATION_MARKER,\n\tSET_GOOGLE_MAPS_POLYLINE,\n} from '../actions/ActionTypes';\n\ntype AppState = {\n\t//when clic on edit\n\teditingPackage: Package | null;\n\t// to handle coordinates\n\taddressCoordinates: { lat: number; lng: number } | null;\n\tdestinationCoordinates: { lat: number; lng: number } | null;\n\t// if scripts loads\n\tisLoadedGoogleMapsScript: boolean;\n\t// googlemaps\n\tmap: google.maps.Map | null;\n\t// marker of goolge maps\n\tmarker: google.maps.Marker | null;\n\tdestinationMarker: google.maps.Marker | null;\n\t// line\n\tpathPolyline: google.maps.Polyline | null;\n};\n\nconst initialState: AppState = {\n\taddressCoordinates: null,\n\tdestinationCoordinates: null,\n\teditingPackage: null,\n\tisLoadedGoogleMapsScript: false,\n\tmap: null,\n\tmarker: null,\n\tdestinationMarker: null,\n\tpathPolyline: null,\n};\n\nconst AppReducer = (state: AppState = initialState, action: AppActions): AppState => {\n\tlet nextState: AppState;\n\tswitch (action.type) {\n\t\tcase SET_MAPS_COORDINATES:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.addressCoordinates = action.coordinates;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_DESTINATION_COORDINATES:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.destinationCoordinates = action.coordinates;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase WILL_EDIT_PACKAGE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.editingPackage = action.pkg;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase RESET_PACKAGE_TO_EDIT:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.editingPackage = null;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_GOOGLE_MAPS_SCRIPT:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.isLoadedGoogleMapsScript = action.status;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_GOOGLE_MAP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.map = action.map;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_GOOGLE_MAPS_MARKER:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.marker = action.marker;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_GOOGLE_MAPS_DESTINATION_MARKER:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.destinationMarker = action.marker;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_GOOGLE_MAPS_POLYLINE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.pathPolyline = action.path;\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n\treturn nextState;\n};\n\nexport default AppReducer;\n","import produce from 'immer';\nimport {\n\tADD_LABEL_PICKUP,\n\tSET_LABELS_PICKUP,\n\tAddressRequest,\n\tCAN_CONTINUE_TO_EDIT_PICKUP,\n\tCAN_CONTINUE_TO_SUMMARY_PICKUP,\n\tCAN_MOVE_TO_BOOKLET_PICKUP,\n\tCANCEL_PICKUP,\n\tContact,\n\tFETCH_PICKUPS,\n\tPickUpActions,\n\tPickUpLabelDetails,\n\tREMOVE_LABEL_PICKUP,\n\tRESET_LABELS_PICKUP,\n\tRESET_PICKUP,\n\tSET_ADDRESS_PICKUP,\n\tSET_CARRIER_FOLIO_PICKUP,\n\tSET_CARRRIER_PICKUP,\n\tSET_CONTACT_PICKUP,\n\tSET_DATE_PICKUP,\n\tSET_EXTRA_INDICATIONS_PICKUP,\n\tSET_INDICATIONS_PICKUP,\n\tSET_PICKUP_DETAILS,\n\tSET_REASON_PICKUP,\n\tSET_STATUS_PICKUP,\n\tSET_TIME_PICKUP,\n\tShipmentPickUpResponse,\n\tShipmentSendResponse,\n\tTRIGGER_VALIDATE_BEFORE_SUMMARY_PICKUP,\n\tUPDATE_PICKUP,\n\tUPDATE_PICKUP_DETAILS,\n\tSET_INSURANCE_FOR_PICKUP,\n\tSET_PICKUP_SUPERVISOR,\n\tSET_PICKUP_NOTES\n} from '../actions/ActionTypes';\nimport { PickupStatus } from '~util/cellStatusColor';\n\ntype PickUpState = {\n\tlabelsPickup: ShipmentSendResponse[];\n\taddressPickUp: AddressRequest | null;\n\tavailableContactsPickUp: Contact[];\n\tindicationsPickUp: string;\n\textraIndicationsPickUp: string;\n\tdatePickUp: Date | null;\n\tstartTimePickUp: Date | null;\n\tendTimePickUp: Date | null;\n\tisTouchedPickup: boolean; // if will trigger validations\n\tcanContinueToSummaryPickUp: boolean;\n\tcarrierPickup: string;\n\tcanMoveToBookletPickup: boolean;\n\n\tpickUpStatus: string;\n\tpickUpReason: string;\n\tpickUpCarrierFolio: string;\n\tpickupSupervisor: string;\n\tpickupNotes: string;\n\n\tcanContinueToEditPickUp: boolean;\n\n\t// TODO remove?\n\tpickups: ShipmentPickUpResponse[];\n\n\tinsuranceForOrder: boolean;\n};\n\nconst initialState: PickUpState = {\n\tlabelsPickup: [],\n\taddressPickUp: null,\n\tavailableContactsPickUp: [],\n\tindicationsPickUp: '',\n\textraIndicationsPickUp: '',\n\tdatePickUp: null,\n\tstartTimePickUp: null,\n\tendTimePickUp: null,\n\tisTouchedPickup: false,\n\tcanContinueToSummaryPickUp: false,\n\tcarrierPickup: '',\n\tcanMoveToBookletPickup: false,\n\n\tpickUpStatus: '',\n\tpickUpReason: '',\n\tpickUpCarrierFolio: '',\n\tpickupSupervisor: '',\n\tpickupNotes: '',\n\n\tcanContinueToEditPickUp: false,\n\n\tpickups: [],\n\n\tinsuranceForOrder: false\n};\n\nconst PickUpReducer = (state: PickUpState = initialState, action: PickUpActions): PickUpState => {\n\tlet nextState: PickUpState;\n\tswitch (action.type) {\n\t\tcase RESET_PICKUP:\n\t\t\treturn initialState;\n\t\tcase RESET_LABELS_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.labelsPickup = [];\n\t\t\t\tdraft.canContinueToSummaryPickUp = false;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_ADDRESS_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.addressPickUp = Object.assign({}, action.address);\n\t\t\t\tdraft.availableContactsPickUp = action.contacts;\n\t\t\t\tif (action.contacts.length === 1 && draft.addressPickUp) {\n\t\t\t\t\tdraft.addressPickUp.contact = Object.assign({}, action.contacts[0]);\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_CONTACT_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tif (draft.addressPickUp) {\n\t\t\t\t\tdraft.addressPickUp.contact = action.contact;\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase ADD_LABEL_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.labelsPickup.push(action.label);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_LABELS_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.labelsPickup = action.labels;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase REMOVE_LABEL_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.labelsPickup = draft.labelsPickup.filter((l) => l.parcel_number !== action.id);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_INDICATIONS_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.indicationsPickUp = action.indications;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_EXTRA_INDICATIONS_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.extraIndicationsPickUp = action.extra_indications;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_DATE_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.datePickUp = action.date;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_TIME_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tif (action.target === 'start') {\n\t\t\t\t\tdraft.startTimePickUp = action.time;\n\t\t\t\t} else {\n\t\t\t\t\tdraft.endTimePickUp = action.time;\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase TRIGGER_VALIDATE_BEFORE_SUMMARY_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.isTouchedPickup = action.status;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CAN_CONTINUE_TO_SUMMARY_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.canContinueToSummaryPickUp =\n\t\t\t\t\tBoolean(draft.addressPickUp) &&\n\t\t\t\t\tBoolean(draft.addressPickUp?.contact) &&\n\t\t\t\t\tBoolean(draft.datePickUp) &&\n\t\t\t\t\tBoolean(draft.startTimePickUp) &&\n\t\t\t\t\tBoolean(draft.endTimePickUp) &&\n\t\t\t\t\tdraft.labelsPickup.length > 0 &&\n\t\t\t\t\tBoolean(draft.carrierPickup);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CAN_MOVE_TO_BOOKLET_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.canMoveToBookletPickup = action.value;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_CARRRIER_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.carrierPickup = action.carrier;\n\t\t\t});\n\t\t\tbreak;\n\n\t\tcase FETCH_PICKUPS:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.pickups = action.pickups;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CANCEL_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.pickups = draft.pickups.map((p) => {\n\t\t\t\t\tif (p.id === action.id) {\n\t\t\t\t\t\tp.status = PickupStatus.CANCELLED;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn p;\n\t\t\t\t});\n\t\t\t});\n\t\t\tbreak;\n\t\tcase UPDATE_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.pickups = draft.pickups.map((p) => {\n\t\t\t\t\tif (p.id === action.pickup.id) {\n\t\t\t\t\t\treturn { ...p, ...action.pickup, details: p.details };\n\t\t\t\t\t}\n\n\t\t\t\t\treturn p;\n\t\t\t\t});\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_PICKUP_DETAILS:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tconst index = draft.pickups.findIndex((p) => p.id === action.id);\n\t\t\t\tdraft.pickups[index].details = Object.assign({}, action.details);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase UPDATE_PICKUP_DETAILS:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tconst pickup = draft.pickups.find((p) => p.id === action.id);\n\t\t\t\tif (!pickup) {\n\t\t\t\t\tconsole.log('@@@ No pickup was found in UPDATE_PICKUP_DETAILS');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tpickup.labels = action.labels.map((l) => l.parcel_number);\n\t\t\t\tconst details: PickUpLabelDetails = {};\n\t\t\t\taction.labels.forEach((l) => {\n\t\t\t\t\tdetails[l.parcel_number] = {\n\t\t\t\t\t\torigin: l.origin,\n\t\t\t\t\t\tdestination: l.destination,\n\t\t\t\t\t\tpackages: l.packages\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\tpickup.details = details;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_STATUS_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.pickUpStatus = action.status;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_CARRIER_FOLIO_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.pickUpCarrierFolio = action.carrierFolio;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_REASON_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.pickUpReason = action.reason;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CAN_CONTINUE_TO_EDIT_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.canContinueToEditPickUp =\n\t\t\t\t\tBoolean(draft.addressPickUp) &&\n\t\t\t\t\tBoolean(draft.addressPickUp?.contact) &&\n\t\t\t\t\tBoolean(draft.datePickUp) &&\n\t\t\t\t\tBoolean(draft.startTimePickUp) &&\n\t\t\t\t\tBoolean(draft.endTimePickUp);\n\n\t\t\t\tif (action.isAgent) {\n\t\t\t\t\tdraft.canContinueToEditPickUp =\n\t\t\t\t\t\tdraft.canContinueToEditPickUp && Boolean(draft.pickUpStatus);\n\n\t\t\t\t\t// if (draft.pickUpStatus === PickupStatus.PENDING) {\n\t\t\t\t\t//\tdraft.canContinueToEditPickUp =\n\t\t\t\t\t//\t\tdraft.canContinueToEditPickUp &&\n\t\t\t\t\t//\t\tBoolean(draft.pickUpCarrierFolio);\n\t\t\t\t\t//}\n\n\t\t\t\t\tif (draft.pickUpStatus === PickupStatus.EXCEPTED) {\n\t\t\t\t\t\tdraft.canContinueToEditPickUp =\n\t\t\t\t\t\t\tdraft.canContinueToEditPickUp && Boolean(draft.pickUpReason);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_INSURANCE_FOR_PICKUP:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.insuranceForOrder = action.insuranceForOrder;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_PICKUP_SUPERVISOR:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.pickupSupervisor = action.pickupSupervisor;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_PICKUP_NOTES:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.pickupNotes = action.pickupNotes;\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n\treturn nextState;\n};\n\nexport default PickUpReducer;\n","import produce from 'immer';\nimport {\n\tADD_PACKAGE_SEND,\n\tADD_MERCHANDISE_PACKAGE_SEND,\n\tAddressRequest,\n\tCAN_CONTINUE_TO_RATE_SEND,\n\tCAN_CONTINUE_TO_SUMMARY_SEND,\n\tContact,\n\tPackage,\n\tREMOVE_PACKAGE_SEND,\n\tRESET_SEND,\n\tRESET_SERVICE_SEND,\n\tSendActions,\n\tServiceRequest,\n\tSET_ADDRESS_QUERY,\n\tSET_BATCH_ID,\n\tSET_DESTINATION_ADDRESS_SEND,\n\tSET_DESTINATION_CONTACT_SEND,\n\tSET_ESTAFETA_OUTPUT_TYPE,\n\tSET_EXTRA_INFORMATION,\n\tSET_FORM_PACKAGES_VALID_SEND,\n\tSET_FORMATTED_ADDRESS,\n\tSET_INSURANCE_ON_SUMMARY,\n\tSET_ORIGIN_ADDRESS_SEND,\n\tSET_ORIGIN_CONTACT_SEND,\n\tSET_RATE_ID,\n\tSET_SAVE_ESTAFETA_OUTPUT_TYPE,\n\tSET_SERVICE_SEND,\n\tSWIPE_ADDRESS_SEND,\n\tTRIGGER_VALIDATE_BEFORE_RATE_SEND,\n\tUPDATE_COLUMN_PACKAGE_SEND,\n\tSET_USE_TRADING,\n\tSET_NOTIFICATIONS,\n\tNotificationContacts,\n\tNewBusiness,\n\tChannel,\n\tRESET_PACKAGES\n} from '../actions/ActionTypes';\n\ntype SendState = {\n\toriginAddressSend: AddressRequest | null;\n\tdestinationAddressSend: AddressRequest | null;\n\n\toriginFormattedAddress: any | null;\n\tdestinationFormattedAddress: any | null;\n\n\tcurrentPackagesSend: Package[];\n\tserviceSend: ServiceRequest | null;\n\testafetaOutputType: string | null;\n\twantsToSaveOutputTypeForEstafeta: boolean;\n\tavailableOriginContactsSend: Contact[];\n\tavailableDestinationContactsSend: Contact[];\n\tcanContinueToRateSend: boolean;\n\tcanContinueToSummarySend: boolean;\n\tisTouchedSend: boolean;\n\tareFormPkgsValidSend: boolean;\n\tshowInsuranceOnSummary: boolean;\n\tbatchId: string | null;\n\trateId: string | null;\n\n\toriginQuery: string | null;\n\tdestinationQuery: string | null;\n\tadditionalInfo: string;\n\treference: string;\n\tchannel?: Channel;\n\n\tvalue: string;\n\n\tbusiness?: NewBusiness;\n\tnotifications?: NotificationContacts;\n};\n\nconst initialState: SendState = {\n\toriginAddressSend: null,\n\tdestinationAddressSend: null,\n\n\toriginFormattedAddress: null,\n\tdestinationFormattedAddress: null,\n\n\tcurrentPackagesSend: [],\n\tserviceSend: null,\n\testafetaOutputType: null,\n\twantsToSaveOutputTypeForEstafeta: false,\n\tavailableOriginContactsSend: [],\n\tavailableDestinationContactsSend: [],\n\tcanContinueToRateSend: false,\n\tcanContinueToSummarySend: false,\n\tisTouchedSend: false,\n\tareFormPkgsValidSend: false,\n\tshowInsuranceOnSummary: false,\n\tbatchId: null,\n\trateId: null,\n\n\toriginQuery: null,\n\tdestinationQuery: null,\n\tadditionalInfo: '',\n\treference: '',\n\tchannel: undefined,\n\n\tvalue: 'prepaid',\n\n\tnotifications: undefined,\n\tbusiness: undefined\n};\n\nconst SendReducer = (state: SendState = initialState, action: SendActions): SendState => {\n\tlet nextState: SendState;\n\tswitch (action.type) {\n\t\tcase RESET_SEND:\n\t\t\treturn initialState;\n\t\tcase ADD_PACKAGE_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.currentPackagesSend.push(action.pkg);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase ADD_MERCHANDISE_PACKAGE_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tconst index = draft.currentPackagesSend.findIndex((p) => p.pkg_id === action.pkg_id);\n\t\t\t\tif (index === -1) return;\n\t\t\t\tif (!draft.currentPackagesSend[index].merchandise) {\n\t\t\t\t\tdraft.currentPackagesSend[index].merchandise = [];\n\t\t\t\t}\n\t\t\t\tdraft.currentPackagesSend[index].merchandise?.push(action.payload);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CAN_CONTINUE_TO_RATE_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.canContinueToRateSend =\n\t\t\t\t\tBoolean(draft.originAddressSend) &&\n\t\t\t\t\tBoolean(draft.originAddressSend?.contact) &&\n\t\t\t\t\tBoolean(draft.destinationAddressSend) &&\n\t\t\t\t\tBoolean(draft.destinationAddressSend?.contact) &&\n\t\t\t\t\tBoolean(draft.currentPackagesSend.length > 0) &&\n\t\t\t\t\tdraft.areFormPkgsValidSend;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CAN_CONTINUE_TO_SUMMARY_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.canContinueToSummarySend = draft.canContinueToRateSend && Boolean(draft.serviceSend);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_ORIGIN_ADDRESS_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.originAddressSend = action.address;\n\t\t\t\tdraft.availableOriginContactsSend = action.contacts;\n\t\t\t\tif (action.contacts.length === 1 && draft.originAddressSend) {\n\t\t\t\t\tdraft.originAddressSend.contact = action.contacts[0];\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_DESTINATION_ADDRESS_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.destinationAddressSend = action.address;\n\t\t\t\tdraft.availableDestinationContactsSend = action.contacts;\n\t\t\t\tif (action.contacts.length === 1 && draft.destinationAddressSend) {\n\t\t\t\t\tdraft.destinationAddressSend.contact = action.contacts[0];\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_ORIGIN_CONTACT_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tif (draft.originAddressSend) {\n\t\t\t\t\tdraft.originAddressSend.contact = action.contact;\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_DESTINATION_CONTACT_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tif (draft.destinationAddressSend) {\n\t\t\t\t\tdraft.destinationAddressSend.contact = action.contact;\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase REMOVE_PACKAGE_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.currentPackagesSend = draft.currentPackagesSend.filter((p) => p.pkg_id !== action.id);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase RESET_PACKAGES:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.currentPackagesSend = [];\n\t\t\t\tdraft.isTouchedSend = false;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_SERVICE_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.serviceSend = action.service;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SWIPE_ADDRESS_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tconst temp = draft.destinationAddressSend;\n\t\t\t\tdraft.destinationAddressSend = draft.originAddressSend;\n\t\t\t\tdraft.originAddressSend = temp;\n\t\t\t\tconst tempContacts = draft.availableDestinationContactsSend;\n\t\t\t\tdraft.availableDestinationContactsSend = draft.availableOriginContactsSend;\n\t\t\t\tdraft.availableOriginContactsSend = tempContacts;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase TRIGGER_VALIDATE_BEFORE_RATE_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.isTouchedSend = action.status;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_FORM_PACKAGES_VALID_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.areFormPkgsValidSend = action.status;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase UPDATE_COLUMN_PACKAGE_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tconst index = draft.currentPackagesSend.findIndex((p) => p.pkg_id === action.pkg_id);\n\t\t\t\tif (index === -1) return;\n\t\t\t\tfor (const [key, value] of Object.entries(action.payload)) {\n\t\t\t\t\tif (key === 'merchandise') continue;\n\t\t\t\t\tswitch (key) {\n\t\t\t\t\t\tcase 'quantity':\n\t\t\t\t\t\t\tif (!action.merchandiseId) {\n\t\t\t\t\t\t\t\tdraft.currentPackagesSend[index][key] = value as number;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'insurance':\n\t\t\t\t\t\tcase 'height':\n\t\t\t\t\t\tcase 'width':\n\t\t\t\t\t\tcase 'length':\n\t\t\t\t\t\tcase 'weight':\n\t\t\t\t\t\t\tdraft.currentPackagesSend[index][key] = value as number;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'type':\n\t\t\t\t\t\tcase 'alias':\n\t\t\t\t\t\tcase 'measurement':\n\t\t\t\t\t\tcase 'content':\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tdraft.currentPackagesSend[index][key] = value as string;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tcase 'is_irregular_delivery':\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tdraft.currentPackagesSend[index][key] = value as boolean;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (index === -1 || !draft.currentPackagesSend[index].merchandise) return;\n\t\t\t\tconst merchandiseIndex = draft.currentPackagesSend[index].merchandise?.findIndex(\n\t\t\t\t\t(m) => m.id === action.merchandiseId\n\t\t\t\t);\n\t\t\t\tif (merchandiseIndex === -1) return;\n\n\t\t\t\tfor (const [key, value] of Object.entries(action.payload)) {\n\t\t\t\t\tswitch (key) {\n\t\t\t\t\t\tcase 'currency':\n\t\t\t\t\t\tcase 'description':\n\t\t\t\t\t\tcase 'product_code':\n\t\t\t\t\t\tcase 'unit_code':\n\t\t\t\t\t\t\tif (!!draft.currentPackagesSend[index].merchandise) {\n\t\t\t\t\t\t\t\t//@ts-ignore\n\t\t\t\t\t\t\t\tdraft.currentPackagesSend[index].merchandise[merchandiseIndex][key] =\n\t\t\t\t\t\t\t\t\tvalue as string;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'value':\n\t\t\t\t\t\t\tif (!!draft.currentPackagesSend[index].merchandise) {\n\t\t\t\t\t\t\t\t//@ts-ignore\n\t\t\t\t\t\t\t\tdraft.currentPackagesSend[index].merchandise[merchandiseIndex][key] =\n\t\t\t\t\t\t\t\t\tvalue as number;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'quantity':\n\t\t\t\t\t\t\tif (!!draft.currentPackagesSend[index].merchandise && action.merchandiseId) {\n\t\t\t\t\t\t\t\t//@ts-ignore\n\t\t\t\t\t\t\t\tdraft.currentPackagesSend[index].merchandise[merchandiseIndex].quantity =\n\t\t\t\t\t\t\t\t\ttypeof value === 'string' ? parseInt(value) : value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\n\t\tcase SET_INSURANCE_ON_SUMMARY:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.showInsuranceOnSummary = action.status;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_BATCH_ID:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.batchId = action.batchId;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_RATE_ID:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.rateId = action.rateId;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_ADDRESS_QUERY:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tif (action.target === 'origin') draft.originQuery = action.query;\n\t\t\t\telse draft.destinationQuery = action.query;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase RESET_SERVICE_SEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.serviceSend = null;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_FORMATTED_ADDRESS:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.originFormattedAddress = action.origin;\n\t\t\t\tdraft.destinationFormattedAddress = action.destination;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_ESTAFETA_OUTPUT_TYPE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.estafetaOutputType = action.outputType;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_SAVE_ESTAFETA_OUTPUT_TYPE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.wantsToSaveOutputTypeForEstafeta = action.save;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_EXTRA_INFORMATION:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.reference = action.reference;\n\t\t\t\tdraft.additionalInfo = action.additionalInfo;\n\t\t\t\tdraft.business = action.business || undefined;\n\t\t\t\tdraft.channel = action.channel || undefined;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_NOTIFICATIONS:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.notifications = action.notifications;\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn state;\n\t\tcase SET_USE_TRADING:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.value = action.value;\n\t\t\t});\n\t}\n\treturn nextState;\n};\n\nexport default SendReducer;\n","import produce from 'immer';\nimport {\n\tSET_DESTINATION_ADDRESS_RATE,\n\tSET_ORIGIN_ADDRESS_RATE,\n\tRESET_RATE,\n\tADD_PACKAGE_RATE,\n\tREMOVE_PACKAGE_RATE,\n\tUPDATE_COLUMN_PACKAGE_RATE,\n\tTRIGGER_VALIDATE_BEFORE_RATE_RATE,\n\tCAN_CONTINUE_TO_RATE_RATE,\n\tSET_FORM_PACKAGES_VALID_RATE,\n\tPackage,\n\tRateActions,\n\tAddressRequest,\n\tTOGGLE_ORIGIN_ADDRESS_COMPONENT,\n\tTOGGLE_DESTINATION_ADDRESS_COMPONENT\n} from '../actions/ActionTypes';\n\ntype RateState = {\n\toriginAddressRate: AddressRequest | null;\n\tdestinationAddressRate: AddressRequest | null;\n\toriginAddressComponent: 'input' | 'maps';\n\tdestinationAddressComponent: 'input' | 'maps';\n\tcurrentPackagesRate: Package[];\n\tcanContinueToRateRate: boolean;\n\tisTouchedRate: boolean;\n\tareFormPkgsValidRate: boolean;\n};\n\nconst initialState: RateState = {\n\toriginAddressRate: null,\n\tdestinationAddressRate: null,\n\tcurrentPackagesRate: [],\n\tcanContinueToRateRate: false,\n\tisTouchedRate: false,\n\tareFormPkgsValidRate: false,\n\toriginAddressComponent: 'input',\n\tdestinationAddressComponent: 'maps'\n};\n\nexport const RateReducer = (state: RateState = initialState, action: RateActions): RateState => {\n\tlet nextState: RateState;\n\tswitch (action.type) {\n\t\tcase SET_DESTINATION_ADDRESS_RATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.destinationAddressRate = action.address;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_ORIGIN_ADDRESS_RATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.originAddressRate = action.address;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase RESET_RATE:\n\t\t\treturn initialState;\n\t\tcase ADD_PACKAGE_RATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.currentPackagesRate.push(action.pkg);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase REMOVE_PACKAGE_RATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.currentPackagesRate = draft.currentPackagesRate.filter(\n\t\t\t\t\t(p) => (p.pkg_id ? p.pkg_id : p.id) !== action.id\n\t\t\t\t);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase UPDATE_COLUMN_PACKAGE_RATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tconst index = draft.currentPackagesRate.findIndex(\n\t\t\t\t\t(p) => (p.pkg_id ? p.pkg_id : p.id) === action.id\n\t\t\t\t);\n\t\t\t\tif (index === -1) return;\n\t\t\t\tconst key = Object.keys(action.payload)[0];\n\t\t\t\tconst value = Object.values(action.payload)[0];\n\t\t\t\tswitch (key) {\n\t\t\t\t\tcase 'quantity':\n\t\t\t\t\tcase 'insurance':\n\t\t\t\t\tcase 'height':\n\t\t\t\t\tcase 'width':\n\t\t\t\t\tcase 'length':\n\t\t\t\t\tcase 'weight':\n\t\t\t\t\t\tdraft.currentPackagesRate[index][key] = value as number;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'type':\n\t\t\t\t\tcase 'content':\n\t\t\t\t\t\tdraft.currentPackagesRate[index][key] = value as string;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'measurement':\n\t\t\t\t\t\tdraft.currentPackagesRate[index][key] = value as 'cm' | 'm';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'is_irregular_delivery':\n\t\t\t\t\t\tdraft.currentPackagesRate[index][key] = value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase TRIGGER_VALIDATE_BEFORE_RATE_RATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.isTouchedRate = action.status;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CAN_CONTINUE_TO_RATE_RATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.canContinueToRateRate =\n\t\t\t\t\tBoolean(draft.originAddressRate) &&\n\t\t\t\t\tBoolean(draft.destinationAddressRate) &&\n\t\t\t\t\tdraft.currentPackagesRate.length > 0 &&\n\t\t\t\t\tdraft.areFormPkgsValidRate;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_FORM_PACKAGES_VALID_RATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.areFormPkgsValidRate = action.status;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase TOGGLE_ORIGIN_ADDRESS_COMPONENT:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tif (draft.originAddressComponent === 'input') {\n\t\t\t\t\tdraft.originAddressComponent = 'maps';\n\t\t\t\t} else {\n\t\t\t\t\tdraft.originAddressComponent = 'input';\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase TOGGLE_DESTINATION_ADDRESS_COMPONENT:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tif (draft.destinationAddressComponent === 'input') {\n\t\t\t\t\tdraft.destinationAddressComponent = 'maps';\n\t\t\t\t} else {\n\t\t\t\t\tdraft.destinationAddressComponent = 'input';\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n\treturn nextState;\n};\n\nexport default RateReducer;\n","import produce from 'immer';\nimport {\n\tSET_DESTINATION_ADDRESS_CREATE,\n\tSET_ORIGIN_ADDRESS_CREATE,\n\tRESET_CREATE,\n\tADD_PACKAGE_CREATE,\n\tREMOVE_PACKAGE_CREATE,\n\tUPDATE_COLUMN_PACKAGE_CREATE,\n\tTRIGGER_VALIDATE_BEFORE_CREATE_CREATE,\n\tCAN_CONTINUE_TO_CREATE_CREATE,\n\tSET_FORM_PACKAGES_VALID_CREATE,\n\tPackage,\n\tContact,\n\tCreateActions,\n\tAddressRequest,\n\tTOGGLE_ORIGIN_ADDRESS_COMPONENT,\n\tTOGGLE_DESTINATION_ADDRESS_COMPONENT\n} from '../actions/ActionTypes';\n\ntype CreateState = {\n\tavailableOriginContactsCreate: Contact[];\n\tavailableDestinationContactsCreate: Contact[];\n\toriginAddressCreate: AddressRequest | null;\n\tdestinationAddressCreate: AddressRequest | null;\n\toriginFormattedAddress: any | null;\n\tdestinationFormattedAddress: any | null;\n\toriginAddressComponent: 'input' | 'autocomplete';\n\tdestinationAddressComponent: 'input' | 'autocomplete';\n\tcurrentPackagesCreate: Package[];\n\tcanContinueToRateCreate: boolean;\n\tcanContinueToCreateCreate: boolean;\n\tisTouchedCreate: boolean;\n\tareFormPkgsValidCreate: boolean;\n};\n\nconst initialState: CreateState = {\n\tavailableOriginContactsCreate: [],\n\tavailableDestinationContactsCreate: [],\n\toriginAddressCreate: null,\n\tdestinationAddressCreate: null,\n\toriginFormattedAddress: null,\n\tdestinationFormattedAddress: null,\n\tcurrentPackagesCreate: [],\n\tcanContinueToCreateCreate: false,\n\tcanContinueToRateCreate: false,\n\tisTouchedCreate: false,\n\tareFormPkgsValidCreate: false,\n\toriginAddressComponent: 'autocomplete',\n\tdestinationAddressComponent: 'autocomplete'\n};\n\nexport const CreateReducer = (\n\tstate: CreateState = initialState,\n\taction: CreateActions\n): CreateState => {\n\tlet nextState: CreateState;\n\tswitch (action.type) {\n\t\tcase SET_DESTINATION_ADDRESS_CREATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.destinationAddressCreate = action.address;\n\t\t\t\tdraft.availableDestinationContactsCreate = action.contacts;\n\t\t\t\tif (action.contacts.length === 1 && draft.destinationAddressCreate) {\n\t\t\t\t\tdraft.destinationAddressCreate.contact = action.contacts[0];\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_ORIGIN_ADDRESS_CREATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.originAddressCreate = action.address;\n\t\t\t\tdraft.availableOriginContactsCreate = action.contacts;\n\t\t\t\tif (action.contacts.length === 1 && draft.originAddressCreate) {\n\t\t\t\t\tdraft.originAddressCreate.contact = action.contacts[0];\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CAN_CONTINUE_TO_CREATE_CREATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.canContinueToRateCreate =\n\t\t\t\t\tBoolean(draft.originAddressCreate) &&\n\t\t\t\t\tBoolean(draft.originAddressCreate?.contact) &&\n\t\t\t\t\tBoolean(draft.destinationAddressCreate) &&\n\t\t\t\t\tBoolean(draft.destinationAddressCreate?.contact) &&\n\t\t\t\t\tBoolean(draft.currentPackagesCreate.length > 0) &&\n\t\t\t\t\tdraft.areFormPkgsValidCreate;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase RESET_CREATE:\n\t\t\treturn initialState;\n\t\tcase ADD_PACKAGE_CREATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.currentPackagesCreate.push(action.pkg);\n\t\t\t});\n\t\t\tbreak;\n\n\t\tcase REMOVE_PACKAGE_CREATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.currentPackagesCreate = draft.currentPackagesCreate.filter(\n\t\t\t\t\t(p) => p.pkg_id !== action.id\n\t\t\t\t);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase UPDATE_COLUMN_PACKAGE_CREATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tconst index = draft.currentPackagesCreate.findIndex((p) => p.pkg_id === action.id);\n\t\t\t\tif (index === -1) return;\n\t\t\t\tconst key = Object.keys(action.payload)[0];\n\t\t\t\tconst value = Object.values(action.payload)[0];\n\t\t\t\tswitch (key) {\n\t\t\t\t\tcase 'quantity':\n\t\t\t\t\tcase 'insurance':\n\t\t\t\t\tcase 'height':\n\t\t\t\t\tcase 'width':\n\t\t\t\t\tcase 'length':\n\t\t\t\t\tcase 'weight':\n\t\t\t\t\t\tdraft.currentPackagesCreate[index][key] = value as number;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'type':\n\t\t\t\t\t\tdraft.currentPackagesCreate[index][key] = value as string;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase TRIGGER_VALIDATE_BEFORE_CREATE_CREATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.isTouchedCreate = action.status;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_FORM_PACKAGES_VALID_CREATE:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.areFormPkgsValidCreate = action.status;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase TOGGLE_ORIGIN_ADDRESS_COMPONENT:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tif (draft.originAddressComponent === 'input') {\n\t\t\t\t\tdraft.originAddressComponent = 'autocomplete';\n\t\t\t\t} else {\n\t\t\t\t\tdraft.originAddressComponent = 'input';\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase TOGGLE_DESTINATION_ADDRESS_COMPONENT:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tif (draft.destinationAddressComponent === 'input') {\n\t\t\t\t\tdraft.destinationAddressComponent = 'autocomplete';\n\t\t\t\t} else {\n\t\t\t\t\tdraft.destinationAddressComponent = 'input';\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n\treturn nextState;\n};\n\nexport default CreateReducer;\n","import produce from 'immer';\nimport {\n\tRESET_CONSOLIDATED,\n\tSTART_CONSOLIDATED,\n\tSET_CARRIERS_CONSOLIDATED,\n\tSET_CONSOLIDATED_ORIGIN_FORM,\n\tSET_CONSOLIDATED_DESTINATION_FORM,\n\tSET_CONSOLIDATED_SPECIALS,\n\tConsolidatedActions,\n\tCANCEL_CONSOLIDATED,\n\tSET_OPTION_CONSOLIDATED,\n\tID,\n\tSET_PICK_UP_CONSOLIDATED,\n\tSET_DELIVER_CONSOLIDATED,\n\t//TRIGGER_VALIDATE_BEFORE_CONSOLIDATED,\n} from '../actions/ActionTypes';\n\ntype ConsolidatedState = {\n\twillBeConsolidated: boolean;\n\tcurrentCarriersConsolidated: string[];\n\t//when will select the service\n\toptionConsolidated: ID;\n\n\tuseOriginRequirements: boolean;\n\tuseDestinationRequirements: boolean;\n\toriginRequirements: {\n\t\tmaneuvers: string;\n\t\tthree_meter_distance: string;\n\t\tpickup_description: string;\n\t} | null;\n\tdestinationRequirements: {\n\t\tmaneuvers: string;\n\t\tthree_meter_distance: string;\n\t\tpickup_description: string;\n\t} | null;\n\tspecials: [];\n\tselectedCarriers: string[];\n};\n\nconst initialState: ConsolidatedState = {\n\twillBeConsolidated: false,\n\tcurrentCarriersConsolidated: [],\n\toriginRequirements: null,\n\tdestinationRequirements: null,\n\toptionConsolidated: '',\n\tspecials: [],\n\tuseOriginRequirements: false,\n\tuseDestinationRequirements: false,\n\tselectedCarriers: []\n};\n\nconst ConsolidatedReducer = (\n\tstate: ConsolidatedState = initialState,\n\taction: ConsolidatedActions\n): ConsolidatedState => {\n\tlet nextState: ConsolidatedState;\n\tswitch (action.type) {\n\t\tcase RESET_CONSOLIDATED:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.willBeConsolidated = false;\n\t\t\t\tdraft.currentCarriersConsolidated = [];\n\t\t\t\tdraft.optionConsolidated = '';\n\t\t\t\tdraft.originRequirements = null;\n\t\t\t\tdraft.destinationRequirements = null;\n\t\t\t\tdraft.specials = [];\n\t\t\t\tdraft.selectedCarriers = [];\n\t\t\t\tdraft.useDestinationRequirements = false;\n\t\t\t\tdraft.useOriginRequirements = false;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase START_CONSOLIDATED:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.willBeConsolidated = true;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CANCEL_CONSOLIDATED:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.willBeConsolidated = false;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_CARRIERS_CONSOLIDATED:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.currentCarriersConsolidated = action.carriers;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_CONSOLIDATED_ORIGIN_FORM:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.originRequirements = action.form;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_CONSOLIDATED_DESTINATION_FORM:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.destinationRequirements = action.form;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_CONSOLIDATED_SPECIALS:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.specials = action.form;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_OPTION_CONSOLIDATED:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.optionConsolidated = action.option;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_DELIVER_CONSOLIDATED:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.useDestinationRequirements = action.status;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_PICK_UP_CONSOLIDATED:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.useOriginRequirements = action.status;\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n\treturn nextState;\n};\n\nexport default ConsolidatedReducer;\n","import produce from 'immer';\nimport {\n\tBookletServiceForm,\n\t// NewAddress,\n\t//AddressRequest,\n\tCreateOrUpdateCustomerActions,\n\t// RESET_CUCUSTOMER,\n\t// SET_ADDRESS_INFO_DRAFT_CUCUSTOMER,\n\t// SET_GENERAL_INFO_DRAFT_CUCUSTOMER,\n\t// SET_GENERAL_INFO_VALID_CUCUSTOMER,\n\t// SET_LEGAL_INFO_DRAFT_CUCUSTOMER,\n\t// SET_LEGAL_INFO_VALID_CUCUSTOMER,\n\tSET_SERVICES_CUCUSTOMER,\n\t// SET_TOUCHED_ADDRESS_CUCUSTOMER,\n\t// SET_EDITING_ADDRESS_CUCUSTOMER,\n} from '~store/actions/ActionTypes';\n\n// type CUCustomerState = {\n// \tgeneralInfoDraftCUCustomer: any | null;\n// \tlegalInfoDraftCUCustomer: any | null;\n// \taddressCUCustomer: NewAddress | null;\n// \tisTouchedCUCustomer: boolean;\n// \tservicesInfoDraftCUCustomer: BookletServiceForm[];\n// \tidCustomerEditingCUCustomer: number;\n// \tidUserEditingCUCustomer: number;\n\n// \t// For validations\n// \tgeneralInfoIsValidCUCustomer: boolean;\n// \tlegalInfoIsValidCUCustomer: boolean;\n// };\n\ntype CUCustomerState = {\n\tservicesInfoDraftCUCustomer: BookletServiceForm[];\n};\n\nconst initialState: CUCustomerState = {\n\tservicesInfoDraftCUCustomer: [],\n};\n\n// const initialState: CUCustomerState = {\n// \tgeneralInfoDraftCUCustomer: null,\n// \tlegalInfoDraftCUCustomer: null,\n// \tservicesInfoDraftCUCustomer: [],\n// \taddressCUCustomer: null,\n// \tisTouchedCUCustomer: false,\n// \tidCustomerEditingCUCustomer: 0,\n// \tidUserEditingCUCustomer: 0,\n// \tgeneralInfoIsValidCUCustomer: false,\n// \tlegalInfoIsValidCUCustomer: false,\n// };\n\nconst createOrCustomerReducer = (\n\tstate: CUCustomerState = initialState,\n\taction: CreateOrUpdateCustomerActions\n): CUCustomerState => {\n\tlet nextState: CUCustomerState;\n\tswitch (action.type) {\n// \t\tcase RESET_CUCUSTOMER:\n// \t\t\treturn initialState;\n// \t\tcase SET_ADDRESS_INFO_DRAFT_CUCUSTOMER:\n// \t\t\tnextState = produce(state, (draft) => {\n// \t\t\t\tdraft.addressCUCustomer = action.address;\n// \t\t\t});\n// \t\t\tbreak;\n// \t\tcase SET_TOUCHED_ADDRESS_CUCUSTOMER:\n// \t\t\tnextState = produce(state, (draft) => {\n// \t\t\t\tdraft.isTouchedCUCustomer = action.touched;\n// \t\t\t});\n// \t\t\tbreak;\n// \t\tcase SET_GENERAL_INFO_DRAFT_CUCUSTOMER:\n// \t\t\tnextState = produce(state, (draft) => {\n// \t\t\t\tdraft.generalInfoDraftCUCustomer = action.form;\n// \t\t\t});\n// \t\t\tbreak;\n// \t\tcase SET_GENERAL_INFO_VALID_CUCUSTOMER:\n// \t\t\tnextState = produce(state, (draft) => {\n// \t\t\t\tdraft.generalInfoIsValidCUCustomer = action.valid;\n// \t\t\t});\n// \t\t\tbreak;\n// \t\tcase SET_LEGAL_INFO_DRAFT_CUCUSTOMER:\n// \t\t\tnextState = produce(state, (draft) => {\n// \t\t\t\tdraft.legalInfoDraftCUCustomer = action.form;\n// \t\t\t});\n// \t\t\tbreak;\n// \t\tcase SET_LEGAL_INFO_VALID_CUCUSTOMER:\n// \t\t\tnextState = produce(state, (draft) => {\n// \t\t\t\tdraft.legalInfoIsValidCUCustomer = action.valid;\n// \t\t\t});\n// \t\t\tbreak;\n\t\tcase SET_SERVICES_CUCUSTOMER:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.servicesInfoDraftCUCustomer = action.services;\n\t\t\t});\n\t\t\tbreak;\n// \t\tcase SET_EDITING_ADDRESS_CUCUSTOMER:\n// \t\t\tnextState = produce(state, (draft) => {\n// \t\t\t\tdraft.idCustomerEditingCUCustomer = action.idCustomer;\n// \t\t\t\tdraft.idUserEditingCUCustomer = action.idUser;\n// \t\t\t});\n// \t\t\tbreak;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n\treturn nextState;\n};\n\nexport default createOrCustomerReducer;\n","import produce from 'immer';\nimport {\n\tCLEAR_ERROR_SIMULATED_USER,\n\tCustomerDetails,\n\tRESET_SIMULATED_USER,\n\tSET_SIMULATED_CUSTOMER_SIMULATED_USER,\n\tSET_SIMULATED_USER,\n\tTRIGGER_ERRORS_SIMULATED_USER,\n\tSimulatedUserActions,\n\tUserDetails,\n} from '~store/actions/ActionTypes';\n\ntype SimulatedUserState = {\n\t// When is agent or root\n\tsimulatedUser: UserDetails | null;\n\tsimulatedCustomer: CustomerDetails | null;\n\tisTouchedSimulatedUser: boolean;\n\tcanPostSimulatedUser: boolean;\n};\n\nconst initialState: SimulatedUserState = {\n\tsimulatedUser: null,\n\tsimulatedCustomer: null,\n\tcanPostSimulatedUser: false,\n\tisTouchedSimulatedUser: false,\n};\n\nconst SimulatedUserReducer = (\n\tstate: SimulatedUserState = initialState,\n\taction: SimulatedUserActions\n): SimulatedUserState => {\n\tlet nextState: SimulatedUserState;\n\tswitch (action.type) {\n\t\tcase RESET_SIMULATED_USER:\n\t\t\treturn initialState;\n\t\tcase SET_SIMULATED_USER:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.simulatedUser = action.user;\n\t\t\t\tdraft.canPostSimulatedUser = Boolean(action.user);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_SIMULATED_CUSTOMER_SIMULATED_USER:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.simulatedCustomer = action.customer;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase TRIGGER_ERRORS_SIMULATED_USER:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.isTouchedSimulatedUser = true;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase CLEAR_ERROR_SIMULATED_USER:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.isTouchedSimulatedUser = false;\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n\treturn nextState;\n};\n\nexport default SimulatedUserReducer;\n","import produce from 'immer';\nimport { MultiSendActions, RESET_MULTISEND, SET_CARRIER_MULTISEND, SET_SERVICE_MULTISEND } from '~store/actions/ActionTypes';\n\ntype MultiSendState = {\n\tcarrierMultiSend: string | null;\n\tserviceMultiSend: string | null;\n};\n\nconst initialState: MultiSendState = {\n\tcarrierMultiSend: null,\n\tserviceMultiSend: null,\n};\n\nconst multiSendReducer = (state: MultiSendState = initialState, action: MultiSendActions): MultiSendState => {\n\tlet nextState: MultiSendState;\n\tswitch (action.type) {\n\t\tcase RESET_MULTISEND:\n\t\t\treturn initialState;\n\t\tcase SET_CARRIER_MULTISEND:\n\t\t\tnextState = produce(state, (draft) => {\n\t\t\t\tdraft.carrierMultiSend = action.carrier;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase SET_SERVICE_MULTISEND:\n\t\t\tnextState = produce(state, draft => {\n\t\t\t\tdraft.serviceMultiSend = action.service;\n\t\t\t})\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n\treturn nextState;\n};\n\nexport default multiSendReducer;\n","import thunk from 'redux-thunk';\nimport { createStore, combineReducers, applyMiddleware, compose } from 'redux';\nimport { useSelector as useReduxSelector, TypedUseSelectorHook } from 'react-redux';\n\nimport FlowReducer from './reducers/FlowReducer';\nimport DataReducer from './reducers/DataReducer';\nimport AppReducer from './reducers/AppReducer';\nimport PickUpReducer from './reducers/PickUpReducer';\nimport SendReducer from './reducers/SendReducer';\nimport RateReducer from './reducers/RateReducer';\nimport CreateReducer from './reducers/CreateReducer';\nimport ConsolidatedReducer from './reducers/ConsolidatedReducer';\nimport CreateOrUpdateCustomerReducer from './reducers/agents/CreateorUpdateCustomerReducer';\nimport SimulatedUserReducer from './reducers/agents/SimulatedUserReducer';\nimport MultiSendReducer from './reducers/MultiSendReducer';\n\nconst rootReducer = combineReducers({\n\t//maps:\n\tflow: FlowReducer,\n\tsend: SendReducer,\n\tmultisend: MultiSendReducer,\n\trate: RateReducer,\n\tconsolidated: ConsolidatedReducer,\n\tpickup: PickUpReducer,\n\tdata: DataReducer,\n\tapp: AppReducer,\n\tcreate: CreateReducer,\n\tsimulatedUser: SimulatedUserReducer,\n\tcuCustomer: CreateOrUpdateCustomerReducer\n});\n\nconst composeEnhancers =\n\ttypeof window === 'object' && (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n\t\t? (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\n\t\t\t\t// Specify extension’s options like name, actionsBlacklist, actionsCreators, serialize...\n\t\t\t\ttrace: true\n\t\t })\n\t\t: compose;\n\nconst enhancer = composeEnhancers(applyMiddleware(thunk));\n\nconst mainStore = createStore(rootReducer, enhancer);\n\nexport type RootStore = ReturnType;\n// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/2ab7a8073719008b169a3069977cc66f2e87a1e2/types/react-redux/index.d.ts#L544\nexport const useSelector: TypedUseSelectorHook = useReduxSelector;\n\nexport default mainStore;\n","import React, { useEffect, useState, useContext } from 'react';\nimport { Autocomplete } from '@material-ui/lab';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { useHistory } from 'react-router-dom';\nimport { Plus as PlusIcon } from 'react-feather';\nimport { Button, IconButton, Typography, createFilterOptions } from '@mui/material';\nimport DrawContext from '~context/DrawContext';\n\nimport RenderInput from './_RenderInput';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\n\nimport { useAddBtnAutocompleteStyles } from '../../hooks/useStyles';\nimport { addPkgSend, addPkgRate } from '../../store/actions';\nimport { Package } from '../../store/actions/ActionTypes';\nimport { RootStore } from '../../store/store';\nimport useInputSearchPackages from '../../hooks/useInputSearchPackages';\n\nlet showAddBtn = true;\nlet isRating = false;\n\nconst PlusButtonAutoComplete: React.FC<{ children?: React.ReactNode }> = (props) => {\n\tconst history = useHistory();\n\tconst dispatch = useDispatch();\n\tconst { btnAutocompleteClasses } = useAddBtnAutocompleteStyles();\n\n\treturn (\n\t\t\n\t\t\t{showAddBtn && (\n\t\t\t\t {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}}\n\t\t\t\t\tclassName={btnAutocompleteClasses.btnAdd}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tif (isRating) {\n\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\taddPkgRate({\n\t\t\t\t\t\t\t\t\tid: new Date().toISOString(),\n\t\t\t\t\t\t\t\t\tpkg_id: '',\n\t\t\t\t\t\t\t\t\tquantity: 1,\n\t\t\t\t\t\t\t\t\tinsurance: 0,\n\t\t\t\t\t\t\t\t\talias: '',\n\t\t\t\t\t\t\t\t\ttype: '',\n\t\t\t\t\t\t\t\t\theight: 1,\n\t\t\t\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\t\t\t\tlength: 1,\n\t\t\t\t\t\t\t\t\tweight: 1,\n\t\t\t\t\t\t\t\t\tmeasurement: 'cm',\n\t\t\t\t\t\t\t\t\tmerchandise: [],\n\t\t\t\t\t\t\t\t\tcontent: ''\n\t\t\t\t\t\t\t\t} as Package)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\thistory.push('/paquete');\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t) => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisableRipple\n\t\t\t\t\t\tclassName={btnAutocompleteClasses.iconAdd}\n\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t  Agregar nuevo empaque\n\t\t\t\t\n\t\t\t)}\n\t\t\t{props.children}\n\t\t\n\t);\n};\n\n// Filter search for Contact\nconst filterOptionsPackage = createFilterOptions({\n\ttrim: true,\n\tstringify: (option) => JSON.stringify(option)\n});\n\n// to handle add package\nconst idForNewPackage = 'newPackage';\n\ninterface Props {\n\tlabel: string; //passed to the render param\n\n\tisRating?: boolean; //when ratting\n\t// isCreating?: boolean;\n\n\t/**\n\t * Callback for package when is on form\n\t */\n\tonClick?: (pkg: Package) => void;\n\n\tshouldDisable?: boolean; //when already adding a package in form\n}\n\n/**\n * Autocomplete for search packages\n */\nconst InputSearchPackage: React.FC = (props) => {\n\tconst dispatch = useDispatch();\n\tconst history = useHistory();\n\n\tconst { data: packages } = useInputSearchPackages();\n\tconst { isTouchedSend, currentPackagesSend } = useSelector((state: RootStore) => state.send);\n\tconst { isTouchedRate, currentPackagesRate } = useSelector((state: RootStore) => state.rate);\n\tconst { currentFlow } = useSelector((state: RootStore) => state.flow);\n\n\tconst [pkg, setPkg] = useState(null);\n\tconst [disable, setDisable] = useState(false);\n\tconst [showError, setShowError] = useState(false);\n\n\tisRating = Boolean(props.isRating);\n\n\t// Clear error\n\t//validate that there is at least one package\n\tuseEffect(() => {\n\t\tif (currentFlow === 'send' && isTouchedSend) {\n\t\t\tsetShowError(currentPackagesSend.length === 0);\n\t\t} else if (currentFlow === 'rate' && isTouchedRate) {\n\t\t\tsetShowError(currentPackagesRate.length === 0);\n\t\t}\n\t}, [\n\t\tcurrentFlow,\n\t\tisTouchedSend,\n\t\tcurrentPackagesSend.length,\n\t\tisTouchedRate,\n\t\tcurrentPackagesRate.length\n\t]);\n\n\tconst { setNotification } = useContext(DrawContext);\n\n\t// to give some kind of timeout to setPkg(null) take effect on the input when is on the package form\n\tuseEffect(() => {\n\t\tsetDisable(Boolean(props.shouldDisable));\n\t}, [props.shouldDisable]);\n\n\tconst handleChangePackage = (value: Package | null) => {\n\t\tlet pkg: Package = {\n\t\t\tid: value!.id,\n\t\t\tpkg_id: new Date().toISOString(),\n\t\t\talias: value!.alias,\n\t\t\ttype: value!.type,\n\t\t\theight: value!.height,\n\t\t\twidth: value!.width,\n\t\t\tlength: value!.length,\n\t\t\tweight: value!.weight,\n\t\t\tmeasurement: value!.measurement,\n\t\t\tmerchandise: value!.merchandise,\n\t\t\tcontent: value!.content\n\t\t};\n\n\t\tif (props.onClick) {\n\t\t\tprops.onClick(pkg);\n\t\t} else {\n\t\t\t// Check if trying combine pallet with other package\n\t\t\tlet canAddPkg = true;\n\t\t\tconst pkgs = isRating ? currentPackagesRate : currentPackagesSend;\n\t\t\tif (pkg.type === 'Tarima')\n\t\t\t\tcanAddPkg = pkgs.length > 0 ? pkgs.every((pkg) => pkg.type === 'Tarima') : true;\n\t\t\telse canAddPkg = pkgs.length > 0 ? pkgs.every((pkg) => pkg.type !== 'Tarima') : true;\n\n\t\t\tif (!canAddPkg) {\n\t\t\t\tsetNotification({\n\t\t\t\t\tseverity: 'error',\n\t\t\t\t\tmessage: 'Tarimas deben documentarse por separado'\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tpkg = { ...pkg, quantity: 1 };\n\t\t\tif (isRating) dispatch(addPkgRate(pkg));\n\t\t\telse dispatch(addPkgSend(pkg));\n\t\t}\n\t};\n\n\treturn (\n\t\t {\n\t\t\t\tconst filtered = filterOptionsPackage(options, params);\n\t\t\t\tif (props.onClick) {\n\t\t\t\t\tshowAddBtn = false;\n\t\t\t\t\treturn filtered;\n\t\t\t\t}\n\n\t\t\t\tif (props.isRating) {\n\t\t\t\t\treturn filtered;\n\t\t\t\t}\n\n\t\t\t\t// Suggest the creation of a new value\n\t\t\t\tif (params.inputValue !== '' && filtered.length === 0) {\n\t\t\t\t\tshowAddBtn = false;\n\t\t\t\t\tfiltered.push({\n\t\t\t\t\t\tid: idForNewPackage,\n\t\t\t\t\t\tpkg_id: '',\n\t\t\t\t\t\talias: 'Agregar Nuevo Paquete- ' + params.inputValue,\n\t\t\t\t\t\theight: 1,\n\t\t\t\t\t\tlength: 1,\n\t\t\t\t\t\tweight: 1,\n\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\ttype: '',\n\t\t\t\t\t\tmeasurement: 'cm',\n\t\t\t\t\t\tcontent: ''\n\t\t\t\t\t} as Package);\n\t\t\t\t} else {\n\t\t\t\t\tshowAddBtn = true;\n\t\t\t\t}\n\n\t\t\t\treturn filtered;\n\t\t\t}}\n\t\t\tgetOptionSelected={(option, value) => option.id === value.id || value.id === idForNewPackage}\n\t\t\tgetOptionLabel={(option) => `${option.alias}`}\n\t\t\toptions={packages || []}\n\t\t\trenderInput={(params) => (\n\t\t\t\t\n\t\t\t)}\n\t\t\tvalue={pkg}\n\t\t\tnoOptionsText='No se encontraron paquetes'\n\t\t\tonChange={(_, value) => {\n\t\t\t\tif (typeof value !== 'string') {\n\t\t\t\t\tif (value?.id === idForNewPackage) {\n\t\t\t\t\t\thistory.push('/paquete');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t//reset the search\n\t\t\t\t\tsetPkg(null);\n\t\t\t\t\thandleChangePackage(value);\n\t\t\t\t}\n\t\t\t}}\n\t\t/>\n\t);\n};\n\nexport default InputSearchPackage;\n","import usePagination from './usePagination';\nimport { Package } from '../store/actions/ActionTypes';\nimport { Items } from '../util/pagination';\nimport usePermissions from './usePermissions';\n\nexport default function useInputSearchPackages(limit = Items.InputSearch) {\n\tconst { isRootOrAgent, can } = usePermissions();\n\tconst { data: packages } = usePagination({\n\t\turl: '/api/items',\n\t\tlimit: limit,\n\t\tparam: 'page',\n\t\tqueryParams: isRootOrAgent ? ['user_id'] : [],\n\t\tcanHaveActions: can('canRead.packages')\n\t});\n\n\treturn {\n\t\tdata: packages\n\t};\n}\n","import React, { SetStateAction, Dispatch, useCallback, useEffect, useState } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { TextField } from '@mui/material';\nimport { Autocomplete } from '@material-ui/lab';\nimport { Controller } from 'react-hook-form';\nimport { useLocation } from 'react-router-dom';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\nimport { updatePkgSend, updatePkgRate } from '../../store/actions';\nimport { ID } from '~store/actions/ActionTypes';\nimport { useSelector } from '~store/store';\nimport axiosInstance from '~util/axios';\nimport { setPackageContentOptions, setUninsurablePackages } from '~store/actions/FlowActions';\n\ninterface Props {\n\t// Function to pass the selected value\n\tcontrol: any;\n\terrors: any;\n\tdefaultValue?: string;\n\tsetValue?: (name: string, value: unknown, config?: { shouldValidate?: boolean }) => void;\n\tsetRequireDescription?: Dispatch>;\n\tpackageId?: ID;\n\tfieldName?: string;\n\tfieldError?: any;\n}\n\nexport type PackagingContentItem = {\n\tcontent: string;\n\tcan_be_assured?: boolean;\n\tinsurance_description?: string;\n};\n\n/**\n * Autocomplete for \"Contenido de paquete\"\n */\nconst PackageContentField: React.FC = ({\n\tcontrol,\n\terrors,\n\tdefaultValue,\n\tsetValue,\n\tsetRequireDescription,\n\tpackageId,\n\tfieldName,\n\tfieldError\n}) => {\n\tconst location = useLocation();\n\tconst dispatch = useDispatch();\n\tconst { currentFlow } = useSelector((state) => state.flow);\n\tconst [contentOptions, setContentOptions] = useState([]);\n\n\tconst getPackagingContent = useCallback(async () => {\n\t\ttry {\n\t\t\tconst { data } = await axiosInstance.get('/api/sat/packagingContent');\n\t\t\tdispatch(\n\t\t\t\tsetUninsurablePackages(\n\t\t\t\t\tdata\n\t\t\t\t\t\t?.filter((item: PackagingContentItem) => !item?.can_be_assured)\n\t\t\t\t\t\t?.map((item: PackagingContentItem) => item.content)\n\t\t\t\t)\n\t\t\t);\n\t\t\tdispatch(setPackageContentOptions(data?.map((item: PackagingContentItem) => item.content)));\n\t\t\tsetContentOptions(data);\n\t\t} catch (error) {\n\t\t\tconsole.error({ error });\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tuseEffect(() => {\n\t\tgetPackagingContent();\n\t}, [getPackagingContent]);\n\n\treturn (\n\t\t (\n\t\t\t\t\n\t\t\t\t\t\toption.insurance_description\n\t\t\t\t\t\t\t? `${option.content} (${option.insurance_description})`\n\t\t\t\t\t\t\t: option.content\n\t\t\t\t\t}\n\t\t\t\t\tgetOptionSelected={(option, value) => option.content === value.content}\n\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\tlet newTitle = data ? data.content : '';\n\t\t\t\t\t\tsetRequireDescription &&\n\t\t\t\t\t\t\tsetRequireDescription(newTitle === 'Otro' || newTitle === 'Muestras');\n\t\t\t\t\t\tsetValue && setValue('content', data, { shouldValidate: true });\n\n\t\t\t\t\t\tif (!packageId) return;\n\n\t\t\t\t\t\tif (currentFlow === 'send') {\n\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\tupdatePkgSend(packageId, {\n\t\t\t\t\t\t\t\t\tcontent: data.content\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (currentFlow === 'rate') {\n\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\tupdatePkgRate(packageId, {\n\t\t\t\t\t\t\t\t\tcontent: data.content\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\tname={fieldName ?? 'package_content'}\n\t\t\tcontrol={control}\n\t\t\trules={{ required: true }}\n\t\t\tdefaultValue={defaultValue ? { content: defaultValue } : null}\n\t\t/>\n\t);\n};\n\nexport default PackageContentField;\n","import React, { useState, useEffect, useMemo } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { useDebounce } from 'use-debounce';\nimport { TextField, Grid } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport clsx from 'clsx';\nimport { Autocomplete } from '@material-ui/lab';\n\nimport { useSelector } from '~store/store';\nimport { setIndicationsPickUp, setExtraIndicationsPickUp } from '~store/actions';\nimport { radiusCard, useCardStyles } from '~hooks/useStyles';\nimport { PickupStatus } from '~util/cellStatusColor';\nimport { useHistory } from 'react-router-dom';\nimport { HeadingOne } from '~components/Headings';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tpadding: theme.spacing(3),\n\t\theight: 270,\n\t\t//width: 477,\n\t\t'&>*': {\n\t\t\tmarginTop: theme.spacing(3)\n\t\t},\n\t\tborderRadius: `0 ${radiusCard}px ${radiusCard}px 0`\n\t},\n\tformWidth: {\n\t\twidth: '100%',\n\t\tmaxWidth: 400\n\t}\n}));\n\n/**\n * Las indicaciones en Pick Up\n */\nconst InfoPickUpCard = ({\n\twithoutTitle,\n\taddPickup\n}: {\n\twithoutTitle?: boolean;\n\taddPickup?: boolean;\n}) => {\n\tconst classes = useStyles();\n\tconst history = useHistory();\n\tconst isEditingPickup = useMemo(() => {\n\t\treturn (\n\t\t\t!history.location.pathname.includes('recolecciones') &&\n\t\t\thistory.location.pathname.includes('recoleccion')\n\t\t);\n\t}, [history.location.pathname]);\n\tconst { cardClasses } = useCardStyles();\n\tconst dispatch = useDispatch();\n\n\tconst { indicationsPickUp, extraIndicationsPickUp, isTouchedPickup, pickUpStatus } = useSelector(\n\t\t(state) => state.pickup\n\t);\n\tconst [extraIndications, setExtraIndications] = useState(extraIndicationsPickUp);\n\tconst [debounceExtraIndications] = useDebounce(extraIndications, 1000);\n\n\tuseEffect(() => {\n\t\tdispatch(setExtraIndicationsPickUp(debounceExtraIndications));\n\t}, [dispatch, debounceExtraIndications]);\n\n\tuseEffect(() => {\n\t\t// This can happen when going into editing a pickup and the time we update\n\t\t// the value in the useEffect hook in UpdateShipment/AddressSelector.tsx\n\t\tif (extraIndicationsPickUp !== extraIndications) {\n\t\t\tsetExtraIndications(extraIndicationsPickUp);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [extraIndicationsPickUp]);\n\n\tconst shouldBeDisabled = useMemo(() => {\n\t\tif (isEditingPickup)\n\t\t\treturn (pickUpStatus.length > 0 && pickUpStatus !== PickupStatus.PENDING) || false;\n\t\telse return false;\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [pickUpStatus]);\n\n\treturn (\n\t\t\n\t\t\t{!withoutTitle && (\n\t\t\t\t\n\t\t\t)}\n\t\t\t\n\t\t\t\t option}\n\t\t\t\t\tgetOptionSelected={(option, value) => option === value}\n\t\t\t\t\tonChange={(_, value) => {\n\t\t\t\t\t\tvalue && dispatch(setIndicationsPickUp(value as string));\n\t\t\t\t\t}}\n\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t\n\t\t\t\n\t\t\t\t setExtraIndications(e.target.value)}\n\t\t\t\t\tvalue={extraIndications}\n\t\t\t\t\tclassName={classes.formWidth}\n\t\t\t\t\tdisabled={shouldBeDisabled || (withoutTitle && !addPickup)}\n\t\t\t\t\terror={extraIndications.length > 40}\n\t\t\t\t\tlabel='Comentarios adicionales'\n\t\t\t\t\tmultiline\n\t\t\t\t\tminRows={2}\n\t\t\t\t\tmaxRows={3}\n\t\t\t\t\thelperText={`${extraIndications.length}/40 ${\n\t\t\t\t\t\textraIndications.length > 40 ? 'Límite excedido' : ''\n\t\t\t\t\t}`}\n\t\t\t\t/>\n\t\t\t\n\t\t\n\t);\n};\n\nexport default InfoPickUpCard;\n","import { useState, useCallback, useContext, useEffect } from 'react';\nimport axiosInstance from '~util/axios';\nimport axios from 'axios';\nimport {\n\tShipmentSendResponse,\n\tNewBusiness,\n\tShipmentCompensation,\n\tShipmentModality\n} from '~store/actions/ActionTypes';\nimport moment from 'moment';\nimport DrawContext from '~context/DrawContext';\nimport { useSelector } from '~store/store';\nimport usePermissions from '~hooks/usePermissions';\n\nexport default function useShipmentDetails() {\n\tconst [selectedBusiness, setSelectedBusiness] = useState(null);\n\tconst [pdf, setLabelPDF] = useState('');\n\tconst [errorPDF, setErrorPDF] = useState(false);\n\tconst [loadingPDF, setLoadingPDF] = useState(false);\n\tconst [loadingData, setLoadingData] = useState(true);\n\tconst [loadingSubmit, setLoadingSubmit] = useState(false);\n\tconst [updatedData, setUpdatedData] = useState(null);\n\tconst [businessList, setBusinessList] = useState();\n\n\tconst { isRootOrAgent, can } = usePermissions();\n\tconst { simulatedCustomer } = useSelector((state) => state.simulatedUser);\n\tconst { setNotification } = useContext(DrawContext);\n\tconst canHaveBusinessActions = can('canRead.business');\n\n\t// fetch details when open\n\tconst fetchGuideDetails = useCallback(\n\t\tasync (data: ShipmentSendResponse | null, id: string, carrier: string, isManual?: boolean) => {\n\t\t\ttry {\n\t\t\t\tsetLoadingData(true);\n\t\t\t\tsetErrorPDF(false);\n\t\t\t\tsetLoadingPDF(true);\n\n\t\t\t\tconst carrierValue = !!data ? data.carrier : carrier;\n\t\t\t\tconst guideId = !!data ? data.id : id;\n\t\t\t\tif (!carrierValue || !guideId) return;\n\t\t\t\tconst guideRes = await axiosInstance.get(`api/label/${carrierValue}/${guideId}`);\n\n\t\t\t\tsetLoadingPDF(false);\n\t\t\t\tsetLabelPDF(guideRes.data.label as string);\n\t\t\t\tmoment.locale('es-MX');\n\n\t\t\t\tconst resultData = {\n\t\t\t\t\t...guideRes.data,\n\t\t\t\t\tcreated_at: moment(guideRes.data.created_at).format('LL')\n\t\t\t\t};\n\n\t\t\t\tsetUpdatedData(resultData as ShipmentSendResponse);\n\t\t\t} catch (error) {\n\t\t\t\t// if fails show the fethed data\n\t\t\t\tsetUpdatedData(data);\n\t\t\t\tsetLoadingPDF(false);\n\t\t\t\tsetErrorPDF(true);\n\t\t\t\tsetLabelPDF('');\n\t\t\t\tif (axios.isAxiosError(error)) {\n\t\t\t\t\tif (error.response) {\n\t\t\t\t\t\tsetNotification({\n\t\t\t\t\t\t\tmessage: 'Hubo un error al obtener los datos de la guía',\n\t\t\t\t\t\t\tseverity: 'error'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tsetLoadingData(false);\n\t\t\t}\n\t\t},\n\t\t[setNotification]\n\t);\n\n\tconst getBusiness = useCallback(\n\t\tasync (isRootOrAgent: boolean) => {\n\t\t\ttry {\n\t\t\t\tconst url = '/api/business';\n\t\t\t\tconst { data } = await axiosInstance.get(\n\t\t\t\t\tisRootOrAgent ? `${url}?customer_id=${simulatedCustomer?.id}` : url\n\t\t\t\t);\n\t\t\t\tsetBusinessList(data.data);\n\t\t\t\tupdatedData &&\n\t\t\t\t\tupdatedData.business_id &&\n\t\t\t\t\tsetSelectedBusiness(\n\t\t\t\t\t\tdata.data.find((item: NewBusiness) => item.id === updatedData.business_id)\n\t\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\tsetBusinessList([]);\n\t\t\t\tsetNotification({\n\t\t\t\t\tseverity: 'error',\n\t\t\t\t\tmessage: 'Hubo un error al obtener los datos de facturación',\n\t\t\t\t\ttime: 2000\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[updatedData, simulatedCustomer]\n\t);\n\n\t// Get business options for select and selected business for default\n\tuseEffect(() => {\n\t\tif ((isRootOrAgent && !simulatedCustomer?.id) || !canHaveBusinessActions) {\n\t\t\tsetBusinessList([]);\n\t\t\treturn;\n\t\t}\n\t\tgetBusiness(isRootOrAgent);\n\t}, [simulatedCustomer, isRootOrAgent, canHaveBusinessActions, getBusiness]);\n\n\t// Edit selected business for billing\n\tconst putLabelBusiness = useCallback(\n\t\tasync ({\n\t\t\tpayload,\n\t\t\tcb\n\t\t}: {\n\t\t\tpayload: {\n\t\t\t\tbusiness_id?: number;\n\t\t\t\tcompensation?: ShipmentCompensation;\n\t\t\t\tmodality?: ShipmentModality;\n\t\t\t\tnotes?: string;\n\t\t\t\timmediate_billing?: boolean;\n\t\t\t\tnotification_contacts?: any;\n\t\t\t};\n\t\t\tcb?: () => void;\n\t\t}) => {\n\t\t\ttry {\n\t\t\t\tawait axiosInstance.put(`/api/label/${updatedData?.id}`, payload);\n\t\t\t\tconst selected = businessList?.find((item) => item.id === payload?.business_id);\n\t\t\t\tselected && setSelectedBusiness(selected);\n\t\t\t\tsetNotification({\n\t\t\t\t\tseverity: 'success',\n\t\t\t\t\tmessage: 'Los datos del envío se actualizaron correctamente',\n\t\t\t\t\ttime: 2000\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tsetNotification({\n\t\t\t\t\tseverity: 'error',\n\t\t\t\t\tmessage: `Hubo un error al actualizar los datos del envío`,\n\t\t\t\t\ttime: 2000\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tcb && cb();\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[updatedData, businessList]\n\t);\n\n\tconst addCharges = useCallback(async () => {\n\t\tsetLoadingSubmit(true);\n\t\ttry {\n\t\t\tawait axiosInstance.put(`/api/billing/label/${updatedData?.id}`);\n\t\t\tsetNotification({\n\t\t\t\tseverity: 'success',\n\t\t\t\tmessage: 'Los cargos fueron fueron actualizados correctamente',\n\t\t\t\ttime: 2000\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tlet errorMessage = 'Hubo un error al agregar los cargos';\n\t\t\tif (!axios.isAxiosError(error)) return;\n\n\t\t\tif (error.response?.data?.description?.length) {\n\t\t\t\terror.response?.data?.description?.forEach((item: { [key: string]: string }) => {\n\t\t\t\t\tif (Object.values(item).includes('The label does not have pending charges')) {\n\t\t\t\t\t\terrorMessage = 'La guía no posee cargos pendientes.';\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tsetNotification({\n\t\t\t\tseverity: 'error',\n\t\t\t\tmessage: errorMessage,\n\t\t\t\ttime: 2000\n\t\t\t});\n\t\t} finally {\n\t\t\tsetLoadingSubmit(false);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [updatedData?.id]);\n\n\t// Confirm reused guide\n\tconst confirmReused = useCallback(\n\t\tasync (reused: boolean, parcel_number: string) => {\n\t\t\tsetLoadingSubmit(true);\n\n\t\t\ttry {\n\t\t\t\tawait axiosInstance.post('/api/label/reused', { parcel_number, reused });\n\t\t\t\tsetNotification({\n\t\t\t\t\tseverity: 'success',\n\t\t\t\t\tmessage: 'Tu respuesta ha sido enviada',\n\t\t\t\t\ttime: 2000\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tsetNotification({\n\t\t\t\t\tseverity: 'error',\n\t\t\t\t\tmessage: 'Hubo un error al enviar la respuesta',\n\t\t\t\t\ttime: 2000\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tsetLoadingSubmit(false);\n\t\t\t}\n\t\t},\n\t\t[setNotification]\n\t);\n\n\treturn {\n\t\tfetchGuideDetails,\n\t\tloadingPDF,\n\t\tloadingData,\n\t\terrorPDF,\n\t\tpdf,\n\t\tbusinessList,\n\t\tupdatedData,\n\t\tputLabelBusiness,\n\t\tsetUpdatedData,\n\t\tsetSelectedBusiness,\n\t\tselectedBusiness,\n\t\taddCharges,\n\t\tconfirmReused,\n\t\tloadingSubmit\n\t};\n}\n","import { Grid } from '@mui/material';\nimport React from 'react';\nimport { PermissionsKey } from '~context/AuthContext';\nimport OnlyIf from '~components/Guard/OnlyIf';\nimport { AddButton } from './Controls/AddButton';\n\ninterface Props {\n\trows?: any[];\n\tlinkToAdd: string;\n\tsetFilteredRows?: (rows: any[]) => void;\n\tpermission?: PermissionsKey;\n}\n\nconst TableControls: React.FC = (props) => {\n\treturn (\n\t\t\n\t\t\t{/* @@@ Remove the conditional */}\n\t\t\t{props.permission ? (\n\t\t\t\t\n\t\t\t\t\t{/* {\n\t\t\t\t\t\t\thistory.push(props.linkToAdd);\n\t\t\t\t\t\t\tdispatch(resetFlow());\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\t Nuevo\n\t\t\t\t\t */}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t) : null}\n\t\t\t{/* {props.setFilteredRows && (\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t)} */}\n\t\t
\n\t);\n};\n\nexport default TableControls;\n","import { useState, useCallback } from 'react';\nimport axiosInstance from '~util/axios';\nimport { FedexAvailibityType } from '~store/actions/ActionTypes';\n\ninterface FedexAvailabilityData {\n\t[key: string]: FedexAvailibityType;\n}\n\nconst usePickupAvailability = () => {\n\t// Pickup range for fedex\n\tconst [fedexAvailability, setFedexAvailability] = useState(null);\n\n\t// Check availability for fedex\n\tconst checkFedexAvailability = useCallback(async (zipCode: string) => {\n\t\ttry {\n\t\t\tconst { data } = await axiosInstance.get(\n\t\t\t\t`/api/pickup/fedex/availability?zip_code=${zipCode}`\n\t\t\t);\n\t\t\tconst formatData: { [key: string]: FedexAvailibityType } = {};\n\t\t\tdata.options?.forEach((item: FedexAvailibityType) => {\n\t\t\t\tformatData[item?.pickup_date?.toString()] = item;\n\t\t\t});\n\n\t\t\tsetFedexAvailability(formatData);\n\t\t} catch (error) {\n\t\t\tconsole.error({ error });\n\t\t}\n\t}, []);\n\n\treturn {\n\t\tcheckFedexAvailability,\n\t\tfedexAvailability\n\t};\n};\n\nexport default usePickupAvailability;\n","import { GridColDef, GridCellParams } from '@mui/x-data-grid';\nimport MenuActionButton from '../../../components/Tables/_MenuActionsButton';\nimport StatusCell from '~components/Tables/_StatusCell';\nimport { ProspectValidationStatus } from '~store/actions/ActionTypes';\n\ntype CustomColumns = {\n\tonEdit: (customer_id: number) => void;\n\tonDelete?: (id: number) => void;\n};\n\ntype StatusLabel = {\n\t[key: string]: string;\n};\n\nexport const STATUS_LABELS: StatusLabel = {\n\t[ProspectValidationStatus.PROSPECTING]: 'Prospección',\n\t[ProspectValidationStatus.VALIDATED]: 'Validado',\n\t[ProspectValidationStatus.DOCUMENTATION]: 'Documentación',\n\t[ProspectValidationStatus.REGISTER]: 'Registro',\n\t// TODO:\n\tvalidado_pero_pendiente_tarifas: 'Tarifas Pendientes'\n};\n\nexport default function customerTableColumns({ onEdit, onDelete }: CustomColumns): GridColDef[] {\n\tconst columns: GridColDef[] = [\n\t\t{\n\t\t\tfield: 'Id',\n\t\t\theaderName: 'ID',\n\t\t\tflex: 0.5,\n\t\t\trenderCell: (params) => {\n\t\t\t\treturn

{params.row.prospect_id}

;\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tfield: 'date',\n\t\t\theaderName: 'Fecha',\n\t\t\tflex: 0.5,\n\t\t\trenderCell: (params) => {\n\t\t\t\treturn

{params.row.created_at}

;\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tfield: 'email',\n\t\t\theaderName: 'Email',\n\t\t\tflex: 1,\n\t\t\trenderCell: (params) => {\n\t\t\t\treturn

{params.row.contact.email}

;\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tfield: 'name',\n\t\t\theaderName: 'Nombre',\n\t\t\tflex: 1,\n\t\t\trenderCell: (params) => {\n\t\t\t\treturn

{params.row.contact.name}

;\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tfield: 'phone',\n\t\t\theaderName: 'Teléfono',\n\t\t\tflex: 1,\n\t\t\trenderCell: (params) => {\n\t\t\t\treturn

{params.row.phone_number}

;\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tfield: 'status',\n\t\t\theaderName: 'Estatus',\n\t\t\tflex: 0.75,\n\t\t\trenderCell: (params) => {\n\t\t\t\tconst buttonBackground =\n\t\t\t\t\tparams.row.validation_status === ProspectValidationStatus.DOCUMENTATION\n\t\t\t\t\t\t? '#409cff'\n\t\t\t\t\t\t: params.row.validation_status === ProspectValidationStatus.DOCUMENTATION\n\t\t\t\t\t\t? '#57BBD8'\n\t\t\t\t\t\t: 'dimgray';\n\t\t\t\treturn (\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tfield: 'actions',\n\t\t\theaderName: 'Acciones',\n\t\t\twidth: 120,\n\t\t\tsortable: false,\n\t\t\trenderCell: (params: GridCellParams) => {\n\t\t\t\tconst menuProps: any = {};\n\t\t\t\tif (onEdit) menuProps.onEdit = () => onEdit(params.row.id);\n\t\t\t\t//if (onDelete) menuProps.onDelete = () => onDelete(params.id as number);\n\n\t\t\t\treturn (\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t];\n\n\treturn columns;\n}\n","import { TextField, Grid } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\nimport { Autocomplete } from '@material-ui/lab';\nimport { BookletServiceForm } from '~store/actions/ActionTypes';\nimport { Archive } from 'react-feather';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\n\nconst useStyles = makeStyles((theme) => ({\n\tcontainer: {\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tmarginTop: theme.spacing(2),\n\t\tborderRadius: theme.spacing(1)\n\t},\n\ticon: {\n\t\tmarginBottom: theme.spacing(-1),\n\t\tmarginRight: theme.spacing(1.25)\n\t}\n}));\n\ntype SelectorProps = {\n\toptions: BookletServiceForm[];\n\tonChange: (user: BookletServiceForm) => void;\n\tisEstafeta?: boolean;\n\tselectedService?: BookletServiceForm;\n};\n\nexport default function Selector({\n\toptions,\n\tonChange,\n\tisEstafeta,\n\tselectedService\n}: SelectorProps) {\n\tconst classes = useStyles();\n\n\treturn (\n\t\t\n\t\t\t{!isEstafeta && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\n\t\t\t\n\t\t\t\t option.name}\n\t\t\t\t\tgetOptionSelected={(option, value) => !!option.name && option.name === value.name}\n\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\tclearOnBlur\n\t\t\t\t\tonChange={(_, value) => {\n\t\t\t\t\t\tif (value) {\n\t\t\t\t\t\t\tonChange(value);\n\t\t\t\t\t\t\t// To clear it\n\t\t\t\t\t\t\t// setValue(null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t/>\n\t\t\t\n\t\t\n\t);\n}\n","import React from 'react';\nimport { Grid } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\nimport { User, Folder, ShoppingCart, CheckCircle, DollarSign } from 'react-feather';\n\nconst useStyles = makeStyles(() => ({\n\tfont: {\n\t\tfontWeight: 'bold',\n\t\tfontSize: 15\n\t}\n}));\n\ninterface Props {\n\tgeneralInfo: boolean;\n\tlegalInfo: boolean;\n\tservices: boolean;\n\taddRateStep?: boolean;\n\trateInfo?: boolean;\n}\n\nconst CreateOrUpdateClientControl: React.FC = ({\n\tgeneralInfo,\n\tlegalInfo,\n\tservices,\n\taddRateStep,\n\trateInfo\n}) => {\n\tconst classes = useStyles();\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t{generalInfo ? : }\n\t\t\t\t  Generales\n\t\t\t\n\t\t\t\n\t\t\t\t{legalInfo ? : }\n\t\t\t\t  Facturación\n\t\t\t\n\t\t\t\n\t\t\t\t{services ? : }\n\t\t\t\t  Servicios\n\t\t\t\n\t\t\t{addRateStep && (\n\t\t\t\t\n\t\t\t\t\t{rateInfo ? : }\n\t\t\t\t\t Tarifas\n\t\t\t\t\n\t\t\t)}\n\t\t\n\t);\n};\n\nexport default CreateOrUpdateClientControl;\n","import { FC } from 'react';\nimport { Grid } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { PDFObject } from 'react-pdfobject';\nimport { radiusCard } from '~hooks/useStyles';\nimport { TextTwo } from '~components/Headings';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\tlabelContainer: {\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tborderRadius: radiusCard,\n\t\tpadding: `${theme.spacing(2)} 0`\n\t},\n\tnoPDFTextContainer: {\n\t\tfontStyle: 'italic',\n\t\tbackgroundColor: '#2a2a2e',\n\t\tminHeight: '300px',\n\t\tborderRadius: '4px'\n\t}\n}));\n\ninterface Props {\n\tpdf: string;\n\tisManual?: boolean;\n}\n\nconst LabelContainer: FC = ({ pdf, isManual }) => {\n\tconst classes = useStyles();\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t{pdf === '' ? (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t) : !isManual ? (\n\t\t\t\t\t\n\t\t\t\t) : pdf.includes('pdf') ? (\n\t\t\t\t\t\n\t\t\t\t) : (\n\t\t\t\t\tarchivo complementario\n\t\t\t\t)}\n\t\t\t\n\t\t\n\t);\n};\n\nexport default LabelContainer;\n","const StaticMap = ({\n\taddress,\n\tlatitude,\n\tlongitude\n}: {\n\taddress: string;\n\tlatitude?: number;\n\tlongitude?: number;\n}) => {\n\tconst parameters = longitude && latitude ? `${latitude},${longitude}` : address;\n\n\treturn (\n\t\t window.open(`https://www.google.com/maps/search/?api=1&query=${parameters}`)}\n\t\t\tsrc={`https://maps.googleapis.com/maps/api/staticmap?zoom=14&size=560x500&maptype=roadmap&markers=${parameters}&key=AIzaSyA9mQ-ghQDAssm31Tonf5dCG0ln0SNXyu0`}\n\t\t\tstyle={{ width: '100%', borderRadius: '8px', cursor: 'pointer' }}\n\t\t\talt={address}\n\t\t/>\n\t);\n};\n\nexport default StaticMap;\n","import {\n\tTypography,\n\tTable,\n\tTableContainer,\n\tTableHead,\n\tTableRow,\n\tTableCell,\n\tTableBody,\n\tPaper,\n\tGrid\n} from '@mui/material';\nimport { Package as PackageIcon } from 'react-feather';\n\nimport { ShipmentSendResponse } from '~store/actions/ActionTypes';\nimport { useStyles } from './styles';\nimport { formatPrice } from '~util/formatPrice';\n\nconst PackagesDetail = ({ updatedData }: { updatedData: ShipmentSendResponse }) => {\n\tconst classes = useStyles();\n\n\treturn (\n\t\t
\n\t\t\t{updatedData.packages.map((item, index) => (\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tEmpaque {updatedData.packages.length > 1 ? index + 1 : ''} \n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\tTipo:{item.type}\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\tDimensiones:\n\t\t\t\t\t\t\t\t\t{` ${item.length}x${item.width}x${item.height} ${\n\t\t\t\t\t\t\t\t\t\titem.measurement ?? 'cm'\n\t\t\t\t\t\t\t\t\t}`}\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\tPeso:{item.weight}kg.\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\tValor declarado:{formatPrice(item.insurance ?? 0)}\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\tContenido:\n\t\t\t\t\t\t\t\t\t{item.content}\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t{updatedData?.price && (\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\tPrecio Cotizado:\n\t\t\t\t\t\t\t\t\t\t{formatPrice(updatedData?.price)}\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{item.content === 'Otro' && (\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\tDescripción: {item.description ?? ''}\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t{item.merchandise && (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tCarta Porte\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tClave/Descripción\n\t\t\t\t\t\t\t\t\t\t\t\tCantidad\n\t\t\t\t\t\t\t\t\t\t\t\tUnidad\n\t\t\t\t\t\t\t\t\t\t\t\tPrecio\n\t\t\t\t\t\t\t\t\t\t\t\tSubtotal\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{item.merchandise.map((row: any) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{typeof row.description === 'string' && row.description}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t{row.quantity}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{row.unit_code}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{formatPrice(row.value)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{formatPrice(row.value * row.quantity)}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t)}\n\t\t\t\t
\n\t\t\t))}\n\t\t
\n\t);\n};\n\nexport default PackagesDetail;\n","import { Controller, Control } from 'react-hook-form';\nimport { TextField, Grid } from '@mui/material';\nimport { Autocomplete } from '@material-ui/lab';\n\nimport DropdownPaper from '~components/Forms/DropdownPaper';\n\nimport { useStyles } from './styles';\nimport { ShipmentSendResponse } from '~store/actions/ActionTypes';\n\nconst EditLabelFields = ({\n\tupdatedData,\n\tcontrol\n}: {\n\tupdatedData?: ShipmentSendResponse;\n\tcontrol: Control;\n}) => {\n\tconst classes = useStyles();\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t option}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => value && option === value}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => }\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={updatedData?.modality}\n\t\t\t\t/>\n\t\t\t\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t option}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => value && option === value}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={updatedData?.compensation}\n\t\t\t\t/>\n\t\t\t\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tonChange(e.target.value);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\t\tdefaultValue={updatedData?.notes}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tdefaultValue={updatedData?.notes}\n\t\t\t\t\trules={{\n\t\t\t\t\t\tmaxLength: { value: 256, message: 'La longitud máxima es de 256 caracteres' }\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\n\t\t\n\t);\n};\n\nexport default EditLabelFields;\n","import React, { useMemo } from 'react';\nimport { HeadingTwo, TextOne } from '~components/Headings';\nimport { Grid, Link } from '@mui/material';\nimport { ListItem, List, Divider, Tooltip } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { Download } from 'react-feather';\nimport { FileImg } from '~store/CreateLabelStore';\n\n// const files = [];\n\nexport const useStyles = makeStyles((theme: Theme) => ({\n\tfileContainer: {\n\t\tpadding: theme.spacing(2),\n\t\tmarginTop: theme.spacing(1),\n\t\twidth: '100%'\n\t},\n\tlinkText: {\n\t\tcolor: '#50aac4',\n\t\ttextDecoration: 'underline'\n\t},\n\ticonContainer: {\n\t\tbackgroundColor: '#333537',\n\t\tborderRadius: '50%',\n\t\tpadding: theme.spacing(0.5),\n\t\tdisplay: 'flex',\n\t\talignItems: 'center',\n\t\tcursor: 'pointer',\n\t\twidth: '100%'\n\t},\n\tfullWith: {\n\t\twidth: '100%'\n\t}\n}));\n\nexport const FileLink = ({ file, downloadName }: { file: FileImg; downloadName?: string }) => {\n\tconst classes = useStyles();\n\tconst fileName = useMemo(() => file.path.split('/').at(-1), [file]);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nconst FilesLabelManual = ({ files }: { files: FileImg[] }) => {\n\tconst classes = useStyles();\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t{files?.map((file) => (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t))}\n\t\t\t\n\t\t\n\t);\n};\n\nexport default FilesLabelManual;\n","import React, { useEffect, useMemo, useState } from 'react';\n// hooks and tools\nimport clsx from 'clsx';\nimport { useForm } from 'react-hook-form';\nimport moment from 'moment';\nimport 'moment/locale/es';\nimport { FollowUpLabelStatus } from '~util/cellStatusColor';\nimport useShipmentDetails from './useShipmentDetails';\nimport { useSelector } from 'react-redux';\nimport usePermissions from '~hooks/usePermissions';\nimport { useHistory, useLocation } from 'react-router-dom';\nimport useQuery from '~hooks/useQuery';\nimport { CARRIERS } from '~util/logos';\nimport { Edit, Save } from 'react-feather';\n// store and context\nimport { useDispatch } from 'react-redux';\nimport { setDestinationMapCoordinates, setMapCoordinates } from '~store/actions';\nimport {\n\tAddressRequest,\n\tBillingSchema,\n\tNotificationType,\n\tPackage,\n\tShipmentCompensation,\n\tShipmentModality,\n\tShipmentSendResponse\n} from '~store/actions/ActionTypes';\nimport { RootStore } from '~store/store';\n\n// components\nimport CarrierService from '~components/Tables/CarrierService';\nimport TrackingContainer from '../_TrakingContainer';\nimport LabelContainer from '../_LabelContainer';\nimport AddressSummaryCard from '../../Cards/AddressSummaryCard';\nimport StatusCell from '../../Tables/_StatusCell';\nimport StaticMap from '~components/Maps/StaticMap';\nimport NotificationRow, {\n\tNotificationsContactsFields\n} from '~components/Forms/Notifications/NotificationRow';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\nimport SaveButton from '~components/Tables/Controls/SaveButton';\nimport PackagesDetail from './PackagesDetail';\nimport EditLabelFields from './EditLabelFields';\nimport FilesLabelManual, { FileLink } from './FilesLabelManual';\nimport ConfirmActionDialog from '../ConfirmActionDialog';\n\n// styles and icons\nimport {\n\tTypography,\n\tTextField,\n\tCircularProgress,\n\tGrid,\n\tLinearProgress,\n\tCheckbox,\n\tFormControlLabel,\n\tButton,\n\tList\n} from '@mui/material';\nimport EventAvailableIcon from '@material-ui/icons/EventAvailable';\nimport { Autocomplete } from '@material-ui/lab';\nimport { Truck, Send as SendIcon } from 'react-feather';\nimport { useStyles } from './styles';\n\nconst NOTIFICATION_FIELDS = [\n\t{\n\t\talias: '',\n\t\tphone_number: '',\n\t\tguide_status: '',\n\t\tshipping_mode: '',\n\t\tactive: false\n\t},\n\t{\n\t\talias: '',\n\t\tphone_number: '',\n\t\tguide_status: '',\n\t\tshipping_mode: '',\n\t\tactive: false\n\t}\n];\n\ninterface Props {\n\tdata: ShipmentSendResponse | null;\n\tisManual?: boolean;\n\tisEditLabel: boolean;\n}\n\n/**\n * This is the modal to see the detials of a label\n */\n\nconst ShipmentDetailsContent: React.FC = (props) => {\n\tconst dispatch = useDispatch();\n\tconst classes = useStyles();\n\tconst { errors, control, handleSubmit, getValues, setError, clearErrors } = useForm();\n\tconst history = useHistory();\n\tconst { can, isRoot } = usePermissions();\n\n\tconst {\n\t\tupdatedData,\n\t\tsetUpdatedData,\n\t\tfetchGuideDetails,\n\t\tbusinessList,\n\t\tloadingData,\n\t\tloadingPDF,\n\t\terrorPDF,\n\t\tpdf,\n\t\tselectedBusiness,\n\t\tsetSelectedBusiness,\n\t\tputLabelBusiness,\n\t\taddCharges,\n\t\tconfirmReused,\n\t\tloadingSubmit\n\t} = useShipmentDetails();\n\tconst [loadingPostEdit, setLoadingPostEdit] = useState(false);\n\tconst [immediateSchema, setImmediateSchema] = useState(false);\n\tconst [openConfirmDialog, setOpenConfirmDialog] = useState<\n\t\t'billing' | 'charges' | 'reused' | null\n\t>(null);\n\tconst [isEditing, setIsEditing] = useState(false);\n\n\tconst { simulatedCustomer } = useSelector((state: RootStore) => state.simulatedUser);\n\tconst canHaveBusinessActions = can('canRead.business');\n\tconst location: { state: { carrier: string; id: string } } = useLocation();\n\tconst query = useQuery();\n\tconst dataWithPackagesId = useMemo(() => {\n\t\tconst packages = updatedData?.packages?.map((subItem: Package) => ({\n\t\t\t...subItem,\n\t\t\tid: Date.now()\n\t\t}));\n\t\treturn { ...updatedData, packages };\n\t}, [updatedData]);\n\n\tconst onSubmit = async (data: {\n\t\tmodality?: ShipmentModality;\n\t\tcompensation?: ShipmentCompensation;\n\t\tnotes?: string;\n\t\tnotification_contacts?: {};\n\t}) => {\n\t\tsetLoadingPostEdit(true);\n\t\tconst payload: any = {\n\t\t\tcompensation: data?.compensation || undefined,\n\t\t\tmodality: data?.modality || undefined,\n\t\t\tnotes: data?.notes || undefined\n\t\t};\n\n\t\tputLabelBusiness({\n\t\t\tpayload,\n\t\t\tcb: () => {\n\t\t\t\thistory.push('/envios');\n\t\t\t\tsetLoadingPostEdit(false);\n\t\t\t}\n\t\t});\n\t};\n\n\tconst deliveredTime = useMemo(\n\t\t() =>\n\t\t\tupdatedData?.events?.find((item) => item.description === FollowUpLabelStatus.DELIVERED)\n\t\t\t\t? updatedData?.events?.find((item) => item.description === FollowUpLabelStatus.DELIVERED)\n\t\t\t\t\t\t?.createdAt\n\t\t\t\t: '',\n\t\t[updatedData]\n\t);\n\n\t// fetch details when open\n\tuseEffect(() => {\n\t\tconst paramId = query.get('id');\n\t\tconst carrier = query.get('carrier');\n\t\t(async () =>\n\t\t\tfetchGuideDetails(\n\t\t\t\tprops.data,\n\t\t\t\tparamId ?? location.state?.id,\n\t\t\t\tcarrier ?? location.state?.carrier,\n\t\t\t\tprops.isManual\n\t\t\t))();\n\n\t\treturn () => {\n\t\t\tsetUpdatedData(null);\n\t\t\tsetSelectedBusiness(null);\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\tprops.data,\n\t\tprops.isManual,\n\t\tsetSelectedBusiness,\n\t\tsetUpdatedData,\n\t\tfetchGuideDetails,\n\t\tlocation\n\t]);\n\n\tconst shouldDisplayPdf = useMemo(() => {\n\t\treturn ![FollowUpLabelStatus.EXPIRED, FollowUpLabelStatus.CANCELLED].includes(\n\t\t\tupdatedData?.follow_up as FollowUpLabelStatus\n\t\t);\n\t}, [updatedData]);\n\n\tconst formatUrlParameters = (type: 'origin' | 'destination') => {\n\t\tconst item = type === 'origin' ? updatedData?.origin : updatedData?.destination;\n\t\treturn `${item?.address?.replaceAll(' ', '+')}+${item?.city.replaceAll(\n\t\t\t' ',\n\t\t\t'+'\n\t\t)}+${item?.state.replaceAll(' ', '+')}`;\n\t};\n\n\t// set co0rdinates\n\tuseEffect(() => {\n\t\tconst destinationCoordinates = !!updatedData?.destination.coordinates\n\t\t\t? (updatedData?.destination.coordinates as { lat: number; lng: number })\n\t\t\t: {\n\t\t\t\t\tlat: updatedData?.destination.latitude ?? 0,\n\t\t\t\t\tlng: updatedData?.destination.longitude ?? 0\n\t\t\t };\n\n\t\tconst originCoordinates = !!updatedData?.origin.coordinates\n\t\t\t? (updatedData?.origin.coordinates as { lat: number; lng: number })\n\t\t\t: { lat: updatedData?.origin.latitude ?? 0, lng: updatedData?.origin.longitude ?? 0 };\n\n\t\tdispatch(setMapCoordinates(destinationCoordinates));\n\t\tdispatch(setDestinationMapCoordinates(originCoordinates));\n\t\treturn () => {\n\t\t\tdispatch(setMapCoordinates(null));\n\t\t\tdispatch(setDestinationMapCoordinates(null));\n\t\t};\n\t}, [updatedData, dispatch]);\n\n\tconst createdAtDate = useMemo(\n\t\t() => moment(updatedData?.created_at, 'LL').format('LL') ?? '',\n\t\t[updatedData]\n\t);\n\n\tif (loadingData) {\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\tif (\n\t\t!updatedData ||\n\t\t(canHaveBusinessActions && updatedData.business_id && !businessList) ||\n\t\t(canHaveBusinessActions &&\n\t\t\t!selectedBusiness &&\n\t\t\t!!simulatedCustomer?.id &&\n\t\t\t!!updatedData.business_id)\n\t) {\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\treturn (\n\t\t\n\t\t\t{/* LEFT SIDE: */}\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tCódigo de rastreo\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{updatedData?.tracking_number}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tServicio:\n\t\t\t\t\t\t\t{updatedData.service_description}\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tCreación de guía:\n\t\t\t\t\t\t\t{createdAtDate}\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tN° de Guía:{updatedData.parcel_number}\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t{/* Razón social */}\n\t\t\t\t{canHaveBusinessActions && (\n\t\t\t\t\t
\n\t\t\t\t\t\t item.status !== 'disabled') || []}\n\t\t\t\t\t\t\tgetOptionLabel={(option) => option.business_name}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option.business_name === value.business_name}\n\t\t\t\t\t\t\tonChange={(e, value) => {\n\t\t\t\t\t\t\t\tif (!value) return;\n\t\t\t\t\t\t\t\tconst payload = { business_id: value.id };\n\t\t\t\t\t\t\t\tputLabelBusiness({ payload });\n\t\t\t\t\t\t\t\tsetUpdatedData({\n\t\t\t\t\t\t\t\t\t...updatedData,\n\t\t\t\t\t\t\t\t\tbusiness_id: value.id\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tdisabled={!updatedData?.can_edit_business}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t
\n\t\t\t\t)}\n\t\t\t\t{isRoot && updatedData.billing === BillingSchema.IMMEDIATE && (\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{updatedData?.immediate_billing || immediateSchema ? (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tlabel={
Facturación Inmediata
}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\tsetOpenConfirmDialog('billing');\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tFacturación Inmediata\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t)}\n\t\t\t\t{isRoot && (\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\tsetOpenConfirmDialog('charges');\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tAgregar cargos al reporte\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t)}\n\t\t\t\t{isRoot && updatedData?.notified_reused && (\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\tsetOpenConfirmDialog('reused');\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tConfirmar Reutilizada\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t)}\n\t\t\t\t{/* Estatus */}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tEstatus\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{deliveredTime && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{deliveredTime}\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t{/* Firma guía entregada */}\n\t\t\t\t{!!updatedData?.sign_delivery &&\n\t\t\t\t\tupdatedData?.follow_up === FollowUpLabelStatus.DELIVERED && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tEvidencia Entrega\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{updatedData?.carrier === CARRIERS.FEDEX ||\n\t\t\t\t\t\t\t\tupdatedData?.carrier === CARRIERS.DHL ? (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{!!updatedData?.received_by_name && (\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tRecibió {updatedData?.received_by_name}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t{/* Historial */}\n\t\t\t\t
\n\t\t\t\t\tHistorial\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t{/* RIGHT SIDE: */}\n\t\t\t\n\t\t\t\t{/* Paquetes */}\n\t\t\t\t{!!updatedData?.packages?.length && !!dataWithPackagesId?.packages?.length && (\n\t\t\t\t\t\n\t\t\t\t)}\n\n\t\t\t\t{/* Notificaciones */}\n\t\t\t\t\n\t\t\t\t\t{!props.isEditLabel && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tNotificaciones WhatsApp\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\tsetIsEditing((prev) => !prev);\n\t\t\t\t\t\t\t\t\t\tif (isEditing) {\n\t\t\t\t\t\t\t\t\t\t\tsetLoadingPostEdit(true);\n\t\t\t\t\t\t\t\t\t\t\tconst value = getValues();\n\t\t\t\t\t\t\t\t\t\t\tconst contactIdShipper = updatedData?.notification_contacts?.find(\n\t\t\t\t\t\t\t\t\t\t\t\t(item) => item.type === NotificationType.SHIPPPER\n\t\t\t\t\t\t\t\t\t\t\t)?.contact_id;\n\t\t\t\t\t\t\t\t\t\t\tconst contactIdRecipient = updatedData?.notification_contacts?.find(\n\t\t\t\t\t\t\t\t\t\t\t\t(item) => item.type === NotificationType.RECIPIENT\n\t\t\t\t\t\t\t\t\t\t\t)?.contact_id;\n\n\t\t\t\t\t\t\t\t\t\t\tconst notifications = [\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontact_id: contactIdShipper,\n\t\t\t\t\t\t\t\t\t\t\t\t\tactive: value?.user_active,\n\t\t\t\t\t\t\t\t\t\t\t\t\talias: value?.user_alias,\n\t\t\t\t\t\t\t\t\t\t\t\t\tphone_number: value?.user_phone_number,\n\t\t\t\t\t\t\t\t\t\t\t\t\tguide_status: value?.user_guide_status,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype: NotificationType.SHIPPPER,\n\t\t\t\t\t\t\t\t\t\t\t\t\tshipping_mode: 'Este envío'\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontact_id: contactIdRecipient,\n\t\t\t\t\t\t\t\t\t\t\t\t\tactive: value?.contact_active,\n\t\t\t\t\t\t\t\t\t\t\t\t\talias: value?.contact_alias,\n\t\t\t\t\t\t\t\t\t\t\t\t\tphone_number: value?.contact_phone_number,\n\t\t\t\t\t\t\t\t\t\t\t\t\tguide_status: value?.contact_guide_status,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype: NotificationType.RECIPIENT,\n\t\t\t\t\t\t\t\t\t\t\t\t\tshipping_mode: 'Este envío'\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\t\t\t\tawait putLabelBusiness({\n\t\t\t\t\t\t\t\t\t\t\t\tpayload: { notification_contacts: notifications },\n\t\t\t\t\t\t\t\t\t\t\t\tcb: () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetLoadingPostEdit(false);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tendIcon={!isEditing ? : }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{!isEditing ? 'Editar' : 'Actualizar'}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tAvisar a\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tEstatus guía\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tWhatsApp\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t !!item.type)\n\t\t\t\t\t\t\t\t\t\t\t\t\t? updatedData?.notification_contacts?.find(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(item) => item.type === NotificationType.SHIPPPER\n\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t: updatedData.notification_contacts.find(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(item: NotificationsContactsFields) => Boolean(item.user_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t ) ??\n\t\t\t\t\t\t\t\t\t\t\t\t\t updatedData.notification_contacts.find(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(item: NotificationsContactsFields) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\titem.alias?.toLowerCase() ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatedData.origin?.contact?.name?.toLowerCase()\n\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t: NOTIFICATION_FIELDS[0]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbackgroundColor='inherit'\n\t\t\t\t\t\t\t\t\t\tsetError={setError}\n\t\t\t\t\t\t\t\t\t\tclearErrors={clearErrors}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t !!item.type)\n\t\t\t\t\t\t\t\t\t\t\t\t\t? updatedData?.notification_contacts?.find(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(item) => item.type === NotificationType.RECIPIENT\n\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t: updatedData.notification_contacts?.every((item) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tBoolean(item?.contact_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t? updatedData.notification_contacts.find(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(item: NotificationsContactsFields) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\titem.alias?.toLowerCase() ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatedData.destination?.contact?.name?.toLowerCase()\n\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t: updatedData.notification_contacts.find(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(item: NotificationsContactsFields) => Boolean(item.contact_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t: NOTIFICATION_FIELDS[1]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbackgroundColor='inherit'\n\t\t\t\t\t\t\t\t\t\tsetError={setError}\n\t\t\t\t\t\t\t\t\t\tclearErrors={clearErrors}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* Direcciones */}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t{/* Editar guía: campos de indemnización */}\n\t\t\t\t\t{props.isEditLabel && }\n\n\t\t\t\t\t{/* Mapas */}\n\t\t\t\t\t{!props.isEditLabel && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{updatedData?.origin.latitude && (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{updatedData?.destination.latitude && (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* PDF */}\n\t\t\t\t\t{!props.isEditLabel &&\n\t\t\t\t\t\t(shouldDisplayPdf || (props.isManual && !!updatedData.files?.length)) && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{!errorPDF ? (\n\t\t\t\t\t\t\t\t\t\t!loadingPDF ? (\n\t\t\t\t\t\t\t\t\t\t\t!props.isManual ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\tupdatedData?.files?.map(\n\t\t\t\t\t\t\t\t\t\t\t\t\t(item) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t!item.type?.includes('excel') && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t{/* Detalle guía manual: archivos complementarios */}\n\t\t\t\t\t{!!updatedData?.files?.length && }\n\t\t\t\t\n\t\t\t\n\t\t\t{props.isEditLabel && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tGuardar\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t)}\n\n\t\t\t setOpenConfirmDialog(null)}\n\t\t\t\tbodyText={\n\t\t\t\t\topenConfirmDialog === 'billing'\n\t\t\t\t\t\t? '¿Estás seguro de realizar facturación inmediata?'\n\t\t\t\t\t\t: openConfirmDialog === 'charges'\n\t\t\t\t\t\t? '¿Estás seguro de agregar cargos a esta guía?'\n\t\t\t\t\t\t: '¿Quieres confirmar que la guía fue reutilizada?'\n\t\t\t\t}\n\t\t\t\tcancelBtnLabel={openConfirmDialog === 'reused' ? 'No' : 'Cancelar'}\n\t\t\t\tconfirmBtnLabel={openConfirmDialog === 'reused' ? 'Sí' : 'Confirmar'}\n\t\t\t\thandleClickConfirm={async () => {\n\t\t\t\t\tsetLoadingPostEdit(true);\n\t\t\t\t\tif (openConfirmDialog === 'billing') {\n\t\t\t\t\t\t// Set immediate billing\n\t\t\t\t\t\tawait putLabelBusiness({\n\t\t\t\t\t\t\tpayload: { immediate_billing: true, business_id: updatedData?.business_id },\n\t\t\t\t\t\t\tcb: () => {\n\t\t\t\t\t\t\t\tsetImmediateSchema(true);\n\t\t\t\t\t\t\t\tsetUpdatedData({\n\t\t\t\t\t\t\t\t\t...updatedData,\n\t\t\t\t\t\t\t\t\timmediate_billing: true,\n\t\t\t\t\t\t\t\t\tbusiness_id: updatedData?.business_id,\n\t\t\t\t\t\t\t\t\tbilling: BillingSchema.IMMEDIATE\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (openConfirmDialog === 'charges') {\n\t\t\t\t\t\t// Add charges to report\n\t\t\t\t\t\tawait addCharges();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Set that the guide was reused\n\t\t\t\t\t\tawait confirmReused(true, updatedData?.parcel_number);\n\t\t\t\t\t}\n\t\t\t\t\tsetOpenConfirmDialog(null);\n\t\t\t\t\tsetLoadingPostEdit(false);\n\t\t\t\t}}\n\t\t\t\thandleClickCancel={async () => {\n\t\t\t\t\tif (openConfirmDialog === 'reused') {\n\t\t\t\t\t\t// Set that the guide was not reused\n\t\t\t\t\t\tawait confirmReused(false, updatedData?.parcel_number);\n\t\t\t\t\t\tsetOpenConfirmDialog(null);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsetOpenConfirmDialog(null);\n\t\t\t\t}}\n\t\t\t\tloading={loadingPostEdit || loadingSubmit}\n\t\t\t/>\n\t\t\n\t);\n};\n\nexport default ShipmentDetailsContent;\n","export default __webpack_public_path__ + \"static/media/googlemapsicon.a2d8910f.png\";","import React, { useEffect, useRef, useState } from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { InputAdornment, TextField, CircularProgress } from '@mui/material';\nimport { setGoogleMapsScriptStatus, setMapCoordinates } from '../../store/actions';\n\nimport { RootStore } from '../../store/store';\nimport loadGMaps from '../../js-scripts/loadGMaps';\n\nimport googleMapsIcon from '../../assets/googlemapsicon.png';\n\nexport type Place = {\n\tname?: string;\n\tstreet_number?: string;\n\troute?: string;\n\tsublocality_level_1?: string;\n\tlocality?: string;\n\tadministrative_area_level_1?: string;\n\tcountry?: string;\n\tpostal_code?: string;\n\tcoordinates: {\n\t\tlat: number;\n\t\tlng: number;\n\t};\n\t// municipio\n\t// region?: string;\n};\n\ninterface Props {\n\tsearchCallback: (place: Place) => void;\n\tisRating?: boolean;\n}\n\nconst AutoCompleteMaps: React.FC = (props) => {\n\t/**\n\t * Google Maps Scripts\n\t */\n\tconst dispatch = useDispatch();\n\tconst { isLoadedGoogleMapsScript, map } = useSelector((state: RootStore) => state.app);\n\tconst { isTouchedRate } = useSelector((state: RootStore) => state.rate);\n\n\tconst searchItemRef = useRef(null);\n\tconst [place, setPlace] = useState(null);\n\tconst [showError, setShowError] = useState(false);\n\n\t// Handle the error\n\tuseEffect(() => {\n\t\tif (props.isRating) {\n\t\t\tsetShowError(isTouchedRate && !place);\n\t\t}\n\t}, [props.isRating, isTouchedRate, place]);\n\n\t// clean coordiates if exists\n\tuseEffect(() => {\n\t\tdispatch(setMapCoordinates(null));\n\t}, [dispatch]);\n\n\t// load script\n\tuseEffect(() => {\n\t\tif (!isLoadedGoogleMapsScript) {\n\t\t\tloadGMaps(() => dispatch(setGoogleMapsScriptStatus(true)));\n\t\t}\n\t}, [isLoadedGoogleMapsScript, dispatch]);\n\n\t// set up stuff\n\tuseEffect(() => {\n\t\tif (isLoadedGoogleMapsScript && searchItemRef.current) {\n\t\t\tconst autocomplete = new window.google.maps.places.Autocomplete(searchItemRef.current, {\n\t\t\t\tcomponentRestrictions: { country: 'mx' }\n\t\t\t});\n\t\t\t// TODO remove things that wont be needed because \"municipio\" wont be required to autocomplete\n\t\t\t// Avoid paying for data that you don't need by restricting the set of\n\t\t\t// place fields that are returned to just the address components.\n\t\t\tautocomplete.setFields(['address_components', 'geometry']);\n\t\t\t// autocomplete.setFields(['address_components', 'geometry', 'name', 'adr_address']);\n\t\t\t//autocomplete.setFields();\n\n\t\t\tif (map) {\n\t\t\t\tautocomplete.bindTo('bounds', map);\n\t\t\t}\n\n\t\t\tautocomplete.addListener('place_changed', () => {\n\t\t\t\tconst place = autocomplete.getPlace();\n\t\t\t\t//console.log('place', place);\n\n\t\t\t\tif (!place.geometry) {\n\t\t\t\t\t// UserForm entered the name of a Place that was not suggested and\n\t\t\t\t\t// pressed the Enter key, or the Place Details request failed.\n\t\t\t\t\t//window.alert(\"No details available for input: '\" + place.name + \"'\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If the place has a geometry, then present it on a map.\n\t\t\t\tconst coordinates = {\n\t\t\t\t\tlat: place.geometry.location.lat(),\n\t\t\t\t\tlng: place.geometry.location.lng()\n\t\t\t\t};\n\n\t\t\t\tdispatch(setMapCoordinates(coordinates));\n\n\t\t\t\tconst infoForCallBack: Place = { coordinates: coordinates };\n\n\t\t\t\tfor (const component of place.address_components as google.maps.GeocoderAddressComponent[]) {\n\t\t\t\t\tconst addressType = component.types[0];\n\t\t\t\t\tswitch (addressType) {\n\t\t\t\t\t\tcase 'street_number':\n\t\t\t\t\t\t\tinfoForCallBack[addressType] = component['short_name'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'route':\n\t\t\t\t\t\t\tinfoForCallBack[addressType] = component['long_name'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'sublocality_level_1':\n\t\t\t\t\t\t\tinfoForCallBack[addressType] = component['long_name'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'locality':\n\t\t\t\t\t\t\tinfoForCallBack[addressType] = component['long_name'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'administrative_area_level_1':\n\t\t\t\t\t\t\tinfoForCallBack[addressType] = component['long_name'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'country':\n\t\t\t\t\t\t\tinfoForCallBack[addressType] = component['long_name'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'postal_code':\n\t\t\t\t\t\t\tinfoForCallBack[addressType] = component['short_name'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// This was used to determinate the municipality\n\t\t\t\t// const region = place.adr_address!.toString().match(/(.*?)<\\/span>/g);\n\t\t\t\t// if(region && region?.length > 0){\n\t\t\t\t// \tinfoForCallBack['region'] = region[0].replace(/<\\/?span( class=\"region\")?>/g, '')\n\t\t\t\t// }\n\n\t\t\t\t//console.log(place.adr_address.toString().match(/(.*?)<\\/span>/g));\n\t\t\t\tsetPlace(infoForCallBack);\n\t\t\t\tprops.searchCallback(infoForCallBack);\n\t\t\t});\n\t\t}\n\t}, [map, props, isLoadedGoogleMapsScript, dispatch]);\n\n\tif (!isLoadedGoogleMapsScript) {\n\t\treturn ;\n\t}\n\n\treturn (\n\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)\n\t\t\t}}\n\t\t/>\n\t);\n};\n\nexport default AutoCompleteMaps;\n","import { Theme } from '@mui/material/styles';\nimport { withStyles } from '@mui/styles';\nimport { forwardRef, Ref, ReactElement } from 'react';\nimport { IconButton, Typography, Slide } from '@mui/material';\nimport {\n\tDialog as MuiDialog,\n\tDialogTitle as MuiDialogTitle,\n\tDialogContent as MuiDialogContent\n} from '@mui/material';\nimport { TransitionProps } from '@mui/material/transitions';\nimport { styles } from './styles';\nimport { X } from 'react-feather';\n\n// interface DialogTitleProps extends WithStyles {\n// \tchildren: ReactNode;\n// \tonClose: () => void;\n// }\n\nexport const Transition = forwardRef(function Transition(\n\tprops: TransitionProps & { children: ReactElement },\n\tref: Ref\n) {\n\treturn ;\n});\n\nexport const DialogTitle = (props: any) => {\n\tconst classes = styles();\n\tconst { children, onClose, ...other } = props;\n\treturn (\n\t\t\n\t\t\t{children}\n\t\t\t{onClose ? (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t) : null}\n\t\t\n\t);\n};\n\nexport const DialogContent = withStyles((theme: Theme) => ({\n\troot: {\n\t\tpadding: `0 ${theme.spacing(2)} !important`,\n\t\tbackgroundColor: theme.palette.background.default\n\t}\n}))(MuiDialogContent);\n\nexport const Dialog = withStyles(() => ({\n\tpaperFullScreen: {\n\t\tmaxWidth: '80%'\n\t},\n\tscrollPaper: {\n\t\tjustifyContent: 'flex-end'\n\t}\n}))(MuiDialog);\n","import React from 'react';\n// store and context\nimport { ShipmentSendResponse } from '~store/actions/ActionTypes';\n\n// components\nimport { Transition, DialogTitle, DialogContent, Dialog } from './ModalComponents';\nimport { HeadingOne } from '~components/Headings';\n\n// styles and icons\nimport { Grid } from '@mui/material';\nimport { useStyles } from './styles';\nimport ShipmentDetailsContent from './ShipmentDetailsContent';\n\ninterface Props {\n\tisOpen: boolean; // is shown\n\thandleOpen: (s: boolean) => void;\n\tdata: ShipmentSendResponse | null;\n\thandleCancel?: () => void;\n\tisManual?: boolean;\n}\n\n/**\n * This is the modal to see the detials of a label\n */\n\nconst ShipmentDetailsModal: React.FC = (props) => {\n\tconst classes = useStyles();\n\n\tconst handleClose = () => {\n\t\tprops.handleOpen(false);\n\t};\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{''}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default ShipmentDetailsModal;\n","import { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\n\nexport const useTrackingStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tmargin: `${theme.spacing(8)} 0`,\n\t\t[theme.breakpoints.down(750)]: {\n\t\t\tmargin: `${theme.spacing(1)} 0`\n\t\t}\n\t},\n\tcontainer: {\n\t\tborder: '1px solid #FFFFFF50',\n\t\tpadding: theme.spacing(4),\n\t\tmaxWidth: 600,\n\t\tborderRadius: theme.spacing(1),\n\t\t[theme.breakpoints.down(750)]: {\n\t\t\tmaxWidth: 500,\n\t\t\tborder: 'none'\n\t\t}\n\t},\n\tbox: {\n\t\tpadding: `${theme.spacing(1.5)} 0`,\n\t\t'&>h5': {\n\t\t\tdisplay: 'flex',\n\t\t\talignItems: 'center',\n\t\t\tgap: '4px'\n\t\t}\n\t},\n\tguideIdBox: {\n\t\tfontWeight: 400,\n\t\tpaddingTop: '4px'\n\t},\n\tcarrierContainer: {\n\t\tdisplay: 'flex',\n\t\tgap: '6px',\n\t\talignItems: 'center',\n\t\tjustifyContent: 'space-between'\n\t},\n\tguideData: {\n\t\tfontSize: '16px',\n\t\t'&>p': {\n\t\t\tdisplay: 'flex',\n\t\t\talignItems: 'center',\n\t\t\tmargin: 0,\n\t\t\tcolor: 'rgba(255, 255, 255, 0.7)',\n\t\t\t'&>span': {\n\t\t\t\tfontWeight: 700,\n\t\t\t\tmarginLeft: '6px',\n\t\t\t\tcolor: '#FFF'\n\t\t\t},\n\t\t\t'&>svg': {\n\t\t\t\tmarginRight: '12px',\n\t\t\t\twidth: '18px'\n\t\t\t}\n\t\t},\n\t\t[theme.breakpoints.down(750)]: {\n\t\t\tfontSize: '14px'\n\t\t}\n\t},\n\tboxWithBorder: {\n\t\tfilter: 'drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.08))',\n\t\t'& p': {\n\t\t\tfontWeight: 500,\n\t\t\tfontSize: '16px'\n\t\t}\n\t},\n\tloader: {\n\t\tminHeight: '20vh'\n\t}\n}));\n","import { useCallback, useEffect, useState, useMemo, useContext } from 'react';\nimport TrackingContainer from '~components/Modals/_TrakingContainer';\nimport CarrierService from '~components/Tables/CarrierService';\nimport LogoMessage from '~pages/auth/_LogoMessage';\nimport StatusCell from '~components/Tables/_StatusCell';\nimport { HeadingOne, HeadingTwo } from '~components/Headings';\n\nimport { Grid, CircularProgress, Typography } from '@mui/material';\nimport { Truck, Send as SendIcon, MapPin } from 'react-feather';\nimport EventAvailableIcon from '@material-ui/icons/EventAvailable';\n\nimport axiosInstance from '~util/axios';\nimport clsx from 'clsx';\nimport moment from 'moment';\nimport { FollowUpLabelStatus } from '~util/cellStatusColor';\nimport { useParams } from 'react-router-dom';\nimport { EventType } from '~store/actions/ActionTypes';\nimport DrawContext from '~context/DrawContext';\nimport { useTrackingStyles } from './styles';\nimport { CARRIERS } from '~util/logos';\n\ntype TrackingGuideType = {\n\tid: number;\n\tparcel_number: string;\n\ttracking_number: string;\n\tcarrier: string;\n\torigin: { city: string; state: string; zip_code: string };\n\tdestination: { city: string; state: string; zip_code: string };\n\tservice_description: string;\n\tservice_id: number;\n\tcreated_at: string;\n\tfollow_up: FollowUpLabelStatus;\n\tevents: EventType[] | null;\n};\n\nconst ShipmentTracking = () => {\n\tconst classes = useTrackingStyles();\n\tconst [guideData, setGuideData] = useState(null);\n\tconst params: { id: string } = useParams();\n\tconst { setNotification, setRCardStatus } = useContext(DrawContext);\n\n\tconst createdAtDate = useMemo(\n\t\t() => moment(guideData?.created_at).format('LL') ?? '',\n\t\t[guideData]\n\t);\n\n\tconst deliveredTime = useMemo(\n\t\t() =>\n\t\t\tguideData?.events?.find((item) => item.description === FollowUpLabelStatus.DELIVERED)\n\t\t\t\t? guideData?.events?.find((item) => item.description === FollowUpLabelStatus.DELIVERED)\n\t\t\t\t\t\t?.createdAt\n\t\t\t\t: '',\n\t\t[guideData]\n\t);\n\n\tconst getTracking = useCallback(async () => {\n\t\ttry {\n\t\t\t//\n\t\t\tconst guide = await axiosInstance.get(`/api/tracking/${params.id}`);\n\t\t\tsetGuideData(guide.data);\n\t\t} catch (error) {\n\t\t\tsetNotification({\n\t\t\t\tmessage:\n\t\t\t\t\t'No se puedo obtener la información de la guía. Asegúrese que la URL sea correcta.',\n\t\t\t\tseverity: 'error'\n\t\t\t});\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [params.id]);\n\n\tuseEffect(() => {\n\t\tgetTracking();\n\t}, [getTracking]);\n\n\tuseEffect(() => {\n\t\tsetRCardStatus('HIDDEN');\n\t}, [setRCardStatus]);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{guideData ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tServicio:\n\t\t\t\t\t\t\t\t\t\t{guideData.service_description}\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tCreación de guía:\n\t\t\t\t\t\t\t\t\t\t{createdAtDate}\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tN° de Guía:{guideData.parcel_number}\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tOrigen: {`${guideData.origin.city}, ${guideData.origin.state}`}\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{deliveredTime && (\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{deliveredTime}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{/* Tracking */}\n\t\t\t\t\t\t\t{!!guideData?.events && (\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\n\t\t\t\t\t) : (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t);\n};\n\nexport default ShipmentTracking;\n","export default function capitalize(str: string = '') {\n\treturn str.trim().toLowerCase().charAt(0).toUpperCase() + str.slice(1);\n}\n\nexport function capitalizeAll(str: string = '') {\n\treturn str\n\t\t.trim()\n\t\t.toLowerCase()\n\t\t?.split(' ')\n\t\t.map((item) => (item !== 'y' && item !== 'de' ? capitalize(item) : item))\n\t\t.join(' ');\n}\n","// import { Dispatch } from 'redux';\nimport {\n\tBookletServiceForm,\n// \tCLEAR_ADDRESS_DATA,\n// \t//AddressRequest,\n\tCreateOrUpdateCustomerActions,\n// \tDataActions,\n// \tNewAddress,\n// \tRESET_CUCUSTOMER,\n// \tSET_ADDRESS_INFO_DRAFT_CUCUSTOMER,\n// \tSET_EDITING_ADDRESS_CUCUSTOMER,\n// \tSET_GENERAL_INFO_DRAFT_CUCUSTOMER,\n// \tSET_GENERAL_INFO_VALID_CUCUSTOMER,\n// \tSET_LEGAL_INFO_DRAFT_CUCUSTOMER,\n// \tSET_LEGAL_INFO_VALID_CUCUSTOMER,\n\tSET_SERVICES_CUCUSTOMER,\n// \tSET_TOUCHED_ADDRESS_CUCUSTOMER,\n} from '../ActionTypes';\n\n// export const setAddressInfoDraftCUCustomer = (address: NewAddress): CreateOrUpdateCustomerActions => {\n// \treturn { type: SET_ADDRESS_INFO_DRAFT_CUCUSTOMER, address };\n// };\n\n// export const setTouchAddressInfoDraftCUCustomer = (touched: boolean): CreateOrUpdateCustomerActions => {\n// \treturn { type: SET_TOUCHED_ADDRESS_CUCUSTOMER, touched: touched };\n// };\n\n// export const setGeneralInfoValidCUCustomer = (valid: boolean): CreateOrUpdateCustomerActions => {\n// \treturn { type: SET_GENERAL_INFO_VALID_CUCUSTOMER, valid };\n// };\n\n// export const setGeneralInfoDraftCUCustomer = (form: any): CreateOrUpdateCustomerActions => {\n// \treturn { type: SET_GENERAL_INFO_DRAFT_CUCUSTOMER, form };\n// };\n\n// export const setidCustomerEditingCUCustomer = (idCustomer: number, idUser: number): CreateOrUpdateCustomerActions => {\n// \treturn { type: SET_EDITING_ADDRESS_CUCUSTOMER, idCustomer, idUser};\n// };\n\n// export const setLegallInfoValidCUCustomer = (valid: boolean): CreateOrUpdateCustomerActions => {\n// \treturn { type: SET_LEGAL_INFO_VALID_CUCUSTOMER, valid };\n// };\n\n// export const setLegalInfoDraftCUCustomer = (form: any): CreateOrUpdateCustomerActions => {\n// \treturn { type: SET_LEGAL_INFO_DRAFT_CUCUSTOMER, form };\n// };\n\nexport const setServicesCUCustomer = (services: BookletServiceForm[]): CreateOrUpdateCustomerActions => {\n\treturn { type: SET_SERVICES_CUCUSTOMER, services };\n};\n\n// export const resetCUCustomer = () => async (dispatch: Dispatch) => {\n// \tdispatch({ type: RESET_CUCUSTOMER });\n// \tdispatch({ type: CLEAR_ADDRESS_DATA });\n// \t// dispatch({ type: RESET_FLOW })\n// };\n","import {\n\tCLEAR_ERROR_SIMULATED_USER,\n\tCustomerDetails,\n\tRESET_SIMULATED_USER,\n\tSET_SIMULATED_CUSTOMER_SIMULATED_USER,\n\tSET_SIMULATED_USER,\n\tTRIGGER_ERRORS_SIMULATED_USER,\n\tSimulatedUserActions,\n\tUserDetails,\n} from '../ActionTypes';\n\nexport const setSimulatedUser = (user: UserDetails | null): SimulatedUserActions => {\n\treturn { type: SET_SIMULATED_USER, user };\n};\n\nexport const setSimulatedCustomer = (customer: CustomerDetails | null): SimulatedUserActions => {\n\treturn { type: SET_SIMULATED_CUSTOMER_SIMULATED_USER, customer };\n};\n\nexport const resetSimulatedUser = (): SimulatedUserActions => {\n\treturn { type: RESET_SIMULATED_USER };\n};\n\nexport const triggerErrorSimulatedUser = (): SimulatedUserActions => {\n\treturn { type: TRIGGER_ERRORS_SIMULATED_USER }\n}\n\nexport const clearErrorsSimulatedUser = (): SimulatedUserActions => {\n\treturn { type: CLEAR_ERROR_SIMULATED_USER }\n}","/**\n * Cell status color for grids\n */\n\nexport enum COLORS {\n\tORANCE = '#ff9800',\n\tRED = '#aa3e3d',\n\tLIGHTBLUE = '#57BBD8',\n\tBLUE = '#409cff',\n\tGREEN = '#4caf50',\n\tVIOLET = '#77568a',\n\tGREY = 'dimgray'\n}\n\n// LABELS\n\nexport enum FollowUpLabelStatus {\n\tREGISTERED = 'Generada',\n\tFACILITY = 'Suc. / Ocurre',\n\tTRANSIT = 'En tránsito',\n\tCANCELLED = 'Cancelada',\n\tEXPIRED = 'Caducada',\n\tEXCEPTION = 'Incidente',\n\tDELIVERED = 'Entregada',\n\tSCANNED = 'Escaneada',\n\tABORT = 'Anulada',\n\tFINALIZED = 'Finalizada'\n}\n\nexport const ShipmentStatusRef = {\n\tREGISTERED: 'Generada',\n\tFACILITY: 'Suc. / Ocurre',\n\tSCANNED: 'Escaneada',\n\tTRANSIT: 'En tránsito',\n\tEXPIRED: 'Caducada',\n\tEXCEPTION: 'Incidente',\n\tABORT: 'Anulada',\n\tCANCELLED: 'Cancelada',\n\tDELIVERED: 'Entregada',\n\tFINALIZED: 'Finalizada'\n};\n\n// PICKUP\n\nexport const PickupStatusRef = {\n\tPENDING: 'Pendiente',\n\tSCHEDULED: 'Programada',\n\tRESCHEDULED: 'Reprogramada',\n\tROUTED: 'Enrutada',\n\tPARTIAL: 'Parcial',\n\tEXCEPTED: 'Excepcionada',\n\tCANCELLED: 'Cancelada',\n\tCOLLECTED: 'Recolectada'\n};\n\nexport enum PickupStatus {\n\tPENDING = 'Pendiente',\n\tSCHEDULED = 'Programada',\n\tRESCHEDULED = 'Reprogramada',\n\tROUTED = 'Enrutada',\n\tCOLLECTED = 'Recolectada',\n\tPARTIAL = 'Parcial',\n\tEXCEPTED = 'Excepcionada',\n\tCANCELLED = 'Cancelada'\n}\n\n// INVOICE\n\nexport enum InvoiceStatus {\n\tCREATED = 'Creada',\n\tNOT_PAID = 'Sin pagar',\n\tEXPIRED = 'Vencida',\n\tCANCELLED = 'Cancelada',\n\tPAID = 'Pagada',\n\tABOUT_TO_CANCEL = 'Por cancelar',\n\tPRE_CANCELLED = 'Precancelada',\n\tLIQUIDATED = 'Liquidada'\n}\n\n// PAYMENT LABELS\n\nexport enum LabelPaymentStatus {\n\tCREATED = 'Created',\n\tAPPLIED = 'Applied', // ??\n\tCANCELLED = 'Cancelled',\n\tREPORT = 'Report', // ??\n\tPRE_INVOICE = 'PreInvoice', // ??\n\tINVOICED = 'Invoiced' // ??\n}\n\nexport enum CustomerPaymentStatus {\n\tPENDING = 'pending',\n\tVALIDATED = 'validated',\n\tREJECTED = 'rejected'\n}\n\n// DISPERSION\n\nexport enum DispersionStatus {\n\tACTIVE = 'Vigente',\n\tEXPIRED = 'Caducada',\n\tABOUT_TO_EXPIRE = 'Por caducar',\n\tFINISHED = 'Finalizada'\n}\n\nexport const getCellStatusColor = (status: string) => {\n\tswitch (status) {\n\t\tcase PickupStatus.EXCEPTED:\n\t\tcase PickupStatus.PARTIAL:\n\t\tcase FollowUpLabelStatus.EXCEPTION:\n\t\tcase InvoiceStatus.ABOUT_TO_CANCEL:\n\t\tcase InvoiceStatus.EXPIRED:\n\t\tcase DispersionStatus.ABOUT_TO_EXPIRE:\n\t\t\t// case LabelPaymentStatus.CREATED:\n\t\t\t// case CustomerPaymentStatus.PENDING:\n\t\t\treturn COLORS.ORANCE; // orange\n\t\tcase PickupStatus.CANCELLED:\n\t\tcase FollowUpLabelStatus.EXPIRED:\n\t\tcase FollowUpLabelStatus.CANCELLED:\n\t\tcase FollowUpLabelStatus.ABORT:\n\t\tcase InvoiceStatus.CANCELLED:\n\t\tcase LabelPaymentStatus.CANCELLED:\n\t\tcase CustomerPaymentStatus.REJECTED:\n\t\tcase DispersionStatus.EXPIRED:\n\t\t\treturn COLORS.RED; // red\n\t\tcase PickupStatus.SCHEDULED:\n\t\tcase PickupStatus.RESCHEDULED:\n\t\tcase FollowUpLabelStatus.FACILITY:\n\t\t\treturn COLORS.LIGHTBLUE; // lightblue\n\t\tcase PickupStatus.ROUTED:\n\t\tcase FollowUpLabelStatus.TRANSIT:\n\t\tcase FollowUpLabelStatus.SCANNED:\n\t\tcase InvoiceStatus.PRE_CANCELLED:\n\t\t\treturn COLORS.BLUE; // blue\n\t\tcase PickupStatus.COLLECTED:\n\t\tcase FollowUpLabelStatus.DELIVERED:\n\t\tcase InvoiceStatus.PAID:\n\t\tcase InvoiceStatus.LIQUIDATED:\n\t\tcase 'cotización lista':\n\t\tcase CustomerPaymentStatus.VALIDATED:\n\t\tcase DispersionStatus.ACTIVE:\n\t\t\treturn COLORS.GREEN; // green\n\t\t// case PickupStatus.PENDING:\n\t\tcase FollowUpLabelStatus.FINALIZED:\n\t\t\treturn COLORS.VIOLET; // grey violet\n\t\tdefault:\n\t\t\t// console.log(`@@@ Missing case for status: ${status}`);\n\t\t\treturn COLORS.GREY;\n\t}\n};\n","import { Fragment, FC, Dispatch, SetStateAction, useMemo } from 'react';\nimport clsx from 'clsx';\nimport { useHistory, useLocation } from 'react-router-dom';\nimport { BottomNavigation, BottomNavigationAction } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { PermissionsKey } from '~context/AuthContext';\nimport usePermissions from '~hooks/usePermissions';\nimport { TextOne } from '~components/Headings';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\twidth: '100%',\n\t\tborderRadius: '20px 20px 0 0',\n\t\t'&>*': {\n\t\t\tflex: 1,\n\t\t\tmaxWidth: 'unset !important',\n\t\t\tfontWeight: 700,\n\t\t\tjustifySelf: 'flex-start'\n\t\t}\n\t\t//backgroundColor: `${theme.palette.background.default} !important`\n\t},\n\tmenuOption: {\n\t\twidth: 150,\n\t\tborderBottom: 'solid 0.9px rgb(81, 81, 81) !important',\n\t\tcolor: `rgba(255, 255, 255, 0.7) !important`\n\t},\n\tlabel: {\n\t\tfontSize: 25\n\t},\n\tmenuOptionSelected: {\n\t\tborderBottom: `solid 2px ${theme.palette.primary.main} !important`\n\t},\n\ttabBorder: {\n\t\tboxSizing: 'border-box',\n\t\tborderBottom: 'solid 0.9px rgb(81, 81, 81)',\n\t\tpaddingLeft: 0,\n\t\tpaddingRight: 0,\n\t\t'& > span:nth-child(1)': {\n\t\t\tmarginRight: '-5px',\n\t\t\tborderRight: '1px solid #505050',\n\t\t\twidth: '100%'\n\t\t}\n\t}\n}));\n\ntype BookletOption = { path: string; name: string; permission: PermissionsKey };\n\ninterface Props {\n\tcurrentTab: 'cotizar' | 'enviar' | 'recolectar' | 'carga-masiva' | null;\n\tsetReset?: Dispatch>;\n}\n\n// FIXME dont use the hoxfix\n// TODO move this logic to the Routes.tsx file\n// const booklets: BookletOption[] = [\n// \t{ path: '/cotizar', name: 'Cotizar', permission: 'canRead.rate' },\n// \t{ path: '/enviar', name: 'Enviar', permission: 'canRead.label' },\n// \t// { path: '/carga-masiva', name: 'Carga Masiva', permission: 'canRead.label' },\n// \t{ path: '/recolectar', name: 'Recolectar', permission: 'canRead.pickup' },\n// ];\n\nconst MenuTabs: FC = (props) => {\n\tconst classes = useStyles();\n\n\tconst { isRootOrAgent, can } = usePermissions();\n\t// const [reset, setReset] = useState(false);\n\tconst booklets: BookletOption[] = useMemo(\n\t\t() =>\n\t\t\tisRootOrAgent\n\t\t\t\t? [\n\t\t\t\t\t\t{ path: '/cotizar', name: 'Cotizar', permission: 'canCreateUpdateDelete.rate' },\n\t\t\t\t\t\t{ path: '/enviar', name: 'Enviar', permission: 'canCreateUpdateDelete.label' },\n\t\t\t\t\t\t// { path: '/carga-masiva', name: 'Carga Masiva', permission: 'canCreateUpdateDelete.label' },\n\t\t\t\t\t\t{ path: '/recolectar', name: 'Recolectar', permission: 'canCreateUpdateDelete.pickup' }\n\t\t\t\t ]\n\t\t\t\t: [\n\t\t\t\t\t\t{ path: '/cotizar', name: 'Cotizar', permission: 'canCreateUpdateDelete.rate' },\n\t\t\t\t\t\t{ path: '/enviar', name: 'Enviar', permission: 'canCreateUpdateDelete.label' },\n\t\t\t\t\t\t{ path: '/recolectar', name: 'Recolectar', permission: 'canCreateUpdateDelete.pickup' }\n\t\t\t\t ],\n\t\t[isRootOrAgent]\n\t);\n\n\tconst history = useHistory();\n\tconst location = useLocation();\n\n\tconst enabledTabs = useMemo(\n\t\t() => booklets.filter((booklet) => can(booklet.permission)),\n\t\t[can, booklets]\n\t);\n\tconst tabs = useMemo(() => enabledTabs.map((booklet) => booklet.name), [enabledTabs]);\n\n\tconst currentTab = useMemo(() => {\n\t\treturn enabledTabs.findIndex((b) => b.path === location.pathname);\n\t}, [location, enabledTabs]);\n\n\t// console.log(currentTab);\n\n\treturn (\n\t\t\n\t\t\t {\n\t\t\t\t\tconst route = enabledTabs[newValue].path;\n\t\t\t\t\thistory.replace(route as string);\n\t\t\t\t}}\n\t\t\t\tshowLabels\n\t\t\t\tclassName={classes.root}\n\t\t\t>\n\t\t\t\t{tabs.map((tabName, index) => (\n\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t\n\n\t\t\t{/* Control to select customers if he/she is an agent */}\n\t\t\t{/* {isRootOrAgent && currentTab > -1 && } */}\n\t\t\n\t);\n};\n\nexport default MenuTabs;\n","import { Fragment, useEffect, useContext } from 'react';\nimport { Slide } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\nimport { Theme } from '@mui/material/styles';\n\nimport DrawContext from '~context/DrawContext';\nimport { radiusCard } from '~hooks/useStyles';\nimport MenuTabs from '~components/Tabs/MenuTabs';\nimport logo from '../../assets/logo.svg';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\tlogo: {\n\t\tmarginBottom: theme.spacing(15),\n\t\tmarginTop: '15%',\n\t\tmaxWidth: 400,\n\t\theight: 125\n\t},\n\troot: {\n\t\tpadding: theme.spacing(3),\n\t\tborderRadius: `0 0 ${radiusCard}px ${radiusCard}px`\n\t}\n}));\n\n/**\n * The main page, like home, where the just tabs are shown\n */\n\nconst MainPage: React.FC = () => {\n\tconst classes = useStyles();\n\tconst { toggleBarLogo, setRCardStatus } = useContext(DrawContext);\n\n\tuseEffect(() => {\n\t\ttoggleBarLogo(false);\n\t\tsetRCardStatus('HIDDEN');\n\t\treturn () => {\n\t\t\ttoggleBarLogo(true);\n\t\t};\n\t}, [toggleBarLogo, setRCardStatus]);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\tlogo\n\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t);\n};\n\nexport default MainPage;\n","import React, { useState, useContext } from 'react';\nimport { Switch, FormControlLabel } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\nimport clsx from 'clsx';\nimport { useDispatch } from 'react-redux';\nimport { useSelector } from '~store/store';\n\nimport InputSearchAddress from '../Inputs/InputSearchAddress';\nimport AutoCompleteMaps from '../Maps/AutoCompleteMaps';\nimport { HeadingOne } from '~components/Headings';\n\nimport { useCardStyles } from '../../hooks/useStyles';\n\nimport {\n\tsetAddressRate,\n\ttoggleDestinationAddressComponent,\n\ttoggleOriginAddressComponent\n} from '../../store/actions';\nimport DrawContext from '../../context/DrawContext';\nimport usePermissions from '~hooks/usePermissions';\n\nconst useStyles = makeStyles((theme) => ({\n\troot: {\n\t\tpadding: theme.spacing(3),\n\t\theight: 250,\n\t\t'&>*': {\n\t\t\tmarginTop: theme.spacing(1)\n\t\t}\n\t},\n\tcontainer: {\n\t\tcolor: theme.palette.text.disabled\n\t},\n\tcaption: {\n\t\tmarginLeft: '12%'\n\t}\n}));\n\ninterface Props {\n\tfor: 'Origen' | 'Destino';\n}\n\n/**\n * This is the component when ratting\n */\nconst AddressCardRate: React.FC = (props) => {\n\tconst classes = useStyles();\n\tconst { cardClasses } = useCardStyles();\n\tconst dispatch = useDispatch();\n\n\tconst { originAddressComponent, destinationAddressComponent } = useSelector(\n\t\t(state) => state.rate\n\t);\n\tconst { currentFlow } = useSelector((state) => state.flow);\n\n\tconst { setNotification } = useContext(DrawContext);\n\tconst { can } = usePermissions();\n\tconst canHaveActions = can('canRead.addresses');\n\n\tconst [searchWithMaps, setSearchWithMaps] = useState(\n\t\tcurrentFlow === 'rate' || !canHaveActions\n\t\t\t? true\n\t\t\t: props.for === 'Destino'\n\t\t\t? destinationAddressComponent === 'maps'\n\t\t\t: originAddressComponent === 'maps'\n\t);\n\n\treturn (\n\t\t\n\t\t\t\n\n\t\t\t {\n\t\t\t\t\t\t\tsetSearchWithMaps((prev) => !prev);\n\t\t\t\t\t\t\tif (props.for === 'Destino') {\n\t\t\t\t\t\t\t\tdispatch(toggleDestinationAddressComponent());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdispatch(toggleOriginAddressComponent());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tcolor='primary'\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tlabel={searchWithMaps ? 'Buscando con Google Maps' : 'Buscar con Google Maps'}\n\t\t\t/>\n\t\t\t
\n\t\t\t\t{searchWithMaps && (\n\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tif (!p.postal_code) {\n\t\t\t\t\t\t\t\t\tsetNotification({\n\t\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t\t'Lo sentimos pero Google Maps no regreso un código postal para esta dirección, favor de dar de alta la dirección en tu libreta.',\n\t\t\t\t\t\t\t\t\t\tseverity: 'error'\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\tsetAddressRate(\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tid: new Date().toISOString(),\n\t\t\t\t\t\t\t\t\t\t\tcountry: p.country as string,\n\t\t\t\t\t\t\t\t\t\t\tcoordinates: `${p.coordinates.lat}, ${p.coordinates.lng}`,\n\t\t\t\t\t\t\t\t\t\t\tnumber: p.street_number as string,\n\t\t\t\t\t\t\t\t\t\t\tstreet: p.route as string,\n\t\t\t\t\t\t\t\t\t\t\tbusiness_name: p.name as string,\n\t\t\t\t\t\t\t\t\t\t\treference: '',\n\t\t\t\t\t\t\t\t\t\t\treference_streets: '',\n\t\t\t\t\t\t\t\t\t\t\tsuite_number: '',\n\t\t\t\t\t\t\t\t\t\t\ttype: '',\n\t\t\t\t\t\t\t\t\t\t\tcity: p.locality ?? '',\n\t\t\t\t\t\t\t\t\t\t\tcontact: null,\n\t\t\t\t\t\t\t\t\t\t\tneighborhood: p.sublocality_level_1 as string,\n\t\t\t\t\t\t\t\t\t\t\tstate: p.administrative_area_level_1 as string,\n\t\t\t\t\t\t\t\t\t\t\tzip_code: p.postal_code,\n\t\t\t\t\t\t\t\t\t\t\talias: '',\n\t\t\t\t\t\t\t\t\t\t\ttax_id: ''\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tprops.for === 'Destino' ? 'destination' : 'origin'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{canHaveActions && 'Apagar el switch para buscar con libreta'}\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t{!searchWithMaps && canHaveActions && (\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\tActualmente buscando en libreta\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default AddressCardRate;\n","import { FC, useEffect, useState } from 'react';\nimport {\n\tButton,\n\tButtonGroup,\n\tFormControl,\n\tFormHelperText,\n\tInputAdornment,\n\tInputLabel,\n\tPaper,\n\tSelect,\n\tTable,\n\tTableBody,\n\tTableCell,\n\tTableContainer,\n\tTableHead,\n\tTableRow,\n\tTextField\n} from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles, withStyles } from '@mui/styles';\nimport { Edit as EditIcon, XSquare } from 'react-feather';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { useForm } from 'react-hook-form';\nimport { useHistory } from 'react-router-dom';\n\nimport PackageTypeField from '../Inputs/PackageTypeField';\nimport PackageContentField from '~components/Inputs/PackageContentField';\n\nimport {\n\tremovePackageSend,\n\tupdatePkgSend,\n\tsetValidateFormPkgsSend,\n\teditPackage,\n\tremovePackageRate,\n\tupdatePkgRate,\n\tsetValidateFormPkgsRate,\n\tshowInsuranceServicesFlow\n} from '../../store/actions';\n\nimport { REGEX_POSITIVE_FLOAT_NUMBERS } from '../../util';\nimport { Package } from '../../store/actions/ActionTypes';\nimport { RootStore } from '../../store/store';\nimport { Checkbox } from '@mui/material';\n\ninterface Column {\n\tid:\n\t\t| 'quantity'\n\t\t| 'insurance'\n\t\t| 'type'\n\t\t| 'dimensions'\n\t\t| 'height'\n\t\t| 'width'\n\t\t| 'length'\n\t\t| 'measurement'\n\t\t| 'weight'\n\t\t| 'actions'\n\t\t| 'content'\n\t\t| 'is_irregular_delivery';\n\tlabel: string;\n\tminWidth?: number;\n\tmaxWidth?: number;\n\twidth?: number;\n}\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tfontWeight: 'bold'\n\t},\n\tcolumnLabel: {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'center'\n\t},\n\trowContainer: {\n\t\tbackgroundColor: theme.palette.background.paper\n\t},\n\tirregularLabel: {\n\t\tfontSize: '12px',\n\t\t'&>span': {\n\t\t\tfontSize: 'inherit'\n\t\t}\n\t},\n\tdimensionsCell: {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'center',\n\t\tpadding: '16px 0 !important',\n\t\tmarginTop: '4px'\n\t},\n\tinputAdorment: {\n\t\theight: '100%',\n\t\tdisplay: 'flex',\n\t\talignSelf: 'flex-end',\n\t\tpaddingBottom: '7px',\n\t\tmarginLeft: 0\n\t},\n\tactionButtons: {\n\t\tcolor: '#f2f2f2',\n\t\tborder: '1px solid rgba(255, 255, 255, 0.23)',\n\t\tminWidth: 'unset',\n\t\t'&:nth-child(1)': {\n\t\t\tborderTopRightRadius: 0,\n\t\t\tborderBottomRightRadius: 0,\n\t\t\tborderRightColor: 'transparent'\n\t\t},\n\t\t'&:nth-child(2)': {\n\t\t\tborderTopLeftRadius: 0,\n\t\t\tborderBottomLeftRadius: 0\n\t\t}\n\t}\n}));\n\nconst TableCellWithOutPadding = withStyles({\n\troot: {\n\t\tpadding: '5px 3px'\n\t}\n})(TableCell);\n\ntype FormValues = {\n\tpkgs: {\n\t\tquantity: number;\n\t\theight: number;\n\t\twidth: number;\n\t\tlength: number;\n\t\tweight: number;\n\t\tmeasurement: string;\n\t\tinsurance: number;\n\t\tpackage_type: { title: string };\n\t}[];\n};\ninterface Props {\n\tshowInsurance: boolean;\n\tdata: Package[];\n}\n\n/**\n * Esta tabla es la que se usa para preparar los paquetes\n * para un Send o Rate, se manda a llamar en PackageCard\n */\nconst TablePackagesCU: FC = (props) => {\n\tconst classes = useStyles();\n\tconst dispatch = useDispatch();\n\tconst history = useHistory();\n\tconst { currentFlow, uninsurablePackages } = useSelector((state: RootStore) => state.flow);\n\tconst { isTouchedRate } = useSelector((state: RootStore) => state.rate);\n\tconst { isTouchedSend } = useSelector((state: RootStore) => state.send);\n\n\tconst { register, errors, control, formState, handleSubmit, clearErrors, setValue } =\n\t\tuseForm({\n\t\t\tmode: 'all'\n\t\t});\n\n\tconst { isValid } = formState;\n\n\tconst [columns, setColumns] = useState([\n\t\t{ id: 'quantity', label: 'Cantidad', width: 50 },\n\t\t{ id: 'type', label: 'Tipo' },\n\t\t{ id: 'dimensions', label: 'Caracteristicas', minWidth: 200 },\n\t\t{ id: 'content', label: 'Contenido', minWidth: 175 },\n\t\t{\n\t\t\tid: 'is_irregular_delivery',\n\t\t\tlabel: 'Manejo Especial',\n\t\t\tmaxWidth: props.showInsurance ? 40 : 80,\n\t\t\tminWidth: 40\n\t\t},\n\t\t{ id: 'actions', label: 'Acciones', width: 50 }\n\t]);\n\n\t// listen when should validate\n\t// trigger by the 'Continuar' button\n\tuseEffect(() => {\n\t\tif (currentFlow === 'send') {\n\t\t\tdispatch(setValidateFormPkgsSend(isValid));\n\t\t} else if (currentFlow === 'rate') {\n\t\t\tdispatch(setValidateFormPkgsRate(isValid));\n\t\t}\n\t}, [isValid, dispatch, currentFlow]);\n\n\t// Show error feedback when touched\n\tuseEffect(() => {\n\t\tif (isTouchedRate || isTouchedSend) {\n\t\t\thandleSubmit(() => {})();\n\t\t}\n\t}, [isTouchedRate, isTouchedSend, handleSubmit]);\n\n\t// Handle add new column for insurance\n\t// Dispatch if the insurance will be available\n\tuseEffect(() => {\n\t\tif (props.showInsurance) {\n\t\t\tsetColumns((prev) => {\n\t\t\t\treturn [\n\t\t\t\t\t...prev.slice(0, 5),\n\t\t\t\t\t{ id: 'insurance', label: 'Seguro', width: 119 },\n\t\t\t\t\t...prev.slice(5, prev.length)\n\t\t\t\t];\n\t\t\t});\n\t\t} else if (!props.showInsurance) {\n\t\t\t// this may look redundant but works because the re-renders\n\t\t\tsetColumns((prev) => {\n\t\t\t\treturn prev.filter((item) => item.id !== 'insurance');\n\t\t\t});\n\t\t}\n\t}, [props.showInsurance, dispatch]);\n\n\t// Remove the insurance from the values\n\tuseEffect(() => {\n\t\tif (!props.showInsurance) {\n\t\t\tprops.data.forEach((p) => {\n\t\t\t\tif (currentFlow === 'send') {\n\t\t\t\t\tdispatch(updatePkgSend(p.pkg_id, { insurance: 0 }));\n\t\t\t\t} else if (currentFlow === 'rate') {\n\t\t\t\t\tdispatch(updatePkgRate(p.pkg_id ? p.pkg_id : p.id, { insurance: 0 }));\n\t\t\t\t}\n\t\t\t});\n\t\t\tdispatch(showInsuranceServicesFlow(false));\n\t\t} else if (props.showInsurance) {\n\t\t\tdispatch(showInsuranceServicesFlow(true));\n\t\t}\n\t}, [props.showInsurance, props.data, currentFlow, dispatch]);\n\n\tconst isContentUninsurable = (pkgContent: string) => {\n\t\treturn uninsurablePackages?.includes(pkgContent);\n\t};\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{columns.map((column) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
{column.label}
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t{props.data.map((row, i) => {\n\t\t\t\t\t\t\tconst packageToRateId = row.pkg_id ? row.pkg_id : row.id;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{columns.map((column) => {\n\t\t\t\t\t\t\t\t\t\tswitch (column.id) {\n\t\t\t\t\t\t\t\t\t\t\tcase 'quantity':\n\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (currentFlow === 'send') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgSend(row.pkg_id, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tquantity: parseInt(e.target.value) || 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (currentFlow === 'rate') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgRate(packageToRateId, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tquantity: parseInt(e.target.value) || 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant='filled'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ width: column.width ?? 'unset' }}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel='#'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tcase 'dimensions':\n\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (currentFlow === 'send') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgSend(row.pkg_id, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlength: parseFloat(e.target.value) || 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (currentFlow === 'rate') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgRate(packageToRateId, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlength: parseFloat(e.target.value) || 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel='Largo'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue={row.type === 'Sobre' ? '-' : row.length.toString()}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// defaultValue={row.type === 'Sobre' ? '-' : row.length.toString()}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant='filled'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ width: 60 }}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (currentFlow === 'send') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgSend(row.pkg_id, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: parseFloat(e.target.value) || 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (currentFlow === 'rate') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgRate(packageToRateId, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: parseFloat(e.target.value) || 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel='Ancho'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue={row.type === 'Sobre' ? '-' : row.width.toString()}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// defaultValue={row.type === 'Sobre' ? '-' : row.width.toString()}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant='filled'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ width: 60 }}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (currentFlow === 'send') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgSend(row.pkg_id, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: parseFloat(e.target.value) || 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (currentFlow === 'rate') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgRate(packageToRateId, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: parseFloat(e.target.value) || 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant='filled'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ width: 60 }}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel='Alto'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue={row.type === 'Sobre' ? '-' : row.height.toString()}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// defaultValue={row.type === 'Sobre' ? '-' : row.height.toString()}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tUnidad\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (currentFlow === 'send') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgSend(row.pkg_id, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmeasurement: e.target.value as string\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (currentFlow === 'rate') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgRate(packageToRateId, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmeasurement: e.target.value as string\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{errors?.pkgs?.length && errors?.pkgs[i]?.measurement?.message}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (currentFlow === 'send') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgSend(row.pkg_id, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tweight: parseFloat(e.target.value) || 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (currentFlow === 'rate') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgRate(packageToRateId, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tweight: parseFloat(e.target.value) || 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel='Peso'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue={row.weight}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant='filled'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ maxWidth: 94, minWidth: props.showInsurance ? 74 : 94 }}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tInputProps={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendAdornment: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKg\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tcase 'insurance':\n\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (isContentUninsurable(row.content)) return;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst value = e.target.value\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.split('')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.filter((item) => item !== ',' && item !== '$')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.join('');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (currentFlow === 'send') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgSend(row.pkg_id, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinsurance: parseFloat(value) || 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (currentFlow === 'rate') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgRate(packageToRateId, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinsurance: parseFloat(value) || 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant='filled'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ width: column.width ?? 'unset' }}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tValor por {row.type ?? 'Empaque'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tInputProps={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendAdornment: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMXN\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartAdornment: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tcase 'actions':\n\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{currentFlow === 'send' && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(editPackage(row));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(removePackageSend(row.pkg_id));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory.push(`/paquete/${row.id}`);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (currentFlow === 'rate') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(removePackageRate(packageToRateId));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (currentFlow === 'send') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(removePackageSend(row.pkg_id));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tcase 'is_irregular_delivery':\n\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (currentFlow === 'send') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgSend(row.pkg_id, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tis_irregular_delivery: e.target.checked\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (currentFlow === 'rate') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePkgRate(packageToRateId, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tis_irregular_delivery: e.target.checked\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\tcase 'type':\n\t\t\t\t\t\t\t\t\t\t\t\tif (currentFlow === 'rate') {\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdispatch(updatePkgRate(packageToRateId, { type: t }));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclearErrors(`pkgs[${i}].weight`);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tautoFocus={row[column.id] === null}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\terrors={errors}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue={row[column.id]}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfieldName={`pkgs[${i}].package_type`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif (currentFlow === 'send') {\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn {row[column.id]};\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn <>Caso no manejado;\n\n\t\t\t\t\t\t\t\t\t\t\tcase 'content':\n\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpackageId={packageToRateId}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfieldName={`pkgs[${i}].package_content`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{row[column.id]}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t);\n};\n\nexport default TablePackagesCU;\n","import React, { useEffect, useContext, Dispatch, SetStateAction } from 'react';\nimport { Checkbox, FormControlLabel, Grid } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport clsx from 'clsx';\nimport { Package } from '~store/actions/ActionTypes';\nimport { useDispatch } from 'react-redux';\nimport { useCardStyles } from '~hooks/useStyles';\nimport InputSearchPackage from '../Inputs/InputSearchPackage';\nimport TablePackagesCU from '../Tables/TablePackagesCU';\nimport {\n\tdisableInsuranceServicesFlow,\n\tsetInsuranceOnSummary,\n\tenableInsuranceServicesFlow\n} from '~store/actions';\nimport { useSelector } from '~store/store';\nimport DrawContext from '~context/DrawContext';\nimport { HeadingOne } from '~components/Headings';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tpadding: theme.spacing(3),\n\t\t'&>div>h4': {\n\t\t\tmarginRight: '4px'\n\t\t}\n\t}\n}));\n\ninterface Props {\n\tisRating?: boolean;\n\tcurrentPackages: Package[];\n\taddInsurance: boolean;\n\tsetAddInsurance: Dispatch>;\n}\n\n/**\n * This is the container for the TablePackagesCU\n * is used when Send or Rate\n */\nconst PackageCard: React.FC = ({\n\tisRating,\n\tcurrentPackages,\n\taddInsurance,\n\tsetAddInsurance\n}) => {\n\tconst classes = useStyles();\n\tconst { cardClasses } = useCardStyles();\n\tconst dispatch = useDispatch();\n\tconst { currentFlow, uninsurablePackages } = useSelector((state) => state.flow);\n\tconst { currentPackagesSend } = useSelector((state) => state.send);\n\tconst { setNotification } = useContext(DrawContext);\n\tconst { currentPackagesRate } = useSelector((state) => state.rate);\n\n\tuseEffect(() => {\n\t\tdispatch(disableInsuranceServicesFlow());\n\t\tdispatch(setInsuranceOnSummary(false));\n\t}, [addInsurance, dispatch]);\n\n\tuseEffect(() => {\n\t\tconst packages = currentFlow === 'send' ? currentPackagesSend : currentPackagesRate;\n\t\tif (!packages?.length || !addInsurance) {\n\t\t\tdispatch(disableInsuranceServicesFlow());\n\t\t\tdispatch(setInsuranceOnSummary(false));\n\t\t\treturn;\n\t\t}\n\t\tif (packages.every((pkg) => uninsurablePackages?.includes(pkg.content))) {\n\t\t\tsetAddInsurance(false);\n\t\t\tsetNotification({\n\t\t\t\tmessage: 'El contenido del paquete no se puede asegurar',\n\t\t\t\tseverity: 'info',\n\t\t\t\ttime: 4000\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tdispatch(enableInsuranceServicesFlow());\n\t\tdispatch(setInsuranceOnSummary(true));\n\t}, [\n\t\taddInsurance,\n\t\tsetAddInsurance,\n\t\tdispatch,\n\t\tcurrentPackagesSend,\n\t\tsetNotification,\n\t\tcurrentPackagesRate,\n\t\tcurrentFlow,\n\t\tuninsurablePackages\n\t]);\n\n\treturn (\n\t\t\n\t\t\t{/* Titulo */}\n\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t{/* Boton */}\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t setAddInsurance((prev) => !prev)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlabel='Asegurar envío'\n\t\t\t\t\t\tlabelPlacement='end'\n\t\t\t\t\t\tstyle={{ marginLeft: '4px' }}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default PackageCard;\n","import React, { useContext, useEffect, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { Grid, Fade } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { useDispatch } from 'react-redux';\nimport DrawContext from '~context/DrawContext';\nimport { maxWidthContainer, radiusCard } from '~hooks/useStyles';\nimport { RootStore, useSelector } from '~store/store';\nimport { resetRate, triggerValidationsRate, initFlow } from '~store/actions';\nimport { clearErrorsSimulatedUser, triggerErrorSimulatedUser } from '~store/actions/agents';\nimport ControlBar from '~components/Bar/ControlBar';\nimport RateOrSendControl from '~components/Bar/RateOrSendControl';\nimport AddressCardRate from '../Cards/AddressCardRate';\nimport PackageCard from '../Cards/PackageCard';\nimport usePermissions from '~hooks/usePermissions';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\twidth: '100%',\n\t\tpadding: theme.spacing(3),\n\t\tborderRadius: `0 0 ${radiusCard}px ${radiusCard}px`,\n\t\tmaxWidth: maxWidthContainer\n\t}\n}));\n\n/**\n * The container for rate\n */\nconst Rate: React.FC = () => {\n\tconst classes = useStyles();\n\n\tconst dispatch = useDispatch();\n\tconst history = useHistory();\n\tconst { currentPackagesRate, canContinueToRateRate } = useSelector(\n\t\t(state: RootStore) => state.rate\n\t);\n\tconst { canPostSimulatedUser } = useSelector((state) => state.simulatedUser);\n\tconst { disableGlobalInsuranceFlow } = useSelector((state) => state.flow);\n\tconst { isRootOrAgent } = usePermissions();\n\tconst [wantsToMove, setWantsToMove] = useState(false);\n\tconst [addInsurance, setAddInsurance] = useState(!disableGlobalInsuranceFlow);\n\t// 1. Change the card\n\t// 2. Reset errors when the container gets mounted anyway can not move util is valid\n\t// 3. Init the flow\n\t// 4. Clear error if is an agent or customer\n\tconst { setRCardStatus } = useContext(DrawContext);\n\tuseEffect(() => {\n\t\tdispatch(triggerValidationsRate(false));\n\t\tdispatch(initFlow('rate'));\n\t\tdispatch(clearErrorsSimulatedUser());\n\t\tsetRCardStatus('SUMMARY_ADDRESS');\n\t}, [setRCardStatus, dispatch]);\n\n\t// validate before move to rate when rating\n\tuseEffect(() => {\n\t\tsetWantsToMove(false);\n\t\tif (!(wantsToMove && canContinueToRateRate)) {\n\t\t\treturn;\n\t\t}\n\t\tif (!isRootOrAgent) {\n\t\t\thistory.push('/resultados');\n\t\t\treturn;\n\t\t}\n\t\tif (canPostSimulatedUser) {\n\t\t\thistory.push('/resultados');\n\t\t}\n\t}, [wantsToMove, history, canContinueToRateRate, dispatch, isRootOrAgent, canPostSimulatedUser]);\n\n\tconst canContinueWhenRating = () => {\n\t\tsetWantsToMove(true);\n\t\tdispatch(triggerValidationsRate(true));\n\t\tif (isRootOrAgent) {\n\t\t\tdispatch(triggerErrorSimulatedUser());\n\t\t}\n\t};\n\n\treturn (\n\t\t\n\t\t\t
\n\t\t\t\t{/* Container */}\n\t\t\t\t\n\t\t\t\t\t{/* Origen */}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{/* Paquetes */}\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t{/* Bottom Bar */}\n\t\t\t\t {\n\t\t\t\t\t\tdispatch(resetRate());\n\t\t\t\t\t}}\n\t\t\t\t\trightText='Continuar'\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t);\n};\n\nexport default Rate;\n","import React from 'react';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport clsx from 'clsx';\nimport { useHistory } from 'react-router-dom';\nimport InputSearchAddress from '../Inputs/InputSearchAddress';\nimport InputSearchContact from '../Inputs/InputSearchContact';\nimport { HeadingOne } from '~components/Headings';\nimport { useCardStyles } from '../../hooks/useStyles';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tpadding: theme.spacing(3),\n\t\tminHeight: 270,\n\t\t//width: 477,\n\t\t'&>*': {\n\t\t\tmarginTop: theme.spacing(3)\n\t\t}\n\t}\n}));\n\ninterface Props {\n\tfor: 'Origen' | 'Destino';\n\tisPickingUp?: boolean; // When Picking Up\n\treset?: boolean;\n}\n\n/**\n * The component AddressCard is used to select a pair of address and contact\n * is used when send or pickup, if you want to rate check component\n */\nconst AddressCard: React.FC = (props) => {\n\tconst classes = useStyles();\n\tconst { cardClasses } = useCardStyles();\n\tconst history = useHistory();\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default AddressCard;\n","import {create} from 'zustand';\nimport produce from 'immer';\n\n\ninterface PackagesStore {\n\thasOldContent: boolean;\n\tsetHasOldContent: (hasOldContent: boolean) => void;\n}\n\n// Store to validate the contents of the package\n\nconst usePackagesStore = create((set) => ({\n\thasOldContent: false,\n\tsetHasOldContent: (hasOldContent) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.hasOldContent = hasOldContent;\n\t\t\t})\n\t\t),\n}));\n\nexport default usePackagesStore;","import React, { useCallback, useContext, useEffect, useState } from 'react';\nimport { Fab, Fade, Grid } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { RefreshCcw } from 'react-feather';\nimport { useDispatch } from 'react-redux';\nimport { useHistory } from 'react-router-dom';\nimport DrawContext from '~context/DrawContext';\nimport { maxWidthContainer, radiusCard } from '~hooks/useStyles';\nimport { useSelector } from '~store/store';\nimport { initFlow, resetSend, swipeAddressSend, triggerValidationsSend } from '~store/actions';\nimport AddressCard from '../Cards/AddressCard';\nimport PackageCard from '../Cards/PackageCard';\nimport ControlBar from '../Bar/ControlBar';\nimport RateOrSendControl from '../Bar/RateOrSendControl';\nimport usePermissions from '~hooks/usePermissions';\nimport { clearErrorsSimulatedUser, triggerErrorSimulatedUser } from '~store/actions/agents';\nimport { removePackageSend, addPkgSend } from '~store/actions';\nimport usePackagesStore from '~store/newstore/usePackagesStore';\nimport { shallow } from 'zustand/shallow';\nimport { resetCreatedLabels } from '~store/actions/DataActions';\nimport { Tooltip } from '@mui/material';\nimport ConfirmActionDialog from '~components/Modals/ConfirmActionDialog';\nimport { getUserBalance } from '~store/actions/DataActions';\nimport useBalanceStore from '~store/useBalanceStore';\nimport AuthContext from '~context/AuthContext';\nimport { Package } from '~store/actions/ActionTypes';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\tconvertBtn: {\n\t\tposition: 'absolute',\n\t\tmarginTop: '55px',\n\t\tmarginLeft: '10px',\n\t\tborder: `6px solid ${theme.palette.background.paper}`,\n\t\tbackgroundColor: theme.palette.background.default,\n\t\tcolor: theme.palette.text.primary\n\t},\n\tcenterFab: {\n\t\tdisplay: 'flex',\n\t\talignItems: 'center',\n\t\tjustifyContent: 'center'\n\t},\n\troot: {\n\t\twidth: '100%',\n\t\tpadding: theme.spacing(3),\n\t\tborderRadius: `0 0 ${radiusCard}px ${radiusCard}px`,\n\t\tmaxWidth: maxWidthContainer\n\t}\n}));\n\n/**\n * The container for send\n */\nconst Send: React.FC = () => {\n\tconst classes = useStyles();\n\tconst [setHasOldContent, hasOldContent] = usePackagesStore(\n\t\t(state) => [state.setHasOldContent, state.hasOldContent],\n\t\tshallow\n\t);\n\tconst { setNotification, setAvailableBalance } = useContext(DrawContext);\n\tconst { currentUser } = useContext(AuthContext);\n\n\tconst dispatch = useDispatch();\n\tconst history = useHistory();\n\tconst {\n\t\toriginAddressSend,\n\t\tdestinationAddressSend,\n\t\tcurrentPackagesSend,\n\t\tcanContinueToRateSend,\n\t\tshowInsuranceOnSummary\n\t} = useSelector((state) => state.send);\n\tconst { canPostSimulatedUser } = useSelector((state) => state.simulatedUser);\n\tconst { disableGlobalInsuranceFlow, contentOptions } = useSelector((state) => state.flow);\n\tconst { simulatedCustomer, simulatedUser } = useSelector((state) => state.simulatedUser);\n\n\tconst { isRootOrAgent } = usePermissions();\n\n\tconst [reset, setReset] = useState(false);\n\tconst [wantsToMove, setWantsToMove] = useState(false);\n\tconst [openConfirmDialog, setOpenConfirmDialog] = useState<'insurance' | 'charge' | null>(null);\n\tconst [addInsurance, setAddInsurance] = useState(\n\t\t!disableGlobalInsuranceFlow || showInsuranceOnSummary\n\t);\n\tconst { customerHasBalance } = useBalanceStore();\n\n\t// 1. Change the card\n\t// 2. Reset errors when the container gets mounted anyway can not move util is valid\n\t// 3. Init the flow\n\t// 4. Clear error if is an agent or customer\n\tconst { setRCardStatus } = useContext(DrawContext);\n\tuseEffect(() => {\n\t\tdispatch(triggerValidationsSend(false));\n\t\tdispatch(initFlow('send'));\n\t\tsetRCardStatus('SUMMARY_ADDRESS');\n\t\tdispatch(clearErrorsSimulatedUser());\n\n\t\treturn () => {\n\t\t\tsetRCardStatus('HIDDEN');\n\t\t};\n\t}, [setRCardStatus, dispatch]);\n\n\tuseEffect(() => {\n\t\tif (currentPackagesSend?.some((item) => item?.merchandise?.length)) {\n\t\t\tcurrentPackagesSend?.forEach((item) => {\n\t\t\t\tconst packageItem = { ...item, merchandise: [] };\n\t\t\t\tdispatch(removePackageSend(item?.pkg_id));\n\t\t\t\tdispatch(addPkgSend(packageItem));\n\t\t\t});\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [currentPackagesSend]);\n\n\tconst checkPackageContent = useCallback(\n\t\tasync (packages: Package[]) => {\n\t\t\ttry {\n\t\t\t\tlet hasOld = false;\n\t\t\t\tpackages.forEach((item) => {\n\t\t\t\t\tif (item.merchandise?.length === 0 || item.merchandise === null) {\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\talias,\n\t\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tinsurance,\n\t\t\t\t\t\t\tlength,\n\t\t\t\t\t\t\tmeasurement,\n\t\t\t\t\t\t\tpkg_id,\n\t\t\t\t\t\t\tquantity,\n\t\t\t\t\t\t\tweight,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\twidth\n\t\t\t\t\t\t} = item;\n\t\t\t\t\t\tconst packageItem = {\n\t\t\t\t\t\t\talias,\n\t\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tinsurance,\n\t\t\t\t\t\t\tlength,\n\t\t\t\t\t\t\tmeasurement,\n\t\t\t\t\t\t\tpkg_id,\n\t\t\t\t\t\t\tquantity,\n\t\t\t\t\t\t\tweight,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\twidth\n\t\t\t\t\t\t};\n\t\t\t\t\t\tdispatch(removePackageSend(pkg_id));\n\t\t\t\t\t\tdispatch(addPkgSend(packageItem));\n\t\t\t\t\t}\n\t\t\t\t\tconst localSearch = contentOptions.find((content) => content === item.content);\n\t\t\t\t\thasOld = !localSearch;\n\t\t\t\t});\n\t\t\t\tsetHasOldContent(hasOld);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[setHasOldContent, contentOptions]\n\t);\n\n\tuseEffect(() => {\n\t\tif (currentPackagesSend.length > 0 && !!contentOptions?.length) {\n\t\t\tcheckPackageContent(currentPackagesSend);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [currentPackagesSend, checkPackageContent]);\n\n\tuseEffect(() => {\n\t\tif (hasOldContent) {\n\t\t\tsetNotification({\n\t\t\t\tmessage:\n\t\t\t\t\t'El contenido del paquete ha cambiado, en necesario actualizarlo para continuar con la creación de la guía',\n\t\t\t\tseverity: 'error'\n\t\t\t});\n\t\t}\n\t}, [hasOldContent, setNotification]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tsetHasOldContent(false);\n\t\t};\n\t}, [setHasOldContent]);\n\n\t// validate before move to rate when sending\n\tuseEffect(() => {\n\t\tsetWantsToMove(false);\n\n\t\tif (!(wantsToMove && canContinueToRateSend)) {\n\t\t\treturn;\n\t\t}\n\t\tif (!isRootOrAgent) {\n\t\t\thistory.push('/resultados');\n\t\t\treturn;\n\t\t}\n\t\tif (canPostSimulatedUser) {\n\t\t\thistory.push('/resultados');\n\t\t}\n\t}, [wantsToMove, history, canContinueToRateSend, dispatch, isRootOrAgent, canPostSimulatedUser]);\n\n\tconst canContinueWhenSending = (confirm?: boolean) => {\n\t\tif (hasOldContent) {\n\t\t\treturn setNotification({\n\t\t\t\tmessage:\n\t\t\t\t\t'El contenido del paquete ha cambiado, en necesario actualizarlo para continuar con la creación de la guía',\n\t\t\t\tseverity: 'error'\n\t\t\t});\n\t\t}\n\n\t\tif (\n\t\t\taddInsurance &&\n\t\t\tcurrentPackagesSend.every((item) => !item.insurance || item?.insurance === 0)\n\t\t) {\n\t\t\treturn setNotification({\n\t\t\t\tmessage: 'Todos tus empaques tienen $0.00 en Valor Declarado',\n\t\t\t\tseverity: 'error',\n\t\t\t\ttime: 2000\n\t\t\t});\n\t\t}\n\n\t\t// Alert for insured package with no declared value\n\t\tif (addInsurance && currentPackagesSend.some((item) => item.insurance === 0) && !confirm) {\n\t\t\tsetOpenConfirmDialog('insurance');\n\t\t\treturn;\n\t\t}\n\n\t\t// Alert for envelope with a content other than documents\n\t\tif (\n\t\t\tcurrentPackagesSend.some(\n\t\t\t\t(item) =>\n\t\t\t\t\titem.type?.toLowerCase() === 'sobre' &&\n\t\t\t\t\t!item.content?.toLowerCase()?.includes('documentos')\n\t\t\t) &&\n\t\t\t!confirm\n\t\t) {\n\t\t\tsetOpenConfirmDialog('charge');\n\t\t\treturn;\n\t\t}\n\n\t\tsetWantsToMove(true);\n\t\tdispatch(triggerValidationsSend(true));\n\t\tif (isRootOrAgent) {\n\t\t\tdispatch(triggerErrorSimulatedUser());\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tdispatch(resetCreatedLabels());\n\t}, [dispatch]);\n\n\tuseEffect(() => {\n\t\tif (customerHasBalance(isRootOrAgent ? simulatedCustomer : currentUser?.customer)) {\n\t\t\tgetUserBalance(isRootOrAgent, setAvailableBalance, simulatedCustomer?.id, simulatedUser?.id);\n\t\t}\n\t}, [\n\t\tisRootOrAgent,\n\t\tsimulatedCustomer,\n\t\tsimulatedUser,\n\t\tcurrentUser,\n\t\tcustomerHasBalance,\n\t\tsetAvailableBalance\n\t]);\n\n\treturn (\n\t\t\n\t\t\t
\n\t\t\t\t setOpenConfirmDialog(null)}\n\t\t\t\t\thandleClickConfirm={() => {\n\t\t\t\t\t\tsetOpenConfirmDialog(null);\n\t\t\t\t\t\tcanContinueWhenSending(true);\n\t\t\t\t\t}}\n\t\t\t\t\thandleClickCancel={() => setOpenConfirmDialog(null)}\n\t\t\t\t\tbodyText={\n\t\t\t\t\t\topenConfirmDialog === 'insurance'\n\t\t\t\t\t\t\t? `Algunos de tus empaques tienen $0.00 en Valor Declarado.\n\t\t\t\t\t¿Deseas Continuar?\n\t\t\t\t\t`\n\t\t\t\t\t\t\t: `El transportista podrá cobrar un extra por exceder dimensiones del sobre.\n\t\t\t\t\t¿Deseas Continuar?\n\t\t\t\t\t`\n\t\t\t\t\t}\n\t\t\t\t\tconfirmBtnLabel='Sí'\n\t\t\t\t\tcancelBtnLabel='No'\n\t\t\t\t/>\n\n\t\t\t\t
\n\t\t\t\t\t{/* Container */}\n\t\t\t\t\t\n\t\t\t\t\t\t{/* Origen */}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t{(Boolean(originAddressSend) || Boolean(destinationAddressSend)) && (\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t dispatch(swipeAddressSend())}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{/* Destino */}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t{/* Paquetes */}\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t{/* Bottom Bar */}\n\t\t\t\t {\n\t\t\t\t\t\tdispatch(resetSend());\n\t\t\t\t\t\tdispatch(resetCreatedLabels());\n\t\t\t\t\t}}\n\t\t\t\t\trightText='Continuar'\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t);\n};\n\nexport default Send;\n","import React, { useEffect, useContext, useState, useRef } from 'react';\nimport { Grid, TextField, Typography, Fade } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport clsx from 'clsx';\n// TODO change to date-fns instead of moment\nimport moment from 'moment';\nimport { setHours, setMinutes } from 'date-fns';\nimport { useDispatch, useSelector } from 'react-redux';\nimport DatePicker from 'react-datepicker';\nimport 'react-datepicker/dist/react-datepicker.css';\nimport { useHistory } from 'react-router-dom';\nimport { GridSelectionModel } from '@mui/x-data-grid';\n// Components\nimport AddressCard from '../Cards/AddressCard';\nimport InfoPickUpCard from '../Cards/InfoPickUpCard';\nimport ControlBar from '~components/Bar/ControlBar';\nimport RateOrSendControl from '~components/Bar/RateOrSendControl';\nimport TableShipmentSend from '~components/Tables/ShipmentTables/TableShipmentSend';\nimport { HeadingOne } from '~components/Headings';\n// Hooks\nimport { maxWidthContainer, useCardStyles } from '../../hooks/useStyles';\nimport { radiusCard } from '~hooks/useStyles';\nimport usePermissions from '~hooks/usePermissions';\nimport useLabels from '~hooks/useLabels';\nimport usePickupAvailability from '~hooks/usePickupAvailability';\nimport DrawContext from '../../context/DrawContext';\n// Store and utils\nimport {\n\tsetDatePickUp,\n\tsetTimePickUp,\n\ttriggerValidationsPickup,\n\tresetPickup,\n\tinitFlow,\n\tresetLabelsPickup\n} from '../../store/actions';\nimport { RootStore } from '../../store/store';\nimport { clearErrorsSimulatedUser, triggerErrorSimulatedUser } from '~store/actions/agents';\nimport { ShipmentSendResponse } from '~store/actions/ActionTypes';\nimport { setLabelsPickup } from '~store/actions';\nimport { CARRIERS } from '~util/logos';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\tcard: {\n\t\tpadding: theme.spacing(3)\n\t},\n\tinputTimes: {\n\t\tmaxWidth: 150,\n\t\twidth: '100%'\n\t},\n\tlinkTerms: {\n\t\t'&>a': {\n\t\t\ttextDecoration: 'none',\n\t\t\tcolor: theme.palette.primary.main\n\t\t}\n\t},\n\tterms: {\n\t\tmargin: `${theme.spacing(1)} ${theme.spacing(10)}`\n\t},\n\troot: {\n\t\tpadding: theme.spacing(3),\n\t\tborderRadius: `${radiusCard}px`,\n\t\tmaxWidth: maxWidthContainer\n\t}\n}));\n\n/**\n * The container to PickUp\n */\nconst PickUp: React.FC = () => {\n\tconst classes = useStyles();\n\tconst { cardClasses } = useCardStyles();\n\tconst dispatch = useDispatch();\n\tconst history = useHistory();\n\n\tconst {\n\t\tdatePickUp,\n\t\tendTimePickUp,\n\t\tstartTimePickUp,\n\t\tisTouchedPickup,\n\t\tcanContinueToSummaryPickUp,\n\t\taddressPickUp,\n\t\tlabelsPickup\n\t} = useSelector((state: RootStore) => state.pickup);\n\tconst { canPostSimulatedUser } = useSelector((state: RootStore) => state.simulatedUser);\n\tconst { isRootOrAgent } = usePermissions();\n\tconst [wantsToMove, setWantsToMove] = useState(false);\n\tconst [selectionModelPickUp, setSelectionModelPickUp] = useState([]);\n\n\tconst infoRef = useRef(null);\n\tconst { data } = useLabels(\n\t\tisRootOrAgent ? ['user_id', 'carrier', 'for_pickup'] : ['carrier', 'for_pickup']\n\t);\n\tconst fedexRef = useRef(false);\n\tconst { checkFedexAvailability, fedexAvailability } = usePickupAvailability();\n\n\t// 1. Change the card\n\t// 2. Reset errors when the container gets mounted anyway can not move util is valid\n\t// 3. Init the flow\n\t// 4. Clear error if is an agent or customer\n\tconst { setRCardStatus } = useContext(DrawContext);\n\tuseEffect(() => {\n\t\tdispatch(triggerValidationsPickup(false));\n\t\tdispatch(initFlow('pickup'));\n\t\tsetRCardStatus('HIDDEN');\n\t\tdispatch(clearErrorsSimulatedUser());\n\t}, [setRCardStatus, dispatch]);\n\n\t// validate before move to summary\n\tuseEffect(() => {\n\t\tsetWantsToMove(false);\n\t\tif (!(wantsToMove && canContinueToSummaryPickUp)) {\n\t\t\treturn;\n\t\t}\n\t\tif (!isRootOrAgent) {\n\t\t\thistory.push('/resumen');\n\t\t\treturn;\n\t\t}\n\t\tif (canPostSimulatedUser) {\n\t\t\thistory.push('/resumen');\n\t\t}\n\t}, [\n\t\twantsToMove,\n\t\thistory,\n\t\tcanContinueToSummaryPickUp,\n\t\tdispatch,\n\t\tisRootOrAgent,\n\t\tcanPostSimulatedUser\n\t]);\n\n\t// Validate end date\n\tuseEffect(() => {\n\t\tif (startTimePickUp) {\n\t\t\tdispatch(setTimePickUp(null, 'end'));\n\t\t}\n\t}, [startTimePickUp, dispatch]);\n\n\tconst canContinueWhenPickingUp = () => {\n\t\tsetWantsToMove(true);\n\t\tdispatch(triggerValidationsPickup(true));\n\t\tif (isRootOrAgent) {\n\t\t\tdispatch(triggerErrorSimulatedUser());\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (selectionModelPickUp.length > 0) {\n\t\t\tconst labelsList: ShipmentSendResponse[] = [];\n\t\t\tselectionModelPickUp.forEach((itemId) => {\n\t\t\t\tconst dataItem = data?.find((guide) => guide.parcel_number === itemId);\n\t\t\t\tdataItem && labelsList.push(dataItem);\n\t\t\t});\n\t\t\tdispatch(setLabelsPickup(labelsList));\n\t\t} else {\n\t\t\tdispatch(resetLabelsPickup());\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [selectionModelPickUp, data]);\n\n\tuseEffect(() => {\n\t\tif (labelsPickup.length > 0 && addressPickUp) {\n\t\t\tconst [first] = labelsPickup;\n\t\t\tif (addressPickUp.state !== first.origin.state) {\n\t\t\t\tdispatch(resetLabelsPickup());\n\t\t\t}\n\t\t\tconst isFedex = labelsPickup[0]?.carrier === CARRIERS?.FEDEX;\n\t\t\tfedexRef.current = isFedex;\n\t\t\t// Check availability for fedex\n\t\t\tif (isFedex) {\n\t\t\t\tcheckFedexAvailability(addressPickUp?.zip_code);\n\t\t\t}\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [addressPickUp, labelsPickup, checkFedexAvailability]);\n\n\tuseEffect(() => {\n\t\tif (isTouchedPickup && !Boolean(datePickUp)) {\n\t\t\tinfoRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t\t}\n\t}, [isTouchedPickup, datePickUp]);\n\n\t// useEffect(() => {\n\t// \tdispatch(resetPickup());\n\t// \t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, [])\n\n\treturn (\n\t\t\n\t\t\t
\n\t\t\t\t{/* Container */}\n\t\t\t\t (infoRef.current = instance)}\n\t\t\t\t\tcontainer\n\t\t\t\t\tspacing={2}\n\t\t\t\t\tjustifyContent='space-evenly'\n\t\t\t\t\talignItems='center'\n\t\t\t\t>\n\t\t\t\t\t{/* Labels table */}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{/* Origen */}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t{/* Indicaciones */}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t{/* Fecha hora */}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tLas recolecciones se realizan en horario abierto\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t dispatch(setDatePickUp(date as Date))}\n\t\t\t\t\t\t\t\t\t\t\tminDate={\n\t\t\t\t\t\t\t\t\t\t\t\t!fedexRef.current || !fedexAvailability\n\t\t\t\t\t\t\t\t\t\t\t\t\t? moment().toDate()\n\t\t\t\t\t\t\t\t\t\t\t\t\t: fedexAvailability[moment().format('YYYY-MM-DD')]\n\t\t\t\t\t\t\t\t\t\t\t\t\t? moment().toDate()\n\t\t\t\t\t\t\t\t\t\t\t\t\t: moment().add(1, 'days').toDate()\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//maxDate={addDays(new Date(), 5)}\n\t\t\t\t\t\t\t\t\t\t\tcustomInput={\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t dispatch(setTimePickUp(date as Date, 'start'))}\n\t\t\t\t\t\t\t\t\t\t\tminTime={\n\t\t\t\t\t\t\t\t\t\t\t\t!datePickUp\n\t\t\t\t\t\t\t\t\t\t\t\t\t? moment().toDate()\n\t\t\t\t\t\t\t\t\t\t\t\t\t: fedexRef.current && fedexAvailability\n\t\t\t\t\t\t\t\t\t\t\t\t\t? setHours(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetMinutes(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew Date(datePickUp),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfedexAvailability[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoment(datePickUp).format('YYYY-MM-DD')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]?.earliest_times[0]?.slice(3, 5) ?? '0'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfedexAvailability[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoment(datePickUp).format('YYYY-MM-DD')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]?.earliest_times[0]?.slice(0, 2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t: moment(new Date()).format('YYYY-MM-DD') ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t moment(datePickUp).format('YYYY-MM-DD')\n\t\t\t\t\t\t\t\t\t\t\t\t\t? moment().toDate()\n\t\t\t\t\t\t\t\t\t\t\t\t\t: moment(datePickUp).toDate()\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// maxTime={setHours(setMinutes(new Date(), 0), 22)}\n\t\t\t\t\t\t\t\t\t\t\tmaxTime={\n\t\t\t\t\t\t\t\t\t\t\t\tfedexRef.current && fedexAvailability && datePickUp\n\t\t\t\t\t\t\t\t\t\t\t\t\t? setHours(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetMinutes(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew Date(datePickUp),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfedexAvailability[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoment(datePickUp).format('YYYY-MM-DD')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]?.earliest_times\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?.at(-1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?.slice(3, 5) ?? '0'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfedexAvailability[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoment(datePickUp).format('YYYY-MM-DD')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]?.earliest_times\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?.at(-1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?.slice(0, 2) ?? '0'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t: setHours(setMinutes(new Date(), 0), 22)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tshowTimeSelect\n\t\t\t\t\t\t\t\t\t\t\tshowTimeSelectOnly\n\t\t\t\t\t\t\t\t\t\t\ttimeIntervals={!fedexRef.current ? 15 : 30}\n\t\t\t\t\t\t\t\t\t\t\ttimeCaption='Hora'\n\t\t\t\t\t\t\t\t\t\t\tdateFormat='h:mm aa'\n\t\t\t\t\t\t\t\t\t\t\tcustomInput={\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t dispatch(setTimePickUp(date as Date, 'end'))}\n\t\t\t\t\t\t\t\t\t\t\tminTime={\n\t\t\t\t\t\t\t\t\t\t\t\tfedexRef.current && fedexAvailability && datePickUp\n\t\t\t\t\t\t\t\t\t\t\t\t\t? setHours(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetMinutes(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew Date(datePickUp),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfedexAvailability[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoment(datePickUp).format('YYYY-MM-DD')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]?.latest_times[0]?.slice(3, 5)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfedexAvailability[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoment(datePickUp).format('YYYY-MM-DD')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]?.latest_times[0]?.slice(0, 2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t: setMinutes(startTimePickUp ? (startTimePickUp as Date) : new Date(), 60)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tmaxTime={\n\t\t\t\t\t\t\t\t\t\t\t\tfedexRef.current && fedexAvailability && datePickUp\n\t\t\t\t\t\t\t\t\t\t\t\t\t? setHours(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetMinutes(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew Date(datePickUp),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfedexAvailability[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoment(datePickUp).format('YYYY-MM-DD')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]?.latest_times\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?.at(-1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?.slice(3, 5) ?? '0'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfedexAvailability[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoment(datePickUp).format('YYYY-MM-DD')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]?.latest_times\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?.at(-1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?.slice(0, 2) ?? '0'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t: setHours(setMinutes(new Date(), 0), 22)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tshowTimeSelect\n\t\t\t\t\t\t\t\t\t\t\tshowTimeSelectOnly\n\t\t\t\t\t\t\t\t\t\t\ttimeIntervals={!fedexRef.current ? 15 : 30}\n\t\t\t\t\t\t\t\t\t\t\ttimeCaption='Hora'\n\t\t\t\t\t\t\t\t\t\t\tdateFormat='h:mm aa'\n\t\t\t\t\t\t\t\t\t\t\tcustomInput={\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t{/* Bottom Bar */}\n\t\t\t\t {\n\t\t\t\t\t\tdispatch(resetPickup());\n\t\t\t\t\t}}\n\t\t\t\t\trightText='Continuar'\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t);\n};\n\nexport default PickUp;\n","export default __webpack_public_path__ + \"static/media/template.0255f325.csv\";","import React, { useContext, useEffect, useState } from 'react';\nimport {\n\tButton,\n\tDialog,\n\tDialogContent,\n\tDialogContentText,\n\tDialogTitle,\n\tFade,\n\tGrid,\n\tTypography,\n\tLinearProgress\n} from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\n// import { Autocomplete } from '@material-ui/lab';\nimport { useDispatch, useSelector } from 'react-redux';\n// import { useHistory } from 'react-router-dom';\nimport MenuTabs from '~components/Tabs/MenuTabs';\n// import ControlBar from '../../Bar/ControlBar';\nimport DrawContext from '~context/DrawContext';\n// import AuthContext from '~context/AuthContext';\nimport { radiusCard } from '~hooks/useStyles';\nimport { RootStore } from '~store/store';\nimport {\n\tinitFlow,\n\t// resetMultiSend,\n\t// resetSend,\n\t// setCarrierMultiSend,\n\t// setServiceMultiSend,\n\ttriggerValidationsSend\n} from '~store/actions';\n// import usePermissions from '~hooks/usePermissions';\nimport { clearErrorsSimulatedUser } from '~store/actions/agents';\nimport { FilePond, registerPlugin } from 'react-filepond';\nimport FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type';\nimport axios from '~util/axios';\nimport axiosOriginal from 'axios';\nimport templateCsv from '../../../assets/csv/template.csv';\n\n// Import FilePond styles\nimport 'filepond/dist/filepond.min.css';\n// Custom Styles\nimport './styles.css';\nregisterPlugin(FilePondPluginFileValidateType);\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\twidth: '100%'\n\t},\n\tdownloadButons: {\n\t\tpadding: 12,\n\t\t'&>*': {\n\t\t\tmarginLeft: 20\n\t\t}\n\t},\n\twrapper: {\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tpadding: theme.spacing(3),\n\t\tborderRadius: `0 0 ${radiusCard}px ${radiusCard}px`\n\t}\n}));\n\n/**\n * The container for send\n */\nconst MultiSendLabel: React.FC = () => {\n\tconst classes = useStyles();\n\n\tconst dispatch = useDispatch();\n\t// const history = useHistory();\n\t// const { isRootOrAgent } = usePermissions();\n\t// const { currentUser } = useContext(AuthContext);\n\t// const { carrierMultiSend, serviceMultiSend } = useSelector((state: RootStore) => state.multisend);\n\tconst { simulatedUser } = useSelector((state: RootStore) => state.simulatedUser);\n\n\t// const [wantsToMove, setWantsToMove] = useState(false);\n\tconst [open, setOpen] = useState(false);\n\tconst [finished, setFinished] = useState(false);\n\tconst [error, setError] = useState([]);\n\tconst [success, setSuccess] = useState([]);\n\n\t// const [carriers, setCarriers] = useState([]);\n\t// const [services, setServices] = useState([]);\n\n\t// 1. Change the card\n\t// 2. Reset errors when the container gets mounted anyway can not move util is valid\n\t// 3. Init the flow\n\t// 4. Clear error if is an agent or customer\n\tconst { setRCardStatus } = useContext(DrawContext);\n\tuseEffect(() => {\n\t\tdispatch(triggerValidationsSend(false));\n\t\tdispatch(initFlow('multisend'));\n\t\t// TODO add the correct info\n\t\t// setRCardStatus('SUMMARY_ADDRESS');\n\t\tdispatch(clearErrorsSimulatedUser());\n\t}, [setRCardStatus, dispatch]);\n\n\t// validate before move to rate when sending\n\t// useEffect(() => {\n\t// \tsetWantsToMove(false);\n\t// \t// console.log('trying to move send, can', canContinueToRateSend);\n\t// \tif (!(wantsToMove && canContinueToRateSend)) {\n\t// \t\treturn;\n\t// \t}\n\t// \tif (!isRootOrAgent) {\n\t// \t\thistory.push('/resultados');\n\t// \t\treturn;\n\t// \t}\n\t// \tif (canPostSimulatedUser) {\n\t// \t\thistory.push('/resultados');\n\t// \t}\n\t// }, [wantsToMove, history, canContinueToRateSend, dispatch, isRootOrAgent, canPostSimulatedUser]);\n\n\t// Set unique carriers\n\t// useEffect(() => {\n\t// \tsetCarriers(['zubut']);\n\t// let services: string[] = [];\n\t// if (isRootOrAgent) {\n\t// \tservices = !simulatedUser\n\t// \t\t? []\n\t// \t\t: simulatedUser.services.map((s) => {\n\t// \t\t\t\tif (s.type === 'PICKUP') {\n\t// \t\t\t\t\treturn s.carrier;\n\t// \t\t\t\t}\n\t// \t\t\t\treturn '';\n\t// \t\t });\n\t// } else {\n\t// \tservices = currentUser.services.map((s) => {\n\t// \t\tif (s.type === 'PICKUP') {\n\t// \t\t\treturn s.carrier;\n\t// \t\t}\n\t// \t\treturn '';\n\t// \t});\n\t// }\n\t// setCarriers([...new Set(services)]);\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, [simulatedUser]);\n\t// }, []);\n\n\t// const canContinueWhenSending = () => {\n\t// \tsetWantsToMove(true);\n\t// \tdispatch(triggerValidationsSend(true));\n\t// \tif (isRootOrAgent) {\n\t// \t\tdispatch(triggerErrorSimulatedUser());\n\t// \t}\n\t// };\n\n\treturn (\n\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tGenerando guías\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tSe estan generando las guías, esto puede demorar bastantes minutos. Puede seguir\n\t\t\t\t\t\t\tutilizando su computadora. No cierre esta pestaña.\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{/* Control Tabs */}\n\t\t\t\t\n\t\t\t\t{/* Container */}\n\t\t\t\t\n\t\t\t\t\t{/* Subtitle */}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tGenera guías de manera masiva por medio de un csv, descarga la plantilla para respetar\n\t\t\t\t\t\t\tel formato\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{/* Services selector */}\n\t\t\t\t\t{/* \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t option}\n\t\t\t\t\t\t\t\tvalue={carrierMultiSend}\n\t\t\t\t\t\t\t\tonChange={(_: any, value) => {\n\t\t\t\t\t\t\t\t\tif (value) {\n\t\t\t\t\t\t\t\t\t\tdispatch(setCarrierMultiSend(value));\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// clear services\n\t\t\t\t\t\t\t\t\t\tsetServices([]);\n\t\t\t\t\t\t\t\t\t\tdispatch(resetMultiSend());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t// \n\t\t\t\t\t\t\t\t\t// \t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// \t\n\t\t\t\t\t\t\t\t\t// \n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t option}\n\t\t\t\t\t\t\t\tvalue={serviceMultiSend}\n\t\t\t\t\t\t\t\tonChange={(_: any, value) => {\n\t\t\t\t\t\t\t\t\tdispatch(setServiceMultiSend(value));\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t// \n\t\t\t\t\t\t\t\t\t// \t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// \t\n\t\t\t\t\t\t\t\t\t// \n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t */}\n\t\t\t\t\t{simulatedUser && (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{/* Download resource */}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{/* */}\n\t\t\t\t\t\t\t\tDa clic para descargar\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{/* */}\n\t\t\t\t\t\t\t\t{/* */}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{/* File */}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\tsetOpen(true);\n\n\t\t\t\t\t\t\t\t\t\t\tconst formData = new FormData();\n\t\t\t\t\t\t\t\t\t\t\tformData.append('csv_file', file, file.name);\n\t\t\t\t\t\t\t\t\t\t\tformData.append('service_id', '1');\n\t\t\t\t\t\t\t\t\t\t\tformData.append('carrier', 'zubut');\n\t\t\t\t\t\t\t\t\t\t\tformData.append('user_id', simulatedUser.id.toString());\n\n\t\t\t\t\t\t\t\t\t\t\t// aborting the request\n\t\t\t\t\t\t\t\t\t\t\tconst CancelToken = axiosOriginal.CancelToken;\n\t\t\t\t\t\t\t\t\t\t\tconst source = CancelToken.source();\n\n\t\t\t\t\t\t\t\t\t\t\tconsole.log('sending info ');\n\n\t\t\t\t\t\t\t\t\t\t\taxios({\n\t\t\t\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\t\t\t\turl: 'api/label/multiple',\n\t\t\t\t\t\t\t\t\t\t\t\tdata: formData,\n\t\t\t\t\t\t\t\t\t\t\t\tcancelToken: source.token,\n\t\t\t\t\t\t\t\t\t\t\t\tonUploadProgress: (e) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// updating progress indicator\n\t\t\t\t\t\t\t\t\t\t\t\t\tprogress(e.lengthComputable, e.loaded, e.total);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t.then((response) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// passing the file id to FilePond\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log('axios response', response);\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetFinished(true);\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetError(response?.data?.errors ? response.data.errors : []);\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetSuccess(response?.data?.labels ? response?.data?.labels : []);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetOpen(false);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// load(response.file);\n\t\t\t\t\t\t\t\t\t\t\t\t\tload('s');\n\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t.catch((thrown) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (axiosOriginal.isCancel(thrown)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log('Request canceled', thrown.message);\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// handle error\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log('error uploading file', thrown);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t// Setup abort interface\n\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\tabort: () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tsource.cancel('Operation canceled by the user.');\n\t\t\t\t\t\t\t\t\t\t\t\t\tabort();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{finished && (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tErrores:\n\t\t\t\t\t\t\t\t\t\t{error?.map((i) => (\n\t\t\t\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t\t\t\t
  • Error en fila {i + 2}
  • \n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tCorrectos: {success.length}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t
\n\t\t\t\t\t)}\n\t\t\t\t
\n\n\t\t\t\t{/* Bottom Bar */}\n\t\t\t\t{/* {\n\t\t\t\t\t\tdispatch(resetSend());\n\t\t\t\t\t}}\n\t\t\t\t\trightText='Continuar'\n\t\t\t\t> */}\n\t\t\t\t{/* */}\n\t\t\t\t{/* */}\n\t\t\t
\n\t\t
\n\t);\n};\n\nexport default MultiSendLabel;\n","import produce from 'immer';\nimport { create } from 'zustand';\n\ntype ReportId = {\n\toverweigthReportNumber?: string;\n\tsetOverweightReportNumber: (overweigthReportNumber: string) => void;\n\tinsuranceReportNumber?: string;\n\tsetInsuranceReportNumber: (insuranceReportNumber: string) => void;\n\n\t/** Cutoff Date */\n\tguidesCutoffDate: string;\n\tsetGuidesCutoffDate: (guidesCutoffDate: string) => void;\n\toverweightCutoffDate: string;\n\tsetoverweightCutoffDate: (guidesCutoffDate: string) => void;\n\tinsuranceCutoffDate: string;\n\tsetInsirancetCutoffDate: (guidesCutoffDate: string) => void;\n\n\t/** Type */\n\ttype: string;\n\tsetType: (type: string) => void;\n};\n\nconst useReportStore = create((set) => ({\n\toverweigthReportNumber: undefined,\n\tsetOverweightReportNumber: (overweigthReportNumber: string) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.overweigthReportNumber = overweigthReportNumber;\n\t\t\t})\n\t\t),\n\tinsuranceReportNumber: undefined,\n\tsetInsuranceReportNumber: (insuranceReportNumber: string) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.insuranceReportNumber = insuranceReportNumber;\n\t\t\t})\n\t\t),\n\tguidesCutoffDate: '',\n\tsetGuidesCutoffDate: (guidesCutoffDate: string) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.guidesCutoffDate = guidesCutoffDate;\n\t\t\t})\n\t\t),\n\toverweightCutoffDate: '',\n\tsetoverweightCutoffDate: (overweightCutoffDate: string) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.overweightCutoffDate = overweightCutoffDate;\n\t\t\t})\n\t\t),\n\tinsuranceCutoffDate: '',\n\tsetInsirancetCutoffDate: (insuranceCutoffDate: string) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.insuranceCutoffDate = insuranceCutoffDate;\n\t\t\t})\n\t\t),\n\ttype: '',\n\tsetType: (type: string) =>\n\t\tset((state) =>\n\t\t\tproduce(state, (draft) => {\n\t\t\t\tdraft.type = type;\n\t\t\t})\n\t\t)\n}));\n\nexport default useReportStore;\n","import React from 'react';\nimport { TextField } from '@mui/material';\nimport { Autocomplete } from '@material-ui/lab';\nimport { Controller, FieldErrors, Control } from 'react-hook-form';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\n\nexport const enterpriseTypeOptions = [\n\t{ title: 'Micro (1-10 empleados)', value: 'micro' },\n\t{ title: 'Pequeña (11-30 empleados)', value: 'pequeña' },\n\t{ title: 'Mediana (31-100 empleados)', value: 'mediana' },\n\t{ title: 'Grande (más de 100 empleados)', value: 'grande' }\n];\n\ninterface Props {\n\t// Function to pass the selected value\n\tcontrol: Control;\n\terrors: FieldErrors;\n\tdefaultValue?: { title: string; value: string };\n}\n\n/**\n * Autocomplete for \"Tipo de empresa\"\n */\nconst EnterpriseType: React.FC = (props) => {\n\treturn (\n\t\t (\n\t\t\t\t option.title}\n\t\t\t\t\tgetOptionSelected={(option, value) => option.title === value.title}\n\t\t\t\t\tonChange={(_, data) => onChange(data)}\n\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\tname='company_type'\n\t\t\tcontrol={props.control}\n\t\t\t// rules={{ required: 'Ingrese el Tipo de Empresa' }}\n\t\t\tdefaultValue={!!props.defaultValue?.value ? props.defaultValue : null}\n\t\t/>\n\t);\n};\n\nexport default EnterpriseType;\n","import React, { useEffect, useState } from 'react';\nimport axios from '~util/axios';\nimport { TextField } from '@mui/material';\nimport { Autocomplete } from '@material-ui/lab';\nimport { Controller, FieldErrors, Control } from 'react-hook-form';\nimport { SellerResponse } from '~store/actions/ActionTypes';\nimport usePermissions from '~hooks/usePermissions';\nimport { useSelector } from 'react-redux';\nimport { RootStore } from '~store/store';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\n\ninterface Props {\n\tcontrol: Control;\n\terrors: FieldErrors;\n\tdefaultValue?: SellerResponse;\n\tdefaultValueProspect?: number[];\n\tdisabled?: boolean;\n}\n\n/**\n * Autocomplete for Agents initials\n */\nconst SearchAgentInitials: React.FC = (props) => {\n\tconst [loading, setIsLoading] = useState(true);\n\tconst [agents, setAgents] = useState([]);\n\tconst { isRootOrAgent } = usePermissions();\n\tconst { simulatedCustomer } = useSelector((state: RootStore) => state.simulatedUser);\n\n\t// Fetch the agents\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.get('/api/operators?role=seller');\n\t\t\t\tsetAgents(data ?? []);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Error while fetching agents in [InputSearchAgentInitials]', error);\n\t\t\t} finally {\n\t\t\t\tsetIsLoading(false);\n\t\t\t}\n\t\t})();\n\t}, [props.defaultValueProspect, isRootOrAgent, simulatedCustomer?.id]);\n\n\tif (loading) return
;\n\treturn (\n\t\t (\n\t\t\t\t option.name}\n\t\t\t\t\tgetOptionSelected={(option, value) => option.id === value.id}\n\t\t\t\t\tonChange={(_, data) => onChange(data)}\n\t\t\t\t\tloading={loading}\n\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\tname='seller'\n\t\t\tcontrol={props.control}\n\t\t\tdefaultValue={\n\t\t\t\tprops.defaultValue\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...props.defaultValue,\n\t\t\t\t\t\t\tname: `${props.defaultValue.name} ${props.defaultValue.lastName}`\n\t\t\t\t\t }\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t);\n};\n\nexport default SearchAgentInitials;\n","import React, { useMemo } from 'react';\nimport { useLocation, useParams } from 'react-router-dom';\nimport { Grid, TextField, CircularProgress } from '@mui/material';\nimport { Controller, Control, FieldErrors } from 'react-hook-form';\nimport EnterpriseType from '../Inputs/EnterpriseType';\nimport EnterpriseOperations from '../Inputs/EnterpriseOperations';\nimport ChannelInput from '~components/Inputs/ChannelInput';\nimport SearchAgentInitials from '../../components/Inputs/InputSearchAgentInitials';\nimport PhoneNumberInput from '../../components/Inputs/InputForms/PhoneNumberInput';\nimport usePermissions from '../../hooks/usePermissions';\nimport { Validators } from '~util/validators';\nimport { Autocomplete } from '@material-ui/lab';\nimport { STATUS_LABELS } from '~pages/customer/ProspectsTable/columns';\nimport { enterpriseOperationsOptions } from '../Inputs/EnterpriseOperations';\nimport { enterpriseTypeOptions } from '../Inputs/EnterpriseType';\nimport { channelOptions } from '~components/Inputs/ChannelInput';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\nimport { ErrorOption } from 'react-hook-form';\nimport { capitalizeAll } from '~util/capitalize';\nimport { ProspectValidationStatus } from '~store/actions/ActionTypes';\n\ninterface Props {\n\tcontrol: Control;\n\terrors: FieldErrors;\n\tresponseError: string;\n\toldBussinesName: string;\n\toldEmail: string;\n\tinitialValues?: any;\n\tdisableSpecial?: boolean;\n\tsetError?: (name: string, error: ErrorOption) => void;\n\tclearErrors?: (name?: string | string[] | undefined) => void;\n\tisProfile?: boolean;\n}\n\nconst SignUpForm: React.FC = ({\n\tcontrol,\n\terrors,\n\tresponseError,\n\toldBussinesName,\n\toldEmail,\n\tinitialValues,\n\tdisableSpecial,\n\tsetError,\n\tclearErrors,\n\tisProfile\n}) => {\n\tconst { isRoot } = usePermissions();\n\tconst location = useLocation();\n\tconst params: { id?: string } = useParams();\n\tconst isCustomerPage = useMemo(() => location.pathname.includes('cliente'), [location]);\n\tconst isProspectPage = useMemo(() => location.pathname.includes('prospecto'), [location]);\n\tconst enterpriseOpsProspectTitle = useMemo(() => {\n\t\tconst item = enterpriseOperationsOptions.find(\n\t\t\t(item) => item.value === initialValues?.set_of_operations\n\t\t);\n\t\treturn item ? item.title : '';\n\t}, [initialValues]);\n\tconst companyTypeProspectTitle = useMemo(() => {\n\t\tconst item = enterpriseTypeOptions.find((item) => item.value === initialValues?.company_type);\n\t\treturn item ? item.title : '';\n\t}, [initialValues]);\n\tconst channelProspectTitle = useMemo(() => {\n\t\tconst item = channelOptions.find((item) => item.value === initialValues?.channel);\n\t\treturn item ? item.title : '';\n\t}, [initialValues]);\n\n\tif (params?.id && !initialValues) {\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\treturn (\n\t\t\n\t\t\t{/* Business name */}\n\t\t\t{(isCustomerPage || isProspectPage || isProfile) && (\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\t\tif (responseError === 'CUSTOMER_ALREADY_EXISTS' && bn === oldBussinesName) {\n\t\t\t\t\t\t\t\t\treturn 'Ya existe un registro con esta información';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tas={\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\tdefaultValue={initialValues?.business_name ? initialValues?.business_name : ''}\n\t\t\t\t\t\thelperText={errors?.business_name?.message}\n\t\t\t\t\t\tinputProps={{ style: { textTransform: 'uppercase' } }}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t)}\n\n\t\t\t{/* Name */}\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\t!isProspectPage && initialValues?.name\n\t\t\t\t\t\t\t? initialValues?.name\n\t\t\t\t\t\t\t: isProspectPage || isProfile\n\t\t\t\t\t\t\t? initialValues?.contact.name\n\t\t\t\t\t\t\t: ''\n\t\t\t\t\t}\n\t\t\t\t\thelperText={errors?.name?.message}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Last name */}\n\t\t\t{(isCustomerPage || isProspectPage || isProfile) && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\t\t!isProspectPage && initialValues?.last_name\n\t\t\t\t\t\t\t\t? initialValues?.last_name\n\t\t\t\t\t\t\t\t: isProspectPage || isProfile\n\t\t\t\t\t\t\t\t? initialValues?.contact.last_name\n\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t}\n\t\t\t\t\t\thelperText={errors?.last_name?.message}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t)}\n\n\t\t\t{/* Email */}\n\t\t\t\n\t\t\t\t {\n\t\t\t\t\t\t\tif (responseError === 'USER_ALREADY_EXISTS' && email === oldEmail) {\n\t\t\t\t\t\t\t\treturn 'Ya existe un registro con esta información';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tas={\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\t!isProspectPage && initialValues?.email\n\t\t\t\t\t\t\t? initialValues?.email\n\t\t\t\t\t\t\t: isProspectPage || isProfile\n\t\t\t\t\t\t\t? initialValues?.contact.email\n\t\t\t\t\t\t\t: ''\n\t\t\t\t\t}\n\t\t\t\t\thelperText={errors?.email?.message}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Phone */}\n\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t{/* Regime */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t capitalizeAll(option)}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option === value}\n\t\t\t\t\t\t\tonChange={(_, data) => onChange(data)}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tname='business_type'\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\trules={{ required: 'Ingrese el régimen' }}\n\t\t\t\t\tdefaultValue={!!initialValues?.business_type ? initialValues?.business_type : null}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Type */}\n\t\t\t{(isCustomerPage || isProspectPage || isProfile) && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\n\t\t\t{/* Giro */}\n\t\t\t{(isCustomerPage || isProspectPage || isProfile) && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\n\t\t\t{/* Channel */}\n\t\t\t{(isCustomerPage || isProspectPage || isProfile) && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\n\t\t\t{/* Web Site */}\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\trules={{\n\t\t\t\t\t\tmaxLength: { value: 200, message: 'El URL es demasiado largo' },\n\t\t\t\t\t\tvalidate: (value) =>\n\t\t\t\t\t\t\tvalue === '' ? true : Validators.URL(value as string) || 'Debe ser una URL'\n\t\t\t\t\t}}\n\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\tisProfile ? undefined : initialValues?.webpage ? initialValues?.webpage : ''\n\t\t\t\t\t}\n\t\t\t\t\thelperText={errors?.webpage?.message}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* TODO: seller? */}\n\t\t\t{/* Assing agent just for root users */}\n\t\t\t{isRoot || isProfile ? (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t) : null}\n\n\t\t\t{isProspectPage && !isProfile && (\n\t\t\t\t\n\t\t\t\t\t (\n\t\t\t\t\t\t\t option.name}\n\t\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option.value === value.value}\n\t\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\t\tif (!data) return;\n\t\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tPaperComponent={(paperProps) => (\n\t\t\t\t\t\t\t\t\t{paperProps.children}\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tname='validation_status'\n\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\trules={{ required: true }}\n\t\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\t\tinitialValues\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\tvalue: initialValues?.validation_status,\n\t\t\t\t\t\t\t\t\t\tname:\n\t\t\t\t\t\t\t\t\t\t\tSTATUS_LABELS[initialValues?.validation_status.normalize()] ??\n\t\t\t\t\t\t\t\t\t\t\tinitialValues?.validation_status\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t)}\n\t\t\n\t);\n};\n\nexport default SignUpForm;\n","import React, { useEffect, useRef, useMemo } from 'react';\nimport clsx from 'clsx';\nimport { Grid, Typography } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { Control, FieldErrors } from 'react-hook-form';\nimport usePermissions from '../../../hooks/usePermissions';\nimport { useCardStyles } from '../../../hooks/useStyles';\nimport SignUpForm from '../SignUpForm';\nimport IOSSwitch from '~components/Buttons/IOSSwitch';\nimport { useLocation } from 'react-router-dom';\nimport { HeadingOne } from '~components/Headings';\nimport { ErrorOption } from 'react-hook-form';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\tcontainer: {\n\t\tpadding: theme.spacing(3),\n\t\twidth: '100%',\n\t\tmarginTop: theme.spacing(4)\n\t}\n}));\n\ninterface Props {\n\tcontrol: Control;\n\terrors: FieldErrors;\n\tinitialValues: any;\n\tcustomID: string;\n\toldBussinesName: string;\n\toldEmail: string;\n\tresponseError: string;\n\tdisableSpecial: boolean;\n\tblocked: boolean;\n\thandleStatus?: () => void;\n\tsetError?: (name: string, error: ErrorOption) => void;\n\tclearErrors?: (name?: string | string[] | undefined) => void;\n\tisProfile?: boolean;\n}\n\n/**\n * Client form\n */\nconst ClientForm: React.FC = ({\n\tcontrol,\n\terrors,\n\tinitialValues,\n\tcustomID,\n\toldBussinesName,\n\toldEmail,\n\tresponseError,\n\tdisableSpecial,\n\tblocked,\n\thandleStatus,\n\tsetError,\n\tclearErrors,\n\tisProfile\n}) => {\n\tconst classes = useStyles();\n\tconst { cardClasses } = useCardStyles();\n\tconst infoRef = useRef(null);\n\tconst { isRoot } = usePermissions();\n\tconst location = useLocation();\n\n\tconst isProspectPage = useMemo(() => location.pathname.includes('prospecto'), [location]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\terrors.cfdi ||\n\t\t\terrors.agents ||\n\t\t\terrors.business_name ||\n\t\t\terrors.business_type ||\n\t\t\terrors.channel ||\n\t\t\terrors.email ||\n\t\t\terrors.enterprise_operations ||\n\t\t\terrors.last_name ||\n\t\t\terrors.name ||\n\t\t\terrors.phone_number\n\t\t) {\n\t\t\tinfoRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t\t}\n\t}, [errors]);\n\n\treturn (\n\t\t (infoRef.current = instance)}\n\t\t\tcontainer\n\t\t\tclassName={clsx(cardClasses.card, classes.container)}\n\t\t\tstyle={{\n\t\t\t\talignItems: 'center',\n\t\t\t\tmarginTop: 0,\n\t\t\t\tborderTopLeftRadius: 0,\n\t\t\t\tborderTopRightRadius: 0\n\t\t\t}}\n\t\t>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{!isProfile && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{customID ? `ID: ${customID}` : ''}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\t{isRoot && !isProspectPage && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tBloquear Cliente\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default ClientForm;\n","import React, { useMemo, useRef } from 'react';\nimport { Grid, TextField } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { Controller, Control, FieldErrors, useWatch } from 'react-hook-form';\nimport clsx from 'clsx';\nimport { useCardStyles } from '~hooks/useStyles';\nimport { HeadingOne } from '~components/Headings';\nimport { Autocomplete } from '@material-ui/lab';\nimport DropdownPaper from '../DropdownPaper';\nimport { PaymentConditions } from '~store/actions/ActionTypes';\nimport capitalize from '~util/capitalize';\nimport { shallow } from 'zustand/shallow';\nimport { useSelector } from '~store/store';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\tcontainer: {\n\t\tpadding: theme.spacing(3),\n\t\twidth: '100%',\n\t\tmarginTop: theme.spacing(4)\n\t},\n\tspaceWithCollapse: {\n\t\tmarginTop: theme.spacing(2)\n\t}\n}));\n\ninterface Props {\n\tcontrol: Control;\n\terrors: FieldErrors;\n\tinitialValues: any;\n\tclearSchema?: () => void;\n\tisProfile?: boolean;\n\tsetValue?: (name: string, value: any) => void;\n}\n\nconst MODALITY_OPTIONS = {\n\tTRACKING: 'Seguimiento',\n\tINDEPENDENT: 'Independiente',\n\tSC: 'SC'\n};\n\nconst DISPERSION_TYPE_OPTIONS = ['Global', 'Restrictivo'];\nconst BILLING_OPTIONS = ['Inmediata', 'Reportes'];\n\n/**\n * This form is used to create or update a Customer by an Agent,\n * it is imported in CreateOrUpdateCustomer\n */\n\nconst ClientFiscalForm: React.FC = ({\n\tcontrol,\n\terrors,\n\tinitialValues,\n\tclearSchema,\n\tisProfile,\n\tsetValue\n}) => {\n\tconst classes = useStyles();\n\tconst { cardClasses } = useCardStyles();\n\n\tconst { servicesInfoDraftCUCustomer } = useSelector((state) => state.cuCustomer, shallow);\n\n\tconst hasPrepaid = useMemo(\n\t\t() =>\n\t\t\tservicesInfoDraftCUCustomer?.some((item) =>\n\t\t\t\t(item?.name ?? item?.service)?.includes('Prepago')\n\t\t\t),\n\t\t[servicesInfoDraftCUCustomer]\n\t);\n\n\tconst infoRef = useRef(null);\n\n\tconst modality = useWatch({\n\t\tname: 'modality',\n\t\tcontrol,\n\t\tdefaultValue: initialValues?.modality || ''\n\t});\n\n\treturn (\n\t\t (infoRef.current = instance)}\n\t\t\tcontainer\n\t\t\tclassName={clsx(cardClasses.card, classes.container)}\n\t\t>\n\t\t\t{/* Title */}\n\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t{/* Info outside the Collapse */}\n\t\t\t\n\t\t\t\t{/* Modalidad */}\n\t\t\t\t\n\t\t\t\t\t (\n\t\t\t\t\t\t\t capitalize(option) ?? ''}\n\t\t\t\t\t\t\t\tgetOptionSelected={(option, value) => value && option === value}\n\t\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\t\tif (data === MODALITY_OPTIONS.SC && setValue) {\n\t\t\t\t\t\t\t\t\t\tsetValue('conditions', PaymentConditions.CASH);\n\t\t\t\t\t\t\t\t\t\tsetValue('conditions', PaymentConditions.CASH);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tPaperComponent={(paperProps) => (\n\t\t\t\t\t\t\t\t\t{paperProps.children}\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tname='modality'\n\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\tdefaultValue={initialValues?.modality || ''}\n\t\t\t\t\t\t//rules={{}}\n\t\t\t\t\t/>\n\t\t\t\t\n\n\t\t\t\t{/* Condiciones */}\n\t\t\t\t\n\t\t\t\t\t (\n\t\t\t\t\t\t\t option ?? ''}\n\t\t\t\t\t\t\t\tgetOptionSelected={(option, value) => value && option === value}\n\t\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tPaperComponent={(paperProps) => (\n\t\t\t\t\t\t\t\t\t{paperProps.children}\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tname='conditions'\n\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\tdefaultValue={initialValues?.conditions || ''}\n\t\t\t\t\t\t//rules={{}}\n\t\t\t\t\t/>\n\t\t\t\t\n\n\t\t\t\t{/* Facturación */}\n\t\t\t\t{!isProfile && (\n\t\t\t\t\t\n\t\t\t\t\t\t (\n\t\t\t\t\t\t\t\t capitalize(option) ?? ''}\n\t\t\t\t\t\t\t\t\tgetOptionSelected={(option, value) => value && option === value}\n\t\t\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tdisabled={modality === MODALITY_OPTIONS.SC}\n\t\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\tPaperComponent={(paperProps) => (\n\t\t\t\t\t\t\t\t\t\t{paperProps.children}\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tname='billing'\n\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\tdefaultValue={initialValues?.billing || ''}\n\t\t\t\t\t\t\t//rules={{}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t)}\n\n\t\t\t\t{/* Envío reportes */}\n\t\t\t\t{/* {!isProfile && (\n\t\t\t\t\t\n\t\t\t\t\t\t (\n\t\t\t\t\t\t\t\t capitalize(option) ?? ''}\n\t\t\t\t\t\t\t\t\tgetOptionSelected={(option, value) => value && option === value}\n\t\t\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\tPaperComponent={(paperProps) => (\n\t\t\t\t\t\t\t\t\t\t{paperProps.children}\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tname='review_reports'\n\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\tdefaultValue={initialValues?.review_reports || ''}\n\t\t\t\t\t\t\t//rules={{}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t)} */}\n\n\t\t\t\t{/* Tipo de dispersion (asignación a asuarios o global) */}\n\t\t\t\t{!isProfile && hasPrepaid && (\n\t\t\t\t\t\n\t\t\t\t\t\t (\n\t\t\t\t\t\t\t\t option ?? ''}\n\t\t\t\t\t\t\t\t\tgetOptionSelected={(option, value) => value && option === value}\n\t\t\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\tPaperComponent={(paperProps) => (\n\t\t\t\t\t\t\t\t\t\t{paperProps.children}\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tname='dispersion_type'\n\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\tdefaultValue={initialValues?.dispersion_type ?? null}\n\t\t\t\t\t\t\t//rules={{}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t)}\n\n\t\t\t\t{isProfile && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tname='customer_schema'\n\t\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\t\t\t\tcapitalize(\n\t\t\t\t\t\t\t\t\t\tinitialValues?.reports?.find((item: any) => item.name === 'guías')?.schema\n\t\t\t\t\t\t\t\t\t) ?? ''\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tname='customer_cutoffdate'\n\t\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\t\t\t\tcapitalize(\n\t\t\t\t\t\t\t\t\t\tinitialValues?.reports?.find((item: any) => item.name === 'guías')?.date\n\t\t\t\t\t\t\t\t\t) ?? ''\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\n\t\t\n\t);\n};\n\nexport default ClientFiscalForm;\n","import { Checkbox, IconButton, TextField, Tooltip } from '@mui/material';\nimport { GridRenderEditCellParams, GridColDef, useGridApiContext } from '@mui/x-data-grid';\nimport { Trash2, DollarSign } from 'react-feather';\nimport { GridValueFormatterParams } from '@mui/x-data-grid';\nimport { NotSuitableForRates } from '.';\nimport { CustomerResponse } from '~store/actions/ActionTypes';\n\ntype GetColumnsProps = {\n\tonDelete: (index: number, id: number) => any;\n\teditable: boolean;\n\tshowControlls: boolean;\n\tgoToRate: (id: number) => void;\n\taddedServices: string[];\n\tfromDispersion?: boolean;\n\tdisabled: boolean;\n\tcustomer?: CustomerResponse;\n\thasBalance: boolean;\n};\n\nconst RenderIsEnabled = (params: any) => {\n\treturn ;\n};\n\nfunction EnabledEditCheckboxCell(props: GridRenderEditCellParams, customerBalance?: boolean) {\n\tconst { id, value, field } = props;\n\tconst apiRef = useGridApiContext();\n\n\tconst handleChange = () => {\n\t\tapiRef.current.setEditCellValue({ id, field, value: !Boolean(value) });\n\t};\n\n\treturn (\n\t\t\n\t);\n}\n\nfunction EnabledInputCell(params: GridRenderEditCellParams) {\n\treturn (\n\t\t\n\t);\n}\n\nfunction EnabledEditInputCell(params: GridRenderEditCellParams) {\n\tconst { id, field } = params;\n\tconst apiRef = useGridApiContext();\n\n\tconst handleChange = (e: any) => {\n\t\tapiRef.current.setEditCellValue({ id, field, value: e.target.value });\n\t};\n\n\treturn (\n\t\t\n\t);\n}\n\nconst editableCols = (customerBalance?: boolean): GridColDef[] => {\n\treturn [\n\t\t{\n\t\t\tfield: 'enabled',\n\t\t\theaderName: 'Cargos / Seguro',\n\t\t\tflex: 1,\n\t\t\teditable: true,\n\t\t\trenderCell: RenderIsEnabled,\n\t\t\trenderEditCell: (params) => EnabledEditCheckboxCell(params, customerBalance)\n\t\t},\n\t\t{\n\t\t\tfield: 'discount',\n\t\t\theaderName: 'Aumento',\n\t\t\tflex: 1,\n\t\t\teditable: true,\n\t\t\ttype: 'number',\n\t\t\trenderCell: (params) => EnabledInputCell(params),\n\t\t\trenderEditCell: (params) => EnabledEditInputCell(params)\n\t\t},\n\t\t{\n\t\t\tfield: 'irregular_delivery_price',\n\t\t\theaderName: 'Manejo Especial',\n\t\t\tflex: 0.75,\n\t\t\teditable: true,\n\t\t\ttype: 'number',\n\t\t\tdescription: 'Precio especial para envío irregular'\n\t\t},\n\t\t{\n\t\t\tfield: 'reissue_price',\n\t\t\theaderName: 'Reexpedición',\n\t\t\tflex: 0.75,\n\t\t\teditable: true,\n\t\t\ttype: 'number',\n\t\t\tdescription: 'Precio especial para reexpediciones'\n\t\t},\n\t\t{\n\t\t\tfield: 'insurance_percentage',\n\t\t\theaderName: 'Seguro',\n\t\t\tflex: 1,\n\t\t\teditable: true,\n\t\t\ttype: 'number',\n\t\t\tvalueFormatter: (params: GridValueFormatterParams) => {\n\t\t\t\tif (!params.value) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t\tif (params.value > 100) {\n\t\t\t\t\treturn 100;\n\t\t\t\t}\n\t\t\t\tconst valueFormatted = Number(params.value).toLocaleString();\n\t\t\t\treturn `${valueFormatted} %`;\n\t\t\t},\n\t\t\tdescription: 'Precio especial para seguro'\n\t\t}\n\t];\n};\n\nexport function getColumns({\n\tonDelete,\n\teditable,\n\tshowControlls,\n\tgoToRate,\n\taddedServices,\n\tfromDispersion,\n\tdisabled,\n\tcustomer,\n\thasBalance\n}: GetColumnsProps) {\n\tconst columns: GridColDef[] = [\n\t\t{\n\t\t\tfield: 'carrier',\n\t\t\theaderName: 'Proveedor',\n\t\t\tflex: 1\n\t\t},\n\t\t{\n\t\t\tfield: 'name',\n\t\t\theaderName: 'Servicio',\n\t\t\tflex: 2.5\n\t\t},\n\t\t{\n\t\t\tfield: 'tariff_name',\n\t\t\theaderName: 'Tarifario',\n\t\t\tflex: 1.5\n\t\t}\n\t];\n\n\tif (editable) {\n\t\tcolumns.push(...editableCols(Boolean(customer && hasBalance)));\n\t}\n\n\tif (showControlls || editable) {\n\t\tcolumns.push({\n\t\t\tfield: 'actions',\n\t\t\theaderName: 'Acciones',\n\t\t\twidth: 120,\n\t\t\tsortable: false,\n\t\t\t// disableClickEventBubbling: true,\n\t\t\trenderCell: ({ id, tabIndex, row }) => {\n\t\t\t\t// NOTE(eduardo): tabIndex is not used anymore. We should delete\n\t\t\t\t// it and make sure that the change does not affect the current\n\t\t\t\t// behaviour.\n\t\t\t\tconst disableButton = disabled || addedServices.includes(id.toString());\n\n\t\t\t\treturn (\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t onDelete(tabIndex, id as number)}\n\t\t\t\t\t\t\t\taria-label='delete'\n\t\t\t\t\t\t\t\tcolor='default'\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t{row.carrier?.toLowerCase() === 'estafeta' &&\n\t\t\t\t\t\t\t!row.name.includes('2 Dias') &&\n\t\t\t\t\t\t\trow.name !== NotSuitableForRates.ESTAFETA_TRACKING &&\n\t\t\t\t\t\t\trow.name !== NotSuitableForRates.ESTAFETA_PICKUP &&\n\t\t\t\t\t\t\trow.name !== NotSuitableForRates.ESTAFETA_TRACKING_PICKUP && (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t goToRate(id as number)}\n\t\t\t\t\t\t\t\t\t\taria-label='rates'\n\t\t\t\t\t\t\t\t\t\tdisabled={disableButton}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t
\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t}\n\treturn columns;\n}\n","import { FC, useCallback, useEffect, useState, useMemo, useRef } from 'react';\nimport { useHistory, useParams } from 'react-router';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { useFieldArray } from 'react-hook-form';\nimport produce from 'immer';\nimport { Grid, TextField } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\nimport { Autocomplete } from '@material-ui/lab';\nimport { shallow } from 'zustand/shallow';\nimport clsx from 'clsx';\nimport { User } from 'react-feather';\nimport { GridColDef, GridEditCellPropsParams } from '@mui/x-data-grid';\n// Hooks\nimport useServices, { TariffListItem } from '~hooks/useServices';\nimport { useCardStyles } from '~hooks/useStyles';\nimport usePermissions from '~hooks/usePermissions';\n// Store\nimport { BookletServiceForm, CustomerResponse } from '~store/actions/ActionTypes';\nimport { setServicesCUCustomer } from '~store/actions/agents';\nimport useRateStore from '~store/useRateStore';\nimport { RootStore } from '~store/store';\n// Components\nimport DataGrid from '~components/Tables/DataGrid';\nimport { getColumns } from './columns';\nimport Selector from './Selector';\nimport { HeadingOne } from '~components/Headings';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\n// Utils\nimport { ProspectResponseType } from '~store/actions/ActionTypes';\nimport { CARRIERS, getCarrierName } from '~util/logos';\nimport useBalanceStore from '~store/useBalanceStore';\nimport useGetColumns, { formatServiceToRateName } from '../Client/ClientRate/useGetColumns';\nimport { getRateCurrentYear } from '~util/rateYear';\n\nexport enum NotSuitableForRates {\n\tESTAFETA_PICKUP = 'Estafeta: Recolección',\n\tESTAFETA_TRACKING = 'Estafeta: Rastreo',\n\tESTAFETA_TRACKING_PICKUP = 'Estafeta: Rastreo Recolección'\n}\n\nconst useStyles = makeStyles((theme) => ({\n\troot: {\n\t\tpadding: theme.spacing(3),\n\t\twidth: '100%',\n\t\tmarginTop: theme.spacing(4),\n\t\t'& .MuiGrid-item': {\n\t\t\tpaddingLeft: 8\n\t\t}\n\t},\n\ttable: {\n\t\tmarginTop: theme.spacing(2),\n\t\tbackgroundColor: theme.palette.background.paper\n\t},\n\tsettingsContainer: {\n\t\tmarginTop: 0,\n\t\tmarginBottom: theme.spacing(2.5)\n\t},\n\tlabel: {\n\t\tmarginBottom: theme.spacing(1),\n\t\tdisplay: 'inline-block'\n\t},\n\terror: {\n\t\tcolor: theme.palette.error.main\n\t},\n\tcontainer: {\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tmarginTop: theme.spacing(2),\n\t\tborderRadius: theme.spacing(1)\n\t\t// padding: `0 ${theme.spacing(2)}`\n\t},\n\ticon: {\n\t\tmarginBottom: theme.spacing(-1),\n\t\tmarginRight: theme.spacing(1.25)\n\t},\n\thelpText: {\n\t\tcolor: 'rgba(255, 255, 255, 0.7)',\n\t\tmargin: 0\n\t}\n}));\n\ninterface ServicesTableProps {\n\tregister: any;\n\tcontrol: any;\n\terror?: string;\n\tonChange: () => void;\n\tdefaultValues: BookletServiceForm[];\n\n\t// If editable in order to assign stock, etc\n\teditable?: boolean;\n\tcustomer?: CustomerResponse | ProspectResponseType;\n\tfromDispersion?: boolean;\n\t// callback for creating rates from dispersion flow\n\tonCreateRateFromDispersion?: () => void;\n\tisProspect?: boolean;\n}\n\n/**\n * This is the Service Selector Table\n * here can be edited and selected the carrier and corresponding service\n */\nconst ServicesTable: FC = ({\n\tregister,\n\tcontrol,\n\terror,\n\tonChange,\n\tdefaultValues,\n\t// When managing clients\n\teditable,\n\tcustomer,\n\tfromDispersion,\n\tonCreateRateFromDispersion,\n\tisProspect\n}) => {\n\tconst classes = useStyles();\n\tconst { cardClasses } = useCardStyles();\n\n\tconst { isRootOrAgent, isCustomer } = usePermissions();\n\tconst history = useHistory();\n\tconst { id } = useParams<{ id?: string }>();\n\tconst dispatch = useDispatch();\n\n\tconst { fields, append, remove } = useFieldArray({\n\t\tcontrol,\n\t\tname: 'services'\n\t});\n\n\tconst {\n\t\tselectedServices,\n\t\tupdateSelectedServices,\n\t\tcarrierOptions,\n\t\tservices,\n\t\taddService,\n\t\tcarrier,\n\t\tupdateCarrier,\n\t\tremoveService,\n\t\tloading,\n\t\ttariffsList,\n\t\tselectedService,\n\t\tsetSelectedService,\n\t\tdeleteRate\n\t} = useServices({ initialValues: defaultValues, editable: Boolean(editable), isCustomer });\n\n\tconst [setSelectedCarrier, setService, proposals, service, ranges, clientRates] = useRateStore(\n\t\t(state) => [\n\t\t\tstate.setSelectedCarrier,\n\t\t\tstate.setService,\n\t\t\tstate.proposals,\n\t\t\tstate.service,\n\t\t\tstate.ranges,\n\t\t\tstate.clientRates\n\t\t],\n\t\tshallow\n\t);\n\n\tconst { currentFlow } = useSelector((state: RootStore) => state.flow);\n\tconst { customerHasBalance } = useBalanceStore();\n\n\tconst [columns, setColumns] = useState([]);\n\tconst [addedServices, setAddedServices] = useState([]);\n\tconst [selectedRate, setSelectedRate] = useState(null);\n\tconst [volumeForEstafetaRate, setVolumeForEstafetaRate] = useState(null);\n\tconst [selectedProposal, setSelectedProposal] = useState(null);\n\n\tconst { fetchRates, setSelectedYear, selectedYear, getClientRates } = useGetColumns({\n\t\tselectedProposal,\n\t\tsetSelectedProposal\n\t});\n\n\tconst isEstafeta = useMemo(() => carrier?.value?.toLowerCase() === CARRIERS.ESTAFETA, [carrier]);\n\tconst hasFetchRates = useRef(false);\n\tconst tariffsOptions = useMemo(\n\t\t() =>\n\t\t\tisEstafeta\n\t\t\t\t? proposals\n\t\t\t\t: tariffsList?.filter(\n\t\t\t\t\t\t(item) => item.carrier?.toLowerCase() === carrier?.value?.toLowerCase()\n\t\t\t\t ) ?? [],\n\t\t[tariffsList, proposals, carrier, isEstafeta]\n\t);\n\n\t// FIXME\n\t// This is a kind of hotfix to render the service data grid\n\t// it looks like gives a problem when history push or replace\n\tconst [done, setDone] = useState(false);\n\tuseEffect(() => {\n\t\tsetDone(selectedServices.length > 0);\n\t}, [selectedServices.length]);\n\n\t// Set columns\n\tuseEffect(() => {\n\t\tsetColumns(\n\t\t\tgetColumns({\n\t\t\t\tonDelete: async (_: number, serviceId: number) => {\n\t\t\t\t\t// NOTE(eduardo): This is why we do the reverse().\n\t\t\t\t\tconst index = selectedServices.findIndex((s) => s.id === serviceId);\n\t\t\t\t\tconst rateServiceName = selectedServices[index]?.rates_service_description;\n\t\t\t\t\tconst existingRate = clientRates?.find((item) => item?.service === rateServiceName);\n\n\t\t\t\t\tconst shouldDeleteRate =\n\t\t\t\t\t\t!!clientRates &&\n\t\t\t\t\t\texistingRate &&\n\t\t\t\t\t\tselectedServices?.filter((item) => item.rates_service_description === rateServiceName)\n\t\t\t\t\t\t\t.length === 1;\n\n\t\t\t\t\t// Delete rate if is the only service that is using it\n\t\t\t\t\tif (shouldDeleteRate && id) {\n\t\t\t\t\t\tawait deleteRate({\n\t\t\t\t\t\t\tisProspect,\n\t\t\t\t\t\t\tclientRatesId: id,\n\t\t\t\t\t\t\trateConfigId: existingRate?.id?.toString()\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tremove(index);\n\t\t\t\t\tremoveService(serviceId);\n\t\t\t\t},\n\t\t\t\teditable: Boolean(editable) && isRootOrAgent,\n\t\t\t\tshowControlls: currentFlow !== 'cucustomer',\n\t\t\t\tgoToRate: (id: number) => {\n\t\t\t\t\tconst service = selectedServices.find((s) => s.id === id);\n\t\t\t\t\tif (typeof service?.carrier === 'string') {\n\t\t\t\t\t\tconst currentYear = getRateCurrentYear();\n\t\t\t\t\t\tlet serviceState =\n\t\t\t\t\t\t\tparseInt(currentYear) <= 2024\n\t\t\t\t\t\t\t\t? formatServiceToRateName(service.name)\n\t\t\t\t\t\t\t\t: service.rates_service_description ?? service?.name;\n\n\t\t\t\t\t\tsetService(serviceState);\n\t\t\t\t\t\tsetSelectedCarrier(service.carrier);\n\t\t\t\t\t}\n\n\t\t\t\t\t// if (fromDispersion && onCreateRateFromDispersion) {\n\t\t\t\t\t// \tonCreateRateFromDispersion();\n\t\t\t\t\t// \treturn;\n\t\t\t\t\t// }\n\n\t\t\t\t\tlet url = `/tarifas/${customer?.id}`;\n\t\t\t\t\thistory.push(url);\n\t\t\t\t},\n\t\t\t\taddedServices,\n\t\t\t\tdisabled: !customer?.id,\n\t\t\t\tcustomer: customer as CustomerResponse,\n\t\t\t\thasBalance: Boolean(customer && customerHasBalance(customer))\n\t\t\t})\n\t\t);\n\t}, [\n\t\teditable,\n\t\tremove,\n\t\tremoveService,\n\t\tisRootOrAgent,\n\t\tcurrentFlow,\n\t\tselectedServices,\n\t\thistory,\n\t\tid,\n\t\tsetSelectedCarrier,\n\t\tsetService,\n\t\tcustomer?.id,\n\t\tfromDispersion,\n\t\taddedServices,\n\t\tonCreateRateFromDispersion,\n\t\tcustomer,\n\t\tcustomerHasBalance,\n\t\tisProspect,\n\t\tclientRates,\n\t\tdeleteRate,\n\t\tproposals\n\t]);\n\n\t// Fill forms\n\tuseEffect(() => {\n\t\tif (loading && defaultValues) {\n\t\t\t// NOTE(eduardo): We do the reverse since we need to match the order\n\t\t\t// of items between the fields from `useFieldArray` and the ones\n\t\t\t// from our `useServices` hook. This order is important in the\n\t\t\t// onDelete callback used by getColumns\n\t\t\tdefaultValues.forEach((value) => {\n\t\t\t\tappend(value);\n\t\t\t});\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [loading, defaultValues]);\n\n\tuseEffect(() => {\n\t\tif (!!service && !!selectedYear && !hasFetchRates.current) {\n\t\t\tfetchRates();\n\t\t\thasFetchRates.current = true;\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [hasFetchRates, service, selectedYear]);\n\n\tuseEffect(() => {\n\t\tif (id) {\n\t\t\tgetClientRates(id, getRateCurrentYear());\n\t\t}\n\t}, [getClientRates, id]);\n\n\t// Clear errors\n\tuseEffect(() => {\n\t\tif (selectedServices.length > 0) {\n\t\t\tonChange();\n\t\t}\n\t\tif (editable) {\n\t\t\tdispatch(setServicesCUCustomer([...selectedServices].reverse()));\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [selectedServices, dispatch, editable]);\n\n\t// When is editable for manage clients\n\tconst handleEditCellChangeCommitted = useCallback(\n\t\tasync ({ id, field, props }: GridEditCellPropsParams) => {\n\t\t\tupdateSelectedServices((oldservices) =>\n\t\t\t\tproduce(oldservices, (draft) => {\n\t\t\t\t\tconst serviceToUpdate = oldservices.findIndex((s) => s.id === id);\n\t\t\t\t\tif (\n\t\t\t\t\t\tfield === 'min_stock' ||\n\t\t\t\t\t\tfield === 'discount' ||\n\t\t\t\t\t\tfield === 'price_list' ||\n\t\t\t\t\t\tfield === 'irregular_delivery_price' ||\n\t\t\t\t\t\tfield === 'reissue_price' ||\n\t\t\t\t\t\tfield === 'insurance_percentage'\n\t\t\t\t\t) {\n\t\t\t\t\t\tlet nextValue = +(props.value as string);\n\t\t\t\t\t\tnextValue = nextValue <= -1 ? 0 : nextValue;\n\t\t\t\t\t\tif (serviceToUpdate > -1) {\n\t\t\t\t\t\t\t//@ts-ignore\n\t\t\t\t\t\t\tdraft[serviceToUpdate][field] = nextValue;\n\n\t\t\t\t\t\t\t// HOTFIX to decide wether discount ot price_list\n\t\t\t\t\t\t\tif (field === 'discount' && nextValue > 0) {\n\t\t\t\t\t\t\t\tdraft[serviceToUpdate].price_list = 0;\n\t\t\t\t\t\t\t} else if (field === 'price_list' && nextValue > 0) {\n\t\t\t\t\t\t\t\tdraft[serviceToUpdate].discount = 0;\n\t\t\t\t\t\t\t} else if (field === 'min_stock' && nextValue <= 0) {\n\t\t\t\t\t\t\t\tdraft[serviceToUpdate].min_stock = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the field is enables\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tdraft[serviceToUpdate][field] = props.value;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[]\n\t);\n\n\t// Format added service\n\tconst selectAndFormatService = ({\n\t\tservice,\n\t\ttariff,\n\t\tvolume,\n\t\tproposal,\n\t\tcarrier\n\t}: {\n\t\tservice: BookletServiceForm;\n\t\ttariff?: { percentage_increase: number; name: string; id?: string };\n\t\tvolume?: string;\n\t\tproposal?: Proposal;\n\t\tcarrier: string;\n\t}) => {\n\t\tconst extra: any = {\n\t\t\tprice_list: 0,\n\t\t\tmin_stock: 1,\n\t\t\tdiscount: tariff?.percentage_increase ?? 0,\n\t\t\tenabled: true,\n\t\t\tproposal_id: proposal?.id,\n\t\t\tvolume: volume,\n\t\t\tcarrier,\n\t\t\ttariff_name: isEstafeta && tariff ? `${tariff?.name} / ${volume}` : tariff?.name ?? ''\n\t\t};\n\n\t\tif (editable) {\n\t\t\taddService({ ...service, ...extra });\n\t\t} else {\n\t\t\taddService(service);\n\t\t}\n\t\tsetAddedServices((prev) =>\n\t\t\tprev.concat(typeof service.id === 'string' ? service.id : service.id.toString())\n\t\t);\n\t\tappend({ value: service.id });\n\t\tsetVolumeForEstafetaRate(null);\n\t\tsetSelectedService(null);\n\t\tsetSelectedRate(null);\n\t\tsetSelectedProposal(null);\n\t};\n\n\treturn (\n\t\t\n\t\t\t
\n\t\t\t\t\n\n\t\t\t\t

\n\t\t\t\t\tSeleccionar proveedor y servicio para visualizar opciones a dar de alta\n\t\t\t\t

\n\t\t\t
\n\n\t\t\t{isRootOrAgent || currentFlow !== 'cucustomer' ? (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{!isEstafeta && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t option.label}\n\t\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option.label === value.label}\n\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tonChange={(_, value) => {\n\t\t\t\t\t\t\t\t\tvalue && updateCarrier(value);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tPaperComponent={(paperProps) => (\n\t\t\t\t\t\t\t\t\t{paperProps.children}\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t {\n\t\t\t\t\t\t\tselectedRate && setSelectedRate(null);\n\n\t\t\t\t\t\t\tsetSelectedService(service);\n\t\t\t\t\t\t\tif (service.name.includes('2 Dias')) {\n\t\t\t\t\t\t\t\tselectAndFormatService({\n\t\t\t\t\t\t\t\t\tservice,\n\t\t\t\t\t\t\t\t\tcarrier: service.carrier\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Check if the rate exist for that service\n\t\t\t\t\t\t\tconst existingRate =\n\t\t\t\t\t\t\t\t!!clientRates &&\n\t\t\t\t\t\t\t\tclientRates?.find((item) => item?.service === service?.rates_service_description);\n\t\t\t\t\t\t\tif (existingRate) {\n\t\t\t\t\t\t\t\tconst volumeItem = existingRate?.prices[0]?.rangeVolumes?.find(\n\t\t\t\t\t\t\t\t\t(item: any) => item?.selected\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tconst year = existingRate?.year || '';\n\t\t\t\t\t\t\t\tconst volume = `${volumeItem?.from}-${volumeItem?.to}`;\n\t\t\t\t\t\t\t\tconst name = existingRate?.proposal_name ?? 'Proposal';\n\t\t\t\t\t\t\t\tconst carrier = service.carrier;\n\n\t\t\t\t\t\t\t\tsetSelectedProposal({\n\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\tid: existingRate?.id.toString(),\n\t\t\t\t\t\t\t\t\tyear,\n\t\t\t\t\t\t\t\t\tmodality: '',\n\t\t\t\t\t\t\t\t\tvolume\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tconst tariff = {\n\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\tcarrier,\n\t\t\t\t\t\t\t\t\tpercentage_increase: 0,\n\t\t\t\t\t\t\t\t\tyear\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tsetSelectedRate(tariff);\n\t\t\t\t\t\t\t\tselectAndFormatService({\n\t\t\t\t\t\t\t\t\tservice,\n\t\t\t\t\t\t\t\t\ttariff,\n\t\t\t\t\t\t\t\t\tcarrier,\n\t\t\t\t\t\t\t\t\tvolume\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Set service to get proposals for estafeta\n\t\t\t\t\t\t\tif (!isEstafeta) return;\n\t\t\t\t\t\t\tservice?.rates_service_description &&\n\t\t\t\t\t\t\t\tsetService(service.rates_service_description ?? service?.name);\n\t\t\t\t\t\t\t!hasFetchRates.current &&\n\t\t\t\t\t\t\t\tsetSelectedYear({ value: getRateCurrentYear(), fromUser: false });\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tisEstafeta={isEstafeta}\n\t\t\t\t\t\tselectedService={selectedService ?? undefined}\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\t option?.name}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => !!option?.name && option?.name === value?.name}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tonChange={(_, value: any) => {\n\t\t\t\t\t\t\t\tif (!selectedService || !value) return;\n\n\t\t\t\t\t\t\t\tsetSelectedRate(value);\n\t\t\t\t\t\t\t\tif (!isEstafeta) {\n\t\t\t\t\t\t\t\t\tselectAndFormatService({\n\t\t\t\t\t\t\t\t\t\tservice: selectedService,\n\t\t\t\t\t\t\t\t\t\ttariff: value,\n\t\t\t\t\t\t\t\t\t\tcarrier: value.carrier\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetSelectedProposal(value);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t{isEstafeta && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t item.field)}\n\t\t\t\t\t\t\t\tgetOptionLabel={(option) => option}\n\t\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option === value}\n\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tonChange={(_, value) => {\n\t\t\t\t\t\t\t\t\tif (!selectedService || !selectedRate || !value) return;\n\t\t\t\t\t\t\t\t\tsetVolumeForEstafetaRate(value);\n\t\t\t\t\t\t\t\t\tselectAndFormatService({\n\t\t\t\t\t\t\t\t\t\tservice: selectedService,\n\t\t\t\t\t\t\t\t\t\tproposal: selectedProposal ?? undefined,\n\t\t\t\t\t\t\t\t\t\tvolume: value,\n\t\t\t\t\t\t\t\t\t\ttariff: selectedRate,\n\t\t\t\t\t\t\t\t\t\tcarrier: getCarrierName(CARRIERS.ESTAFETA)\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tsetSelectedService(null);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tPaperComponent={(paperProps) => (\n\t\t\t\t\t\t\t\t\t{paperProps.children}\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t)}\n\t\t\t{error ?

{error}

:

}\n\t\t\t{done && (\n\t\t\t\t\n\t\t\t)}\n\t\t\t{fields.map((field, index) => (\n\t\t\t\t\n\t\t\t))}\n\t\t\n\t);\n};\n\nexport default ServicesTable;\n","import { useState, useEffect, useCallback, useMemo, useContext } from 'react';\nimport { BookletServiceForm } from '~store/actions/ActionTypes';\nimport { Option } from '~components/Forms/Select';\nimport axios, { instanceRate } from '~util/axios';\nimport { CARRIERS, getCarrierName } from '~util/logos';\nimport { getRateCurrentYear } from '~util/rateYear';\nimport DrawContext from '~context/DrawContext';\n\ntype ServiceMap = {\n\t[key: string]: BookletServiceForm[];\n};\n\ntype Props = {\n\tinitialValues: any;\n\teditable?: boolean;\n\tisCustomer?: boolean;\n};\n\nexport type TariffListItem = {\n\tname: string;\n\tcarrier: string;\n\tpercentage_increase: number;\n\tyear: string;\n};\n\nexport default function useServices({ initialValues, editable, isCustomer }: Props) {\n\tconst [carrier, updateCarrier] = useState

;\n\nconst ColumnsReportsConfig = () => {\n\tconst classes = useStyles();\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\tNum.\n\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\tNum. de Archivos\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\tTipo de Reporte\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\tCorte\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\tFecha\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\tSubtipo\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\tDías Rev.\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\tDías Prefac.\n\t\t\t\n\t\t\n\t);\n};\n\nexport default ColumnsReportsConfig;\n","import {\n\tConditionTypeReport,\n\tPreInvoiceDays,\n\tReportDateBiweekly,\n\tReportDateMonthly,\n\tReportDateWeekly,\n\tReportSubType,\n\tSchemaType\n} from '~store/actions/ActionTypes';\n\nexport const subtypeOptions = [\n\tReportSubType.CURRENT_MONTH,\n\tReportSubType.PREVIOUS_MONTH,\n\tReportSubType.BIWEEK,\n\tReportSubType.WEEK\n];\n\nexport const cutOptions = [\n\t{ title: SchemaType.IMMEDIATE },\n\t{ title: SchemaType.WEEKLY },\n\t{ title: SchemaType.BIWEEKLY },\n\t{ title: SchemaType.MONTHLY }\n];\n\nexport const cutOptionsOverweightSupplier = [\n\t{ title: SchemaType.IMMEDIATE },\n\t{ title: SchemaType.INDEPENDENT }\n];\n\nexport const monthDateOptions = [\n\tReportDateMonthly.DAY_1,\n\tReportDateMonthly.DAY_6,\n\tReportDateMonthly.DAY_12,\n\tReportDateMonthly.DAY_16,\n\tReportDateMonthly.DAY_22,\n\tReportDateMonthly.DAY_26,\n\tReportDateMonthly.DAY_31\n];\n\nexport const weeklyDateOptions = [\n\tReportDateWeekly.MONDAY,\n\tReportDateWeekly.TUESDAY,\n\tReportDateWeekly.WEDNESDAY,\n\tReportDateWeekly.THURSDAY,\n\tReportDateWeekly.FRIDAY,\n\tReportDateWeekly.SATURDAY,\n\tReportDateWeekly.SUNDAY\n];\nexport const biweeklyDateOptions = [ReportDateBiweekly.FIRST_WEEK];\n\nexport const reviewOptions = [\n\t{ title: ConditionTypeReport.INMEDIATE },\n\t{ title: ConditionTypeReport.THREE_DAYS },\n\t{ title: ConditionTypeReport.FIVE_DAYS }\n];\n\nexport const billingOptions = [\n\t{ title: PreInvoiceDays.INMEDIATE },\n\t{ title: PreInvoiceDays.ONE_DAY },\n\t{ title: PreInvoiceDays.TWO_DAYS },\n\t{ title: PreInvoiceDays.THREE_DAYS },\n\t{ title: PreInvoiceDays.PURCHASE_ORDER }\n];\n","import { useState, useCallback } from 'react';\nimport { monthDateOptions, weeklyDateOptions, biweeklyDateOptions } from '../options';\nimport { ReportItem, ReportSubType, SchemaType } from '~store/actions/ActionTypes';\n\nconst useOptions = ({ setValue }: { setValue?: (key: string, value: string) => void }) => {\n\tconst [dateOptions, setDateOptions] = useState([]);\n\tconst [subtype, setSubtype] = useState('');\n\tconst [date, setDate] = useState('');\n\tconst [reportNunberOptions, setReportNunberOptions] = useState<{ num: string }[]>([]);\n\n\t/** Determine cutoff date options to show depending on the type of cut chosen */\n\tconst handleDateOptions = useCallback(\n\t\t(cutoffDate: string, dateValue?: string) => {\n\t\t\tif (cutoffDate === SchemaType.MONTHLY) {\n\t\t\t\tsetDateOptions(monthDateOptions);\n\t\t\t} else if (cutoffDate === SchemaType.WEEKLY) {\n\t\t\t\tsetDateOptions(weeklyDateOptions);\n\t\t\t} else {\n\t\t\t\tsetDateOptions(biweeklyDateOptions);\n\t\t\t}\n\t\t\tsetValue && dateValue && setValue('guides_date', dateValue);\n\t\t},\n\t\t[setValue]\n\t);\n\n\t/** Set the subtype depending on the type of schema chosen */\n\tconst handleSubtypes = useCallback(\n\t\t(schema: string, type: 'guides' | 'insurance' | 'overweight', defautlValues?: ReportItem) => {\n\t\t\tif (schema === SchemaType.WEEKLY) {\n\t\t\t\tsetValue && setValue(`${type}_subtype`, ReportSubType.WEEK);\n\t\t\t} else if (schema === SchemaType.BIWEEKLY) {\n\t\t\t\tsetValue && setValue(`${type}_subtype`, ReportSubType.BIWEEK);\n\t\t\t} else if (schema === SchemaType.IMMEDIATE || schema === SchemaType.INDEPENDENT) {\n\t\t\t\tsetValue && setValue(`${type}_subtype`, '');\n\t\t\t} else {\n\t\t\t\tsetValue && setValue(`${type}_subtype`, defautlValues?.sub_type || '');\n\t\t\t}\n\t\t},\n\t\t[setValue]\n\t);\n\n\t/** Report numbers that can be chosen to define the type of report */\n\tconst handleReportNumber = useCallback((reportNumber: string) => {\n\t\tif (reportNumber! === '1') {\n\t\t\tsetReportNunberOptions([{ num: '1' }, { num: '2' }]);\n\t\t} else {\n\t\t\tsetReportNunberOptions([{ num: '1' }, { num: '2' }, { num: '3' }]);\n\t\t}\n\t}, []);\n\n\treturn {\n\t\tdateOptions,\n\t\thandleDateOptions,\n\t\thandleSubtypes,\n\t\tsubtype,\n\t\tsetSubtype,\n\t\tdate,\n\t\tsetDate,\n\t\thandleReportNumber,\n\t\treportNunberOptions\n\t};\n};\n\nexport default useOptions;\n","import { useEffect, useMemo } from 'react';\n//Libraries\nimport { Grid, Typography, TextField } from '@mui/material';\nimport { Control, Controller } from 'react-hook-form';\nimport { Autocomplete } from '@material-ui/lab';\nimport { shallow } from 'zustand/shallow';\n//Styles\nimport { useStyles } from './useReporTable.styles';\n//Hooks\nimport usePermissions from '~hooks/usePermissions';\nimport useOptions from './hooks/useOptions';\nimport { subtypeOptions, cutOptions, reviewOptions, billingOptions } from './options';\n//Store\nimport useReportStore from '~store/ReportStore';\nimport capitalize from '~util/capitalize';\nimport { FieldErrors } from 'react-hook-form';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\nimport { ReportItem, ReportNumber, ReportSubType, SchemaType } from '~store/actions/ActionTypes';\n\ninterface Props {\n\tcontrol: Control;\n\tinitialValues?: ReportItem;\n\terrors: FieldErrors;\n\tsetValue?: (key: string, value: string) => void;\n}\n\nconst GuidesRow = ({ control, initialValues, errors, setValue }: Props) => {\n\tconst classes = useStyles();\n\n\tconst { isRoot } = usePermissions();\n\tconst { dateOptions, handleDateOptions, handleSubtypes, setSubtype } = useOptions({\n\t\tsetValue\n\t});\n\n\tconst [setGuidesCutoffDate, guidesCutoffDate, insuranceCutoffDate, overweightCutoffDate] =\n\t\tuseReportStore(\n\t\t\t(state) => [\n\t\t\t\tstate.setGuidesCutoffDate,\n\t\t\t\tstate.guidesCutoffDate,\n\t\t\t\tstate.insuranceCutoffDate,\n\t\t\t\tstate.overweightCutoffDate\n\t\t\t],\n\t\t\tshallow\n\t\t);\n\n\tconst hasFilledValues = useMemo(\n\t\t() => !!insuranceCutoffDate || !!guidesCutoffDate || !!overweightCutoffDate,\n\t\t[insuranceCutoffDate, guidesCutoffDate, overweightCutoffDate]\n\t);\n\n\tuseEffect(() => {\n\t\tsetValue && setValue('guides_subtype', '');\n\t\thandleSubtypes(guidesCutoffDate, 'guides', initialValues!);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [guidesCutoffDate, handleSubtypes, initialValues]);\n\n\tuseEffect(() => {\n\t\tsetGuidesCutoffDate(initialValues?.schema || '');\n\t}, [initialValues?.schema, setGuidesCutoffDate]);\n\n\tuseEffect(() => {\n\t\thandleDateOptions(guidesCutoffDate);\n\t}, [guidesCutoffDate, handleDateOptions]);\n\n\tuseEffect(() => {\n\t\tif (initialValues) {\n\t\t\tsetValue && setValue('guides_date', initialValues?.date ?? '');\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\treturn (\n\t\t\n\t\t\t{/* Num. Rep. */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\tname='guides_reportNumber'\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={ReportNumber.ONE}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Reports number of files */}\n\t\t\t\n\n\t\t\t{/* Report Type */}\n\t\t\t\n\t\t\t\tGuías\n\t\t\t\n\n\t\t\t{/* Cutoff day schema*/}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t capitalize(option.title) || ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => !!value?.title && option.title === value?.title}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\tsetGuidesCutoffDate(data?.title);\n\t\t\t\t\t\t\t\tif (!setValue) return;\n\t\t\t\t\t\t\t\tsetValue('guides_date', '');\n\t\t\t\t\t\t\t\tsetValue('guides_subtype', '');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={initialValues?.schema ? { title: initialValues?.schema } : null}\n\t\t\t\t\trules={{ required: isRoot && hasFilledValues }}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Cutoff date */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t capitalize(option) || ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option === value}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={initialValues?.date}\n\t\t\t\t\trules={{\n\t\t\t\t\t\trequired:\n\t\t\t\t\t\t\tisRoot &&\n\t\t\t\t\t\t\thasFilledValues &&\n\t\t\t\t\t\t\tguidesCutoffDate !== SchemaType.IMMEDIATE &&\n\t\t\t\t\t\t\tguidesCutoffDate !== SchemaType.INDEPENDENT\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Subtype */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t item !== ReportSubType.BIWEEK && item !== ReportSubType.WEEK\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={!isRoot || guidesCutoffDate !== SchemaType.MONTHLY}\n\t\t\t\t\t\t\tgetOptionLabel={(option) => capitalize(option) || ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option === value}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\tsetSubtype(data ?? '');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\trules={\n\t\t\t\t\t\tisRoot && hasFilledValues && guidesCutoffDate === SchemaType.MONTHLY\n\t\t\t\t\t\t\t? { required: true }\n\t\t\t\t\t\t\t: {}\n\t\t\t\t\t}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={initialValues?.sub_type}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Review days */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t option.title || ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => !!value?.title && option.title === value?.title}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={initialValues?.conditions ? { title: initialValues?.conditions } : null}\n\t\t\t\t\trules={{ required: isRoot && hasFilledValues }}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Billing */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t option.title || ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => !!value?.title && option.title === value?.title}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\tinitialValues?.pre_invoice_days ? { title: initialValues?.pre_invoice_days } : null\n\t\t\t\t\t}\n\t\t\t\t\trules={{ required: isRoot && hasFilledValues }}\n\t\t\t\t/>\n\t\t\t\n\t\t\n\t);\n};\n\nexport default GuidesRow;\n","import { useEffect, useMemo } from 'react';\n//Libraries\nimport { Grid, TextField, Tooltip } from '@mui/material';\nimport { Control, Controller } from 'react-hook-form';\nimport { Autocomplete } from '@material-ui/lab';\nimport { shallow } from 'zustand/shallow';\n//Styles\nimport { useStyles } from './useReporTable.styles';\n//Store\nimport useReportStore from '~store/ReportStore';\n//Hooks\nimport usePermissions from '~hooks/usePermissions';\nimport useOptions from './hooks/useOptions';\nimport {\n\tsubtypeOptions,\n\tcutOptions,\n\treviewOptions,\n\tbillingOptions,\n\tcutOptionsOverweightSupplier\n} from './options';\nimport capitalize from '~util/capitalize';\nimport { FieldErrors } from 'react-hook-form';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\nimport {\n\tReportFileType,\n\tReportItem,\n\tReportName,\n\tReportNumber,\n\tReportSubType,\n\tReportType,\n\tSchemaType\n} from '~store/actions/ActionTypes';\nimport { useWatch } from 'react-hook-form';\n\ninterface Props {\n\tcontrol: Control;\n\tinitialValues?: ReportItem;\n\terrors: FieldErrors;\n\tsetValue?: (key: string, value: unknown) => void;\n}\n\nconst REPORT_FILE_TYPE_OPTIONS = Object.values(ReportFileType);\n\nconst OverweightRow = ({ control, initialValues, errors, setValue }: Props) => {\n\tconst classes = useStyles();\n\n\tconst { isRoot } = usePermissions();\n\tconst { dateOptions, handleDateOptions, handleSubtypes } = useOptions({\n\t\tsetValue\n\t});\n\n\tconst [\n\t\tsetOverweightReportNumber,\n\t\toverweightCutoffDate,\n\t\tsetoverweightCutoffDate,\n\t\tguidesCutoffDate,\n\t\tinsuranceCutoffDate,\n\t\toverweigthReportNumber\n\t] = useReportStore(\n\t\t(state) => [\n\t\t\tstate.setOverweightReportNumber,\n\t\t\tstate.overweightCutoffDate,\n\t\t\tstate.setoverweightCutoffDate,\n\t\t\tstate.guidesCutoffDate,\n\t\t\tstate.insuranceCutoffDate,\n\t\t\tstate.overweigthReportNumber\n\t\t],\n\t\tshallow\n\t);\n\tconst overweightTypeName: { name: string; value: ReportName } | undefined = useWatch({\n\t\tcontrol,\n\t\tname: 'overweight_name'\n\t});\n\n\tconst reportFileType = useWatch({\n\t\tcontrol,\n\t\tname: 'report_file_type'\n\t});\n\n\tconst guidesDate: string | undefined = useWatch({\n\t\tcontrol,\n\t\tname: 'guides_date'\n\t});\n\n\tconst hasSameFileSet = useMemo(\n\t\t() => reportFileType === ReportFileType.SAME_FILE,\n\t\t[reportFileType]\n\t);\n\n\tconst hasFilledValues = useMemo(\n\t\t() => !!insuranceCutoffDate || !!guidesCutoffDate || !!overweightCutoffDate,\n\t\t[insuranceCutoffDate, guidesCutoffDate, overweightCutoffDate]\n\t);\n\n\tconst reportNameConfigForOverweight = useMemo(\n\t\t() => guidesCutoffDate === SchemaType.IMMEDIATE || guidesCutoffDate === SchemaType.INDEPENDENT,\n\t\t[guidesCutoffDate]\n\t);\n\n\tconst canNotEditCutData = useMemo(\n\t\t() =>\n\t\t\toverweightTypeName?.value === ReportName.OVERWEIGHTS &&\n\t\t\toverweigthReportNumber === ReportNumber.ONE,\n\t\t[overweigthReportNumber, overweightTypeName]\n\t);\n\n\tuseEffect(() => {\n\t\tinitialValues &&\n\t\t\thandleSubtypes(\n\t\t\t\thasSameFileSet && canNotEditCutData ? guidesCutoffDate : overweightCutoffDate,\n\t\t\t\t'overweight',\n\t\t\t\tinitialValues\n\t\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\toverweightCutoffDate,\n\t\thandleSubtypes,\n\t\tinitialValues,\n\t\thasSameFileSet,\n\t\tguidesCutoffDate,\n\t\tcanNotEditCutData\n\t]);\n\n\tuseEffect(() => {\n\t\tsetoverweightCutoffDate(initialValues?.schema || '');\n\t}, [initialValues?.schema, setoverweightCutoffDate]);\n\n\tuseEffect(() => {\n\t\thandleDateOptions(\n\t\t\thasSameFileSet && canNotEditCutData ? guidesCutoffDate : overweightCutoffDate\n\t\t);\n\t}, [\n\t\toverweightCutoffDate,\n\t\thandleDateOptions,\n\t\tguidesCutoffDate,\n\t\thasSameFileSet,\n\t\tcanNotEditCutData\n\t]);\n\n\tuseEffect(() => {\n\t\tif (hasSameFileSet && canNotEditCutData && guidesDate) {\n\t\t\tsetValue && setValue('overweight_date', guidesDate);\n\t\t}\n\t}, [guidesDate, hasSameFileSet, canNotEditCutData, initialValues, setValue]);\n\n\tuseEffect(() => {\n\t\tif (initialValues) {\n\t\t\tsetValue && setValue('overweight_date', initialValues?.date ?? '');\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\tinitialValues?.type === ReportType.ONLY_OVERWEIGHTS ||\n\t\t\tinitialValues?.type === ReportType.OVERWEIGHTS_AND_INSURANCES ||\n\t\t\tinitialValues?.type === ReportType.LABELS_AND_INSURANCES\n\t\t) {\n\t\t\tsetOverweightReportNumber(ReportNumber.TWO);\n\t\t} else {\n\t\t\tsetOverweightReportNumber(ReportNumber.ONE);\n\t\t}\n\t}, [initialValues?.type, setOverweightReportNumber]);\n\n\treturn (\n\t\t\n\t\t\t{/* Num Rep */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t option.num ?? ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option.num === value?.num}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\tsetOverweightReportNumber(data?.num);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tname='overweight_reportNumber'\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\tinitialValues?.type === 'todos' || initialValues?.type === 'guías y sobrepesos'\n\t\t\t\t\t\t\t? { num: '1' }\n\t\t\t\t\t\t\t: initialValues?.type === ReportType.ONLY_OVERWEIGHTS ||\n\t\t\t\t\t\t\t initialValues?.type === ReportType.OVERWEIGHTS_AND_INSURANCES ||\n\t\t\t\t\t\t\t initialValues?.type === ReportType.LABELS_AND_INSURANCES\n\t\t\t\t\t\t\t? { num: '2' }\n\t\t\t\t\t\t\t: null\n\t\t\t\t\t}\n\t\t\t\t\trules={isRoot && hasFilledValues ? { required: true } : { required: false }}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Number of report files */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t !!value && option === value}\n\t\t\t\t\t\t\tgetOptionLabel={(option) => option || ''}\n\t\t\t\t\t\t\trenderInput={(params) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tname='report_file_type'\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={initialValues?.report_file_type}\n\t\t\t\t\trules={{ required: isRoot && hasFilledValues }}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Report type */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t !!value.value && option.value === value?.value}\n\t\t\t\t\t\t\tgetOptionLabel={(option) => option.title || ''}\n\t\t\t\t\t\t\trenderInput={(params) => {\n\t\t\t\t\t\t\t\treturn ;\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tsetoverweightCutoffDate('');\n\t\t\t\t\t\t\t\tsetValue && setValue('overweight_schema', '');\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tname='overweight_name'\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={{\n\t\t\t\t\t\ttitle: initialValues\n\t\t\t\t\t\t\t? initialValues?.name === ReportName.OVERWEIGHTS\n\t\t\t\t\t\t\t\t? 'Sobrepeso Plataforma'\n\t\t\t\t\t\t\t\t: 'Sobrepeso Proveedor'\n\t\t\t\t\t\t\t: 'Sobrepeso Plataforma',\n\t\t\t\t\t\tvalue: initialValues?.name ?? ReportName.OVERWEIGHTS\n\t\t\t\t\t}}\n\t\t\t\t\trules={isRoot && hasFilledValues ? { required: true } : { required: false }}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Cutoff day schema */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t capitalize(option.title) || ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option.title === value?.title}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\tsetoverweightCutoffDate(data?.title);\n\t\t\t\t\t\t\t\tif (!setValue) return;\n\t\t\t\t\t\t\t\tsetValue('overweight_date', '');\n\t\t\t\t\t\t\t\tsetValue('overweight_subtype', '');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={initialValues?.schema ? { title: initialValues?.schema } : null}\n\t\t\t\t\trules={{ required: isRoot && hasFilledValues }}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Cutoff date */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t capitalize(option) || ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option === value}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={initialValues?.date}\n\t\t\t\t\trules={{\n\t\t\t\t\t\trequired:\n\t\t\t\t\t\t\tisRoot &&\n\t\t\t\t\t\t\thasFilledValues &&\n\t\t\t\t\t\t\toverweightCutoffDate !== SchemaType.IMMEDIATE &&\n\t\t\t\t\t\t\toverweightCutoffDate !== SchemaType.INDEPENDENT\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Subtype */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t item !== ReportSubType.BIWEEK && item !== ReportSubType.WEEK\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t!isRoot ||\n\t\t\t\t\t\t\t\toverweightCutoffDate !== SchemaType.MONTHLY ||\n\t\t\t\t\t\t\t\t(canNotEditCutData && hasSameFileSet)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tgetOptionLabel={(option) => capitalize(option) || ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option === value}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={initialValues?.sub_type}\n\t\t\t\t\trules={{\n\t\t\t\t\t\trequired: isRoot && hasFilledValues && overweightCutoffDate === SchemaType.MONTHLY\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Reports number of files */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t option.title || ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option.title === value?.title}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={initialValues?.conditions ? { title: initialValues?.conditions } : null}\n\t\t\t\t\trules={{ required: isRoot && hasFilledValues && !hasSameFileSet }}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Billing */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t option.title || ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option.title === value?.title}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\tinitialValues?.pre_invoice_days ? { title: initialValues?.pre_invoice_days } : null\n\t\t\t\t\t}\n\t\t\t\t\trules={{ required: isRoot && hasFilledValues && !hasSameFileSet }}\n\t\t\t\t/>\n\t\t\t\n\t\t\n\t);\n};\n\nexport default OverweightRow;\n","import { useEffect, useMemo } from 'react';\n//Libraries\nimport { Grid, Typography, TextField } from '@mui/material';\nimport { Control, Controller, useWatch } from 'react-hook-form';\nimport { Autocomplete } from '@material-ui/lab';\nimport { shallow } from 'zustand/shallow';\n//Styles\nimport { useStyles } from './useReporTable.styles';\n//Store\nimport useReportStore from '~store/ReportStore';\n//Hooks\nimport usePermissions from '~hooks/usePermissions';\nimport useOptions from './hooks/useOptions';\nimport { subtypeOptions, cutOptions, reviewOptions, billingOptions } from './options';\nimport capitalize from '~util/capitalize';\nimport { FieldErrors } from 'react-hook-form';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\nimport {\n\tReportFileType,\n\tReportItem,\n\tReportNumber,\n\tReportSubType,\n\tReportType,\n\tSchemaType\n} from '~store/actions/ActionTypes';\n\ninterface Props {\n\tcontrol: Control;\n\tinitialValues?: ReportItem;\n\terrors: FieldErrors;\n\tsetValue?: (key: string, value: string) => void;\n}\n\nconst InsuranceRow = ({ control, initialValues, errors, setValue }: Props) => {\n\tconst classes = useStyles();\n\n\tconst { isRoot } = usePermissions();\n\tconst {\n\t\tdateOptions,\n\t\thandleDateOptions,\n\t\thandleSubtypes,\n\t\thandleReportNumber,\n\t\treportNunberOptions\n\t} = useOptions({ setValue });\n\n\tconst [\n\t\toverweigthReportNumber,\n\t\tsetInsuranceReportNumber,\n\t\tinsuranceCutoffDate,\n\t\tsetInsirancetCutoffDate,\n\t\tguidesCutoffDate,\n\t\toverweightCutoffDate,\n\t\tinsuranceReportNumber\n\t] = useReportStore(\n\t\t(state) => [\n\t\t\tstate.overweigthReportNumber,\n\t\t\tstate.setInsuranceReportNumber,\n\t\t\tstate.insuranceCutoffDate,\n\t\t\tstate.setInsirancetCutoffDate,\n\t\t\tstate.guidesCutoffDate,\n\t\t\tstate.overweightCutoffDate,\n\t\t\tstate.insuranceReportNumber\n\t\t],\n\t\tshallow\n\t);\n\n\tconst reportFileType = useWatch({\n\t\tcontrol,\n\t\tname: 'report_file_type'\n\t});\n\n\tconst guidesDate: string | undefined = useWatch({\n\t\tcontrol,\n\t\tname: 'guides_date'\n\t});\n\n\tconst hasSameFileSet = useMemo(\n\t\t() => reportFileType === ReportFileType.SAME_FILE,\n\t\t[reportFileType]\n\t);\n\n\tconst hasFilledValues = useMemo(\n\t\t() => !!insuranceCutoffDate || !!guidesCutoffDate || !!overweightCutoffDate,\n\t\t[insuranceCutoffDate, guidesCutoffDate, overweightCutoffDate]\n\t);\n\n\t// TODO: this condition?\n\tconst canNotEditCutData = useMemo(\n\t\t() => insuranceReportNumber === ReportNumber.ONE,\n\t\t[insuranceReportNumber]\n\t);\n\n\tuseEffect(() => {\n\t\thandleReportNumber(overweigthReportNumber!);\n\t}, [handleReportNumber, overweigthReportNumber]);\n\n\tuseEffect(() => {\n\t\tinitialValues &&\n\t\t\thandleSubtypes(\n\t\t\t\thasSameFileSet && canNotEditCutData ? guidesCutoffDate : insuranceCutoffDate,\n\t\t\t\t'insurance',\n\t\t\t\tinitialValues!\n\t\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [handleSubtypes, initialValues, insuranceCutoffDate, guidesCutoffDate, canNotEditCutData]);\n\n\tuseEffect(() => {\n\t\tsetInsirancetCutoffDate(initialValues?.schema || '');\n\t}, [initialValues?.schema, setInsirancetCutoffDate]);\n\n\tuseEffect(() => {\n\t\thandleDateOptions(insuranceCutoffDate);\n\t}, [handleDateOptions, insuranceCutoffDate]);\n\n\tuseEffect(() => {\n\t\tif (initialValues?.type === ReportType.ONLY_LABELS) {\n\t\t\tsetInsuranceReportNumber(ReportNumber.THREE);\n\t\t} else if (\n\t\t\tinitialValues?.type === ReportType.LABELS_AND_OVERWEIGHTS ||\n\t\t\tinitialValues?.type === ReportType.OVERWEIGHTS_AND_INSURANCES\n\t\t) {\n\t\t\tsetInsuranceReportNumber(ReportNumber.TWO);\n\t\t} else {\n\t\t\tsetInsuranceReportNumber(ReportNumber.ONE);\n\t\t}\n\t}, [initialValues?.type, setInsuranceReportNumber]);\n\n\tuseEffect(() => {\n\t\tif (hasSameFileSet && guidesDate && canNotEditCutData) {\n\t\t\tsetValue && setValue('insurance_date', guidesDate);\n\t\t}\n\t}, [guidesDate, hasSameFileSet, initialValues, setValue, canNotEditCutData]);\n\n\tuseEffect(() => {\n\t\tif (initialValues) {\n\t\t\tsetValue && setValue('insurance_date', initialValues?.date ?? '');\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\treturn (\n\t\t\n\t\t\t{/* Num. Rep. */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t option.num ?? ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => !!value?.num && option.num === value?.num}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\tsetInsuranceReportNumber(data?.num);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tname='insurance_reportNumber'\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\tinitialValues?.type === ReportType.ALL ||\n\t\t\t\t\t\tinitialValues?.type === ReportType.LABELS_AND_INSURANCES\n\t\t\t\t\t\t\t? { num: '1' }\n\t\t\t\t\t\t\t: initialValues?.type === ReportType.LABELS_AND_OVERWEIGHTS ||\n\t\t\t\t\t\t\t initialValues?.type === ReportType.OVERWEIGHTS_AND_INSURANCES\n\t\t\t\t\t\t\t? { num: '2' }\n\t\t\t\t\t\t\t: initialValues?.type === ReportType.ONLY_INSURANCES\n\t\t\t\t\t\t\t? { num: '3' }\n\t\t\t\t\t\t\t: null\n\t\t\t\t\t}\n\t\t\t\t\trules={isRoot && hasFilledValues ? { required: true } : { required: false }}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Reports number of files */}\n\t\t\t\n\n\t\t\t{/* Report Type */}\n\t\t\t\n\t\t\t\tSeguro\n\t\t\t\n\n\t\t\t{/* Cutoff day schema*/}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t capitalize(option.title) ?? ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => !!value?.title && option.title === value?.title}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t\tsetInsirancetCutoffDate(data?.title);\n\t\t\t\t\t\t\t\tif (!setValue) return;\n\t\t\t\t\t\t\t\tsetValue('insurance_date', '');\n\t\t\t\t\t\t\t\tsetValue('insurance_subtype', '');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={initialValues?.schema ? { title: initialValues?.schema } : null}\n\t\t\t\t\trules={{ required: isRoot && hasFilledValues }}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Cutoff date */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t capitalize(option) || ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option === value}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={initialValues?.date}\n\t\t\t\t\trules={{\n\t\t\t\t\t\trequired:\n\t\t\t\t\t\t\tisRoot &&\n\t\t\t\t\t\t\thasFilledValues &&\n\t\t\t\t\t\t\tinsuranceCutoffDate !== SchemaType.IMMEDIATE &&\n\t\t\t\t\t\t\tinsuranceCutoffDate !== SchemaType.INDEPENDENT\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Subtype */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t item !== ReportSubType.BIWEEK && item !== ReportSubType.WEEK\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t!isRoot ||\n\t\t\t\t\t\t\t\tinsuranceCutoffDate !== SchemaType.MONTHLY ||\n\t\t\t\t\t\t\t\t(canNotEditCutData && hasSameFileSet)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tgetOptionLabel={(option) => capitalize(option) ?? ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option === value}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={initialValues?.sub_type}\n\t\t\t\t\trules={{\n\t\t\t\t\t\trequired: isRoot && hasFilledValues && insuranceCutoffDate === SchemaType.MONTHLY\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Review days */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t option.title || ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => {\n\t\t\t\t\t\t\t\treturn option.title === value?.title;\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={initialValues?.conditions ? { title: initialValues?.conditions } : null}\n\t\t\t\t\trules={{ required: isRoot && hasFilledValues && !hasSameFileSet }}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Billing */}\n\t\t\t\n\t\t\t\t (\n\t\t\t\t\t\t option.title ?? ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => !!value?.title && option.title === value?.title}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tonChange(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\tinitialValues?.pre_invoice_days ? { title: initialValues?.pre_invoice_days } : null\n\t\t\t\t\t}\n\t\t\t\t\trules={{ required: isRoot && hasFilledValues && !hasSameFileSet }}\n\t\t\t\t/>\n\t\t\t\n\t\t\n\t);\n};\n\nexport default InsuranceRow;\n","//Libraries\nimport { Grid } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\nimport { Control, FieldErrors } from 'react-hook-form';\nimport clsx from 'clsx';\n//Hooks\nimport { useCardStyles } from '~hooks/useStyles';\n//Components\nimport ColumnsReportsConfig from './ReportTableConfig/ColumnsReportConfig';\nimport GuidesRow from './ReportTableConfig/GuidesRow';\nimport OverweightRow from './ReportTableConfig/OverweightRow';\nimport InsuranceRow from './ReportTableConfig/InsuranceRow';\nimport { HeadingOne } from '~components/Headings';\nimport { ReportItem, ReportName } from '~store/actions/ActionTypes';\n\nconst useStyles = makeStyles((theme) => ({\n\troot: {\n\t\tpadding: theme.spacing(3),\n\t\tmarginTop: theme.spacing(4),\n\t\twidth: '100%'\n\t},\n\ttableContainer: {\n\t\tborder: '1px solid #515151',\n\t\tborderRadius: '8px',\n\t\tpadding: '20px'\n\t}\n}));\ninterface Props {\n\tcontrol: Control;\n\tinitialValues?: ReportItem[];\n\terrors: FieldErrors;\n\tsetValue?: (key: string, value: unknown) => void;\n}\n\nconst ClientReportsConfig: React.FC = ({ control, initialValues, errors, setValue }) => {\n\tconst classes = useStyles();\n\tconst { cardClasses } = useCardStyles();\n\n\treturn (\n\t\t
\n\t\t\t\n\n\t\t\t\n\t\t\t\t{/* Columns top table */}\n\t\t\t\t\n\t\t\t\t
\n\n\t\t\t\t{/* Rows */}\n\t\t\t\t<>\n\t\t\t\t\t{/* Guides config */}\n\t\t\t\t\t item.name === ReportName.LABELS)\n\t\t\t\t\t\t}\n\t\t\t\t\t\terrors={errors}\n\t\t\t\t\t\tsetValue={setValue}\n\t\t\t\t\t/>\n\t\t\t\t\t
\n\n\t\t\t\t\t{/* Sobrepesos */}\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\titem.name === ReportName.OVERWEIGHTS ||\n\t\t\t\t\t\t\t\t\titem.name === ReportName.OVERWEIGHTS_SUPPLIER\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\terrors={errors}\n\t\t\t\t\t\tsetValue={setValue}\n\t\t\t\t\t/>\n\t\t\t\t\t
\n\n\t\t\t\t\t{/* Seguros */}\n\t\t\t\t\t item.name === ReportName.INSURANCES)\n\t\t\t\t\t\t}\n\t\t\t\t\t\terrors={errors}\n\t\t\t\t\t\tsetValue={setValue}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t
\n\t);\n};\n\nexport default ClientReportsConfig;\n","import { FC, useEffect, useState, useRef } from 'react';\nimport { useLocation, useHistory, useParams } from 'react-router-dom';\nimport clsx from 'clsx';\nimport { ArrowLeft } from 'react-feather';\nimport { shallow } from 'zustand/shallow';\nimport { Grid } from '@mui/material';\nimport Skeleton from '@material-ui/lab/Skeleton';\nimport { useForm, useWatch } from 'react-hook-form';\nimport {\n\tReportItem,\n\tReportName,\n\tReportType,\n\tSchemaType,\n\tReportSubType,\n\tReportFileType,\n\tReportNumber\n} from '~store/actions/ActionTypes';\n// Store and context\nimport useReportStore from '~store/ReportStore';\n// Hooks\nimport useCustomerForm, { CustomerFormValues } from './useCustomerForm';\nimport { useCardStyles } from '~hooks/useStyles';\nimport useStyles from './style';\nimport usePermissions from '~hooks/usePermissions';\nimport { useSelector } from '~store/store';\nimport useQuery from '~hooks/useQuery';\n// Components\nimport ClientForm from '~components/Forms/Client/ClientForm';\nimport ClientFiscalForm from '~components/Forms/Client/ClientFiscalForm';\nimport ServicesSelector from '~components/Forms/ServicesSelector';\nimport ControlBar from '~components/Bar/ControlBar';\nimport CreateOrUpdateClientControl from './CreateOrUpdateClientControl';\nimport { HeadingOne } from '~components/Headings';\nimport ClientReportsConfig from '~components/Forms/Client/ClientReports/ClientReportsConfig';\nimport ConfirmActionDialog from '~components/Modals/ConfirmActionDialog';\n\nconst CreateOrUpdateCustomer: FC = () => {\n\tconst classes = useStyles();\n\tconst { cardClasses } = useCardStyles();\n\tconst history = useHistory();\n\tconst location: { state: { fromCreateDispersion?: boolean } } = useLocation();\n\tconst { id } = useParams<{ id?: string }>();\n\tconst query = useQuery();\n\n\tconst [oldEmail, setOldEmail] = useState(null);\n\tconst [oldBussinesName, setBusinessName] = useState(null);\n\tconst [guidesType, setGuidesType] = useState('');\n\tconst [overweighType, setOverweightType] = useState('');\n\tconst [insuranceType, setInsuranceType] = useState('');\n\tconst [isOpenDialog, setIsOpenDialog] = useState(false);\n\tconst [formPayload, setFormPayload] = useState | null>(null);\n\n\tconst [guidesRowOfReport, setGuidesRowOfReport] = useState();\n\tconst [overweightRowOdReport, setOverweightRwOfReport] = useState();\n\tconst [insuranceRowOfReport, setInsuranceRowOfReport] = useState();\n\n\tconst reportsRef = useRef(null);\n\tconst servicessRef = useRef(null);\n\n\tconst { servicesInfoDraftCUCustomer } = useSelector((state) => state.cuCustomer, shallow);\n\n\tconst {\n\t\tsave,\n\t\tloading,\n\t\tediting,\n\t\tposting,\n\t\tcustomer,\n\t\tresponseError,\n\t\tgetPayloadServices,\n\t\tformatPayload,\n\t\tsaveRates,\n\t\tgetNewServices\n\t} = useCustomerForm(location?.state?.fromCreateDispersion);\n\n\tconst { isRoot, isCustomer } = usePermissions();\n\n\tconst [\n\t\toverweigthReportNumber,\n\t\tinsuranceReportNumber,\n\t\tguidesCutoffDate,\n\t\toverweightCutoffDate,\n\t\tinsuranceCutoffDate,\n\t\tsetInsirancetCutoffDate,\n\t\tsetoverweightCutoffDate\n\t] = useReportStore(\n\t\t(state) => [\n\t\t\tstate.overweigthReportNumber,\n\t\t\tstate.insuranceReportNumber,\n\t\t\tstate.guidesCutoffDate,\n\t\t\tstate.overweightCutoffDate,\n\t\t\tstate.insuranceCutoffDate,\n\t\t\tstate.setInsirancetCutoffDate,\n\t\t\tstate.setoverweightCutoffDate\n\t\t],\n\t\tshallow\n\t);\n\n\t//Saving the status that the client has in the db\n\tconst [status, setStatus] = useState(customer?.status);\n\t//Control to know if the client has been blocked\n\tconst [blocked, setBlocked] = useState(false);\n\n\tuseEffect(() => {\n\t\tcustomer?.status && setStatus(customer.status);\n\t\tsetBlocked(customer?.status === 'LOCKED');\n\t}, [customer?.status]);\n\n\t/** Setting the type of report that is sent */\n\tuseEffect(() => {\n\t\tif (overweigthReportNumber === '2' && insuranceReportNumber === '3') {\n\t\t\tsetGuidesType(ReportType.ONLY_LABELS);\n\t\t\tsetOverweightType(ReportType.ONLY_OVERWEIGHTS);\n\t\t\tsetInsuranceType(ReportType.ONLY_INSURANCES);\n\t\t} else if (overweigthReportNumber === '1' && insuranceReportNumber === '1') {\n\t\t\tsetGuidesType(ReportType.ALL);\n\t\t\tsetOverweightType(ReportType.ALL);\n\t\t\tsetInsuranceType(ReportType.ALL);\n\t\t} else if (overweigthReportNumber === '1' && insuranceReportNumber === '2') {\n\t\t\tsetGuidesType(ReportType.LABELS_AND_OVERWEIGHTS);\n\t\t\tsetOverweightType(ReportType.LABELS_AND_OVERWEIGHTS);\n\t\t\tsetInsuranceType(ReportType.ONLY_INSURANCES);\n\t\t} else if (overweigthReportNumber === '2' && insuranceReportNumber === '2') {\n\t\t\tsetGuidesType(ReportType.ONLY_LABELS);\n\t\t\tsetOverweightType(ReportType.OVERWEIGHTS_AND_INSURANCES);\n\t\t\tsetInsuranceType(ReportType.OVERWEIGHTS_AND_INSURANCES);\n\t\t} else {\n\t\t\tsetGuidesType('guías y seguros');\n\t\t\tsetOverweightType('solo sobrepesos');\n\t\t\tsetInsuranceType('guías y seguros');\n\t\t}\n\t}, [overweigthReportNumber, insuranceReportNumber]);\n\n\tconst {\n\t\thandleSubmit,\n\t\tcontrol,\n\t\tregister,\n\t\tclearErrors,\n\t\ttrigger,\n\t\tsetValue,\n\t\terrors,\n\t\twatch,\n\t\tsetError\n\t} = useForm({ mode: 'onTouched' });\n\n\tconst {\n\t\t// General\n\t\tname,\n\t\tlast_name,\n\t\temail,\n\t\tphone_number,\n\t\tbusiness_name,\n\t\t// enterprise_operations,\n\t\tcompany_type,\n\t\tbusiness_type,\n\n\t\t// Fiscal info\n\t\tmodality,\n\t\tconditions,\n\t\tseller,\n\n\t\t//Reports\n\t\tguides_schema,\n\t\tguides_subtype,\n\t\tguides_date,\n\t\tguides_conditions_report,\n\t\tguides_pre_invoice_days,\n\n\t\t// overweight_schema,\n\t\toverweight_subtype,\n\t\toverweight_date,\n\t\toverweight_conditions_report,\n\t\toverweight_pre_invoice_days,\n\t\toverweight_name,\n\n\t\t// insurance_schema,\n\t\tinsurance_subtype,\n\t\tinsurance_date,\n\t\tinsurance_conditions_report,\n\t\tinsurance_pre_invoice_days\n\t} = watch();\n\n\tconst reportFileType = useWatch({\n\t\tcontrol,\n\t\tname: 'report_file_type'\n\t});\n\n\t//Saving default and changed values for the reports\n\tuseEffect(() => {\n\t\t// Guides\n\t\tconst guidesSubtype =\n\t\t\tguidesCutoffDate === SchemaType.BIWEEKLY\n\t\t\t\t? ReportSubType.BIWEEK\n\t\t\t\t: guidesCutoffDate === SchemaType.WEEKLY\n\t\t\t\t? ReportSubType.WEEK\n\t\t\t\t: guidesCutoffDate === SchemaType.IMMEDIATE || guidesCutoffDate === SchemaType.INDEPENDENT\n\t\t\t\t? ''\n\t\t\t\t: guides_subtype;\n\t\tconst guidesDate =\n\t\t\tguidesCutoffDate === SchemaType.IMMEDIATE || guidesCutoffDate === SchemaType.INDEPENDENT\n\t\t\t\t? ''\n\t\t\t\t: guides_date;\n\t\tconst guidesCondition =\n\t\t\ttypeof guides_conditions_report === 'object'\n\t\t\t\t? guides_conditions_report?.title\n\t\t\t\t: guides_conditions_report;\n\t\tconst guidesPreinvoice =\n\t\t\ttypeof guides_pre_invoice_days === 'object'\n\t\t\t\t? guides_pre_invoice_days?.title\n\t\t\t\t: guides_pre_invoice_days;\n\n\t\tsetGuidesRowOfReport({\n\t\t\tname: ReportName.LABELS,\n\t\t\ttype: guidesType,\n\t\t\tsub_type: guidesSubtype?.toLowerCase(),\n\t\t\tschema: guidesCutoffDate?.toLowerCase(),\n\t\t\tdate: guidesDate?.toLowerCase(),\n\t\t\tconditions: guidesCondition,\n\t\t\tpre_invoice_days: guidesPreinvoice\n\t\t});\n\n\t\t// Overweight\n\t\tconst overweightSubtype =\n\t\t\toverweightCutoffDate === SchemaType.BIWEEKLY\n\t\t\t\t? ReportSubType.BIWEEK\n\t\t\t\t: overweightCutoffDate === SchemaType.WEEKLY\n\t\t\t\t? ReportSubType.WEEK\n\t\t\t\t: overweightCutoffDate === SchemaType.IMMEDIATE ||\n\t\t\t\t overweightCutoffDate === SchemaType.INDEPENDENT\n\t\t\t\t? ''\n\t\t\t\t: overweight_subtype;\n\t\tconst overweightDate =\n\t\t\toverweightCutoffDate === SchemaType.IMMEDIATE ||\n\t\t\toverweightCutoffDate === SchemaType.INDEPENDENT\n\t\t\t\t? ''\n\t\t\t\t: overweight_date;\n\t\tconst overweightConditions =\n\t\t\ttypeof overweight_conditions_report === 'object'\n\t\t\t\t? overweight_conditions_report?.title\n\t\t\t\t: overweight_conditions_report;\n\t\tconst overweightPreinvoice =\n\t\t\ttypeof overweight_pre_invoice_days === 'object'\n\t\t\t\t? overweight_pre_invoice_days?.title\n\t\t\t\t: overweight_pre_invoice_days;\n\n\t\tsetOverweightRwOfReport({\n\t\t\tname: overweight_name?.value ?? ReportName.OVERWEIGHTS,\n\t\t\ttype: overweighType,\n\t\t\tsub_type: overweightSubtype?.toLowerCase(),\n\t\t\tschema: overweightCutoffDate?.toLowerCase(),\n\t\t\tdate: overweightDate?.toLowerCase(),\n\t\t\tconditions: overweightConditions,\n\t\t\tpre_invoice_days: overweightPreinvoice\n\t\t});\n\n\t\t// Insurance\n\t\tconst insuranceSubtype =\n\t\t\tinsuranceCutoffDate === SchemaType.BIWEEKLY\n\t\t\t\t? ReportSubType.BIWEEK\n\t\t\t\t: insuranceCutoffDate === SchemaType.WEEKLY\n\t\t\t\t? ReportSubType.WEEK\n\t\t\t\t: insuranceCutoffDate === SchemaType.IMMEDIATE ||\n\t\t\t\t insuranceCutoffDate === SchemaType.INDEPENDENT\n\t\t\t\t? ''\n\t\t\t\t: insurance_subtype;\n\t\tconst insuranceDate =\n\t\t\tinsuranceCutoffDate === SchemaType.IMMEDIATE || insuranceCutoffDate === SchemaType.INDEPENDENT\n\t\t\t\t? ''\n\t\t\t\t: insurance_date;\n\t\tconst insuranceCondition =\n\t\t\ttypeof insurance_conditions_report === 'object'\n\t\t\t\t? insurance_conditions_report?.title\n\t\t\t\t: insurance_conditions_report;\n\t\tconst insurancePreinvoice =\n\t\t\ttypeof insurance_pre_invoice_days === 'object'\n\t\t\t\t? insurance_pre_invoice_days?.title\n\t\t\t\t: insurance_pre_invoice_days;\n\t\tsetInsuranceRowOfReport({\n\t\t\tname: ReportName.INSURANCES,\n\t\t\ttype: insuranceType,\n\t\t\tsub_type: insuranceSubtype?.toLowerCase(),\n\t\t\tschema: insuranceCutoffDate?.toLowerCase(),\n\t\t\tdate: insuranceDate?.toLowerCase(),\n\t\t\tconditions: insuranceCondition,\n\t\t\tpre_invoice_days: insurancePreinvoice\n\t\t});\n\t}, [\n\t\tguidesCutoffDate,\n\t\toverweightCutoffDate,\n\t\tinsuranceCutoffDate,\n\t\tguidesType,\n\t\toverweighType,\n\t\tinsuranceType,\n\t\tcustomer?.reports,\n\t\tguides_subtype,\n\t\tguides_date,\n\t\tguides_conditions_report,\n\t\tguides_pre_invoice_days,\n\t\toverweight_subtype,\n\t\toverweight_date,\n\t\toverweight_conditions_report,\n\t\toverweight_pre_invoice_days,\n\t\tinsurance_subtype,\n\t\tinsurance_date,\n\t\tinsurance_conditions_report,\n\t\tinsurance_pre_invoice_days,\n\t\toverweight_name\n\t]);\n\n\tuseEffect(() => {\n\t\tconst sameFileConfig = reportFileType === ReportFileType.SAME_FILE;\n\t\tconst setGuidesCutConfig = (\n\t\t\ttype: 'overweight' | 'insurance',\n\t\t\tsetCutoffDate: (cuttofDate: string) => void\n\t\t) => {\n\t\t\tsetCutoffDate(guidesCutoffDate?.toLowerCase());\n\t\t\tsetValue(`${type}_schema`, guides_schema);\n\t\t\tsetValue(`${type}_subtype`, guides_subtype);\n\t\t\tsetValue(`${type}_date`, guides_date);\n\t\t};\n\n\t\tif (sameFileConfig) {\n\t\t\tif (\n\t\t\t\toverweight_name?.value === ReportName.OVERWEIGHTS &&\n\t\t\t\toverweigthReportNumber === ReportNumber.ONE\n\t\t\t) {\n\t\t\t\tsetGuidesCutConfig('overweight', setoverweightCutoffDate);\n\t\t\t}\n\t\t\tsetValue('overweight_conditions_report', guides_conditions_report);\n\t\t\tsetValue('overweight_pre_invoice_days', guides_pre_invoice_days);\n\n\t\t\tif (insuranceReportNumber === ReportNumber.ONE) {\n\t\t\t\tsetGuidesCutConfig('insurance', setInsirancetCutoffDate);\n\t\t\t}\n\t\t\tsetValue('insurance_conditions_report', guides_conditions_report);\n\t\t\tsetValue('insurance_pre_invoice_days', guides_pre_invoice_days);\n\t\t}\n\t}, [\n\t\tguidesCutoffDate,\n\t\toverweightCutoffDate,\n\t\tinsuranceCutoffDate,\n\t\tguides_subtype,\n\t\tguides_date,\n\t\tguides_conditions_report,\n\t\tguides_pre_invoice_days,\n\t\treportFileType,\n\t\tguides_schema,\n\t\toverweigthReportNumber,\n\t\tinsuranceReportNumber,\n\t\tsetInsirancetCutoffDate,\n\t\tsetoverweightCutoffDate,\n\t\tsetValue,\n\t\toverweight_name\n\t]);\n\n\tconst handleStatus = () => {\n\t\tsetBlocked((prev) => !prev);\n\t\tif (blocked) {\n\t\t\tsetStatus('ACTIVE');\n\t\t} else {\n\t\t\tsetStatus('LOCKED');\n\t\t}\n\t};\n\n\t// Handle Submit\n\tconst onSubmit = async (data: CustomerFormValues) => {\n\t\t// Discount field alert for services other than estafeta\n\t\t// if (\n\t\t// \tservicesInfoDraftCUCustomer\n\t\t// \t\t.filter((item) => item.discount === 0)\n\t\t// \t\t.some((item) => item.carrier !== 'Estafeta')\n\t\t// ) {\n\t\t// \tsetNotification({\n\t\t// \t\tmessage: 'Algunos servicios no tienen aumento definido.',\n\t\t// \t\tseverity: 'warning'\n\t\t// \t});\n\t\t// \treturn;\n\t\t// }\n\n\t\tsetOldEmail(data.email);\n\t\tsetBusinessName(data.business_name);\n\n\t\tconst payload = formatPayload({\n\t\t\tdata,\n\t\t\tguidesRowOfReport,\n\t\t\toverweightRowOdReport,\n\t\t\tinsuranceRowOfReport,\n\t\t\tstatus\n\t\t});\n\n\t\t// Confirm or not new services for all users\n\t\tconst newServices = getNewServices();\n\t\tif (!!newServices?.length) {\n\t\t\tsetFormPayload(payload);\n\t\t\tsetIsOpenDialog(true);\n\t\t\t// if (location?.state?.fromCreateDispersion) {\n\t\t\t// \tconst service = newServices[0];\n\t\t\t// \tif (!service) return;\n\t\t\t// \tsetSelectedCarrier(service.carrier);\n\t\t\t// \tsetService(service?.name);\n\t\t\t// }\n\t\t\treturn;\n\t\t}\n\n\t\tconst { success, customerId } = await save(payload);\n\t\tif (!success) {\n\t\t\tawait trigger('email');\n\t\t\tawait trigger('business_name');\n\n\t\t\t// Save rate if it's a new customer or if there is new services from estafeta\n\t\t\tconst newEstafetaServices = getNewServices(true);\n\t\t\tif (!id || !!newEstafetaServices?.length) {\n\t\t\t\tawait saveRates(customerId);\n\t\t\t}\n\t\t}\n\t};\n\n\t// Trigger error if resource exists\n\t// this is if the email or the bussiness name already exists\n\tuseEffect(() => {\n\t\tif (responseError) {\n\t\t\ttrigger(['email', 'business_name']);\n\t\t}\n\t}, [responseError, trigger]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\terrors.guides_date ||\n\t\t\terrors.guides_conditions_report ||\n\t\t\terrors.guides_schema ||\n\t\t\terrors.guides_subtype ||\n\t\t\terrors.guides_pre_invoice_days ||\n\t\t\terrors.insurance_conditions_report ||\n\t\t\terrors.insurance_date ||\n\t\t\terrors.insurance_pre_invoice_days ||\n\t\t\terrors.insurance_subtype ||\n\t\t\terrors.overweight_date ||\n\t\t\terrors.overweight_conditions_report ||\n\t\t\terrors.overweight_pre_invoice_days ||\n\t\t\terrors.overweight_subtype\n\t\t) {\n\t\t\treportsRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t\t}\n\t}, [errors]);\n\n\t// Scroll to services if is commig from add service in create dispersion\n\tuseEffect(() => {\n\t\tif (location?.state?.fromCreateDispersion) {\n\t\t\tservicessRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t\t}\n\t}, [location?.state]);\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tconst fromDispersionQuery = query.get('from') === 'dispersion';\n\t\t\t\t\t\t\tif (!location?.state?.fromCreateDispersion && !fromDispersionQuery) {\n\t\t\t\t\t\t\t\thistory.push('/clientes');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thistory.push('/comprar-guias');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t{/* Datos generales */}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t{/* Servicios */}\n\t\t\t\t\t (servicessRef.current = instance)}>\n\t\t\t\t\t\t clearErrors('services')}\n\t\t\t\t\t\t\tdefaultValues={servicesInfoDraftCUCustomer as any}\n\t\t\t\t\t\t\teditable\n\t\t\t\t\t\t\tcustomer={customer}\n\t\t\t\t\t\t\tfromDispersion={location?.state?.fromCreateDispersion}\n\t\t\t\t\t\t\t// onCreateRateFromDispersion={handleSubmit(onSubmit)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\n\t\t\t\t\t{/* Facturacion */}\n\t\t\t\t\t\n\t\t\t\t\t\t clearErrors('schema')}\n\t\t\t\t\t\t\tinitialValues={customer}\n\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\terrors={errors}\n\t\t\t\t\t\t\tsetValue={setValue}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\n\t\t\t\t\t{/* Reportes */}\n\t\t\t\t\t (reportsRef.current = instance)}>\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\n\t\t\t\n\t\t\t\t 0}\n\t\t\t\t/>\n\t\t\t\n\t\t\t setIsOpenDialog(false)}\n\t\t\t\tbodyText={'¿Deseas agregar los nuevos servicios a todos los usuarios?'}\n\t\t\t\thandleClickConfirm={async () => {\n\t\t\t\t\tsetIsOpenDialog(false);\n\t\t\t\t\tconst payload = location?.state?.fromCreateDispersion\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t...formPayload,\n\t\t\t\t\t\t\t\tservices: getPayloadServices()\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: formPayload;\n\t\t\t\t\tconst { success, customerId } = await save({ ...payload, add_services_to_users: true });\n\t\t\t\t\t// Save rate if it's a new customer or if there is new services from estafeta\n\t\t\t\t\tconst newEstafetaServices = getNewServices(true);\n\t\t\t\t\tif (success && (!id || !!newEstafetaServices?.length)) {\n\t\t\t\t\t\tawait saveRates(customerId);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\thandleClickCancel={async () => {\n\t\t\t\t\tsetIsOpenDialog(false);\n\t\t\t\t\tconst payload = location?.state?.fromCreateDispersion\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t...formPayload,\n\t\t\t\t\t\t\t\tservices: getPayloadServices()\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: formPayload;\n\t\t\t\t\tconst { success, customerId } = await save({ ...payload, add_services_to_users: false });\n\t\t\t\t\t// Save rate if it's a new customer or if there is new services from estafeta\n\t\t\t\t\tconst newEstafetaServices = getNewServices(true);\n\t\t\t\t\tif (success && (!id || !!newEstafetaServices?.length)) {\n\t\t\t\t\t\tawait saveRates(customerId);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\tconfirmBtnLabel={'Sí'}\n\t\t\t\tcancelBtnLabel={'No'}\n\t\t\t/>\n\t\t\n\t);\n};\n\nexport default CreateOrUpdateCustomer;\n","import { FC } from 'react';\nimport { BottomNavigation, BottomNavigationAction } from '@mui/material';\nimport clsx from 'clsx';\nimport { useStyles } from '~components/Tabs/useStyles';\n\ninterface Props {\n\tcurrentTab: number;\n\thandleChange: (tab: number) => void;\n\ttabs: { name: string; path: string }[];\n}\n\nconst CustomerTabs: FC = (props) => {\n\tconst classes = useStyles();\n\n\treturn (\n\t\t {\n\t\t\t\tprops.handleChange(newValue);\n\t\t\t}}\n\t\t\tshowLabels\n\t\t\tclassName={classes.root}\n\t\t>\n\t\t\t{props.tabs.map((tab, index) => (\n\t\t\t\t\n\t\t\t))}\n\t\t\n\t);\n};\n\nexport default CustomerTabs;\n","import { FC } from 'react';\nimport { Grid } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\nimport { User, CheckCircle } from 'react-feather';\n\nconst useStyles = makeStyles(() => ({\n\tfont: {\n\t\tfontWeight: 'bold',\n\t\tfontSize: 15\n\t}\n}));\n\ninterface Props {\n\tgeneralInfo: boolean;\n}\n\nconst CreateOrUpdateClientControl: FC = ({ generalInfo }) => {\n\tconst classes = useStyles();\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t{generalInfo ? : }\n\t\t\t\t  Generales\n\t\t\t\n\t\t\n\t);\n};\n\nexport default CreateOrUpdateClientControl;\n","import React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport { ArrowLeft } from 'react-feather';\nimport { CircularProgress, Grid } from '@mui/material';\nimport Skeleton from '@material-ui/lab/Skeleton';\nimport { useHistory, useParams } from 'react-router';\nimport ClientForm from '~components/Forms/Client/ClientForm';\nimport { useForm } from 'react-hook-form';\nimport ControlBar from '~components/Bar/ControlBar';\nimport CreateOrUpdateProspectControl from './control';\nimport { useCardStyles } from '~hooks/useStyles';\nimport usePermissions from '~hooks/usePermissions';\nimport useProspects from '../ProspectsTable/useProspects';\nimport { ProspectRequestType, ProspectValidationStatus } from '~store/actions/ActionTypes';\nimport { SellerResponse } from '~store/actions/ActionTypes';\nimport ServicesSelector from '~components/Forms/ServicesSelector';\nimport { useSelector } from 'react-redux';\nimport { RootStore } from '~store/store';\nimport { ServiceDataItem } from '../CreateOrUpdateCustomer/useCustomerForm';\nimport { makeStyles } from '@mui/styles';\nimport { BookletServiceForm } from '~store/actions/ActionTypes';\nimport { HeadingOne } from '~components/Headings';\nimport ClientFiscalForm from '~components/Forms/Client/ClientFiscalForm';\nimport ClientReportsConfig from '~components/Forms/Client/ClientReports/ClientReportsConfig';\n\nconst useStyles = makeStyles((theme) => ({\n\troot: {\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tpadding: `0 ${theme.spacing(3)} ${theme.spacing(3)} ${theme.spacing(3)}`,\n\t\twidth: '100%'\n\t},\n\tformContainer: {\n\t\tpadding: `0 0 ${theme.spacing(3)} 0px`,\n\t\twidth: '100%'\n\t},\n\ttitle: {\n\t\tpadding: `${theme.spacing(3)} 0 0 0 !important`,\n\t\tmarginLeft: '-24px'\n\t},\n\tleftArrow: {\n\t\tcolor: '#57BAD7',\n\t\tbackgroundColor: 'transparent',\n\t\tborder: 'none',\n\t\t'&:focus': {\n\t\t\toutline: 'none'\n\t\t},\n\t\t'&:hover': {\n\t\t\tcursor: 'pointer'\n\t\t}\n\t}\n}));\n\ntype FormValues = {\n\t// General Info\n\tname: string;\n\tlast_name: string;\n\temail: string;\n\tphone_number: string;\n\tbusiness_name: string;\n\tcompany_type: { title: string; value: string };\n\tenterprise_operations: { title: string; value: string };\n\tchannel: { title: string; value: string };\n\twebpage: string;\n\tseller: SellerResponse;\n\tvalidation_status: {\n\t\ttitle: 'Prospección' | 'Validado' | 'Documentación' | 'Registro';\n\t\tvalue: ProspectValidationStatus;\n\t};\n\tbusiness_type: string;\n};\n\nconst CreateOrUpdateProspect: React.FC = () => {\n\tconst classes = useStyles();\n\tconst { cardClasses } = useCardStyles();\n\tconst history = useHistory();\n\tconst params: { id?: string } = useParams();\n\tconst { isRoot } = usePermissions();\n\n\tconst { handleSubmit, control, errors, watch, register, clearErrors, setValue } =\n\t\tuseForm({\n\t\t\tmode: 'onTouched'\n\t\t});\n\tconst { getProspect, prospect, loading, saveProspect } = useProspects();\n\tconst reportsRef = useRef(null);\n\n\tconst { servicesInfoDraftCUCustomer } = useSelector((state: RootStore) => state.cuCustomer);\n\n\tuseEffect(() => {\n\t\tif (params.id) {\n\t\t\tgetProspect(params.id);\n\t\t}\n\t}, [params.id, getProspect]);\n\n\tconst {\n\t\tname,\n\t\tlast_name,\n\t\temail,\n\t\tphone_number,\n\t\tbusiness_name,\n\t\tenterprise_operations,\n\t\tcompany_type,\n\t\tvalidation_status\n\t} = watch();\n\n\t// Handle Submit\n\tconst onSubmit = async (data: FormValues) => {\n\t\tconst payload: { [key: string]: any } = {\n\t\t\tname: data.name.trim(),\n\t\t\tlast_name: data.last_name.trim(),\n\t\t\temail: data.email.trim(),\n\t\t\tphone_number: data.phone_number.trim(),\n\t\t\tbusiness_name: data.business_name.trim() || undefined,\n\t\t\tcompany_type: data.company_type.value || undefined,\n\t\t\tset_of_operations: data.enterprise_operations.value || undefined,\n\t\t\twebpage: data.webpage || undefined,\n\t\t\tvalidation_status: data.validation_status.value,\n\t\t\tchannel: data.channel.value || undefined,\n\t\t\tbusiness_type: data.business_type\n\t\t};\n\n\t\tif (isRoot) {\n\t\t\tpayload.seller_id = data.seller?.id;\n\t\t}\n\n\t\tpayload.services = servicesInfoDraftCUCustomer.map((s) => {\n\t\t\tconst payloadServices = {\n\t\t\t\tid: s.id,\n\t\t\t\tenabled: s.enabled,\n\t\t\t\tmin_stock: s.min_stock,\n\t\t\t\tprice_list: s.price_list,\n\t\t\t\tdiscount: s.discount\n\t\t\t} as ServiceDataItem;\n\t\t\tif (!!s.reissue_price) {\n\t\t\t\tpayloadServices.reissue_price = s.reissue_price;\n\t\t\t}\n\t\t\tif (!!s.irregular_delivery_price) {\n\t\t\t\tpayloadServices.irregular_delivery_price = s.irregular_delivery_price;\n\t\t\t}\n\t\t\tif (!!s.insurance_percentage) {\n\t\t\t\tpayloadServices.insurance_percentage = s.insurance_percentage;\n\t\t\t}\n\t\t\treturn payloadServices;\n\t\t});\n\n\t\tsaveProspect(payload as ProspectRequestType, params.id);\n\t};\n\n\tif (loading) {\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t{/* Datos generales */}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{/* Servicios */}\n\t\t\t\t\t\n\t\t\t\t\t\t{prospect?.services?.length && !servicesInfoDraftCUCustomer ? (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t clearErrors('services')}\n\t\t\t\t\t\t\t\tdefaultValues={servicesInfoDraftCUCustomer as BookletServiceForm[]}\n\t\t\t\t\t\t\t\teditable\n\t\t\t\t\t\t\t\tcustomer={prospect ?? undefined}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\n\n\t\t\t\t\t{/* Facturacion */}\n\t\t\t\t\t\n\t\t\t\t\t\t clearErrors('schema')}\n\t\t\t\t\t\t\tinitialValues={prospect}\n\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\terrors={errors}\n\t\t\t\t\t\t\tsetValue={setValue}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\n\t\t\t\t\t{/* Reportes */}\n\t\t\t\t\t (reportsRef.current = instance)}>\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
\n\t);\n};\n\nexport default CreateOrUpdateProspect;\n","import { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\n\nexport const useStyles = makeStyles((theme: Theme) => ({\n\t// General data tab\n\tdataContainer: {\n\t\t'& > div': {\n\t\t\tborderTopLeftRadius: 0,\n\t\t\tborderTopRightRadius: 0\n\t\t}\n\t},\n\t// Rates tab\n\tratesContainer: {\n\t\tpadding: '24px',\n\t\tborderTopLeftRadius: 0,\n\t\tborderTopRightRadius: 0\n\t\t//minHeight: '60vh'\n\t},\n\tsubsectionTitle: {\n\t\tpadding: '12px 0 !important'\n\t},\n\tspacing: {\n\t\tpaddingBottom: `${theme.spacing(3)} !important`\n\t},\n\tuploadBtn: {\n\t\tdisplay: 'flex',\n\t\talignItems: 'center',\n\t\tminWidth: '100px',\n\t\tpadding: '6px 14px',\n\t\tcolor: '#3f403f !important',\n\t\tbackgroundColor: '#E5E5E5',\n\t\toutline: '0px',\n\t\tborder: '0px',\n\t\tborderRadius: '8px',\n\t\tfontWeight: 500,\n\t\tfontSize: '0.875rem',\n\t\tfontFamily: 'Roboto',\n\t\tcursor: 'pointer',\n\t\t'&:disabled': {\n\t\t\tcolor: 'grey',\n\t\t\topacity: 0.9\n\t\t},\n\t\t'&:hover': {\n\t\t\tbackground: '#E5E5E5',\n\t\t\topacity: 0.9\n\t\t}\n\t}\n}));\n","import { useContext, useEffect, useState, useCallback, ChangeEvent, useMemo } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { useDispatch } from 'react-redux';\nimport {\n\tAccordion,\n\tAccordionSummary,\n\tButton,\n\tCircularProgress,\n\tGrid,\n\tTextField,\n\tTooltip\n} from '@mui/material';\nimport { Autocomplete } from '@material-ui/lab';\nimport { shallow } from 'zustand/shallow';\nimport axios from 'axios';\nimport AuthContext from '~context/AuthContext';\nimport DrawContext from '~context/DrawContext';\nimport { DataGrid, GridCellParams } from '@mui/x-data-grid';\nimport { FileText, Plus } from 'react-feather';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\n// Hooks and store\nimport { useCardStyles } from '~hooks/useStyles';\nimport useRateStore from '~store/useRateStore';\nimport { setServicesCUCustomer } from '~store/actions/agents';\nimport usePermissions from '~hooks/usePermissions';\nimport { useStyles } from './styles';\n// Components\nimport { HeadingOne, HeadingTwo } from '~components/Headings';\nimport DropdownPaper from '~components/Forms/DropdownPaper';\n// Utils\nimport capitalize from '~util/capitalize';\nimport axiosInstante from '~util/axios';\nimport clsx from 'clsx';\nimport { MUIDataGridTranslations } from '~util/index';\nimport { CARRIERS } from '~util/logos';\nimport { useDropzone } from 'react-dropzone/.';\n\ntype RateFileType = {\n\tid: number;\n\tcarrier: string;\n\turl: string;\n\tname?: string;\n\trange?: string;\n\tservice?: string;\n};\n\nconst ProfileRates = () => {\n\tconst { cardClasses } = useCardStyles();\n\tconst classes = useStyles();\n\n\tconst params: { id?: string } = useParams();\n\tconst dispatch = useDispatch();\n\n\tconst [ratesList, setRatesList] = useState(null);\n\tconst [inactivesRatesList, setInactivesRatesList] = useState(null);\n\tconst [selectedRate, setSelectedRate] = useState | null>(null);\n\tconst [expandActivePDF, setExpandActivePDF] = useState(true);\n\tconst [isSubmitting, setIsSubmitting] = useState(false);\n\n\tconst { isRootOrAgent } = usePermissions();\n\tconst { currentUser } = useContext(AuthContext);\n\tconst { setNotification } = useContext(DrawContext);\n\tconst [setService] = useRateStore((state) => [state.setService], shallow);\n\n\tconst isEstafetaRate = (carrier?: string) =>\n\t\tcarrier && carrier?.toLowerCase() === CARRIERS.ESTAFETA;\n\n\tconst saveTariff = useCallback(\n\t\tasync (file: File) => {\n\t\t\tif (!params?.id || !selectedRate?.carrier) return;\n\t\t\ttry {\n\t\t\t\tconst fileItem = new File([file], file.name, {\n\t\t\t\t\ttype: file.type\n\t\t\t\t});\n\n\t\t\t\tconst formData = new FormData();\n\t\t\t\tformData.append('files', fileItem);\n\t\t\t\tformData.append('customer_id', params?.id);\n\t\t\t\tformData.append('carrier', selectedRate?.carrier?.toLowerCase());\n\n\t\t\t\tawait axiosInstante.post('/api/customer/tariffs', formData);\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'Se subió con éxito',\n\t\t\t\t\tseverity: 'success'\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tconst errorMessage = 'Hubo un error al subir la tarifa';\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: axios.isAxiosError(error)\n\t\t\t\t\t\t? error?.response?.data?.description ?? errorMessage\n\t\t\t\t\t\t: errorMessage,\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[params?.id, selectedRate]\n\t);\n\n\tconst onDrop = useCallback(\n\t\tasync (acceptedFile: any) => {\n\t\t\tif (!acceptedFile?.length) return;\n\t\t\tsetIsSubmitting(true);\n\t\t\tconst file = acceptedFile[0];\n\t\t\tconst fileItem = new File([file], file.name, {\n\t\t\t\ttype: file.type\n\t\t\t});\n\t\t\tawait saveTariff(fileItem);\n\t\t\tsetIsSubmitting(false);\n\t\t},\n\t\t[saveTariff]\n\t);\n\n\tconst { getRootProps, getInputProps } = useDropzone({\n\t\tonDrop,\n\t\tnoDrag: true,\n\t\tmaxFiles: 1,\n\t\tmultiple: false\n\t});\n\n\tconst ratesOptions = useMemo(() => {\n\t\tlet list = ratesList;\n\t\tconst countMap = ratesList?.reduce((acc, item) => {\n\t\t\t// @ts-ignore\n\t\t\tacc[item?.carrier] = (acc[item?.carrier] || 0) + 1;\n\t\t\treturn acc;\n\t\t}, {});\n\t\t// @ts-ignore\n\t\tconst duplicates = ratesList?.filter((item) => countMap && countMap[item?.carrier] > 1);\n\t\tif (!!duplicates?.length && duplicates?.length > 1) {\n\t\t\t// @ts-ignore\n\t\t\tlist = Object.keys(countMap)?.map((item) => ({ carrier: item }));\n\t\t}\n\t\treturn list;\n\t}, [ratesList]);\n\n\tconst servicesOptions = useMemo(() => ratesList?.filter((item) => !!item?.service), [ratesList]);\n\n\tconst proposalOptions = useMemo(\n\t\t() => ratesList?.filter((item) => item?.carrier === selectedRate?.carrier),\n\t\t[ratesList, selectedRate]\n\t);\n\n\tconst hasProposalsToChoose = useMemo(\n\t\t() => !!proposalOptions && proposalOptions?.length > 1,\n\t\t[proposalOptions]\n\t);\n\n\tconst columns = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tfield: 'created_at',\n\t\t\t\tflex: 1,\n\t\t\t\theaderName: 'Fecha de Alta',\n\t\t\t\trenderCell: (params: GridCellParams) => ''\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: 'inactive_at',\n\t\t\t\tflex: 1,\n\t\t\t\theaderName: 'Fecha de Baja',\n\t\t\t\trenderCell: (params: GridCellParams) => ''\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: 'carrier',\n\t\t\t\tflex: 1,\n\t\t\t\theaderName: 'Transportista',\n\t\t\t\trenderCell: (params: GridCellParams) => params.row.carrier\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: 'proposal',\n\t\t\t\tflex: 1,\n\t\t\t\theaderName: 'Propuesta',\n\t\t\t\trenderCell: (params: GridCellParams) => ''\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: 'range',\n\t\t\t\tflex: 1,\n\t\t\t\theaderName: 'Rangos',\n\t\t\t\trenderCell: (params: GridCellParams) => ''\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: 'actions',\n\t\t\t\theaderName: 'Acciones',\n\t\t\t\tflex: 1,\n\t\t\t\tsortable: false,\n\t\t\t\trenderCell: (params: GridCellParams) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t window.open(params.row.url, '_blank')} />\n\t\t\t\t\t\t\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t[]\n\t);\n\n\tconst getRatesFiles = useCallback(async () => {\n\t\tconst url = isRootOrAgent\n\t\t\t? `/api/customer/files/documents?customer_id=${params?.id}`\n\t\t\t: '/api/customer/files/documents';\n\t\tconst { data } = await axiosInstante.get(url);\n\t\tsetRatesList(data?.tariffs?.active);\n\t\tsetInactivesRatesList(data?.tariffs?.inactive);\n\t}, [isRootOrAgent, params?.id]);\n\n\tuseEffect(() => {\n\t\tif (!currentUser?.services?.length) return;\n\t\tsetService(currentUser?.services[0]?.service);\n\t\tdispatch(\n\t\t\tsetServicesCUCustomer(\n\t\t\t\tcurrentUser?.services?.map((item) => ({\n\t\t\t\t\t...item,\n\t\t\t\t\tname: item.service,\n\t\t\t\t\tcarrier: capitalize(item.carrier)\n\t\t\t\t}))\n\t\t\t)\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [currentUser]);\n\n\tuseEffect(() => {\n\t\tgetRatesFiles();\n\t}, [getRatesFiles]);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t{/* ACTIVE */}\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{isRootOrAgent && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{!isSubmitting ? (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tNuevo\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t option.carrier}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option === value}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tconst carrierHasMoreThanOneRate =\n\t\t\t\t\t\t\t\t\t!!ratesList &&\n\t\t\t\t\t\t\t\t\tratesList?.filter((item) => item?.carrier === data?.carrier)?.length > 1;\n\t\t\t\t\t\t\t\tsetSelectedRate(\n\t\t\t\t\t\t\t\t\tcarrierHasMoreThanOneRate\n\t\t\t\t\t\t\t\t\t\t? { carrier: data?.carrier }\n\t\t\t\t\t\t\t\t\t\t: ratesList?.find((item) => item?.carrier === data?.carrier)!\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\n\t\t\t\t\t{isEstafetaRate(selectedRate?.carrier) && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t option?.service ?? ''}\n\t\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option?.service === value?.service}\n\t\t\t\t\t\t\t\tvalue={selectedRate}\n\t\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tclearOnBlur\n\t\t\t\t\t\t\t\tonChange={(_, value) => {\n\t\t\t\t\t\t\t\t\tconst newValue = !hasProposalsToChoose\n\t\t\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t\t\tcarrier: value?.carrier,\n\t\t\t\t\t\t\t\t\t\t\t\tid: value?.id,\n\t\t\t\t\t\t\t\t\t\t\t\tservice: value?.service\n\t\t\t\t\t\t\t\t\t\t };\n\t\t\t\t\t\t\t\t\tsetSelectedRate(newValue);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tPaperComponent={(paperProps) => (\n\t\t\t\t\t\t\t\t\t{paperProps.children}\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\n\t\t\t\t\t\n\t\t\t\t\t\t option?.name ?? ''}\n\t\t\t\t\t\t\tgetOptionSelected={(option, value) => option?.name === value?.name}\n\t\t\t\t\t\t\tonChange={(_, data) => {\n\t\t\t\t\t\t\t\tsetSelectedRate(data);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tvalue={selectedRate}\n\t\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{!!selectedRate?.url && (\n\t\t\t\t\t, expanded: boolean) => setExpandActivePDF(expanded)}\n\t\t\t\t\t\tstyle={{ boxShadow: 'none', width: '100%', backgroundColor: 'transparent' }}\n\t\t\t\t\t>\n\t\t\t\t\t\t} id='panel1-header'>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{!selectedRate?.url ? null : expandActivePDF ? 'Ocultar PDF' : 'Mostrar PDF'}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{selectedRate?.url && (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\n\n\t\t\t{/* INACTIVE */}\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default ProfileRates;\n","// Libraries\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { Grid } from '@mui/material';\n// Components\nimport { HeadingOne, TextTwo } from '~components/Headings';\n// import LabelContainer from '~components/Modals/_LabelContainer';\n// import { PDF } from '~pages/profile/MOCKUP';\n\n// Hooks\nimport { radiusCard } from '~hooks/useStyles';\n\nexport const useStyles = makeStyles((theme: Theme) => ({\n\tcontainer: {\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tborderRadius: `0 0 ${radiusCard}px ${radiusCard}px !important`,\n\t\tpadding: theme.spacing(3)\n\t\t// '&>h4': {\n\t\t// \tmargin: `${theme.spacing(2)} 0 ${theme.spacing(2)} ${theme.spacing(2)}`,\n\t\t// \twidth: '100%',\n\t\t// \ttextAlign: 'left'\n\t\t// }\n\t}\n}));\n\nconst ProfileContract = () => {\n\tconst classes = useStyles();\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{/* \n\t\t\t\t\t\t\n\t\t\t\t\t */}\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default ProfileContract;\n","import { FC, Fragment, useMemo } from 'react';\nimport { useLocation, useHistory, useParams } from 'react-router-dom';\nimport { PermissionsKey } from '~context/AuthContext';\n//Hooks\nimport usePermissions from '~hooks/usePermissions';\n//Components\nimport CreateOrUpdateCustomer from './CreateOrUpdateCustomer';\nimport CustomerTabs from '~components/Tabs/CustomerFormTabs';\nimport CreateOrUpdateProspect from '../CreateOrUpdateProspect';\nimport CustomerDocuments from './CustomerDocuments';\nimport ProfileRates from '~pages/profile/ProfileRates';\nimport ProfileContract from '~pages/profile/ProfileContract';\n\ntype BookletOption = {\n\tpath: string;\n\tname: string;\n\tcomponent: FC;\n\tpermission: PermissionsKey;\n};\n\nconst CustomerFormPage = () => {\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst params: { id?: string } = useParams();\n\n\tconst { can } = usePermissions();\n\n\tconst isCustomerForm = useMemo(() => location.pathname.includes('cliente'), [location]);\n\n\tconst customerBooklets: BookletOption[] = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tpath: '/cliente/datos',\n\t\t\t\tname: 'Datos',\n\t\t\t\tcomponent: CreateOrUpdateCustomer,\n\t\t\t\tpermission: 'canCreateUpdateDelete.client'\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/cliente/tarifas',\n\t\t\t\tname: 'Tarifas',\n\t\t\t\tcomponent: ProfileRates,\n\t\t\t\tpermission: 'canCreateUpdateDelete.client'\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/cliente/documentos',\n\t\t\t\tname: 'Documentos',\n\t\t\t\tcomponent: CustomerDocuments,\n\t\t\t\tpermission: 'canCreateUpdateDelete.client'\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/cliente/contrato',\n\t\t\t\tname: 'Contrato',\n\t\t\t\tcomponent: ProfileContract,\n\t\t\t\tpermission: 'canCreateUpdateDelete.client'\n\t\t\t}\n\t\t],\n\t\t[]\n\t);\n\n\tconst prospectBooklets: BookletOption[] = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tpath: '/prospecto/datos',\n\t\t\t\tname: 'Datos',\n\t\t\t\tcomponent: CreateOrUpdateProspect,\n\t\t\t\tpermission: 'canCreateUpdateDelete.client'\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/prospecto/documentos',\n\t\t\t\tname: 'Documentos',\n\t\t\t\tcomponent: CustomerDocuments,\n\t\t\t\tpermission: 'canCreateUpdateDelete.client'\n\t\t\t}\n\t\t],\n\t\t[]\n\t);\n\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tconst enabledTabs = useMemo(\n\t\t() =>\n\t\t\t(isCustomerForm ? customerBooklets : prospectBooklets).filter((booklet) =>\n\t\t\t\tcan(booklet.permission)\n\t\t\t),\n\t\t[can, isCustomerForm, customerBooklets, prospectBooklets]\n\t);\n\tconst tabs = useMemo(\n\t\t() => enabledTabs.map((booklet) => ({ name: booklet.name, path: booklet.path })),\n\t\t[enabledTabs]\n\t);\n\n\tconst index = useMemo(() => {\n\t\treturn enabledTabs.findIndex((b) => location.pathname?.includes(b.path));\n\t}, [location, enabledTabs]);\n\n\tconst Component = enabledTabs[index]?.component;\n\n\treturn (\n\t\t\n\t\t\t {\n\t\t\t\t\tconst booklet = enabledTabs[tabIndex];\n\t\t\t\t\tconst url = !params?.id ? booklet.path : booklet.path.concat(`/${params?.id}`);\n\t\t\t\t\thistory.replace(url);\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t\n\t\t\n\t);\n};\n\nexport default CustomerFormPage;\n","import { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { maxWidthContainerCard } from '~hooks/useStyles';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tpadding: theme.spacing(3),\n\t\twidth: maxWidthContainerCard\n\t},\n\tcontainer: {\n\t\t'&>*': {\n\t\t\tmarginTop: theme.spacing(2),\n\t\t\tpadding: theme.spacing(1)\n\t\t}\n\t}\n}));\n\nexport default useStyles;\n","// Libraries\nimport { useHistory, useParams } from 'react-router-dom';\nimport { Skeleton } from '@mui/material';\nimport { Grid, IconButton } from '@mui/material';\nimport { ArrowLeft } from 'react-feather';\nimport clsx from 'clsx';\n// Hooks\nimport useStyles from './styles';\nimport { useCardStyles } from '~hooks/useStyles';\n// Components\nimport { HeadingOne } from '~components/Headings';\n\nconst DocumentsPage = () => {\n\tconst classes = useStyles();\n\tconst { cardClasses } = useCardStyles();\n\tconst history = useHistory();\n\n\tconst params: { id?: string } = useParams();\n\n\tconst isLoading = false;\n\n\tif (isLoading) {\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t history.goBack()} color='primary'>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t
ID: {params?.id}
\n\t\t\t
\n\t\t
\n\t);\n};\n\nexport default DocumentsPage;\n","import { CircularProgress, Grid } from '@mui/material';\nimport React, { useState, useCallback, useContext, useEffect } from 'react';\nimport ClientForm from '~components/Forms/Client/ClientForm';\nimport AuthContext from '~context/AuthContext';\nimport { CustomerDetails } from '~store/actions/ActionTypes';\nimport axiosInstance from '~util/axios';\nimport { useForm } from 'react-hook-form';\nimport { useStyles } from './styles';\nimport ClientFiscalForm from '~components/Forms/Client/ClientFiscalForm';\n\nconst ProfileData = () => {\n\tconst classes = useStyles();\n\n\tconst { currentUser } = useContext(AuthContext);\n\n\tconst [customer, setCustomer] = useState();\n\tconst { control, errors } = useForm();\n\n\tconst getCustomer = useCallback(async (id: number) => {\n\t\ttry {\n\t\t\tconst { data } = await axiosInstance.get(`/api/customer/${id}`);\n\t\t\tsetCustomer(data);\n\t\t} catch (error) {\n\t\t\t// setNotification({\n\t\t\t// \tseverity: 'error',\n\t\t\t// \tmessage: 'Hubo un error',\n\t\t\t// \ttime: 3000\n\t\t\t// });\n\t\t}\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (currentUser?.customer?.id) {\n\t\t\tgetCustomer(currentUser?.customer?.id);\n\t\t}\n\t}, [currentUser, getCustomer]);\n\n\tif (!customer) {\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\treturn (\n\t\t\n\t\t\t{/* Datos generales */}\n\t\t\t\n\t\t\t\t{' '}\n\t\t\t\n\n\t\t\t{/* Facturacion */}\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default ProfileData;\n","import { FC } from 'react';\nimport { BottomNavigation, BottomNavigationAction } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport clsx from 'clsx';\n\ninterface Props {\n\tcurrentTab: number;\n\thandleChange: (tab: number) => void;\n\ttabs: { name: string; path: string }[];\n}\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\twidth: '100%',\n\t\tborderRadius: '20px 20px 0 0',\n\t\t'&>*': {\n\t\t\tflex: 1,\n\t\t\tmaxWidth: 'unset',\n\t\t\tfontWeight: 700,\n\t\t\tjustifySelf: 'flex-start'\n\t\t}\n\t},\n\tbookletOption: {\n\t\tborderBottom: 'solid 0.9px rgb(81, 81, 81)'\n\t},\n\tlabel: {\n\t\tfontSize: 25\n\t},\n\tbookletOptionSelected: {\n\t\tborderBottom: 'solid 4px ' + theme.palette.primary.main,\n\t\tbackgroundColor: '#4d4d4d',\n\t\tborderTopLeftRadius: '20px',\n\t\tborderTopRightRadius: '20px'\n\t},\n\ttabBorder: {\n\t\tboxSizing: 'border-box',\n\t\tborderBottom: 'solid 0.9px rgb(81, 81, 81)',\n\t\tpaddingLeft: 0,\n\t\tpaddingRight: 0,\n\t\t'& > span:nth-child(1)': {\n\t\t\tmarginRight: '-5px',\n\t\t\tborderRight: '1px solid #505050',\n\t\t\tpadding: '4px 0'\n\t\t}\n\t}\n}));\n\nconst ProfileTabs: FC = (props) => {\n\tconst classes = useStyles();\n\n\treturn (\n\t\t {\n\t\t\t\tprops.handleChange(newValue);\n\t\t\t}}\n\t\t\tshowLabels\n\t\t\tclassName={classes.root}\n\t\t>\n\t\t\t{props.tabs.map((tab, index) => (\n\t\t\t\t\n\t\t\t))}\n\t\t\n\t);\n};\n\nexport default ProfileTabs;\n","import { FC, Fragment, useMemo } from 'react';\nimport { useLocation, useHistory } from 'react-router-dom';\nimport { PermissionsKey } from '~context/AuthContext';\n//Hooks\nimport usePermissions from '~hooks/usePermissions';\n//Components\nimport ProfileData from './ProfileData';\nimport ProfileTabs from '~components/Tabs/ProfileTabs';\nimport ProfileRates from './ProfileRates';\nimport CustomerDocuments from '~pages/customer/CreateOrUpdateCustomer/CustomerDocuments';\nimport ProfileContract from './ProfileContract';\n\ntype BookletOption = {\n\tpath: string;\n\tname: string;\n\tcomponent: FC;\n\tpermission: PermissionsKey;\n};\n\nconst ProfilePage = () => {\n\tconst location = useLocation();\n\tconst history = useHistory();\n\n\tconst { can } = usePermissions();\n\n\tconst booklets: BookletOption[] = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tpath: '/perfil/datos',\n\t\t\t\tname: 'Datos',\n\t\t\t\tcomponent: ProfileData,\n\t\t\t\tpermission: 'canRead.app'\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/perfil/tarifas',\n\t\t\t\tname: 'Tarifas',\n\t\t\t\tcomponent: ProfileRates,\n\t\t\t\tpermission: 'canRead.app'\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/perfil/documentos',\n\t\t\t\tname: 'Documentos',\n\t\t\t\tcomponent: CustomerDocuments,\n\t\t\t\tpermission: 'canRead.app'\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/perfil/contrato',\n\t\t\t\tname: 'Contrato',\n\t\t\t\tcomponent: ProfileContract,\n\t\t\t\tpermission: 'canRead.app'\n\t\t\t}\n\t\t],\n\t\t[]\n\t);\n\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tconst enabledTabs = useMemo(() => booklets.filter((booklet) => can(booklet.permission)), [can]);\n\tconst tabs = useMemo(\n\t\t() => enabledTabs.map((booklet) => ({ name: booklet.name, path: booklet.path })),\n\t\t[enabledTabs]\n\t);\n\n\tconst index = useMemo(() => {\n\t\treturn enabledTabs.findIndex((b) => location.pathname?.includes(b.path));\n\t}, [location, enabledTabs]);\n\n\tconst Component = enabledTabs[index]?.component;\n\n\treturn (\n\t\t\n\t\t\t {\n\t\t\t\t\tconst booklet = enabledTabs[tabIndex];\n\t\t\t\t\tconst url = booklet.path;\n\t\t\t\t\thistory.replace(url);\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t\n\t\t\n\t);\n};\n\nexport default ProfilePage;\n","import React, { useContext } from 'react';\nimport { Switch, Route, Redirect } from 'react-router-dom';\nimport { UserRole } from '~store/actions/ActionTypes';\nimport AuthContext, { PermissionsKey } from './context/AuthContext';\n\n// Pages\nimport MainPage from './pages/main/MainPage';\nimport RateContainer from './components/Containers/Rate';\nimport SendContainer from './components/Containers/Send';\nimport PickUpContainer from './components/Containers/PickUp';\nimport MultiSendLabel from './components/Containers/MultiSendLabel';\nimport CustomerFormPage from '~pages/customer/CreateOrUpdateCustomer/CustomerFormPage';\nimport DocumentsPage from '~pages/customer/DocumentsPage/DocumentsPage';\nimport ProfilePage from '~pages/profile/ProfilePage';\n// import TutorialsPage from '~pages/tutorials/TutorialsPage';\n// import IncidentResume from '~pages/shipments/Incident/IncidentResume';\n\n// Pages with lazy loading\nconst CreateOrUpdatePackagePage = React.lazy(\n\t() => import('./pages/packages/CreateOrUpdatePackagePage')\n);\nconst CreateOrUpdateAddressPage = React.lazy(\n\t() => import('./pages/address/CreateOrUpdateAddressPage')\n);\nconst SummaryPage = React.lazy(() => import('./pages/summary/SummaryPage'));\nconst RatePage = React.lazy(() => import('./pages/rate/RatePage'));\nconst ResultPage = React.lazy(() => import('./pages/results/ResultPage'));\nconst ConsolidatedPage = React.lazy(() => import('./pages/consolidated/ConsolidatedPage'));\nconst ShipmentPage = React.lazy(() => import('./pages/shipments/ShipmentPage'));\nconst UpdateLabelPage = React.lazy(() => import('./pages/shipments/UpdateLabelPage'));\n// const ProfilePage = React.lazy(() => import('~pages/profile/ProfilePage'));\n// const TutorialsPage = React.lazy(() => import('~pages/tutorials/TutorialsPage'));\n\n// const IncidentForm = React.lazy(() => import('~pages/shipments/Incident/IncidentForm'));\n// const IncidentDocuments = React.lazy(\n// \t() => import('~pages/shipments/Incident/Forms/IncidentDocuments/IncidentDocuments')\n// );\n\n// const EditIncident = React.lazy(\n// \t() => import('~pages/shipments/Incident/EditIncident/EditIncident')\n// );\n\nconst CreateOrUpdateShipmentPage = React.lazy(\n\t() => import('./pages/shipments/CreateOrUpdateShipmentPage')\n);\nconst BookletPage = React.lazy(() => import('./pages/booklet/BookletPage'));\nconst CreateOrUpdateUserPage = React.lazy(() => import('./pages/users/CreateOrUpdateUserPage'));\nconst CreateOrUpdateGroupPage = React.lazy(() => import('./pages/groups/CreateOrUpdateGroupPage'));\nconst ConsolidatedResultPage = React.lazy(\n\t() => import('./pages/consolidated/ConsolidatedResultsPage')\n);\n\nconst CustomerPage = React.lazy(() => import('./pages/customer/CustomerPage'));\n// const CustomerFormPage = React.lazy(\n// \t() => import('~pages/customer/CreateOrUpdateCustomer/CustomerFormPage')\n// );\n\n// const CreateOrUpdateProspectPage = React.lazy(\n// \t() => import('./pages/customer/CreateOrUpdateProspect')\n// );\n\n// const DocumentsPage = React.lazy(() => import('~pages/customer/DocumentsPage/DocumentsPage'));\n\nconst AgentsPage = React.lazy(() => import('./pages/agents/AgentsTable'));\nconst CreateOrUpdateAgentPage = React.lazy(() => import('./pages/agents/CreateOrUpdateAgentPage'));\nconst CreateDispersionPage = React.lazy(() => import('./pages/Dispersion/DispersionCreate'));\nconst DispersePage = React.lazy(() => import('./pages/Dispersion/Disperse'));\nconst CreateIssuePage = React.lazy(() => import('./pages/issues/CreateIssuePage'));\n\nconst PackagingPage = React.lazy(() => import('./pages/Packaging/PackagingPage'));\n//Wallet\nconst BookletWallet = React.lazy(() => import('./pages/booklet/BookletWallet'));\nconst CreateFiscalPage = React.lazy(() => import('./pages/billing/CreateFiscalPage'));\nconst PreinvoiceFiscalResume = React.lazy(\n\t() => import('./pages/billing/PreinvoiceFiscalResume/PreinvoiceFiscalResume')\n);\nconst PendingPayments = React.lazy(() => import('./pages/billing/PendingPayments/PendingPayments'));\nconst CreditNoteRegister = React.lazy(\n\t() => import('./pages/billing/CreditNoteRegister/CreditNoteRegister')\n);\n\n// Balance\nconst PaymentRegister = React.lazy(() => import('./pages/billing/PaymentRegister/PaymentRegister'));\nconst DisperseBalance = React.lazy(\n\t() => import('./pages/Dispersion/DisperseBalance/DisperseBalance')\n);\n\n//Rate\nconst ClientRate = React.lazy(() => import('./components/Forms/Client/ClientRate/ClientRate'));\n\nconst CreateGuide = React.lazy(() => import('./components/ShipmentPickUp/CreateGuide/CreateGuide'));\nconst CreateSimpleAddress = React.lazy(\n\t() => import('./components/ShipmentPickUp/CreateGuide/SimpleAddress/CreateSimpleAddress')\n);\n\n// Dispersion\nconst PurchaseLabelsPage = React.lazy(() => import('./pages/Dispersion/Purchase/PurchaseLabels'));\nconst BillingData = React.lazy(() => import('./pages/Dispersion/Billing/PurchaseBilling'));\nconst PurchaseConfirm = React.lazy(() => import('./pages/Dispersion/Purchase/PurchaseConfirm'));\n\nconst ShipmentTracking = React.lazy(() => import('./pages/tracking/ShipmentTracking'));\n\n/**\n * This file contains the routes for all the page, to avoid mispellings\n */\n\nexport interface RouteType {\n\tpath: string;\n\texact?: boolean;\n\tname: string;\n\tcomponent: React.FC<{}>;\n\troles?: UserRole[];\n\tpermissionKey: PermissionsKey;\n}\n\n// Implement the real route file\nexport const routes: RouteType[] = [\n\t// Main Pages\n\t{ path: '/', exact: true, name: 'MainPage', component: MainPage, permissionKey: 'canRead.app' },\n\t{\n\t\tpath: '/carga-masiva',\n\t\texact: true,\n\t\tname: 'MultiSendLabel',\n\t\tcomponent: MultiSendLabel,\n\t\tpermissionKey: 'canCreateUpdateDelete.label'\n\t},\n\t{\n\t\tpath: '/enviar',\n\t\texact: true,\n\t\tname: 'SendPage',\n\t\tcomponent: SendContainer,\n\t\tpermissionKey: 'canCreateUpdateDelete.label'\n\t},\n\t{\n\t\tpath: '/cotizar',\n\t\texact: true,\n\t\tname: 'RatePage',\n\t\tcomponent: RateContainer,\n\t\tpermissionKey: 'canCreateUpdateDelete.rate'\n\t},\n\t{\n\t\tpath: '/recolectar',\n\t\texact: true,\n\t\tname: 'PickupPage',\n\t\tcomponent: PickUpContainer,\n\t\tpermissionKey: 'canCreateUpdateDelete.pickup'\n\t},\n\n\t// Flow Pages\n\t{\n\t\tpath: '/resultados',\n\t\texact: true,\n\t\tname: 'RateResultsPage',\n\t\tcomponent: RatePage,\n\t\tpermissionKey: 'canCreateUpdateDelete.rate'\n\t},\n\t{\n\t\tpath: '/resumen',\n\t\texact: true,\n\t\tname: 'SummaryPage',\n\t\tcomponent: SummaryPage,\n\t\tpermissionKey: 'canCreateUpdateDelete.label'\n\t},\n\t{\n\t\tpath: '/consolidado',\n\t\texact: true,\n\t\tname: 'ConsolidatedPage',\n\t\tcomponent: ConsolidatedPage,\n\t\tpermissionKey: 'canCreateUpdateDelete.label'\n\t},\n\t{\n\t\tpath: '/consolidados',\n\t\texact: true,\n\t\tname: 'ConsolidatedsPage',\n\t\tcomponent: ConsolidatedResultPage,\n\t\tpermissionKey: 'canRead.label'\n\t},\n\t{\n\t\tpath: '/orden',\n\t\texact: true,\n\t\tname: 'ResultPage',\n\t\tcomponent: ResultPage,\n\t\tpermissionKey: 'canCreateUpdateDelete.label'\n\t},\n\t// Booklet (addresses, packages, users, groups)\n\t// Dispersion\n\t{\n\t\tpath: '/dispersion',\n\t\texact: true,\n\t\tname: 'CreateDispersion',\n\t\tcomponent: CreateDispersionPage,\n\t\tpermissionKey: 'canCreateUpdateDelete.dispersion',\n\t\troles: [UserRole.AGENT, UserRole.ROOT]\n\t},\n\t{\n\t\tpath: '/comprar-guias/:id?',\n\t\texact: true,\n\t\tname: 'PurchaseLabels',\n\t\tcomponent: PurchaseLabelsPage,\n\t\tpermissionKey: 'canCreateUpdateDelete.disperse'\n\t},\n\t{\n\t\tpath: '/pedido/datos-facturacion',\n\t\texact: true,\n\t\tname: 'BillingData',\n\t\tcomponent: BillingData,\n\t\tpermissionKey: 'canCreateUpdateDelete.disperse'\n\t},\n\t{\n\t\tpath: '/pedido/confirmar',\n\t\texact: true,\n\t\tname: 'DispersePage',\n\t\tcomponent: PurchaseConfirm,\n\t\tpermissionKey: 'canCreateUpdateDelete.disperse'\n\t},\n\t{\n\t\tpath: '/dispersar/:id?',\n\t\texact: true,\n\t\tname: 'Disperse',\n\t\tcomponent: DispersePage,\n\t\tpermissionKey: 'canCreateUpdateDelete.disperse'\n\t},\n\t// Address\n\t{\n\t\tpath: '/direcciones',\n\t\texact: true,\n\t\tname: 'AddressesPage',\n\t\tcomponent: BookletPage,\n\t\tpermissionKey: 'canRead.addresses'\n\t},\n\t{\n\t\tpath: '/direccion/:id?',\n\t\texact: true,\n\t\tname: 'CreateOrUpdateAddressPage',\n\t\tcomponent: CreateOrUpdateAddressPage,\n\t\tpermissionKey: 'canCreateUpdateDelete.address'\n\t},\n\t// Packages\n\t{\n\t\tpath: '/paquetes',\n\t\texact: true,\n\t\tname: 'PackagesPage',\n\t\tcomponent: BookletPage,\n\t\tpermissionKey: 'canRead.packages'\n\t},\n\t{\n\t\tpath: '/paquete/:id?',\n\t\texact: true,\n\t\tname: 'CreateOrUpdatePackagePage',\n\t\tcomponent: CreateOrUpdatePackagePage,\n\t\tpermissionKey: 'canCreateUpdateDelete.package'\n\t},\n\t// Users\n\t{\n\t\tpath: '/usuarios',\n\t\texact: true,\n\t\tname: 'UsersPage',\n\t\tcomponent: BookletPage,\n\t\t// roles: [UserRole.AGENT, UserRole.ROOT, UserRole.CUSTOMER],\n\t\tpermissionKey: 'canRead.users'\n\t},\n\t{\n\t\tpath: '/usuario/:id?',\n\t\texact: true,\n\t\tname: 'CreateOrUpdateUserPage',\n\t\tcomponent: CreateOrUpdateUserPage,\n\t\t// TODO validate that only de admin can manage itself\n\t\t// roles: [UserRole.AGENT, UserRole.ROOT, UserRole.CUSTOMER],\n\t\tpermissionKey: 'canRead.users'\n\t},\n\t{\n\t\tpath: '/grupos',\n\t\texact: true,\n\t\tname: 'GruopsPage',\n\t\tcomponent: BookletPage,\n\t\tpermissionKey: 'canRead.groups'\n\t},\n\t{\n\t\tpath: '/grupo/:id?',\n\t\texact: true,\n\t\tname: 'CreateOrUpdateGroupPage',\n\t\tcomponent: CreateOrUpdateGroupPage,\n\t\tpermissionKey: 'canCreateUpdateDelete.group'\n\t},\n\t{\n\t\tpath: '/bot',\n\t\texact: true,\n\t\tname: 'BotTable',\n\t\tcomponent: BookletPage,\n\t\tpermissionKey: 'canCreateUpdateDelete.client'\n\t},\n\n\t// Shipment (rates, shipments, pickups, clarifications)\n\t// { path: '/cotizaciones', exact: true, name: 'RatesPage', component: ShipmentPage, permissionKey: 'canRead.rate' },\n\t{\n\t\tpath: '/envios',\n\t\texact: true,\n\t\tname: 'ShipmentsPage',\n\t\tcomponent: ShipmentPage,\n\t\tpermissionKey: 'canRead.label'\n\t},\n\t{\n\t\tpath: '/seguimiento',\n\t\texact: true,\n\t\tname: 'ShipmentsTrackingPage',\n\t\tcomponent: ShipmentPage,\n\t\tpermissionKey: 'canRead.label'\n\t},\n\t{\n\t\tpath: '/recolecciones',\n\t\texact: true,\n\t\tname: 'PickupsPage',\n\t\tcomponent: ShipmentPage,\n\t\tpermissionKey: 'canRead.pickup'\n\t},\n\t// {\n\t// \tpath: '/incidentes',\n\t// \texact: true,\n\t// \tname: 'IncidentTable',\n\t// \tcomponent: ShipmentPage,\n\t// \tpermissionKey: 'canRead.label'\n\t// },\n\t// {\n\t// \tpath: '/registrar-incidente',\n\t// \texact: true,\n\t// \tname: 'IncidentForm',\n\t// \tcomponent: IncidentForm,\n\t// \tpermissionKey: 'canRead.label'\n\t// },\n\t// {\n\t// \tpath: '/registrar-incidente/documentos',\n\t// \texact: true,\n\t// \tname: 'IncidentForm',\n\t// \tcomponent: IncidentDocuments,\n\t// \tpermissionKey: 'canRead.label'\n\t// },\n\t// {\n\t// \tpath: '/registrar-incidente/resumen',\n\t// \texact: true,\n\t// \tname: 'IncidentForm',\n\t// \tcomponent: IncidentResume,\n\t// \tpermissionKey: 'canRead.label'\n\t// },\n\t{\n\t\tpath: '/dispersiones',\n\t\texact: true,\n\t\tname: 'DispersionPage',\n\t\tcomponent: ShipmentPage,\n\t\tpermissionKey: 'canRead.dispersion'\n\t},\n\t{\n\t\tpath: '/recoleccion/:id',\n\t\texact: true,\n\t\tname: 'CreateOrUpdatePickupPage',\n\t\tcomponent: CreateOrUpdateShipmentPage,\n\t\tpermissionKey: 'canCreateUpdateDelete.pickup'\n\t},\n\t{\n\t\tpath: '/envio/:id',\n\t\texact: true,\n\t\tname: 'UpdateLabelPage',\n\t\tcomponent: UpdateLabelPage,\n\t\tpermissionKey: 'canCreateUpdateDelete.label'\n\t},\n\t// PERFIL\n\t{\n\t\tpath: '/perfil/datos',\n\t\texact: true,\n\t\tname: 'ProfilePage',\n\t\tcomponent: ProfilePage,\n\t\tpermissionKey: 'canRead.app'\n\t},\n\t{\n\t\tpath: '/perfil/tarifas',\n\t\texact: true,\n\t\tname: 'ProfilePage',\n\t\tcomponent: ProfilePage,\n\t\tpermissionKey: 'canRead.app'\n\t},\n\t{\n\t\tpath: '/perfil/documentos',\n\t\texact: true,\n\t\tname: 'ProfilePage',\n\t\tcomponent: ProfilePage,\n\t\tpermissionKey: 'canRead.app'\n\t},\n\t// {\n\t// \tpath: '/tutoriales',\n\t// \texact: true,\n\t// \tname: 'TutorialsPage',\n\t// \tcomponent: TutorialsPage,\n\t// \tpermissionKey: 'canRead.app'\n\t// },\n\t{\n\t\tpath: '/perfil/contrato',\n\t\texact: true,\n\t\tname: 'ProfilePage',\n\t\tcomponent: ProfilePage,\n\t\tpermissionKey: 'canRead.app'\n\t},\n\n\t// SALDO\n\t{\n\t\tpath: '/historial-saldo',\n\t\texact: true,\n\t\tname: 'CreditTable',\n\t\tcomponent: ShipmentPage,\n\t\tpermissionKey: 'canRead.dispersion'\n\t},\n\t{\n\t\tpath: '/registro-saldo/:id?',\n\t\texact: true,\n\t\tname: 'PaymentRegister',\n\t\tcomponent: PaymentRegister,\n\t\tpermissionKey: 'canCreateUpdateDelete.disperse'\n\t},\n\t{\n\t\tpath: '/dispersar-saldo',\n\t\texact: true,\n\t\tname: 'DisperseBalance',\n\t\tcomponent: DisperseBalance,\n\t\tpermissionKey: 'canCreateUpdateDelete.disperse'\n\t},\n\n\t/**\n\t * ==================\n\t * ===Admin Routes===\n\t * ==================\n\t */\n\t{\n\t\tpath: '/clientes',\n\t\texact: true,\n\t\tname: 'CustomerPage',\n\t\tcomponent: CustomerPage,\n\t\troles: [UserRole.AGENT, UserRole.ROOT, UserRole.SELLER],\n\t\tpermissionKey: 'canRead.client'\n\t},\n\t{\n\t\tpath: '/cliente/datos/:id?',\n\t\texact: true,\n\t\tname: 'CreateOrUpdateClientPage',\n\t\tcomponent: CustomerFormPage,\n\t\troles: [UserRole.AGENT, UserRole.CUSTOMER, UserRole.ROOT],\n\t\tpermissionKey: 'canCreateUpdateDelete.client'\n\t},\n\t{\n\t\tpath: '/cliente/tarifas/:id?',\n\t\texact: true,\n\t\tname: 'CustomerFormPage',\n\t\tcomponent: CustomerFormPage,\n\t\troles: [UserRole.AGENT, UserRole.CUSTOMER, UserRole.ROOT],\n\t\tpermissionKey: 'canCreateUpdateDelete.client'\n\t},\n\t{\n\t\tpath: '/cliente/documentos/:id?',\n\t\texact: true,\n\t\tname: 'CustomerFormPage',\n\t\tcomponent: CustomerFormPage,\n\t\troles: [UserRole.AGENT, UserRole.CUSTOMER, UserRole.ROOT],\n\t\tpermissionKey: 'canCreateUpdateDelete.client'\n\t},\n\t{\n\t\tpath: '/cliente/documento/:id?',\n\t\texact: true,\n\t\tname: 'DocumentsPage',\n\t\tcomponent: DocumentsPage,\n\t\troles: [UserRole.AGENT, UserRole.CUSTOMER, UserRole.ROOT],\n\t\tpermissionKey: 'canCreateUpdateDelete.client'\n\t},\n\t{\n\t\tpath: '/cliente/contrato/:id?',\n\t\texact: true,\n\t\tname: 'CustomerFormPage',\n\t\tcomponent: CustomerFormPage,\n\t\troles: [UserRole.AGENT, UserRole.CUSTOMER, UserRole.ROOT],\n\t\tpermissionKey: 'canCreateUpdateDelete.client'\n\t},\n\t{\n\t\tpath: '/tarifas/:id?',\n\t\texact: true,\n\t\tname: 'ClientRate',\n\t\tcomponent: ClientRate,\n\t\tpermissionKey: 'canRead.app'\n\t},\n\t{\n\t\tpath: '/prospectos',\n\t\texact: true,\n\t\tname: 'ProspectsPage',\n\t\tcomponent: CustomerPage,\n\t\troles: [UserRole.AGENT, UserRole.ROOT],\n\t\tpermissionKey: 'canRead.client'\n\t},\n\t// {\n\t// \tpath: '/prospecto/:id?',\n\t// \texact: true,\n\t// \tname: 'ProspectsPage',\n\t// \tcomponent: CreateOrUpdateProspectPage,\n\t// \troles: [UserRole.AGENT, UserRole.ROOT],\n\t// \tpermissionKey: 'canCreateUpdateDelete.client'\n\t// },\n\t{\n\t\tpath: '/prospecto/datos/:id?',\n\t\texact: true,\n\t\tname: 'CustomerFormPage',\n\t\tcomponent: CustomerFormPage,\n\t\troles: [UserRole.AGENT, UserRole.CUSTOMER, UserRole.ROOT],\n\t\tpermissionKey: 'canCreateUpdateDelete.client'\n\t},\n\t{\n\t\tpath: '/prospecto/documentos/:id?',\n\t\texact: true,\n\t\tname: 'CustomerFormPage',\n\t\tcomponent: CustomerFormPage,\n\t\troles: [UserRole.AGENT, UserRole.CUSTOMER, UserRole.ROOT],\n\t\tpermissionKey: 'canCreateUpdateDelete.client'\n\t},\n\t{\n\t\tpath: '/agentes',\n\t\texact: true,\n\t\tname: 'AgentsPage',\n\t\tcomponent: AgentsPage,\n\t\troles: [UserRole.ROOT],\n\t\tpermissionKey: 'canRead.client'\n\t},\n\t{\n\t\tpath: '/agente/:id?',\n\t\texact: true,\n\t\tname: 'CreateOrUpdateAgentPage',\n\t\tcomponent: CreateOrUpdateAgentPage,\n\t\troles: [UserRole.ROOT],\n\t\tpermissionKey: 'canCreateUpdateDelete.client'\n\t},\n\n\t{\n\t\tpath: '/problema',\n\t\texact: true,\n\t\tname: 'CreateIssuePage',\n\t\tcomponent: CreateIssuePage,\n\t\t// For this page, the permissionKey is irrelevant. We can change this to any\n\t\t// other possible key\n\t\tpermissionKey: 'canCreateUpdateDelete.user'\n\t},\n\n\t{\n\t\tpath: '/empaques',\n\t\texact: true,\n\t\tname: 'PackagingPage',\n\t\tcomponent: PackagingPage,\n\t\tpermissionKey: 'canCreateUpdateDelete.pickup'\n\t},\n\t// FACTURACION\n\t{\n\t\tpath: '/facturas',\n\t\texact: true,\n\t\tname: 'ControlPanel',\n\t\tcomponent: BookletWallet,\n\t\tpermissionKey: 'canRead.business'\n\t},\n\t{\n\t\tpath: '/centro-costos',\n\t\texact: true,\n\t\tname: 'BusinessTable',\n\t\tcomponent: BookletWallet,\n\t\tpermissionKey: 'canRead.business'\n\t},\n\t{\n\t\tpath: '/revision',\n\t\texact: true,\n\t\tname: 'ReportsTable',\n\t\tcomponent: BookletWallet,\n\t\tpermissionKey: 'canRead.business'\n\t},\n\t{\n\t\tpath: '/pre-facturas',\n\t\texact: true,\n\t\tname: 'PreInvoicesTable',\n\t\tcomponent: BookletWallet,\n\t\tpermissionKey: 'canRead.business'\n\t},\n\t{\n\t\tpath: '/facturas',\n\t\texact: true,\n\t\tname: 'InvoicesTable',\n\t\tcomponent: BookletWallet,\n\t\tpermissionKey: 'canRead.business'\n\t},\n\t{\n\t\tpath: '/facturas-saldos',\n\t\texact: true,\n\t\tname: 'InvoicesTable',\n\t\tcomponent: BookletWallet,\n\t\tpermissionKey: 'canCreateUpdateDelete.client'\n\t},\n\t{\n\t\tpath: '/razon-social/:id?',\n\t\texact: true,\n\t\tname: 'CreateFiscalPage',\n\t\tcomponent: CreateFiscalPage,\n\t\tpermissionKey: 'canRead.business'\n\t},\n\t{\n\t\tpath: '/resumen-razon-social/:id?',\n\t\texact: true,\n\t\tname: 'PreinvoiceFiscalResume',\n\t\tcomponent: PreinvoiceFiscalResume,\n\t\tpermissionKey: 'canRead.business'\n\t},\n\t{\n\t\tpath: '/pagos',\n\t\texact: true,\n\t\tname: 'PendingPayments',\n\t\tcomponent: PendingPayments,\n\t\tpermissionKey: 'canRead.business'\n\t},\n\t{\n\t\tpath: '/nota-credito',\n\t\texact: true,\n\t\tname: 'CreditNoteRegister',\n\t\tcomponent: CreditNoteRegister,\n\t\tpermissionKey: 'canRead.business'\n\t},\n\t// GUÍA MANUAL\n\t{\n\t\tpath: '/guia-manual/:id?',\n\t\texact: true,\n\t\tname: 'CreateGuide',\n\t\tcomponent: CreateGuide,\n\t\tpermissionKey: 'canCreateUpdateDelete.label'\n\t},\n\t{\n\t\tpath: '/direccion-simple/:id?',\n\t\texact: true,\n\t\tname: 'CreateSimpleAddress',\n\t\tcomponent: CreateSimpleAddress,\n\t\tpermissionKey: 'canRead.app'\n\t},\n\t// ADMIN SALDO\n\t{\n\t\tpath: '/saldo',\n\t\texact: true,\n\t\tname: 'CreditTable',\n\t\tcomponent: BookletWallet,\n\t\tpermissionKey: 'canRead.dispersion'\n\t},\n\t// TRACKING\n\t{\n\t\tpath: '/tracking/:id',\n\t\texact: true,\n\t\tname: 'ShipmentTracking',\n\t\tcomponent: ShipmentTracking,\n\t\tpermissionKey: 'canRead.app',\n\t}\n\t// INCIDENTES\n\t// {\n\t// \tpath: '/incidente/:id',\n\t// \texact: true,\n\t// \tname: 'EditIncident',\n\t// \tcomponent: EditIncident,\n\t// \tpermissionKey: 'canCreateUpdateDelete.client'\n\t// }\n];\n\nconst Routes: React.FC = () => {\n\tconst { currentUser, currentPermissions } = useContext(AuthContext);\n\n\treturn (\n\t\t\n\t\t\t{routes.map((r, i) => {\n\t\t\t\t// This is the only case where we don't validate permissions or role\n\t\t\t\tif (r.path === '/problema') {\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\n\t\t\t\tconst [permission, module] = r.permissionKey.split('.');\n\t\t\t\tif (!r.roles) {\n\t\t\t\t\t// If no role so it should public\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (currentPermissions[permission][module]) {\n\t\t\t\t\t\treturn ;\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (r.roles.includes(currentUser.role) && currentPermissions[permission][module]) {\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t})}\n\t\t\t{/* Default 404 */}\n\t\t\t\n\t\t\n\t);\n};\n\nexport default React.memo(Routes);\n","import homeHover from './home-hover.svg';\nimport home from './home.svg';\n\nexport default { homeHover, home };\n","export default __webpack_public_path__ + \"static/media/home-hover.963578a0.svg\";","export default __webpack_public_path__ + \"static/media/home.7cc6ec72.svg\";","type IconColor = {\n\tcolor?: string;\n};\n\nexport function SendIcon({ color }: IconColor) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport function RateIcon({ color }: IconColor) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport function PickupIcon({ color }: IconColor) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport function HistoryIcon({ color }: IconColor) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport function NotebookIcon({ color }: IconColor) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport function ClientsIcon({ color }: IconColor) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport function AgentsIcon({ color }: IconColor) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport function BillingIcon({ color }: IconColor) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import { FC, Fragment, useCallback, useContext } from 'react';\nimport { Drawer, SwipeableDrawer, Grid, Theme, useMediaQuery } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\nimport DrawContext from '~context/DrawContext';\nimport CustomIconButton from '~components/Buttons/CustomIconButton';\nimport { clearAddressesData, resetFlow, resetPickup } from '~store/actions';\nimport { useHistory, useLocation } from 'react-router-dom';\nimport { useDispatch, useSelector } from 'react-redux';\nimport usePermissions from '~hooks/usePermissions';\nimport { RootStore } from '~store/store';\nimport menuImages from '../../assets/menu/index';\nimport {\n\tSendIcon,\n\tRateIcon,\n\tPickupIcon,\n\tNotebookIcon,\n\tHistoryIcon,\n\tClientsIcon,\n\tAgentsIcon,\n\tBillingIcon\n} from '~components/MenuIcons/MenuIcons';\nimport useWalletStore from '~store/WalletStore';\nimport { shallow } from 'zustand/shallow';\nimport { useTheme } from '~hooks/useTheme';\nimport { Hidden } from '@mui/material';\n\nconst useStyles = makeStyles((theme: Theme) => {\n\treturn {\n\t\trootList: {\n\t\t\t'&>:first-child': {\n\t\t\t\t'&>*:hover': {\n\t\t\t\t\tbackgroundColor: 'inherit'\n\t\t\t\t}\n\t\t\t},\n\t\t\t'&>*': {\n\t\t\t\tpadding: '6px'\n\t\t\t},\n\t\t\t'&>* > button': {\n\t\t\t\tcolor: theme.palette.white.main,\n\t\t\t\tmaxWidth: 'unset',\n\t\t\t\twidth: '76px',\n\t\t\t\theight: '68px',\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tflexDirection: 'column',\n\t\t\t\talignItems: 'center',\n\n\t\t\t\t'&>*:hover': {\n\t\t\t\t\tcolor: '#fff'\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tpaperLeftDrawer: {\n\t\t\t//paddingTop: theme.spacing(1),\n\t\t\t// paddingBottom: theme.spacing(1.5),\n\t\t\tleft: 4,\n\t\t\ttop: 30,\n\t\t\theight: '100%',\n\t\t\tboxSizing: 'border-box',\n\t\t\tborderRadius: theme.shape.borderRadius,\n\t\t\tbackgroundColor: `${theme.palette.background.default} !important`,\n\t\t\tborder: 'none !important',\n\t\t\tdisplay: 'flex',\n\t\t\tjustifyContent: 'center',\n\t\t\talignItems: 'center',\n\t\t\tzIndex: '11 !important'\n\t\t},\n\t\ticon: {\n\t\t\tfontFamily: 'Gotham',\n\t\t\tfontStyle: 'normal',\n\t\t\tfontWeight: 400,\n\t\t\tfontSize: '11px',\n\t\t\tlineHeight: '12px',\n\t\t\twidth: '26px'\n\t\t},\n\t\thomeIcon: {\n\t\t\twidth: '36px',\n\t\t\theight: '36px',\n\t\t\tbackgroundImage: `url(${menuImages.home})`,\n\t\t\t'&:hover': {\n\t\t\t\tbackgroundImage: `url(${menuImages.homeHover})`\n\t\t\t}\n\t\t},\n\t\tlabel: {\n\t\t\tfontSize: '11px',\n\t\t\tlineHeight: '12px',\n\t\t\tfontWeight: 400,\n\t\t\tmargin: '6px 0px 0px 0px'\n\t\t}\n\t};\n});\n\n/**\n * Menú de la izquierda\n */\n\nconst LDrawer: FC = () => {\n\tconst classes = useStyles();\n\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst dispatch = useDispatch();\n\tconst currentFlow = useSelector((state: RootStore) => state.flow.currentFlow);\n\tconst { mobileLeftDrawerStatus, toggleLeftDrawer } = useContext(DrawContext);\n\tconst { isRoot, isRootOrAgent, canUseLibreta, canUseEnvios, can, isSeller, isBiller } =\n\t\tusePermissions();\n\tconst resetBusinessTabs = useWalletStore((state) => state.reset, shallow);\n\n\tconst matchesLG = useMediaQuery('(min-width:1360px)');\n\tconst { themeV4 } = useTheme();\n\n\tconst leftMenu = useCallback(\n\t\t() => (\n\t\t\t\n\t\t\t\t{matchesLG || !isRootOrAgent ? (\n\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tdispatch(resetFlow());\n\t\t\t\t\t\t\t\thistory.push('/');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t) : (\n\t\t\t\t\t
\n\t\t\t\t)}\n\n\t\t\t\t{can('canCreateUpdateDelete.label') && (\n\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tif (location.pathname.includes('enviar')) return;\n\t\t\t\t\t\t\t\thistory.push('/enviar');\n\t\t\t\t\t\t\t\tdispatch(clearAddressesData());\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Enviar

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t)}\n\n\t\t\t\t{can('canCreateUpdateDelete.rate') && (\n\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tif (location.pathname.includes('cotizar')) return;\n\t\t\t\t\t\t\t\tdispatch(resetFlow());\n\t\t\t\t\t\t\t\thistory.push('/cotizar');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Cotizar

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t)}\n\n\t\t\t\t{can('canCreateUpdateDelete.pickup') && (\n\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tif (location.pathname.includes('recolectar')) return;\n\t\t\t\t\t\t\t\tdispatch(resetPickup());\n\t\t\t\t\t\t\t\thistory.push('/recolectar');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Recolectar

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t)}\n\n\t\t\t\t{canUseEnvios && (\n\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tdispatch(resetFlow());\n\t\t\t\t\t\t\t\thistory.push('/envios');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Historial

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t)}\n\n\t\t\t\t{canUseLibreta && (\n\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tdispatch(resetFlow());\n\t\t\t\t\t\t\t\thistory.push(can('canRead.addresses') ? '/direcciones' : '/paquetes');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Libreta

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t)}\n\n\t\t\t\t{(isRootOrAgent || isSeller || isBiller) && (\n\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tdispatch(resetFlow());\n\t\t\t\t\t\t\t\thistory.push('/clientes');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Clientes

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t)}\n\t\t\t\t{isRoot && (\n\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tdispatch(resetFlow());\n\t\t\t\t\t\t\t\thistory.push('/agentes');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Agentes

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t)}\n\t\t\t\t{can('canRead.business') && (\n\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tdispatch(resetFlow());\n\t\t\t\t\t\t\t\tresetBusinessTabs();\n\t\t\t\t\t\t\t\thistory.push('/facturas');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Facturación

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t)}\n\t\t\t\n\t\t),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[\n\t\t\tclasses.rootList,\n\t\t\tlocation.pathname,\n\t\t\tisRootOrAgent,\n\t\t\tisRoot,\n\t\t\tcanUseEnvios,\n\t\t\tcanUseLibreta,\n\t\t\tcan,\n\t\t\thistory,\n\t\t\tdispatch,\n\t\t\tcurrentFlow,\n\t\t\tclasses.homeIcon,\n\t\t\tclasses.label,\n\t\t\tmatchesLG,\n\t\t\tisBiller,\n\t\t\tisSeller,\n\t\t\tresetBusinessTabs\n\t\t]\n\t);\n\n\treturn (\n\t\t\n\t\t\t{/* Mobile */}\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{leftMenu()}\n\t\t\t\t\n\t\t\t\n\n\t\t\t{/* Desktop */}\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{leftMenu()}\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default LDrawer;\n","import { Badge, Button, Divider, IconButton, Menu, MenuItem, Grid } from '@mui/material';\nimport { useState } from 'react';\nimport { Bell as NotificationIcon } from 'react-feather';\nimport { shallow } from 'zustand/shallow';\nimport useNotificationStore from '~store/newstore/useNotificationStore';\n\nexport default function NotificationTopNav() {\n\tconst [notifications, clearNotifications] = useNotificationStore(\n\t\t(state) => [state.notificationsQueue, state.clearNotificationsQueue],\n\t\tshallow\n\t);\n\n\tconst [anchorEl, setAnchorEl] = useState(null);\n\n\tconst handleClick = (event: React.MouseEvent) => {\n\t\tsetAnchorEl(event.currentTarget);\n\t};\n\n\tconst handleClose = (): void => {\n\t\tsetAnchorEl(null);\n\t};\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t{notifications.length ? (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t) : (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\n\t\t\t\n\t\t\t\t{notifications.map((notification, i) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tnotification.callBack?.();\n\t\t\t\t\t\t\t\thandleClose();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{notification.message}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{notification.date.toLocaleString('es-ES')}\n\t\t\t\t\t\t\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t\t{notifications.length > 0 ? (\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tclearNotifications();\n\t\t\t\t\t\t\t\thandleClose();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t) : (\n\t\t\t\t\tNo hay notificaciones\n\t\t\t\t)}\n\t\t\t\n\t\t
\n\t);\n}\n","import React, { useEffect, useState, useMemo, useCallback, useContext } from 'react';\nimport { useHistory, useLocation } from 'react-router-dom';\n\nimport { Grid, TextField } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { Autocomplete } from '@material-ui/lab';\nimport axios from '~util/axios';\nimport { appendOrReplaceValueInUrlParams } from '~util/query';\nimport useQuery from '~hooks/useQuery';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { useDebounce } from 'use-debounce';\n\nimport { CustomerDetails, UserDetails } from '~store/actions/ActionTypes';\nimport { setSimulatedCustomer, setSimulatedUser } from '~store/actions/agents';\nimport { resetSend, resetRate } from '~store/actions';\nimport { RootStore } from '~store/store';\n\nimport DropdownPaper from '~components/Forms/DropdownPaper';\nimport axiosInstance from '~util/axios';\nimport { RouteType, routes } from '../../../Routes';\nimport useWalletStore from '~store/WalletStore';\nimport { shallow } from 'zustand/shallow';\nimport DrawContext from '~context/DrawContext';\nimport useBalanceStore from '~store/useBalanceStore';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\tcontainer: {\n\t\tbackgroundColor: theme.palette.background.default,\n\t\tborderRadius: theme.shape.borderRadius,\n\t\tpadding: `${theme.spacing(1)} 0 !important`,\n\t\t'& input': {\n\t\t\tpadding: `0 !important`\n\t\t}\n\t},\n\tinput: {\n\t\t'&>div:hover': {\n\t\t\tborder: '0.1px solid #4d4d4d !important'\n\t\t}\n\t}\n}));\n\nconst PERMISSIONS_NAME_REF: { [key: string]: number } = {\n\tapp: 0,\n\taddresses: 1,\n\taddress: 1,\n\tpackages: 4,\n\tpackage: 4,\n\tusers: 2,\n\tuser: 2,\n\tgroups: 2,\n\tgroup: 2,\n\trate: 6,\n\tlabel: 3,\n\tpickup: 5,\n\tdispersion: 7,\n\tdisperse: 7,\n\tbusiness: 8,\n\tbilling: 8\n};\n\nconst PERMISSIONS_VALUE_REF: { [key: string]: number } = {\n\tcanRead: 1,\n\tcanCreateUpdateDelete: 2,\n\tnone: 0\n};\n\n/**\n * This component is used when an Agent behaves like a customer\n */\ninterface Props {\n\tdisabled?: boolean;\n\tsetReset?: React.Dispatch>;\n\tmatchRoutes?: boolean;\n}\n\nconst CustomerSelector = ({ disabled, setReset, matchRoutes }: Props) => {\n\tconst classes = useStyles();\n\tconst dispatch = useDispatch();\n\tconst query = useQuery();\n\tconst history = useHistory();\n\tconst location = useLocation();\n\n\tconst { simulatedUser, simulatedCustomer, isTouchedSimulatedUser } = useSelector(\n\t\t(store: RootStore) => store.simulatedUser\n\t);\n\tconst { currentFlow } = useSelector((state: RootStore) => state.flow);\n\tconst { setAvailableBalance, setNotification } = useContext(DrawContext);\n\n\tconst [customers, setCustomers] = useState([]);\n\tconst [customerUsers, setCustomerUsers] = useState(\n\t\tsimulatedCustomer ? simulatedCustomer.users : []\n\t);\n\n\tconst [searchQuery, setSearchQuery] = useState();\n\tconst [debounceCustomer] = useDebounce(searchQuery, 200);\n\n\tconst setCurrentBusiness = useWalletStore((state) => state.setCurrentBusiness, shallow);\n\tconst { customerHasBalance } = useBalanceStore();\n\n\tconst currentRoute = useMemo(\n\t\t() =>\n\t\t\troutes\n\t\t\t\t.filter((item) => item.path !== '/')\n\t\t\t\t?.find((route) => {\n\t\t\t\t\tconst path = route.path?.includes(':')\n\t\t\t\t\t\t? route.path?.slice(0, route.path.indexOf(':') - 1)\n\t\t\t\t\t\t: route.path;\n\t\t\t\t\treturn history.location.pathname?.includes(path);\n\t\t\t\t}),\n\t\t[history.location.pathname]\n\t);\n\tconst isFormWithAutocompleteFields = useMemo(\n\t\t() => currentRoute?.path.includes('manual'),\n\t\t[currentRoute]\n\t);\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (!debounceCustomer) return;\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.get(`/api/customers?query=${debounceCustomer}`);\n\t\t\t\tsetCustomers(data.data);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('customer selector index error', error);\n\t\t\t}\n\t\t})();\n\t}, [debounceCustomer]);\n\n\t// Fetch customer balance\n\tconst getCustomerBalance = useCallback(\n\t\tasync (customer: CustomerDetails) => {\n\t\t\ttry {\n\t\t\t\tconst { data } = await axiosInstance.get(\n\t\t\t\t\t`/api/dispersion/balance?customer_id=${customer.id}`\n\t\t\t\t);\n\t\t\t\tsetAvailableBalance(data.remaining);\n\t\t\t} catch (error) {\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'Hubo un error al obtener el saldo disponible del cliente',\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[setAvailableBalance]\n\t);\n\n\t// Fetch services and set customer\n\tconst getCustomer = useCallback(\n\t\tasync (customer: CustomerDetails) => {\n\t\t\ttry {\n\t\t\t\tconst { data } = await axiosInstance.get(`/api/customer/${customer.id}`);\n\t\t\t\tdispatch(setSimulatedCustomer({ ...customer, ...data }));\n\t\t\t\tif (customerHasBalance(data)) {\n\t\t\t\t\tawait getCustomerBalance(data);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tdispatch(setSimulatedCustomer(customer));\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[getCustomerBalance]\n\t);\n\n\t// Get user for a customer\n\tconst getCustomerUsers = useCallback(async (customerId: number) => {\n\t\ttry {\n\t\t\tconst { data } = await axiosInstance.get(`/api/users?customer_id=${customerId}`);\n\t\t\tconst usersWithPermissions = usersPermissions(data.data, currentRoute);\n\t\t\tsetCustomerUsers(usersWithPermissions);\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t\tsetCustomerUsers([]);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Fetch\n\tconst getUserBalance = useCallback(\n\t\tasync (user: UserDetails) => {\n\t\t\ttry {\n\t\t\t\tconst { data } = await axiosInstance.get(\n\t\t\t\t\t`/api/dispersion/balance/users?customer_id=${simulatedCustomer?.id}`\n\t\t\t\t);\n\t\t\t\tconst userBalance = data.data?.find((item: any) => item.user_id === user.id)?.remaining;\n\t\t\t\tsetAvailableBalance(userBalance ?? 0);\n\t\t\t} catch (error) {\n\t\t\t\tsetNotification({\n\t\t\t\t\tmessage: 'Hubo un error al obtener el saldo disponible del usuario',\n\t\t\t\t\tseverity: 'error'\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[simulatedCustomer, setAvailableBalance]\n\t);\n\n\t// Add to query params the current simulated user\n\t// useEffect(() => {\n\t// \tif (!simulatedUser || query.has('user_id') || !!matchRoutes) {\n\t// \t\treturn;\n\t// \t}\n\t// \t// Wait so that it does not delete necessary parameters\n\t// \t(async () =>\n\t// \t\tsetTimeout(() => {\n\t// \t\t\tconst params = appendOrReplaceValueInUrlParams(query, 'user_id', simulatedUser.id);\n\t// \t\t\thistory.replace(`${history.location.pathname}?${params}`);\n\t// \t\t}, 2000))();\n\t// \t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, [simulatedUser, history, matchRoutes]);\n\n\tuseEffect(() => {\n\t\tif (!!simulatedUser && !simulatedCustomer?.id) {\n\t\t\tconst customerData = customers.find((item) => item.id === simulatedUser.customer?.id);\n\t\t\tcustomerData && dispatch(setSimulatedCustomer(customerData));\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [simulatedUser, simulatedCustomer, customers]);\n\n\tuseEffect(() => {\n\t\tif (!customerUsers?.find((item) => item.id === simulatedUser?.id)) {\n\t\t\tdispatch(setSimulatedUser(null));\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [customerUsers, simulatedUser?.id]);\n\n\t// useEffect(() => {\n\t// \tif (!simulatedCustomer || query.has('customer_id') || !!matchRoutes) {\n\t// \t\treturn;\n\t// \t}\n\n\t// \t// Wait so that it does not delete necessary parameters\n\t// \t(async () =>\n\t// \t\tsetTimeout(() => {\n\t// \t\t\tconst params = appendOrReplaceValueInUrlParams(query, 'customer_id', simulatedCustomer.id);\n\t// \t\t\thistory.replace(`${history.location.pathname}?${params}`);\n\t// \t\t}, 2000))();\n\t// \t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, [simulatedCustomer, history, matchRoutes]);\n\n\t// Check users permissions for route\n\tconst usersPermissions = useCallback((users: UserDetails[], route?: RouteType) => {\n\t\treturn users?.filter((item: UserDetails) => {\n\t\t\tconst routeItemParts = route?.permissionKey.split('.') ?? [];\n\t\t\tconst permissionModule = PERMISSIONS_NAME_REF[routeItemParts[1] ?? 'app'];\n\t\t\tconst permissionType = PERMISSIONS_VALUE_REF[routeItemParts[0] ?? 'none'];\n\n\t\t\treturn parseInt(item.permissions[permissionModule]) >= permissionType;\n\t\t});\n\t}, []);\n\n\t// Set only users with route permissions when location changes\n\tuseEffect(() => {\n\t\tif (!simulatedCustomer) {\n\t\t\tsetCustomers([]);\n\t\t\treturn;\n\t\t}\n\t\tif (simulatedCustomer?.modality === 'sc') {\n\t\t\tsetCustomerUsers(simulatedCustomer?.users);\n\t\t} else {\n\t\t\tconst usersWithPermissions = usersPermissions(simulatedCustomer?.users, currentRoute);\n\t\t\tusersWithPermissions && setCustomerUsers(usersWithPermissions);\n\t\t}\n\t}, [currentRoute, simulatedCustomer, usersPermissions]);\n\n\tuseEffect(() => {\n\t\tif (!!simulatedCustomer?.id && !customerUsers?.length) {\n\t\t\tgetCustomerUsers(simulatedCustomer.id);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [simulatedCustomer, getCustomerUsers]);\n\n\tif (!!matchRoutes) {\n\t\treturn
;\n\t}\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t option.business_name.toUpperCase()}\n\t\t\t\t\tgetOptionSelected={(option, value) => value && option.id === value.id}\n\t\t\t\t\tvalue={simulatedCustomer}\n\t\t\t\t\tonChange={async (_: any, value: CustomerDetails | null) => {\n\t\t\t\t\t\tif (value) {\n\t\t\t\t\t\t\tconst response = await axiosInstance.get(`/api/users?customer_id=${value.id}`);\n\n\t\t\t\t\t\t\t// Set only users with current route permissions\n\t\t\t\t\t\t\tconst usersWithPermissions = usersPermissions(response.data.data, currentRoute);\n\t\t\t\t\t\t\tsetCustomerUsers(usersWithPermissions);\n\t\t\t\t\t\t\tawait getCustomer(value);\n\n\t\t\t\t\t\t\tif (setReset) {\n\t\t\t\t\t\t\t\tsetReset(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// clear customer users\n\t\t\t\t\t\t\tsetCustomerUsers([]);\n\t\t\t\t\t\t\tsetAvailableBalance(null);\n\t\t\t\t\t\t\tif (setReset) {\n\t\t\t\t\t\t\t\tsetReset(true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdispatch(setSimulatedCustomer(value));\n\t\t\t\t\t\t\tsetCurrentBusiness(null);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (currentFlow === 'send') {\n\t\t\t\t\t\t\tdispatch(resetSend());\n\t\t\t\t\t\t} else if (currentFlow === 'rate') {\n\t\t\t\t\t\t\tdispatch(resetRate());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdispatch(setSimulatedUser(null));\n\t\t\t\t\t}}\n\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t setSearchQuery(e.target.value)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t/>\n\t\t\t\n\n\t\t\t{/* Selected UserForm */}\n\t\t\t\n\t\t\t\t{location.pathname !== '/pagos' && (\n\t\t\t\t\t `${option.first_name} ${option.last_name}`}\n\t\t\t\t\t\tgetOptionSelected={(option, value) => option?.id === value?.id}\n\t\t\t\t\t\tvalue={simulatedUser}\n\t\t\t\t\t\tonChange={async (_, value) => {\n\t\t\t\t\t\t\tif (value) {\n\t\t\t\t\t\t\t\t// TODO should be part of the get customer\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tconst result = await axios.get(`/api/user/${value.id}`);\n\t\t\t\t\t\t\t\t\tdispatch(setSimulatedUser(result.data));\n\t\t\t\t\t\t\t\t\tif (setReset) {\n\t\t\t\t\t\t\t\t\t\tsetReset(false);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (result.data?.customer?.balance) {\n\t\t\t\t\t\t\t\t\t\tawait getUserBalance(value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\t\tdispatch(setSimulatedUser(null));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdispatch(setSimulatedUser(null));\n\t\t\t\t\t\t\t\tsetAvailableBalance(null);\n\t\t\t\t\t\t\t\tif (setReset) {\n\t\t\t\t\t\t\t\t\tsetReset(true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\trenderInput={(params) => (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tPaperComponent={(paperProps) => {paperProps.children}}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\n\t\t\n\t);\n};\n\nexport default CustomerSelector;\n","import { alpha } from '@material-ui/core/styles';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\n\nexport const useStyles = makeStyles((theme: Theme) => ({\n\tgrow: {\n\t\t//flexGrow: 1,\n\t\tzIndex: 1100\n\t},\n\thelpButton: {\n\t\ttextTransform: 'capitalize',\n\t\tcolor: 'white',\n\t\tborderRadius: 20,\n\t\theight: 44,\n\t\tmarginTop: 10,\n\t\tmarginRight: 10\n\t},\n\tmenuButton: {\n\t\tmarginRight: theme.spacing(2),\n\t\t[theme.breakpoints.up('md')]: {\n\t\t\tdisplay: 'none'\n\t\t}\n\t},\n\tbrand: {\n\t\t//flexGrow: 0.8,\n\t\tdisplay: 'none',\n\t\t[theme.breakpoints.up('sm')]: {\n\t\t\tdisplay: 'block',\n\t\t\tzIndex: 1100\n\t\t}\n\t},\n\tsearch: {\n\t\tposition: 'relative',\n\t\tborderRadius: theme.spacing(3),\n\t\tbackgroundColor: alpha(theme.palette.common.white, 0.15),\n\t\t'&:hover': {\n\t\t\tbackgroundColor: alpha(theme.palette.common.white, 0.25)\n\t\t},\n\t\tmarginLeft: 0,\n\t\twidth: '100%',\n\t\t[theme.breakpoints.up('sm')]: {\n\t\t\tmarginLeft: theme.spacing(1),\n\t\t\twidth: '500px'\n\t\t}\n\t},\n\tsearchIcon: {\n\t\tpadding: theme.spacing(0, 2),\n\t\theight: '100%',\n\t\tposition: 'absolute',\n\t\tpointerEvents: 'none',\n\t\tdisplay: 'flex',\n\t\talignItems: 'center',\n\t\tjustifyContent: 'center'\n\t},\n\tinputRoot: {\n\t\tcolor: 'inherit'\n\t},\n\tinputInput: {\n\t\theight: 30,\n\t\tpadding: theme.spacing(1, 1, 1, 0),\n\t\t// vertical padding + font size from searchIcon\n\t\tpaddingLeft: `calc(1em + ${theme.spacing(4)})`,\n\t\ttransition: theme.transitions.create('width'),\n\t\twidth: '100%',\n\t\t[theme.breakpoints.up('md')]: {\n\t\t\twidth: '20ch'\n\t\t}\n\t},\n\tsectionDesktop: {\n\t\tdisplay: 'none',\n\t\t[theme.breakpoints.up('md')]: {\n\t\t\tdisplay: 'flex'\n\t\t}\n\t},\n\tsectionMobile: {\n\t\tdisplay: 'flex',\n\t\t[theme.breakpoints.up('md')]: {\n\t\t\tdisplay: 'none'\n\t\t}\n\t},\n\tappBar: {\n\t\tbackgroundColor: '#181818 !important',\n\t\tbackgroundImage: 'none',\n\t\tboxShadow: 'none',\n\t\t'&>div': {\n\t\t\tdisplay: 'flex',\n\t\t\talignItems: 'center',\n\t\t\tminHeight: '72px'\n\t\t}\n\t},\n\tavatar: {\n\t\tbackgroundColor: theme.palette.primary.main,\n\t\tcolor: theme.palette.background.default\n\t},\n\tcustomerSelector: {\n\t\twidth: '100%'\n\t},\n\tbalanceData: {\n\t\tmarginRight: theme.spacing(1),\n\t\tdisplay: 'flex',\n\t\talignItems: 'flex-start',\n\t\t// color: theme.palette.primary.main,\n\t\t'& svg': {\n\t\t\tmarginRight: theme.spacing(1),\n\t\t\tfontSize: '20px'\n\t\t},\n\t\t'& p': {\n\t\t\tfontWeight: 'bold'\n\t\t}\n\t},\n\tdivider: {\n\t\tbackgroundColor: 'rgba(255, 255, 255, 0.12)'\n\t}\n}));\n","import React, { useContext, useCallback, useMemo, useEffect } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { Link, useHistory, useRouteMatch } from 'react-router-dom';\nimport {\n\tAppBar,\n\tAvatar,\n\tToolbar,\n\tIconButton,\n\tMenuItem,\n\tMenu,\n\tTooltip,\n\tDivider\n} from '@mui/material';\nimport { Menu as MenuIcon, MoreVertical as MoreIcon } from 'react-feather';\n\nimport NotificationTopNav from '../TopNavComponents/NotificationTopNav';\nimport CustomerSelector from '~components/Inputs/CustomerSelector';\n\nimport { useStyles } from './styles';\nimport AuthContext from '~context/AuthContext';\nimport DrawContext from '~context/DrawContext';\nimport { resetFlow } from '~store/actions';\nimport usePermissions from '~hooks/usePermissions';\nimport instanceAPI, { instanceRate, instancePayment } from '~util/axios';\nimport logo from '~assets/logo.svg';\nimport useNotificationStore from '~store/newstore/useNotificationStore';\nimport { shallow } from 'zustand/shallow';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faWallet } from '@fortawesome/free-solid-svg-icons';\nimport { TextOne } from '~components/Headings';\nimport { formatPrice } from '~util/formatPrice';\nimport { useSelector } from '~store/store';\nimport useBalanceStore from '~store/useBalanceStore';\nimport { getUserBalance } from '~store/actions/DataActions';\n\ninterface Props {\n\tcurrentTheme: boolean;\n\ttoggleTheme: () => void;\n}\n\nconst TopNav: React.FC = (props) => {\n\tconst classes = useStyles();\n\tconst history = useHistory();\n\n\tconst { setAuth, currentUser, clearUser } = useContext(AuthContext);\n\tconst { toggleLeftDrawer, showBarLogo, availableBalance, setAvailableBalance } =\n\t\tuseContext(DrawContext);\n\tconst { isCustomer, isRootOrAgent, isSeller } = usePermissions();\n\tconst { simulatedCustomer, simulatedUser } = useSelector((state) => state.simulatedUser);\n\tconst dispatch = useDispatch();\n\n\tlet matchClients = useRouteMatch('/clientes');\n\tlet matchClient = useRouteMatch('/cliente');\n\tlet matchAgent = useRouteMatch('/agente');\n\tlet matchAgents = useRouteMatch('/agentes');\n\tlet matchOrder = useRouteMatch('/orden');\n\tlet matchSummary = useRouteMatch('/resultados');\n\tlet matchRate = useRouteMatch('/tarifas');\n\tlet matchFiscalForm = useRouteMatch('/razon-social');\n\tlet matchFiscalSummary = useRouteMatch('/resumen-razon-social');\n\tlet matchGroupForm = useRouteMatch('/grupo');\n\tlet matchProspects = useRouteMatch('/prospectos');\n\tlet matchProspect = useRouteMatch('/prospecto');\n\tlet matchDispersion = useRouteMatch('/dispersion');\n\n\tconst matchRoutes = useMemo(\n\t\t() =>\n\t\t\tBoolean(\n\t\t\t\tmatchClients ||\n\t\t\t\t\tmatchAgents ||\n\t\t\t\t\tmatchOrder ||\n\t\t\t\t\tmatchSummary ||\n\t\t\t\t\tmatchAgent ||\n\t\t\t\t\tmatchClient ||\n\t\t\t\t\tmatchRate ||\n\t\t\t\t\tmatchFiscalForm ||\n\t\t\t\t\tmatchFiscalSummary ||\n\t\t\t\t\tmatchGroupForm ||\n\t\t\t\t\tmatchProspects ||\n\t\t\t\t\tmatchProspect ||\n\t\t\t\t\tmatchDispersion ||\n\t\t\t\t\thistory.location.pathname === '/'\n\t\t\t),\n\t\t[\n\t\t\tmatchClients,\n\t\t\tmatchAgents,\n\t\t\tmatchOrder,\n\t\t\tmatchSummary,\n\t\t\tmatchAgent,\n\t\t\tmatchClient,\n\t\t\tmatchRate,\n\t\t\tmatchFiscalForm,\n\t\t\tmatchFiscalSummary,\n\t\t\tmatchGroupForm,\n\t\t\tmatchProspects,\n\t\t\tmatchProspect,\n\t\t\tmatchDispersion,\n\t\t\thistory.location.pathname\n\t\t]\n\t);\n\n\tconst [anchorEl, setAnchorEl] = React.useState(null);\n\tconst [mobileMoreAnchorEl, setMobileMoreAnchorEl] = React.useState(null);\n\tconst { customerHasBalance } = useBalanceStore();\n\n\tconst isMenuOpen = Boolean(anchorEl);\n\tconst isMobileMenuOpen = Boolean(mobileMoreAnchorEl);\n\n\tconst handleProfileMenuOpen = (event: React.MouseEvent) => {\n\t\tsetAnchorEl(event.currentTarget);\n\t};\n\n\tconst handleMobileMenuClose = () => {\n\t\tsetMobileMoreAnchorEl(null);\n\t};\n\n\tconst handleMenuClose = () => {\n\t\tsetAnchorEl(null);\n\t\thandleMobileMenuClose();\n\t};\n\n\tconst handleMobileMenuOpen = (event: React.MouseEvent) => {\n\t\tsetMobileMoreAnchorEl(event.currentTarget);\n\t};\n\n\tconst [clearNotifications] = useNotificationStore(\n\t\t(state) => [state.clearNotificationsQueue],\n\t\tshallow\n\t);\n\n\tuseEffect(() => {\n\t\tif (customerHasBalance(isRootOrAgent ? simulatedCustomer : currentUser?.customer)) {\n\t\t\tgetUserBalance(isRootOrAgent, setAvailableBalance, simulatedCustomer?.id);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [availableBalance, currentUser, simulatedCustomer, isRootOrAgent]);\n\n\tconst menuTop = useCallback(() => {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t{currentUser.name}\n\t\t\t\t\n\t\t\t\t{/* {isCustomer && (\n\t\t\t\t\t {\n\t\t\t\t\t\t\thistory.push(`/cliente/datos/${currentUser?.customer?.id}`);\n\t\t\t\t\t\t\thandleMenuClose();\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tEmpresa\n\t\t\t\t\t\n\t\t\t\t)} */}\n\t\t\t\t{!isRootOrAgent && isCustomer && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\thistory.push('/perfil/datos');\n\t\t\t\t\t\t\t\thandleMenuClose();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tDatos generales\n\t\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\thistory.push('/perfil/tarifas');\n\t\t\t\t\t\t\t\thandleMenuClose();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tTarifas\n\t\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\thistory.push('/perfil/documentos');\n\t\t\t\t\t\t\t\thandleMenuClose();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tDocumentos\n\t\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\thistory.push('/perfil/contrato');\n\t\t\t\t\t\t\t\thandleMenuClose();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tContrato\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t{/* {\n\t\t\t\t\t\thistory.push('/tutoriales');\n\t\t\t\t\t\thandleMenuClose();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\tTutoriales\n\t\t\t\t */}\n\t\t\t\t\n\t\t\t\t {\n\t\t\t\t\t\tdelete instanceAPI.defaults.headers.common['Authorization'];\n\t\t\t\t\t\tdelete instanceRate.defaults.headers.common['Authorization'];\n\t\t\t\t\t\tdelete instancePayment.defaults.headers.common['Authorization'];\n\t\t\t\t\t\tlocalStorage.removeItem('auth');\n\t\t\t\t\t\tsetAuth(false);\n\t\t\t\t\t\tclearNotifications();\n\t\t\t\t\t\tclearUser();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\tSalir\n\t\t\t\t\n\t\t\t
\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [history, setAuth, clearUser, isCustomer]);\n\n\tconst userMenu = (\n\t\t\n\t\t\t{menuTop()}\n\t\t\n\t);\n\n\tconst renderMobileMenu = (\n\t\t\n\t\t\t{menuTop()}\n\t\t\n\t);\n\n\t// Top Nav\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t toggleLeftDrawer()}\n\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
dispatch(resetFlow())}>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t{/* Simulated customer and user for roots or agents */}\n\t\t\t\t\t\t{(isRootOrAgent || isSeller) && }\n\t\t\t\t\t
\n\t\t\t\t\t{/* Available balance */}\n\t\t\t\t\t{((!isRootOrAgent && customerHasBalance(currentUser?.customer)) ||\n\t\t\t\t\t\t(isRootOrAgent && customerHasBalance(simulatedUser?.customer ?? simulatedCustomer))) &&\n\t\t\t\t\t\tavailableBalance !== null && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t)}\n\t\t\t\t\t
\n\t\t\t\t\t\t{/* Notification */}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{currentUser.name.charAt(0)}\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t{renderMobileMenu}\n\t\t\t{userMenu}\n\t\t
\n\t);\n};\n\nexport default TopNav;\n","import React, { useEffect } from 'react';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport {\n\tAccordion,\n\tAccordionDetails,\n\tAccordionSummary,\n\tTypography,\n\tDivider,\n\tGrid\n} from '@mui/material';\nimport { ChevronDown as ExpandMoreIcon } from 'react-feather';\nimport { useSelector } from 'react-redux';\nimport { RootStore } from '../../store/store';\nimport AddressSummaryCard from '../Cards/AddressSummaryCard';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\twidth: '100%',\n\t\tbackgroundColor: theme.palette.background.default,\n\t\t'&>*': {\n\t\t\tbackgroundColor: 'transparent !important',\n\t\t\tboxShadow: 'none'\n\t\t}\n\t},\n\theading: {\n\t\tfontSize: theme.typography.pxToRem(15)\n\t\t// flexBasis: '33.33%',\n\t\t// flexShrink: 0,\n\t},\n\tsecondaryHeading: {\n\t\tfontSize: theme.typography.pxToRem(15),\n\t\tcolor: theme.palette.text.secondary\n\t},\n\taddressCard: {\n\t\t'& div': {\n\t\t\tbackgroundColor: 'transparent !important'\n\t\t}\n\t}\n}));\n\nconst AddressCollapse = () => {\n\tconst classes = useStyles();\n\n\tconst { currentFlow } = useSelector((state: RootStore) => state.flow);\n\tconst { originAddressSend, destinationAddressSend, currentPackagesSend } = useSelector(\n\t\t(state: RootStore) => state.send\n\t);\n\tconst { originAddressRate, destinationAddressRate, currentPackagesRate } = useSelector(\n\t\t(state: RootStore) => state.rate\n\t);\n\tconst { addressPickUp } = useSelector((state: RootStore) => state.pickup);\n\n\tconst [expanded, setExpanded] = React.useState(false);\n\n\t// ===== pickup\n\tuseEffect(() => {\n\t\tif (addressPickUp && currentFlow === 'pickup') {\n\t\t\tsetExpanded('panel1');\n\t\t}\n\t}, [addressPickUp, currentFlow]);\n\n\t// ======== Rate\n\tuseEffect(() => {\n\t\tif (originAddressRate && currentFlow === 'rate') {\n\t\t\tsetExpanded('panel1');\n\t\t}\n\t}, [originAddressRate, currentFlow]);\n\n\tuseEffect(() => {\n\t\tif (destinationAddressRate && currentFlow === 'rate') {\n\t\t\tsetExpanded('panel2');\n\t\t}\n\t}, [destinationAddressRate, currentFlow]);\n\n\tuseEffect(() => {\n\t\tif (currentPackagesRate.length > 0 && currentFlow === 'rate') {\n\t\t\tsetExpanded('panel3');\n\t\t}\n\t}, [currentPackagesRate.length, currentFlow]);\n\n\t// ======= Send\n\n\tuseEffect(() => {\n\t\tif (originAddressSend && currentFlow === 'send') {\n\t\t\tsetExpanded('panel1');\n\t\t}\n\t}, [originAddressSend, currentFlow]);\n\n\tuseEffect(() => {\n\t\tif (destinationAddressSend && currentFlow === 'send') {\n\t\t\tsetExpanded('panel2');\n\t\t}\n\t}, [destinationAddressSend, currentFlow]);\n\n\tuseEffect(() => {\n\t\tif (currentPackagesSend.length > 0 && currentFlow === 'send') {\n\t\t\tsetExpanded('panel3');\n\t\t}\n\t}, [currentPackagesSend.length, currentFlow]);\n\n\tconst handleChange = (panel: string) => (event: React.ChangeEvent<{}>, isExpanded: boolean) => {\n\t\tsetExpanded(isExpanded ? panel : false);\n\t};\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t}>\n\t\t\t\t\t\n\t\t\t\t\t\tDirección {currentFlow !== 'pickup' ? 'Origen' : null}\n\t\t\t\t\t\n\t\t\t\t\t{/* I am an accordion */}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{originAddressSend && currentFlow === 'send' && (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\t{originAddressRate && currentFlow === 'rate' && (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\t{addressPickUp && currentFlow === 'pickup' && (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t\n\t\t\t{currentFlow !== 'pickup' && (\n\t\t\t\t\n\t\t\t\t\t}>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tDirección Destino\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{destinationAddressSend && currentFlow === 'send' && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{destinationAddressRate && currentFlow === 'rate' && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\t{currentFlow !== 'pickup' && (\n\t\t\t\t\n\t\t\t\t\t}>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tEmpaques\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{(currentFlow === 'send' ? currentPackagesSend : currentPackagesRate).map((p, i) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tPaquete #{i + 1}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{p.quantity} - {`${p.alias ? p.alias : 'Artículo'}`}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{`${p.length}x${p.width}x${p.height} `} | {Math.ceil(p.weight)} Kg\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t
\n\t);\n};\n\nexport default AddressCollapse;\n","import React, { useEffect, useRef } from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { CircularProgress } from '@mui/material';\nimport {\n\tsetGoogleMap,\n\tsetGoogleMapsDestinationMarker,\n\tsetGoogleMapsMarker,\n\tsetGoogleMapsPolyline,\n\tsetGoogleMapsScriptStatus,\n\tsetMapCoordinates\n} from '../../store/actions';\nimport { RootStore } from '../../store/store';\nimport loadGMaps from '~js-scripts/loadGMaps';\n\nconst Maps: React.FC = () => {\n\t/**\n\t * Google Maps Scripts\n\t */\n\tconst dispatch = useDispatch();\n\tconst {\n\t\tisLoadedGoogleMapsScript,\n\t\taddressCoordinates,\n\t\tmap,\n\t\tmarker,\n\t\tdestinationCoordinates,\n\t\tdestinationMarker,\n\t\tpathPolyline\n\t} = useSelector((state: RootStore) => state.app);\n\n\tconst mapsDivRef = useRef(null);\n\n\t// Load google maps script\n\tuseEffect(() => {\n\t\tif (!isLoadedGoogleMapsScript) {\n\t\t\tloadGMaps(() => dispatch(setGoogleMapsScriptStatus(true)));\n\t\t}\n\t}, [isLoadedGoogleMapsScript, dispatch]);\n\n\t// Mount the Map\n\tuseEffect(() => {\n\t\tif (isLoadedGoogleMapsScript && mapsDivRef) {\n\t\t\t//console.log('mounting map');\n\t\t\tdispatch(\n\t\t\t\tsetGoogleMap(\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tnew window.google.maps.Map(mapsDivRef.current, {\n\t\t\t\t\t\tcenter: { lat: 23.634501, lng: -102.552784 },\n\t\t\t\t\t\tzoom: 5,\n\t\t\t\t\t\tgestureHandling: 'cooperative' //enable crtl on scroll\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}, [isLoadedGoogleMapsScript, dispatch]);\n\n\t// Create the marker and listen for coordinates\n\tuseEffect(() => {\n\t\tif (!map) return;\n\t\t// Create the marker\n\t\tif (!marker) {\n\t\t\tdispatch(\n\t\t\t\tsetGoogleMapsMarker(\n\t\t\t\t\tnew google.maps.Marker({\n\t\t\t\t\t\tmap,\n\t\t\t\t\t\tanchorPoint: new google.maps.Point(0, -29),\n\t\t\t\t\t\tanimation: google.maps.Animation.DROP,\n\t\t\t\t\t\tdraggable: true,\n\t\t\t\t\t\tcrossOnDrag: true\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Simple Marker\n\t\tif (addressCoordinates) {\n\t\t\tif (destinationCoordinates) {\n\t\t\t\tmarker.setDraggable(false);\n\t\t\t\tmap.setZoom(11);\n\t\t\t} else {\n\t\t\t\tmarker.setDraggable(true);\n\t\t\t\tmap.setZoom(17);\n\t\t\t}\n\t\t\t// Marker\n\t\t\tmap.setCenter(addressCoordinates);\n\t\t\tmarker.setPosition(addressCoordinates);\n\t\t}\n\n\t\t// Listen for the destination marker\n\t\tif (destinationCoordinates) {\n\t\t\tif (!destinationMarker) {\n\t\t\t\tdispatch(\n\t\t\t\t\tsetGoogleMapsDestinationMarker(\n\t\t\t\t\t\tnew google.maps.Marker({\n\t\t\t\t\t\t\tmap,\n\t\t\t\t\t\t\tanimation: google.maps.Animation.DROP\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!pathPolyline) {\n\t\t\t\tdispatch(\n\t\t\t\t\tsetGoogleMapsPolyline(\n\t\t\t\t\t\tnew google.maps.Polyline({\n\t\t\t\t\t\t\tpath: [destinationCoordinates, addressCoordinates!],\n\t\t\t\t\t\t\tgeodesic: true,\n\t\t\t\t\t\t\tstrokeColor: '#FF0000',\n\t\t\t\t\t\t\tstrokeOpacity: 1.0,\n\t\t\t\t\t\t\tstrokeWeight: 2\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdestinationMarker.setPosition(destinationCoordinates);\n\t\t\tpathPolyline.setMap(map);\n\t\t}\n\t}, [\n\t\taddressCoordinates,\n\t\tmap,\n\t\tdispatch,\n\t\tmarker,\n\t\tdestinationCoordinates,\n\t\tdestinationMarker,\n\t\tpathPolyline\n\t]);\n\n\tuseEffect(() => {\n\t\tif (!marker) return;\n\t\tgoogle.maps.event.addListener(marker, 'dragend', function (evt) {\n\t\t\tdispatch(setMapCoordinates({ lat: evt.latLng.lat(), lng: evt.latLng.lng() }));\n\t\t});\n\t}, [marker, dispatch]);\n\n\t// Clean the map\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\t//console.log('cleaned up map');\n\t\t\tdispatch(setGoogleMap(null));\n\t\t\tdispatch(setGoogleMapsMarker(null));\n\t\t\tdispatch(setGoogleMapsDestinationMarker(null));\n\t\t\tdispatch(setGoogleMapsPolyline(null));\n\t\t};\n\t}, [dispatch]);\n\n\tif (!isLoadedGoogleMapsScript) {\n\t\treturn ;\n\t}\n\n\treturn
;\n};\n\nexport default Maps;\n","import React, { useContext, useRef, useEffect } from 'react';\nimport { Card } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\nimport DrawContext from '../../context/DrawContext';\n\nimport AddressCollapse from '../ContentForCard/AddressCollapse';\nimport Map from '../Maps/Map';\nimport clsx from 'clsx';\n\nconst useStyles = makeStyles({\n\troot: {\n\t\tmaxHeight: 490,\n\t\theight: '80%',\n\t\twidth: 290,\n\t\tmarginBottom: '10%',\n\t\tmarginTop: 20,\n\t\tmarginRight: 20,\n\t\tborderRadius: 14,\n\t\tpadding: 0,\n\t\toverflow: 'auto',\n\t\toverflowX: 'hidden',\n\t\tbackgroundColor: '#181818 !important'\n\t}\n});\n\nconst RCard: React.FC = () => {\n\tconst { rCardStatus } = useContext(DrawContext);\n\n\t// FIX to the error of the carousel\n\tconst mounted = useRef(true);\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tmounted.current = false;\n\t\t};\n\t}, []);\n\n\tconst classes = useStyles();\n\treturn (\n\t\t\n\t\t\t{rCardStatus === 'MAPS' && }\n\t\t\t{rCardStatus === 'SUMMARY_ADDRESS' && }\n\t\t\n\t);\n};\n\nexport default RCard;\n","import React from 'react';\nimport { makeStyles } from '@mui/styles';\nimport { Theme } from '@mui/material/styles';\nimport { Box, Drawer } from '@mui/material';\nimport RCard from '../Cards/RCard';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\tmobileContainer: {\n\t\t[theme.breakpoints.down('xs')]: {\n\t\t\tdisplay: 'block'\n\t\t},\n\t\t[theme.breakpoints.up('xs')]: {\n\t\t\tdisplay: 'none'\n\t\t}\n\t},\n\tdesktopContainer: {\n\t\t[theme.breakpoints.down('lg')]: {\n\t\t\tdisplay: 'none'\n\t\t},\n\t\t[theme.breakpoints.up('lg')]: {\n\t\t\tdisplay: 'block'\n\t\t}\n\t},\n\tpaperRightDrawer: {\n\t\tbackground: `${theme.palette.background.default} !important`,\n\t\tcolor: `${theme.palette.white.main} !important`,\n\t\ttop: '10%',\n\t\theight: '90%',\n\t\tborder: 'none',\n\t\t'& > div': {\n\t\t\tboxShadow: 'none'\n\t\t}\n\t},\n\trightDrawButton: {\n\t\tposition: 'fixed',\n\t\tright: 0,\n\t\t//bottom: '50%'\n\t\ttop: '12%',\n\t\tmaxHeight: 490,\n\t\theight: '80%',\n\t\tbackgroundColor: theme.palette.background.paper,\n\t\tborderRadius: '14px 0 0 14px'\n\t}\n}));\n\n/**\n * Menú de la derecha\n */\n\nconst RDrawer: React.FC = () => {\n\tconst classes = useStyles();\n\n\t// const { mobileRigthDrawerStatus, toggleRightDrawer } = useContext(DrawContext);\n\n\treturn (\n\t\t\n\t\t\t{/* Laptop */}\n\t\t\t{/* \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t */}\n\n\t\t\t{/* Desktop */}\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default RDrawer;\n","import React, { useContext, useEffect } from 'react';\nimport { Snackbar } from '@mui/material';\nimport { Alert } from '@mui/lab';\nimport { useDispatch } from 'react-redux';\n\nimport { useSelector } from '~store/store';\nimport DrawContext from '../../context/DrawContext';\nimport { RootStore } from '../../store/store';\nimport { clearError } from '../../store/actions';\n\nconst SnackBarToast: React.FC = () => {\n\tconst dispatch = useDispatch();\n\tconst { notification, setNotification, showNotification, setShowNotification } =\n\t\tuseContext(DrawContext);\n\tconst { errorMessageData } = useSelector((state: RootStore) => state.data);\n\n\t// Listen for error message\n\tuseEffect(() => {\n\t\tif (errorMessageData.length > 1) {\n\t\t\t// setNotification({ message: errorMessageData });\n\t\t\tdispatch(clearError());\n\t\t}\n\t}, [dispatch, errorMessageData, setNotification, setShowNotification]);\n\n\tuseEffect(() => {\n\t\tif (notification?.message.length > 0) {\n\t\t\tsetShowNotification(true);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [notification]);\n\n\tconst handleClose = (_?: Event | React.SyntheticEvent, reason?: string) => {\n\t\tif (reason === 'clickaway') {\n\t\t\treturn;\n\t\t}\n\t\tsetShowNotification(false);\n\t\tsetNotification({ message: '' });\n\t};\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t{notification?.message}\n\t\t\t\n\t\t\n\t);\n};\n\nexport default SnackBarToast;\n","import React from 'react';\nimport { styled } from '@material-ui/core/styles';\nimport Button, { ButtonProps } from '@material-ui/core/Button';\nimport { Omit } from '@material-ui/types';\n\ninterface MyButtonProps {\n\tcolor: 'red' | 'blue';\n}\n\nconst GradientButton = styled(\n\t({ color, ...other }: MyButtonProps & Omit) => (\n\t\t\n\t\t);\n\t}, [show, styles, toggle]);\n\n\treturn (\n\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t{icon}\n\t\t\t\t
\n\t\t\t}\n\t\t\tcontrol={control}\n\t\t\tdefaultValue=''\n\t\t/>\n\t);\n}\n","import { Grid } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport React from 'react';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tcolor: '#FFFFFF50',\n\t\tfontSize: '0.75rem'\n\t}\n}));\n\nconst CopyRight: React.FC = () => {\n\tconst classes = useStyles();\n\treturn (\n\t\t\n\t\t\t© 2021 Encamino SA de CV. Todos los derechos reservados.\n\t\t\n\t);\n};\n\nexport default CopyRight;\n","import React, { useContext, useState } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { useForm, Controller } from 'react-hook-form';\nimport { useHistory } from 'react-router-dom';\nimport {\n\tCheckbox,\n\tButton,\n\tFormControlLabel,\n\tGrid,\n\tTextField,\n\tCircularProgress,\n\tTypography\n} from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\n\nimport { UserDetails } from '~store/actions/ActionTypes';\nimport { resetApp } from '~store/actions';\nimport AuthContext from '~context/AuthContext';\nimport DrawContext from '~context/DrawContext';\nimport GradientButton from '~components/Buttons/GradientButton';\nimport PasswordInput from '~components/Inputs/PasswordInput';\nimport CopyRight from './_CopyRight';\nimport LogoMessage from './_LogoMessage';\nimport axiosInstance, { instanceRate, instancePayment } from '~util/axios';\nimport axios from 'axios';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tborder: '1px solid #FFFFFF50',\n\t\tmarginTop: theme.spacing(3),\n\t\tpadding: theme.spacing(6),\n\t\tmaxWidth: `700px !important`,\n\t\tborderRadius: `${theme.spacing(1)} !important`\n\t},\n\tlinkTerms: {\n\t\tmargin: '15px auto',\n\t\t'&>a': {\n\t\t\ttextDecoration: 'none',\n\t\t\tcolor: theme.palette.primary.main\n\t\t}\n\t},\n\tcontinueBtn: {\n\t\twidth: '100%',\n\t\tmaxWidth: 400,\n\t\tborderRadius: theme.spacing(3)\n\t},\n\tsignIn: {\n\t\twidth: '100%',\n\t\tmaxWidth: 400,\n\t\tborderRadius: theme.spacing(3),\n\t\tborder: '1px solid #FFFFFF66',\n\t\theight: 48,\n\t\tbackgroundColor: 'transparent'\n\t},\n\tline: {\n\t\theight: 1,\n\t\tflex: 1,\n\t\tbackgroundColor: '#FFFFFF50'\n\t},\n\tforgotPassword: {\n\t\ttextDecoration: 'none',\n\t\tcolor: theme.palette.primary.main,\n\t\tcursor: 'pointer'\n\t},\n\terrorMessage: {\n\t\tcolor: '#f44336',\n\t\tmarginBottom: 20\n\t}\n}));\n\ntype Inputs = {\n\temail: string;\n\tpassword: string;\n};\n\ninterface Props {}\n\nconst SignInPage: React.FC = (props) => {\n\tconst classes = useStyles();\n\n\tconst history = useHistory();\n\tconst dispatch = useDispatch();\n\tconst { setAuth, setCurrentUser } = useContext(AuthContext);\n\tconst { handleSubmit, errors, control } = useForm();\n\tconst [responseError, setResponseError] = useState(null);\n\tconst [isLoading, setIsLoading] = useState(false);\n\tconst { setNotification } = useContext(DrawContext);\n\tconst [rememberSession, setRememberSession] = useState(true);\n\n\tconst onSubmit = async (data: Inputs) => {\n\t\tsetIsLoading(true);\n\t\ttry {\n\t\t\tconst response = await axiosInstance.post('/api/user/login', {\n\t\t\t\t...data,\n\t\t\t\temail: data.email.trim()\n\t\t\t});\n\t\t\tif (response.data.message !== 'UNAUTHORIZED') {\n\t\t\t\tsetResponseError('');\n\t\t\t\tif (rememberSession) {\n\t\t\t\t\tlocalStorage.setItem('auth', response.data.token);\n\t\t\t\t}\n\t\t\t\taxiosInstance.defaults.headers.common['Authorization'] = `Bearer ${response.data.token}`;\n\t\t\t\tinstanceRate.defaults.headers.common['Authorization'] = `Bearer ${response.data.token}`;\n\t\t\t\tinstancePayment.defaults.headers.common['Authorization'] = `Bearer ${response.data.token}`;\n\t\t\t\tconst userDetails = await axiosInstance.get('/api/user');\n\t\t\t\tsetCurrentUser(userDetails.data as UserDetails);\n\t\t\t\tsetAuth(true);\n\t\t\t\tdispatch(resetApp());\n\t\t\t} else {\n\t\t\t\tsetResponseError('UNAUTHORIZED');\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlet errorMessage = 'Algo salió mal en el servidor, intente más tarde.';\n\t\t\tif (axios.isAxiosError(error)) {\n\t\t\t\tif (error?.message === 'Network Error') {\n\t\t\t\t\tsetNotification({ message: 'El servidor no esta respondiendo' });\n\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\terrorMessage = error?.response?.data?.message;\n\t\t\t\tsetResponseError(errorMessage);\n\t\t\t\tswitch (errorMessage) {\n\t\t\t\t\tcase 'WRONG_DATA':\n\t\t\t\t\tcase 'UNAUTHORIZED':\n\t\t\t\t\t\terrorMessage = 'Correo o contraseña incorrectos';\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\terrorMessage = 'Algo salió mal en el servidor, intente más tarde.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetNotification({ message: errorMessage });\n\t\t\tsetIsLoading(false);\n\t\t}\n\t};\n\n\treturn (\n\t\t\n\t\t\t{/* The border */}\n\t\t\t\n\t\t\t\t{/* Logo and message */}\n\t\t\t\t\n\t\t\t\t{/* Error messages */}\n\t\t\t\t\n\t\t\t\t\t{responseError === 'UNAUTHORIZED' || responseError === 'WRONG_DATA'\n\t\t\t\t\t\t? 'Correo o contraseña incorrectos'\n\t\t\t\t\t\t: responseError && 'Ocurrio un error'}\n\t\t\t\t\n\t\t\t\t{/* The form */}\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))\\s*$/i,\n\t\t\t\t\t\t\t\t\t\tmessage: 'Ingrese un correo válido'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tas={\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\t\tdefaultValue=''\n\t\t\t\t\t\t\t\thelperText={errors?.email?.message}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t history.push('/forgotpassword')}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tOlvidé mi contraseña\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tAl continuar aceptas los \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tTérminos y Condiciones\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t y \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tPolíticas de privacidad\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t de Encamino SA de CV.\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{isLoading ? (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tContinuar\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t setRememberSession((prev) => !prev)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlabel='Recordar mi sesión'\n\t\t\t\t\t\t\t\tlabelPlacement='end'\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t

¿No tienes cuenta?

 \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t (window.location.href = 'https://encamino.com/join/index.html')}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tRegistrarme\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\n\t);\n};\n\nexport default SignInPage;\n","import { useEffect, useState, useContext } from 'react';\nimport { Grid, Typography, CircularProgress } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { useForm, useWatch } from 'react-hook-form';\nimport { useParams, useHistory } from 'react-router-dom';\nimport LogoMessage from './_LogoMessage';\nimport axiosInstance from '../../util/axios';\nimport CopyRight from './_CopyRight';\nimport GradientButton from '../../components/Buttons/GradientButton';\nimport PasswordInput from '~components/Inputs/PasswordInput';\nimport axios from 'axios';\nimport DrawContext from '~context/DrawContext';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tborder: '1px solid #FFFFFF50',\n\t\tmarginTop: theme.spacing(3),\n\t\tpadding: theme.spacing(6),\n\t\tmaxWidth: 700,\n\t\tborderRadius: theme.spacing(1)\n\t},\n\tlinkTerms: {\n\t\tmargin: '15px auto',\n\t\t'&>a': {\n\t\t\ttextDecoration: 'none',\n\t\t\tcolor: theme.palette.primary.main\n\t\t}\n\t},\n\tcontinueBtn: {\n\t\twidth: '100%',\n\t\tmaxWidth: 400,\n\t\tborderRadius: theme.spacing(3)\n\t}\n}));\n\ntype Inputs = {\n\tpassword: string;\n\tconfirm_password: string;\n};\n\n/**\n * When confirm password to validate\n * or when forgot password\n */\nconst CreatePasswordPage = () => {\n\tconst classes = useStyles();\n\tconst history = useHistory();\n\tconst { validateToken } = useParams<{ validateToken: string }>();\n\tconst { handleSubmit, errors, control, formState, trigger } = useForm();\n\tconst { isSubmitted } = formState;\n\tconst [isLoading, setIsLoading] = useState(false);\n\tconst { setNotification } = useContext(DrawContext);\n\n\tconst password = useWatch({\n\t\tcontrol,\n\t\tname: 'password',\n\t\tdefaultValue: ''\n\t});\n\n\tuseEffect(() => {\n\t\tlocalStorage.removeItem('auth');\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (isSubmitted) {\n\t\t\ttrigger('confirm_password');\n\t\t}\n\t}, [isSubmitted, trigger, password]);\n\n\tconst onSubmit = async (data: Inputs) => {\n\t\tsetIsLoading(true);\n\t\t//console.log('data', data);\n\t\ttry {\n\t\t\t//const response =\n\t\t\tawait axiosInstance.post(`/api/user/validate/${validateToken}`, {\n\t\t\t\tpassword: data.password,\n\t\t\t\tconfirm_password: data.confirm_password\n\t\t\t});\n\t\t\t//console.log('response', response.data);\n\t\t\thistory.replace('/auth');\n\t\t} catch (error) {\n\t\t\tlet errorMessage = 'Algo salió mal, inténtalo de nuevo más tarde';\n\t\t\tconsole.log({ error });\n\t\t\tif (axios.isAxiosError(error)) {\n\t\t\t\terrorMessage =\n\t\t\t\t\terror?.response?.data?.message === 'TOKEN_EXPIRED'\n\t\t\t\t\t\t? 'Este enlace ya no es válido'\n\t\t\t\t\t\t: error?.response?.data?.message === 'WRONG_DATA'\n\t\t\t\t\t\t? 'La contraseña debe tener un mínimo de 8 caracteres y contener al menos una mayúscula, una minúscula, un número y un símbolo.'\n\t\t\t\t\t\t: 'Hubo un problema al actualizar la contraseña';\n\t\t\t}\n\t\t\tsetIsLoading(false);\n\t\t\tsetNotification({\n\t\t\t\tmessage: errorMessage,\n\t\t\t\tseverity: 'error'\n\t\t\t});\n\t\t}\n\t};\n\n\treturn (\n\t\t\n\t\t\t{/* The border */}\n\t\t\t\n\t\t\t\t{/* Logo and message */}\n\t\t\t\t\n\t\t\t\t{/* The form */}\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tCrear contraseña\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t{/* \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{responseError === 'TOKEN_EXPIRED' && 'Este enlace ya no es válido'}\n\t\t\t\t\t\t\t\t{responseError === 'WRONG_DATA' &&\n\t\t\t\t\t\t\t\t\t'La contraseña debe tener un mínimo de 8 caracteres y contener al menos una mayúscula, una minúscula, un número y un símbolo.'}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t */}\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\\?@[\\]\\^_`\\{\\|}~])[a-zA-Z0-9!\"#\\$%&'\\(\\)\\*\\+,-\\.\\/:;<=>\\?@[\\]\\^_`\\{\\|}~]{8,}$/i,\n\t\t\t\t\t\t\t\t\t\tmessage: 'Combinación de letras mayúsculas, minúsculas, números y símbolos'\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tminLength: { value: 8, message: 'Mínimo 8 caracteres' }\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\t\terror={'password' in errors}\n\t\t\t\t\t\t\t\thelperText={\n\t\t\t\t\t\t\t\t\terrors?.password\n\t\t\t\t\t\t\t\t\t\t? errors.password.message\n\t\t\t\t\t\t\t\t\t\t: 'Mínimo 8 caracteres, con combinación de letras mayúsculas, minúsculas, números y símbolos'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\tif (password !== p) {\n\t\t\t\t\t\t\t\t\t\t\treturn 'Las contraseñas son distintas';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\t\terror={'confirm_password' in errors}\n\t\t\t\t\t\t\t\thelperText={errors?.confirm_password?.message}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tAl continuar aceptas los \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tTérminos y Condiciones\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t y \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tPolíticas de privacidad\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t de Encamino SA de CV.\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{isLoading ? (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tContinuar\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t\n\t);\n};\n\nexport default CreatePasswordPage;\n","import React, { useState } from 'react';\nimport { Grid, TextField, Typography, CircularProgress } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { Controller, useForm } from 'react-hook-form';\nimport LogoMessage from './_LogoMessage';\nimport axios from '../../util/axios';\nimport CopyRight from './_CopyRight';\nimport GradientButton from '../../components/Buttons/GradientButton';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\tborder: '1px solid #FFFFFF50',\n\t\tmarginTop: theme.spacing(3),\n\t\tpadding: theme.spacing(6),\n\t\tmaxWidth: 700,\n\t\tborderRadius: theme.spacing(1)\n\t},\n\tlinkTerms: {\n\t\tmargin: '15px auto',\n\t\t'&>a': {\n\t\t\ttextDecoration: 'none',\n\t\t\tcolor: theme.palette.primary.main\n\t\t}\n\t},\n\tcontinueBtn: {\n\t\twidth: '100%',\n\t\tmaxWidth: 400,\n\t\tborderRadius: theme.spacing(3)\n\t}\n}));\n\ntype Inputs = {\n\temail: string;\n};\n\nconst ForgotPasswordPage = () => {\n\tconst classes = useStyles();\n\tconst { handleSubmit, errors, control } = useForm();\n\n\tconst [emailSent, setEmailSent] = useState(false);\n\tconst [isLoading, setIsLoading] = useState(false);\n\n\tconst onSubmit = async (data: Inputs) => {\n\t\tsetIsLoading(true);\n\t\ttry {\n\t\t\t// const res =\n\t\t\tawait axios.post('/api/user/reset', { email: data.email.trim() });\n\t\t\t//console.log('/api/user/reset response', res);\n\t\t} catch (error) {\n\t\t\t//console.log('/api/user/reset/', error.response);\n\t\t} finally {\n\t\t\tsetIsLoading(false);\n\t\t\tsetEmailSent(true);\n\t\t}\n\t};\n\n\tif (emailSent) {\n\t\treturn (\n\t\t\t\n\t\t\t\t{/* The border */}\n\t\t\t\t\n\t\t\t\t\t{/* Logo and message */}\n\t\t\t\t\t\n\t\t\t\t\t{/* Text */}\n\t\t\t\t\t\n\t\t\t\t\t\tSi existe una cuenta con el correo electrónico
\n\t\t\t\t\t\tque indicaste, recibirás un correo con las
\n\t\t\t\t\t\tinstrucciones para recuperar tu constraseña.\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\treturn (\n\t\t\n\t\t\t{/* The border */}\n\t\t\t\n\t\t\t\t{/* Logo and message */}\n\t\t\t\t\n\t\t\t\t{/* The form */}\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tTe enviaremos un correo con las instrucciones para recuperar tu contraseña.\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))\\s*$/i,\n\t\t\t\t\t\t\t\t\t\tmessage: 'Ingrese un correo válido'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tas={\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\t\tdefaultValue=''\n\t\t\t\t\t\t\t\thelperText={errors?.email?.message}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{isLoading ? (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tContinuar\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t\n\t);\n};\n\nexport default ForgotPasswordPage;\n","import { Grid, LinearProgress } from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport React from 'react';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\troot: {\n\t\twidth: '100%',\n\t\t'& > *': {\n\t\t\t//marginTop: theme.spacing(2)\n\t\t}\n\t},\n\tbkLine: {\n\t\tbackgroundColor: 'unset'\n\t}\n}));\n\nconst LoaderPage: React.FC = () => {\n\tconst classes = useStyles();\n\treturn (\n\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t);\n};\n\nexport default LoaderPage;\n","import React from 'react';\nimport { Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material';\nimport { Button } from '@mui/material';\n// Components\nimport { HeadingTwo, TextOne } from '~components/Headings';\n// Styles\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\ttitle: {\n\t\tpadding: `${theme.spacing(1)} ${theme.spacing(3)}`\n\t},\n\ttitleText: {\n\t\tcolor: '#E5E5E5'\n\t},\n\ttextContent: {\n\t\t//padding: theme.spacing(1),\n\t\tcolor: '#E5E5E5',\n\t\tfontWeight: 500\n\t},\n\tdialogContent: {\n\t\tborderTop: `1px solid ${theme.palette.grey[800]}`,\n\t\twidth: '100%'\n\t},\n\tdialogActions: {\n\t\twidth: '100%',\n\t\tjustifyContent: 'flex-end',\n\t\tpadding: 0\n\t},\n\tbuttonConfirm: {\n\t\tmargin: '0 16px 16px 16px',\n\t\tbackgroundColor: theme.palette.primary.main,\n\t\tborderRadius: theme.spacing(1),\n\t\t'&:hover': {\n\t\t\tbackgroundColor: theme.palette.primary.main\n\t\t},\n\t\tcolor: '#000000de'\n\t}\n}));\n\ntype Props = {\n\tisOpen: boolean;\n\tonClose: () => void;\n\tonConfirm: () => void;\n};\n\nconst ServerUpdatedModal: React.FC = ({ isOpen, onClose, onConfirm }) => {\n\tconst classes = useStyles();\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default ServerUpdatedModal;\n","import { FC, useCallback, useContext, useState, useMemo } from 'react';\nimport {\n\tDialog,\n\tDialogTitle,\n\tDialogContent,\n\tGrid,\n\tDialogActions,\n\tButton,\n\tFormControlLabel,\n\tRadio\n} from '@mui/material';\nimport { Theme } from '@mui/material/styles';\nimport { makeStyles } from '@mui/styles';\nimport { HeadingTwo, TextOne } from '~components/Headings';\nimport axiosInstance from '~util/axios';\nimport DrawContext from '~context/DrawContext';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n\tcontainer: {\n\t\t'& .MuiPaper-root': {\n\t\t\tmaxWidth: '60vw'\n\t\t},\n\t\tpadding: theme.spacing(2)\n\t},\n\tdialogContent: {\n\t\tpaddingTop: '0 !important',\n\t\t'& > img': {\n\t\t\twidth: '100%'\n\t\t}\n\t},\n\tcloseButton: {\n\t\tpadding: '0',\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'flex-end',\n\t\t'& > button': {\n\t\t\tcolor: theme.palette.grey[500]\n\t\t}\n\t},\n\tspacing: {\n\t\tpadding: `${theme.spacing(2)} ${theme.spacing(3)} ${theme.spacing(3)} ${theme.spacing(3)}`\n\t}\n}));\n\nexport type NotificationItem = {\n\ttype: NotificationType;\n\ttitle: string;\n\tmessage: string;\n};\n\nexport enum NotificationType {\n\tPURCHASE_VALIDITY = 'purchase_validity',\n\tEXPIRED_DISPERSION = 'expired_dispersion',\n\tSTOCK_TO_BALANCE = 'stock_to_balance'\n}\n\ntype Props = {\n\tisOpen: boolean;\n\tonFinish: () => void;\n\tnotification: NotificationItem | null;\n};\n\nconst HomeNotificationModal: FC = ({ isOpen, onFinish, notification }) => {\n\tconst classes = useStyles();\n\tconst [confirm, setConfirm] = useState(false);\n\tconst [loading, setLoading] = useState(false);\n\tconst { setNotification } = useContext(DrawContext);\n\n\t// Checkbox for purchase alert and change of scheme alert\n\tconst hideCheckbox = useMemo(\n\t\t() => notification?.type === NotificationType.EXPIRED_DISPERSION,\n\t\t[notification]\n\t);\n\n\t// Confirm read notification\n\tconst handleReadNotification = useCallback(async () => {\n\t\tsetLoading(true);\n\t\ttry {\n\t\t\tawait axiosInstance.post('/api/notification/confirmRead', { type: notification?.type });\n\t\t\tsetNotification({\n\t\t\t\tseverity: 'success',\n\t\t\t\tmessage: 'La noticación se confirmó con éxito',\n\t\t\t\ttime: 2000\n\t\t\t});\n\t\t\tonFinish();\n\t\t} catch (error) {\n\t\t\tsetNotification({\n\t\t\t\tseverity: 'error',\n\t\t\t\tmessage: 'Hubo un error al confirmar la notificación',\n\t\t\t\ttime: 2000\n\t\t\t});\n\t\t} finally {\n\t\t\tonFinish();\n\t\t\tsetLoading(false);\n\t\t}\n\t}, [onFinish, setNotification, notification?.type]);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{!hideCheckbox && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlabel='Acepto y estoy de acuerdo con el esquema'\n\t\t\t\t\t\t\t\tonChange={(e) => setConfirm((e.target as HTMLInputElement).value === 'confirm')}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tConfirmar\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default HomeNotificationModal;\n","import { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/material/className';\n\nClassNameGenerator.configure(\n\t// Do something with the componentName\n\t// (componentName) => `mui-jss-${componentName}`,\n\t(componentName) => componentName?.toLowerCase().includes('grid') ? componentName : `mui-jss-${componentName}`,\n\n);\n","import React, { useCallback, useContext, useEffect, useState } from 'react';\nimport { makeStyles, StylesProvider } from '@mui/styles';\nimport { ThemeProvider } from '@mui/material/styles';\nimport { Grid } from '@mui/material';\nimport { CssBaseline } from '@mui/material';\n\nimport { BrowserRouter as Router, Switch, Route, Redirect } from 'react-router-dom';\nimport Routes from './Routes';\nimport axiosInstance, { instanceRate, instancePayment } from './util/axios';\nimport LogRocket from 'logrocket';\nimport { shallow } from 'zustand/shallow';\n\n// Drawers\nimport LDrawer from './components/Navigation/LDrawer';\nimport TopNav from './components/Navigation/TopNav/TopNav';\nimport RDrawer from './components/Navigation/RDrawer';\nimport SnackBarToast from './components/Navigation/SnackBarToast';\n\n// Auth\nimport SignInPage from './pages/auth/SignInPage';\nimport CreatePasswordPage from './pages/auth/CreatePasswordPage';\nimport ForgotPasswordPage from './pages/auth/ForgotPasswordPage';\n\nimport { useTheme } from './hooks/useTheme';\nimport AuthContext from './context/AuthContext';\nimport DrawContext from './context/DrawContext';\nimport LoaderPage from './pages/loader/LoaderPage';\nimport { UserDetails } from './store/actions/ActionTypes';\nimport { END_POINT_WS, LOGROCKET_ENABLE, LOGROCKET_KEY } from './config';\nimport useReportExportsStore from '~store/newstore/useReportExportsStore';\nimport useNotificationStore from '~store/newstore/useNotificationStore';\nimport ShipmentTracking from '~pages/tracking/ShipmentTracking';\nimport { io } from 'socket.io-client';\nimport ServerUpdatedModal from '~components/Modals/ServerUpdatedModal';\nimport HomeNotificationModal, { NotificationItem } from '~components/Modals/HomeNotificationModal';\nimport { StyledEngineProvider } from '@mui/material';\nimport './MuiClassNameSetup';\nconst DocumentsForm = React.lazy(() => import('~pages/documents/DocumentsForm'));\n\nconst useStyles = makeStyles((theme) => {\n\treturn {\n\t\tmainContainer: {\n\t\t\tmarginTop: 80,\n\t\t\tmarginBottom: 80\n\t\t}\n\t};\n});\n\nconst App: React.FC = () => {\n\tconst classes = useStyles();\n\n\tconst { themeV4, currentTheme, toggleTheme, generateClassName } = useTheme(false);\n\tconst { setIsCheckingIsAuth, setAuth, setCurrentUser, isCheckingIsAuth, isAuth, currentUser } =\n\t\tuseContext(AuthContext);\n\tconst { rCardStatus } = useContext(DrawContext);\n\tconst [reportExports, removeReportExports] = useReportExportsStore(\n\t\t(state) => [state.reportExports, state.removeReportExports],\n\t\tshallow\n\t);\n\tconst [setNotificationQueue, clearNotificationQueue] = useNotificationStore(\n\t\t(state) => [state.setNotificationQueue, state.clearNotificationsQueue],\n\t\tshallow\n\t);\n\n\tconst [showServerUpdateAlert, setShowServerUpdateAlert] = useState(false);\n\tconst [showDispersionAlert, setShowDispersionAlert] = useState(false);\n\tconst [notificationAlert, setNotificationAlert] = useState(null);\n\n\tconst handleRealod = () => {\n\t\twindow.location.reload();\n\t};\n\n\t// Confirm read notification\n\tconst handleReadNotification = useCallback(async () => {\n\t\tsetShowDispersionAlert(false);\n\t\tsetNotificationAlert(null);\n\t}, []);\n\n\tconst checkForNewerVersion = async () => {\n\t\tconst token = localStorage.getItem('auth');\n\t\tif (token) {\n\t\t\ttry {\n\t\t\t\taxiosInstance.defaults.headers.common['Authorization'] = `Bearer ${token}`;\n\t\t\t\tconst response = await axiosInstance.get('/api/version');\n\t\t\t\tconst lastVersion = response.data.version;\n\t\t\t\tconst currentVersion = localStorage.getItem('version');\n\n\t\t\t\t// if there is no current version, we set the last version and force to update just in case\n\t\t\t\t// if there is a current version, we compare it with the last version and force to update just in case\n\t\t\t\tif (!currentVersion || currentVersion !== lastVersion) {\n\t\t\t\t\tsetShowServerUpdateAlert(true);\n\t\t\t\t\tlocalStorage.setItem('version', lastVersion);\n\t\t\t\t}\n\t\t\t\t// so it doesn't break the whole page in case of a network error\n\t\t\t} catch (err) {}\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tconst SECOND = 1_000;\n\t\tconst MINUTE = SECOND * 60;\n\t\tconst CHECK_EVERY = MINUTE * 10;\n\t\tconst id = setInterval(checkForNewerVersion, CHECK_EVERY);\n\n\t\treturn () => {\n\t\t\tclearInterval(id);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst handler = () => {\n\t\t\tif (document.visibilityState === 'visible') {\n\t\t\t\tcheckForNewerVersion();\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener('visibilitychange', handler);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('visibilitychange', handler);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst socket = io(END_POINT_WS || '');\n\n\t\tsocket.on('serverUpdated', (version) => {\n\t\t\t// set the version updated from server, stop from double update on reload\n\t\t\tlocalStorage.setItem('version', version);\n\t\t\tsetShowServerUpdateAlert(true);\n\t\t});\n\n\t\tsocket.on(`notifications_${currentUser.id}`, (...newDispersions) => {\n\t\t\tif (!Array.isArray(newDispersions) || !newDispersions?.length) return;\n\t\t\tsetShowDispersionAlert(true);\n\t\t\tsetNotificationAlert(newDispersions[0]);\n\t\t});\n\n\t\treturn () => {\n\t\t\tsocket.disconnect();\n\t\t};\n\t}, [currentUser.id]);\n\n\t// Validate Token\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tconst token = localStorage.getItem('auth');\n\t\t\tif (token) {\n\t\t\t\ttry {\n\t\t\t\t\taxiosInstance.defaults.headers.common['Authorization'] = `Bearer ${token}`;\n\t\t\t\t\tinstanceRate.defaults.headers.common['Authorization'] = `Bearer ${token}`;\n\t\t\t\t\tinstancePayment.defaults.headers.common['Authorization'] = `Bearer ${token}`;\n\t\t\t\t\tconst userDetails = await axiosInstance.get('/api/user');\n\t\t\t\t\tsetCurrentUser(userDetails.data as UserDetails);\n\t\t\t\t\tsetAuth(true);\n\n\t\t\t\t\t// Check last available version\n\t\t\t\t\tconst response = await axiosInstance.get('/api/version');\n\t\t\t\t\tconst lastVersion = response.data.version;\n\t\t\t\t\tconst currentVersion = localStorage.getItem('version');\n\n\t\t\t\t\t// if there is no current version, we set the last version and force to update just in case\n\t\t\t\t\t// if there is a current version, we compare it with the last version and force to update just in case\n\t\t\t\t\tif (!currentVersion || currentVersion !== lastVersion) {\n\t\t\t\t\t\tsetShowServerUpdateAlert(true);\n\t\t\t\t\t\tlocalStorage.setItem('version', lastVersion);\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tlocalStorage.removeItem('auth');\n\t\t\t\t\tsetAuth(false);\n\t\t\t\t\taxiosInstance.defaults.headers.common['Authorization'] = undefined;\n\t\t\t\t\tinstanceRate.defaults.headers.common['Authorization'] = undefined;\n\t\t\t\t\tinstancePayment.defaults.headers.common['Authorization'] = undefined;\n\t\t\t\t\tclearNotificationQueue();\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetIsCheckingIsAuth(false);\n\t\t})();\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [isAuth, setIsCheckingIsAuth]);\n\n\t// Queue for reports\n\tuseEffect(() => {\n\t\tconst intervalId = setInterval(async () => {\n\t\t\tif (reportExports.length === 0) {\n\t\t\t\tclearInterval(intervalId);\n\t\t\t}\n\t\t\tfor (const report of reportExports) {\n\t\t\t\ttry {\n\t\t\t\t\tconst url =\n\t\t\t\t\t\treport?.type === 'invoices'\n\t\t\t\t\t\t\t? `/reports/invoices/${report.id}`\n\t\t\t\t\t\t\t: `/reports/labels/${report.id}`;\n\t\t\t\t\tconst status = await instanceRate.get(url);\n\t\t\t\t\tif (status.data.status === 'done') {\n\t\t\t\t\t\twindow.open(report.url, '_blank');\n\t\t\t\t\t\tsetNotificationQueue({\n\t\t\t\t\t\t\tmessage: `El Reporte ${\n\t\t\t\t\t\t\t\tnew Date().toISOString().split('T')[0]\n\t\t\t\t\t\t\t} esta listo. Da click para verlo`,\n\t\t\t\t\t\t\tdate: new Date(),\n\t\t\t\t\t\t\tcallBack: () => {\n\t\t\t\t\t\t\t\twindow.open(report.url, '_blank');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tremoveReportExports(report.spreadsheet_id);\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconsole.error(e);\n\t\t\t\t\tsetNotificationQueue({\n\t\t\t\t\t\tmessage: `El Reporte ${\n\t\t\t\t\t\t\tnew Date().toISOString().split('T')[0]\n\t\t\t\t\t\t} no se pudo procesar, intente más tarde`,\n\t\t\t\t\t\tdate: new Date()\n\t\t\t\t\t});\n\t\t\t\t\tclearInterval(intervalId);\n\t\t\t\t\tremoveReportExports(report.spreadsheet_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 1000 * 5); // in milliseconds\n\n\t\treturn () => clearInterval(intervalId);\n\t}, [reportExports, setNotificationQueue, removeReportExports]);\n\n\t// Enable logRocket\n\tuseEffect(() => {\n\t\tif (currentUser?.id !== 0 && LOGROCKET_ENABLE) {\n\t\t\tLogRocket.init(LOGROCKET_KEY);\n\t\t\tLogRocket.identify(currentUser.id.toString(), {\n\t\t\t\temail: currentUser.email,\n\t\t\t\tname: currentUser.name\n\t\t\t});\n\t\t}\n\t}, [currentUser]);\n\n\t// Shows the user a load while checking\n\tif (isCheckingIsAuth) {\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\t// If is not auth, the pages to login or singup\n\tif (!isAuth) {\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{/* Toasts (snackbar)*/}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{/* Tutorial button and modal */}\n\t\t\t\t\t\t\t{/* \n\t\t\t\t\t\t\t */}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\t// He or She is an authenticated user\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t setShowServerUpdateAlert(false)}\n\t\t\t\t\t\t\tonConfirm={handleRealod}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t{/* Tutorial button and modal */}\n\t\t\t\t\t\t{/* \n\t\t\t\t\t\t */}\n\n\t\t\t\t\t\t{/* Toasts (snackbar)*/}\n\t\t\t\t\t\t\n\t\t\t\t\t\t{/* Top Nav Bar */}\n\t\t\t\t\t\t\n\t\t\t\t\t\t{/* Left Menu */}\n\t\t\t\t\t\t\n\t\t\t\t\t\t{/* Rigth Menu */}\n\t\t\t\t\t\t{rCardStatus !== 'HIDDEN' && }\n\t\t\t\t\t\t{/* Main Layout */}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{/* Space for Left Draw */}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{/* Main Layout */}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{/* Space for Right Draw */}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{/* Space for Right Draw */}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default App;\n","import { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n\tif (onPerfEntry && onPerfEntry instanceof Function) {\n\t\timport('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n\t\t\tgetCLS(onPerfEntry);\n\t\t\tgetFID(onPerfEntry);\n\t\t\tgetFCP(onPerfEntry);\n\t\t\tgetLCP(onPerfEntry);\n\t\t\tgetTTFB(onPerfEntry);\n\t\t});\n\t}\n};\n\nexport default reportWebVitals;\n","import React, { useCallback, useState } from 'react';\nimport DrawContext, { rdrawstatus, SnackBarMessage } from './DrawContext';\nimport AuthContext, { PermissionState } from './AuthContext';\nimport { UserDetails, UserRole } from '../store/actions/ActionTypes';\nimport { numberOfPermissions } from '~components/Forms/Permissions/helpers';\n\nconst defaultPermissions: PermissionState = {\n\tcanRead: {\n\t\tapp: true,\n\t\taddresses: false,\n\t\tpackages: false,\n\t\tusers: false,\n\t\tclient: false,\n\t\tgroups: false,\n\t\trate: false,\n\t\tlabel: false,\n\t\tpickup: false,\n\t\tdispersion: false,\n\t\tdisperse: false,\n\t\tbusiness: false,\n\t\tbilling: false\n\t},\n\tcanCreateUpdateDelete: {\n\t\taddress: false,\n\t\tpackage: false,\n\t\tuser: false,\n\t\tclient: false,\n\t\tgroup: false,\n\t\trate: false,\n\t\tlabel: false,\n\t\tpickup: false,\n\t\tdispersion: false,\n\t\tdisperse: false,\n\t\tbusiness: false,\n\t\tbilling: false\n\t}\n};\n\nconst defaultUser: UserDetails = {\n\tid: 0,\n\tcustomer: null,\n\tdefault_address: null,\n\temail: '',\n\tgroup: null,\n\tname: '',\n\toptions: {\n\t\trate_price: false,\n\t\ttheme: false\n\t},\n\tpermissions: '',\n\tphone_number: null,\n\trole: UserRole.CLIENT,\n\tservices: []\n};\n\nconst GlobalContext: React.FC<{ children: React.ReactNode }> = (props) => {\n\t//DrawContext\n\tconst [mobileLeftDrawerStatus, setMobileLeftDrawerStatus] = useState(false);\n\tconst [mobileRigthDrawerStatus, setMobileRigthDrawerStatus] = useState(false);\n\tconst [helpDialogStatus, setHelpDialogStatus] = useState(false);\n\tconst [rCardStatus, setRCardStatus] = useState('INITIAL');\n\tconst [notification, setNotification] = useState({ message: '' });\n\tconst [showNotification, setShowNotification] = useState(false);\n\tconst [showBarLogo, setShowBarLogo] = useState(true);\n\tconst [availableBalance, setAvailableBalance] = useState(0);\n\n\t//AuthContext\n\tconst [isAuth, setIsAuth] = useState(false);\n\tconst [isCheckingIsAuth, setIsCheckingIsAuth] = useState(true);\n\n\tconst [currentUser, setCurrentUser] = useState(defaultUser);\n\n\tconst [currentPermissions, setCurrentPermissions] = useState(defaultPermissions);\n\n\tconst updateUser = useCallback((user: UserDetails) => {\n\t\tsetCurrentUser(user);\n\n\t\tconst permissions = user.permissions + '0'.repeat(numberOfPermissions - numberOfPermissions);\n\n\t\tconst nextPermissions: PermissionState = {\n\t\t\tcanRead: {\n\t\t\t\tapp: true,\n\t\t\t\taddresses: true,\n\t\t\t\tpackages: true,\n\t\t\t\tusers: true,\n\t\t\t\tgroups: true,\n\t\t\t\tclient: true,\n\n\t\t\t\trate: true,\n\t\t\t\tlabel: true,\n\t\t\t\tpickup: true,\n\t\t\t\tdispersion: true,\n\t\t\t\tdisperse: true,\n\n\t\t\t\tbusiness: true,\n\t\t\t\tbilling: true\n\t\t\t},\n\t\t\tcanCreateUpdateDelete: {\n\t\t\t\taddress: true,\n\t\t\t\tpackage: true,\n\t\t\t\tuser: true,\n\t\t\t\tgroup: true,\n\t\t\t\tclient: true,\n\n\t\t\t\trate: true,\n\t\t\t\tlabel: true,\n\t\t\t\tpickup: true,\n\t\t\t\tdispersion: true,\n\t\t\t\tdisperse: true,\n\n\t\t\t\tbusiness: true,\n\t\t\t\tbilling: true\n\t\t\t}\n\t\t};\n\n\t\tif (user.role !== UserRole.ROOT) {\n\t\t\t// Can READ\n\t\t\tnextPermissions.canRead.addresses = +permissions[1] >= 1;\n\t\t\tnextPermissions.canRead.groups = user.role === UserRole.AGENT ? true : +permissions[2] >= 1;\n\t\t\tnextPermissions.canRead.users = user.role === UserRole.AGENT ? true : +permissions[2] >= 1;\n\t\t\tnextPermissions.canRead.client = user.role !== UserRole.CLIENT;\n\t\t\tnextPermissions.canRead.label = +permissions[3] >= 1;\n\t\t\tnextPermissions.canRead.packages = +permissions[4] >= 1;\n\t\t\tnextPermissions.canRead.pickup = +permissions[5] >= 1;\n\t\t\tnextPermissions.canRead.rate = +permissions[6] >= 1;\n\t\t\t// TODO: NOT USED\n\t\t\tnextPermissions.canRead.disperse = user.role === UserRole.CUSTOMER;\n\t\t\tnextPermissions.canRead.dispersion =\n\t\t\t\tuser.role === UserRole.AGENT || user.role === UserRole.CUSTOMER\n\t\t\t\t\t? true\n\t\t\t\t\t: +permissions[7] >= 1;\n\t\t\tnextPermissions.canRead.business = +permissions[8] >= 1;\n\t\t\tnextPermissions.canRead.billing = +permissions[8] >= 1;\n\n\t\t\t// Can CREATE/UPDATE/DELETE\n\t\t\tnextPermissions.canCreateUpdateDelete.address = +permissions[1] > 1;\n\t\t\tnextPermissions.canCreateUpdateDelete.group =\n\t\t\t\tuser.role === UserRole.AGENT ? true : +permissions[2] > 1;\n\t\t\tnextPermissions.canCreateUpdateDelete.user =\n\t\t\t\tuser.role === UserRole.AGENT ? true : +permissions[2] > 1;\n\t\t\tnextPermissions.canCreateUpdateDelete.client = user.role !== UserRole.CLIENT;\n\t\t\tnextPermissions.canCreateUpdateDelete.label = +permissions[3] > 1;\n\t\t\tnextPermissions.canCreateUpdateDelete.package = +permissions[4] > 1;\n\t\t\tnextPermissions.canCreateUpdateDelete.pickup = +permissions[5] > 1;\n\t\t\tnextPermissions.canCreateUpdateDelete.rate = +permissions[6] > 1;\n\t\t\t// TODO: NOT USED\n\t\t\tnextPermissions.canCreateUpdateDelete.disperse =\n\t\t\t\tuser.role === UserRole.CUSTOMER ? true : +permissions[7] > 1;\n\t\t\tnextPermissions.canCreateUpdateDelete.dispersion = user.role === UserRole.AGENT;\n\t\t\tnextPermissions.canCreateUpdateDelete.business = +permissions[8] > 1;\n\t\t\tnextPermissions.canCreateUpdateDelete.billing = +permissions[8] > 1;\n\t\t} else {\n\t\t\tnextPermissions.canRead.groups = true;\n\t\t\tnextPermissions.canRead.users = true;\n\t\t}\n\t\tsetCurrentPermissions(nextPermissions);\n\t}, []);\n\n\treturn (\n\t\t setIsAuth(auth),\n\t\t\t\tisCheckingIsAuth,\n\t\t\t\tsetIsCheckingIsAuth,\n\t\t\t\tcurrentUser: currentUser,\n\t\t\t\tsetCurrentUser: updateUser,\n\t\t\t\tcurrentPermissions,\n\t\t\t\tclearUser: () => {\n\t\t\t\t\tsetCurrentUser({\n\t\t\t\t\t\tid: 0,\n\t\t\t\t\t\tcustomer: null,\n\t\t\t\t\t\tdefault_address: null,\n\t\t\t\t\t\temail: '',\n\t\t\t\t\t\tgroup: null,\n\t\t\t\t\t\tname: '',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\trate_price: false,\n\t\t\t\t\t\t\ttheme: false\n\t\t\t\t\t\t},\n\t\t\t\t\t\tpermissions: '',\n\t\t\t\t\t\tphone_number: null,\n\t\t\t\t\t\trole: UserRole.CLIENT,\n\t\t\t\t\t\tservices: []\n\t\t\t\t\t});\n\t\t\t\t\tsetCurrentPermissions(defaultPermissions);\n\t\t\t\t\tsetAvailableBalance(null);\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t setMobileLeftDrawerStatus((prev) => !prev),\n\t\t\t\t\tmobileRigthDrawerStatus,\n\t\t\t\t\ttoggleRightDrawer: () => setMobileRigthDrawerStatus((prev) => !prev),\n\t\t\t\t\thelpDialogStatus,\n\t\t\t\t\ttoggleHelpDialogStatus: () => setHelpDialogStatus((prev) => !prev),\n\t\t\t\t\trCardStatus,\n\t\t\t\t\tsetRCardStatus,\n\t\t\t\t\tnotification,\n\t\t\t\t\tsetNotification,\n\t\t\t\t\tshowNotification,\n\t\t\t\t\tsetShowNotification,\n\t\t\t\t\tshowBarLogo,\n\t\t\t\t\ttoggleBarLogo: (a: boolean) => setShowBarLogo(a),\n\t\t\t\t\tavailableBalance,\n\t\t\t\t\tsetAvailableBalance\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{props.children}\n\t\t\t\n\n\t\t\t{/* setWalletDialog((prev) => !prev)\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{props.children}\n\t\t\t */}\n\t\t\n\t);\n};\n\nexport default GlobalContext;\n","import { Suspense } from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\nimport { Provider } from 'react-redux';\nimport LoaderPage from './pages/loader/LoaderPage';\nimport { StyledEngineProvider } from '@mui/material/styles';\n\nimport GlobalContext from './context/_GlobalContext';\n\nimport mainStore from './store/store';\n\nReactDOM.render(\n\t}>\n\t\t\n\t\t\t\n\t\t\t\t{/* */}\n\t\t\t\t\n\t\t\t\t{/* */}\n\t\t\t\n\t\t\n\t,\n\tdocument.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n","import React from 'react';\nimport { UserDetails, UserRole } from '../store/actions/ActionTypes';\n\nexport type ReadPermissions = {\n\tapp: boolean;\n\taddresses: boolean;\n\tpackages: boolean;\n\tusers: boolean;\n\tgroups: boolean;\n\tclient: boolean;\n\trate: boolean;\n\tlabel: boolean;\n\tpickup: boolean;\n\tdispersion: boolean;\n\tdisperse: boolean;\n\tbusiness: boolean;\n\tbilling: boolean;\n}\n\nexport type CreateUpdateDeletePermissions = {\n\taddress: boolean;\n\tpackage: boolean;\n\tuser: boolean;\n\tgroup: boolean;\n\tclient: boolean;\n\trate: boolean;\n\tlabel: boolean;\n\tpickup: boolean;\n\tdispersion: boolean;\n\tdisperse: boolean;\n\tbusiness: boolean;\n\tbilling: boolean;\n}\n\nexport type PermissionState = { canRead: ReadPermissions, canCreateUpdateDelete: CreateUpdateDeletePermissions };\n\n// https://stackoverflow.com/questions/58434389/typescript-deep-keyof-of-a-nested-object\ntype Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...0[]];\n\ntype Join = K extends string | number\n\t? P extends string | number\n\t\t? `${K}${'' extends P ? '' : '.'}${P}`\n\t\t: never\n\t: never;\n\n// type Paths = [D] extends [never] ? never : T extends object ?\n// { [K in keyof T]-?: K extends string | number ?\n// `${K}` | Join>\n// : never\n// }[keyof T] : \"\"\n\ntype Leaves = [D] extends [never]\n\t? never\n\t: T extends object\n\t? { [K in keyof T]-?: Join> }[keyof T]\n\t: '';\n\nexport type PermissionsKey = Leaves;\n\ninterface Params {\n\t// Log in\n\tisAuth: boolean;\n\tsetAuth: (auth: boolean) => void;\n\tisCheckingIsAuth: boolean;\n\tsetIsCheckingIsAuth: (auth: boolean) => void;\n\t// UserForm info\n\tcurrentUser: UserDetails;\n\tsetCurrentUser: (currentUser: UserDetails) => void;\n\tcurrentPermissions: PermissionState;\n\tclearUser: () => void;\n}\n\n\nconst AuthContext = React.createContext({\n\tisAuth: false,\n\tsetAuth: () => {},\n\tisCheckingIsAuth: true,\n\tsetIsCheckingIsAuth: () => {},\n\tcurrentUser: {\n\t\tid: 0,\n\t\tcustomer: null,\n\t\tdefault_address: null,\n\t\temail: '',\n\t\tgroup: null,\n\t\tname: '',\n\t\toptions: {\n\t\t\trate_price: false,\n\t\t\ttheme: false,\n\t\t},\n\t\tpermissions: '',\n\t\tphone_number: null,\n\t\trole: UserRole.CLIENT,\n\t\tservices: [],\n\t},\n\tsetCurrentUser: () => {},\n\tcurrentPermissions: {\n\t\tcanRead: {\n\t\t\tapp: true,\n\t\t\taddresses: false,\n\t\t\tpackages: false,\n\t\t\tusers: false,\n\t\t\tgroups: false,\n\t\t\tclient: false,\n\n\t\t\trate: false,\n\t\t\tlabel: false,\n\t\t\tpickup: false,\n\t\t\tdispersion: false,\n\t\t\tdisperse: false,\n\n\t\t\tbusiness: false,\n\t\t\tbilling: false,\n\t\t},\n\t\tcanCreateUpdateDelete:{\n\t\t\taddress: false,\n\t\t\tpackage: false,\n\t\t\tuser: false,\n\t\t\tgroup: false,\n\t\t\tclient: false,\n\n\t\t\trate: false,\n\t\t\tlabel: false,\n\t\t\tpickup: false,\n\t\t\tdispersion: false,\n\t\t\tdisperse: false,\n\n\t\t\t\n\t\t\tbusiness: false,\n\t\t\tbilling: false,\n\t\t},\n\t},\n\tclearUser: () => {}\n});\n\nexport default AuthContext;\n","import { Dispatch } from 'redux';\nimport {\n\tADD_LABEL_PICKUP,\n\tSET_LABELS_PICKUP,\n\tAddressRequest,\n\tCAN_CONTINUE_TO_EDIT_PICKUP,\n\tCAN_CONTINUE_TO_SUMMARY_PICKUP,\n\tContact,\n\tID,\n\tPickUpActions,\n\tREMOVE_LABEL_PICKUP,\n\tRESET_LABELS_PICKUP,\n\tRESET_PICKUP,\n\tSET_ADDRESS_PICKUP,\n\tSET_CARRIER_FOLIO_PICKUP,\n\tSET_CARRRIER_PICKUP,\n\tSET_CONTACT_PICKUP,\n\tSET_DATE_PICKUP,\n\tSET_EXTRA_INDICATIONS_PICKUP,\n\tSET_INDICATIONS_PICKUP,\n\tSET_REASON_PICKUP,\n\tSET_STATUS_PICKUP,\n\tSET_TIME_PICKUP,\n\tShipmentSendResponse,\n\tTRIGGER_VALIDATE_BEFORE_SUMMARY_PICKUP,\n\tUPDATE_PICKUP_DETAILS,\n\tSET_INSURANCE_FOR_PICKUP,\n\tSET_PICKUP_SUPERVISOR,\n\tSET_PICKUP_NOTES\n} from './ActionTypes';\n\nexport const resetPickup = (): PickUpActions => {\n\treturn { type: RESET_PICKUP };\n};\n\nexport const setAddressPickUp =\n\t(address: AddressRequest | null, contacts: Contact[]) => (dispatch: Dispatch) => {\n\t\tdispatch({ type: SET_ADDRESS_PICKUP, address, contacts });\n\t\tdispatch({ type: CAN_CONTINUE_TO_SUMMARY_PICKUP });\n\t};\n\nexport const setContactPickup =\n\t(contact: Contact | null) => (dispatch: Dispatch) => {\n\t\tdispatch({ type: SET_CONTACT_PICKUP, contact });\n\t\tdispatch({ type: CAN_CONTINUE_TO_SUMMARY_PICKUP });\n\t};\n\nexport const updatePickupDetails =\n\t(id: ID, labels: ShipmentSendResponse[]) => (dispatch: Dispatch) => {\n\t\tdispatch({ type: UPDATE_PICKUP_DETAILS, id, labels });\n\t};\n\nexport const addLabelPickup =\n\t(label: ShipmentSendResponse) => (dispatch: Dispatch) => {\n\t\tdispatch({ type: ADD_LABEL_PICKUP, label });\n\t\tdispatch({ type: CAN_CONTINUE_TO_SUMMARY_PICKUP });\n\t};\n\nexport const setLabelsPickup =\n\t(labels: ShipmentSendResponse[]) => (dispatch: Dispatch) => {\n\t\tdispatch({ type: SET_LABELS_PICKUP, labels });\n\t\tdispatch({ type: CAN_CONTINUE_TO_SUMMARY_PICKUP });\n\t};\n\nexport const removeLabelPickup = (id: ID) => (dispatch: Dispatch) => {\n\tdispatch({ type: REMOVE_LABEL_PICKUP, id });\n\tdispatch({ type: CAN_CONTINUE_TO_SUMMARY_PICKUP });\n};\n\nexport const setIndicationsPickUp =\n\t(indications: string) => (dispatch: Dispatch) => {\n\t\tdispatch({ type: SET_INDICATIONS_PICKUP, indications });\n\t\tdispatch({ type: CAN_CONTINUE_TO_SUMMARY_PICKUP });\n\t};\n\nexport const setExtraIndicationsPickUp = (extra_indications: string): PickUpActions => {\n\treturn { type: SET_EXTRA_INDICATIONS_PICKUP, extra_indications };\n};\n\nexport const setDatePickUp = (date: Date | null) => (dispatch: Dispatch) => {\n\tdispatch({ type: SET_DATE_PICKUP, date });\n\tdispatch({ type: CAN_CONTINUE_TO_SUMMARY_PICKUP });\n};\n\nexport const setTimePickUp =\n\t(time: Date | null, target: 'start' | 'end') => (dispatch: Dispatch) => {\n\t\tdispatch({ type: SET_TIME_PICKUP, target, time });\n\t\tdispatch({ type: CAN_CONTINUE_TO_SUMMARY_PICKUP });\n\t};\n\nexport const setStatus =\n\t(status: string, isAgent: boolean) => (dispatch: Dispatch) => {\n\t\tdispatch({ type: SET_STATUS_PICKUP, status });\n\t\tdispatch({ type: CAN_CONTINUE_TO_EDIT_PICKUP, isAgent });\n\t};\n\nexport const setPickUpReason =\n\t(reason: string, isAgent: boolean) => (dispatch: Dispatch) => {\n\t\tdispatch({ type: SET_REASON_PICKUP, reason });\n\t\tdispatch({ type: CAN_CONTINUE_TO_EDIT_PICKUP, isAgent });\n\t};\n\nexport const setPickUpCarrierFolio =\n\t(carrierFolio: string, isAgent: boolean) => (dispatch: Dispatch) => {\n\t\tdispatch({ type: SET_CARRIER_FOLIO_PICKUP, carrierFolio });\n\t\tdispatch({ type: CAN_CONTINUE_TO_EDIT_PICKUP, isAgent });\n\t};\n\nexport const setPickUpSupervisor =\n\t(pickupSupervisor: string) => (dispatch: Dispatch) => {\n\t\tdispatch({ type: SET_PICKUP_SUPERVISOR, pickupSupervisor });\n\t};\n\nexport const setPickupNotes = (pickupNotes: string) => (dispatch: Dispatch) => {\n\tdispatch({ type: SET_PICKUP_NOTES, pickupNotes });\n};\n\nexport const setInsuranceForPickupOrder =\n\t(insuranceForOrder: boolean) => (dispatch: Dispatch) => {\n\t\tdispatch({ type: SET_INSURANCE_FOR_PICKUP, insuranceForOrder });\n\t};\n\n/**\n * Will try to validate the existence of address, contact date, times and indications\n */\nexport const triggerValidationsPickup = (status: boolean): PickUpActions => {\n\treturn { type: TRIGGER_VALIDATE_BEFORE_SUMMARY_PICKUP, status };\n};\n\nexport const resetLabelsPickup = (): PickUpActions => {\n\treturn { type: RESET_LABELS_PICKUP };\n};\n\nexport const setCarrierPickUp = (carrier: string) => (dispatch: Dispatch) => {\n\tdispatch({ type: SET_CARRRIER_PICKUP, carrier });\n\tdispatch({ type: CAN_CONTINUE_TO_SUMMARY_PICKUP });\n};\n","import axiosInstance from '../../util/axios';\nimport axios from 'axios';\nimport { Dispatch } from 'redux';\nimport { RootStore } from '../store';\nimport {\n\tDataActions,\n\tCLEAR_ADDRESS_DATA,\n\tADD_ADDRESS_DATA,\n\tADD_PACKAGE_TEMP_DATA,\n\tCLEAR_ERROR_FETCH_DATA,\n\tCLEAR_SERVICES_DATA,\n\tFETCH_ADDRESSES_DATA,\n\tFETCH_FAIL_DATA,\n\tFETCH_INIT_DATA,\n\tFETCH_PACKAGES_DATA,\n\tFETCH_SUCCESS_DATA,\n\tPOST_GUIDE_DATA,\n\tPOST_RATE_DATA,\n\tPOST_PICKUP_DATA,\n\tSET_BATCH_ID,\n\tServiceResponse,\n\tPackage,\n\tConsolidatedActions,\n\tSET_CARRIERS_CONSOLIDATED,\n\tNewAddress,\n\tREMOVE_PACKAGE,\n\tFlowActions,\n\tSendActions,\n\tSET_UNIQUE_CARRIER_SERVICES_FLOW,\n\tSET_FILTERED_SERVICES,\n\tEDIT_PACKAGE_TEMP_DATA,\n\tPickUpActions,\n\tCAN_MOVE_TO_BOOKLET_PICKUP,\n\tCLEAR_PARCEL_NUMBERS,\n\tSHOW_GLOBAL_INSURANCE_FLOW,\n\tRateRequest,\n\tSET_CARRIERS,\n\tCarrierList\n} from './ActionTypes';\nimport { removeStress } from '~util/removeStress';\nimport capitalize, { capitalizeAll } from '~util/capitalize';\nimport { splitTextIntoLines } from '~util/preview';\nimport { CARRIERS } from '~util/logos';\n\n// Get addreses fot the booklet\nexport const fetchAddresses = () => async (dispatch: Dispatch) => {\n\tdispatch({ type: FETCH_INIT_DATA });\n\n\t// fetch only once? //TODO add refresh button\n\t//console.log('getting addreses');\n\n\ttry {\n\t\tconst result = await axiosInstance.get('/api/addresses');\n\t\t//console.log('addreses result', result);\n\t\tdispatch({ type: FETCH_SUCCESS_DATA });\n\t\tconst addresses: NewAddress[] = result.data.map((addr: any) => ({\n\t\t\tid: addr.address.id,\n\t\t\taddress: addr.address.address,\n\t\t\talias: addr.address.alias,\n\t\t\tscope:\n\t\t\t\taddr.scope === 'global' ? 'global' : addr.scope === 'user' ? 'Personal' : 'departamental',\n\t\t\ttype: addr.address.type,\n\t\t\tcoordinates: addr.address.coordinates,\n\t\t\tstreet: addr.address.street,\n\t\t\tnumber: addr.address.number,\n\t\t\tsuite_number: addr.address.suite_number,\n\t\t\tcity: addr.address.city,\n\t\t\tbusiness_name: addr.address.business_name,\n\t\t\tneighborhood: addr.address.neighborhood,\n\t\t\tstate: addr.address.state,\n\t\t\tzip_code: addr.address.zip_code,\n\t\t\tcountry: addr.address.country,\n\t\t\tcontacts: addr.address.contacts\n\t\t}));\n\t\tdispatch({ type: FETCH_ADDRESSES_DATA, addresses: addresses });\n\t} catch (error) {\n\t\t//console.log('fetch address error', error.response);\n\t\tdispatch({\n\t\t\ttype: FETCH_FAIL_DATA,\n\t\t\tmessage: 'No se pudo obtener las direcciones'\n\t\t});\n\t}\n};\n\nexport const removeAddress = (id: string) => async (dispatch: Dispatch) => {\n\ttry {\n\t\tif (id.startsWith('t')) {\n\t\t\tdispatch({ type: REMOVE_PACKAGE, id });\n\t\t} else {\n\t\t\tawait axiosInstance.delete(`/api/address/${id}`);\n\t\t}\n\t} catch (error) {\n\t\t//console.error('Error when deleting package', error?.response);\n\t}\n};\n\nexport const clearAddressesData = (): DataActions => {\n\treturn { type: CLEAR_ADDRESS_DATA };\n};\n\nexport const fetchPackages =\n\t() => async (dispatch: Dispatch, getStore: () => RootStore) => {\n\t\tdispatch({ type: FETCH_INIT_DATA });\n\t\tconst { data } = getStore();\n\n\t\tif (!data.packages.length) {\n\t\t\ttry {\n\t\t\t\tconst response = await axiosInstance.get('/api/items');\n\t\t\t\t//console.log('fetched packages', response);\n\t\t\t\tdispatch({ type: FETCH_SUCCESS_DATA });\n\t\t\t\tconst packages: Package[] = response.data.map((pkg: any) => ({\n\t\t\t\t\tid: pkg.id,\n\t\t\t\t\talias: pkg.alias,\n\t\t\t\t\ttype: pkg.type,\n\t\t\t\t\tcontent: pkg.content,\n\t\t\t\t\tdescription: pkg.description,\n\t\t\t\t\tlength: pkg.length,\n\t\t\t\t\theight: pkg.height,\n\t\t\t\t\twidth: pkg.width,\n\t\t\t\t\tweight: pkg.weight\n\t\t\t\t}));\n\n\t\t\t\tdispatch({ type: FETCH_PACKAGES_DATA, packages });\n\t\t\t} catch (error) {\n\t\t\t\t//console.log('Error fetching packages', error.response);\n\t\t\t\tdispatch({\n\t\t\t\t\ttype: FETCH_FAIL_DATA,\n\t\t\t\t\tmessage: 'No se pudo obtener las direcciones'\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\nexport const addTempAddress = (address: NewAddress): DataActions => {\n\treturn { type: ADD_ADDRESS_DATA, address };\n};\n\nexport const createAddress = (address: NewAddress) => async (dispatch: Dispatch) => {\n\tdispatch({ type: FETCH_INIT_DATA });\n\ttry {\n\t\tconst payload = {\n\t\t\taddress: {\n\t\t\t\t...address\n\t\t\t},\n\t\t\tscope: address.scope\n\t\t};\n\t\t// TODO dispatch\n\t\t//dispatch({ type: ADD_ADDRESS_TEMP, address: {...address, id: new Date().toISOString()} as Address });\n\t\t// const result =\n\t\tawait axiosInstance.post('/api/address', payload);\n\t\t//console.log('[Data Actions] create address', result);\n\t\tdispatch({ type: FETCH_SUCCESS_DATA });\n\t} catch (error) {\n\t\t//console.log('create address error', error.response);\n\t\tdispatch({ type: FETCH_FAIL_DATA, message: 'No se pudo crear' });\n\t}\n};\n\nexport const addTempPackage = (pkg: Package): DataActions => {\n\treturn { type: ADD_PACKAGE_TEMP_DATA, package: pkg };\n};\n\nexport const updateTempPackage = (pkg: Package): DataActions => {\n\treturn { type: EDIT_PACKAGE_TEMP_DATA, package: pkg };\n};\n\nexport const createPackage = (pkg: Package) => async (dispatch: Dispatch) => {\n\tdispatch({ type: FETCH_INIT_DATA });\n\ttry {\n\t\tconst payload = {\n\t\t\t...pkg\n\t\t};\n\t\tconst response = await axios.post('/api/item', payload);\n\t\t//console.log('Created Package', response);\n\t\tdispatch({ type: FETCH_SUCCESS_DATA });\n\t\tdispatch({ type: ADD_PACKAGE_TEMP_DATA, package: response.data });\n\t} catch (error) {\n\t\t//console.error('Error when creating package', error?.response);\n\t\tdispatch({ type: FETCH_FAIL_DATA, message: 'No se pudo crear el paquete' });\n\t}\n};\n\nexport const removePackage = (id: string) => async (dispatch: Dispatch) => {\n\ttry {\n\t\tif (id.startsWith('t')) {\n\t\t\tdispatch({ type: REMOVE_PACKAGE, id });\n\t\t} else {\n\t\t\tawait axiosInstance.delete(`/api/item/${id}`);\n\t\t}\n\t} catch (error) {\n\t\t//console.error('Error when deleting package', error?.response);\n\t}\n};\n\nexport const clearError = (): DataActions => {\n\treturn { type: CLEAR_ERROR_FETCH_DATA };\n};\n\nexport const postRate =\n\t(notification?: (message: string) => void) =>\n\tasync (\n\t\tdispatch: Dispatch,\n\t\tgetStore: () => RootStore\n\t) => {\n\t\tconst { send, simulatedUser, rate, flow } = getStore();\n\n\t\ttry {\n\t\t\tdispatch({ type: FETCH_INIT_DATA });\n\t\t\tdispatch({ type: CLEAR_SERVICES_DATA });\n\t\t\tdispatch({ type: SET_FILTERED_SERVICES, services: [] });\n\n\t\t\tlet ensuredPackages = 0;\n\n\t\t\tconst pkgs =\n\t\t\t\tflow.currentFlow === 'send' ? send.currentPackagesSend : rate.currentPackagesRate;\n\n\t\t\tconst pkgsPaylod = pkgs.reduce((result: any, p) => {\n\t\t\t\tlet finalInsurance = 0;\n\t\t\t\tif (p.insurance && p.insurance > 0) {\n\t\t\t\t\tfinalInsurance = p.insurance;\n\t\t\t\t\tensuredPackages = ensuredPackages + (p.quantity ?? 1);\n\t\t\t\t}\n\n\t\t\t\treturn result.concat(\n\t\t\t\t\tnew Array(p.quantity).fill(p).map((p) => {\n\t\t\t\t\t\tif (finalInsurance > 0) {\n\t\t\t\t\t\t\treturn p.type === 'Sobre'\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\tlength: 30,\n\t\t\t\t\t\t\t\t\t\tweight: p.weight,\n\t\t\t\t\t\t\t\t\t\theight: 2,\n\t\t\t\t\t\t\t\t\t\twidth: 26,\n\t\t\t\t\t\t\t\t\t\t// Server wants insurance with decimals even if the user input an integer\n\t\t\t\t\t\t\t\t\t\tinsurance: +finalInsurance.toFixed(2),\n\t\t\t\t\t\t\t\t\t\ttype: p.type,\n\t\t\t\t\t\t\t\t\t\tmerchandise: p.merchandise,\n\t\t\t\t\t\t\t\t\t\tis_irregular_delivery: p.is_irregular_delivery ?? false,\n\t\t\t\t\t\t\t\t\t\tmeasurement: 'cm'\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\tlength: p.length,\n\t\t\t\t\t\t\t\t\t\tweight: p.weight,\n\t\t\t\t\t\t\t\t\t\theight: p.height,\n\t\t\t\t\t\t\t\t\t\twidth: p.width,\n\t\t\t\t\t\t\t\t\t\t// Server wants insurance with decimals even if the user input an integer\n\t\t\t\t\t\t\t\t\t\tinsurance: +finalInsurance.toFixed(2),\n\t\t\t\t\t\t\t\t\t\ttype: p.type,\n\t\t\t\t\t\t\t\t\t\tmerchandise: p.merchandise,\n\t\t\t\t\t\t\t\t\t\tis_irregular_delivery: p.is_irregular_delivery ?? false,\n\t\t\t\t\t\t\t\t\t\tmeasurement: p.measurement\n\t\t\t\t\t\t\t\t };\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn p.type === 'Sobre'\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tlength: 30,\n\t\t\t\t\t\t\t\t\tweight: p.weight,\n\t\t\t\t\t\t\t\t\theight: 2,\n\t\t\t\t\t\t\t\t\twidth: 26,\n\t\t\t\t\t\t\t\t\ttype: p.type,\n\t\t\t\t\t\t\t\t\tmerchandise: p.merchandise,\n\t\t\t\t\t\t\t\t\tis_irregular_delivery: p.is_irregular_delivery ?? false,\n\t\t\t\t\t\t\t\t\tmeasurement: 'cm'\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tlength: p.length,\n\t\t\t\t\t\t\t\t\tweight: p.weight,\n\t\t\t\t\t\t\t\t\theight: p.height,\n\t\t\t\t\t\t\t\t\twidth: p.width,\n\t\t\t\t\t\t\t\t\ttype: p.type,\n\t\t\t\t\t\t\t\t\tmerchandise: p.merchandise,\n\t\t\t\t\t\t\t\t\tis_irregular_delivery: p.is_irregular_delivery ?? false,\n\t\t\t\t\t\t\t\t\tmeasurement: p.measurement\n\t\t\t\t\t\t\t };\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}, []);\n\n\t\t\tif (flow.showGlobalInsuranceFlow) {\n\t\t\t\tdispatch({\n\t\t\t\t\ttype: SHOW_GLOBAL_INSURANCE_FLOW,\n\t\t\t\t\tshow: ensuredPackages > 0\n\t\t\t\t});\n\t\t\t\t// dispatch({ type: DISABLE_GLOBAL_INSURANCE_FLOW });\n\t\t\t}\n\n\t\t\tconst sendFlow = flow.currentFlow === 'send';\n\n\t\t\tconst dcoords = sendFlow\n\t\t\t\t? send.destinationAddressSend?.coordinates\n\t\t\t\t: rate.destinationAddressRate?.coordinates;\n\t\t\tconst ocoords = sendFlow\n\t\t\t\t? send.originAddressSend?.coordinates\n\t\t\t\t: rate.originAddressRate?.coordinates;\n\n\t\t\tconst neighborhood_orgin = sendFlow\n\t\t\t\t? send.originAddressSend?.neighborhood\n\t\t\t\t: rate.originAddressRate?.neighborhood;\n\t\t\tconst state_destination = sendFlow\n\t\t\t\t? send.destinationAddressSend?.state\n\t\t\t\t: rate.destinationAddressRate?.state;\n\t\t\tconst city_destination = sendFlow\n\t\t\t\t? send.destinationAddressSend?.city\n\t\t\t\t: rate.destinationAddressRate?.city;\n\n\t\t\tconst neighborhood_destionation = sendFlow\n\t\t\t\t? send.destinationAddressSend?.neighborhood\n\t\t\t\t: rate.destinationAddressRate?.neighborhood;\n\n\t\t\tconst payload: RateRequest = {\n\t\t\t\tpackages: pkgsPaylod,\n\t\t\t\tzip_destination: sendFlow\n\t\t\t\t\t? send.destinationAddressSend?.zip_code\n\t\t\t\t\t: rate.destinationAddressRate?.zip_code,\n\t\t\t\tzip_origin: sendFlow ? send.originAddressSend?.zip_code : rate.originAddressRate?.zip_code\n\t\t\t};\n\n\t\t\tif (dcoords) {\n\t\t\t\tpayload.coordinates_destination = dcoords;\n\t\t\t}\n\n\t\t\tif (ocoords) {\n\t\t\t\tpayload.coordinates_origin = ocoords;\n\t\t\t}\n\n\t\t\tif (neighborhood_orgin) {\n\t\t\t\tpayload.neighborhood_origin = neighborhood_orgin;\n\t\t\t}\n\n\t\t\tif (neighborhood_destionation) {\n\t\t\t\tpayload.neighborhood_destination = neighborhood_destionation;\n\t\t\t}\n\n\t\t\tif (state_destination) {\n\t\t\t\tpayload.state_destination = state_destination;\n\t\t\t}\n\n\t\t\tif (city_destination) {\n\t\t\t\tpayload.city_destination = city_destination;\n\t\t\t}\n\n\t\t\tif (simulatedUser.simulatedUser) {\n\t\t\t\tpayload.user_id = simulatedUser.simulatedUser.id;\n\t\t\t}\n\n\t\t\tconst result = await axiosInstance.post('/api/rate/label', payload);\n\n\t\t\tconst services = result.data.rates as ServiceResponse[];\n\n\t\t\tconst localCarriers: string[] = [];\n\t\t\tservices.forEach((s) => localCarriers.push(s.carrier));\n\n\t\t\tdispatch({\n\t\t\t\ttype: SET_UNIQUE_CARRIER_SERVICES_FLOW,\n\t\t\t\tcarriers: [...new Set(localCarriers)]\n\t\t\t});\n\t\t\tdispatch({ type: SET_BATCH_ID, batchId: result.data.batch_id });\n\n\t\t\tdispatch({ type: SET_FILTERED_SERVICES, services });\n\t\t\tdispatch({ type: POST_RATE_DATA, services });\n\t\t\tdispatch({ type: FETCH_SUCCESS_DATA });\n\n\t\t\t// set carriers for consolidated\n\t\t\tconst encamino = services.find((s) => s.carrier === 'encamino');\n\t\t\tif (encamino) {\n\t\t\t\tdispatch({\n\t\t\t\t\ttype: SET_CARRIERS_CONSOLIDATED,\n\t\t\t\t\tcarriers: encamino.carriers as string[]\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlet errorMessage = 'No se pudo cotizar, intente más tarde';\n\t\t\tif (axios.isAxiosError(error)) {\n\t\t\t\tif (\n\t\t\t\t\terror.response?.data?.message === 'WRONG_DATA' &&\n\t\t\t\t\t!!error.response?.data?.description.length\n\t\t\t\t) {\n\t\t\t\t\tconst descriptionList = error.response?.data?.description\n\t\t\t\t\t\t?.map((item: { [key: string]: string }) => Object.values(item))\n\t\t\t\t\t\t.flat();\n\t\t\t\t\tif (\n\t\t\t\t\t\tdescriptionList.some((item: string) =>\n\t\t\t\t\t\t\titem.includes('is not allowed for this measurement')\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\terrorMessage =\n\t\t\t\t\t\t\t'Las medidas superan lo permitido. Verifica las medidas y la unidad de medida.';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdispatch({\n\t\t\t\ttype: FETCH_FAIL_DATA,\n\t\t\t\tmessage: errorMessage\n\t\t\t});\n\t\t\tnotification && notification(errorMessage);\n\t\t}\n\t};\n\n// TODO move the pickup actions\nexport const postPickUp =\n\t(notify?: (message: string, severity?: 'error' | 'success') => void) =>\n\tasync (dispatch: Dispatch, getStore: () => RootStore) => {\n\t\tconst { pickup, simulatedUser } = getStore();\n\t\ttry {\n\t\t\tdispatch({ type: FETCH_INIT_DATA });\n\n\t\t\tconst resultLocation: { [key: string]: any } = {};\n\n\t\t\tObject.entries({ ...pickup.addressPickUp }).forEach(([key, value]) => {\n\t\t\t\tif (value !== undefined && value !== null && value !== '') {\n\t\t\t\t\tresultLocation[key] = value;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconst payload: any = {\n\t\t\t\tparcel_numbers: pickup.labelsPickup.map((l) => l.parcel_number),\n\t\t\t\tdate: (pickup.datePickUp as Date).toISOString().split('T')[0], // .toLocaleDateString().replace(/(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})/, '$3-$1-$1'),\n\t\t\t\tearliest_time: (pickup.startTimePickUp as Date)\n\t\t\t\t\t.toTimeString()\n\t\t\t\t\t.split(' ')[0]\n\t\t\t\t\t.replace(/(\\d{1,2}):(\\d{1,2}):(\\d{1,2})/, '$1:$2'),\n\t\t\t\tlatest_time: (pickup.endTimePickUp as Date)\n\t\t\t\t\t.toTimeString()\n\t\t\t\t\t.split(' ')[0]\n\t\t\t\t\t.replace(/(\\d{1,2}):(\\d{1,2}):(\\d{1,2})/, '$1:$2'),\n\t\t\t\tpackages: pickup.labelsPickup.reduce((prev, current) => {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tfor (const p of current.packages) {\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tprev.push(p);\n\t\t\t\t\t}\n\t\t\t\t\treturn prev;\n\t\t\t\t}, []),\n\n\t\t\t\tlocation: resultLocation\n\t\t\t};\n\n\t\t\tpayload.location.contact_name = pickup.addressPickUp?.contact?.name;\n\t\t\tpayload.location.phone_number = pickup.addressPickUp?.contact?.phone_number;\n\t\t\tpayload.location.email = pickup.addressPickUp?.contact?.email;\n\t\t\tpayload.location.coordinates = pickup.addressPickUp?.coordinates || undefined;\n\n\t\t\tpayload.location.suite_number = pickup.addressPickUp?.suite_number || undefined;\n\t\t\tpayload.location.reference = pickup.addressPickUp?.reference || undefined;\n\t\t\tpayload.location.reference_streets = pickup.addressPickUp?.reference_streets || undefined;\n\t\t\tpayload.location.country = 'Mexico';\n\t\t\tpayload.collect_in = pickup.indicationsPickUp || undefined;\n\t\t\tpayload.indications = pickup.extraIndicationsPickUp || undefined;\n\t\t\tpayload.location.number = pickup.addressPickUp?.number || 'S/N';\n\t\t\tdelete payload.location?.street1;\n\t\t\tdelete payload.location?.street2;\n\t\t\tdelete payload.location?.street3;\n\n\t\t\t// delete payload.location.alias;\n\n\t\t\tif (simulatedUser.simulatedUser) {\n\t\t\t\tpayload.user_id = simulatedUser.simulatedUser.id;\n\t\t\t}\n\n\t\t\tawait axiosInstance.post(`/api/label/${pickup.carrierPickup}/pickup`, payload);\n\t\t\tdispatch({ type: FETCH_SUCCESS_DATA });\n\t\t\t// TODO remove?\n\t\t\tdispatch({ type: POST_PICKUP_DATA, response: 'si' });\n\t\t\tdispatch({ type: CAN_MOVE_TO_BOOKLET_PICKUP, value: true });\n\t\t\tnotify && notify('La recolección fue generada con éxito', 'success');\n\t\t} catch (error) {\n\t\t\tif (axios.isAxiosError(error)) {\n\t\t\t\tnotify &&\n\t\t\t\t\tnotify(\n\t\t\t\t\t\ttypeof error.response?.data?.description === 'string'\n\t\t\t\t\t\t\t? error.response?.data?.description\n\t\t\t\t\t\t\t: 'No se pudo generar la recolección, intente más tarde'\n\t\t\t\t\t);\n\t\t\t}\n\t\t\tdispatch({\n\t\t\t\ttype: FETCH_FAIL_DATA,\n\t\t\t\tmessage: 'No se pudo generar la recolección, intente más tarde'\n\t\t\t});\n\t\t}\n\t};\n\nexport const getUserBalance = async (\n\tisRootOrAgent: boolean,\n\tsetAvailableBalance: (balance: number | null) => void,\n\tcustomerId?: number,\n\tuserId?: number\n) => {\n\ttry {\n\t\tconst url = userId\n\t\t\t? `/api/dispersion/balance/users?customer_id=${customerId}`\n\t\t\t: isRootOrAgent\n\t\t\t? `/api/dispersion/balance?customer_id=${customerId}`\n\t\t\t: '/api/dispersion/balance';\n\t\tconst { data } = await axiosInstance.get(url);\n\t\tif (userId) {\n\t\t\tconst userBalance = data.data?.find((item: any) => item.user_id === userId)?.remaining;\n\t\t\tsetAvailableBalance(userBalance ?? 0);\n\t\t} else if (isRootOrAgent) {\n\t\t\tconst userBalance = data?.remaining;\n\t\t\tsetAvailableBalance(userBalance ?? 0);\n\t\t} else {\n\t\t\tsetAvailableBalance(data?.remaining);\n\t\t}\n\t} catch (error) {\n\t\tconsole.error(error);\n\t}\n};\n\n// TODO move to send actions\nexport const postLabel =\n\t(notify: (message: string, severity?: 'error' | 'success' | 'info' | 'warning') => void) =>\n\tasync (dispatch: Dispatch, getStore: () => RootStore) => {\n\t\tconst { send, simulatedUser } = getStore();\n\n\t\ttry {\n\t\t\tdispatch({ type: FETCH_INIT_DATA });\n\t\t\tdispatch({ type: CLEAR_PARCEL_NUMBERS });\n\n\t\t\tif (!(send.originAddressSend?.tax_id && send.destinationAddressSend?.tax_id)) {\n\t\t\t\tnotify(\n\t\t\t\t\t'Para crear la guía es necesario que la dirección de origen y dirección destino cuenten con RFC'\n\t\t\t\t);\n\t\t\t\tdispatch({ type: FETCH_SUCCESS_DATA });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serviceSend = send.serviceSend!;\n\n\t\t\tconst pkgsPaylod = send.currentPackagesSend.reduce((result: any, p) => {\n\t\t\t\tlet finalInsurance = 0;\n\n\t\t\t\tif (send.showInsuranceOnSummary && p.insurance && p.insurance > 0) {\n\t\t\t\t\tfinalInsurance = p.insurance;\n\t\t\t\t}\n\t\t\t\treturn result.concat(\n\t\t\t\t\tnew Array(p.quantity).fill(p).map((p) => {\n\t\t\t\t\t\tconst packageType =\n\t\t\t\t\t\t\tp.type?.toLowerCase() === 'sobre' &&\n\t\t\t\t\t\t\t!p.content?.toLowerCase()?.includes('documentos') &&\n\t\t\t\t\t\t\tserviceSend?.carrier?.toLowerCase() === CARRIERS.ESTAFETA\n\t\t\t\t\t\t\t\t? 'Caja'\n\t\t\t\t\t\t\t\t: p.type;\n\t\t\t\t\t\tconst payloadData: any = {\n\t\t\t\t\t\t\tlength: p.length,\n\t\t\t\t\t\t\tweight: p.weight,\n\t\t\t\t\t\t\theight: p.height,\n\t\t\t\t\t\t\twidth: p.width,\n\t\t\t\t\t\t\ttype: packageType,\n\t\t\t\t\t\t\tcontent: p.content,\n\t\t\t\t\t\t\tdescription: p.description ? p.description : p.content,\n\t\t\t\t\t\t\tis_irregular_delivery: p.is_irregular_delivery ?? false,\n\t\t\t\t\t\t\tmeasurement: p.measurement\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (finalInsurance > 0) {\n\t\t\t\t\t\t\tpayloadData.insurance = finalInsurance;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(serviceSend.carrier === 'estafeta' &&\n\t\t\t\t\t\t\t\tserviceSend.service_description.includes('LTL')) ||\n\t\t\t\t\t\t\tserviceSend.carrier === 'fedex' ||\n\t\t\t\t\t\t\t(p.type === 'Tarima' && serviceSend.carrier === 'paquetexpress')\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst merchandiseList = p.merchandise.map((item: Partial) => {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tid: item.id,\n\t\t\t\t\t\t\t\t\tcurrency: item.currency,\n\t\t\t\t\t\t\t\t\tproduct_code: item.product_code,\n\t\t\t\t\t\t\t\t\tquantity: item.quantity,\n\t\t\t\t\t\t\t\t\tunit_code: item.unit_code,\n\t\t\t\t\t\t\t\t\tvalue: item.value\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tpayloadData.merchandise = merchandiseList;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn payloadData;\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}, []);\n\n\t\t\t//Find out if the origin address contains an phone extension. If it doesn't have the extension field, it is not sent to the db\n\t\t\tconst formattedOriginType = {\n\t\t\t\talias: send.originAddressSend?.alias,\n\t\t\t\ttax_id: send.originAddressSend?.tax_id.toUpperCase(),\n\t\t\t\ttype: send.originAddressSend?.type || undefined,\n\t\t\t\tnumber: send.originAddressSend?.number || undefined,\n\t\t\t\tcountry: capitalize(removeStress(send.originAddressSend?.country)),\n\t\t\t\tsuite_number: send.originAddressSend?.suite_number || undefined,\n\t\t\t\treference: send.originAddressSend?.reference\n\t\t\t\t\t? capitalizeAll(send.originAddressSend?.reference)\n\t\t\t\t\t: undefined,\n\t\t\t\treference_streets: send.originAddressSend?.reference_streets\n\t\t\t\t\t? capitalizeAll(send.originAddressSend?.reference_streets)\n\t\t\t\t\t: undefined,\n\t\t\t\tstreet:\n\t\t\t\t\tserviceSend.carrier === 'dhl' || serviceSend.carrier === 'estafeta'\n\t\t\t\t\t\t? capitalizeAll(send.originAddressSend?.street1)\n\t\t\t\t\t\t: capitalizeAll(send.originAddressSend?.street),\n\t\t\t\tzip_code: send.originAddressSend?.zip_code,\n\t\t\t\tcoordinates: send.originAddressSend?.coordinates || undefined,\n\t\t\t\tneighborhood: send.originAddressSend?.neighborhood,\n\t\t\t\tcity: send.originAddressSend?.city,\n\t\t\t\tstate: send.originAddressSend?.state,\n\t\t\t\tcontact_name: capitalizeAll(send.originAddressSend?.contact?.name),\n\t\t\t\tbusiness_name: send.originAddressSend?.business_name?.toUpperCase(),\n\t\t\t\temail: send.originAddressSend?.contact?.email,\n\t\t\t\tphone_number: send.originAddressSend?.contact?.phone_number,\n\t\t\t\ttype_phone_number: send.originAddressSend?.contact?.type,\n\t\t\t\textension: send.originAddressSend?.contact?.extension || undefined\n\t\t\t};\n\n\t\t\t//Find out if the destination address contains an phone extension. If it doesn't have the extension field, it is not sent to the db\n\t\t\tconst formattedDestinationType = {\n\t\t\t\talias: send.destinationAddressSend?.alias,\n\t\t\t\ttax_id: send.destinationAddressSend?.tax_id.toUpperCase(),\n\t\t\t\ttype: send.destinationAddressSend?.type || undefined,\n\t\t\t\tnumber: send.destinationAddressSend?.number || undefined,\n\t\t\t\tcountry: capitalize(removeStress(send.destinationAddressSend?.country)),\n\t\t\t\tsuite_number: send.destinationAddressSend?.suite_number || undefined,\n\t\t\t\treference: send.destinationAddressSend?.reference || undefined,\n\t\t\t\treference_streets: send.destinationAddressSend?.reference_streets || undefined,\n\t\t\t\tstreet:\n\t\t\t\t\tserviceSend.carrier === 'dhl' || serviceSend.carrier === 'estafeta'\n\t\t\t\t\t\t? send.destinationAddressSend?.street1\n\t\t\t\t\t\t: send.destinationAddressSend?.street,\n\t\t\t\tzip_code: send.destinationAddressSend?.zip_code,\n\t\t\t\tcoordinates: send.destinationAddressSend?.coordinates || undefined,\n\t\t\t\tneighborhood: send.destinationAddressSend?.neighborhood,\n\t\t\t\tcity: send.destinationAddressSend?.city,\n\t\t\t\tstate: send.destinationAddressSend?.state,\n\t\t\t\tcontact_name: capitalizeAll(send.destinationAddressSend?.contact?.name),\n\t\t\t\tphone_number: send.destinationAddressSend?.contact?.phone_number,\n\t\t\t\ttype_phone_number: send.destinationAddressSend?.contact?.type,\n\t\t\t\temail: send.destinationAddressSend?.contact?.email,\n\t\t\t\tbusiness_name: send.destinationAddressSend?.business_name?.toUpperCase(),\n\t\t\t\textension: send.destinationAddressSend?.contact?.extension || undefined\n\t\t\t};\n\n\t\t\tconst payload: any = {\n\t\t\t\tuse_trading: send.value === 'prepaid',\n\t\t\t\tcarrier: send.serviceSend?.carrier,\n\t\t\t\tbatch_id: send.batchId,\n\t\t\t\trate_id: send.serviceSend?.rate_id,\n\t\t\t\tservice_id: send.serviceSend?.service_id,\n\t\t\t\torigin_info: formattedOriginType,\n\t\t\t\tdestination_info: formattedDestinationType,\n\t\t\t\tpackages: pkgsPaylod\n\t\t\t};\n\n\t\t\tswitch (serviceSend.carrier) {\n\t\t\t\tcase 'estafeta':\n\t\t\t\t\tpayload.wants_to_save_output_type = send.wantsToSaveOutputTypeForEstafeta;\n\t\t\t\t\tpayload.output_type = send.estafetaOutputType;\n\n\t\t\t\t\tpayload.destination_info.street2 = send.destinationAddressSend?.street2 || undefined;\n\t\t\t\t\tpayload.destination_info.street3 = send.destinationAddressSend?.street3 || undefined;\n\t\t\t\t\tpayload.origin_info.street2 = send.originAddressSend?.street2 || undefined;\n\t\t\t\t\tpayload.origin_info.street3 = send.originAddressSend?.street3 || undefined;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'fedex':\n\t\t\t\t\tpayload.wants_to_save_output_type = send.wantsToSaveOutputTypeForEstafeta;\n\t\t\t\t\tpayload.output_type = send.estafetaOutputType;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'dhl':\n\t\t\t\t\tdelete payload.origin_info.number;\n\t\t\t\t\tdelete payload.origin_info.suite_number;\n\t\t\t\t\tdelete payload.destination_info.number;\n\t\t\t\t\tdelete payload.destination_info.suite_number;\n\n\t\t\t\t\tlet streetOrigin = [\n\t\t\t\t\t\tsend.originAddressSend.street1,\n\t\t\t\t\t\tsend.originAddressSend.street2,\n\t\t\t\t\t\tsend.originAddressSend.street3\n\t\t\t\t\t]\n\t\t\t\t\t\t.join(' ')\n\t\t\t\t\t\t.trim();\n\t\t\t\t\tlet streetDestination = [\n\t\t\t\t\t\tsend.destinationAddressSend.street1,\n\t\t\t\t\t\tsend.destinationAddressSend.street2,\n\t\t\t\t\t\tsend.destinationAddressSend.street3\n\t\t\t\t\t]\n\t\t\t\t\t\t.join(' ')\n\t\t\t\t\t\t.trim();\n\n\t\t\t\t\tif (send.originAddressSend?.number) {\n\t\t\t\t\t\tstreetOrigin += ` Ext. ${send.originAddressSend.number}`;\n\t\t\t\t\t}\n\t\t\t\t\tif (send.destinationAddressSend?.number) {\n\t\t\t\t\t\tstreetDestination += ` Ext. ${send.destinationAddressSend.number}`;\n\t\t\t\t\t}\n\t\t\t\t\tif (send.originAddressSend?.suite_number) {\n\t\t\t\t\t\tstreetOrigin += ` Int. ${send.originAddressSend.suite_number}`;\n\t\t\t\t\t}\n\t\t\t\t\tif (send.destinationAddressSend?.suite_number) {\n\t\t\t\t\t\tstreetDestination += ` Int. ${send.destinationAddressSend.suite_number}`;\n\t\t\t\t\t}\n\t\t\t\t\tstreetOrigin += ` Col. ${send.originAddressSend.neighborhood}`;\n\t\t\t\t\tstreetDestination += ` Col. ${send.destinationAddressSend.neighborhood}`;\n\n\t\t\t\t\tconst [streetOrigin1, streetOrigin2, streetOrigin3] = splitTextIntoLines({\n\t\t\t\t\t\ttext: streetOrigin,\n\t\t\t\t\t\tmaxCharactersPerLine: 45\n\t\t\t\t\t});\n\t\t\t\t\tconst [streetDestination1, streetDestination2, streetDestination3] = splitTextIntoLines({\n\t\t\t\t\t\ttext: streetDestination,\n\t\t\t\t\t\tmaxCharactersPerLine: 45\n\t\t\t\t\t});\n\n\t\t\t\t\tpayload.origin_info.street = streetOrigin1;\n\t\t\t\t\tpayload.origin_info.street2 = streetOrigin2 || undefined;\n\t\t\t\t\tpayload.origin_info.street3 = streetOrigin3 || undefined;\n\t\t\t\t\tpayload.destination_info.street = streetDestination1;\n\t\t\t\t\tpayload.destination_info.street2 = streetDestination2 || undefined;\n\t\t\t\t\tpayload.destination_info.street3 = streetDestination3 || undefined;\n\t\t\t\t\t// payload.destination_info.street2 = send.destinationAddressSend?.street2 || undefined;\n\t\t\t\t\t// payload.destination_info.street3 = send.destinationAddressSend?.street3 || undefined;\n\t\t\t\t\t// payload.origin_info.street2 = send.originAddressSend?.street2 || undefined;\n\t\t\t\t\t// payload.origin_info.street3 = send.originAddressSend?.street3 || undefined;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'paquetexpress':\n\t\t\t\t\tpayload.wants_to_save_output_type = send.wantsToSaveOutputTypeForEstafeta;\n\t\t\t\t\tpayload.output_type = send.estafetaOutputType;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Ocurre: to destination office\n\t\t\tif (!!send.destinationAddressSend.ocurre_office && serviceSend.carrier === 'paquetexpress') {\n\t\t\t\tpayload.destination_info.ocurre_office = send.destinationAddressSend.ocurre_office;\n\t\t\t\tpayload.destination_info.coordinates = send.destinationAddressSend?.coordinates\n\t\t\t\t\t? Object.values(send.destinationAddressSend?.coordinates).join(',')\n\t\t\t\t\t: undefined;\n\t\t\t}\n\n\t\t\tif (send.reference) {\n\t\t\t\tpayload.reference = send.reference;\n\t\t\t}\n\n\t\t\tif (send.additionalInfo) {\n\t\t\t\tpayload.additional_info = send.additionalInfo;\n\t\t\t}\n\n\t\t\tif (send.channel) {\n\t\t\t\tpayload.channel = send.channel;\n\t\t\t}\n\n\t\t\tif (simulatedUser.simulatedUser) {\n\t\t\t\tpayload.user_id = simulatedUser.simulatedUser.id;\n\t\t\t}\n\n\t\t\tif (send.notifications) {\n\t\t\t\tpayload.notification_contacts = send.notifications;\n\t\t\t}\n\n\t\t\tif (send.business) {\n\t\t\t\tpayload.business_id = send.business.id;\n\t\t\t}\n\t\t\tlet total = serviceSend!.label_price || 0 + serviceSend?.insurance;\n\t\t\ttotal += serviceSend?.irregular_delivery_price || 0;\n\t\t\ttotal += serviceSend?.reissue_price || 0;\n\t\t\ttotal += serviceSend?.overweight_price || 0;\n\n\t\t\tconst result = await axiosInstance.post('/api/label', payload);\n\n\t\t\tdispatch({ type: FETCH_SUCCESS_DATA });\n\t\t\tdispatch({\n\t\t\t\ttype: POST_GUIDE_DATA,\n\t\t\t\tlabels: result.data.labels.map((label: any) => ({\n\t\t\t\t\t...payload,\n\t\t\t\t\tparcelNumber: label.parcel_number,\n\t\t\t\t\tparcel_number: label.parcel_number,\n\t\t\t\t\tpdf: label.pdf,\n\t\t\t\t\torigin: payload.origin_info,\n\t\t\t\t\tdestination: payload.destination_info\n\t\t\t\t})),\n\t\t\t\ttotal\n\t\t\t});\n\t\t\tnotify(`Fueron creadas ${result.data.labels.length} guías con éxito.`, 'success');\n\t\t} catch (error) {\n\t\t\tif (axios.isAxiosError(error)) {\n\t\t\t\tif (typeof error === 'string') notify(error);\n\t\t\t\tconst errorStatus = error?.response?.status ?? undefined;\n\t\t\t\tconst errorDescription = error?.response?.data?.description ?? 'Hubo un error';\n\n\t\t\t\tif (errorStatus === 402) {\n\t\t\t\t\tnotify('No hay guias disponibles para crearla, pide que te asignen más');\n\t\t\t\t} else if (errorStatus === 503 && errorDescription !== 'Not further details') {\n\t\t\t\t\tnotify(errorDescription);\n\t\t\t\t} else if (errorStatus === 405 && errorDescription !== 'Not further details') {\n\t\t\t\t\tnotify(errorDescription);\n\t\t\t\t} else if (errorDescription === 'Not further details' && error?.response?.data?.code) {\n\t\t\t\t\tnotify(error?.response?.data?.code);\n\t\t\t\t} else {\n\t\t\t\t\tnotify(\n\t\t\t\t\t\t'No fue posible generar la guia, contacte al equipo de Encamino para más información'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tdispatch({ type: FETCH_FAIL_DATA, message: '' });\n\t\t\t}\n\t\t} finally {\n\t\t\t// Clear temporal addresses\n\t\t\tdispatch({ type: CLEAR_ADDRESS_DATA });\n\t\t}\n\t};\n\nexport const resetCreatedLabels = () => (dispatch: Dispatch) => {\n\tdispatch({ type: CLEAR_PARCEL_NUMBERS });\n};\n\nexport const setCarriersList = (carriers: CarrierList) => (dispatch: Dispatch) => {\n\tdispatch({ type: SET_CARRIERS, carriers });\n};\n","import { Dispatch } from 'react';\nimport {\n\tADD_PACKAGE_SEND,\n\tADD_MERCHANDISE_PACKAGE_SEND,\n\tCAN_CONTINUE_TO_RATE_SEND,\n\tCAN_CONTINUE_TO_SUMMARY_SEND,\n\tSET_ORIGIN_ADDRESS_SEND,\n\tSET_DESTINATION_ADDRESS_SEND,\n\tSET_ORIGIN_CONTACT_SEND,\n\tSET_DESTINATION_CONTACT_SEND,\n\tREMOVE_PACKAGE_SEND,\n\tSET_SERVICE_SEND,\n\tSWIPE_ADDRESS_SEND,\n\tTRIGGER_VALIDATE_BEFORE_RATE_SEND,\n\tUPDATE_COLUMN_PACKAGE_SEND,\n\tSET_ADDRESS_QUERY,\n\tAddressRequest,\n\tSendActions,\n\tContact,\n\tPackage,\n\tID,\n\tServiceRequest,\n\tPayloadPackageRequest,\n\tRESET_SEND,\n\tRESET_SERVICE_SEND,\n\tSET_FORM_PACKAGES_VALID_SEND,\n\tSET_INSURANCE_ON_SUMMARY,\n\tSET_FORMATTED_ADDRESS,\n\tSET_ESTAFETA_OUTPUT_TYPE,\n\tSET_SAVE_ESTAFETA_OUTPUT_TYPE,\n\tSET_EXTRA_INFORMATION,\n\tSET_NOTIFICATIONS,\n\tNotificationContacts,\n\tNewBusiness,\n\tChannel,\n\tRESET_PACKAGES\n} from './ActionTypes';\n\nexport const setAddressSend =\n\t(address: AddressRequest | null, target: 'destination' | 'origin', contacts: Contact[]) =>\n\t(dispatch: Dispatch) => {\n\t\tif (target === 'destination') {\n\t\t\tdispatch({ type: SET_DESTINATION_ADDRESS_SEND, address, contacts });\n\t\t} else {\n\t\t\tdispatch({ type: SET_ORIGIN_ADDRESS_SEND, address, contacts });\n\t\t}\n\t\tdispatch({ type: CAN_CONTINUE_TO_RATE_SEND });\n\t};\n\nexport const setContactSend =\n\t(contact: Contact | null, target: 'destination' | 'origin') =>\n\t(dispatch: Dispatch) => {\n\t\tif (target === 'destination') {\n\t\t\tdispatch({ type: SET_DESTINATION_CONTACT_SEND, contact });\n\t\t} else {\n\t\t\tdispatch({ type: SET_ORIGIN_CONTACT_SEND, contact });\n\t\t}\n\t\tdispatch({ type: CAN_CONTINUE_TO_RATE_SEND });\n\t};\n\nexport const addPkgSend = (pkg: Package) => (dispatch: Dispatch) => {\n\tdispatch({ type: ADD_PACKAGE_SEND, pkg });\n\tdispatch({ type: CAN_CONTINUE_TO_RATE_SEND });\n};\n\nexport const removePackageSend = (id: ID) => (dispatch: Dispatch) => {\n\tdispatch({ type: REMOVE_PACKAGE_SEND, id });\n\tdispatch({ type: CAN_CONTINUE_TO_RATE_SEND });\n};\nexport const updatePkgSend = (\n\tpkg_id: string | number,\n\tpayload: PayloadPackageRequest,\n\tmerchandiseId?: string\n): SendActions => {\n\treturn { type: UPDATE_COLUMN_PACKAGE_SEND, pkg_id, payload, merchandiseId };\n};\nexport const addMerchandisePkgSend = (pkg_id: string | number, payload: Merchandise) => {\n\treturn { type: ADD_MERCHANDISE_PACKAGE_SEND, pkg_id, payload };\n};\nexport const setServiceSend = (service: ServiceRequest) => (dispatch: Dispatch) => {\n\tdispatch({ type: SET_SERVICE_SEND, service });\n\tdispatch({ type: CAN_CONTINUE_TO_SUMMARY_SEND });\n};\n\nexport const swipeAddressSend = (): SendActions => {\n\treturn { type: SWIPE_ADDRESS_SEND };\n};\n\nexport const triggerValidationsSend = (status: boolean): SendActions => {\n\treturn { type: TRIGGER_VALIDATE_BEFORE_RATE_SEND, status };\n};\n\nexport const setValidateFormPkgsSend = (status: boolean) => (dispatch: Dispatch) => {\n\tdispatch({ type: SET_FORM_PACKAGES_VALID_SEND, status });\n\tdispatch({ type: CAN_CONTINUE_TO_RATE_SEND });\n};\n\nexport const resetSend = (): SendActions => {\n\treturn { type: RESET_SEND };\n};\n\nexport const resetPackages = (): SendActions => {\n\treturn { type: RESET_PACKAGES };\n};\n\nexport const setAddressQuery = (\n\tquery: string | null,\n\ttarget: 'origin' | 'destination'\n): SendActions => {\n\treturn {\n\t\ttype: SET_ADDRESS_QUERY,\n\t\tquery: query,\n\t\ttarget: target\n\t};\n};\n\nexport const resetServiceSend = (): SendActions => {\n\treturn { type: RESET_SERVICE_SEND };\n};\n\n/**\n * To show the insurance on the summary\n */\nexport const setInsuranceOnSummary = (status: boolean) => {\n\treturn { type: SET_INSURANCE_ON_SUMMARY, status };\n};\n\nexport const setFormattedAddresses = (origin: any, destination: any) => {\n\treturn { type: SET_FORMATTED_ADDRESS, origin, destination };\n};\n\nexport const setExtraInformation = (\n\treference: string,\n\tadditionalInfo: any,\n\tbusiness: NewBusiness,\n\tchannel: Channel\n) => {\n\tif (business) {\n\t\treturn { type: SET_EXTRA_INFORMATION, reference, additionalInfo, business, channel };\n\t} else {\n\t\treturn { type: SET_EXTRA_INFORMATION, reference, additionalInfo, channel };\n\t}\n};\n\nexport const setNotificationsContacts = (notifications: NotificationContacts) => {\n\treturn { type: SET_NOTIFICATIONS, notifications };\n};\n\nexport const setEstafetaOutputType = (outputType: string | null) => {\n\treturn { type: SET_ESTAFETA_OUTPUT_TYPE, outputType: outputType };\n};\n\nexport const setSaveEstafetaOutputType = (save: boolean) => {\n\treturn { type: SET_SAVE_ESTAFETA_OUTPUT_TYPE, save: save };\n};\n"],"sourceRoot":""}