{"version":3,"file":"bearingSearch-7ea6206a.js","sources":["../../js/engineering-tools/components/BearingTypeAssistance.tsx","../../js/engineering-tools/bearing-search/reducer.ts","../../js/engineering-tools/components/bearing-type-dropdown/reducer.ts","../../js/engineering-tools/components/bearing-type-dropdown/BearingTypeDropdown.tsx","../../js/engineering-tools/components/bearing-search-results/reducer.ts","../../js/engineering-tools/components/bearing-search-results/BearingSearchResults.tsx","../../js/engineering-tools/bearing-search/BearingSearch.tsx","../../js/engineering-tools/bearing-search/index.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { helpMeChooseData } from '../../components/bearing-search/api/api';\nimport { text } from '../data';\nimport { generateId, purgeHtml } from '../utils/engineering-tools';\nimport { BearingCharacteristicGrade } from '../../components/bearing-search/types/types';\n\ntype AssistedTypeOption = {\n\tid: string;\n\tlabel: string;\n\thtml: string;\n\tselected: boolean;\n\tpartTypes: string[];\n\tcharacteristics: Record;\n};\n\ninterface BearingTypeAssistanceProps {\n\tonCancel: () => void;\n\tonApply: ( types: string[] ) => void;\n}\n\nconst BearingTypeAssistance: React.FC = ( {\n\tonApply,\n\tonCancel,\n} ) => {\n\tconst [ assistedTypes, setAssistedTypes ] = useState( [] );\n\n\tuseEffect( () => {\n\t\tconst types = helpMeChooseData.bearingTypes.map( ( type ) => {\n\t\t\tconst typeLabel = purgeHtml( type.label );\n\t\t\tconst typeId = generateId( typeLabel );\n\n\t\t\treturn {\n\t\t\t\tid: typeId,\n\t\t\t\tlabel: typeLabel,\n\t\t\t\thtml: type.label,\n\t\t\t\tselected: false,\n\t\t\t\tpartTypes: type.part_types ? type.part_types.split( ',' ) : [],\n\t\t\t\tcharacteristics: type.characteristics,\n\t\t\t} as AssistedTypeOption;\n\t\t} );\n\n\t\tsetAssistedTypes( types );\n\t}, [] );\n\n\tconst toggleAssistedType = ( index: number ) => {\n\t\tconst types = [ ...assistedTypes ];\n\n\t\tif ( ! types[ index ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttypes[ index ].selected = ! types[ index ].selected;\n\t\tsetAssistedTypes( types );\n\t};\n\n\tconst apply = () => {\n\t\tconst partTypes: string[] = [];\n\n\t\tassistedTypes\n\t\t\t.filter( ( type ) => type.selected )\n\t\t\t.forEach( ( type ) => {\n\t\t\t\tfor ( const partType of type.partTypes ) {\n\t\t\t\t\tif ( ! partTypes.includes( partType ) ) {\n\t\t\t\t\t\tpartTypes.push( partType );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\n\t\tonApply( partTypes );\n\t\treset();\n\t};\n\n\tconst cancel = () => {\n\t\treset();\n\t\tonCancel();\n\t};\n\n\tconst reset = () => {\n\t\tconst types = assistedTypes.map( ( type ) => {\n\t\t\treturn {\n\t\t\t\t...type,\n\t\t\t\tselected: false,\n\t\t\t} as AssistedTypeOption;\n\t\t} );\n\n\t\tsetAssistedTypes( types );\n\t};\n\n\treturn (\n\t\t
\n\t\t\t

{helpMeChooseData.title || ''}

\n\t\t\t

\n\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{assistedTypes.map( ( type, index ) => {\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\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{Object.keys( helpMeChooseData.characteristics ).map(\n\t\t\t\t\t\t\t( characteristic ) => {\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\n\t\t\t\t\t\t\t\t\t\t{assistedTypes.map( ( type ) => {\n\t\t\t\t\t\t\t\t\t\t\tconst grade = type.characteristics[ characteristic ];\n\n\t\t\t\t\t\t\t\t\t\t\tconst cssClass: Record<\n\t\t\t\t\t\t\t\t\t\t\t\tBearingCharacteristicGrade,\n\t\t\t\t\t\t\t\t\t\t\t\tstring\n\t\t\t\t\t\t\t\t\t\t\t> = {\n\t\t\t\t\t\t\t\t\t\t\t\texcellent: 'c-help-me-choose__data--positive',\n\t\t\t\t\t\t\t\t\t\t\t\tgood: 'c-help-me-choose__data--positive',\n\t\t\t\t\t\t\t\t\t\t\t\tfair: '',\n\t\t\t\t\t\t\t\t\t\t\t\tpoor: 'c-help-me-choose__data--negative',\n\t\t\t\t\t\t\t\t\t\t\t\tunsuitable: 'c-help-me-choose__data--negative',\n\t\t\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\t\t\treturn (\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{helpMeChooseData.performances[ grade ]}\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
{text.characteristic}\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t toggleAssistedType( index )}\n\t\t\t\t\t\t\t\t\t\t\t\taria-label={type.label}\n\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\t\t{helpMeChooseData.characteristics[ characteristic ]}\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t type.selected )}\n\t\t\t\t\tonClick={() => apply()}\n\t\t\t\t>\n\t\t\t\t\t{text.apply}\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t);\n};\n\nexport default BearingTypeAssistance;\n","import React from 'react';\nimport { BearingAdvancedFilterKey, BearingPayload, BearingTypeCode, TimkenUnit, UnitType } from '../../components/bearing-search/types/types';\nimport { getTooltip, handleActionError } from '../utils/engineering-tools';\nimport { bearingSearchLabels, text } from '../data';\nimport { convertNumberInput, isValidBoundary } from '../utils/validations';\n\nexport type BearingSearchState = {\n\tunit: TimkenUnit;\n\tmarketPlaceDescription: string;\n\tpartType: string[];\n\tbearingType: string[];\n\tbearingSubType: string[];\n\tadvancedFilters: BearingAdvancedFilterMap;\n\tvalidation: BearingAdvancedFilterValidationMap;\n\trequestData?: Partial;\n};\n\nexport type BearingAdvancedFilter = {\n\tid: string;\n\tlabel: string;\n\tvalue?: number;\n\ttype: UnitType;\n\ttooltip?: string;\n\tisApplicable?: boolean;\n};\n\ntype BearingAdvancedFilterMap = { [Property in BearingAdvancedFilterKey]: BearingAdvancedFilter };\ntype BearingAdvancedFilterValidationMap = Map;\n\nconst defaultFilterValue: Pick = {\n\ttype: 'length',\n\tisApplicable: true,\n};\n\nconst filterPairs: Array<[BearingAdvancedFilterKey, BearingAdvancedFilterKey]> = [\n\t[ 'boreMinimum', 'boreMaximum' ],\n\t[ 'outerDiameterMinimum', 'outerDiameterMaximum' ],\n\t[ 'bearingWidthMinimum', 'bearingWidthMaximum' ],\n\t[ 'c1RatingMinimum', 'c1RatingMaximum' ],\n\t[ 'c90RatingMinimum', 'c90RatingMaximum' ],\n\t[ 'ceRatingMinimum', 'ceRatingMaximum' ],\n\t[ 'kFactorMinimum', 'kFactorMaximum' ],\n\t[ 'y1FactorMinimum', 'y1FactorMaximum' ],\n];\n\nconst getValidationMap = ( state?: BearingSearchState ): BearingAdvancedFilterValidationMap => {\n\tif ( ! state ) {\n\t\t// assign initial value\n\t\tconst initialValidationMap: BearingAdvancedFilterValidationMap = new Map();\n\n\t\tfilterPairs.forEach( ( [ min, max ] ) => {\n\t\t\tinitialValidationMap.set( min, {\n\t\t\t\tmessage: text.errorBoundaryLower,\n\t\t\t\tinvalid: false,\n\t\t\t} );\n\n\t\t\tinitialValidationMap.set( max, {\n\t\t\t\tmessage: text.errorBoundaryUpper,\n\t\t\t\tinvalid: false,\n\t\t\t} );\n\t\t} );\n\n\t\treturn initialValidationMap;\n\t}\n\n\tconst { advancedFilters: filters, validation: map } = state;\n\n\tconst validation = new Map(Object.entries(map || {}));\n\n\tfilterPairs.forEach( ( [ min, max ] ) => {\n\t\tconst invalid = ! isValidBoundary( filters[ min ].value, filters[ max ].value );\n\n\t\tvalidation.set( min, {\n\t\t\tinvalid,\n\t\t\tmessage: text.errorBoundaryLower,\n\t\t} );\n\t\tvalidation.set( max, {\n\t\t\tinvalid,\n\t\t\tmessage: text.errorBoundaryUpper,\n\t\t} );\n\t} );\n\n\treturn validation;\n};\n\nconst initialAdvancedFilters: BearingAdvancedFilterMap = {\n\tboreMinimum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_bore_min',\n\t\tlabel: bearingSearchLabels.boreMinimum || '',\n\t\ttooltip: bearingSearchLabels.boreMinimum && getTooltip( bearingSearchLabels.boreMinimum ),\n\t},\n\tboreMaximum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_bore_max',\n\t\tlabel: bearingSearchLabels.boreMaximum || '',\n\t\ttooltip: bearingSearchLabels.boreMaximum && getTooltip( bearingSearchLabels.boreMaximum ),\n\t},\n\touterDiameterMinimum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_out_diameter_min',\n\t\tlabel: bearingSearchLabels.outerDiameterMinimum || '',\n\t\ttooltip: bearingSearchLabels.outerDiameterMinimum && getTooltip( bearingSearchLabels.outerDiameterMinimum ),\n\t},\n\touterDiameterMaximum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_out_diameter_max',\n\t\tlabel: bearingSearchLabels.outerDiameterMaximum || '',\n\t\ttooltip: bearingSearchLabels.outerDiameterMaximum && getTooltip( bearingSearchLabels.outerDiameterMaximum ),\n\t},\n\tbearingWidthMinimum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_width_min',\n\t\tlabel: bearingSearchLabels.bearingWidthMinimum || '',\n\t\ttooltip: bearingSearchLabels.bearingWidthMinimum && getTooltip( bearingSearchLabels.bearingWidthMinimum ),\n\t},\n\tbearingWidthMaximum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_width_max',\n\t\tlabel: bearingSearchLabels.bearingWidthMaximum || '',\n\t\ttooltip: bearingSearchLabels.bearingWidthMaximum && getTooltip( bearingSearchLabels.bearingWidthMaximum ),\n\t},\n\tc1RatingMinimum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_c1_min',\n\t\ttype: 'force',\n\t\tlabel: bearingSearchLabels.c1RatingMinimum || '',\n\t\ttooltip: bearingSearchLabels.c1RatingMinimum && getTooltip( bearingSearchLabels.c1RatingMinimum ),\n\t},\n\tc1RatingMaximum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_c1_max',\n\t\ttype: 'force',\n\t\tlabel: bearingSearchLabels.c1RatingMaximum || '',\n\t\ttooltip: bearingSearchLabels.c1RatingMaximum && getTooltip( bearingSearchLabels.c1RatingMaximum ),\n\t},\n\tc90RatingMinimum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_c90_min',\n\t\ttype: 'force',\n\t\tlabel: bearingSearchLabels.c90RatingMinimum || '',\n\t\ttooltip: bearingSearchLabels.c90RatingMinimum && getTooltip( bearingSearchLabels.c90RatingMinimum ),\n\t},\n\tc90RatingMaximum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_c90_max',\n\t\ttype: 'force',\n\t\tlabel: bearingSearchLabels.c90RatingMaximum || '',\n\t\ttooltip: bearingSearchLabels.c90RatingMaximum && getTooltip( bearingSearchLabels.c90RatingMaximum ),\n\t},\n\tceRatingMinimum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_ce_min',\n\t\ttype: 'force',\n\t\tlabel: bearingSearchLabels.ceRatingMinimum || '',\n\t\ttooltip: bearingSearchLabels.ceRatingMinimum && getTooltip( bearingSearchLabels.ceRatingMinimum ),\n\t},\n\tceRatingMaximum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_ce_max',\n\t\ttype: 'force',\n\t\tlabel: bearingSearchLabels.ceRatingMaximum || '',\n\t\ttooltip: bearingSearchLabels.ceRatingMaximum && getTooltip( bearingSearchLabels.ceRatingMaximum ),\n\t},\n\tkFactorMinimum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_k_factor_min',\n\t\ttype: 'unitless',\n\t\tlabel: bearingSearchLabels.kFactorMinimum || '',\n\t\ttooltip: bearingSearchLabels.kFactorMinimum && getTooltip( bearingSearchLabels.kFactorMinimum ),\n\t},\n\tkFactorMaximum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_k_factor_max',\n\t\ttype: 'unitless',\n\t\tlabel: bearingSearchLabels.kFactorMaximum || '',\n\t\ttooltip: bearingSearchLabels.kFactorMaximum && getTooltip( bearingSearchLabels.kFactorMaximum ),\n\t},\n\ty1FactorMinimum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_y1_factor_min',\n\t\ttype: 'unitless',\n\t\tlabel: bearingSearchLabels.y1FactorMinimum || '',\n\t\ttooltip: bearingSearchLabels.y1FactorMinimum && getTooltip( bearingSearchLabels.y1FactorMinimum ),\n\t},\n\ty1FactorMaximum: {\n\t\t...defaultFilterValue,\n\t\tid: 'bearing_search_y1_factor_max',\n\t\ttype: 'unitless',\n\t\tlabel: bearingSearchLabels.y1FactorMaximum || '',\n\t\ttooltip: bearingSearchLabels.y1FactorMaximum && getTooltip( bearingSearchLabels.y1FactorMaximum ),\n\t},\n};\n\nexport const initialBearingSearchState: BearingSearchState = {\n\tunit: 'M',\n\tmarketPlaceDescription: '',\n\tpartType: [],\n\tbearingType: [],\n\tbearingSubType: [],\n\tadvancedFilters: initialAdvancedFilters,\n\tvalidation: getValidationMap(),\n};\n\nconst updateAdvancedFilters = ( initialFilters: BearingAdvancedFilterMap, bearingType: string[] ): BearingAdvancedFilterMap => {\n\tconst filters = { ...initialFilters };\n\tObject.values( filters ).forEach( ( filter ) => filter.isApplicable = true );\n\tconst hiddenFields: BearingAdvancedFilterKey[] = [];\n\n\tif ( bearingType.length > 0 ) {\n\t\tif ( ! bearingType.filter( ( type ) => type !== 'RBB' && type !== 'ACBB' ).length ) {\n\t\t\thiddenFields.push( 'c1RatingMinimum', 'c1RatingMaximum' );\n\t\t}\n\n\t\tif ( ! bearingType.includes( BearingTypeCode.TRB ) ) {\n\t\t\thiddenFields.push( 'c90RatingMinimum', 'c90RatingMaximum', 'kFactorMinimum', 'kFactorMaximum' );\n\t\t}\n\n\t\tif ( ! bearingType.includes( BearingTypeCode.SRB ) ) {\n\t\t\thiddenFields.push( 'y1FactorMinimum', 'y1FactorMaximum' );\n\t\t}\n\n\t\tif ( ! bearingType.includes( BearingTypeCode.RBB ) && ! bearingType.includes( BearingTypeCode.ACBB ) ) {\n\t\t\thiddenFields.push( 'ceRatingMinimum', 'ceRatingMaximum' );\n\t\t}\n\n\t\tfor ( const key of hiddenFields ) {\n\t\t\tfilters[ key ].isApplicable = false;\n\t\t}\n\t}\n\n\treturn filters;\n};\n\nexport type BearingSearchAction =\n\t| { type: 'change_unit'; payload: TimkenUnit; }\n\t| { type: 'change_part_number'; payload: string; }\n\t| {\n\t\ttype: 'change_bearing_type'; payload: {\n\t\t\tpartType: string[];\n\t\t\tbearingType: string[];\n\t\t\tbearingSubType: string[];\n\t\t};\n\t}\n\t| { type: 'change_advanced_filter'; payload: Array; }\n\t| { type: 'change_number_field'; payload: [keyof BearingPayload, unknown]; }\n\t| { type: 'update_request_data'; }\n\t| { type: 'reset'; payload?: BearingSearchState; };\n\nconst bearingSearchReducer: React.Reducer<\n\tBearingSearchState,\n\tBearingSearchAction\n> = ( state, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'change_unit': {\n\t\t\tconst unit = action.payload;\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tunit,\n\t\t\t};\n\t\t}\n\t\tcase 'change_part_number': {\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmarketPlaceDescription: action.payload,\n\t\t\t};\n\t\t}\n\t\tcase 'change_bearing_type': {\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.payload,\n\t\t\t\tadvancedFilters: updateAdvancedFilters( state.advancedFilters, action.payload.bearingType ),\n\t\t\t};\n\t\t}\n\t\tcase 'change_advanced_filter': {\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tadvancedFields: [ ...action.payload ],\n\t\t\t};\n\t\t}\n\t\tcase 'change_number_field': {\n\t\t\tconst [ key, value ] = action.payload;\n\n\t\t\tif ( ! state.advancedFilters[ key ] ) {\n\t\t\t\treturn { ...state };\n\t\t\t}\n\n\t\t\tconst filter = { ...state.advancedFilters[ key ] };\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tadvancedFilters: {\n\t\t\t\t\t...state.advancedFilters,\n\t\t\t\t\t[ key ]: {\n\t\t\t\t\t\t...filter,\n\t\t\t\t\t\tvalue: convertNumberInput( value ),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\tcase 'update_request_data': {\n\t\t\tconst validation = getValidationMap( state );\n\t\t\tconst isInValid = Array.from( validation.values() ).some( ( field ) => field.invalid );\n\n\t\t\tif ( isInValid ) {\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\tvalidation,\n\t\t\t\t\trequestData: undefined,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { unit, marketPlaceDescription, partType, advancedFilters } = state;\n\t\t\tconst requestData: Partial = { unit, marketPlaceDescription, partType };\n\n\t\t\tObject.keys( advancedFilters ).filter( ( key ) => {\n\t\t\t\tconst field = advancedFilters[ key ] as BearingAdvancedFilter;\n\n\t\t\t\treturn field.isApplicable && field.value;\n\t\t\t} ).forEach( ( key ) => {\n\t\t\t\tconst field = advancedFilters[ key ] as BearingAdvancedFilter;\n\n\t\t\t\trequestData[ key ] = field.value;\n\t\t\t} );\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tvalidation,\n\t\t\t\trequestData,\n\t\t\t};\n\t\t}\n\t\tcase 'reset': {\n\t\t\tconst newState = action.payload ? action.payload : initialBearingSearchState;\n\n\t\t\treturn {\n\t\t\t\t...newState,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn handleActionError( action );\n};\n\nexport default bearingSearchReducer;\n","import React from 'react';\nimport { BearingGroupOption, BearingTypeOption, MultiSelectState } from '../../types/types';\nimport { handleActionError } from '../../utils/engineering-tools';\nimport { BearingTypeCode } from '../../../components/bearing-search/types/types';\n\nexport type BearingTypeDropdownState = {\n\tisOpen: boolean;\n\tgroups: BearingGroupOption[];\n\tgroupsInAction: BearingGroupOption[];\n\tpartType: string[];\n\tbearingType: BearingTypeCode[];\n\tbearingSubType: string[];\n};\n\nexport const initialBearingTypeDropdownState: BearingTypeDropdownState = {\n\tisOpen: false,\n\tgroupsInAction: [],\n\tgroups: [],\n\tpartType: [],\n\tbearingType: [],\n\tbearingSubType: [],\n};\n\nexport type BearingTypeDropdownAction =\n\t| { type: 'set_part_types'; payload: string[] }\n\t| { type: 'change_part_group'; payload: { groupIndex: number, selected: MultiSelectState } }\n\t| { type: 'change_part_type'; payload: { groupIndex: number, typeIndex: number, selected: boolean } }\n\t| { type: 'start_selection' }\n\t| { type: 'apply_selection' }\n\t| { type: 'cancel_selection' }\n\t| { type: 'reset'; payload: BearingTypeDropdownState };\n\nconst getTypeData = ( groups: BearingGroupOption[] ): {\n\tpartType: string[];\n\tbearingType: BearingTypeCode[];\n\tbearingSubType: string[];\n} => {\n\tconst partType: string[] = [];\n\tconst bearingType = new Set();\n\tconst bearingSubType: string[] = [];\n\n\tfor ( const type of groups.flatMap( ( group ) => group.types ) ) {\n\t\tif ( type.selected ) {\n\t\t\tpartType.push( type.value );\n\t\t\tconst { bearingType: bType, bearingSubType: sType } = type;\n\n\t\t\tif ( bType ) {\n\t\t\t\tbearingType.add( bType );\n\t\t\t}\n\n\t\t\tif ( sType && bType === BearingTypeCode.TRB ) {\n\t\t\t\tbearingSubType.push( sType );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\tpartType,\n\t\tbearingType: [ ...bearingType ],\n\t\tbearingSubType,\n\t};\n};\n\nconst bearingTypeReducer: React.Reducer<\n\tBearingTypeDropdownState,\n\tBearingTypeDropdownAction\n> = ( state, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'set_part_types': {\n\t\t\tconst newTypes = action.payload;\n\n\t\t\tconst groups = state.groups.map( ( group ) => {\n\t\t\t\tlet selectedCount = 0;\n\n\t\t\t\tconst types = group.types.map( ( type ) => {\n\t\t\t\t\tlet selected = false;\n\n\t\t\t\t\tif ( newTypes.includes( type.value ) ) {\n\t\t\t\t\t\tselectedCount++;\n\t\t\t\t\t\tselected = true;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...type,\n\t\t\t\t\t\tselected,\n\t\t\t\t\t};\n\t\t\t\t} );\n\n\t\t\t\tconst selected: MultiSelectState = ( selectedCount > 0 && selectedCount < group.types.length ) ? 'mixed' : selectedCount !== 0;\n\n\t\t\t\treturn {\n\t\t\t\t\t...group,\n\t\t\t\t\ttypes,\n\t\t\t\t\tselected,\n\t\t\t\t};\n\t\t\t} );\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tgroups,\n\t\t\t\t...getTypeData( groups ),\n\t\t\t};\n\t\t}\n\t\tcase 'start_selection': {\n\t\t\tconst groupsInAction = JSON.parse( JSON.stringify( state.groups ) );\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisOpen: true,\n\t\t\t\tgroupsInAction,\n\t\t\t};\n\t\t}\n\t\tcase 'cancel_selection': {\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisOpen: false,\n\t\t\t\tgroupsInAction: [],\n\t\t\t};\n\t\t}\n\t\tcase 'apply_selection': {\n\t\t\tconst groups = JSON.parse( JSON.stringify( state.groupsInAction ) );\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisOpen: false,\n\t\t\t\tgroups,\n\t\t\t\tgroupsInAction: [],\n\t\t\t\t...getTypeData( groups ),\n\t\t\t};\n\t\t}\n\t\tcase 'change_part_type': {\n\t\t\tconst { groupIndex, typeIndex, selected } = action.payload;\n\t\t\tconst groupsInAction: BearingGroupOption[] = JSON.parse( JSON.stringify( state.groupsInAction ) );\n\n\t\t\tif ( ! groupsInAction[ groupIndex ]?.types[ typeIndex ] ) {\n\t\t\t\treturn { ...state };\n\t\t\t}\n\n\t\t\tconst groupOption = groupsInAction[ groupIndex ];\n\t\t\tconst typeOption = groupOption.types[ typeIndex ];\n\n\t\t\t// Toggle type selection\n\t\t\ttypeOption.selected = ! selected;\n\n\t\t\t// Update group selection status\n\t\t\tconst selectedCount = groupOption.types.filter( ( type: BearingTypeOption ) => type.selected ).length;\n\t\t\tgroupOption.selected = ( selectedCount > 0 && selectedCount < groupOption.types.length ) ? 'mixed' : selectedCount !== 0;\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tgroupsInAction,\n\t\t\t};\n\t\t}\n\t\tcase 'change_part_group': {\n\t\t\tconst { groupIndex, selected } = action.payload;\n\t\t\tconst groupsInAction = JSON.parse( JSON.stringify( state.groupsInAction ) );\n\t\t\tconst groupOption = groupsInAction[ groupIndex ];\n\n\t\t\tif ( ! groupOption ) {\n\t\t\t\treturn { ...state };\n\t\t\t}\n\n\t\t\t// Unselect all types if all types were selected\n\t\t\t// Select all types if some or no types were selected\n\t\t\tconst isUnselectAll = selected === true;\n\n\t\t\tgroupOption.selected = ! isUnselectAll;\n\t\t\tgroupOption.types.forEach( ( type: BearingTypeOption ) => type.selected = ! isUnselectAll );\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tgroupsInAction,\n\t\t\t};\n\t\t}\n\t\tcase 'reset': {\n\t\t\treturn {\n\t\t\t\t...action.payload,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn handleActionError( action );\n};\n\nexport default bearingTypeReducer;\n","import React, { Reducer, useEffect, useReducer } from 'react';\nimport { BearingGroupOption, BearingTypeOption } from '../../types/types';\nimport { BearingGroup } from '../../../components/bearing-search/types/types';\nimport bearingTypeReducer, {\n\tBearingTypeDropdownAction,\n\tBearingTypeDropdownState,\n\tinitialBearingTypeDropdownState,\n} from './reducer';\nimport { text } from '../../data';\n\ninterface GroupSelectDropdownProps {\n\tid: string;\n\tlabel: string;\n\tgroups: BearingGroup[];\n\tpreselected: string[];\n\tonChange: ( typeData: {\n\t\tpartType: string[];\n\t\tbearingType: string[];\n\t\tbearingSubType: string[];\n\t} ) => void;\n\tonApply: ( bearingGroups: BearingGroupOption[] ) => void;\n\trequired?: boolean;\n\tplaceholder?: string;\n}\n\nconst GroupSelectDropdown: React.FC = ( {\n\tid,\n\tlabel,\n\tgroups,\n\tpreselected,\n\trequired,\n\tplaceholder,\n\tonChange,\n\tonApply,\n} ) => {\n\tconst initialBearingGroups = groups.map( ( group ) => {\n\t\tconst groupOption: BearingGroupOption = {\n\t\t\tselected: false,\n\t\t\tgroupId: group.bearingGroupID,\n\t\t\tlabel: group.bearingGroupDescription || '',\n\t\t\ttypes: group.bearingTypeDetailsList.map( ( type ) => {\n\t\t\t\tconst {\n\t\t\t\t\tpartType,\n\t\t\t\t\tdescription,\n\t\t\t\t\tbearingType,\n\t\t\t\t\tbearingSubType,\n\t\t\t\t\tbearingGroupID: groupId,\n\t\t\t\t} = type;\n\n\t\t\t\tconst typeOption: BearingTypeOption = {\n\t\t\t\t\tselected: false,\n\t\t\t\t\tid: `bearing_type_${ partType.toLowerCase() }`,\n\t\t\t\t\tlabel: description,\n\t\t\t\t\tvalue: partType,\n\t\t\t\t\tgroupId,\n\t\t\t\t\tbearingType,\n\t\t\t\t\tbearingSubType,\n\t\t\t\t};\n\n\t\t\t\treturn typeOption;\n\t\t\t} ),\n\t\t};\n\n\t\treturn groupOption;\n\t} );\n\n\tconst [ typeState, dispatch ] = useReducer>(\n\t\tbearingTypeReducer,\n\t\tinitialBearingTypeDropdownState,\n\t);\n\n\tuseEffect( () => {\n\t\tdispatch( {\n\t\t\ttype: 'reset',\n\t\t\tpayload: {\n\t\t\t\t...initialBearingTypeDropdownState,\n\t\t\t\tgroups: initialBearingGroups,\n\t\t\t},\n\t\t} );\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tdispatch( {\n\t\t\ttype: 'set_part_types',\n\t\t\tpayload: preselected,\n\t\t} );\n\t}, [ preselected ] );\n\n\tuseEffect( () => {\n\t\tconst { partType, bearingType, bearingSubType } = typeState;\n\n\t\tonChange( {\n\t\t\tpartType,\n\t\t\tbearingType,\n\t\t\tbearingSubType,\n\t\t} );\n\t}, [ typeState.partType ] );\n\n\tuseEffect( () => {\n\t\t// Close on clicking outside the menu\n\t\tif ( typeState.isOpen ) {\n\t\t\tdocument.addEventListener( 'click', handleClickOutside );\n\t\t}\n\n\t\treturn () => document.removeEventListener( 'click', handleClickOutside );\n\t}, [ typeState.isOpen ] );\n\n\tconst handleClickOutside = ( event: MouseEvent ) => {\n\t\tconst target = event.target;\n\n\t\tif (\n\t\t\ttarget instanceof Element &&\n\t\t\t! ( target as HTMLElement ).closest( '.js-bearing-type-dropdown' )\n\t\t) {\n\t\t\tdispatch( { type: 'cancel_selection' } );\n\t\t}\n\t};\n\n\tconst toggleMenu = () => {\n\t\tif ( typeState.isOpen ) {\n\t\t\tdispatch( { type: 'cancel_selection' } );\n\t\t} else {\n\t\t\tdispatch( { type: 'start_selection' } );\n\t\t}\n\t};\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t{label}\n\t\t\t\n\n\t\t\t
\n\t\t\t\t toggleMenu()}\n\t\t\t\t>\n\t\t\t\t\t{typeState.partType.length === 0 && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{placeholder || label}\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\n\t\t\t\t\t{typeState.partType.length > 0 && (\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
\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{typeState.groupsInAction.map( ( group, groupIndex ) => {\n\t\t\t\t\t\t\tconst { groupId, label: groupLabel, types } = group;\n\n\t\t\t\t\t\t\tconst ariaControlLabel = types\n\t\t\t\t\t\t\t\t.map( ( type ) => type.id )\n\t\t\t\t\t\t\t\t.join( ' ' )\n\t\t\t\t\t\t\t\t.trim();\n\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
\n\t\t\t\t\t\t\t\t\t\t\n\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\ttype: 'change_part_group',\n\t\t\t\t\t\t\t\t\t\t\t\t\tpayload: { groupIndex, selected: group.selected },\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\n\t\t\t\t\t\t\t\t\t\t\t{groupLabel}\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
    \n\t\t\t\t\t\t\t\t\t\t{types.map( ( type, typeIndex ) => {\n\t\t\t\t\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\t\t\t\t\tid: typeId,\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: typeLabel,\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: typeValue,\n\t\t\t\t\t\t\t\t\t\t\t\tselected: typeSelected,\n\t\t\t\t\t\t\t\t\t\t\t} = type;\n\t\t\t\t\t\t\t\t\t\t\treturn (\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\n\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\ttype: 'change_part_type',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpayload: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroupIndex,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeIndex,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselected: typeSelected,\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\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{typeLabel}\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);\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\n\t\t\t\t\t
\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tonApply( typeState.groupsInAction );\n\t\t\t\t\t\t\t\tdispatch( {\n\t\t\t\t\t\t\t\t\ttype: 'apply_selection',\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\t{text.apply}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdispatch( {\n\t\t\t\t\t\t\t\t\ttype: 'cancel_selection',\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\t{text.cancel}\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 GroupSelectDropdown;\n","import React from 'react';\nimport { View } from '../../types/types';\nimport { handleActionError } from '../../utils/engineering-tools';\nimport { PAGE_SIZE } from '../../../components/bearing-search/api/api';\nimport { BearingInfo, BearingKey, TimkenSortDirection } from '../../../components/bearing-search/types/types';\n\nexport type BearingSearchState = {\n\tcomparedData: BearingInfo[];\n\tcurrentPage: number;\n\ttotalPages: number;\n\tpageSize: number;\n\tisRefining: boolean;\n\tsortExpression?: BearingKey;\n\tsortDirection?: TimkenSortDirection;\n\tview: View;\n};\n\nexport const initialSearchState: BearingSearchState = {\n\tcomparedData: [],\n\tcurrentPage: 1,\n\ttotalPages: 0,\n\tpageSize: PAGE_SIZE,\n\tisRefining: false,\n\tsortDirection: \"desc\",\n\tsortExpression: \"availability\",\n\tview: View.LIST,\n};\n\nexport type BearingSearchAction =\n\t| { type: 'update_total_records'; payload: number }\n\t| { type: 'change_page'; payload: number }\n\t| { type: 'update_compare'; payload: BearingInfo }\n\t| { type: 'sort_by'; payload: string | undefined }\n\t| { type: 'change_view'; payload: View }\n\t| { type: 'reset'; payload?: BearingSearchState };\n\nconst paginate = ( totalRecords: number, size: number ): number => {\n\treturn totalRecords === 0 ? 0 : Math.ceil( totalRecords / size );\n};\n\nconst bearingSearchReducer: React.Reducer<\n\tBearingSearchState,\n\tBearingSearchAction\n> = ( state, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'update_total_records': {\n\t\t\tconst totalPages = paginate( action.payload, state.pageSize );\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\ttotalPages,\n\t\t\t\tisRefining: false,\n\t\t\t};\n\t\t}\n\t\tcase 'update_compare': {\n\t\t\tconst bearing = action.payload;\n\t\t\tconst comparedData = [ ...state.comparedData ];\n\n\t\t\tconst targetId = comparedData.findIndex( ( item ) => item.marketPlaceDescription === bearing.marketPlaceDescription );\n\n\t\t\tif ( targetId >= 0 ) {\n\t\t\t\t// remove\n\t\t\t\tcomparedData.splice( targetId, 1 );\n\t\t\t} else {\n\t\t\t\t// add\n\t\t\t\tcomparedData.push( bearing );\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcomparedData,\n\t\t\t};\n\t\t}\n\t\tcase 'change_page': {\n\t\t\tconst currentPage = action.payload;\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisRefining: true,\n\t\t\t\tcurrentPage,\n\t\t\t};\n\t\t}\n\t\tcase 'sort_by': {\n\t\t\tconst { sortDirection, sortKey } = state;\n\t\t\tconst newSortKey = action.payload;\n\n\t\t\tif ( ! newSortKey ) {\n\t\t\t\t// Unsort\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\tsortKey: undefined,\n\t\t\t\t\tsortDirection: undefined,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst newSortDirection = sortKey !== newSortKey || sortDirection !== 'asc' ? 'asc' : 'desc';\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisRefining: true,\n\t\t\t\tsortKey: newSortKey as BearingKey,\n\t\t\t\tsortDirection: newSortDirection,\n\t\t\t};\n\t\t}\n\t\tcase 'change_view': {\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tview: action.payload,\n\t\t\t};\n\t\t}\n\t\tcase 'reset': {\n\t\t\tconst newState = action.payload ? action.payload : initialSearchState;\n\n\t\t\treturn {\n\t\t\t\t...newState,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn handleActionError( action );\n};\n\nexport default bearingSearchReducer;\n","import React, {\n\tFunctionComponent,\n\tReducer,\n\tuseEffect,\n\tuseReducer,\n\tuseState,\n} from 'react';\nimport { bearingSearchTableHeads, text } from '../../data';\nimport TableLoader from '../TableLoader';\nimport { generateId, getTooltip } from '../../utils/engineering-tools';\nimport { View } from '../../types/types';\nimport SearchPagination from '../../../components/bearing-search/components/SearchPagination';\nimport Loader from '../../../components/bearing-search/components/Loader';\nimport bearingSearchReducer, {\n\tinitialSearchState,\n\tBearingSearchState,\n\tBearingSearchAction,\n} from './reducer';\nimport SearchPaginationLabel from '../../../components/bearing-search/components/SearchPaginationLabel';\nimport {\n\tBearingInfo,\n\tBearingKey,\n\tBearingPayload,\n\tBearingSortPayload,\n\tBearingTypeCode,\n\tTimkenUnit,\n} from '../../../components/bearing-search/types/types';\nimport {\n\tCOMPARE_SIZE,\n\tcompareBearingsUrl,\n\tgetBearingDetailsUrl,\n\tguidedHelpUrls,\n\treduceArrayData,\n} from '../../../components/bearing-search/api/api';\nimport { bearingSortableKeys } from '../../../components/bearing-search/data';\nimport {\n\tanalyticsData,\n\tgetBearingImpressionData,\n\ttrackBearingListImpression,\n} from '../../utils/analytics';\nimport { trackProductClick } from '../../../analytics/engineering-tools';\nimport {\n\tlogin,\n\tregister,\n\tisEnabled as ssoIsEnabled,\n\tisAuthenticated as ssoIsAuthenticated,\n\tisAuthorized as ssoIsAuthorized\n} from '../../../sso';\nimport SortButton from '../SortButton';\n\ninterface BearingSearchResultsProps {\n\tunit: TimkenUnit;\n\tdata: BearingInfo[];\n\ttotalRecords: number;\n\tloading?: boolean;\n\tonRefine?: ( payload: Partial ) => void;\n}\n\nconst BearingSearchResults: FunctionComponent = ( {\n\tunit,\n\tdata,\n\ttotalRecords,\n\tloading,\n\tonRefine,\n} ) => {\n\tconst [ compareUrl, setCompareUrl ] = useState( '' );\n\tconst [ refinementState, dispatch ] = useReducer<\n\t\tReducer\n\t>( bearingSearchReducer, initialSearchState );\n\tconst isInComparedData = ( marketPlaceDescription: string ) =>\n\t\trefinementState.comparedData.some(\n\t\t\t( bearing ) => bearing.marketPlaceDescription === marketPlaceDescription,\n\t\t);\n\tconst isSsoEnabled = ssoIsEnabled()\n\tconst isAuthenticated = ssoIsAuthenticated()\n\tconst isAuthorized = ssoIsAuthorized()\n\n\tuseEffect( () => {\n\t\tdispatch( {\n\t\t\ttype: 'update_total_records',\n\t\t\tpayload: totalRecords,\n\t\t} );\n\n\t\tif ( ! data.length ) {\n\t\t\tdispatch( {\n\t\t\t\ttype: 'reset',\n\t\t\t} );\n\t\t} else {\n\t\t\tconst { currentPage, pageSize } = refinementState;\n\t\t\ttrackBearingListImpression(\n\t\t\t\tdata,\n\t\t\t\tcurrentPage,\n\t\t\t\tpageSize,\n\t\t\t\tanalyticsData.bearingSearch.name,\n\t\t\t);\n\t\t}\n\t}, [ data ] );\n\n\t// Paginate and sort\n\tuseEffect( () => {\n\t\tif ( data.length && onRefine ) {\n\t\t\tconst { sortKey, sortDirection, currentPage } = refinementState;\n\t\t\tlet sortOptions: BearingSortPayload | undefined;\n\n\t\t\tif ( sortKey && bearingSortableKeys[ sortKey ] ) {\n\t\t\t\tsortOptions = {\n\t\t\t\t\tsortDirection,\n\t\t\t\t\tsortExpression: bearingSortableKeys[ sortKey ]?.[ unit ],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tonRefine( {\n\t\t\t\t...sortOptions,\n\t\t\t\tpageNumber: currentPage,\n\t\t\t} );\n\t\t}\n\t}, [\n\t\trefinementState.sortKey,\n\t\trefinementState.sortDirection,\n\t\trefinementState.currentPage,\n\t] );\n\n\t// Update compare url\n\tuseEffect( () => {\n\t\tconst bearings = refinementState.comparedData;\n\n\t\tif ( bearings.length > 1 ) {\n\t\t\tconst url = new URL( compareBearingsUrl );\n\n\t\t\tbearings.forEach( ( bearing, index ) => {\n\t\t\t\tconst {\n\t\t\t\t\tworldAssemblyPartNumber,\n\t\t\t\t\tmarketPlaceDescription: description,\n\t\t\t\t\tbearingType: types,\n\t\t\t\t\tbearingSubType: subtypes,\n\t\t\t\t\tinnerRingPartNumber,\n\t\t\t\t\touterRingPartNumber,\n\t\t\t\t\tbrand,\n\t\t\t\t} = bearing;\n\n\t\t\t\tlet partNumber = worldAssemblyPartNumber || '';\n\t\t\t\tlet cupPartNumber = '';\n\n\t\t\t\tconst marketPlaceDescription = description || '';\n\t\t\t\tconst bearingType = reduceArrayData( types ) as BearingTypeCode;\n\t\t\t\tconst bearingSubType = reduceArrayData( subtypes );\n\n\t\t\t\tif ( bearingType === BearingTypeCode.TRB ) {\n\t\t\t\t\tpartNumber = reduceArrayData( innerRingPartNumber );\n\t\t\t\t\tcupPartNumber = reduceArrayData( outerRingPartNumber );\n\t\t\t\t}\n\n\t\t\t\turl.searchParams.append(\n\t\t\t\t\t`bearings[${ index }][bearing_type]`,\n\t\t\t\t\tbearingType,\n\t\t\t\t);\n\n\t\t\t\turl.searchParams.append(\n\t\t\t\t\t`bearings[${ index }][bearing_subtype]`,\n\t\t\t\t\tbearingSubType,\n\t\t\t\t);\n\n\t\t\t\turl.searchParams.append( `bearings[${ index }][part_number]`, partNumber );\n\n\t\t\t\turl.searchParams.append(\n\t\t\t\t\t`bearings[${ index }][cup_part_number]`,\n\t\t\t\t\tcupPartNumber,\n\t\t\t\t);\n\n\t\t\t\turl.searchParams.append(\n\t\t\t\t\t`bearings[${ index }][marketplace_description]`,\n\t\t\t\t\tmarketPlaceDescription,\n\t\t\t\t);\n\n\t\t\t\turl.searchParams.append( `bearings[${ index }][brand]`, brand || '' );\n\n\t\t\t\turl.searchParams.append( 'unit', unit );\n\n\t\t\t\tsetCompareUrl( url.toString() );\n\t\t\t} );\n\t\t}\n\t}, [ refinementState.comparedData ] );\n\n\tconst handleProductClick = ( item: BearingInfo, index: number ) => {\n\t\tconst { currentPage, pageSize } = refinementState;\n\n\t\tconst product = getBearingImpressionData(\n\t\t\titem,\n\t\t\tindex,\n\t\t\tcurrentPage,\n\t\t\tpageSize,\n\t\t\tanalyticsData.bearingSearch.name,\n\t\t);\n\n\t\ttrackProductClick( product );\n\t};\n\n\tconst handleSignIn = ( e ) => {\n\t\te.preventDefault();\n\t\tlogin();\n\t};\n\n\tconst handleSignUp = ( e ) => {\n\t\te.preventDefault();\n\t\tregister({ appId: 'pa' });\n\t};\n\n\tconst profileUrl = window?._timken?.profileUrl as string || '';\n\n\treturn (\n\t\t
\n\t\t\t

\n\t\t\t\t{! loading && totalRecords === 0 ? text.noBearingResults : text.results}\n\t\t\t

\n\n\t\t\t{loading && }\n\n\t\t\t{! loading && (\n\t\t\t\t<>\n\t\t\t\t\t{totalRecords === 0 && (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{text.noBearingResultsText1}{' '}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{text.contactUs}\n\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t{text.noBearingResultsText2}\n\t\t\t\t\t\t
\n\t\t\t\t\t)}\n\n\t\t\t\t\t{totalRecords > 0 && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{isSsoEnabled && ! isAuthenticated &&

\n\t\t\t\t\t\t\t\t{text.unauthenticatedVerbiageSignIn}\n\t\t\t\t\t\t\t\t{text.unauthenticatedVerbiageOr}\n\t\t\t\t\t\t\t\t{text.unauthenticatedVerbiageRegister}\n\t\t\t\t\t\t\t\t{text.unauthenticatedVerbiage}\n\t\t\t\t\t\t\t

}\n\n\t\t\t\t\t\t\t{isSsoEnabled && isAuthenticated && !isAuthorized &&

\n\t\t\t\t\t\t\t\t{text.unauthorizedVerbiageRegister}\n\t\t\t\t\t\t\t\t{text.unauthenticatedVerbiage}\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\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
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t{refinementState.view === View.LIST && (\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{refinementState.isRefining && (\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\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\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\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t{bearingSearchTableHeads.map( ( head ) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst { key, label, labelUnit, showLabelUnit, sortable } = head;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst { sortDirection, sortKey } = refinementState;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst isAuthorizedOnlyColumn = key === 'relPrice' || key === 'availability';\n\t\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\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{label} {showLabelUnit && ' (' + labelUnit[unit] + ')'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{getTooltip( label ) &&\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\t\t\n\t\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\t\t\t\n\t\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\t\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\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{sortable && totalRecords > 1 && (\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\t\t\tdispatch( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype: 'sort_by',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpayload: newSortKey as BearingKey,\n\t\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\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\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{data.map( ( row, rowIndex ) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst marketPlaceDescription =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trow.marketPlaceDescription || '';\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst rowKey = generateId(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`${ marketPlaceDescription || rowIndex }`,\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\tconst detailsUrl = getBearingDetailsUrl( row );\n\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\n\t\t\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\t\t{bearingSearchTableHeads.map( ( column ) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst colKey = generateId( column.key );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst isAuthorizedOnlyColumn = column.key === 'relPrice' || column.key === 'availability';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( isAuthorizedOnlyColumn ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( isAuthorized ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( column.key === 'relPrice' ) {\n\t\t\t\t\t\t\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\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\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\tif ( column.key === 'availability' ) {\n\t\t\t\t\t\t\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\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\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\treturn (\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\t\t{column.key === 'relPrice' ? '$ -- --' : '-- -- --'}\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\treturn ;\n\t\t\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\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{row[ column.key ]}\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
\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{refinementState.view === View.GRID && (\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{refinementState.isRefining && (\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\n\t\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t\t{data.map( ( row, rowIndex ) => {\n\t\t\t\t\t\t\t\t\t\t\tconst marketPlaceDescription =\n\t\t\t\t\t\t\t\t\t\t\t\trow.marketPlaceDescription || '';\n\t\t\t\t\t\t\t\t\t\t\tconst rowKey = generateId(\n\t\t\t\t\t\t\t\t\t\t\t\t`${ marketPlaceDescription || rowIndex }`,\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tconst detailsUrl = getBearingDetailsUrl( row );\n\n\t\t\t\t\t\t\t\t\t\t\t// Split into two columns\n\t\t\t\t\t\t\t\t\t\t\tconst columnLen = bearingSearchTableHeads.length;\n\t\t\t\t\t\t\t\t\t\t\tconst middle = Math.ceil( columnLen / 2 );\n\t\t\t\t\t\t\t\t\t\t\tconst group1 = bearingSearchTableHeads.slice( 0, middle );\n\t\t\t\t\t\t\t\t\t\t\tconst group2 = bearingSearchTableHeads.slice(\n\t\t\t\t\t\t\t\t\t\t\t\tmiddle,\n\t\t\t\t\t\t\t\t\t\t\t\tcolumnLen,\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\treturn (\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\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\t\t\t\t}\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\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\t\t=\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCOMPARE_SIZE\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'disabled'\n\t\t\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\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\t\t{text.addToCompareLabel}\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
    \n\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\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{group1.map( ( _, colIndex ) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst column =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbearingSearchTableHeads[ colIndex ];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst colKey = generateId( column.key );\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst isAuthorizedOnlyColumn = column.key === 'relPrice' || column.key === 'availability';\n\n\t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\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\t\t\t\t{column.key === 'relPrice' ? '$ -- --' : '-- -- --'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    {column.label} {column.showLabelUnit && ' (' + column.labelUnit[unit] + ')'}{row[ column.key ]}
    \n\t\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\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\t{group2.map( ( _, colIndex ) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst column =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbearingSearchTableHeads[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmiddle + colIndex\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\tconst colKey = generateId( column.key );\n\n\t\t\t\t\t\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\t\t\t\t\t\n\t\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\t\t\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
    {column.label} {column.showLabelUnit && ' (' + column.labelUnit[unit] + ')'}{row[ column.key ]}
    \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);\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\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{refinementState.comparedData.length > 1 && compareUrl && (\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{text.compare}\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\tdispatch( { type: 'change_page', payload: page } )\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 BearingSearchResults;\n","import React, { ChangeEvent, FormEvent, Reducer, useEffect, useReducer, useRef, useState } from 'react';\nimport SearchModal from '../../components/bearing-search/components/SearchModal';\nimport { text, unitList, unitMap } from '../data';\nimport BearingTypeAssistance from '../components/BearingTypeAssistance';\nimport bearingSearchReducer, {\n\tBearingAdvancedFilter,\n\tBearingSearchAction,\n\tBearingSearchState,\n\tinitialBearingSearchState,\n} from './reducer';\nimport BearingTypeDropdown from '../components/bearing-type-dropdown/BearingTypeDropdown';\nimport { bearingGroups, getBearings } from '../../components/bearing-search/api/api';\nimport TextInput from '../../components/bearing-search/components/forms/TextInput';\nimport SelectDropdown from '../../components/bearing-search/components/forms/SelectDropdown';\nimport {\n\tBearingAdvancedFilterKey,\n\tBearingInfo,\n\tBearingPayload,\n\tBearingResponse,\n\tTimkenUnit,\n} from '../../components/bearing-search/types/types';\nimport NumberInput from '../../components/bearing-search/components/forms/NumberInput';\nimport BearingSearchResults from '../components/bearing-search-results/BearingSearchResults';\nimport {\n\ttrackStart,\n\ttrackResults,\n\tupdateActionParams,\n\ttrackFilters,\n\ttrackProductResults,\n} from '../utils/analytics';\nimport { toggleNextTools } from '../utils/engineering-tools';\nimport { BearingGroupOption } from '../types/types';\n\ndeclare global {\n\tinterface Window {\n\t\tsearchTerm?: string;\n\t}\n}\n\nconst BearingSearch: React.FC = () => {\n\tconst [ isSearched, setIsSearched ] = useState( false );\n\tconst [ isValidated, setIsValidated ] = useState( false );\n\tconst [ isResultsLoading, setIsResultsLoading ] = useState( false );\n\tconst [ displayUnit, setDisplayUnit ] = useState( 'M' );\n\tconst [ results, setResults ] = useState( [] );\n\tconst [ totalRecords, setTotalRecords ] = useState( 0 );\n\tconst [ isAssistanceModalOpen, setIsAssistanceModalOpen ] = useState( false );\n\tconst [ isAdvancedFilterOpen, setIsAdvancedFilterOpen ] = useState( false );\n\tconst [ preselectedTypes, setPreselectedTypes ] = useState( [] );\n\tconst [ formState, dispatch ] = useReducer>(\n\t\tbearingSearchReducer,\n\t\tinitialBearingSearchState,\n\t);\n\tconst [ isRendered, setIsRendered ] = useState( false );\n\tconst formRef = useRef( null );\n\tconst [ bearingTypesGroups, setBearingTypesGroups ] = useState( [] );\n\n\tuseEffect( () => {\n\t\ttrackStart( 'bearingSearch' );\n\n\t\tconst handleAccountInfoLoaded = ( ) => {\n\t\t\tif ( window.searchTerm ) {\n\t\t\t\tdispatch( {\n\t\t\t\t\ttype: 'change_part_number',\n\t\t\t\t\tpayload: window.searchTerm,\n\t\t\t\t} );\n\n\t\t\t\tdispatch( {\n\t\t\t\t\ttype: 'update_request_data',\n\t\t\t\t} );\n\n\t\t\t\tsetIsRendered( true );\n\t\t\t} else {\n\t\t\t\tconst queryMap = new URLSearchParams( document.location.search );\n\n\t\t\t\tif ( queryMap.get( 'savedSearch' ) || queryMap.get( 'gig_savedSearch' ) ) {\n\t\t\t\t\t// Restore from saved search\n\t\t\t\t\tconst savedSearch = window.localStorage.getItem( 'savedSearch' );\n\n\t\t\t\t\tif ( savedSearch ) {\n\t\t\t\t\t\tconst savedState: BearingSearchState = JSON.parse( savedSearch );\n\t\t\t\t\t\tsetPreselectedTypes( savedState.partType || [] );\n\n\t\t\t\t\t\tdispatch( {\n\t\t\t\t\t\t\ttype: 'reset',\n\t\t\t\t\t\t\tpayload: savedState,\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tdispatch( {\n\t\t\t\t\t\t\ttype: 'update_request_data',\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tsetIsRendered( true );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Clear saved search and start fresh\n\t\t\t\t\twindow.localStorage.removeItem( 'savedSearch' );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener( 'timken_sso_account_info_loaded', handleAccountInfoLoaded );\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener( 'timken_sso_account_info_loaded', handleAccountInfoLoaded );\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( ! isRendered ) {\n\t\t\treturn;\n\t\t}\n\n\t\tformRef.current?.dispatchEvent(\n\t\t\tnew Event( 'submit', { cancelable: true, bubbles: true } ),\n\t\t);\n\t}, [ isRendered ] );\n\n\tuseEffect( () => {\n\t\tconst isShown = isSearched && ! isResultsLoading;\n\n\t\ttoggleNextTools( isShown );\n\n\t\treturn () => toggleNextTools( false );\n\t}, [ isSearched, isResultsLoading ] );\n\n\tconst selectTypesFromAssistance = ( partTypes: string[] ) => {\n\t\t// select part types;\n\t\tsetPreselectedTypes( partTypes );\n\n\t\t// clear assistance modal status\n\t\tsetIsAssistanceModalOpen( false );\n\t};\n\n\tconst selectTypes = ( typeData: { partType: string[]; bearingType: string[]; bearingSubType: string[]; } ) => {\n\t\tsetIsValidated( false );\n\n\t\tdispatch( {\n\t\t\ttype: 'change_bearing_type',\n\t\t\tpayload: typeData,\n\t\t} );\n\n\t\tdispatch( {\n\t\t\ttype: 'update_request_data',\n\t\t} );\n\t};\n\n\tconst refineResults = ( payload: Partial ) => {\n\t\tconst request: Partial = {\n\t\t\t...formState.requestData,\n\t\t\t...payload,\n\t\t};\n\n\t\tgetBearings( request ).then( ( response: BearingResponse ) => {\n\t\t\tsetResults( response.bearingInformation || [] );\n\t\t\tsetTotalRecords( response.totalRecords );\n\t\t} );\n\t};\n\n\tconst handleFormChange = () => {\n\t\tsetIsValidated( false );\n\n\t\tdispatch( {\n\t\t\ttype: 'update_request_data',\n\t\t} );\n\t};\n\n\tconst handleSubmit = ( event: FormEvent ) => {\n\t\tevent.preventDefault();\n\t\tsetIsValidated( true );\n\n\t\tif ( formState.requestData ) {\n\t\t\tsetIsSearched( true );\n\t\t\tsetIsResultsLoading( true );\n\t\t\tsetResults( [] );\n\n\t\t\tconst payload: Partial = {\n\t\t\t\t...formState.requestData,\n\t\t\t\tpageNumber: 1,\n\t\t\t};\n\n\t\t\ttrackFilters( payload, bearingTypesGroups );\n\n\t\t\tgetBearings( payload )\n\t\t\t\t.then( ( response: BearingResponse ) => {\n\t\t\t\t\ttrackProductResults( 'bearingSearch', payload, response.totalRecords, formState.marketPlaceDescription );\n\t\t\t\t\tupdateActionParams( 'bearingSearch' );\n\t\t\t\t\tsetDisplayUnit( formState.unit );\n\t\t\t\t\tsetResults( response.bearingInformation || [] );\n\t\t\t\t\tsetTotalRecords( response.totalRecords );\n\t\t\t\t\t// Save search state\n\t\t\t\t\twindow.localStorage.setItem( 'savedSearch', JSON.stringify( formState ) );\n\n\t\t\t\t\tdocument.querySelector('.t-engineering-tools__results').scrollIntoView({\n\t\t\t\t\t\tbehavior: 'smooth'\n\t\t\t\t\t});\n\t\t\t\t} )\n\t\t\t\t.finally( () => {\n\t\t\t\t\tsetIsResultsLoading( false );\n\t\t\t\t} );\n\t\t}\n\t};\n\n\tconst clearSearch = () => {\n\t\tsetIsSearched( false );\n\t\tsetIsValidated( false );\n\n\t\t// Reset form\n\t\tdispatch( {\n\t\t\ttype: 'reset',\n\t\t} );\n\n\t\t// Reset bearing type dropdown\n\t\tsetPreselectedTypes( [] );\n\n\t\t// Remove search state\n\t\twindow.localStorage.removeItem( 'savedSearch' );\n\t};\n\n\treturn (\n\t\t
\n\t\t\t setIsAssistanceModalOpen( true )}\n\t\t\t>\n\t\t\t\t{text.helpMeChoose}\n\t\t\t\n\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\t setBearingTypesGroups( groups )}\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\tdispatch( {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'change_part_number',\n\t\t\t\t\t\t\t\t\t\t\tpayload: event.target.value as string,\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\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\tdispatch( {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'change_unit',\n\t\t\t\t\t\t\t\t\t\t\tpayload: event.target.value as TimkenUnit,\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\n\t\t\t\t\t
\n\t\t\t\t\t\t setIsAdvancedFilterOpen( ! isAdvancedFilterOpen )}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{isAdvancedFilterOpen ? text.hideAdvancedFilters : text.advancedFilters}\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

{text.advancedFilters}

\n\n\t\t\t\t\t
\n\t\t\t\t\t\t{Object.keys( formState.advancedFilters ).map( ( key ) => {\n\t\t\t\t\t\t\tconst filter = formState.advancedFilters[ key ];\n\n\t\t\t\t\t\t\tif ( ! filter ) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst { id, label, value, type, isApplicable, tooltip } = filter as BearingAdvancedFilter;\n\t\t\t\t\t\t\tconst validation = formState.validation.get( key as BearingAdvancedFilterKey );\n\t\t\t\t\t\t\tconst unitLabel = unitMap[ formState.unit ][ type ];\n\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 ) =>\n\t\t\t\t\t\t\t\t\t\t\tdispatch( {\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'change_number_field',\n\t\t\t\t\t\t\t\t\t\t\t\tpayload: [ key as keyof BearingPayload, event.target.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\n\t\t\t\t
\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\n\n\t\t\t{isSearched && (\n\t\t\t\t\n\t\t\t)}\n\n\t\t\t setIsAssistanceModalOpen( false )}\n\t\t\t>\n\t\t\t\t setIsAssistanceModalOpen( false )} />\n\t\t\t\n\t\t\n\t);\n};\n\nexport default BearingSearch;\n","import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport BearingSearch from './BearingSearch';\n\nconst $root: HTMLElement | null = document.getElementById(\n\t'timken-tool-bearing-search',\n);\n\nif ( $root ) {\n\tReactDOM.createRoot( $root ).render(\n\t\t\n\t\t\t\n\t\t,\n\t);\n}\n"],"names":["useState","useEffect","bearingSearchReducer","selected","useReducer","ssoIsEnabled","isAuthenticated","ssoIsAuthenticated","isAuthorized","ssoIsAuthorized","_a","useRef","BearingTypeDropdown","ReactDOM"],"mappings":"mqCAoBA,MAAM,sBAA8D,CAAE,CACrE,QACA,QACD,IAAO,CACN,KAAM,CAAE,cAAe,gBAAiB,EAAIA,aAAA,SAAgC,CAAG,CAAA,EAE/EC,aAAAA,UAAW,IAAM,CAChB,MAAM,MAAQ,iBAAiB,aAAa,IAAO,MAAU,CACtD,MAAA,UAAY,UAAW,KAAK,KAAM,EAGjC,MAAA,CACN,GAHc,WAAY,SAAU,EAIpC,MAAO,UACP,KAAM,KAAK,MACX,SAAU,GACV,UAAW,KAAK,WAAa,KAAK,WAAW,MAAO,GAAI,EAAI,CAAC,EAC7D,gBAAiB,KAAK,eAAA,CACvB,CACC,EAEF,iBAAkB,KAAM,CACzB,EAAG,CAAG,CAAA,EAEA,MAAA,mBAAuB,OAAmB,CACzC,MAAA,MAAQ,CAAE,GAAG,aAAc,EAE1B,MAAO,KAAM,IAIpB,MAAO,KAAM,EAAE,SAAW,CAAE,MAAO,KAAM,EAAE,SAC3C,iBAAkB,KAAM,EAAA,EAGnB,MAAQ,IAAM,CACnB,MAAM,UAAsB,CAAA,EAG1B,cAAA,OAAU,MAAU,KAAK,QAAS,EAClC,QAAW,MAAU,CACT,UAAA,YAAY,KAAK,UACrB,UAAU,SAAU,QAAS,GACnC,UAAU,KAAM,QAAS,CAE3B,CACC,EAEH,QAAS,SAAU,EACb,OAAA,EAGD,OAAS,IAAM,CACd,QACG,UAAA,EAGJ,MAAQ,IAAM,CACnB,MAAM,MAAQ,cAAc,IAAO,OAC3B,CACN,GAAG,KACH,SAAU,EAAA,EAEV,EAEF,iBAAkB,KAAM,CAAA,EAIxB,OAAA,KAAC,MAAI,CAAA,UAAU,mBACd,SAAA,CAAC,IAAA,KAAA,CAAI,SA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