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D,WACxBJ,WAAY3D,IAAAA,KAAe+D,WAC3BzC,MAAOtB,IAAAA,OACPuD,aAAcvD,IAAAA,QAGhB,O","sources":["webpack://app/./app/assets/images/icons/search.svg","webpack://app/./app/javascript/common_filter_logic.jsx","webpack://app/./app/assets/images/contracts.svg","webpack://app/./app/assets/images/dates.svg","webpack://app/./app/assets/images/sectors.svg","webpack://app/./app/assets/images/buyers.svg","webpack://app/./app/assets/images/value.svg","webpack://app/./app/assets/images/suppliers.svg","webpack://app/./app/javascript/constants.js","webpack://app/./app/assets/images/icons/filled-checkbox.svg","webpack://app/./app/javascript/ui/selected_checkbox.jsx"],"sourcesContent":["var _path;\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from \"react\";\nconst SvgSearch = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 13 13\"\n}, props), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.832 11.488 10.605 9.28a5.4 5.4 0 1 0-.834.834l2.209 2.208a.6.6 0 0 0 .852 0 .6.6 0 0 0 0-.834Zm-6.427-1.374a4.2 4.2 0 1 1 0-8.401 4.2 4.2 0 0 1 0 8.401Z\"\n})));\nexport default SvgSearch;","import { Component } from 'react';\nimport update from 'immutability-helper';\nimport { keys, isEqual, some, toArray } from 'lodash';\nimport PropTypes from 'prop-types';\n\n// This class encapsulates the common filter logic in one place.\n// It is currently used as the base for all FilterSidebars and the\n// KeyDecisionMakerModuleFilters.\n// Note: I know this makes our React even more based on Inheritance\n// instead of using Composition, but with the limited time\n// available this was the best option.\n// (Jalada made me do it.🙃)\nexport default class CommonFilterLogic extends Component {\n constructor(props) {\n super(props);\n\n const { filters } = props;\n\n keys(this.constructor.defaultFilters).forEach((key) => {\n if (!filters[key]) {\n filters[key] = this.constructor.defaultFilters[key];\n }\n });\n\n this.state = {\n filters,\n openFilterGroups: {},\n submitting: false\n };\n }\n\n toggleOpen(filterGroupKey, open) {\n const updateObj = {\n openFilterGroups: { [filterGroupKey]: { $set: open } }\n };\n this.setState(update(this.state, updateObj));\n }\n\n // Returns a JSON string representing the filters in a filter tree. It\n // does this by:\n //\n // 1. Getting the subclass to generate the submittable filters in an\n // {[filterName]: inputs} format.\n // 2. Filtering away any default filters (e.g. ones that the user has not\n // changed).\n // 3. Adding all those filters to the array of filter elements.\n // 4. Checking whether we need to construct a special OR node for the\n // supplier name AND/OR category filter (on spend). One day this will\n // be a bit more generic.\n // 5. Converting it to a JSON string.\n submittableFilterTree() {\n const filters = this.toSubmittableFilters();\n\n const newFilters = {\n operation: 'and',\n elements: []\n };\n\n // Filter away any default filters & push into array of filters\n keys(filters).forEach(key => {\n if (!isEqual(filters[key], this.constructor.defaultFilters[key])) {\n newFilters.elements.push({ name: key, input: filters[key] });\n }\n });\n\n // If the user has done no filtering, return an empty object. This is\n // to keep consistency between our old code, rather than an empty search\n // being an object with an operation & empty array of elements.\n if (newFilters.elements.length === 0) {\n return '{}';\n }\n\n // For now our 'and/or' is built manually for this one case. We're going\n // to tidy this up one day, maybe when we add the next and/or filter.\n if (this.useOrFilter(filters)) {\n const combinatorialFilter = {\n operation: 'or',\n // Strictly speaking we shouldn't need the name of this filter because\n // this is just a node of our tree. But IIRC we have some workaround\n // transformation code that turns it into the old structure that relies\n // on spotting this. Hopefully we can clean it up later.\n name: 'supplierNameAndOrCategory',\n elements: this.combinedSupplierFilters.map((filter) => {\n return { name: filter, input: filters[filter] };\n })\n };\n\n // Remove the supplier filters from the top level.\n newFilters.elements = newFilters.elements.filter(f => {\n return !this.combinedSupplierFilters.includes(f.name);\n });\n\n // And push the new filter onto the list of elements\n newFilters.elements.push(combinatorialFilter);\n }\n\n // Make sure we never have this pseudo-filter in our filters. This can\n // happen if the user chooses 'or' for the supplier filter behaviour\n // but doesn't put anything in either filter.\n newFilters.elements = newFilters.elements.filter(f => {\n return !(f.name === 'supplierNameAndOrCategory' && !f.elements);\n });\n\n return JSON.stringify(newFilters);\n }\n\n useOrFilter(filters) {\n return (\n filters.supplierNameAndOrCategory === 'or' &&\n this.combinedSupplierFilters.every(filter => (\n typeof filters[filter] !== 'undefined' &&\n !isEqual(filters[filter], this.constructor.defaultFilters[filter])\n ))\n );\n }\n\n handleFilterChange(filter, updateObj) {\n const newState = update(this.state, {\n filters: { [filter]: updateObj },\n changed: { $set: true }\n });\n this.setState(newState);\n }\n\n // Returns true if any of the filters named differ from the default when\n // first rendered (e.g. the ones supplied from a previous search)\n any() {\n return some(toArray(arguments), (filter) => {\n return !isEqual(this.props.filters[filter], this.constructor.defaultFilters[filter]);\n });\n }\n\n // Reveals a overlay on the data table.\n revealOverlay() {\n this.props.overlay.classList.remove('hidden');\n this.props.overlay.classList.add('absolute');\n }\n\n submit(e) {\n e.preventDefault();\n // Set the state to submitting so that we can use this to render a loading\n // spinner and translucent overlay.\n this.setState({ submitting: !this.state.submitting });\n this.revealOverlay();\n this.form.submit();\n }\n\n render() {\n return this.renderComponent();\n }\n}\n\nCommonFilterLogic.propTypes = {\n filters: PropTypes.object,\n overlay: PropTypes.object\n};\n","var _path;\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from \"react\";\nconst SvgContracts = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 13,\n height: 16\n}, props), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"#aaa\",\n d: \"M0 1.6v12.8c0 .88.72 1.6 1.6 1.6h9.6c.88 0 1.8-.72 1.8-1.6V5L8 0H1.6C.72 0 0 .72 0 1.6Zm7-.4L11.6 6H7V1.2Z\"\n})));\nexport default SvgContracts;","var _path;\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from \"react\";\nconst SvgDates = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 16,\n height: 18\n}, props), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"#aaa\",\n fillRule: \"evenodd\",\n d: \"M12 10H8v4h4v-4Zm-1-8H5V0H3v2H1.778C.8 2 0 3.01 0 4v12.2c0 .99.8 1.8 1.778 1.8h12.444C15.2 18 16 17.19 16 16.2V4c0-.99-.8-2-1.778-2H13V0h-2v2Zm3 14H2V6h12v10Z\"\n})));\nexport default SvgDates;","var _path;\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from \"react\";\nconst SvgSectors = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 16,\n height: 16\n}, props), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"#aaa\",\n d: \"M0 16V0h5v11l4-5h2v5l3-5h2v10z\"\n})));\nexport default SvgSectors;","var _path;\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from \"react\";\nconst SvgBuyers = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 13,\n height: 16\n}, props), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"#aaa\",\n d: \"M11 0H3v2H0v14h5v-2h3v2h5V2h-3V0h1ZM6 12H4v-2h2v2Zm0-3H4V7h2v2Zm0-3H4V4h2v2Zm3 6H7v-2h2v2Zm0-3H7V7h2v2ZM7 6V4.024h2V6H7Z\"\n})));\nexport default SvgBuyers;","var _text;\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from \"react\";\nconst SvgValue = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 10,\n height: 15\n}, props), _text || (_text = /*#__PURE__*/React.createElement(\"text\", {\n fill: \"#aaa\",\n fillRule: \"evenodd\",\n fontFamily: \"SourceSansPro-Bold, Source Sans Pro\",\n fontSize: 22,\n fontWeight: \"bold\",\n transform: \"translate(-1 -7)\"\n}, /*#__PURE__*/React.createElement(\"tspan\", {\n x: 0,\n y: 22\n}, \"\\xA3\"))));\nexport default SvgValue;","var _path;\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from \"react\";\nconst SvgSuppliers = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 14,\n height: 16\n}, props), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"#aaa\",\n fillRule: \"evenodd\",\n d: \"M11.636 0H1.455C.655 0 0 .655 0 1.455v9.381c0 .51.218.946.655 1.237L6.545 16l5.891-3.927c.364-.291.655-.728.655-1.237V1.455c0-.8-.655-1.455-1.455-1.455ZM5.091 10.91 1.455 7.272l1.018-1.018L5.09 8.873l5.527-5.528 1.018 1.019-6.545 6.545Z\"\n})));\nexport default SvgSuppliers;","// Import all our icon SVGs\nimport ContractsIcon from '../assets/images/contracts.svg';\nimport DatesIcon from '../assets/images/dates.svg';\nimport SectorsIcon from '../assets/images/sectors.svg';\nimport BuyersIcon from '../assets/images/buyers.svg';\nimport ValueIcon from '../assets/images/value.svg';\nimport SuppliersIcon from '../assets/images/suppliers.svg';\n\n// If you are adding a new option to the opportunityStatusOptions filter\n// see comments in lib/filter/checkbox.rb above #assign_nil_to_contract_status_other_filter\nconst opportunityStatusOptions = [\n ['Open', 'Open tender'],\n ['Closed', 'Closed tender'],\n ['Pre-Information', 'Future opportunity'],\n ['Other', 'Other']\n];\n\nconst contractSMEOptions = [\n ['Y', 'Yes'],\n ['N', 'No'],\n ['All', 'Include all']\n];\n\nconst contractFrameworkOptions = [\n ['Y', 'Yes'],\n ['N', 'No'],\n ['All', 'Include all']\n];\n\nconst suitableSMEOptions = [\n ['true', 'Yes'],\n ['false', 'No'],\n ['All', 'Include all']\n];\n\nconst supplierSMEOptions = [\n ['Y', 'Yes'],\n ['N', 'No'],\n ['All', 'Include all']\n];\n\nconst supplierNameAndOrCategoryOptions = [\n ['and', 'Filter by name and category'],\n ['or', 'Filter by name or category']\n];\n\nconst contractTypeOptions = [\n ['Works', 'Works'],\n ['Services', 'Services'],\n ['Products', 'Products'],\n ['Supplies', 'Supplies'],\n ['None', 'Not specified']\n];\n\nconst keyDecisionMakerSeniorityOptions = [\n ['Chairman', 'Chairman'],\n ['Vice/Deputy Chairman', 'Vice / Deputy Chairman'],\n ['Chief Officer', 'Chief Officer'],\n ['Deputy/Assistant Chief Officer', 'Deputy / Assistant Chief Officer'],\n ['Clerk/Secretary', 'Clerk / Secretary'],\n ['Top Level Director', 'Top Level Director'],\n ['Second Level / Head of Service', 'Second Level / Head of Service'],\n ['Third Level/Head of Service/Manager', 'Third Level / Head of Service / Manager'],\n ['Unspecified', 'Unspecified']\n];\n\nconst isCalloffOptions = [\n ['Y', 'Yes'],\n ['N', 'No'],\n ['All', 'Include all']\n];\n\n// TODO: Live/Expired Date\n// KEEP after removing feature flag, this is used in constants below: allRelativeDateOptionsWithLiveDateOptions, allRelativeDateOptionsWithLiveDateOptionsAndPrevFinancialYear\n// Remove comment after removing feature flag\nconst liveDateOptions = [\n ['live', 'Live'],\n ['live_and_unknown', 'Live and Unknown'],\n ['expired', 'Expired']\n];\n\nconst invoiceBuyerTypes = [\n {\n label: '',\n options: [\n ['Central Government', 'Central Government'],\n ['Local Government', 'Local Government'],\n ['NHS', 'NHS'],\n ['Rail', 'Rail'],\n ['Devolved Transport', 'Devolved Transport'],\n ['Policing', 'Policing'],\n ['Fire Service', 'Fire Service'],\n ['Charitable Organisation', 'Charitable Organisation'],\n ['Private Limited', 'Private Limited']\n ]\n }\n];\n\nconst invoiceSupplierTypes = [\n ['private', 'Private'],\n ['public', 'Public'],\n ['All', 'All']\n];\n\nconst pastDates = {\n label: 'Past',\n options: [\n ['prev_24_months', 'Last 24 months'],\n ['prev_12_months', 'Last 12 months'],\n ['prev_6_months', 'Last 6 months'],\n ['prev_3_months', 'Last 3 months'],\n ['prev_30_days', 'Last 30 days'],\n ['prev_14_days', 'Last 14 days'],\n ['prev_7_days', 'Last 7 days'],\n ['prev_calendar_year', 'Previous calendar year'],\n ['year_to_date', 'Year to date'],\n ['month_to_date', 'Month to date']\n ]\n};\n\n// TODO: Financial Year\n// KEEP after removing feature flag, this is used in constants below: justPastDatesWithPrevFinancialYear, allRelativeDateOptionsWithPrevFinancialYear, pastRelativeDateOptionsWithPrevFinancialYear\n// Remove comment after removing feature flag\nconst pastDatesWithPrevFinancialYear = {\n label: 'Past',\n options: [\n ['prev_24_months', 'Last 24 months'],\n ['prev_12_months', 'Last 12 months'],\n ['prev_6_months', 'Last 6 months'],\n ['prev_3_months', 'Last 3 months'],\n ['prev_30_days', 'Last 30 days'],\n ['prev_14_days', 'Last 14 days'],\n ['prev_7_days', 'Last 7 days'],\n ['prev_financial_year', 'Previous financial year'],\n ['prev_calendar_year', 'Previous calendar year'],\n ['year_to_date', 'Year to date'],\n ['month_to_date', 'Month to date']\n ]\n};\n\nconst futureDates = {\n label: 'Future',\n options: [\n ['next_7_days', 'Next 7 days'],\n ['next_14_days', 'Next 14 days'],\n ['next_30_days', 'Next 30 days'],\n ['next_3_months', 'Next 3 months'],\n ['next_6_months', 'Next 6 months'],\n ['next_12_months', 'Next 12 months'],\n ['next_24_months', 'Next 24 months']\n ]\n};\n\nconst presentDates = {\n label: 'Present',\n options: [\n ['yesterday', 'Yesterday'],\n ['today', 'Today'],\n ['tomorrow', 'Tomorrow']\n ]\n};\n\nconst justPastDates = [\n pastDates\n];\n\n// TODO: Financial Year\n// KEEP after removing feature flag, this is used in app/javascript/invoice_filter_sidebar/index.jsx\n// Remove comment after removing feature flag\nconst justPastDatesWithPrevFinancialYear = [\n pastDatesWithPrevFinancialYear\n];\n\nconst pastRelativeDateOptions = [\n pastDates,\n {\n label: 'Present',\n options: [\n ['yesterday', 'Yesterday'], ['today', 'Today']\n ]\n }\n];\n\nconst allRelativeDateOptions = [\n pastDates,\n presentDates,\n futureDates\n];\n\n// TODO: Financial Year\n// KEEP after removing feature flag, this is used in:\n// app/javascript/contract_award_filter_sidebar/index.jsx, app/javascript/contract_notice_filter_sidebar/index.jsx, app/javascript/framework_filter_sidebar/index.jsx\n// Remove comment after removing feature flag\nconst allRelativeDateOptionsWithPrevFinancialYear = [\n pastDatesWithPrevFinancialYear,\n presentDates,\n futureDates\n];\n\n// TODO: Financial Year\n// KEEP after removing feature flag, this is used in:\n// app/javascript/contract_award_filter_sidebar/index.jsx, app/javascript/framework_filter_sidebar/index.jsx\n// Remove comment after removing feature flag\nconst pastRelativeDateOptionsWithPrevFinancialYear = [\n pastDatesWithPrevFinancialYear,\n {\n label: 'Present',\n options: [\n ['yesterday', 'Yesterday'], ['today', 'Today']\n ]\n }\n];\n\n// TODO: Live/Expired Date\n// KEEP after removing feature flag, this is used in:\n// app/javascript/contract_award_filter_sidebar/index.jsx\n// Remove comment after removing feature flag\nconst allRelativeDateOptionsWithLiveDateOptions = [\n {\n label: 'Status',\n options: liveDateOptions\n },\n ...allRelativeDateOptions\n];\n\n// TODO: Live/Expired Date\n// KEEP after removing feature flag, this is used in:\n// app/javascript/contract_award_filter_sidebar/index.jsx, app/javascript/framework_filter_sidebar/index.jsx\n// Remove comment after removing feature flag\nconst allRelativeDateOptionsWithLiveDateOptionsAndPrevFinancialYear = [\n {\n label: 'Status',\n options: liveDateOptions\n },\n ...allRelativeDateOptionsWithPrevFinancialYear\n];\n\nconst buyerTypeOptions = [\n {\n label: 'Public Sector',\n options: [\n ['Central Government', 'Central Government'],\n ['Local Government', 'Local Government'],\n ['NHS', 'NHS'],\n ['Rail', 'Rail'],\n ['Devolved Transport', 'Devolved Transport'],\n ['Policing', 'Policing'],\n ['Fire Service', 'Fire Service'],\n ['Further and Higher Education', 'Further and Higher Education'],\n ['Schools', 'Schools'],\n ['Parish Councils', 'Parish Councils']\n ]\n },\n {\n label: 'Private Sector',\n options: [\n ['Limited Liability Partnership', 'Limited Liability Partnership'],\n ['Private Limited', 'Private Limited'],\n ['Private Limited w/o Share Capital', 'Private Limited w/o Share Capital'],\n ['Private Unlimited', 'Private Unlimited'],\n ['Public Limited Company', 'Public Limited Company'],\n ['Non Limited', 'Non Limited'],\n ['Foreign Company', 'Foreign Company'],\n ['Joint Venture', 'Joint Venture'],\n ['Unknown', 'Unknown']\n ]\n },\n {\n label: 'Non Profit',\n options: [\n ['Housing Association', 'Housing Association'],\n ['Charitable Organisation', 'Charitable Organisation'],\n ['Non Profit Organisation', 'Non Profit Organisation'],\n ['The Church of England', 'The Church of England']\n ]\n }\n];\n\nconst employeeCountOptions = [\n ['1 - 10', '1 - 10'],\n ['11 - 50', '11 - 50'],\n ['51 - 250', '51 - 250'],\n ['251 - 500', '251 - 500'],\n ['501 - 1000', '501 - 1000'],\n ['1001 - 5000', '1001 - 5000'],\n ['5001 - 10,000', '5001 - 10,000'],\n ['10,000+', '10,000+'],\n ['Unknown', 'Unknown']\n];\n\n// Export our icons in an object\nconst icons = {\n contracts: ContractsIcon,\n dates: DatesIcon,\n sectors: SectorsIcon,\n buyers: BuyersIcon,\n value: ValueIcon,\n suppliers: SuppliersIcon\n};\n\nconst chartFontFamily = [\n 'Untitled Sans',\n 'Inter',\n 'Roboto',\n 'Helvetica Neue',\n 'Arial Nova',\n 'Nimbus Sans',\n 'Arial',\n 'sans-serif'\n];\n\nexport {\n contractSMEOptions,\n contractFrameworkOptions,\n contractTypeOptions,\n allRelativeDateOptions,\n allRelativeDateOptionsWithPrevFinancialYear,\n allRelativeDateOptionsWithLiveDateOptions,\n allRelativeDateOptionsWithLiveDateOptionsAndPrevFinancialYear,\n justPastDates,\n justPastDatesWithPrevFinancialYear,\n opportunityStatusOptions,\n pastRelativeDateOptions,\n pastRelativeDateOptionsWithPrevFinancialYear,\n suitableSMEOptions,\n supplierSMEOptions,\n supplierNameAndOrCategoryOptions,\n isCalloffOptions,\n buyerTypeOptions,\n employeeCountOptions,\n invoiceBuyerTypes,\n invoiceSupplierTypes,\n keyDecisionMakerSeniorityOptions,\n icons,\n chartFontFamily\n};\n","var _path, _path2;\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from \"react\";\nconst SvgFilledCheckbox = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 21,\n height: 21,\n fill: \"none\"\n}, props), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"#005E09\",\n d: \"M0 4a4 4 0 0 1 4-4h13a4 4 0 0 1 4 4v13a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4Z\"\n})), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"#F2F4F2\",\n d: \"M13.84 7.174a.503.503 0 0 0-.162-.129.434.434 0 0 0-.384 0 .502.502 0 0 0-.162.129l-3.71 4.379-1.56-1.844a.508.508 0 0 0-.166-.126.441.441 0 0 0-.39.008.517.517 0 0 0-.163.133.62.62 0 0 0-.108.197.696.696 0 0 0 .007.459.612.612 0 0 0 .113.192l1.913 2.254a.502.502 0 0 0 .162.129.434.434 0 0 0 .383 0 .503.503 0 0 0 .162-.129l4.065-4.79a.596.596 0 0 0 .118-.195.678.678 0 0 0 0-.471.596.596 0 0 0-.118-.196Z\"\n})));\nexport default SvgFilledCheckbox;","import React from 'react';\nimport Tick from '../../assets/images/icons/filled-checkbox.svg';\nimport PropTypes from 'prop-types';\n\nfunction SelectedCheckbox(props) {\n const labelClasses = props.labelClasses ? props.labelClasses : '';\n\n return (\n \n );\n}\n\nSelectedCheckbox.propTypes = {\n value: PropTypes.object.isRequired,\n onDeselect: PropTypes.func.isRequired,\n label: PropTypes.string,\n labelClasses: PropTypes.string\n};\n\nexport default SelectedCheckbox;\n"],"names":["_path","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","props","xmlns","fill","viewBox","d","CommonFilterLogic","Component","constructor","super","filters","keys","defaultFilters","forEach","state","openFilterGroups","submitting","toggleOpen","filterGroupKey","open","updateObj","$set","setState","update","submittableFilterTree","toSubmittableFilters","newFilters","operation","elements","isEqual","push","name","input","useOrFilter","combinatorialFilter","combinedSupplierFilters","map","filter","f","includes","JSON","stringify","supplierNameAndOrCategory","every","handleFilterChange","newState","changed","any","some","toArray","revealOverlay","overlay","classList","remove","add","submit","e","preventDefault","form","render","renderComponent","propTypes","PropTypes","width","height","fillRule","_text","fontFamily","fontSize","fontWeight","transform","x","y","opportunityStatusOptions","contractSMEOptions","contractFrameworkOptions","suitableSMEOptions","supplierSMEOptions","supplierNameAndOrCategoryOptions","contractTypeOptions","keyDecisionMakerSeniorityOptions","isCalloffOptions","liveDateOptions","invoiceBuyerTypes","label","options","invoiceSupplierTypes","pastDates","pastDatesWithPrevFinancialYear","futureDates","presentDates","justPastDates","justPastDatesWithPrevFinancialYear","pastRelativeDateOptions","allRelativeDateOptions","allRelativeDateOptionsWithPrevFinancialYear","pastRelativeDateOptionsWithPrevFinancialYear","allRelativeDateOptionsWithLiveDateOptions","allRelativeDateOptionsWithLiveDateOptionsAndPrevFinancialYear","buyerTypeOptions","employeeCountOptions","icons","contracts","ContractsIcon","dates","DatesIcon","sectors","SectorsIcon","buyers","BuyersIcon","value","ValueIcon","suppliers","SuppliersIcon","chartFontFamily","_path2","SelectedCheckbox","labelClasses","React","type","onChange","onDeselect","defaultChecked","className","Tick","isRequired"],"sourceRoot":""}