{ "version": 3, "sources": ["../javascripts/components/search/result-set-item.tsx"], "sourcesContent": ["import { bindActionCreators } from '@reduxjs/toolkit';\nimport React from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\n\nimport type { ElasticVehicle } from '../../@types/ElasticVehicle';\nimport { history } from '../../actions/history';\nimport { trackClickItemEvent, trackExposureEvent } from '../../actions/tracking';\nimport QueryFilter from '../../helpers/query-filter';\nimport type { RootState } from '../../reducers';\nimport { ProductGridItem } from '../../styled-components/components/ProductGrid';\nimport ProductCard, { type PrimaryPriceOptions } from '../product-card-v2';\n\ninterface ResultSetItemProps {\n document: ElasticVehicle;\n index: number;\n title?: string;\n testId?: string;\n}\n\nconst ResultSetItem = ({ document, index, title, testId }: ResultSetItemProps) => {\n const dispatch = useDispatch();\n\n const queryFilter = useSelector((s) => s.search.queryFilter);\n const actions = bindActionCreators(\n {\n history,\n trackExposureEvent,\n trackClickItemEvent,\n },\n dispatch,\n );\n\n const onTrackExposure = () =>\n actions.trackExposureEvent(document, new QueryFilter(queryFilter).toString(), index, title);\n\n const onClick = () => {\n actions.trackClickItemEvent(document, index, title);\n if (queryFilter) {\n actions.history(new QueryFilter(queryFilter));\n }\n };\n\n // Set primary price based on price filter applied\n let primaryPrice = 'price';\n\n if (queryFilter?.includes('leasing=true')) {\n primaryPrice = 'privateLeasing';\n } else if (queryFilter?.includes('businessLeasing=true')) {\n primaryPrice = 'businessLeasing';\n }\n\n return (\n \n \n \n );\n};\n\nexport default ResultSetItem;\n"], "mappings": "qWACA,IAAAA,EAAkB,SAkBlB,IAAMC,EAAgB,CAAC,CAAE,SAAAC,EAAU,MAAAC,EAAO,MAAAC,EAAO,OAAAC,CAAO,IAA0B,CAChF,IAAMC,EAAWC,EAAY,EAEvBC,EAAcC,EAAuCC,GAAMA,EAAE,OAAO,WAAW,EAC/EC,EAAUC,EACd,CACE,QAAAC,EACA,mBAAAC,EACA,oBAAAC,CACF,EACAT,CACF,EAEMU,EAAkB,IACtBL,EAAQ,mBAAmBT,EAAU,IAAIe,EAAYT,CAAW,EAAE,SAAS,EAAGL,EAAOC,CAAK,EAEtFc,EAAU,IAAM,CACpBP,EAAQ,oBAAoBT,EAAUC,EAAOC,CAAK,EAC9CI,GACFG,EAAQ,QAAQ,IAAIM,EAAYT,CAAW,CAAC,CAEhD,EAGIW,EAAe,QAEnB,OAAIX,GAAa,SAAS,cAAc,EACtCW,EAAe,iBACNX,GAAa,SAAS,sBAAsB,IACrDW,EAAe,mBAIf,EAAAC,QAAA,cAACC,EAAA,KACC,EAAAD,QAAA,cAACE,EAAA,CACC,KAAMpB,EACN,QAASgB,EACT,WAAYF,EACZ,aAAcG,EACd,OAAQd,EACV,CACF,CAEJ,EAEOkB,EAAQtB", "names": ["import_react", "ResultSetItem", "document", "index", "title", "testId", "dispatch", "useDispatch", "queryFilter", "useSelector", "s", "actions", "bindActionCreators", "history", "trackExposureEvent", "trackClickItemEvent", "onTrackExposure", "query_filter_default", "onClick", "primaryPrice", "React", "ProductGridItem", "product_card_v2_default", "result_set_item_default"] }