{"version":3,"file":"CarSpecsTabularAccordions-400c52da.js","sources":["../../src/components/car-stats/CarSpecsTabularAccordions.vue"],"sourcesContent":["<template>\r\n <div\r\n v-for=\"L1Section in computedSections\"\r\n :key=\"L1Section\"\r\n :class=\"{ 'three-quarter-width': applyFilters }\"\r\n :data-scrollspy-id=\"L1Section.L1Heading.value.toLowerCase()\"\r\n >\r\n <h2 class=\"tabular-data-heading\">\r\n {{ L1Section.L1Heading.value }}\r\n </h2>\r\n\r\n <!-- LEVEL 2 SECTION (DATA NESTED INSIDE ACCORDION) -->\r\n <section v-for=\"L2Section in filteredItems(L1Section.L2Sections)\" :key=\"L2Section\" :cars-to-compare=\"carsToCompare\">\r\n <div class=\"comparison-accordion__container\">\r\n <CarComparisonAccordion :title=\"L2Section.L2Heading.value\">\r\n <CarComparisonTable\r\n :is-mobile=\"isMobile\"\r\n :filtered-items=\"filteredItems(L2Section.selectedDataPoints.targetItems)\"\r\n :cars-to-compare=\"carsToCompare\"\r\n />\r\n </CarComparisonAccordion>\r\n </div>\r\n </section>\r\n </div>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport CarComparisonAccordion from '../car-comparison/CarComparisonAccordion.vue';\r\nimport CarComparisonTable from '../car-comparison/CarComparisonTable.vue';\r\n\r\nconst props = defineProps({\r\n tabularData: {\r\n type: Object,\r\n required: true,\r\n },\r\n carsToCompare: {\r\n type: Array,\r\n required: true,\r\n },\r\n applyFilters: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n isMobile: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n sectionToShow: {\r\n type: String,\r\n default: '',\r\n },\r\n});\r\n\r\n/**\r\n * Filter accordion based on combustion type.\r\n *\r\n * This filter will remove electric vehicle related\r\n * accordions for non-electric vehicles.\r\n */\r\nconst filteredItems = computed(() => {\r\n return (accordionsArray: any[]) => {\r\n return accordionsArray.filter((item) => {\r\n const matchedItems = item.hideFor.targetItems.find((e: any) => e.vehicleType.value === (props.carsToCompare as any[])[0]?.RACQ_SC_Vehicle_Type);\r\n\r\n if (props.applyFilters && item.hideFor.targetItems?.length > 0 && matchedItems?.vehicleType.value) {\r\n return false;\r\n }\r\n\r\n return true;\r\n });\r\n };\r\n});\r\n\r\nconst computedSections = computed(() => {\r\n if (props.sectionToShow) {\r\n return props.tabularData.L1Sections.filter((section: any) => section.L1Heading.value.toLowerCase() === props.sectionToShow.toLowerCase());\r\n }\r\n\r\n return props.tabularData.L1Sections;\r\n});\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.tabular-data-heading {\r\n margin-top: 3.75rem;\r\n}\r\n</style>\r\n"],"names":["filteredItems","computed","accordionsArray","item","matchedItems","e","_a","props","computedSections","section"],"mappings":"y5BA4DMA,EAAgBC,EAAS,IACrBC,GACCA,EAAgB,OAAQC,GAAS,OACtC,MAAMC,EAAeD,EAAK,QAAQ,YAAY,KAAME,GAAW,OAAA,OAAAA,EAAE,YAAY,UAAWC,EAAAC,EAAM,cAAwB,KAA9B,YAAAD,EAAkC,sBAAoB,EAE1I,MAAA,EAAAC,EAAM,gBAAgBD,EAAAH,EAAK,QAAQ,cAAb,YAAAG,EAA0B,QAAS,IAAKF,GAAA,MAAAA,EAAc,YAAY,OAIrF,CACR,CAEJ,EAEKI,EAAmBP,EAAS,IAC5BM,EAAM,cACDA,EAAM,YAAY,WAAW,OAAQE,GAAiBA,EAAQ,UAAU,MAAM,YAAY,IAAMF,EAAM,cAAc,YAAa,CAAA,EAGnIA,EAAM,YAAY,UAC1B"}