From 433122a8dfc95fc2fb4216686527f74d003527df Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Thu, 7 Aug 2025 03:27:50 +0100 Subject: [PATCH 01/15] add support to withdrawal-type filter --- src/CONST/index.ts | 6 + .../Search/SearchAutocompleteList.tsx | 11 + src/components/Search/types.ts | 2 + src/languages/en.ts | 5 + src/libs/SearchAutocompleteUtils.ts | 3 + src/libs/SearchParser/autocompleteParser.js | 583 +++++++++-------- .../SearchParser/autocompleteParser.peggy | 1 + src/libs/SearchParser/baseRules.peggy | 3 + src/libs/SearchParser/searchParser.js | 585 ++++++++++-------- src/libs/SearchParser/searchParser.peggy | 1 + src/libs/SearchQueryUtils.ts | 9 + src/pages/Search/AdvancedSearchFilters.tsx | 13 + src/types/form/SearchAdvancedFiltersForm.ts | 6 +- 13 files changed, 680 insertions(+), 548 deletions(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 98740c16d67b..249efe147785 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -6299,6 +6299,10 @@ const CONST = { DISTANCE: 'distance', PER_DIEM: 'perDiem', }, + WITHDRAWAL_TYPE: { + EXPENSIFY_CARD: 'expensifyCard', + REIMBURSEMENT: 'reimbursement', + }, SORT_ORDER: { ASC: 'asc', DESC: 'desc', @@ -6410,6 +6414,7 @@ const CONST = { PAID: 'paid', EXPORTED: 'exported', POSTED: 'posted', + WITHDRAWAL_TYPE: 'withdrawalType', WITHDRAWN: 'withdrawn', TITLE: 'title', ASSIGNEE: 'assignee', @@ -6455,6 +6460,7 @@ const CONST = { PAID: 'paid', EXPORTED: 'exported', POSTED: 'posted', + WITHDRAWAL_TYPE: 'withdrawal-type', WITHDRAWN: 'withdrawn', TITLE: 'title', ASSIGNEE: 'assignee', diff --git a/src/components/Search/SearchAutocompleteList.tsx b/src/components/Search/SearchAutocompleteList.tsx index b0b05944c84d..cee7c574a6fc 100644 --- a/src/components/Search/SearchAutocompleteList.tsx +++ b/src/components/Search/SearchAutocompleteList.tsx @@ -205,6 +205,7 @@ function SearchAutocompleteList( }, [autocompleteQueryValue]); const expenseTypes = Object.values(CONST.SEARCH.TRANSACTION_TYPE); + const withdrawalTypes = Object.values(CONST.SEARCH.WITHDRAWAL_TYPE); const booleanTypes = Object.values(CONST.SEARCH.BOOLEAN); const cardAutocompleteList = useMemo(() => Object.values(allCards), [allCards]); @@ -374,6 +375,16 @@ function SearchAutocompleteList( text: expenseType, })); } + case CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_TYPE: { + const filteredWithdrawalTypes = withdrawalTypes + .filter((withdrawalType) => withdrawalType.includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(withdrawalType)) + .sort(); + + return filteredWithdrawalTypes.map((withdrawalType) => ({ + filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.WITHDRAWAL_TYPE, + text: withdrawalType, + })); + } case CONST.SEARCH.SYNTAX_FILTER_KEYS.FEED: { const filteredFeeds = feedAutoCompleteList .filter((feed) => feed.name.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(feed.name.toLowerCase())) diff --git a/src/components/Search/types.ts b/src/components/Search/types.ts index d08d09baf48f..368597087c6d 100644 --- a/src/components/Search/types.ts +++ b/src/components/Search/types.ts @@ -67,6 +67,7 @@ type SearchStatus = SingularSearchStatus | SingularSearchStatus[]; type SearchGroupBy = ValueOf; type TableColumnSize = ValueOf; type SearchDatePreset = ValueOf; +type SearchWithdrawalType = ValueOf; type SearchContextData = { currentSearchHash: number; @@ -205,4 +206,5 @@ export type { SearchGroupBy, SingularSearchStatus, SearchDatePreset, + SearchWithdrawalType, }; diff --git a/src/languages/en.ts b/src/languages/en.ts index 7894ea620504..5354268b7934 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -5984,6 +5984,10 @@ const translations = { cards: 'Card', // s77rt use singular key name }, feed: 'Feed', + withdrawalType: { + [CONST.SEARCH.WITHDRAWAL_TYPE.EXPENSIFY_CARD]: 'Expensify Card', + [CONST.SEARCH.WITHDRAWAL_TYPE.REIMBURSEMENT]: 'Reimbursement', + }, }, groupBy: 'Group by', moneyRequestReport: { @@ -5993,6 +5997,7 @@ const translations = { noCategory: 'No category', noTag: 'No tag', expenseType: 'Expense type', + withdrawalType: 'Withdrawal type', recentSearches: 'Recent searches', recentChats: 'Recent chats', searchIn: 'Search in', diff --git a/src/libs/SearchAutocompleteUtils.ts b/src/libs/SearchAutocompleteUtils.ts index 340ac9fe873c..a4064839e8d2 100644 --- a/src/libs/SearchAutocompleteUtils.ts +++ b/src/libs/SearchAutocompleteUtils.ts @@ -124,6 +124,7 @@ function filterOutRangesWithCorrectValue( const typeList = Object.values(CONST.SEARCH.DATA_TYPES) as string[]; const expenseTypeList = Object.values(CONST.SEARCH.TRANSACTION_TYPE) as string[]; + const withdrawalTypeList = Object.values(CONST.SEARCH.WITHDRAWAL_TYPE) as string[]; const statusList = Object.values({ ...CONST.SEARCH.STATUS.EXPENSE, ...CONST.SEARCH.STATUS.INVOICE, @@ -157,6 +158,8 @@ function filterOutRangesWithCorrectValue( return typeList.includes(range.value); case CONST.SEARCH.SYNTAX_FILTER_KEYS.EXPENSE_TYPE: return expenseTypeList.includes(range.value); + case CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_TYPE: + return withdrawalTypeList.includes(range.value); case CONST.SEARCH.SYNTAX_ROOT_KEYS.STATUS: return statusList.includes(range.value); case CONST.SEARCH.SYNTAX_FILTER_KEYS.ACTION: diff --git a/src/libs/SearchParser/autocompleteParser.js b/src/libs/SearchParser/autocompleteParser.js index 8b8de13d2f99..1943d351ae97 100644 --- a/src/libs/SearchParser/autocompleteParser.js +++ b/src/libs/SearchParser/autocompleteParser.js @@ -204,38 +204,40 @@ function peg$parse(input, options) { var peg$c18 = "from"; var peg$c19 = "expenseType"; var peg$c20 = "expense-type"; - var peg$c21 = "billable"; - var peg$c22 = "reimbursable"; - var peg$c23 = "type"; - var peg$c24 = "status"; - var peg$c25 = "sortBy"; - var peg$c26 = "sort-by"; - var peg$c27 = "sortOrder"; - var peg$c28 = "sort-order"; - var peg$c29 = "policyID"; - var peg$c30 = "workspace"; - var peg$c31 = "submitted"; - var peg$c32 = "approved"; - var peg$c33 = "paid"; - var peg$c34 = "exported"; - var peg$c35 = "posted"; - var peg$c36 = "withdrawn"; - var peg$c37 = "groupby"; - var peg$c38 = "group-by"; - var peg$c39 = "feed"; - var peg$c40 = "title"; - var peg$c41 = "assignee"; - var peg$c42 = "createdby"; - var peg$c43 = "created-by"; - var peg$c44 = "action"; - var peg$c45 = "!="; - var peg$c46 = ">="; - var peg$c47 = ">"; - var peg$c48 = "<="; - var peg$c49 = "<"; - var peg$c50 = "\u201C"; - var peg$c51 = "\u201D"; - var peg$c52 = "\""; + var peg$c21 = "withdrawalType"; + var peg$c22 = "withdrawal-type"; + var peg$c23 = "billable"; + var peg$c24 = "reimbursable"; + var peg$c25 = "type"; + var peg$c26 = "status"; + var peg$c27 = "sortBy"; + var peg$c28 = "sort-by"; + var peg$c29 = "sortOrder"; + var peg$c30 = "sort-order"; + var peg$c31 = "policyID"; + var peg$c32 = "workspace"; + var peg$c33 = "submitted"; + var peg$c34 = "approved"; + var peg$c35 = "paid"; + var peg$c36 = "exported"; + var peg$c37 = "posted"; + var peg$c38 = "withdrawn"; + var peg$c39 = "groupby"; + var peg$c40 = "group-by"; + var peg$c41 = "feed"; + var peg$c42 = "title"; + var peg$c43 = "assignee"; + var peg$c44 = "createdby"; + var peg$c45 = "created-by"; + var peg$c46 = "action"; + var peg$c47 = "!="; + var peg$c48 = ">="; + var peg$c49 = ">"; + var peg$c50 = "<="; + var peg$c51 = "<"; + var peg$c52 = "\u201C"; + var peg$c53 = "\u201D"; + var peg$c54 = "\""; var peg$r0 = /^[:=]/; var peg$r1 = /^[^ ,\t\n\r\xA0]/; @@ -271,54 +273,56 @@ function peg$parse(input, options) { var peg$e19 = peg$literalExpectation("from", true); var peg$e20 = peg$literalExpectation("expenseType", false); var peg$e21 = peg$literalExpectation("expense-type", true); - var peg$e22 = peg$literalExpectation("billable", true); - var peg$e23 = peg$literalExpectation("reimbursable", true); - var peg$e24 = peg$literalExpectation("type", true); - var peg$e25 = peg$literalExpectation("status", true); - var peg$e26 = peg$literalExpectation("sortBy", false); - var peg$e27 = peg$literalExpectation("sort-by", true); - var peg$e28 = peg$literalExpectation("sortOrder", false); - var peg$e29 = peg$literalExpectation("sort-order", true); - var peg$e30 = peg$literalExpectation("policyID", false); - var peg$e31 = peg$literalExpectation("workspace", true); - var peg$e32 = peg$literalExpectation("submitted", true); - var peg$e33 = peg$literalExpectation("approved", true); - var peg$e34 = peg$literalExpectation("paid", true); - var peg$e35 = peg$literalExpectation("exported", true); - var peg$e36 = peg$literalExpectation("posted", true); - var peg$e37 = peg$literalExpectation("withdrawn", true); - var peg$e38 = peg$literalExpectation("groupBy", true); - var peg$e39 = peg$literalExpectation("group-by", true); - var peg$e40 = peg$literalExpectation("feed", true); - var peg$e41 = peg$literalExpectation("title", true); - var peg$e42 = peg$literalExpectation("assignee", true); - var peg$e43 = peg$literalExpectation("createdBy", true); - var peg$e44 = peg$literalExpectation("created-by", true); - var peg$e45 = peg$literalExpectation("action", true); - var peg$e46 = peg$otherExpectation("operator"); - var peg$e47 = peg$classExpectation([":", "="], false, false); - var peg$e48 = peg$literalExpectation("!=", false); - var peg$e49 = peg$literalExpectation(">=", false); - var peg$e50 = peg$literalExpectation(">", false); - var peg$e51 = peg$literalExpectation("<=", false); - var peg$e52 = peg$literalExpectation("<", false); - var peg$e53 = peg$otherExpectation("word"); - var peg$e54 = peg$classExpectation([" ", ",", "\t", "\n", "\r", "\xA0"], true, false); - var peg$e55 = peg$otherExpectation("whitespace"); - var peg$e56 = peg$classExpectation([" ", "\t", "\r", "\n", "\xA0"], false, false); - var peg$e57 = peg$otherExpectation("quote"); - var peg$e58 = peg$classExpectation([" ", ",", "\"", "\u201D", "\u201C", "\t", "\n", "\r", "\xA0"], true, false); - var peg$e59 = peg$classExpectation(["\"", ["\u201C", "\u201D"]], false, false); - var peg$e60 = peg$classExpectation(["\"", "\u201D", "\u201C", "\r", "\n"], true, false); - var peg$e61 = peg$literalExpectation("\u201C", false); - var peg$e62 = peg$literalExpectation("\u201D", false); - var peg$e63 = peg$literalExpectation("\"", false); - var peg$e64 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"], ["0", "9"]], false, false); - var peg$e65 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false); - var peg$e66 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0"], false, false); - var peg$e67 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"]], false, false); - var peg$e68 = peg$anyExpectation(); - var peg$e69 = peg$classExpectation([","], false, false); + var peg$e22 = peg$literalExpectation("withdrawalType", false); + var peg$e23 = peg$literalExpectation("withdrawal-type", true); + var peg$e24 = peg$literalExpectation("billable", true); + var peg$e25 = peg$literalExpectation("reimbursable", true); + var peg$e26 = peg$literalExpectation("type", true); + var peg$e27 = peg$literalExpectation("status", true); + var peg$e28 = peg$literalExpectation("sortBy", false); + var peg$e29 = peg$literalExpectation("sort-by", true); + var peg$e30 = peg$literalExpectation("sortOrder", false); + var peg$e31 = peg$literalExpectation("sort-order", true); + var peg$e32 = peg$literalExpectation("policyID", false); + var peg$e33 = peg$literalExpectation("workspace", true); + var peg$e34 = peg$literalExpectation("submitted", true); + var peg$e35 = peg$literalExpectation("approved", true); + var peg$e36 = peg$literalExpectation("paid", true); + var peg$e37 = peg$literalExpectation("exported", true); + var peg$e38 = peg$literalExpectation("posted", true); + var peg$e39 = peg$literalExpectation("withdrawn", true); + var peg$e40 = peg$literalExpectation("groupBy", true); + var peg$e41 = peg$literalExpectation("group-by", true); + var peg$e42 = peg$literalExpectation("feed", true); + var peg$e43 = peg$literalExpectation("title", true); + var peg$e44 = peg$literalExpectation("assignee", true); + var peg$e45 = peg$literalExpectation("createdBy", true); + var peg$e46 = peg$literalExpectation("created-by", true); + var peg$e47 = peg$literalExpectation("action", true); + var peg$e48 = peg$otherExpectation("operator"); + var peg$e49 = peg$classExpectation([":", "="], false, false); + var peg$e50 = peg$literalExpectation("!=", false); + var peg$e51 = peg$literalExpectation(">=", false); + var peg$e52 = peg$literalExpectation(">", false); + var peg$e53 = peg$literalExpectation("<=", false); + var peg$e54 = peg$literalExpectation("<", false); + var peg$e55 = peg$otherExpectation("word"); + var peg$e56 = peg$classExpectation([" ", ",", "\t", "\n", "\r", "\xA0"], true, false); + var peg$e57 = peg$otherExpectation("whitespace"); + var peg$e58 = peg$classExpectation([" ", "\t", "\r", "\n", "\xA0"], false, false); + var peg$e59 = peg$otherExpectation("quote"); + var peg$e60 = peg$classExpectation([" ", ",", "\"", "\u201D", "\u201C", "\t", "\n", "\r", "\xA0"], true, false); + var peg$e61 = peg$classExpectation(["\"", ["\u201C", "\u201D"]], false, false); + var peg$e62 = peg$classExpectation(["\"", "\u201D", "\u201C", "\r", "\n"], true, false); + var peg$e63 = peg$literalExpectation("\u201C", false); + var peg$e64 = peg$literalExpectation("\u201D", false); + var peg$e65 = peg$literalExpectation("\"", false); + var peg$e66 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"], ["0", "9"]], false, false); + var peg$e67 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false); + var peg$e68 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0"], false, false); + var peg$e69 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"]], false, false); + var peg$e70 = peg$anyExpectation(); + var peg$e71 = peg$classExpectation([","], false, false); var peg$f0 = function(ranges) { return { autocomplete, ranges }; }; var peg$f1 = function(filters) { return filters.filter(Boolean).flat(); }; @@ -390,47 +394,48 @@ function peg$parse(input, options) { var peg$f20 = function() { return "cardID"; }; var peg$f21 = function() { return "from"; }; var peg$f22 = function() { return "expenseType"; }; - var peg$f23 = function() { return "billable"; }; - var peg$f24 = function() { return "reimbursable"; }; - var peg$f25 = function() { return "type"; }; - var peg$f26 = function() { return "status"; }; - var peg$f27 = function() { return "sortBy"; }; - var peg$f28 = function() { return "sortOrder"; }; - var peg$f29 = function() { return "policyID"; }; - var peg$f30 = function() { return "submitted"; }; - var peg$f31 = function() { return "approved"; }; - var peg$f32 = function() { return "paid"; }; - var peg$f33 = function() { return "exported"; }; - var peg$f34 = function() { return "posted"; }; - var peg$f35 = function() { return "withdrawn"; }; - var peg$f36 = function() { return "groupBy"; }; - var peg$f37 = function() { return "feed"; }; - var peg$f38 = function() { return "title"; }; - var peg$f39 = function() { return "assignee"; }; - var peg$f40 = function() { return "createdBy"; }; - var peg$f41 = function() { return "action"; }; - var peg$f42 = function() { return "eq"; }; - var peg$f43 = function() { return "neq"; }; - var peg$f44 = function() { return "gte"; }; - var peg$f45 = function() { return "gt"; }; - var peg$f46 = function() { return "lte"; }; - var peg$f47 = function() { return "lt"; }; - var peg$f48 = function(o) { + var peg$f23 = function() { return "withdrawalType"; }; + var peg$f24 = function() { return "billable"; }; + var peg$f25 = function() { return "reimbursable"; }; + var peg$f26 = function() { return "type"; }; + var peg$f27 = function() { return "status"; }; + var peg$f28 = function() { return "sortBy"; }; + var peg$f29 = function() { return "sortOrder"; }; + var peg$f30 = function() { return "policyID"; }; + var peg$f31 = function() { return "submitted"; }; + var peg$f32 = function() { return "approved"; }; + var peg$f33 = function() { return "paid"; }; + var peg$f34 = function() { return "exported"; }; + var peg$f35 = function() { return "posted"; }; + var peg$f36 = function() { return "withdrawn"; }; + var peg$f37 = function() { return "groupBy"; }; + var peg$f38 = function() { return "feed"; }; + var peg$f39 = function() { return "title"; }; + var peg$f40 = function() { return "assignee"; }; + var peg$f41 = function() { return "createdBy"; }; + var peg$f42 = function() { return "action"; }; + var peg$f43 = function() { return "eq"; }; + var peg$f44 = function() { return "neq"; }; + var peg$f45 = function() { return "gte"; }; + var peg$f46 = function() { return "gt"; }; + var peg$f47 = function() { return "lte"; }; + var peg$f48 = function() { return "lt"; }; + var peg$f49 = function(o) { if (nameOperator) { expectingNestedQuote = (o === "eq"); // Use simple parser if no valid operator is found } return o; }; - var peg$f49 = function(chars) { return chars.join("").trim(); }; - var peg$f50 = function() { return "and"; }; - var peg$f51 = function() { return expectingNestedQuote; }; - var peg$f52 = function(start, inner, end) { //handle no-breaking space + var peg$f50 = function(chars) { return chars.join("").trim(); }; + var peg$f51 = function() { return "and"; }; + var peg$f52 = function() { return expectingNestedQuote; }; + var peg$f53 = function(start, inner, end) { //handle no-breaking space return [...start, '"', ...inner, '"', ...end].join(""); }; - var peg$f53 = function(start) {return "“"}; - var peg$f54 = function(start) {return "”"}; - var peg$f55 = function(start) {return "\""}; - var peg$f56 = function(start, inner, end) { + var peg$f54 = function(start) {return "“"}; + var peg$f55 = function(start) {return "”"}; + var peg$f56 = function(start) {return "\""}; + var peg$f57 = function(start, inner, end) { return [...start, '"', ...inner, '"'].join(""); }; var peg$currPos = options.peg$currPos | 0; @@ -736,29 +741,32 @@ function peg$parse(input, options) { if (s1 === peg$FAILED) { s1 = peg$parseexpenseType(); if (s1 === peg$FAILED) { - s1 = peg$parsetype(); + s1 = peg$parsewithdrawalType(); if (s1 === peg$FAILED) { - s1 = peg$parsestatus(); + s1 = peg$parsetype(); if (s1 === peg$FAILED) { - s1 = peg$parsecardID(); + s1 = peg$parsestatus(); if (s1 === peg$FAILED) { - s1 = peg$parsefeed(); + s1 = peg$parsecardID(); if (s1 === peg$FAILED) { - s1 = peg$parsegroupBy(); + s1 = peg$parsefeed(); if (s1 === peg$FAILED) { - s1 = peg$parsereimbursable(); + s1 = peg$parsegroupBy(); if (s1 === peg$FAILED) { - s1 = peg$parsebillable(); + s1 = peg$parsereimbursable(); if (s1 === peg$FAILED) { - s1 = peg$parsepolicyID(); + s1 = peg$parsebillable(); if (s1 === peg$FAILED) { - s1 = peg$parseaction(); + s1 = peg$parsepolicyID(); if (s1 === peg$FAILED) { - s1 = peg$parseposted(); + s1 = peg$parseaction(); if (s1 === peg$FAILED) { - s1 = peg$parsewithdrawn(); + s1 = peg$parseposted(); if (s1 === peg$FAILED) { - s1 = peg$parseexported(); + s1 = peg$parsewithdrawn(); + if (s1 === peg$FAILED) { + s1 = peg$parseexported(); + } } } } @@ -1240,20 +1248,49 @@ function peg$parse(input, options) { return s0; } + function peg$parsewithdrawalType() { + var s0, s1; + + if (input.substr(peg$currPos, 14) === peg$c21) { + s0 = peg$c21; + peg$currPos += 14; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e22); } + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = input.substr(peg$currPos, 15); + if (s1.toLowerCase() === peg$c22) { + peg$currPos += 15; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e23); } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f23(); + } + s0 = s1; + } + + return s0; + } + function peg$parsebillable() { var s0, s1; s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c21) { + if (s1.toLowerCase() === peg$c23) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e22); } + if (peg$silentFails === 0) { peg$fail(peg$e24); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f23(); + s1 = peg$f24(); } s0 = s1; @@ -1265,15 +1302,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c22) { + if (s1.toLowerCase() === peg$c24) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e23); } + if (peg$silentFails === 0) { peg$fail(peg$e25); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f24(); + s1 = peg$f25(); } s0 = s1; @@ -1285,15 +1322,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c23) { + if (s1.toLowerCase() === peg$c25) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e24); } + if (peg$silentFails === 0) { peg$fail(peg$e26); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f25(); + s1 = peg$f26(); } s0 = s1; @@ -1305,15 +1342,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c24) { + if (s1.toLowerCase() === peg$c26) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e25); } + if (peg$silentFails === 0) { peg$fail(peg$e27); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f26(); + s1 = peg$f27(); } s0 = s1; @@ -1323,25 +1360,25 @@ function peg$parse(input, options) { function peg$parsesortBy() { var s0, s1; - if (input.substr(peg$currPos, 6) === peg$c25) { - s0 = peg$c25; + if (input.substr(peg$currPos, 6) === peg$c27) { + s0 = peg$c27; peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e26); } + if (peg$silentFails === 0) { peg$fail(peg$e28); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 7); - if (s1.toLowerCase() === peg$c26) { + if (s1.toLowerCase() === peg$c28) { peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e27); } + if (peg$silentFails === 0) { peg$fail(peg$e29); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f27(); + s1 = peg$f28(); } s0 = s1; } @@ -1352,25 +1389,25 @@ function peg$parse(input, options) { function peg$parsesortOrder() { var s0, s1; - if (input.substr(peg$currPos, 9) === peg$c27) { - s0 = peg$c27; + if (input.substr(peg$currPos, 9) === peg$c29) { + s0 = peg$c29; peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e28); } + if (peg$silentFails === 0) { peg$fail(peg$e30); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c28) { + if (s1.toLowerCase() === peg$c30) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e29); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f28(); + s1 = peg$f29(); } s0 = s1; } @@ -1381,25 +1418,25 @@ function peg$parse(input, options) { function peg$parsepolicyID() { var s0, s1; - if (input.substr(peg$currPos, 8) === peg$c29) { - s0 = peg$c29; + if (input.substr(peg$currPos, 8) === peg$c31) { + s0 = peg$c31; peg$currPos += 8; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e30); } + if (peg$silentFails === 0) { peg$fail(peg$e32); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c30) { + if (s1.toLowerCase() === peg$c32) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e31); } + if (peg$silentFails === 0) { peg$fail(peg$e33); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f29(); + s1 = peg$f30(); } s0 = s1; } @@ -1412,15 +1449,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c31) { + if (s1.toLowerCase() === peg$c33) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e32); } + if (peg$silentFails === 0) { peg$fail(peg$e34); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f30(); + s1 = peg$f31(); } s0 = s1; @@ -1432,15 +1469,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c32) { + if (s1.toLowerCase() === peg$c34) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e33); } + if (peg$silentFails === 0) { peg$fail(peg$e35); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f31(); + s1 = peg$f32(); } s0 = s1; @@ -1452,15 +1489,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c33) { + if (s1.toLowerCase() === peg$c35) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e34); } + if (peg$silentFails === 0) { peg$fail(peg$e36); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f32(); + s1 = peg$f33(); } s0 = s1; @@ -1472,15 +1509,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c34) { + if (s1.toLowerCase() === peg$c36) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e35); } + if (peg$silentFails === 0) { peg$fail(peg$e37); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f33(); + s1 = peg$f34(); } s0 = s1; @@ -1492,15 +1529,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c35) { + if (s1.toLowerCase() === peg$c37) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e36); } + if (peg$silentFails === 0) { peg$fail(peg$e38); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f34(); + s1 = peg$f35(); } s0 = s1; @@ -1512,15 +1549,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c36) { + if (s1.toLowerCase() === peg$c38) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } + if (peg$silentFails === 0) { peg$fail(peg$e39); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f35(); + s1 = peg$f36(); } s0 = s1; @@ -1531,24 +1568,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 7); - if (s0.toLowerCase() === peg$c37) { + if (s0.toLowerCase() === peg$c39) { peg$currPos += 7; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e38); } + if (peg$silentFails === 0) { peg$fail(peg$e40); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c38) { + if (s1.toLowerCase() === peg$c40) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e39); } + if (peg$silentFails === 0) { peg$fail(peg$e41); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f36(); + s1 = peg$f37(); } s0 = s1; } @@ -1561,15 +1598,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c39) { + if (s1.toLowerCase() === peg$c41) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e40); } + if (peg$silentFails === 0) { peg$fail(peg$e42); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f37(); + s1 = peg$f38(); } s0 = s1; @@ -1581,15 +1618,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 5); - if (s1.toLowerCase() === peg$c40) { + if (s1.toLowerCase() === peg$c42) { peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e41); } + if (peg$silentFails === 0) { peg$fail(peg$e43); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f38(); + s1 = peg$f39(); } s0 = s1; @@ -1601,15 +1638,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c41) { + if (s1.toLowerCase() === peg$c43) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e42); } + if (peg$silentFails === 0) { peg$fail(peg$e44); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f39(); + s1 = peg$f40(); } s0 = s1; @@ -1620,24 +1657,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 9); - if (s0.toLowerCase() === peg$c42) { + if (s0.toLowerCase() === peg$c44) { peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e43); } + if (peg$silentFails === 0) { peg$fail(peg$e45); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c43) { + if (s1.toLowerCase() === peg$c45) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e44); } + if (peg$silentFails === 0) { peg$fail(peg$e46); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f40(); + s1 = peg$f41(); } s0 = s1; } @@ -1650,15 +1687,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c44) { + if (s1.toLowerCase() === peg$c46) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e45); } + if (peg$silentFails === 0) { peg$fail(peg$e47); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f41(); + s1 = peg$f42(); } s0 = s1; @@ -1675,81 +1712,81 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e47); } + if (peg$silentFails === 0) { peg$fail(peg$e49); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f42(); + s1 = peg$f43(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c45) { - s1 = peg$c45; + if (input.substr(peg$currPos, 2) === peg$c47) { + s1 = peg$c47; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e48); } + if (peg$silentFails === 0) { peg$fail(peg$e50); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f43(); + s1 = peg$f44(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c46) { - s1 = peg$c46; + if (input.substr(peg$currPos, 2) === peg$c48) { + s1 = peg$c48; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e49); } + if (peg$silentFails === 0) { peg$fail(peg$e51); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f44(); + s1 = peg$f45(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 62) { - s1 = peg$c47; + s1 = peg$c49; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e50); } + if (peg$silentFails === 0) { peg$fail(peg$e52); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f45(); + s1 = peg$f46(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c48) { - s1 = peg$c48; + if (input.substr(peg$currPos, 2) === peg$c50) { + s1 = peg$c50; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e51); } + if (peg$silentFails === 0) { peg$fail(peg$e53); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f46(); + s1 = peg$f47(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 60) { - s1 = peg$c49; + s1 = peg$c51; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e52); } + if (peg$silentFails === 0) { peg$fail(peg$e54); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f47(); + s1 = peg$f48(); } s0 = s1; } @@ -1760,7 +1797,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e46); } + if (peg$silentFails === 0) { peg$fail(peg$e48); } } return s0; @@ -1773,7 +1810,7 @@ function peg$parse(input, options) { s1 = peg$parseoperator(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f48(s1); + s1 = peg$f49(s1); } s0 = s1; @@ -1791,7 +1828,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e54); } + if (peg$silentFails === 0) { peg$fail(peg$e56); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { @@ -1801,7 +1838,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e54); } + if (peg$silentFails === 0) { peg$fail(peg$e56); } } } } else { @@ -1809,13 +1846,13 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f49(s1); + s1 = peg$f50(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e53); } + if (peg$silentFails === 0) { peg$fail(peg$e55); } } return s0; @@ -1827,7 +1864,7 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parse_(); peg$savedPos = s0; - s1 = peg$f50(); + s1 = peg$f51(); s0 = s1; return s0; @@ -1843,7 +1880,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e56); } + if (peg$silentFails === 0) { peg$fail(peg$e58); } } while (s1 !== peg$FAILED) { s0.push(s1); @@ -1852,12 +1889,12 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e56); } + if (peg$silentFails === 0) { peg$fail(peg$e58); } } } peg$silentFails--; s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e55); } + if (peg$silentFails === 0) { peg$fail(peg$e57); } return s0; } @@ -1867,7 +1904,7 @@ function peg$parse(input, options) { s0 = peg$currPos; peg$savedPos = peg$currPos; - s1 = peg$f51(); + s1 = peg$f52(); if (s1) { s1 = undefined; } else { @@ -1904,7 +1941,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e58); } + if (peg$silentFails === 0) { peg$fail(peg$e60); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -1913,7 +1950,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e58); } + if (peg$silentFails === 0) { peg$fail(peg$e60); } } } s2 = input.charAt(peg$currPos); @@ -1921,7 +1958,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e59); } + if (peg$silentFails === 0) { peg$fail(peg$e61); } } if (s2 !== peg$FAILED) { s3 = []; @@ -1930,7 +1967,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e60); } + if (peg$silentFails === 0) { peg$fail(peg$e62); } } while (s4 !== peg$FAILED) { s3.push(s4); @@ -1939,7 +1976,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e60); } + if (peg$silentFails === 0) { peg$fail(peg$e62); } } } s4 = input.charAt(peg$currPos); @@ -1947,7 +1984,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e59); } + if (peg$silentFails === 0) { peg$fail(peg$e61); } } if (s4 !== peg$FAILED) { s5 = []; @@ -1956,7 +1993,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e54); } + if (peg$silentFails === 0) { peg$fail(peg$e56); } } while (s6 !== peg$FAILED) { s5.push(s6); @@ -1965,11 +2002,11 @@ function peg$parse(input, options) { peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e54); } + if (peg$silentFails === 0) { peg$fail(peg$e56); } } } peg$savedPos = s0; - s0 = peg$f52(s1, s3, s5); + s0 = peg$f53(s1, s3, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1981,7 +2018,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e57); } + if (peg$silentFails === 0) { peg$fail(peg$e59); } } return s0; @@ -1998,7 +2035,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e58); } + if (peg$silentFails === 0) { peg$fail(peg$e60); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -2007,7 +2044,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e58); } + if (peg$silentFails === 0) { peg$fail(peg$e60); } } } s2 = input.charAt(peg$currPos); @@ -2015,7 +2052,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e59); } + if (peg$silentFails === 0) { peg$fail(peg$e61); } } if (s2 !== peg$FAILED) { s3 = []; @@ -2024,7 +2061,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e60); } + if (peg$silentFails === 0) { peg$fail(peg$e62); } } if (s4 === peg$FAILED) { s4 = peg$currPos; @@ -2040,15 +2077,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8220) { - s6 = peg$c50; + s6 = peg$c52; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e61); } + if (peg$silentFails === 0) { peg$fail(peg$e63); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f53(s1); + s4 = peg$f54(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -2071,15 +2108,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8221) { - s6 = peg$c51; + s6 = peg$c53; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e62); } + if (peg$silentFails === 0) { peg$fail(peg$e64); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f54(s1); + s4 = peg$f55(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -2102,15 +2139,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s6 = peg$c52; + s6 = peg$c54; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e63); } + if (peg$silentFails === 0) { peg$fail(peg$e65); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f55(s1); + s4 = peg$f56(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -2129,7 +2166,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e60); } + if (peg$silentFails === 0) { peg$fail(peg$e62); } } if (s4 === peg$FAILED) { s4 = peg$currPos; @@ -2145,15 +2182,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8220) { - s6 = peg$c50; + s6 = peg$c52; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e61); } + if (peg$silentFails === 0) { peg$fail(peg$e63); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f53(s1); + s4 = peg$f54(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -2176,15 +2213,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8221) { - s6 = peg$c51; + s6 = peg$c53; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e62); } + if (peg$silentFails === 0) { peg$fail(peg$e64); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f54(s1); + s4 = peg$f55(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -2207,15 +2244,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s6 = peg$c52; + s6 = peg$c54; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e63); } + if (peg$silentFails === 0) { peg$fail(peg$e65); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f55(s1); + s4 = peg$f56(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -2231,7 +2268,7 @@ function peg$parse(input, options) { s4 = peg$parseclosingQuote(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f56(s1, s3, s4); + s0 = peg$f57(s1, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2243,7 +2280,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e57); } + if (peg$silentFails === 0) { peg$fail(peg$e59); } } return s0; @@ -2258,7 +2295,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e59); } + if (peg$silentFails === 0) { peg$fail(peg$e61); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2296,7 +2333,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e64); } + if (peg$silentFails === 0) { peg$fail(peg$e66); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -2305,7 +2342,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e64); } + if (peg$silentFails === 0) { peg$fail(peg$e66); } } } s2 = []; @@ -2314,7 +2351,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e65); } + if (peg$silentFails === 0) { peg$fail(peg$e67); } } while (s3 !== peg$FAILED) { s2.push(s3); @@ -2323,7 +2360,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e65); } + if (peg$silentFails === 0) { peg$fail(peg$e67); } } } s3 = []; @@ -2332,7 +2369,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e66); } + if (peg$silentFails === 0) { peg$fail(peg$e68); } } while (s4 !== peg$FAILED) { s3.push(s4); @@ -2341,7 +2378,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e66); } + if (peg$silentFails === 0) { peg$fail(peg$e68); } } } s4 = peg$parseoperator(); @@ -2360,7 +2397,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e67); } + if (peg$silentFails === 0) { peg$fail(peg$e69); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -2369,7 +2406,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e67); } + if (peg$silentFails === 0) { peg$fail(peg$e69); } } } s2 = peg$currPos; @@ -2390,7 +2427,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e68); } + if (peg$silentFails === 0) { peg$fail(peg$e70); } } peg$silentFails--; if (s4 === peg$FAILED) { @@ -2416,7 +2453,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e69); } + if (peg$silentFails === 0) { peg$fail(peg$e71); } } } } diff --git a/src/libs/SearchParser/autocompleteParser.peggy b/src/libs/SearchParser/autocompleteParser.peggy index 6ee0cb144038..2f3c24bff364 100644 --- a/src/libs/SearchParser/autocompleteParser.peggy +++ b/src/libs/SearchParser/autocompleteParser.peggy @@ -69,6 +69,7 @@ autocompleteKey "key" / createdBy / assignee / expenseType + / withdrawalType / type / status / cardID diff --git a/src/libs/SearchParser/baseRules.peggy b/src/libs/SearchParser/baseRules.peggy index 80511cb601fb..31d7e573796d 100644 --- a/src/libs/SearchParser/baseRules.peggy +++ b/src/libs/SearchParser/baseRules.peggy @@ -38,6 +38,9 @@ from = "from"i { return "from"; } expenseType = "expenseType" / "expense-type"i { return "expenseType"; } +withdrawalType + = "withdrawalType" + / "withdrawal-type"i { return "withdrawalType"; } billable = "billable"i { return "billable"; } reimbursable = "reimbursable"i { return "reimbursable"; } type = "type"i { return "type"; } diff --git a/src/libs/SearchParser/searchParser.js b/src/libs/SearchParser/searchParser.js index 7ca3eb537fd9..7be15ccd7a34 100644 --- a/src/libs/SearchParser/searchParser.js +++ b/src/libs/SearchParser/searchParser.js @@ -205,38 +205,40 @@ function peg$parse(input, options) { var peg$c18 = "from"; var peg$c19 = "expenseType"; var peg$c20 = "expense-type"; - var peg$c21 = "billable"; - var peg$c22 = "reimbursable"; - var peg$c23 = "type"; - var peg$c24 = "status"; - var peg$c25 = "sortBy"; - var peg$c26 = "sort-by"; - var peg$c27 = "sortOrder"; - var peg$c28 = "sort-order"; - var peg$c29 = "policyID"; - var peg$c30 = "workspace"; - var peg$c31 = "submitted"; - var peg$c32 = "approved"; - var peg$c33 = "paid"; - var peg$c34 = "exported"; - var peg$c35 = "posted"; - var peg$c36 = "withdrawn"; - var peg$c37 = "groupby"; - var peg$c38 = "group-by"; - var peg$c39 = "feed"; - var peg$c40 = "title"; - var peg$c41 = "assignee"; - var peg$c42 = "createdby"; - var peg$c43 = "created-by"; - var peg$c44 = "action"; - var peg$c45 = "!="; - var peg$c46 = ">="; - var peg$c47 = ">"; - var peg$c48 = "<="; - var peg$c49 = "<"; - var peg$c50 = "\u201C"; - var peg$c51 = "\u201D"; - var peg$c52 = "\""; + var peg$c21 = "withdrawalType"; + var peg$c22 = "withdrawal-type"; + var peg$c23 = "billable"; + var peg$c24 = "reimbursable"; + var peg$c25 = "type"; + var peg$c26 = "status"; + var peg$c27 = "sortBy"; + var peg$c28 = "sort-by"; + var peg$c29 = "sortOrder"; + var peg$c30 = "sort-order"; + var peg$c31 = "policyID"; + var peg$c32 = "workspace"; + var peg$c33 = "submitted"; + var peg$c34 = "approved"; + var peg$c35 = "paid"; + var peg$c36 = "exported"; + var peg$c37 = "posted"; + var peg$c38 = "withdrawn"; + var peg$c39 = "groupby"; + var peg$c40 = "group-by"; + var peg$c41 = "feed"; + var peg$c42 = "title"; + var peg$c43 = "assignee"; + var peg$c44 = "createdby"; + var peg$c45 = "created-by"; + var peg$c46 = "action"; + var peg$c47 = "!="; + var peg$c48 = ">="; + var peg$c49 = ">"; + var peg$c50 = "<="; + var peg$c51 = "<"; + var peg$c52 = "\u201C"; + var peg$c53 = "\u201D"; + var peg$c54 = "\""; var peg$r0 = /^[^ \t\r\n\xA0]/; var peg$r1 = /^[:=]/; @@ -275,54 +277,56 @@ function peg$parse(input, options) { var peg$e21 = peg$literalExpectation("from", true); var peg$e22 = peg$literalExpectation("expenseType", false); var peg$e23 = peg$literalExpectation("expense-type", true); - var peg$e24 = peg$literalExpectation("billable", true); - var peg$e25 = peg$literalExpectation("reimbursable", true); - var peg$e26 = peg$literalExpectation("type", true); - var peg$e27 = peg$literalExpectation("status", true); - var peg$e28 = peg$literalExpectation("sortBy", false); - var peg$e29 = peg$literalExpectation("sort-by", true); - var peg$e30 = peg$literalExpectation("sortOrder", false); - var peg$e31 = peg$literalExpectation("sort-order", true); - var peg$e32 = peg$literalExpectation("policyID", false); - var peg$e33 = peg$literalExpectation("workspace", true); - var peg$e34 = peg$literalExpectation("submitted", true); - var peg$e35 = peg$literalExpectation("approved", true); - var peg$e36 = peg$literalExpectation("paid", true); - var peg$e37 = peg$literalExpectation("exported", true); - var peg$e38 = peg$literalExpectation("posted", true); - var peg$e39 = peg$literalExpectation("withdrawn", true); - var peg$e40 = peg$literalExpectation("groupBy", true); - var peg$e41 = peg$literalExpectation("group-by", true); - var peg$e42 = peg$literalExpectation("feed", true); - var peg$e43 = peg$literalExpectation("title", true); - var peg$e44 = peg$literalExpectation("assignee", true); - var peg$e45 = peg$literalExpectation("createdBy", true); - var peg$e46 = peg$literalExpectation("created-by", true); - var peg$e47 = peg$literalExpectation("action", true); - var peg$e48 = peg$otherExpectation("operator"); - var peg$e49 = peg$classExpectation([":", "="], false, false); - var peg$e50 = peg$literalExpectation("!=", false); - var peg$e51 = peg$literalExpectation(">=", false); - var peg$e52 = peg$literalExpectation(">", false); - var peg$e53 = peg$literalExpectation("<=", false); - var peg$e54 = peg$literalExpectation("<", false); - var peg$e55 = peg$otherExpectation("word"); - var peg$e56 = peg$classExpectation([" ", ",", "\t", "\n", "\r", "\xA0"], true, false); - var peg$e57 = peg$otherExpectation("whitespace"); - var peg$e58 = peg$classExpectation([" ", "\t", "\r", "\n", "\xA0"], false, false); - var peg$e59 = peg$otherExpectation("quote"); - var peg$e60 = peg$classExpectation([" ", ",", "\"", "\u201D", "\u201C", "\t", "\n", "\r", "\xA0"], true, false); - var peg$e61 = peg$classExpectation(["\"", ["\u201C", "\u201D"]], false, false); - var peg$e62 = peg$classExpectation(["\"", "\u201D", "\u201C", "\r", "\n"], true, false); - var peg$e63 = peg$literalExpectation("\u201C", false); - var peg$e64 = peg$literalExpectation("\u201D", false); - var peg$e65 = peg$literalExpectation("\"", false); - var peg$e66 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"], ["0", "9"]], false, false); - var peg$e67 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false); - var peg$e68 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0"], false, false); - var peg$e69 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"]], false, false); - var peg$e70 = peg$anyExpectation(); - var peg$e71 = peg$classExpectation([","], false, false); + var peg$e24 = peg$literalExpectation("withdrawalType", false); + var peg$e25 = peg$literalExpectation("withdrawal-type", true); + var peg$e26 = peg$literalExpectation("billable", true); + var peg$e27 = peg$literalExpectation("reimbursable", true); + var peg$e28 = peg$literalExpectation("type", true); + var peg$e29 = peg$literalExpectation("status", true); + var peg$e30 = peg$literalExpectation("sortBy", false); + var peg$e31 = peg$literalExpectation("sort-by", true); + var peg$e32 = peg$literalExpectation("sortOrder", false); + var peg$e33 = peg$literalExpectation("sort-order", true); + var peg$e34 = peg$literalExpectation("policyID", false); + var peg$e35 = peg$literalExpectation("workspace", true); + var peg$e36 = peg$literalExpectation("submitted", true); + var peg$e37 = peg$literalExpectation("approved", true); + var peg$e38 = peg$literalExpectation("paid", true); + var peg$e39 = peg$literalExpectation("exported", true); + var peg$e40 = peg$literalExpectation("posted", true); + var peg$e41 = peg$literalExpectation("withdrawn", true); + var peg$e42 = peg$literalExpectation("groupBy", true); + var peg$e43 = peg$literalExpectation("group-by", true); + var peg$e44 = peg$literalExpectation("feed", true); + var peg$e45 = peg$literalExpectation("title", true); + var peg$e46 = peg$literalExpectation("assignee", true); + var peg$e47 = peg$literalExpectation("createdBy", true); + var peg$e48 = peg$literalExpectation("created-by", true); + var peg$e49 = peg$literalExpectation("action", true); + var peg$e50 = peg$otherExpectation("operator"); + var peg$e51 = peg$classExpectation([":", "="], false, false); + var peg$e52 = peg$literalExpectation("!=", false); + var peg$e53 = peg$literalExpectation(">=", false); + var peg$e54 = peg$literalExpectation(">", false); + var peg$e55 = peg$literalExpectation("<=", false); + var peg$e56 = peg$literalExpectation("<", false); + var peg$e57 = peg$otherExpectation("word"); + var peg$e58 = peg$classExpectation([" ", ",", "\t", "\n", "\r", "\xA0"], true, false); + var peg$e59 = peg$otherExpectation("whitespace"); + var peg$e60 = peg$classExpectation([" ", "\t", "\r", "\n", "\xA0"], false, false); + var peg$e61 = peg$otherExpectation("quote"); + var peg$e62 = peg$classExpectation([" ", ",", "\"", "\u201D", "\u201C", "\t", "\n", "\r", "\xA0"], true, false); + var peg$e63 = peg$classExpectation(["\"", ["\u201C", "\u201D"]], false, false); + var peg$e64 = peg$classExpectation(["\"", "\u201D", "\u201C", "\r", "\n"], true, false); + var peg$e65 = peg$literalExpectation("\u201C", false); + var peg$e66 = peg$literalExpectation("\u201D", false); + var peg$e67 = peg$literalExpectation("\"", false); + var peg$e68 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"], ["0", "9"]], false, false); + var peg$e69 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false); + var peg$e70 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0"], false, false); + var peg$e71 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"]], false, false); + var peg$e72 = peg$anyExpectation(); + var peg$e73 = peg$classExpectation([","], false, false); var peg$f0 = function(filters) { return applyDefaults(filters); }; var peg$f1 = function(head, tail) { @@ -406,47 +410,48 @@ function peg$parse(input, options) { var peg$f21 = function() { return "cardID"; }; var peg$f22 = function() { return "from"; }; var peg$f23 = function() { return "expenseType"; }; - var peg$f24 = function() { return "billable"; }; - var peg$f25 = function() { return "reimbursable"; }; - var peg$f26 = function() { return "type"; }; - var peg$f27 = function() { return "status"; }; - var peg$f28 = function() { return "sortBy"; }; - var peg$f29 = function() { return "sortOrder"; }; - var peg$f30 = function() { return "policyID"; }; - var peg$f31 = function() { return "submitted"; }; - var peg$f32 = function() { return "approved"; }; - var peg$f33 = function() { return "paid"; }; - var peg$f34 = function() { return "exported"; }; - var peg$f35 = function() { return "posted"; }; - var peg$f36 = function() { return "withdrawn"; }; - var peg$f37 = function() { return "groupBy"; }; - var peg$f38 = function() { return "feed"; }; - var peg$f39 = function() { return "title"; }; - var peg$f40 = function() { return "assignee"; }; - var peg$f41 = function() { return "createdBy"; }; - var peg$f42 = function() { return "action"; }; - var peg$f43 = function() { return "eq"; }; - var peg$f44 = function() { return "neq"; }; - var peg$f45 = function() { return "gte"; }; - var peg$f46 = function() { return "gt"; }; - var peg$f47 = function() { return "lte"; }; - var peg$f48 = function() { return "lt"; }; - var peg$f49 = function(o) { + var peg$f24 = function() { return "withdrawalType"; }; + var peg$f25 = function() { return "billable"; }; + var peg$f26 = function() { return "reimbursable"; }; + var peg$f27 = function() { return "type"; }; + var peg$f28 = function() { return "status"; }; + var peg$f29 = function() { return "sortBy"; }; + var peg$f30 = function() { return "sortOrder"; }; + var peg$f31 = function() { return "policyID"; }; + var peg$f32 = function() { return "submitted"; }; + var peg$f33 = function() { return "approved"; }; + var peg$f34 = function() { return "paid"; }; + var peg$f35 = function() { return "exported"; }; + var peg$f36 = function() { return "posted"; }; + var peg$f37 = function() { return "withdrawn"; }; + var peg$f38 = function() { return "groupBy"; }; + var peg$f39 = function() { return "feed"; }; + var peg$f40 = function() { return "title"; }; + var peg$f41 = function() { return "assignee"; }; + var peg$f42 = function() { return "createdBy"; }; + var peg$f43 = function() { return "action"; }; + var peg$f44 = function() { return "eq"; }; + var peg$f45 = function() { return "neq"; }; + var peg$f46 = function() { return "gte"; }; + var peg$f47 = function() { return "gt"; }; + var peg$f48 = function() { return "lte"; }; + var peg$f49 = function() { return "lt"; }; + var peg$f50 = function(o) { if (nameOperator) { expectingNestedQuote = (o === "eq"); // Use simple parser if no valid operator is found } return o; }; - var peg$f50 = function(chars) { return chars.join("").trim(); }; - var peg$f51 = function() { return "and"; }; - var peg$f52 = function() { return expectingNestedQuote; }; - var peg$f53 = function(start, inner, end) { //handle no-breaking space + var peg$f51 = function(chars) { return chars.join("").trim(); }; + var peg$f52 = function() { return "and"; }; + var peg$f53 = function() { return expectingNestedQuote; }; + var peg$f54 = function(start, inner, end) { //handle no-breaking space return [...start, '"', ...inner, '"', ...end].join(""); }; - var peg$f54 = function(start) {return "“"}; - var peg$f55 = function(start) {return "”"}; - var peg$f56 = function(start) {return "\""}; - var peg$f57 = function(start, inner, end) { + var peg$f55 = function(start) {return "“"}; + var peg$f56 = function(start) {return "”"}; + var peg$f57 = function(start) {return "\""}; + var peg$f58 = function(start, inner, end) { return [...start, '"', ...inner, '"'].join(""); }; var peg$currPos = options.peg$currPos | 0; @@ -831,31 +836,34 @@ function peg$parse(input, options) { if (s1 === peg$FAILED) { s1 = peg$parseexpenseType(); if (s1 === peg$FAILED) { - s1 = peg$parsesubmitted(); + s1 = peg$parsewithdrawalType(); if (s1 === peg$FAILED) { - s1 = peg$parseapproved(); + s1 = peg$parsesubmitted(); if (s1 === peg$FAILED) { - s1 = peg$parsepaid(); + s1 = peg$parseapproved(); if (s1 === peg$FAILED) { - s1 = peg$parseexported(); + s1 = peg$parsepaid(); if (s1 === peg$FAILED) { - s1 = peg$parseposted(); + s1 = peg$parseexported(); if (s1 === peg$FAILED) { - s1 = peg$parsewithdrawn(); + s1 = peg$parseposted(); if (s1 === peg$FAILED) { - s1 = peg$parsefeed(); + s1 = peg$parsewithdrawn(); if (s1 === peg$FAILED) { - s1 = peg$parsetitle(); + s1 = peg$parsefeed(); if (s1 === peg$FAILED) { - s1 = peg$parseassignee(); + s1 = peg$parsetitle(); if (s1 === peg$FAILED) { - s1 = peg$parsecreatedBy(); + s1 = peg$parseassignee(); if (s1 === peg$FAILED) { - s1 = peg$parsereimbursable(); + s1 = peg$parsecreatedBy(); if (s1 === peg$FAILED) { - s1 = peg$parsebillable(); + s1 = peg$parsereimbursable(); if (s1 === peg$FAILED) { - s1 = peg$parseaction(); + s1 = peg$parsebillable(); + if (s1 === peg$FAILED) { + s1 = peg$parseaction(); + } } } } @@ -1434,20 +1442,49 @@ function peg$parse(input, options) { return s0; } + function peg$parsewithdrawalType() { + var s0, s1; + + if (input.substr(peg$currPos, 14) === peg$c21) { + s0 = peg$c21; + peg$currPos += 14; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e24); } + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = input.substr(peg$currPos, 15); + if (s1.toLowerCase() === peg$c22) { + peg$currPos += 15; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e25); } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f24(); + } + s0 = s1; + } + + return s0; + } + function peg$parsebillable() { var s0, s1; s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c21) { + if (s1.toLowerCase() === peg$c23) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e24); } + if (peg$silentFails === 0) { peg$fail(peg$e26); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f24(); + s1 = peg$f25(); } s0 = s1; @@ -1459,15 +1496,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c22) { + if (s1.toLowerCase() === peg$c24) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e25); } + if (peg$silentFails === 0) { peg$fail(peg$e27); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f25(); + s1 = peg$f26(); } s0 = s1; @@ -1479,15 +1516,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c23) { + if (s1.toLowerCase() === peg$c25) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e26); } + if (peg$silentFails === 0) { peg$fail(peg$e28); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f26(); + s1 = peg$f27(); } s0 = s1; @@ -1499,15 +1536,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c24) { + if (s1.toLowerCase() === peg$c26) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e27); } + if (peg$silentFails === 0) { peg$fail(peg$e29); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f27(); + s1 = peg$f28(); } s0 = s1; @@ -1517,25 +1554,25 @@ function peg$parse(input, options) { function peg$parsesortBy() { var s0, s1; - if (input.substr(peg$currPos, 6) === peg$c25) { - s0 = peg$c25; + if (input.substr(peg$currPos, 6) === peg$c27) { + s0 = peg$c27; peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e28); } + if (peg$silentFails === 0) { peg$fail(peg$e30); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 7); - if (s1.toLowerCase() === peg$c26) { + if (s1.toLowerCase() === peg$c28) { peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e29); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f28(); + s1 = peg$f29(); } s0 = s1; } @@ -1546,25 +1583,25 @@ function peg$parse(input, options) { function peg$parsesortOrder() { var s0, s1; - if (input.substr(peg$currPos, 9) === peg$c27) { - s0 = peg$c27; + if (input.substr(peg$currPos, 9) === peg$c29) { + s0 = peg$c29; peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e30); } + if (peg$silentFails === 0) { peg$fail(peg$e32); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c28) { + if (s1.toLowerCase() === peg$c30) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e31); } + if (peg$silentFails === 0) { peg$fail(peg$e33); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f29(); + s1 = peg$f30(); } s0 = s1; } @@ -1575,25 +1612,25 @@ function peg$parse(input, options) { function peg$parsepolicyID() { var s0, s1; - if (input.substr(peg$currPos, 8) === peg$c29) { - s0 = peg$c29; + if (input.substr(peg$currPos, 8) === peg$c31) { + s0 = peg$c31; peg$currPos += 8; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e32); } + if (peg$silentFails === 0) { peg$fail(peg$e34); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c30) { + if (s1.toLowerCase() === peg$c32) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e33); } + if (peg$silentFails === 0) { peg$fail(peg$e35); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f30(); + s1 = peg$f31(); } s0 = s1; } @@ -1606,15 +1643,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c31) { + if (s1.toLowerCase() === peg$c33) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e34); } + if (peg$silentFails === 0) { peg$fail(peg$e36); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f31(); + s1 = peg$f32(); } s0 = s1; @@ -1626,15 +1663,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c32) { + if (s1.toLowerCase() === peg$c34) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e35); } + if (peg$silentFails === 0) { peg$fail(peg$e37); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f32(); + s1 = peg$f33(); } s0 = s1; @@ -1646,15 +1683,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c33) { + if (s1.toLowerCase() === peg$c35) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e36); } + if (peg$silentFails === 0) { peg$fail(peg$e38); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f33(); + s1 = peg$f34(); } s0 = s1; @@ -1666,15 +1703,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c34) { + if (s1.toLowerCase() === peg$c36) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } + if (peg$silentFails === 0) { peg$fail(peg$e39); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f34(); + s1 = peg$f35(); } s0 = s1; @@ -1686,15 +1723,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c35) { + if (s1.toLowerCase() === peg$c37) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e38); } + if (peg$silentFails === 0) { peg$fail(peg$e40); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f35(); + s1 = peg$f36(); } s0 = s1; @@ -1706,15 +1743,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c36) { + if (s1.toLowerCase() === peg$c38) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e39); } + if (peg$silentFails === 0) { peg$fail(peg$e41); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f36(); + s1 = peg$f37(); } s0 = s1; @@ -1725,24 +1762,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 7); - if (s0.toLowerCase() === peg$c37) { + if (s0.toLowerCase() === peg$c39) { peg$currPos += 7; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e40); } + if (peg$silentFails === 0) { peg$fail(peg$e42); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c38) { + if (s1.toLowerCase() === peg$c40) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e41); } + if (peg$silentFails === 0) { peg$fail(peg$e43); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f37(); + s1 = peg$f38(); } s0 = s1; } @@ -1755,15 +1792,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c39) { + if (s1.toLowerCase() === peg$c41) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e42); } + if (peg$silentFails === 0) { peg$fail(peg$e44); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f38(); + s1 = peg$f39(); } s0 = s1; @@ -1775,15 +1812,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 5); - if (s1.toLowerCase() === peg$c40) { + if (s1.toLowerCase() === peg$c42) { peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e43); } + if (peg$silentFails === 0) { peg$fail(peg$e45); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f39(); + s1 = peg$f40(); } s0 = s1; @@ -1795,15 +1832,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c41) { + if (s1.toLowerCase() === peg$c43) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e44); } + if (peg$silentFails === 0) { peg$fail(peg$e46); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f40(); + s1 = peg$f41(); } s0 = s1; @@ -1814,24 +1851,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 9); - if (s0.toLowerCase() === peg$c42) { + if (s0.toLowerCase() === peg$c44) { peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e45); } + if (peg$silentFails === 0) { peg$fail(peg$e47); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c43) { + if (s1.toLowerCase() === peg$c45) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e46); } + if (peg$silentFails === 0) { peg$fail(peg$e48); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f41(); + s1 = peg$f42(); } s0 = s1; } @@ -1844,15 +1881,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c44) { + if (s1.toLowerCase() === peg$c46) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e47); } + if (peg$silentFails === 0) { peg$fail(peg$e49); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f42(); + s1 = peg$f43(); } s0 = s1; @@ -1869,81 +1906,81 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e49); } + if (peg$silentFails === 0) { peg$fail(peg$e51); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f43(); + s1 = peg$f44(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c45) { - s1 = peg$c45; + if (input.substr(peg$currPos, 2) === peg$c47) { + s1 = peg$c47; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e50); } + if (peg$silentFails === 0) { peg$fail(peg$e52); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f44(); + s1 = peg$f45(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c46) { - s1 = peg$c46; + if (input.substr(peg$currPos, 2) === peg$c48) { + s1 = peg$c48; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e51); } + if (peg$silentFails === 0) { peg$fail(peg$e53); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f45(); + s1 = peg$f46(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 62) { - s1 = peg$c47; + s1 = peg$c49; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e52); } + if (peg$silentFails === 0) { peg$fail(peg$e54); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f46(); + s1 = peg$f47(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c48) { - s1 = peg$c48; + if (input.substr(peg$currPos, 2) === peg$c50) { + s1 = peg$c50; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e53); } + if (peg$silentFails === 0) { peg$fail(peg$e55); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f47(); + s1 = peg$f48(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 60) { - s1 = peg$c49; + s1 = peg$c51; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e54); } + if (peg$silentFails === 0) { peg$fail(peg$e56); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f48(); + s1 = peg$f49(); } s0 = s1; } @@ -1954,7 +1991,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e48); } + if (peg$silentFails === 0) { peg$fail(peg$e50); } } return s0; @@ -1967,7 +2004,7 @@ function peg$parse(input, options) { s1 = peg$parseoperator(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f49(s1); + s1 = peg$f50(s1); } s0 = s1; @@ -1985,7 +2022,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e56); } + if (peg$silentFails === 0) { peg$fail(peg$e58); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { @@ -1995,7 +2032,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e56); } + if (peg$silentFails === 0) { peg$fail(peg$e58); } } } } else { @@ -2003,13 +2040,13 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f50(s1); + s1 = peg$f51(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e55); } + if (peg$silentFails === 0) { peg$fail(peg$e57); } } return s0; @@ -2021,7 +2058,7 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parse_(); peg$savedPos = s0; - s1 = peg$f51(); + s1 = peg$f52(); s0 = s1; return s0; @@ -2037,7 +2074,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e58); } + if (peg$silentFails === 0) { peg$fail(peg$e60); } } while (s1 !== peg$FAILED) { s0.push(s1); @@ -2046,12 +2083,12 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e58); } + if (peg$silentFails === 0) { peg$fail(peg$e60); } } } peg$silentFails--; s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e57); } + if (peg$silentFails === 0) { peg$fail(peg$e59); } return s0; } @@ -2061,7 +2098,7 @@ function peg$parse(input, options) { s0 = peg$currPos; peg$savedPos = peg$currPos; - s1 = peg$f52(); + s1 = peg$f53(); if (s1) { s1 = undefined; } else { @@ -2098,7 +2135,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e60); } + if (peg$silentFails === 0) { peg$fail(peg$e62); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -2107,7 +2144,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e60); } + if (peg$silentFails === 0) { peg$fail(peg$e62); } } } s2 = input.charAt(peg$currPos); @@ -2115,7 +2152,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e61); } + if (peg$silentFails === 0) { peg$fail(peg$e63); } } if (s2 !== peg$FAILED) { s3 = []; @@ -2124,7 +2161,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e62); } + if (peg$silentFails === 0) { peg$fail(peg$e64); } } while (s4 !== peg$FAILED) { s3.push(s4); @@ -2133,7 +2170,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e62); } + if (peg$silentFails === 0) { peg$fail(peg$e64); } } } s4 = input.charAt(peg$currPos); @@ -2141,7 +2178,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e61); } + if (peg$silentFails === 0) { peg$fail(peg$e63); } } if (s4 !== peg$FAILED) { s5 = []; @@ -2150,7 +2187,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e56); } + if (peg$silentFails === 0) { peg$fail(peg$e58); } } while (s6 !== peg$FAILED) { s5.push(s6); @@ -2159,11 +2196,11 @@ function peg$parse(input, options) { peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e56); } + if (peg$silentFails === 0) { peg$fail(peg$e58); } } } peg$savedPos = s0; - s0 = peg$f53(s1, s3, s5); + s0 = peg$f54(s1, s3, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2175,7 +2212,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e59); } + if (peg$silentFails === 0) { peg$fail(peg$e61); } } return s0; @@ -2192,7 +2229,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e60); } + if (peg$silentFails === 0) { peg$fail(peg$e62); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -2201,7 +2238,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e60); } + if (peg$silentFails === 0) { peg$fail(peg$e62); } } } s2 = input.charAt(peg$currPos); @@ -2209,7 +2246,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e61); } + if (peg$silentFails === 0) { peg$fail(peg$e63); } } if (s2 !== peg$FAILED) { s3 = []; @@ -2218,7 +2255,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e62); } + if (peg$silentFails === 0) { peg$fail(peg$e64); } } if (s4 === peg$FAILED) { s4 = peg$currPos; @@ -2234,15 +2271,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8220) { - s6 = peg$c50; + s6 = peg$c52; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e63); } + if (peg$silentFails === 0) { peg$fail(peg$e65); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f54(s1); + s4 = peg$f55(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -2265,15 +2302,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8221) { - s6 = peg$c51; + s6 = peg$c53; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e64); } + if (peg$silentFails === 0) { peg$fail(peg$e66); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f55(s1); + s4 = peg$f56(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -2296,15 +2333,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s6 = peg$c52; + s6 = peg$c54; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e65); } + if (peg$silentFails === 0) { peg$fail(peg$e67); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f56(s1); + s4 = peg$f57(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -2323,7 +2360,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e62); } + if (peg$silentFails === 0) { peg$fail(peg$e64); } } if (s4 === peg$FAILED) { s4 = peg$currPos; @@ -2339,15 +2376,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8220) { - s6 = peg$c50; + s6 = peg$c52; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e63); } + if (peg$silentFails === 0) { peg$fail(peg$e65); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f54(s1); + s4 = peg$f55(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -2370,15 +2407,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8221) { - s6 = peg$c51; + s6 = peg$c53; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e64); } + if (peg$silentFails === 0) { peg$fail(peg$e66); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f55(s1); + s4 = peg$f56(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -2401,15 +2438,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s6 = peg$c52; + s6 = peg$c54; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e65); } + if (peg$silentFails === 0) { peg$fail(peg$e67); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f56(s1); + s4 = peg$f57(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -2425,7 +2462,7 @@ function peg$parse(input, options) { s4 = peg$parseclosingQuote(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f57(s1, s3, s4); + s0 = peg$f58(s1, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2437,7 +2474,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e59); } + if (peg$silentFails === 0) { peg$fail(peg$e61); } } return s0; @@ -2452,7 +2489,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e61); } + if (peg$silentFails === 0) { peg$fail(peg$e63); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2490,7 +2527,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e66); } + if (peg$silentFails === 0) { peg$fail(peg$e68); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -2499,7 +2536,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e66); } + if (peg$silentFails === 0) { peg$fail(peg$e68); } } } s2 = []; @@ -2508,7 +2545,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e67); } + if (peg$silentFails === 0) { peg$fail(peg$e69); } } while (s3 !== peg$FAILED) { s2.push(s3); @@ -2517,7 +2554,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e67); } + if (peg$silentFails === 0) { peg$fail(peg$e69); } } } s3 = []; @@ -2526,7 +2563,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e68); } + if (peg$silentFails === 0) { peg$fail(peg$e70); } } while (s4 !== peg$FAILED) { s3.push(s4); @@ -2535,7 +2572,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e68); } + if (peg$silentFails === 0) { peg$fail(peg$e70); } } } s4 = peg$parseoperator(); @@ -2554,7 +2591,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e69); } + if (peg$silentFails === 0) { peg$fail(peg$e71); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -2563,7 +2600,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e69); } + if (peg$silentFails === 0) { peg$fail(peg$e71); } } } s2 = peg$currPos; @@ -2584,7 +2621,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e70); } + if (peg$silentFails === 0) { peg$fail(peg$e72); } } peg$silentFails--; if (s4 === peg$FAILED) { @@ -2610,7 +2647,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e71); } + if (peg$silentFails === 0) { peg$fail(peg$e73); } } } } diff --git a/src/libs/SearchParser/searchParser.peggy b/src/libs/SearchParser/searchParser.peggy index 1acac10d9f53..12bb400a06d6 100644 --- a/src/libs/SearchParser/searchParser.peggy +++ b/src/libs/SearchParser/searchParser.peggy @@ -126,6 +126,7 @@ key "key" / payer / exporter / expenseType + / withdrawalType / submitted / approved / paid diff --git a/src/libs/SearchQueryUtils.ts b/src/libs/SearchQueryUtils.ts index 611a187fdfbc..2498ec58a020 100644 --- a/src/libs/SearchQueryUtils.ts +++ b/src/libs/SearchQueryUtils.ts @@ -12,6 +12,7 @@ import type { SearchQueryJSON, SearchQueryString, SearchStatus, + SearchWithdrawalType, UserFriendlyKey, } from '@components/Search/types'; import CONST from '@src/CONST'; @@ -87,6 +88,7 @@ const UserFriendlyKeyMap: Record validExpenseTypes.has(expenseType as ValueOf)); } + if (filterKey === CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_TYPE) { + const validWithdrawalTypes = new Set(Object.values(CONST.SEARCH.WITHDRAWAL_TYPE)); + filtersForm[filterKey] = filterValues + .filter((withdrawalType): withdrawalType is SearchWithdrawalType => validWithdrawalTypes.has(withdrawalType as ValueOf)) + .at(0); + } if (filterKey === CONST.SEARCH.SYNTAX_FILTER_KEYS.CARD_ID) { filtersForm[filterKey] = filterValues.filter((card) => cardList[card]); } diff --git a/src/pages/Search/AdvancedSearchFilters.tsx b/src/pages/Search/AdvancedSearchFilters.tsx index c6d72b220589..68b6afd10e75 100644 --- a/src/pages/Search/AdvancedSearchFilters.tsx +++ b/src/pages/Search/AdvancedSearchFilters.tsx @@ -159,6 +159,11 @@ const baseFilterConfig = { description: 'search.expenseType' as const, route: ROUTES.SEARCH_ADVANCED_FILTERS_EXPENSE_TYPE, }, + withdrawalType: { + getTitle: getFilterDisplayTitle, + description: 'search.withdrawalType' as const, + route: ROUTES.SEARCH_ADVANCED_FILTERS_EXPENSE_TYPE, // s77rt update route + }, tag: { getTitle: getFilterDisplayTitle, description: 'common.tag' as const, @@ -223,6 +228,7 @@ const typeFiltersKeys = { ], [ CONST.SEARCH.SYNTAX_FILTER_KEYS.EXPENSE_TYPE, + CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_TYPE, CONST.SEARCH.SYNTAX_FILTER_KEYS.MERCHANT, CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, CONST.SEARCH.SYNTAX_FILTER_KEYS.AMOUNT, @@ -255,6 +261,7 @@ const typeFiltersKeys = { CONST.SEARCH.SYNTAX_FILTER_KEYS.POLICY_ID, ], [ + CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_TYPE, CONST.SEARCH.SYNTAX_FILTER_KEYS.MERCHANT, CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, CONST.SEARCH.SYNTAX_FILTER_KEYS.AMOUNT, @@ -475,6 +482,11 @@ function getFilterDisplayTitle( return filterValue ? translate(`search.filters.groupBy.${filterValue}`) : undefined; } + if (nonDateFilterKey === CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_TYPE) { + const filterValue = filters[nonDateFilterKey]; + return filterValue ? translate(`search.filters.withdrawalType.${filterValue}`) : undefined; + } + const filterValue = filters[nonDateFilterKey]; return Array.isArray(filterValue) ? filterValue.join(', ') : filterValue; } @@ -674,6 +686,7 @@ function AdvancedSearchFilters() { key === CONST.SEARCH.SYNTAX_FILTER_KEYS.TITLE || key === CONST.SEARCH.SYNTAX_FILTER_KEYS.REIMBURSABLE || key === CONST.SEARCH.SYNTAX_FILTER_KEYS.BILLABLE || + key === CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_TYPE || key === CONST.SEARCH.SYNTAX_FILTER_KEYS.TYPE ) { filterTitle = baseFilterConfig[key].getTitle(searchAdvancedFilters, key, translate, localeCompare); diff --git a/src/types/form/SearchAdvancedFiltersForm.ts b/src/types/form/SearchAdvancedFiltersForm.ts index 972f8f60099d..e5f3038b8795 100644 --- a/src/types/form/SearchAdvancedFiltersForm.ts +++ b/src/types/form/SearchAdvancedFiltersForm.ts @@ -1,5 +1,5 @@ import type {ValueOf} from 'type-fest'; -import type {SearchDateFilterKeys, SearchGroupBy} from '@components/Search/types'; +import type {SearchDateFilterKeys, SearchGroupBy, SearchWithdrawalType} from '@components/Search/types'; import CONST from '@src/CONST'; import type {SearchDataTypes} from '@src/types/onyx/SearchResults'; import type Form from './Form'; @@ -36,6 +36,7 @@ const FILTER_KEYS = { POSTED_ON: 'postedOn', POSTED_AFTER: 'postedAfter', POSTED_BEFORE: 'postedBefore', + WITHDRAWAL_TYPE: 'withdrawalType', WITHDRAWN_ON: 'withdrawnOn', WITHDRAWN_AFTER: 'withdrawnAfter', WITHDRAWN_BEFORE: 'withdrawnBefore', @@ -90,6 +91,7 @@ const ALLOWED_TYPE_FILTERS = { FILTER_KEYS.POSTED_AFTER, FILTER_KEYS.POSTED_BEFORE, FILTER_KEYS.POSTED_ON, + FILTER_KEYS.WITHDRAWAL_TYPE, FILTER_KEYS.WITHDRAWN_AFTER, FILTER_KEYS.WITHDRAWN_BEFORE, FILTER_KEYS.WITHDRAWN_ON, @@ -137,6 +139,7 @@ const ALLOWED_TYPE_FILTERS = { FILTER_KEYS.POSTED_AFTER, FILTER_KEYS.POSTED_BEFORE, FILTER_KEYS.POSTED_ON, + FILTER_KEYS.WITHDRAWAL_TYPE, FILTER_KEYS.WITHDRAWN_AFTER, FILTER_KEYS.WITHDRAWN_BEFORE, FILTER_KEYS.WITHDRAWN_ON, @@ -251,6 +254,7 @@ type SearchAdvancedFiltersForm = Form< [FILTER_KEYS.POSTED_ON]: string; [FILTER_KEYS.POSTED_AFTER]: string; [FILTER_KEYS.POSTED_BEFORE]: string; + [FILTER_KEYS.WITHDRAWAL_TYPE]: SearchWithdrawalType; [FILTER_KEYS.WITHDRAWN_ON]: string; [FILTER_KEYS.WITHDRAWN_AFTER]: string; [FILTER_KEYS.WITHDRAWN_BEFORE]: string; From 1177cf4d6360b60b49bfd212431f8337fe728c68 Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Thu, 7 Aug 2025 03:43:35 +0100 Subject: [PATCH 02/15] add withdrawal type RHP filter page --- src/ROUTES.ts | 1 + src/SCREENS.ts | 1 + .../ModalStackNavigators/index.tsx | 1 + .../linkingConfig/RELATIONS/SEARCH_TO_RHP.ts | 1 + src/libs/Navigation/linkingConfig/config.ts | 1 + src/libs/SearchUIUtils.ts | 17 +++- src/pages/Search/AdvancedSearchFilters.tsx | 2 +- .../SearchFiltersWithdrawalTypePage.tsx | 90 +++++++++++++++++++ 8 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWithdrawalTypePage.tsx diff --git a/src/ROUTES.ts b/src/ROUTES.ts index f6496712b602..306eeda89941 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -73,6 +73,7 @@ const ROUTES = { SEARCH_ADVANCED_FILTERS_CARD: 'search/filters/card', SEARCH_ADVANCED_FILTERS_TAX_RATE: 'search/filters/taxRate', SEARCH_ADVANCED_FILTERS_EXPENSE_TYPE: 'search/filters/expenseType', + SEARCH_ADVANCED_FILTERS_WITHDRAWAL_TYPE: 'search/filters/withdrawalType', SEARCH_ADVANCED_FILTERS_TAG: 'search/filters/tag', SEARCH_ADVANCED_FILTERS_FROM: 'search/filters/from', SEARCH_ADVANCED_FILTERS_TO: 'search/filters/to', diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 18c5a4b0fd20..d8d189b9f7ca 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -63,6 +63,7 @@ const SCREENS = { ADVANCED_FILTERS_CARD_RHP: 'Search_Advanced_Filters_Card_RHP', ADVANCED_FILTERS_TAX_RATE_RHP: 'Search_Advanced_Filters_Tax_Rate_RHP', ADVANCED_FILTERS_EXPENSE_TYPE_RHP: 'Search_Advanced_Filters_Expense_Type_RHP', + ADVANCED_FILTERS_WITHDRAWAL_TYPE_RHP: 'Search_Advanced_Filters_Withdrawal_Type_RHP', ADVANCED_FILTERS_TAG_RHP: 'Search_Advanced_Filters_Tag_RHP', ADVANCED_FILTERS_FROM_RHP: 'Search_Advanced_Filters_From_RHP', ADVANCED_FILTERS_TO_RHP: 'Search_Advanced_Filters_To_RHP', diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index a412f2096513..09ce1504becd 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -750,6 +750,7 @@ const SearchAdvancedFiltersModalStackNavigator = createModalStackNavigator require('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersCardPage').default, [SCREENS.SEARCH.ADVANCED_FILTERS_TAX_RATE_RHP]: () => require('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersTaxRatePage').default, [SCREENS.SEARCH.ADVANCED_FILTERS_EXPENSE_TYPE_RHP]: () => require('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersExpenseTypePage').default, + [SCREENS.SEARCH.ADVANCED_FILTERS_WITHDRAWAL_TYPE_RHP]: () => require('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersWithdrawalTypePage').default, [SCREENS.SEARCH.ADVANCED_FILTERS_TAG_RHP]: () => require('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersTagPage').default, [SCREENS.SEARCH.ADVANCED_FILTERS_FROM_RHP]: () => require('@pages/Search/SearchAdvancedFiltersPage/SearchFiltersFromPage').default, [SCREENS.SEARCH.ADVANCED_FILTERS_TO_RHP]: () => require('@pages/Search/SearchAdvancedFiltersPage/SearchFiltersToPage').default, diff --git a/src/libs/Navigation/linkingConfig/RELATIONS/SEARCH_TO_RHP.ts b/src/libs/Navigation/linkingConfig/RELATIONS/SEARCH_TO_RHP.ts index 8e8e1ed36ef4..c87919b54a77 100644 --- a/src/libs/Navigation/linkingConfig/RELATIONS/SEARCH_TO_RHP.ts +++ b/src/libs/Navigation/linkingConfig/RELATIONS/SEARCH_TO_RHP.ts @@ -27,6 +27,7 @@ const SEARCH_TO_RHP: Partial['config'] = { [SCREENS.SEARCH.ADVANCED_FILTERS_CARD_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS_CARD, [SCREENS.SEARCH.ADVANCED_FILTERS_TAX_RATE_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS_TAX_RATE, [SCREENS.SEARCH.ADVANCED_FILTERS_EXPENSE_TYPE_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS_EXPENSE_TYPE, + [SCREENS.SEARCH.ADVANCED_FILTERS_WITHDRAWAL_TYPE_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS_WITHDRAWAL_TYPE, [SCREENS.SEARCH.ADVANCED_FILTERS_TAG_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS_TAG, [SCREENS.SEARCH.ADVANCED_FILTERS_FROM_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS_FROM, [SCREENS.SEARCH.ADVANCED_FILTERS_TO_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS_TO, diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index ed7b86b1ad8f..6aba300b9d5c 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -8,7 +8,17 @@ import type DotLottieAnimation from '@components/LottieAnimations/types'; import type {MenuItemWithLink} from '@components/MenuItemList'; import type {MultiSelectItem} from '@components/Search/FilterDropdowns/MultiSelectPopup'; import type {SingleSelectItem} from '@components/Search/FilterDropdowns/SingleSelectPopup'; -import type {SearchColumnType, SearchDateFilterKeys, SearchDatePreset, SearchGroupBy, SearchQueryJSON, SearchStatus, SingularSearchStatus, SortOrder} from '@components/Search/types'; +import type { + SearchColumnType, + SearchDateFilterKeys, + SearchDatePreset, + SearchGroupBy, + SearchQueryJSON, + SearchStatus, + SearchWithdrawalType, + SingularSearchStatus, + SortOrder, +} from '@components/Search/types'; import ChatListItem from '@components/SelectionList/ChatListItem'; import TaskListItem from '@components/SelectionList/Search/TaskListItem'; import TransactionGroupListItem from '@components/SelectionList/Search/TransactionGroupListItem'; @@ -1777,6 +1787,10 @@ function getDatePresets(filterKey: SearchDateFilterKeys, hasFeed: boolean): Sear } } +function getWithdrawalTypeOptions(translate: LocaleContextProps['translate']) { + return Object.values(CONST.SEARCH.WITHDRAWAL_TYPE).map>((value) => ({text: translate(`search.filters.withdrawalType.${value}`), value})); +} + export { getSuggestedSearches, getListItem, @@ -1810,5 +1824,6 @@ export { isTransactionAmountTooLong, isTransactionTaxAmountTooLong, getDatePresets, + getWithdrawalTypeOptions, }; export type {SavedSearchMenuItem, SearchTypeMenuSection, SearchTypeMenuItem, SearchDateModifier, SearchDateModifierLower, SearchKey, ArchivedReportsIDSet}; diff --git a/src/pages/Search/AdvancedSearchFilters.tsx b/src/pages/Search/AdvancedSearchFilters.tsx index 68b6afd10e75..c5afc2d6e786 100644 --- a/src/pages/Search/AdvancedSearchFilters.tsx +++ b/src/pages/Search/AdvancedSearchFilters.tsx @@ -162,7 +162,7 @@ const baseFilterConfig = { withdrawalType: { getTitle: getFilterDisplayTitle, description: 'search.withdrawalType' as const, - route: ROUTES.SEARCH_ADVANCED_FILTERS_EXPENSE_TYPE, // s77rt update route + route: ROUTES.SEARCH_ADVANCED_FILTERS_WITHDRAWAL_TYPE, }, tag: { getTitle: getFilterDisplayTitle, diff --git a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWithdrawalTypePage.tsx b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWithdrawalTypePage.tsx new file mode 100644 index 000000000000..1c3945d1a072 --- /dev/null +++ b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWithdrawalTypePage.tsx @@ -0,0 +1,90 @@ +import React, {useCallback, useMemo, useState} from 'react'; +import {View} from 'react-native'; +import Button from '@components/Button'; +import FixedFooter from '@components/FixedFooter'; +import HeaderWithBackButton from '@components/HeaderWithBackButton'; +import ScreenWrapper from '@components/ScreenWrapper'; +import type {SearchWithdrawalType} from '@components/Search/types'; +import SelectionList from '@components/SelectionList'; +import SingleSelectListItem from '@components/SelectionList/SingleSelectListItem'; +import type {ListItem} from '@components/SelectionList/types'; +import useLocalize from '@hooks/useLocalize'; +import useOnyx from '@hooks/useOnyx'; +import useThemeStyles from '@hooks/useThemeStyles'; +import {updateAdvancedFilters} from '@libs/actions/Search'; +import Navigation from '@libs/Navigation/Navigation'; +import {getWithdrawalTypeOptions} from '@libs/SearchUIUtils'; +import ONYXKEYS from '@src/ONYXKEYS'; +import ROUTES from '@src/ROUTES'; + +function SearchFiltersWithdrawalTypePage() { + const styles = useThemeStyles(); + const {translate} = useLocalize(); + const [searchAdvancedFiltersForm] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM, {canBeMissing: true}); + const [selectedItem, setSelectedItem] = useState(searchAdvancedFiltersForm?.withdrawalType); + + const listData: Array> = useMemo(() => { + return getWithdrawalTypeOptions(translate).map((withwralTypeOption) => ({ + text: withwralTypeOption.text, + keyForList: withwralTypeOption.value, + isSelected: selectedItem === withwralTypeOption.value, + })); + }, [translate, selectedItem]); + + const updateSelectedItem = useCallback((type: ListItem) => { + setSelectedItem(type?.keyForList ?? undefined); + }, []); + + const resetChanges = useCallback(() => { + setSelectedItem(undefined); + }, []); + + const applyChanges = useCallback(() => { + updateAdvancedFilters({withdrawalType: selectedItem ?? null}); + Navigation.goBack(ROUTES.SEARCH_ADVANCED_FILTERS); + }, [selectedItem]); + + return ( + + { + Navigation.goBack(ROUTES.SEARCH_ADVANCED_FILTERS); + }} + /> + + + + +