From 8fa94301da89491cbf6f1b25ba4fd4441c5dc35c Mon Sep 17 00:00:00 2001 From: Krishna Chaitanya Date: Mon, 19 Oct 2026 18:23:46 +0530 Subject: [PATCH 1/4] Revert "Merge pull request #103211 from c3024/chaitanya/revert-101309-vendor-filter" This reverts commit ed727585a6d45f7864b825203f37114d81d384d9, reversing changes made to cf6d740a1892501a68eff078bcaf3e57d7b4dbf4. --- src/CONST/index.ts | 2 + src/ONYXKEYS.ts | 8 + .../FilterComponents/ListFilterContent.tsx | 3 + .../FilterComponents/VendorSelector.tsx | 98 + src/hooks/useAdvancedSearchFilters.ts | 15 +- src/hooks/useLoadSearchVendorData.ts | 59 + src/languages/de.ts | 1 + src/languages/el.ts | 1 + src/languages/en.ts | 1 + src/languages/es.ts | 1 + src/languages/fr.ts | 1 + src/languages/it.ts | 1 + src/languages/ja.ts | 1 + src/languages/nl.ts | 1 + src/languages/pl.ts | 1 + src/languages/pt-BR.ts | 1 + src/languages/zh-hans.ts | 1 + src/libs/API/types.ts | 2 + src/libs/ExportOnyxState/masking.ts | 1 + src/libs/PolicyUtils/vendor.ts | 16 +- src/libs/SearchAutocompleteUtils.ts | 1 + src/libs/SearchParser/autocompleteParser.js | 1716 +++++++++-------- .../SearchParser/autocompleteParser.peggy | 1 + src/libs/SearchParser/baseRules.peggy | 1 + src/libs/SearchParser/searchParser.js | 1692 ++++++++-------- src/libs/SearchParser/searchParser.peggy | 1 + src/libs/SearchQueryUtils.ts | 5 + src/libs/SearchUIUtils.ts | 11 + src/libs/actions/Search.ts | 1 + src/types/form/SearchAdvancedFiltersForm.ts | 8 + tests/unit/PolicyUtilsTest.ts | 16 +- tests/unit/Search/SearchQueryUtilsTest.ts | 59 + tests/unit/SearchAutocompleteUtilsTest.ts | 13 + .../hooks/useAdvancedSearchFilters.test.ts | 33 + 34 files changed, 2092 insertions(+), 1681 deletions(-) create mode 100644 src/components/Search/FilterComponents/VendorSelector.tsx create mode 100644 src/hooks/useLoadSearchVendorData.ts diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 4116429a2ccc..452d7e734069 100644 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -8399,6 +8399,7 @@ const CONST = { TAG_EMPTY_VALUE: 'none', CATEGORY_EMPTY_VALUE: 'none', CATEGORY_DEFAULT_VALUE: 'Uncategorized', + VENDOR_EMPTY_VALUE: 'none', MERCHANT_EMPTY_VALUE: 'none', SEARCH_ROUTER_ITEM_TYPE: { CONTEXTUAL_SUGGESTION: 'contextualSuggestion', @@ -8435,6 +8436,7 @@ const CONST = { EXPORTER: 'exporter', CATEGORY: 'category', TAG: 'tag', + VENDOR: 'vendor', TAX_RATE: 'tax-rate', CARD_ID: 'card', FEED: 'feed', diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 3e1c1496626d..1a71b5e10d55 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -529,6 +529,12 @@ const ONYXKEYS = { /** Set while search filter category data is loading */ RAM_ONLY_IS_LOADING_SEARCH_FILTERS_CATEGORY_DATA: 'isLoadingSearchFiltersCategoryData', + /** Set whether the search filters vendor data has loaded */ + IS_SEARCH_FILTERS_VENDOR_DATA_LOADED: 'isSearchFiltersVendorDataLoaded', + + /** Set while search filter vendor data is loading */ + RAM_ONLY_IS_LOADING_SEARCH_FILTERS_VENDOR_DATA: 'isLoadingSearchFiltersVendorData', + HAS_LOADED_APP: 'hasLoadedApp', IS_TEST_TOOLS_MODAL_OPEN: 'isTestToolsModalOpen', @@ -1855,6 +1861,8 @@ type OnyxValuesMapping = { [ONYXKEYS.RAM_ONLY_IS_LOADING_RULES]: boolean; [ONYXKEYS.RAM_ONLY_IS_LOADING_SEARCH_FILTERS_CARD_DATA]: boolean; [ONYXKEYS.RAM_ONLY_IS_LOADING_SEARCH_FILTERS_CATEGORY_DATA]: boolean; + [ONYXKEYS.IS_SEARCH_FILTERS_VENDOR_DATA_LOADED]: boolean; + [ONYXKEYS.RAM_ONLY_IS_LOADING_SEARCH_FILTERS_VENDOR_DATA]: boolean; [ONYXKEYS.IS_LOADING_SUBSCRIPTION_DATA]: boolean; [ONYXKEYS.IS_PENDING_UPDATE_PERSONAL_KARMA]: boolean; [ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN]: boolean; diff --git a/src/components/Search/FilterComponents/ListFilterContent.tsx b/src/components/Search/FilterComponents/ListFilterContent.tsx index 6f0a3a984c39..8066216a95d3 100644 --- a/src/components/Search/FilterComponents/ListFilterContent.tsx +++ b/src/components/Search/FilterComponents/ListFilterContent.tsx @@ -34,6 +34,7 @@ import TagSelector from './TagSelector'; import TaxRateSelector from './TaxRateSelector'; import TypeSelector from './TypeSelector'; import UserSelector from './UserSelector'; +import VendorSelector from './VendorSelector'; import WorkspaceSelector from './WorkspaceSelector'; type FilterKeys = Exclude; @@ -195,6 +196,7 @@ function ListFilterContent({ case CONST.SEARCH.SYNTAX_FILTER_KEYS.TAX_RATE: case CONST.SEARCH.SYNTAX_FILTER_KEYS.EXPORTED_TO: case CONST.SEARCH.SYNTAX_FILTER_KEYS.TAG: + case CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDOR: case CONST.SEARCH.SYNTAX_FILTER_KEYS.CATEGORY: { const Component = { [CONST.SEARCH.SYNTAX_FILTER_KEYS.FEED]: FeedSelector, @@ -204,6 +206,7 @@ function ListFilterContent({ [CONST.SEARCH.SYNTAX_FILTER_KEYS.TAX_RATE]: TaxRateSelector, [CONST.SEARCH.SYNTAX_FILTER_KEYS.EXPORTED_TO]: ExportedToSelector, [CONST.SEARCH.SYNTAX_FILTER_KEYS.TAG]: TagSelector, + [CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDOR]: VendorSelector, [CONST.SEARCH.SYNTAX_FILTER_KEYS.CATEGORY]: CategorySelector, }[baseFilterKey]; content = ( diff --git a/src/components/Search/FilterComponents/VendorSelector.tsx b/src/components/Search/FilterComponents/VendorSelector.tsx new file mode 100644 index 000000000000..84fc959dd390 --- /dev/null +++ b/src/components/Search/FilterComponents/VendorSelector.tsx @@ -0,0 +1,98 @@ +import ActivityIndicator from '@components/ActivityIndicator'; +import type {Filter, SearchFilterCommonProps} from '@components/Search/types'; + +import useLoadSearchVendorData from '@hooks/useLoadSearchVendorData'; +import useLocalize from '@hooks/useLocalize'; +import useOnyx from '@hooks/useOnyx'; +import usePermissions from '@hooks/usePermissions'; +import useTheme from '@hooks/useTheme'; +import useThemeStyles from '@hooks/useThemeStyles'; + +import {getVendorFeaturePolicyIDs} from '@libs/PolicyUtils'; +import {getAllPolicyValues, sortOptionsWithEmptyValue} from '@libs/SearchQueryUtils'; + +import CONST from '@src/CONST'; +import ONYXKEYS from '@src/ONYXKEYS'; +import type {Policy, PolicyVendors} from '@src/types/onyx'; +import {getEmptyObject} from '@src/types/utils/EmptyObject'; + +import type {OnyxCollection} from 'react-native-onyx'; + +import React, {useCallback} from 'react'; +import {View} from 'react-native'; + +import MultiSelect from './MultiSelect'; + +type VendorSelectorProps = SearchFilterCommonProps & { + policyID: Filter | undefined; +}; + +function VendorSelector({value = [], policyID, selectionListTextInputStyle, selectionListStyle, autoFocus, footer, onChange}: VendorSelectorProps) { + const {translate, localeCompare} = useLocalize(); + const {isBetaEnabled} = usePermissions(); + const isVendorMatchingBetaEnabled = isBetaEnabled(CONST.BETAS.VENDOR_MATCHING); + const {isLoadingInitialVendors} = useLoadSearchVendorData({shouldRefresh: true}); + const theme = useTheme(); + const styles = useThemeStyles(); + const vendorFeaturePolicyIDsSelector = useCallback( + (allPolicies: OnyxCollection) => getVendorFeaturePolicyIDs(allPolicies, isVendorMatchingBetaEnabled), + [isVendorMatchingBetaEnabled], + ); + const [vendorFeaturePolicyIDs] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: vendorFeaturePolicyIDsSelector}); + const [allPolicyVendors = getEmptyObject>>()] = useOnyx(ONYXKEYS.COLLECTION.POLICY_VENDORS); + + const noVendorLabel = translate('search.noVendor'); + const selectedVendorItems = value.map((vendor) => { + if (vendor === CONST.SEARCH.VENDOR_EMPTY_VALUE) { + return {text: noVendorLabel, value: vendor}; + } + return {text: vendor, value: vendor}; + }); + + // Vendor lists are only offered for the workspaces where the vendor feature is on, so stale lists left behind by a + // disconnected integration never surface in the picker. + const eligiblePolicyIDs = new Set(vendorFeaturePolicyIDs); + const eligiblePolicyVendors: OnyxCollection = Object.fromEntries( + Object.entries(allPolicyVendors).filter(([key]) => eligiblePolicyIDs.has(key.replace(ONYXKEYS.COLLECTION.POLICY_VENDORS, ''))), + ); + + const vendorItems = [{text: noVendorLabel, value: CONST.SEARCH.VENDOR_EMPTY_VALUE as string}]; + const uniqueVendorNames = new Set( + getAllPolicyValues(policyID?.value?.length ? policyID : undefined, ONYXKEYS.COLLECTION.POLICY_VENDORS, eligiblePolicyVendors).flatMap((policyVendors) => + Object.values(policyVendors ?? {}).map((vendor) => vendor.name), + ), + ); + vendorItems.push( + ...Array.from(uniqueVendorNames) + .filter(Boolean) + .map((vendorName) => ({text: vendorName, value: vendorName})) + .toSorted((a, b) => sortOptionsWithEmptyValue(a.text, b.text, localeCompare)), + ); + + if (isLoadingInitialVendors) { + return ( + + + + ); + } + + return ( + = CONST.STANDARD_LIST_ITEM_LIMIT} + autoFocus={autoFocus} + selectionListTextInputStyle={selectionListTextInputStyle} + selectionListStyle={selectionListStyle} + footer={footer} + onChange={(vendors) => onChange(vendors.map((vendor) => vendor.value))} + /> + ); +} + +export default VendorSelector; diff --git a/src/hooks/useAdvancedSearchFilters.ts b/src/hooks/useAdvancedSearchFilters.ts index 00fa8f1fd076..324589b35b36 100644 --- a/src/hooks/useAdvancedSearchFilters.ts +++ b/src/hooks/useAdvancedSearchFilters.ts @@ -1,5 +1,5 @@ import {isFilterableBankAccount} from '@libs/BankAccountUtils'; -import {isPolicyFeatureEnabled} from '@libs/PolicyUtils'; +import {hasVendorFeatureOnAnyPolicy, isPolicyFeatureEnabled} from '@libs/PolicyUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -11,9 +11,11 @@ import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; import {filterCardsHiddenFromSearch} from '@selectors/Card'; import {emailSelector} from '@selectors/Session'; +import {useCallback} from 'react'; import useLocalize from './useLocalize'; import useOnyx from './useOnyx'; +import usePermissions from './usePermissions'; import useWorkspaceList from './useWorkspaceList'; /** @@ -38,6 +40,7 @@ const typeFiltersKeys = { CONST.SEARCH.SYNTAX_FILTER_KEYS.DESCRIPTION, CONST.SEARCH.SYNTAX_FILTER_KEYS.CATEGORY, CONST.SEARCH.SYNTAX_FILTER_KEYS.TAG, + CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDOR, CONST.SEARCH.SYNTAX_FILTER_KEYS.TAX_RATE, CONST.SEARCH.SYNTAX_FILTER_KEYS.ATTENDEE, CONST.SEARCH.SYNTAX_FILTER_KEYS.REIMBURSABLE, @@ -318,6 +321,13 @@ function useAdvancedSearchFilters(type: SearchDataTypes | undefined) { const [shouldDisplayCardFilter] = useOnyx(ONYXKEYS.DERIVED.PERSONAL_AND_WORKSPACE_CARD_LIST, {selector: shouldDisplayCardFilterSelector}); const [policies = getEmptyObject>>()] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: advancedSearchPoliciesSelector}); const [policyDerived] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: policyDerivedSelector}); + const {isBetaEnabled} = usePermissions(); + const isVendorMatchingBetaEnabled = isBetaEnabled(CONST.BETAS.VENDOR_MATCHING); + const isVendorFilterAvailableSelector = useCallback( + (allPolicies: OnyxCollection) => hasVendorFeatureOnAnyPolicy(allPolicies, isVendorMatchingBetaEnabled), + [isVendorMatchingBetaEnabled], + ); + const [isVendorFilterAvailable = false] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: isVendorFilterAvailableSelector}); const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST); const {workspaces} = useAdvancedSearchFiltersWorkspaces(policies); @@ -342,6 +352,9 @@ function useAdvancedSearchFilters(type: SearchDataTypes | undefined) { if (key === CONST.SEARCH.SYNTAX_FILTER_KEYS.TAG && !shouldDisplayTagFilter) { return; } + if (key === CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDOR && !isVendorFilterAvailable) { + return; + } if ( (key === CONST.SEARCH.SYNTAX_FILTER_KEYS.CARD_ID || key === CONST.SEARCH.SYNTAX_FILTER_KEYS.POSTED || diff --git a/src/hooks/useLoadSearchVendorData.ts b/src/hooks/useLoadSearchVendorData.ts new file mode 100644 index 000000000000..0995cfab7082 --- /dev/null +++ b/src/hooks/useLoadSearchVendorData.ts @@ -0,0 +1,59 @@ +import {openSearchVendorFiltersPage} from '@libs/actions/Search'; + +import ONYXKEYS from '@src/ONYXKEYS'; + +import {useEffect, useRef} from 'react'; + +import useNetwork from './useNetwork'; +import useOnyx from './useOnyx'; + +type UseLoadSearchVendorDataParams = { + /** Whether vendor data should be loaded. */ + shouldLoad?: boolean; + + /** Whether already loaded vendor data should be refreshed. */ + shouldRefresh?: boolean; +}; + +function useLoadSearchVendorData({shouldLoad = true, shouldRefresh = false}: UseLoadSearchVendorDataParams = {}) { + const {isOffline} = useNetwork(); + const [areVendorsLoaded] = useOnyx(ONYXKEYS.IS_SEARCH_FILTERS_VENDOR_DATA_LOADED); + const [isLoadingVendors] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_SEARCH_FILTERS_VENDOR_DATA); + const hasRequestedVendorDataRef = useRef(false); + const hasObservedVendorRequestStateRef = useRef(!!areVendorsLoaded || isLoadingVendors !== undefined); + + useEffect(() => { + if (areVendorsLoaded || isLoadingVendors !== undefined) { + hasObservedVendorRequestStateRef.current = true; + } + + const wasVendorRequestStateCleared = hasRequestedVendorDataRef.current && hasObservedVendorRequestStateRef.current && !areVendorsLoaded && isLoadingVendors === undefined; + if (wasVendorRequestStateCleared) { + hasRequestedVendorDataRef.current = false; + hasObservedVendorRequestStateRef.current = false; + } + + if (!shouldLoad) { + hasRequestedVendorDataRef.current = false; + hasObservedVendorRequestStateRef.current = false; + return; + } + + if (isLoadingVendors) { + hasRequestedVendorDataRef.current = true; + return; + } + + if (isOffline || hasRequestedVendorDataRef.current || (areVendorsLoaded && !shouldRefresh)) { + return; + } + hasRequestedVendorDataRef.current = true; + openSearchVendorFiltersPage(); + }, [areVendorsLoaded, isLoadingVendors, isOffline, shouldLoad, shouldRefresh]); + + const isLoadingInitialVendors = shouldLoad && !areVendorsLoaded && !isOffline && isLoadingVendors !== false; + + return {areVendorsLoaded, isLoadingInitialVendors, isOffline}; +} + +export default useLoadSearchVendorData; diff --git a/src/languages/de.ts b/src/languages/de.ts index 5dd7a081fe84..17d0b7c4c1cb 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -10362,6 +10362,7 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc noCategory: 'Keine Kategorie', noMerchant: 'Kein Händler', noTag: 'Kein Tag', + noVendor: 'Kein Lieferant', expenseType: 'Ausgabenart', receiptType: 'Belegart', receiptTypeValues: { diff --git a/src/languages/el.ts b/src/languages/el.ts index 3a0a2f2c3a30..cacfe196d934 100644 --- a/src/languages/el.ts +++ b/src/languages/el.ts @@ -10573,6 +10573,7 @@ ${reportName}`, noCategory: 'Χωρίς κατηγορία', noMerchant: 'Χωρίς έμπορο', noTag: 'Χωρίς ετικέτα', + noVendor: 'Χωρίς προμηθευτή', expenseType: 'Τύπος εξόδου', receiptType: 'Τύπος απόδειξης', receiptTypeValues: { diff --git a/src/languages/en.ts b/src/languages/en.ts index bb6975f9f669..825774402971 100644 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -10620,6 +10620,7 @@ const translations = { noCategory: 'No category', noMerchant: 'No merchant', noTag: 'No tag', + noVendor: 'No vendor', expenseType: 'Expense type', receiptType: 'Receipt type', receiptTypeValues: { diff --git a/src/languages/es.ts b/src/languages/es.ts index 1255ad655989..9dd7c9c1fddc 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -10192,6 +10192,7 @@ ${reportName}`, noCategory: 'Sin categoría', noMerchant: 'Sin comerciante', noTag: 'Sin etiqueta', + noVendor: 'Sin proveedor', expenseType: 'Tipo de gasto', receiptType: 'Tipo de recibo', receiptTypeValues: { diff --git a/src/languages/fr.ts b/src/languages/fr.ts index c629e2bd4b0e..ab58e291c4b8 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -10388,6 +10388,7 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e noCategory: 'Aucune catégorie', noMerchant: 'Aucun commerçant', noTag: 'Aucun tag', + noVendor: 'Aucun fournisseur', expenseType: 'Type de dépense', receiptType: 'Type de reçu', receiptTypeValues: { diff --git a/src/languages/it.ts b/src/languages/it.ts index 9db5fb5ac92f..e66461964d08 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -10313,6 +10313,7 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`, noCategory: 'Nessuna categoria', noMerchant: 'Nessun esercente', noTag: 'Nessun tag', + noVendor: 'Nessun fornitore', expenseType: 'Tipo di spesa', receiptType: 'Tipo di ricevuta', receiptTypeValues: { diff --git a/src/languages/ja.ts b/src/languages/ja.ts index d412979fa9bc..04d797493793 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -10164,6 +10164,7 @@ ${reportName}`, noCategory: 'カテゴリなし', noMerchant: '店舗なし', noTag: 'タグなし', + noVendor: 'ベンダーなし', expenseType: '経費の種類', receiptType: '領収書の種類', receiptTypeValues: { diff --git a/src/languages/nl.ts b/src/languages/nl.ts index 60718020161a..c131f0e60e46 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -10267,6 +10267,7 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`, noCategory: 'Geen categorie', noMerchant: 'Geen handelaar', noTag: 'Geen tag', + noVendor: 'Geen leverancier', expenseType: 'Onkostentype', receiptType: 'Bontype', receiptTypeValues: { diff --git a/src/languages/pl.ts b/src/languages/pl.ts index 9792f3bfe001..6ab2bd0c269b 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -10296,6 +10296,7 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`, noCategory: 'Brak kategorii', noMerchant: 'Brak sprzedawcy', noTag: 'Brak tagu', + noVendor: 'Brak dostawcy', expenseType: 'Typ wydatku', receiptType: 'Typ paragonu', receiptTypeValues: { diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index ca2cb4c94ba2..0de48ff215de 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -10263,6 +10263,7 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`, noCategory: 'Sem categoria', noMerchant: 'Sem comerciante', noTag: 'Sem tag', + noVendor: 'Sem fornecedor', expenseType: 'Tipo de despesa', receiptType: 'Tipo de recibo', receiptTypeValues: { diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index 44a092b96b81..98b17809ff35 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -9895,6 +9895,7 @@ ${reportName}`, noCategory: '无类别', noMerchant: '无商家', noTag: '无标签', + noVendor: '无供应商', expenseType: '报销类型', receiptType: '收据类型', receiptTypeValues: { diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index 28288a96db6c..15d99d3eccfd 100644 --- a/src/libs/API/types.ts +++ b/src/libs/API/types.ts @@ -1656,6 +1656,7 @@ const READ_COMMANDS = { OPEN_SEARCH_PAGE: 'OpenSearchPage', OPEN_SEARCH_CARD_FILTERS_PAGE: 'OpenSearchCardFiltersPage', OPEN_SEARCH_CATEGORY_FILTERS_PAGE: 'OpenSearchCategoryFiltersPage', + OPEN_SEARCH_VENDOR_FILTERS_PAGE: 'OpenSearchVendorFiltersPage', SEARCH: 'Search', GET_INSIGHTS: 'GetInsights', GET_TRANSACTIONS_CONVERTED_AMOUNT: 'GetTransactionsConvertedAmount', @@ -1843,6 +1844,7 @@ type ReadCommandParameters = { [READ_COMMANDS.OPEN_DRAFT_DISTANCE_EXPENSE]: null; [READ_COMMANDS.OPEN_SEARCH_CARD_FILTERS_PAGE]: null; [READ_COMMANDS.OPEN_SEARCH_CATEGORY_FILTERS_PAGE]: null; + [READ_COMMANDS.OPEN_SEARCH_VENDOR_FILTERS_PAGE]: null; [READ_COMMANDS.START_ISSUE_NEW_CARD_FLOW]: Parameters.StartIssueNewCardFlowParams; [READ_COMMANDS.OPEN_CARD_DETAILS_PAGE]: Parameters.OpenCardDetailsPageParams; [READ_COMMANDS.GET_CORPAY_ONBOARDING_FIELDS]: Parameters.GetCorpayOnboardingFieldsParams; diff --git a/src/libs/ExportOnyxState/masking.ts b/src/libs/ExportOnyxState/masking.ts index 19414a189282..0bc83ea7ad9d 100644 --- a/src/libs/ExportOnyxState/masking.ts +++ b/src/libs/ExportOnyxState/masking.ts @@ -260,6 +260,7 @@ const safeOnyxKeys = new Set([ ONYXKEYS.IS_PLAID_DISABLED, ONYXKEYS.IS_SEARCH_FILTERS_CARD_DATA_LOADED, ONYXKEYS.IS_SEARCH_FILTERS_CATEGORY_DATA_LOADED, + ONYXKEYS.IS_SEARCH_FILTERS_VENDOR_DATA_LOADED, ONYXKEYS.IS_SENTRY_DEBUG_ENABLED, ONYXKEYS.IS_SENTRY_SEND_ENABLED, ONYXKEYS.IS_SWITCHING_TO_DELEGATOR, diff --git a/src/libs/PolicyUtils/vendor.ts b/src/libs/PolicyUtils/vendor.ts index 2a77c5280549..4e06e784a688 100644 --- a/src/libs/PolicyUtils/vendor.ts +++ b/src/libs/PolicyUtils/vendor.ts @@ -130,12 +130,25 @@ function hasVendorFeature(policy: OnyxEntry, isVendorMatchingBetaEnabled } /** - * Search spans every workspace at once, so the vendor column is offered when any workspace has the vendor feature. + * Search spans every workspace at once, so the vendor filter and column are offered when any workspace has the vendor feature. */ function hasVendorFeatureOnAnyPolicy(policies: OnyxCollection, isVendorMatchingBetaEnabled: boolean): boolean { return Object.values(policies ?? {}).some((policy) => hasVendorFeature(policy, isVendorMatchingBetaEnabled)); } +/** + * IDs of the workspaces that have the vendor feature, so the Search vendor filter only offers their vendor lists. + */ +function getVendorFeaturePolicyIDs(policies: OnyxCollection, isVendorMatchingBetaEnabled: boolean): string[] { + const policyIDs: string[] = []; + for (const policy of Object.values(policies ?? {})) { + if (policy?.id && hasVendorFeature(policy, isVendorMatchingBetaEnabled)) { + policyIDs.push(policy.id); + } + } + return policyIDs; +} + /** * Single source of truth for which connected integration scopes the vendor field for this workspace * (QBO, Sage Intacct, Xero, Rillet, DualEntry, Business Central, Campfire, or Certinia) and what its vendor list looks like. Returns `undefined` when no @@ -533,5 +546,6 @@ export { isXeroVendorMatchingActive, hasVendorFeature, hasVendorFeatureOnAnyPolicy, + getVendorFeaturePolicyIDs, isMatchingVendorListLoaded, }; diff --git a/src/libs/SearchAutocompleteUtils.ts b/src/libs/SearchAutocompleteUtils.ts index cc7d6a71d8b2..69a28ce1543f 100644 --- a/src/libs/SearchAutocompleteUtils.ts +++ b/src/libs/SearchAutocompleteUtils.ts @@ -267,6 +267,7 @@ function filterOutRangesWithCorrectValue( case CONST.SEARCH.SYNTAX_FILTER_KEYS.MERCHANT: case CONST.SEARCH.SYNTAX_FILTER_KEYS.DESCRIPTION: case CONST.SEARCH.SYNTAX_FILTER_KEYS.TITLE: + case CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDOR: return range.value.length > 0; case CONST.SEARCH.SYNTAX_FILTER_KEYS.EXPORTED_TO: return exportedToList.get().includes(range.value); diff --git a/src/libs/SearchParser/autocompleteParser.js b/src/libs/SearchParser/autocompleteParser.js index 43808487599a..9034c9331ccb 100644 --- a/src/libs/SearchParser/autocompleteParser.js +++ b/src/libs/SearchParser/autocompleteParser.js @@ -200,126 +200,127 @@ function peg$parse(input, options) { var peg$c14 = "group-currency"; var peg$c15 = "tag"; var peg$c16 = "category"; - var peg$c17 = "to"; - var peg$c18 = "exporter"; - var peg$c19 = "payer"; - var peg$c20 = "paidBy"; - var peg$c21 = "paid-by"; - var peg$c22 = "taxrate"; - var peg$c23 = "tax-rate"; - var peg$c24 = "cardID"; - var peg$c25 = "card"; - var peg$c26 = "bankAccount"; - var peg$c27 = "bank-account"; - var peg$c28 = "from"; - var peg$c29 = "attendee"; - var peg$c30 = "expenseType"; - var peg$c31 = "expense-type"; - var peg$c32 = "receiptType"; - var peg$c33 = "receipt-type"; - var peg$c34 = "transactionStatus"; - var peg$c35 = "transaction-status"; - var peg$c36 = "withdrawalType"; - var peg$c37 = "withdrawal-type"; - var peg$c38 = "withdrawalStatus"; - var peg$c39 = "withdrawal-status"; - var peg$c40 = "paidStatus"; - var peg$c41 = "paid-status"; - var peg$c42 = "withdrawalid"; - var peg$c43 = "withdrawal-id"; - var peg$c44 = "billable"; - var peg$c45 = "declined"; - var peg$c46 = "reimbursable"; - var peg$c47 = "type"; - var peg$c48 = "status"; - var peg$c49 = "sortBy"; - var peg$c50 = "sort-by"; - var peg$c51 = "sortOrder"; - var peg$c52 = "sort-order"; - var peg$c53 = "policyID"; - var peg$c54 = "workspace"; - var peg$c55 = "submitted"; - var peg$c56 = "approved"; - var peg$c57 = "anyapproval"; - var peg$c58 = "any-approval"; - var peg$c59 = "paid"; - var peg$c60 = "exported"; - var peg$c61 = "posted"; - var peg$c62 = "withdrawn"; - var peg$c63 = "groupby"; - var peg$c64 = "group-by"; - var peg$c65 = "limit"; - var peg$c66 = "feed"; - var peg$c67 = "title"; - var peg$c68 = "submitteruserid"; - var peg$c69 = "submitter-user-id"; - var peg$c70 = "submitterpayrollid"; - var peg$c71 = "submitter-payroll-id"; - var peg$c72 = "orderdealnumbers"; - var peg$c73 = "order-deal-numbers"; - var peg$c74 = "assignee"; - var peg$c75 = "createdby"; - var peg$c76 = "created-by"; - var peg$c77 = "action"; - var peg$c78 = "total"; - var peg$c79 = "has"; - var peg$c80 = "is"; - var peg$c81 = "purchaseamount"; - var peg$c82 = "purchase-amount"; - var peg$c83 = "purchasecurrency"; - var peg$c84 = "purchase-currency"; - var peg$c85 = "amountdebited"; - var peg$c86 = "amount-debited"; - var peg$c87 = "amountreimbursed"; - var peg$c88 = "amount-reimbursed"; - var peg$c89 = "columns"; - var peg$c90 = "view"; - var peg$c91 = "compare"; - var peg$c92 = "per-diem"; - var peg$c93 = "drafts"; - var peg$c94 = "draft"; - var peg$c95 = "tax"; - var peg$c96 = "policy-name"; - var peg$c97 = "long-report-id"; - var peg$c98 = "exported-to"; - var peg$c99 = "exportedto"; - var peg$c100 = "exchange-rate"; - var peg$c101 = "reimbursable-total"; - var peg$c102 = "non-reimbursable-total"; - var peg$c103 = "group-from"; - var peg$c104 = "group-expenses"; - var peg$c105 = "group-total"; - var peg$c106 = "group-card"; - var peg$c107 = "group-feed"; - var peg$c108 = "group-bank-account"; - var peg$c109 = "group-withdrawn"; - var peg$c110 = "group-withdrawal-id"; - var peg$c111 = "group-amount-debited"; - var peg$c112 = "group-amount-reimbursed"; - var peg$c113 = "group-category"; - var peg$c114 = "group-tag"; - var peg$c115 = "group-merchant"; - var peg$c116 = "group-day"; - var peg$c117 = "group-month"; - var peg$c118 = "group-week"; - var peg$c119 = "group-year"; - var peg$c120 = "group-quarter"; - var peg$c121 = "*:"; - var peg$c122 = "!="; - var peg$c123 = ">="; - var peg$c124 = ">"; - var peg$c125 = "<="; - var peg$c126 = "<"; - var peg$c127 = "\\"; - var peg$c128 = "\u201C"; - var peg$c129 = "\u201D"; - var peg$c130 = "\""; - var peg$c131 = "footercount"; - var peg$c132 = "footer-count"; - var peg$c133 = "footercurrency"; - var peg$c134 = "footer-currency"; - var peg$c135 = "footertotal"; - var peg$c136 = "footer-total"; + var peg$c17 = "vendor"; + var peg$c18 = "to"; + var peg$c19 = "exporter"; + var peg$c20 = "payer"; + var peg$c21 = "paidBy"; + var peg$c22 = "paid-by"; + var peg$c23 = "taxrate"; + var peg$c24 = "tax-rate"; + var peg$c25 = "cardID"; + var peg$c26 = "card"; + var peg$c27 = "bankAccount"; + var peg$c28 = "bank-account"; + var peg$c29 = "from"; + var peg$c30 = "attendee"; + var peg$c31 = "expenseType"; + var peg$c32 = "expense-type"; + var peg$c33 = "receiptType"; + var peg$c34 = "receipt-type"; + var peg$c35 = "transactionStatus"; + var peg$c36 = "transaction-status"; + var peg$c37 = "withdrawalType"; + var peg$c38 = "withdrawal-type"; + var peg$c39 = "withdrawalStatus"; + var peg$c40 = "withdrawal-status"; + var peg$c41 = "paidStatus"; + var peg$c42 = "paid-status"; + var peg$c43 = "withdrawalid"; + var peg$c44 = "withdrawal-id"; + var peg$c45 = "billable"; + var peg$c46 = "declined"; + var peg$c47 = "reimbursable"; + var peg$c48 = "type"; + var peg$c49 = "status"; + var peg$c50 = "sortBy"; + var peg$c51 = "sort-by"; + var peg$c52 = "sortOrder"; + var peg$c53 = "sort-order"; + var peg$c54 = "policyID"; + var peg$c55 = "workspace"; + var peg$c56 = "submitted"; + var peg$c57 = "approved"; + var peg$c58 = "anyapproval"; + var peg$c59 = "any-approval"; + var peg$c60 = "paid"; + var peg$c61 = "exported"; + var peg$c62 = "posted"; + var peg$c63 = "withdrawn"; + var peg$c64 = "groupby"; + var peg$c65 = "group-by"; + var peg$c66 = "limit"; + var peg$c67 = "feed"; + var peg$c68 = "title"; + var peg$c69 = "submitteruserid"; + var peg$c70 = "submitter-user-id"; + var peg$c71 = "submitterpayrollid"; + var peg$c72 = "submitter-payroll-id"; + var peg$c73 = "orderdealnumbers"; + var peg$c74 = "order-deal-numbers"; + var peg$c75 = "assignee"; + var peg$c76 = "createdby"; + var peg$c77 = "created-by"; + var peg$c78 = "action"; + var peg$c79 = "total"; + var peg$c80 = "has"; + var peg$c81 = "is"; + var peg$c82 = "purchaseamount"; + var peg$c83 = "purchase-amount"; + var peg$c84 = "purchasecurrency"; + var peg$c85 = "purchase-currency"; + var peg$c86 = "amountdebited"; + var peg$c87 = "amount-debited"; + var peg$c88 = "amountreimbursed"; + var peg$c89 = "amount-reimbursed"; + var peg$c90 = "columns"; + var peg$c91 = "view"; + var peg$c92 = "compare"; + var peg$c93 = "per-diem"; + var peg$c94 = "drafts"; + var peg$c95 = "draft"; + var peg$c96 = "tax"; + var peg$c97 = "policy-name"; + var peg$c98 = "long-report-id"; + var peg$c99 = "exported-to"; + var peg$c100 = "exportedto"; + var peg$c101 = "exchange-rate"; + var peg$c102 = "reimbursable-total"; + var peg$c103 = "non-reimbursable-total"; + var peg$c104 = "group-from"; + var peg$c105 = "group-expenses"; + var peg$c106 = "group-total"; + var peg$c107 = "group-card"; + var peg$c108 = "group-feed"; + var peg$c109 = "group-bank-account"; + var peg$c110 = "group-withdrawn"; + var peg$c111 = "group-withdrawal-id"; + var peg$c112 = "group-amount-debited"; + var peg$c113 = "group-amount-reimbursed"; + var peg$c114 = "group-category"; + var peg$c115 = "group-tag"; + var peg$c116 = "group-merchant"; + var peg$c117 = "group-day"; + var peg$c118 = "group-month"; + var peg$c119 = "group-week"; + var peg$c120 = "group-year"; + var peg$c121 = "group-quarter"; + var peg$c122 = "*:"; + var peg$c123 = "!="; + var peg$c124 = ">="; + var peg$c125 = ">"; + var peg$c126 = "<="; + var peg$c127 = "<"; + var peg$c128 = "\\"; + var peg$c129 = "\u201C"; + var peg$c130 = "\u201D"; + var peg$c131 = "\""; + var peg$c132 = "footercount"; + var peg$c133 = "footer-count"; + var peg$c134 = "footercurrency"; + var peg$c135 = "footer-currency"; + var peg$c136 = "footertotal"; + var peg$c137 = "footer-total"; var peg$r0 = /^[ \t\r\n\xA0,:=<>!]/; var peg$r1 = /^[:=]/; @@ -356,143 +357,144 @@ function peg$parse(input, options) { var peg$e17 = peg$literalExpectation("group-currency", true); var peg$e18 = peg$literalExpectation("tag", true); var peg$e19 = peg$literalExpectation("category", true); - var peg$e20 = peg$literalExpectation("to", true); - var peg$e21 = peg$literalExpectation("exporter", true); - var peg$e22 = peg$literalExpectation("payer", true); - var peg$e23 = peg$literalExpectation("paidBy", false); - var peg$e24 = peg$literalExpectation("paid-by", true); - var peg$e25 = peg$literalExpectation("taxRate", true); - var peg$e26 = peg$literalExpectation("tax-rate", true); - var peg$e27 = peg$literalExpectation("cardID", false); - var peg$e28 = peg$literalExpectation("card", true); - var peg$e29 = peg$literalExpectation("bankAccount", false); - var peg$e30 = peg$literalExpectation("bank-account", true); - var peg$e31 = peg$literalExpectation("from", true); - var peg$e32 = peg$literalExpectation("attendee", true); - var peg$e33 = peg$literalExpectation("expenseType", false); - var peg$e34 = peg$literalExpectation("expense-type", true); - var peg$e35 = peg$literalExpectation("receiptType", false); - var peg$e36 = peg$literalExpectation("receipt-type", true); - var peg$e37 = peg$literalExpectation("transactionStatus", false); - var peg$e38 = peg$literalExpectation("transaction-status", true); - var peg$e39 = peg$literalExpectation("withdrawalType", false); - var peg$e40 = peg$literalExpectation("withdrawal-type", true); - var peg$e41 = peg$literalExpectation("withdrawalStatus", false); - var peg$e42 = peg$literalExpectation("withdrawal-status", true); - var peg$e43 = peg$literalExpectation("paidStatus", false); - var peg$e44 = peg$literalExpectation("paid-status", true); - var peg$e45 = peg$literalExpectation("withdrawalID", true); - var peg$e46 = peg$literalExpectation("withdrawal-id", true); - var peg$e47 = peg$literalExpectation("billable", true); - var peg$e48 = peg$literalExpectation("declined", true); - var peg$e49 = peg$literalExpectation("reimbursable", true); - var peg$e50 = peg$literalExpectation("type", true); - var peg$e51 = peg$literalExpectation("status", true); - var peg$e52 = peg$literalExpectation("sortBy", false); - var peg$e53 = peg$literalExpectation("sort-by", true); - var peg$e54 = peg$literalExpectation("sortOrder", false); - var peg$e55 = peg$literalExpectation("sort-order", true); - var peg$e56 = peg$literalExpectation("policyID", false); - var peg$e57 = peg$literalExpectation("workspace", true); - var peg$e58 = peg$literalExpectation("submitted", true); - var peg$e59 = peg$literalExpectation("approved", true); - var peg$e60 = peg$literalExpectation("anyApproval", true); - var peg$e61 = peg$literalExpectation("any-approval", true); - var peg$e62 = peg$literalExpectation("paid", true); - var peg$e63 = peg$literalExpectation("exported", true); - var peg$e64 = peg$literalExpectation("posted", true); - var peg$e65 = peg$literalExpectation("withdrawn", true); - var peg$e66 = peg$literalExpectation("groupBy", true); - var peg$e67 = peg$literalExpectation("group-by", true); - var peg$e68 = peg$literalExpectation("limit", true); - var peg$e69 = peg$literalExpectation("feed", true); - var peg$e70 = peg$literalExpectation("title", true); - var peg$e71 = peg$literalExpectation("submitterUserID", true); - var peg$e72 = peg$literalExpectation("submitter-user-id", true); - var peg$e73 = peg$literalExpectation("submitterPayrollID", true); - var peg$e74 = peg$literalExpectation("submitter-payroll-id", true); - var peg$e75 = peg$literalExpectation("orderDealNumbers", true); - var peg$e76 = peg$literalExpectation("order-deal-numbers", true); - var peg$e77 = peg$literalExpectation("assignee", true); - var peg$e78 = peg$literalExpectation("createdBy", true); - var peg$e79 = peg$literalExpectation("created-by", true); - var peg$e80 = peg$literalExpectation("action", true); - var peg$e81 = peg$literalExpectation("total", true); - var peg$e82 = peg$literalExpectation("has", true); - var peg$e83 = peg$literalExpectation("is", true); - var peg$e84 = peg$literalExpectation("purchaseAmount", true); - var peg$e85 = peg$literalExpectation("purchase-amount", true); - var peg$e86 = peg$literalExpectation("purchaseCurrency", true); - var peg$e87 = peg$literalExpectation("purchase-currency", true); - var peg$e88 = peg$literalExpectation("amountDebited", true); - var peg$e89 = peg$literalExpectation("amount-debited", true); - var peg$e90 = peg$literalExpectation("amountReimbursed", true); - var peg$e91 = peg$literalExpectation("amount-reimbursed", true); - var peg$e92 = peg$literalExpectation("columns", true); - var peg$e93 = peg$literalExpectation("view", true); - var peg$e94 = peg$literalExpectation("compare", true); - var peg$e95 = peg$literalExpectation("per-diem", true); - var peg$e96 = peg$literalExpectation("drafts", true); - var peg$e97 = peg$literalExpectation("draft", true); - var peg$e98 = peg$literalExpectation("tax", true); - var peg$e99 = peg$literalExpectation("policy-name", true); - var peg$e100 = peg$literalExpectation("long-report-id", true); - var peg$e101 = peg$literalExpectation("exported-to", true); - var peg$e102 = peg$classExpectation([":", "="], false, false); - var peg$e103 = peg$literalExpectation("exportedTo", true); - var peg$e104 = peg$literalExpectation("exchange-rate", true); - var peg$e105 = peg$literalExpectation("reimbursable-total", true); - var peg$e106 = peg$literalExpectation("non-reimbursable-total", true); - var peg$e107 = peg$literalExpectation("group-from", true); - var peg$e108 = peg$literalExpectation("group-expenses", true); - var peg$e109 = peg$literalExpectation("group-total", true); - var peg$e110 = peg$literalExpectation("group-card", true); - var peg$e111 = peg$literalExpectation("group-feed", true); - var peg$e112 = peg$literalExpectation("group-bank-account", true); - var peg$e113 = peg$literalExpectation("group-withdrawn", true); - var peg$e114 = peg$literalExpectation("group-withdrawal-id", true); - var peg$e115 = peg$literalExpectation("group-amount-debited", true); - var peg$e116 = peg$literalExpectation("group-amount-reimbursed", true); - var peg$e117 = peg$literalExpectation("group-category", true); - var peg$e118 = peg$literalExpectation("group-tag", true); - var peg$e119 = peg$literalExpectation("group-merchant", true); - var peg$e120 = peg$literalExpectation("group-day", true); - var peg$e121 = peg$literalExpectation("group-month", true); - var peg$e122 = peg$literalExpectation("group-week", true); - var peg$e123 = peg$literalExpectation("group-year", true); - var peg$e124 = peg$literalExpectation("group-quarter", true); - var peg$e125 = peg$otherExpectation("operator"); - var peg$e126 = peg$literalExpectation("*:", false); - var peg$e127 = peg$literalExpectation("!=", false); - var peg$e128 = peg$literalExpectation(">=", false); - var peg$e129 = peg$literalExpectation(">", false); - var peg$e130 = peg$literalExpectation("<=", false); - var peg$e131 = peg$literalExpectation("<", false); - var peg$e132 = peg$literalExpectation("\\", false); - var peg$e133 = peg$classExpectation([",", "\"", "\u201D", "\u201C", "\\"], false, false); - var peg$e134 = peg$otherExpectation("word"); - var peg$e135 = peg$classExpectation([" ", ",", "\t", "\n", "\r", "\xA0"], true, false); - var peg$e136 = peg$otherExpectation("whitespace"); - var peg$e137 = peg$classExpectation([" ", "\t", "\r", "\n", "\xA0"], false, false); - var peg$e138 = peg$otherExpectation("quote"); - var peg$e139 = peg$classExpectation([" ", ",", "\"", "\u201D", "\u201C", "\t", "\n", "\r", "\xA0"], true, false); - var peg$e140 = peg$classExpectation(["\"", ["\u201C", "\u201D"]], false, false); - var peg$e141 = peg$classExpectation(["\"", "\u201D", "\u201C", "\r", "\n"], true, false); - var peg$e142 = peg$literalExpectation("\u201C", false); - var peg$e143 = peg$literalExpectation("\u201D", false); - var peg$e144 = peg$literalExpectation("\"", false); - var peg$e145 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"], ["0", "9"]], false, false); - var peg$e146 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false); - var peg$e147 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0"], false, false); - var peg$e148 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"]], false, false); - var peg$e149 = peg$classExpectation([","], false, false); - var peg$e150 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ","], false, false); - var peg$e151 = peg$literalExpectation("footerCount", true); - var peg$e152 = peg$literalExpectation("footer-count", true); - var peg$e153 = peg$literalExpectation("footerCurrency", true); - var peg$e154 = peg$literalExpectation("footer-currency", true); - var peg$e155 = peg$literalExpectation("footerTotal", true); - var peg$e156 = peg$literalExpectation("footer-total", true); + var peg$e20 = peg$literalExpectation("vendor", true); + var peg$e21 = peg$literalExpectation("to", true); + var peg$e22 = peg$literalExpectation("exporter", true); + var peg$e23 = peg$literalExpectation("payer", true); + var peg$e24 = peg$literalExpectation("paidBy", false); + var peg$e25 = peg$literalExpectation("paid-by", true); + var peg$e26 = peg$literalExpectation("taxRate", true); + var peg$e27 = peg$literalExpectation("tax-rate", true); + var peg$e28 = peg$literalExpectation("cardID", false); + var peg$e29 = peg$literalExpectation("card", true); + var peg$e30 = peg$literalExpectation("bankAccount", false); + var peg$e31 = peg$literalExpectation("bank-account", true); + var peg$e32 = peg$literalExpectation("from", true); + var peg$e33 = peg$literalExpectation("attendee", true); + var peg$e34 = peg$literalExpectation("expenseType", false); + var peg$e35 = peg$literalExpectation("expense-type", true); + var peg$e36 = peg$literalExpectation("receiptType", false); + var peg$e37 = peg$literalExpectation("receipt-type", true); + var peg$e38 = peg$literalExpectation("transactionStatus", false); + var peg$e39 = peg$literalExpectation("transaction-status", true); + var peg$e40 = peg$literalExpectation("withdrawalType", false); + var peg$e41 = peg$literalExpectation("withdrawal-type", true); + var peg$e42 = peg$literalExpectation("withdrawalStatus", false); + var peg$e43 = peg$literalExpectation("withdrawal-status", true); + var peg$e44 = peg$literalExpectation("paidStatus", false); + var peg$e45 = peg$literalExpectation("paid-status", true); + var peg$e46 = peg$literalExpectation("withdrawalID", true); + var peg$e47 = peg$literalExpectation("withdrawal-id", true); + var peg$e48 = peg$literalExpectation("billable", true); + var peg$e49 = peg$literalExpectation("declined", true); + var peg$e50 = peg$literalExpectation("reimbursable", true); + var peg$e51 = peg$literalExpectation("type", true); + var peg$e52 = peg$literalExpectation("status", true); + var peg$e53 = peg$literalExpectation("sortBy", false); + var peg$e54 = peg$literalExpectation("sort-by", true); + var peg$e55 = peg$literalExpectation("sortOrder", false); + var peg$e56 = peg$literalExpectation("sort-order", true); + var peg$e57 = peg$literalExpectation("policyID", false); + var peg$e58 = peg$literalExpectation("workspace", true); + var peg$e59 = peg$literalExpectation("submitted", true); + var peg$e60 = peg$literalExpectation("approved", true); + var peg$e61 = peg$literalExpectation("anyApproval", true); + var peg$e62 = peg$literalExpectation("any-approval", true); + var peg$e63 = peg$literalExpectation("paid", true); + var peg$e64 = peg$literalExpectation("exported", true); + var peg$e65 = peg$literalExpectation("posted", true); + var peg$e66 = peg$literalExpectation("withdrawn", true); + var peg$e67 = peg$literalExpectation("groupBy", true); + var peg$e68 = peg$literalExpectation("group-by", true); + var peg$e69 = peg$literalExpectation("limit", true); + var peg$e70 = peg$literalExpectation("feed", true); + var peg$e71 = peg$literalExpectation("title", true); + var peg$e72 = peg$literalExpectation("submitterUserID", true); + var peg$e73 = peg$literalExpectation("submitter-user-id", true); + var peg$e74 = peg$literalExpectation("submitterPayrollID", true); + var peg$e75 = peg$literalExpectation("submitter-payroll-id", true); + var peg$e76 = peg$literalExpectation("orderDealNumbers", true); + var peg$e77 = peg$literalExpectation("order-deal-numbers", true); + var peg$e78 = peg$literalExpectation("assignee", true); + var peg$e79 = peg$literalExpectation("createdBy", true); + var peg$e80 = peg$literalExpectation("created-by", true); + var peg$e81 = peg$literalExpectation("action", true); + var peg$e82 = peg$literalExpectation("total", true); + var peg$e83 = peg$literalExpectation("has", true); + var peg$e84 = peg$literalExpectation("is", true); + var peg$e85 = peg$literalExpectation("purchaseAmount", true); + var peg$e86 = peg$literalExpectation("purchase-amount", true); + var peg$e87 = peg$literalExpectation("purchaseCurrency", true); + var peg$e88 = peg$literalExpectation("purchase-currency", true); + var peg$e89 = peg$literalExpectation("amountDebited", true); + var peg$e90 = peg$literalExpectation("amount-debited", true); + var peg$e91 = peg$literalExpectation("amountReimbursed", true); + var peg$e92 = peg$literalExpectation("amount-reimbursed", true); + var peg$e93 = peg$literalExpectation("columns", true); + var peg$e94 = peg$literalExpectation("view", true); + var peg$e95 = peg$literalExpectation("compare", true); + var peg$e96 = peg$literalExpectation("per-diem", true); + var peg$e97 = peg$literalExpectation("drafts", true); + var peg$e98 = peg$literalExpectation("draft", true); + var peg$e99 = peg$literalExpectation("tax", true); + var peg$e100 = peg$literalExpectation("policy-name", true); + var peg$e101 = peg$literalExpectation("long-report-id", true); + var peg$e102 = peg$literalExpectation("exported-to", true); + var peg$e103 = peg$classExpectation([":", "="], false, false); + var peg$e104 = peg$literalExpectation("exportedTo", true); + var peg$e105 = peg$literalExpectation("exchange-rate", true); + var peg$e106 = peg$literalExpectation("reimbursable-total", true); + var peg$e107 = peg$literalExpectation("non-reimbursable-total", true); + var peg$e108 = peg$literalExpectation("group-from", true); + var peg$e109 = peg$literalExpectation("group-expenses", true); + var peg$e110 = peg$literalExpectation("group-total", true); + var peg$e111 = peg$literalExpectation("group-card", true); + var peg$e112 = peg$literalExpectation("group-feed", true); + var peg$e113 = peg$literalExpectation("group-bank-account", true); + var peg$e114 = peg$literalExpectation("group-withdrawn", true); + var peg$e115 = peg$literalExpectation("group-withdrawal-id", true); + var peg$e116 = peg$literalExpectation("group-amount-debited", true); + var peg$e117 = peg$literalExpectation("group-amount-reimbursed", true); + var peg$e118 = peg$literalExpectation("group-category", true); + var peg$e119 = peg$literalExpectation("group-tag", true); + var peg$e120 = peg$literalExpectation("group-merchant", true); + var peg$e121 = peg$literalExpectation("group-day", true); + var peg$e122 = peg$literalExpectation("group-month", true); + var peg$e123 = peg$literalExpectation("group-week", true); + var peg$e124 = peg$literalExpectation("group-year", true); + var peg$e125 = peg$literalExpectation("group-quarter", true); + var peg$e126 = peg$otherExpectation("operator"); + var peg$e127 = peg$literalExpectation("*:", false); + var peg$e128 = peg$literalExpectation("!=", false); + var peg$e129 = peg$literalExpectation(">=", false); + var peg$e130 = peg$literalExpectation(">", false); + var peg$e131 = peg$literalExpectation("<=", false); + var peg$e132 = peg$literalExpectation("<", false); + var peg$e133 = peg$literalExpectation("\\", false); + var peg$e134 = peg$classExpectation([",", "\"", "\u201D", "\u201C", "\\"], false, false); + var peg$e135 = peg$otherExpectation("word"); + var peg$e136 = peg$classExpectation([" ", ",", "\t", "\n", "\r", "\xA0"], true, false); + var peg$e137 = peg$otherExpectation("whitespace"); + var peg$e138 = peg$classExpectation([" ", "\t", "\r", "\n", "\xA0"], false, false); + var peg$e139 = peg$otherExpectation("quote"); + var peg$e140 = peg$classExpectation([" ", ",", "\"", "\u201D", "\u201C", "\t", "\n", "\r", "\xA0"], true, false); + var peg$e141 = peg$classExpectation(["\"", ["\u201C", "\u201D"]], false, false); + var peg$e142 = peg$classExpectation(["\"", "\u201D", "\u201C", "\r", "\n"], true, false); + var peg$e143 = peg$literalExpectation("\u201C", false); + var peg$e144 = peg$literalExpectation("\u201D", false); + var peg$e145 = peg$literalExpectation("\"", false); + var peg$e146 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"], ["0", "9"]], false, false); + var peg$e147 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false); + var peg$e148 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0"], false, false); + var peg$e149 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"]], false, false); + var peg$e150 = peg$classExpectation([","], false, false); + var peg$e151 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ","], false, false); + var peg$e152 = peg$literalExpectation("footerCount", true); + var peg$e153 = peg$literalExpectation("footer-count", true); + var peg$e154 = peg$literalExpectation("footerCurrency", true); + var peg$e155 = peg$literalExpectation("footer-currency", true); + var peg$e156 = peg$literalExpectation("footerTotal", true); + var peg$e157 = peg$literalExpectation("footer-total", true); var peg$f0 = function(ranges) { return { autocomplete, ranges }; }; var peg$f1 = function(filters) { return filters.filter(Boolean).flat(); }; @@ -574,131 +576,132 @@ function peg$parse(input, options) { var peg$f16 = function() { return "groupCurrency"; }; var peg$f17 = function() { return "tag"; }; var peg$f18 = function() { return "category"; }; - var peg$f19 = function() { return "to"; }; - var peg$f20 = function() { return "exporter"; }; - var peg$f21 = function() { return "payer"; }; - var peg$f22 = function() { return "paidBy"; }; - var peg$f23 = function() { return "taxRate"; }; - var peg$f24 = function() { return "cardID"; }; - var peg$f25 = function() { return "bankAccount"; }; - var peg$f26 = function() { return "from"; }; - var peg$f27 = function() {return "attendee"}; - var peg$f28 = function() { return "expenseType"; }; - var peg$f29 = function() { return "receiptType"; }; - var peg$f30 = function() { return "transactionStatus"; }; - var peg$f31 = function() { return "withdrawalType"; }; - var peg$f32 = function() { return "withdrawalStatus"; }; - var peg$f33 = function() { return "paidStatus"; }; - var peg$f34 = function() { return "withdrawalID"; }; - var peg$f35 = function() { return "billable"; }; - var peg$f36 = function() { return "declined"; }; - var peg$f37 = function() { return "reimbursable"; }; - var peg$f38 = function() { return "type"; }; - var peg$f39 = function() { return "status"; }; - var peg$f40 = function() { return "sortBy"; }; - var peg$f41 = function() { return "sortOrder"; }; - var peg$f42 = function() { return "policyID"; }; - var peg$f43 = function() { return "submitted"; }; - var peg$f44 = function() { return "approved"; }; - var peg$f45 = function() { return "anyApproval"; }; + var peg$f19 = function() { return "vendor"; }; + var peg$f20 = function() { return "to"; }; + var peg$f21 = function() { return "exporter"; }; + var peg$f22 = function() { return "payer"; }; + var peg$f23 = function() { return "paidBy"; }; + var peg$f24 = function() { return "taxRate"; }; + var peg$f25 = function() { return "cardID"; }; + var peg$f26 = function() { return "bankAccount"; }; + var peg$f27 = function() { return "from"; }; + var peg$f28 = function() {return "attendee"}; + var peg$f29 = function() { return "expenseType"; }; + var peg$f30 = function() { return "receiptType"; }; + var peg$f31 = function() { return "transactionStatus"; }; + var peg$f32 = function() { return "withdrawalType"; }; + var peg$f33 = function() { return "withdrawalStatus"; }; + var peg$f34 = function() { return "paidStatus"; }; + var peg$f35 = function() { return "withdrawalID"; }; + var peg$f36 = function() { return "billable"; }; + var peg$f37 = function() { return "declined"; }; + var peg$f38 = function() { return "reimbursable"; }; + var peg$f39 = function() { return "type"; }; + var peg$f40 = function() { return "status"; }; + var peg$f41 = function() { return "sortBy"; }; + var peg$f42 = function() { return "sortOrder"; }; + var peg$f43 = function() { return "policyID"; }; + var peg$f44 = function() { return "submitted"; }; + var peg$f45 = function() { return "approved"; }; var peg$f46 = function() { return "anyApproval"; }; - var peg$f47 = function() { return "paid"; }; - var peg$f48 = function() { return "exported"; }; - var peg$f49 = function() { return "posted"; }; - var peg$f50 = function() { return "withdrawn"; }; - var peg$f51 = function() { return "groupBy"; }; - var peg$f52 = function() { return "limit"; }; - var peg$f53 = function() { return "feed"; }; - var peg$f54 = function() { return "title"; }; - var peg$f55 = function() { return "submitterUserID"; }; - var peg$f56 = function() { return "submitterPayrollID"; }; - var peg$f57 = function() { return "orderDealNumbers"; }; - var peg$f58 = function() { return "assignee"; }; - var peg$f59 = function() { return "createdBy"; }; - var peg$f60 = function() { return "action"; }; - var peg$f61 = function() {return "total"; }; - var peg$f62 = function() {return "has"; }; - var peg$f63 = function() {return "is"; }; - var peg$f64 = function() {return "purchaseAmount"}; - var peg$f65 = function() {return "purchaseCurrency"}; - var peg$f66 = function() {return "amountDebited"}; - var peg$f67 = function() {return "amountReimbursed"}; - var peg$f68 = function() { + var peg$f47 = function() { return "anyApproval"; }; + var peg$f48 = function() { return "paid"; }; + var peg$f49 = function() { return "exported"; }; + var peg$f50 = function() { return "posted"; }; + var peg$f51 = function() { return "withdrawn"; }; + var peg$f52 = function() { return "groupBy"; }; + var peg$f53 = function() { return "limit"; }; + var peg$f54 = function() { return "feed"; }; + var peg$f55 = function() { return "title"; }; + var peg$f56 = function() { return "submitterUserID"; }; + var peg$f57 = function() { return "submitterPayrollID"; }; + var peg$f58 = function() { return "orderDealNumbers"; }; + var peg$f59 = function() { return "assignee"; }; + var peg$f60 = function() { return "createdBy"; }; + var peg$f61 = function() { return "action"; }; + var peg$f62 = function() {return "total"; }; + var peg$f63 = function() {return "has"; }; + var peg$f64 = function() {return "is"; }; + var peg$f65 = function() {return "purchaseAmount"}; + var peg$f66 = function() {return "purchaseCurrency"}; + var peg$f67 = function() {return "amountDebited"}; + var peg$f68 = function() {return "amountReimbursed"}; + var peg$f69 = function() { isColumnsContext = true; return "columns"; }; - var peg$f69 = function() {return "view"}; - var peg$f70 = function() {return "compare"}; - var peg$f71 = function() { return isColumnsContext; }; - var peg$f72 = function() { return "perDiem"; }; - var peg$f73 = function() { return "drafts"; }; - var peg$f74 = function() { return "originalamount"; }; - var peg$f75 = function() { return "taxAmount"; }; - var peg$f76 = function() { return "taxrate"; }; - var peg$f77 = function() { return "policyname"; }; - var peg$f78 = function() { return "withdrawalID"; }; - var peg$f79 = function() { return "bankAccount"; }; - var peg$f80 = function() { return "reportID"; }; - var peg$f81 = function() { return "base62ReportID"; }; - var peg$f82 = function() { return "exportedto"; }; - var peg$f83 = function() { return "exportedTo"; }; + var peg$f70 = function() {return "view"}; + var peg$f71 = function() {return "compare"}; + var peg$f72 = function() { return isColumnsContext; }; + var peg$f73 = function() { return "perDiem"; }; + var peg$f74 = function() { return "drafts"; }; + var peg$f75 = function() { return "originalamount"; }; + var peg$f76 = function() { return "taxAmount"; }; + var peg$f77 = function() { return "taxrate"; }; + var peg$f78 = function() { return "policyname"; }; + var peg$f79 = function() { return "withdrawalID"; }; + var peg$f80 = function() { return "bankAccount"; }; + var peg$f81 = function() { return "reportID"; }; + var peg$f82 = function() { return "base62ReportID"; }; + var peg$f83 = function() { return "exportedto"; }; var peg$f84 = function() { return "exportedTo"; }; - var peg$f85 = function() { return "exchangeRate"; }; - var peg$f86 = function() { return "reimbursableTotal"; }; - var peg$f87 = function() { return "nonReimbursableTotal"; }; - var peg$f88 = function() { return "groupFrom"; }; - var peg$f89 = function() { return "groupExpenses"; }; - var peg$f90 = function() { return "groupTotal"; }; - var peg$f91 = function() { return "groupCard"; }; - var peg$f92 = function() { return "groupFeed"; }; - var peg$f93 = function() { return "groupBankAccount"; }; - var peg$f94 = function() { return "groupWithdrawn"; }; - var peg$f95 = function() { return "groupWithdrawalID"; }; - var peg$f96 = function() { return "groupAmountDebited"; }; - var peg$f97 = function() { return "groupAmountReimbursed"; }; - var peg$f98 = function() { return "amountDebited"; }; - var peg$f99 = function() { return "amountReimbursed"; }; - var peg$f100 = function() { return "groupCategory"; }; - var peg$f101 = function() { return "groupTag"; }; - var peg$f102 = function() { return "groupMerchant"; }; - var peg$f103 = function() { return "groupday"; }; - var peg$f104 = function() { return "groupmonth"; }; - var peg$f105 = function() { return "groupweek"; }; - var peg$f106 = function() { return "groupyear"; }; - var peg$f107 = function() { return "groupquarter"; }; - var peg$f108 = function() { return "contains"; }; - var peg$f109 = function() { return "eq"; }; - var peg$f110 = function() { return "neq"; }; - var peg$f111 = function() { return "gte"; }; - var peg$f112 = function() { return "gt"; }; - var peg$f113 = function() { return "lte"; }; - var peg$f114 = function() { return "lt"; }; - var peg$f115 = function(o) { + var peg$f85 = function() { return "exportedTo"; }; + var peg$f86 = function() { return "exchangeRate"; }; + var peg$f87 = function() { return "reimbursableTotal"; }; + var peg$f88 = function() { return "nonReimbursableTotal"; }; + var peg$f89 = function() { return "groupFrom"; }; + var peg$f90 = function() { return "groupExpenses"; }; + var peg$f91 = function() { return "groupTotal"; }; + var peg$f92 = function() { return "groupCard"; }; + var peg$f93 = function() { return "groupFeed"; }; + var peg$f94 = function() { return "groupBankAccount"; }; + var peg$f95 = function() { return "groupWithdrawn"; }; + var peg$f96 = function() { return "groupWithdrawalID"; }; + var peg$f97 = function() { return "groupAmountDebited"; }; + var peg$f98 = function() { return "groupAmountReimbursed"; }; + var peg$f99 = function() { return "amountDebited"; }; + var peg$f100 = function() { return "amountReimbursed"; }; + var peg$f101 = function() { return "groupCategory"; }; + var peg$f102 = function() { return "groupTag"; }; + var peg$f103 = function() { return "groupMerchant"; }; + var peg$f104 = function() { return "groupday"; }; + var peg$f105 = function() { return "groupmonth"; }; + var peg$f106 = function() { return "groupweek"; }; + var peg$f107 = function() { return "groupyear"; }; + var peg$f108 = function() { return "groupquarter"; }; + var peg$f109 = function() { return "contains"; }; + var peg$f110 = function() { return "eq"; }; + var peg$f111 = function() { return "neq"; }; + var peg$f112 = function() { return "gte"; }; + var peg$f113 = function() { return "gt"; }; + var peg$f114 = function() { return "lte"; }; + var peg$f115 = function() { return "lt"; }; + var peg$f116 = function(o) { if (nameOperator) { expectingNestedQuote = (o === "eq" || o === "contains"); } isColumnsContext = false; return o; }; - var peg$f116 = function(c) { return c; }; - var peg$f117 = function(chars) { return chars.join("").trim(); }; - var peg$f118 = function() { + var peg$f117 = function(c) { return c; }; + var peg$f118 = function(chars) { return chars.join("").trim(); }; + var peg$f119 = function() { isColumnsContext = false; return "and"; }; - var peg$f119 = function() { return expectingNestedQuote; }; - var peg$f120 = function(start, inner, end) { //handle no-breaking space + var peg$f120 = function() { return expectingNestedQuote; }; + var peg$f121 = function(start, inner, end) { //handle no-breaking space return [...start, '"', ...inner, '"', ...end].join(""); }; - var peg$f121 = function(start) {return "“"}; - var peg$f122 = function(start) {return "”"}; - var peg$f123 = function(start) {return "\""}; - var peg$f124 = function(start, inner, end) { + var peg$f122 = function(start) {return "“"}; + var peg$f123 = function(start) {return "”"}; + var peg$f124 = function(start) {return "\""}; + var peg$f125 = function(start, inner, end) { return [...start, '"', ...inner, '"'].join(""); }; - var peg$f125 = function() { return "footerCount"; }; - var peg$f126 = function() { return "footerCurrency"; }; - var peg$f127 = function() { return "footerTotal"; }; + var peg$f126 = function() { return "footerCount"; }; + var peg$f127 = function() { return "footerCurrency"; }; + var peg$f128 = function() { return "footerTotal"; }; var peg$currPos = options.peg$currPos | 0; var peg$savedPos = peg$currPos; var peg$posDetailsCache = [{ line: 1, column: 1 }]; @@ -1121,119 +1124,122 @@ function peg$parse(input, options) { if (s1 === peg$FAILED) { s1 = peg$parsecategory(); if (s1 === peg$FAILED) { - s1 = peg$parseto(); + s1 = peg$parsevendor(); if (s1 === peg$FAILED) { - s1 = peg$parsetaxRate(); + s1 = peg$parseto(); if (s1 === peg$FAILED) { - s1 = peg$parsefrom(); + s1 = peg$parsetaxRate(); if (s1 === peg$FAILED) { - s1 = peg$parseattendee(); + s1 = peg$parsefrom(); if (s1 === peg$FAILED) { - s1 = peg$parsepayer(); + s1 = peg$parseattendee(); if (s1 === peg$FAILED) { - s1 = peg$parsepaidBy(); + s1 = peg$parsepayer(); if (s1 === peg$FAILED) { - s1 = peg$parseexporter(); + s1 = peg$parsepaidBy(); if (s1 === peg$FAILED) { - s1 = peg$parsecreatedBy(); + s1 = peg$parseexporter(); if (s1 === peg$FAILED) { - s1 = peg$parseassignee(); + s1 = peg$parsecreatedBy(); if (s1 === peg$FAILED) { - s1 = peg$parseexpenseType(); + s1 = peg$parseassignee(); if (s1 === peg$FAILED) { - s1 = peg$parsereceiptType(); + s1 = peg$parseexpenseType(); if (s1 === peg$FAILED) { - s1 = peg$parsetransactionStatus(); + s1 = peg$parsereceiptType(); if (s1 === peg$FAILED) { - s1 = peg$parsewithdrawalType(); + s1 = peg$parsetransactionStatus(); if (s1 === peg$FAILED) { - s1 = peg$parsewithdrawalStatus(); + s1 = peg$parsewithdrawalType(); if (s1 === peg$FAILED) { - s1 = peg$parsepaidStatus(); + s1 = peg$parsewithdrawalStatus(); if (s1 === peg$FAILED) { - s1 = peg$parsetype(); + s1 = peg$parsepaidStatus(); 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$parsebankAccount(); + s1 = peg$parsecardID(); if (s1 === peg$FAILED) { - s1 = peg$parsefeed(); + s1 = peg$parsebankAccount(); if (s1 === peg$FAILED) { - s1 = peg$parsegroupBy(); + s1 = peg$parsefeed(); if (s1 === peg$FAILED) { - s1 = peg$parseview(); + s1 = peg$parsegroupBy(); if (s1 === peg$FAILED) { - s1 = peg$parsereimbursable(); + s1 = peg$parseview(); if (s1 === peg$FAILED) { - s1 = peg$parsebillable(); + s1 = peg$parsereimbursable(); if (s1 === peg$FAILED) { - s1 = peg$parsedeclined(); + s1 = peg$parsebillable(); if (s1 === peg$FAILED) { - s1 = peg$parsepolicyID(); + s1 = peg$parsedeclined(); if (s1 === peg$FAILED) { - s1 = peg$parseaction(); + s1 = peg$parsepolicyID(); if (s1 === peg$FAILED) { - s1 = peg$parsedate(); + s1 = peg$parseaction(); if (s1 === peg$FAILED) { - s1 = peg$parsesubmitted(); + s1 = peg$parsedate(); if (s1 === peg$FAILED) { - s1 = peg$parseanyApproval(); + s1 = peg$parsesubmitted(); if (s1 === peg$FAILED) { - s1 = peg$parseapproved(); + s1 = peg$parseanyApproval(); if (s1 === peg$FAILED) { - s1 = peg$parsepaid(); + s1 = peg$parseapproved(); if (s1 === peg$FAILED) { - s1 = peg$parseexportedTo(); + s1 = peg$parsepaid(); if (s1 === peg$FAILED) { - s1 = peg$parseexported(); + s1 = peg$parseexportedTo(); if (s1 === peg$FAILED) { - s1 = peg$parsewithdrawn(); + s1 = peg$parseexported(); if (s1 === peg$FAILED) { - s1 = peg$parseposted(); + s1 = peg$parsewithdrawn(); if (s1 === peg$FAILED) { - s1 = peg$parsehas(); + s1 = peg$parseposted(); if (s1 === peg$FAILED) { - s1 = peg$parseis(); + s1 = peg$parsehas(); if (s1 === peg$FAILED) { - s1 = peg$parsepurchaseCurrency(); + s1 = peg$parseis(); if (s1 === peg$FAILED) { - s1 = peg$parsepurchaseAmount(); + s1 = peg$parsepurchaseCurrency(); if (s1 === peg$FAILED) { - s1 = peg$parseamountDebited(); + s1 = peg$parsepurchaseAmount(); if (s1 === peg$FAILED) { - s1 = peg$parseamountReimbursed(); + s1 = peg$parseamountDebited(); if (s1 === peg$FAILED) { - s1 = peg$parseamount(); + s1 = peg$parseamountReimbursed(); if (s1 === peg$FAILED) { - s1 = peg$parsemerchant(); + s1 = peg$parseamount(); if (s1 === peg$FAILED) { - s1 = peg$parsedescription(); + s1 = peg$parsemerchant(); if (s1 === peg$FAILED) { - s1 = peg$parsereportID(); + s1 = peg$parsedescription(); if (s1 === peg$FAILED) { - s1 = peg$parsewithdrawalID(); + s1 = peg$parsereportID(); if (s1 === peg$FAILED) { - s1 = peg$parsetitle(); + s1 = peg$parsewithdrawalID(); if (s1 === peg$FAILED) { - s1 = peg$parsesubmitterUserID(); + s1 = peg$parsetitle(); if (s1 === peg$FAILED) { - s1 = peg$parsesubmitterPayrollID(); + s1 = peg$parsesubmitterUserID(); if (s1 === peg$FAILED) { - s1 = peg$parseorderDealNumbers(); + s1 = peg$parsesubmitterPayrollID(); if (s1 === peg$FAILED) { - s1 = peg$parsereportFieldDynamic(); + s1 = peg$parseorderDealNumbers(); if (s1 === peg$FAILED) { - s1 = peg$parsecolumns(); + s1 = peg$parsereportFieldDynamic(); if (s1 === peg$FAILED) { - s1 = peg$parselimit(); + s1 = peg$parsecolumns(); if (s1 === peg$FAILED) { - s1 = peg$parsefooterCount(); + s1 = peg$parselimit(); if (s1 === peg$FAILED) { - s1 = peg$parsefooterCurrency(); + s1 = peg$parsefooterCount(); if (s1 === peg$FAILED) { - s1 = peg$parsefooterTotal(); + s1 = peg$parsefooterCurrency(); + if (s1 === peg$FAILED) { + s1 = peg$parsefooterTotal(); + } } } } @@ -1636,13 +1642,13 @@ function peg$parse(input, options) { return s0; } - function peg$parseto() { + function peg$parsevendor() { var s0, s1; s0 = peg$currPos; - s1 = input.substr(peg$currPos, 2); + s1 = input.substr(peg$currPos, 6); if (s1.toLowerCase() === peg$c17) { - peg$currPos += 2; + peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$e20); } @@ -1656,13 +1662,13 @@ function peg$parse(input, options) { return s0; } - function peg$parseexporter() { + function peg$parseto() { var s0, s1; s0 = peg$currPos; - s1 = input.substr(peg$currPos, 8); + s1 = input.substr(peg$currPos, 2); if (s1.toLowerCase() === peg$c18) { - peg$currPos += 8; + peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$e21); } @@ -1676,13 +1682,13 @@ function peg$parse(input, options) { return s0; } - function peg$parsepayer() { + function peg$parseexporter() { var s0, s1; s0 = peg$currPos; - s1 = input.substr(peg$currPos, 5); + s1 = input.substr(peg$currPos, 8); if (s1.toLowerCase() === peg$c19) { - peg$currPos += 5; + peg$currPos += 8; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$e22); } @@ -1696,28 +1702,48 @@ function peg$parse(input, options) { return s0; } + function peg$parsepayer() { + var s0, s1; + + s0 = peg$currPos; + s1 = input.substr(peg$currPos, 5); + if (s1.toLowerCase() === peg$c20) { + peg$currPos += 5; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e23); } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f22(); + } + s0 = s1; + + return s0; + } + function peg$parsepaidBy() { var s0, s1; - if (input.substr(peg$currPos, 6) === peg$c20) { - s0 = peg$c20; + if (input.substr(peg$currPos, 6) === peg$c21) { + s0 = peg$c21; peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e23); } + if (peg$silentFails === 0) { peg$fail(peg$e24); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 7); - if (s1.toLowerCase() === peg$c21) { + if (s1.toLowerCase() === peg$c22) { peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e24); } + if (peg$silentFails === 0) { peg$fail(peg$e25); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f22(); + s1 = peg$f23(); } s0 = s1; } @@ -1729,24 +1755,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 7); - if (s0.toLowerCase() === peg$c22) { + if (s0.toLowerCase() === peg$c23) { peg$currPos += 7; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e25); } + if (peg$silentFails === 0) { peg$fail(peg$e26); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c23) { + if (s1.toLowerCase() === peg$c24) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e26); } + if (peg$silentFails === 0) { peg$fail(peg$e27); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f23(); + s1 = peg$f24(); } s0 = s1; } @@ -1757,25 +1783,25 @@ function peg$parse(input, options) { function peg$parsecardID() { var s0, s1; - if (input.substr(peg$currPos, 6) === peg$c24) { - s0 = peg$c24; + if (input.substr(peg$currPos, 6) === peg$c25) { + s0 = peg$c25; peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e27); } + if (peg$silentFails === 0) { peg$fail(peg$e28); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c25) { + if (s1.toLowerCase() === peg$c26) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e28); } + if (peg$silentFails === 0) { peg$fail(peg$e29); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f24(); + s1 = peg$f25(); } s0 = s1; } @@ -1786,25 +1812,25 @@ function peg$parse(input, options) { function peg$parsebankAccount() { var s0, s1; - if (input.substr(peg$currPos, 11) === peg$c26) { - s0 = peg$c26; + if (input.substr(peg$currPos, 11) === peg$c27) { + s0 = peg$c27; peg$currPos += 11; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e29); } + if (peg$silentFails === 0) { peg$fail(peg$e30); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c27) { + if (s1.toLowerCase() === peg$c28) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e30); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f25(); + s1 = peg$f26(); } s0 = s1; } @@ -1817,15 +1843,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c28) { + if (s1.toLowerCase() === peg$c29) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e31); } + if (peg$silentFails === 0) { peg$fail(peg$e32); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f26(); + s1 = peg$f27(); } s0 = s1; @@ -1837,15 +1863,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c29) { + if (s1.toLowerCase() === peg$c30) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e32); } + if (peg$silentFails === 0) { peg$fail(peg$e33); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f27(); + s1 = peg$f28(); } s0 = s1; @@ -1855,25 +1881,25 @@ function peg$parse(input, options) { function peg$parseexpenseType() { var s0, s1; - if (input.substr(peg$currPos, 11) === peg$c30) { - s0 = peg$c30; + if (input.substr(peg$currPos, 11) === peg$c31) { + s0 = peg$c31; peg$currPos += 11; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e33); } + if (peg$silentFails === 0) { peg$fail(peg$e34); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c31) { + if (s1.toLowerCase() === peg$c32) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e34); } + if (peg$silentFails === 0) { peg$fail(peg$e35); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f28(); + s1 = peg$f29(); } s0 = s1; } @@ -1884,25 +1910,25 @@ function peg$parse(input, options) { function peg$parsereceiptType() { var s0, s1; - if (input.substr(peg$currPos, 11) === peg$c32) { - s0 = peg$c32; + if (input.substr(peg$currPos, 11) === peg$c33) { + s0 = peg$c33; peg$currPos += 11; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e35); } + if (peg$silentFails === 0) { peg$fail(peg$e36); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c33) { + if (s1.toLowerCase() === peg$c34) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e36); } + if (peg$silentFails === 0) { peg$fail(peg$e37); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f29(); + s1 = peg$f30(); } s0 = s1; } @@ -1913,25 +1939,25 @@ function peg$parse(input, options) { function peg$parsetransactionStatus() { var s0, s1; - if (input.substr(peg$currPos, 17) === peg$c34) { - s0 = peg$c34; + if (input.substr(peg$currPos, 17) === peg$c35) { + s0 = peg$c35; peg$currPos += 17; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } + if (peg$silentFails === 0) { peg$fail(peg$e38); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 18); - if (s1.toLowerCase() === peg$c35) { + if (s1.toLowerCase() === peg$c36) { peg$currPos += 18; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e38); } + if (peg$silentFails === 0) { peg$fail(peg$e39); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f30(); + s1 = peg$f31(); } s0 = s1; } @@ -1942,25 +1968,25 @@ function peg$parse(input, options) { function peg$parsewithdrawalType() { var s0, s1; - if (input.substr(peg$currPos, 14) === peg$c36) { - s0 = peg$c36; + if (input.substr(peg$currPos, 14) === peg$c37) { + s0 = peg$c37; peg$currPos += 14; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e39); } + if (peg$silentFails === 0) { peg$fail(peg$e40); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c37) { + if (s1.toLowerCase() === peg$c38) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e40); } + if (peg$silentFails === 0) { peg$fail(peg$e41); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f31(); + s1 = peg$f32(); } s0 = s1; } @@ -1971,25 +1997,25 @@ function peg$parse(input, options) { function peg$parsewithdrawalStatus() { var s0, s1; - if (input.substr(peg$currPos, 16) === peg$c38) { - s0 = peg$c38; + if (input.substr(peg$currPos, 16) === peg$c39) { + s0 = peg$c39; peg$currPos += 16; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e41); } + if (peg$silentFails === 0) { peg$fail(peg$e42); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 17); - if (s1.toLowerCase() === peg$c39) { + if (s1.toLowerCase() === peg$c40) { peg$currPos += 17; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e42); } + if (peg$silentFails === 0) { peg$fail(peg$e43); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f32(); + s1 = peg$f33(); } s0 = s1; } @@ -2000,25 +2026,25 @@ function peg$parse(input, options) { function peg$parsepaidStatus() { var s0, s1; - if (input.substr(peg$currPos, 10) === peg$c40) { - s0 = peg$c40; + if (input.substr(peg$currPos, 10) === peg$c41) { + s0 = peg$c41; peg$currPos += 10; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e43); } + if (peg$silentFails === 0) { peg$fail(peg$e44); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c41) { + if (s1.toLowerCase() === peg$c42) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e44); } + if (peg$silentFails === 0) { peg$fail(peg$e45); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f33(); + s1 = peg$f34(); } s0 = s1; } @@ -2030,24 +2056,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 12); - if (s0.toLowerCase() === peg$c42) { + if (s0.toLowerCase() === peg$c43) { peg$currPos += 12; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e45); } + if (peg$silentFails === 0) { peg$fail(peg$e46); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 13); - if (s1.toLowerCase() === peg$c43) { + if (s1.toLowerCase() === peg$c44) { peg$currPos += 13; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e46); } + if (peg$silentFails === 0) { peg$fail(peg$e47); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f34(); + s1 = peg$f35(); } s0 = s1; } @@ -2060,15 +2086,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c44) { + if (s1.toLowerCase() === peg$c45) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e47); } + if (peg$silentFails === 0) { peg$fail(peg$e48); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f35(); + s1 = peg$f36(); } s0 = s1; @@ -2080,15 +2106,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c45) { + if (s1.toLowerCase() === peg$c46) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e48); } + if (peg$silentFails === 0) { peg$fail(peg$e49); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f36(); + s1 = peg$f37(); } s0 = s1; @@ -2100,15 +2126,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c46) { + if (s1.toLowerCase() === peg$c47) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e49); } + if (peg$silentFails === 0) { peg$fail(peg$e50); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f37(); + s1 = peg$f38(); } s0 = s1; @@ -2120,15 +2146,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c47) { + if (s1.toLowerCase() === peg$c48) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e50); } + if (peg$silentFails === 0) { peg$fail(peg$e51); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f38(); + s1 = peg$f39(); } s0 = s1; @@ -2140,15 +2166,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c48) { + if (s1.toLowerCase() === peg$c49) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e51); } + if (peg$silentFails === 0) { peg$fail(peg$e52); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f39(); + s1 = peg$f40(); } s0 = s1; @@ -2158,25 +2184,25 @@ function peg$parse(input, options) { function peg$parsesortBy() { var s0, s1; - if (input.substr(peg$currPos, 6) === peg$c49) { - s0 = peg$c49; + if (input.substr(peg$currPos, 6) === peg$c50) { + s0 = peg$c50; peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e52); } + if (peg$silentFails === 0) { peg$fail(peg$e53); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 7); - if (s1.toLowerCase() === peg$c50) { + if (s1.toLowerCase() === peg$c51) { peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e53); } + if (peg$silentFails === 0) { peg$fail(peg$e54); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f40(); + s1 = peg$f41(); } s0 = s1; } @@ -2187,25 +2213,25 @@ function peg$parse(input, options) { function peg$parsesortOrder() { var s0, s1; - if (input.substr(peg$currPos, 9) === peg$c51) { - s0 = peg$c51; + if (input.substr(peg$currPos, 9) === peg$c52) { + s0 = peg$c52; peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e54); } + if (peg$silentFails === 0) { peg$fail(peg$e55); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c52) { + if (s1.toLowerCase() === peg$c53) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e55); } + if (peg$silentFails === 0) { peg$fail(peg$e56); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f41(); + s1 = peg$f42(); } s0 = s1; } @@ -2216,25 +2242,25 @@ function peg$parse(input, options) { function peg$parsepolicyID() { var s0, s1; - if (input.substr(peg$currPos, 8) === peg$c53) { - s0 = peg$c53; + if (input.substr(peg$currPos, 8) === peg$c54) { + s0 = peg$c54; peg$currPos += 8; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e56); } + if (peg$silentFails === 0) { peg$fail(peg$e57); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c54) { + if (s1.toLowerCase() === peg$c55) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e57); } + if (peg$silentFails === 0) { peg$fail(peg$e58); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f42(); + s1 = peg$f43(); } s0 = s1; } @@ -2247,15 +2273,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c55) { + if (s1.toLowerCase() === peg$c56) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e58); } + if (peg$silentFails === 0) { peg$fail(peg$e59); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f43(); + s1 = peg$f44(); } s0 = s1; @@ -2267,15 +2293,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c56) { + if (s1.toLowerCase() === peg$c57) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e59); } + if (peg$silentFails === 0) { peg$fail(peg$e60); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f44(); + s1 = peg$f45(); } s0 = s1; @@ -2287,29 +2313,29 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c57) { + if (s1.toLowerCase() === peg$c58) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e60); } + if (peg$silentFails === 0) { peg$fail(peg$e61); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f45(); + s1 = peg$f46(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c58) { + if (s1.toLowerCase() === peg$c59) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e61); } + if (peg$silentFails === 0) { peg$fail(peg$e62); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f46(); + s1 = peg$f47(); } s0 = s1; } @@ -2322,15 +2348,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c59) { + if (s1.toLowerCase() === peg$c60) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e62); } + if (peg$silentFails === 0) { peg$fail(peg$e63); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f47(); + s1 = peg$f48(); } s0 = s1; @@ -2342,15 +2368,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c60) { + if (s1.toLowerCase() === peg$c61) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e63); } + if (peg$silentFails === 0) { peg$fail(peg$e64); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f48(); + s1 = peg$f49(); } s0 = s1; @@ -2362,15 +2388,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c61) { + if (s1.toLowerCase() === peg$c62) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e64); } + if (peg$silentFails === 0) { peg$fail(peg$e65); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f49(); + s1 = peg$f50(); } s0 = s1; @@ -2382,15 +2408,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c62) { + if (s1.toLowerCase() === peg$c63) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e65); } + if (peg$silentFails === 0) { peg$fail(peg$e66); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f50(); + s1 = peg$f51(); } s0 = s1; @@ -2401,24 +2427,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 7); - if (s0.toLowerCase() === peg$c63) { + if (s0.toLowerCase() === peg$c64) { peg$currPos += 7; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e66); } + if (peg$silentFails === 0) { peg$fail(peg$e67); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c64) { + if (s1.toLowerCase() === peg$c65) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e67); } + if (peg$silentFails === 0) { peg$fail(peg$e68); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f51(); + s1 = peg$f52(); } s0 = s1; } @@ -2431,15 +2457,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 5); - if (s1.toLowerCase() === peg$c65) { + if (s1.toLowerCase() === peg$c66) { peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e68); } + if (peg$silentFails === 0) { peg$fail(peg$e69); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f52(); + s1 = peg$f53(); } s0 = s1; @@ -2451,15 +2477,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c66) { + if (s1.toLowerCase() === peg$c67) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e69); } + if (peg$silentFails === 0) { peg$fail(peg$e70); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f53(); + s1 = peg$f54(); } s0 = s1; @@ -2471,15 +2497,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 5); - if (s1.toLowerCase() === peg$c67) { + if (s1.toLowerCase() === peg$c68) { peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e70); } + if (peg$silentFails === 0) { peg$fail(peg$e71); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f54(); + s1 = peg$f55(); } s0 = s1; @@ -2490,24 +2516,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 15); - if (s0.toLowerCase() === peg$c68) { + if (s0.toLowerCase() === peg$c69) { peg$currPos += 15; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e71); } + if (peg$silentFails === 0) { peg$fail(peg$e72); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 17); - if (s1.toLowerCase() === peg$c69) { + if (s1.toLowerCase() === peg$c70) { peg$currPos += 17; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e72); } + if (peg$silentFails === 0) { peg$fail(peg$e73); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f55(); + s1 = peg$f56(); } s0 = s1; } @@ -2519,24 +2545,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 18); - if (s0.toLowerCase() === peg$c70) { + if (s0.toLowerCase() === peg$c71) { peg$currPos += 18; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e73); } + if (peg$silentFails === 0) { peg$fail(peg$e74); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 20); - if (s1.toLowerCase() === peg$c71) { + if (s1.toLowerCase() === peg$c72) { peg$currPos += 20; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e74); } + if (peg$silentFails === 0) { peg$fail(peg$e75); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f56(); + s1 = peg$f57(); } s0 = s1; } @@ -2548,24 +2574,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 16); - if (s0.toLowerCase() === peg$c72) { + if (s0.toLowerCase() === peg$c73) { peg$currPos += 16; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e75); } + if (peg$silentFails === 0) { peg$fail(peg$e76); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 18); - if (s1.toLowerCase() === peg$c73) { + if (s1.toLowerCase() === peg$c74) { peg$currPos += 18; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e76); } + if (peg$silentFails === 0) { peg$fail(peg$e77); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f57(); + s1 = peg$f58(); } s0 = s1; } @@ -2578,15 +2604,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c74) { + if (s1.toLowerCase() === peg$c75) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e77); } + if (peg$silentFails === 0) { peg$fail(peg$e78); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f58(); + s1 = peg$f59(); } s0 = s1; @@ -2597,24 +2623,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 9); - if (s0.toLowerCase() === peg$c75) { + if (s0.toLowerCase() === peg$c76) { peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e78); } + if (peg$silentFails === 0) { peg$fail(peg$e79); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c76) { + if (s1.toLowerCase() === peg$c77) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e79); } + if (peg$silentFails === 0) { peg$fail(peg$e80); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f59(); + s1 = peg$f60(); } s0 = s1; } @@ -2627,15 +2653,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c77) { + if (s1.toLowerCase() === peg$c78) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e80); } + if (peg$silentFails === 0) { peg$fail(peg$e81); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f60(); + s1 = peg$f61(); } s0 = s1; @@ -2647,15 +2673,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 5); - if (s1.toLowerCase() === peg$c78) { + if (s1.toLowerCase() === peg$c79) { peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e81); } + if (peg$silentFails === 0) { peg$fail(peg$e82); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f61(); + s1 = peg$f62(); } s0 = s1; @@ -2667,15 +2693,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 3); - if (s1.toLowerCase() === peg$c79) { + if (s1.toLowerCase() === peg$c80) { peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e82); } + if (peg$silentFails === 0) { peg$fail(peg$e83); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f62(); + s1 = peg$f63(); } s0 = s1; @@ -2687,15 +2713,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 2); - if (s1.toLowerCase() === peg$c80) { + if (s1.toLowerCase() === peg$c81) { peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e83); } + if (peg$silentFails === 0) { peg$fail(peg$e84); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f63(); + s1 = peg$f64(); } s0 = s1; @@ -2706,24 +2732,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 14); - if (s0.toLowerCase() === peg$c81) { + if (s0.toLowerCase() === peg$c82) { peg$currPos += 14; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e84); } + if (peg$silentFails === 0) { peg$fail(peg$e85); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c82) { + if (s1.toLowerCase() === peg$c83) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e85); } + if (peg$silentFails === 0) { peg$fail(peg$e86); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f64(); + s1 = peg$f65(); } s0 = s1; } @@ -2735,24 +2761,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 16); - if (s0.toLowerCase() === peg$c83) { + if (s0.toLowerCase() === peg$c84) { peg$currPos += 16; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e86); } + if (peg$silentFails === 0) { peg$fail(peg$e87); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 17); - if (s1.toLowerCase() === peg$c84) { + if (s1.toLowerCase() === peg$c85) { peg$currPos += 17; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e87); } + if (peg$silentFails === 0) { peg$fail(peg$e88); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f65(); + s1 = peg$f66(); } s0 = s1; } @@ -2764,24 +2790,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 13); - if (s0.toLowerCase() === peg$c85) { + if (s0.toLowerCase() === peg$c86) { peg$currPos += 13; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e88); } + if (peg$silentFails === 0) { peg$fail(peg$e89); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c86) { + if (s1.toLowerCase() === peg$c87) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e89); } + if (peg$silentFails === 0) { peg$fail(peg$e90); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f66(); + s1 = peg$f67(); } s0 = s1; } @@ -2793,24 +2819,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 16); - if (s0.toLowerCase() === peg$c87) { + if (s0.toLowerCase() === peg$c88) { peg$currPos += 16; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e90); } + if (peg$silentFails === 0) { peg$fail(peg$e91); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 17); - if (s1.toLowerCase() === peg$c88) { + if (s1.toLowerCase() === peg$c89) { peg$currPos += 17; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e91); } + if (peg$silentFails === 0) { peg$fail(peg$e92); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f67(); + s1 = peg$f68(); } s0 = s1; } @@ -2823,15 +2849,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 7); - if (s1.toLowerCase() === peg$c89) { + if (s1.toLowerCase() === peg$c90) { peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e92); } + if (peg$silentFails === 0) { peg$fail(peg$e93); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f68(); + s1 = peg$f69(); } s0 = s1; @@ -2843,15 +2869,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c90) { + if (s1.toLowerCase() === peg$c91) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e93); } + if (peg$silentFails === 0) { peg$fail(peg$e94); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f69(); + s1 = peg$f70(); } s0 = s1; @@ -2863,15 +2889,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 7); - if (s1.toLowerCase() === peg$c91) { + if (s1.toLowerCase() === peg$c92) { peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e94); } + if (peg$silentFails === 0) { peg$fail(peg$e95); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f70(); + s1 = peg$f71(); } s0 = s1; @@ -2883,7 +2909,7 @@ function peg$parse(input, options) { s0 = peg$currPos; peg$savedPos = peg$currPos; - s1 = peg$f71(); + s1 = peg$f72(); if (s1) { s1 = undefined; } else { @@ -3018,11 +3044,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c92) { + if (s1.toLowerCase() === peg$c93) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e95); } + if (peg$silentFails === 0) { peg$fail(peg$e96); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3037,7 +3063,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f72(); + s0 = peg$f73(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3055,19 +3081,19 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c93) { + if (s1.toLowerCase() === peg$c94) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e96); } + if (peg$silentFails === 0) { peg$fail(peg$e97); } } if (s1 === peg$FAILED) { s1 = input.substr(peg$currPos, 5); - if (s1.toLowerCase() === peg$c94) { + if (s1.toLowerCase() === peg$c95) { peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e97); } + if (peg$silentFails === 0) { peg$fail(peg$e98); } } } if (s1 !== peg$FAILED) { @@ -3083,7 +3109,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f73(); + s0 = peg$f74(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3101,11 +3127,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c82) { + if (s1.toLowerCase() === peg$c83) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e85); } + if (peg$silentFails === 0) { peg$fail(peg$e86); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3120,7 +3146,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f74(); + s0 = peg$f75(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3138,11 +3164,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 3); - if (s1.toLowerCase() === peg$c95) { + if (s1.toLowerCase() === peg$c96) { peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e98); } + if (peg$silentFails === 0) { peg$fail(peg$e99); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3157,7 +3183,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f75(); + s0 = peg$f76(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3175,11 +3201,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c23) { + if (s1.toLowerCase() === peg$c24) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e26); } + if (peg$silentFails === 0) { peg$fail(peg$e27); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3194,7 +3220,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f76(); + s0 = peg$f77(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3212,11 +3238,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c96) { + if (s1.toLowerCase() === peg$c97) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e99); } + if (peg$silentFails === 0) { peg$fail(peg$e100); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3231,7 +3257,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f77(); + s0 = peg$f78(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3249,11 +3275,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 13); - if (s1.toLowerCase() === peg$c43) { + if (s1.toLowerCase() === peg$c44) { peg$currPos += 13; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e46); } + if (peg$silentFails === 0) { peg$fail(peg$e47); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3268,7 +3294,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f78(); + s0 = peg$f79(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3286,11 +3312,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c27) { + if (s1.toLowerCase() === peg$c28) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e30); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3305,7 +3331,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f79(); + s0 = peg$f80(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3323,11 +3349,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c97) { + if (s1.toLowerCase() === peg$c98) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e100); } + if (peg$silentFails === 0) { peg$fail(peg$e101); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3342,7 +3368,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f80(); + s0 = peg$f81(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3379,7 +3405,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f81(); + s0 = peg$f82(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3397,11 +3423,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c98) { + if (s1.toLowerCase() === peg$c99) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e101); } + if (peg$silentFails === 0) { peg$fail(peg$e102); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3416,7 +3442,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f82(); + s0 = peg$f83(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3441,7 +3467,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e102); } + if (peg$silentFails === 0) { peg$fail(peg$e103); } } if (s2 !== peg$FAILED) { s1 = [s1, s2]; @@ -3460,11 +3486,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c99) { + if (s1.toLowerCase() === peg$c100) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e103); } + if (peg$silentFails === 0) { peg$fail(peg$e104); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3479,7 +3505,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f83(); + s0 = peg$f84(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3491,11 +3517,11 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c98) { + if (s1.toLowerCase() === peg$c99) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e101); } + if (peg$silentFails === 0) { peg$fail(peg$e102); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3510,7 +3536,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f84(); + s0 = peg$f85(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3529,11 +3555,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 13); - if (s1.toLowerCase() === peg$c100) { + if (s1.toLowerCase() === peg$c101) { peg$currPos += 13; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e104); } + if (peg$silentFails === 0) { peg$fail(peg$e105); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3548,7 +3574,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f85(); + s0 = peg$f86(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3566,11 +3592,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 18); - if (s1.toLowerCase() === peg$c101) { + if (s1.toLowerCase() === peg$c102) { peg$currPos += 18; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e105); } + if (peg$silentFails === 0) { peg$fail(peg$e106); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3585,7 +3611,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f86(); + s0 = peg$f87(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3603,11 +3629,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 22); - if (s1.toLowerCase() === peg$c102) { + if (s1.toLowerCase() === peg$c103) { peg$currPos += 22; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e106); } + if (peg$silentFails === 0) { peg$fail(peg$e107); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3622,7 +3648,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f87(); + s0 = peg$f88(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3640,11 +3666,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c103) { + if (s1.toLowerCase() === peg$c104) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e107); } + if (peg$silentFails === 0) { peg$fail(peg$e108); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3659,7 +3685,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f88(); + s0 = peg$f89(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3677,11 +3703,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c104) { + if (s1.toLowerCase() === peg$c105) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e108); } + if (peg$silentFails === 0) { peg$fail(peg$e109); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3696,7 +3722,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f89(); + s0 = peg$f90(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3714,11 +3740,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c105) { + if (s1.toLowerCase() === peg$c106) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e109); } + if (peg$silentFails === 0) { peg$fail(peg$e110); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3733,7 +3759,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f90(); + s0 = peg$f91(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3751,11 +3777,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c106) { + if (s1.toLowerCase() === peg$c107) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e110); } + if (peg$silentFails === 0) { peg$fail(peg$e111); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3770,7 +3796,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f91(); + s0 = peg$f92(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3788,11 +3814,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c107) { + if (s1.toLowerCase() === peg$c108) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e111); } + if (peg$silentFails === 0) { peg$fail(peg$e112); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3807,7 +3833,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f92(); + s0 = peg$f93(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3825,11 +3851,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 18); - if (s1.toLowerCase() === peg$c108) { + if (s1.toLowerCase() === peg$c109) { peg$currPos += 18; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e112); } + if (peg$silentFails === 0) { peg$fail(peg$e113); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3844,7 +3870,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f93(); + s0 = peg$f94(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3862,11 +3888,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c109) { + if (s1.toLowerCase() === peg$c110) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e113); } + if (peg$silentFails === 0) { peg$fail(peg$e114); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3881,7 +3907,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f94(); + s0 = peg$f95(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3899,11 +3925,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 19); - if (s1.toLowerCase() === peg$c110) { + if (s1.toLowerCase() === peg$c111) { peg$currPos += 19; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e114); } + if (peg$silentFails === 0) { peg$fail(peg$e115); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3918,7 +3944,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f95(); + s0 = peg$f96(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3936,11 +3962,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 20); - if (s1.toLowerCase() === peg$c111) { + if (s1.toLowerCase() === peg$c112) { peg$currPos += 20; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e115); } + if (peg$silentFails === 0) { peg$fail(peg$e116); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3955,7 +3981,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f96(); + s0 = peg$f97(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3973,11 +3999,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 23); - if (s1.toLowerCase() === peg$c112) { + if (s1.toLowerCase() === peg$c113) { peg$currPos += 23; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e116); } + if (peg$silentFails === 0) { peg$fail(peg$e117); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3992,7 +4018,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f97(); + s0 = peg$f98(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4010,11 +4036,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c86) { + if (s1.toLowerCase() === peg$c87) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e89); } + if (peg$silentFails === 0) { peg$fail(peg$e90); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4029,7 +4055,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f98(); + s0 = peg$f99(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4047,11 +4073,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 17); - if (s1.toLowerCase() === peg$c88) { + if (s1.toLowerCase() === peg$c89) { peg$currPos += 17; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e91); } + if (peg$silentFails === 0) { peg$fail(peg$e92); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4066,7 +4092,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f99(); + s0 = peg$f100(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4084,11 +4110,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c113) { + if (s1.toLowerCase() === peg$c114) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e117); } + if (peg$silentFails === 0) { peg$fail(peg$e118); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4103,7 +4129,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f100(); + s0 = peg$f101(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4121,11 +4147,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c114) { + if (s1.toLowerCase() === peg$c115) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e118); } + if (peg$silentFails === 0) { peg$fail(peg$e119); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4140,7 +4166,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f101(); + s0 = peg$f102(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4158,11 +4184,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c115) { + if (s1.toLowerCase() === peg$c116) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e119); } + if (peg$silentFails === 0) { peg$fail(peg$e120); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4177,7 +4203,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f102(); + s0 = peg$f103(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4195,11 +4221,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c116) { + if (s1.toLowerCase() === peg$c117) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e120); } + if (peg$silentFails === 0) { peg$fail(peg$e121); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4214,7 +4240,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f103(); + s0 = peg$f104(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4232,11 +4258,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c117) { + if (s1.toLowerCase() === peg$c118) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e121); } + if (peg$silentFails === 0) { peg$fail(peg$e122); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4251,7 +4277,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f104(); + s0 = peg$f105(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4269,11 +4295,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c118) { + if (s1.toLowerCase() === peg$c119) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e122); } + if (peg$silentFails === 0) { peg$fail(peg$e123); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4288,7 +4314,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f105(); + s0 = peg$f106(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4306,11 +4332,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c119) { + if (s1.toLowerCase() === peg$c120) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e123); } + if (peg$silentFails === 0) { peg$fail(peg$e124); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4325,7 +4351,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f106(); + s0 = peg$f107(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4343,11 +4369,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 13); - if (s1.toLowerCase() === peg$c120) { + if (s1.toLowerCase() === peg$c121) { peg$currPos += 13; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e124); } + if (peg$silentFails === 0) { peg$fail(peg$e125); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4362,7 +4388,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f107(); + s0 = peg$f108(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4380,16 +4406,16 @@ function peg$parse(input, options) { peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c121) { - s1 = peg$c121; + if (input.substr(peg$currPos, 2) === peg$c122) { + s1 = peg$c122; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e126); } + if (peg$silentFails === 0) { peg$fail(peg$e127); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f108(); + s1 = peg$f109(); } s0 = s1; if (s0 === peg$FAILED) { @@ -4399,81 +4425,81 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e102); } + if (peg$silentFails === 0) { peg$fail(peg$e103); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f109(); + s1 = peg$f110(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c122) { - s1 = peg$c122; + if (input.substr(peg$currPos, 2) === peg$c123) { + s1 = peg$c123; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e127); } + if (peg$silentFails === 0) { peg$fail(peg$e128); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f110(); + s1 = peg$f111(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c123) { - s1 = peg$c123; + if (input.substr(peg$currPos, 2) === peg$c124) { + s1 = peg$c124; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e128); } + if (peg$silentFails === 0) { peg$fail(peg$e129); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f111(); + s1 = peg$f112(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 62) { - s1 = peg$c124; + s1 = peg$c125; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e129); } + if (peg$silentFails === 0) { peg$fail(peg$e130); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f112(); + s1 = peg$f113(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c125) { - s1 = peg$c125; + if (input.substr(peg$currPos, 2) === peg$c126) { + s1 = peg$c126; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e130); } + if (peg$silentFails === 0) { peg$fail(peg$e131); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f113(); + s1 = peg$f114(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 60) { - s1 = peg$c126; + s1 = peg$c127; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e131); } + if (peg$silentFails === 0) { peg$fail(peg$e132); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f114(); + s1 = peg$f115(); } s0 = s1; } @@ -4485,7 +4511,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e125); } + if (peg$silentFails === 0) { peg$fail(peg$e126); } } return s0; @@ -4498,7 +4524,7 @@ function peg$parse(input, options) { s1 = peg$parseoperator(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f115(s1); + s1 = peg$f116(s1); } s0 = s1; @@ -4510,11 +4536,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c127; + s1 = peg$c128; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e132); } + if (peg$silentFails === 0) { peg$fail(peg$e133); } } if (s1 !== peg$FAILED) { s2 = input.charAt(peg$currPos); @@ -4522,11 +4548,11 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e133); } + if (peg$silentFails === 0) { peg$fail(peg$e134); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f116(s2); + s0 = peg$f117(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4552,7 +4578,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e135); } + if (peg$silentFails === 0) { peg$fail(peg$e136); } } } if (s2 !== peg$FAILED) { @@ -4565,7 +4591,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e135); } + if (peg$silentFails === 0) { peg$fail(peg$e136); } } } } @@ -4574,13 +4600,13 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f117(s1); + s1 = peg$f118(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e134); } + if (peg$silentFails === 0) { peg$fail(peg$e135); } } return s0; @@ -4592,7 +4618,7 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parse_(); peg$savedPos = s0; - s1 = peg$f118(); + s1 = peg$f119(); s0 = s1; return s0; @@ -4608,7 +4634,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e137); } + if (peg$silentFails === 0) { peg$fail(peg$e138); } } while (s1 !== peg$FAILED) { s0.push(s1); @@ -4617,12 +4643,12 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e137); } + if (peg$silentFails === 0) { peg$fail(peg$e138); } } } peg$silentFails--; s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e136); } + if (peg$silentFails === 0) { peg$fail(peg$e137); } return s0; } @@ -4632,7 +4658,7 @@ function peg$parse(input, options) { s0 = peg$currPos; peg$savedPos = peg$currPos; - s1 = peg$f119(); + s1 = peg$f120(); if (s1) { s1 = undefined; } else { @@ -4669,7 +4695,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e139); } + if (peg$silentFails === 0) { peg$fail(peg$e140); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -4678,7 +4704,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e139); } + if (peg$silentFails === 0) { peg$fail(peg$e140); } } } s2 = input.charAt(peg$currPos); @@ -4686,7 +4712,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e140); } + if (peg$silentFails === 0) { peg$fail(peg$e141); } } if (s2 !== peg$FAILED) { s3 = []; @@ -4697,7 +4723,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e141); } + if (peg$silentFails === 0) { peg$fail(peg$e142); } } } while (s4 !== peg$FAILED) { @@ -4709,7 +4735,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e141); } + if (peg$silentFails === 0) { peg$fail(peg$e142); } } } } @@ -4718,7 +4744,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e140); } + if (peg$silentFails === 0) { peg$fail(peg$e141); } } if (s4 !== peg$FAILED) { s5 = []; @@ -4727,7 +4753,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e135); } + if (peg$silentFails === 0) { peg$fail(peg$e136); } } while (s6 !== peg$FAILED) { s5.push(s6); @@ -4736,11 +4762,11 @@ function peg$parse(input, options) { peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e135); } + if (peg$silentFails === 0) { peg$fail(peg$e136); } } } peg$savedPos = s0; - s0 = peg$f120(s1, s3, s5); + s0 = peg$f121(s1, s3, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4752,7 +4778,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e138); } + if (peg$silentFails === 0) { peg$fail(peg$e139); } } return s0; @@ -4769,7 +4795,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e139); } + if (peg$silentFails === 0) { peg$fail(peg$e140); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -4778,7 +4804,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e139); } + if (peg$silentFails === 0) { peg$fail(peg$e140); } } } s2 = input.charAt(peg$currPos); @@ -4786,7 +4812,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e140); } + if (peg$silentFails === 0) { peg$fail(peg$e141); } } if (s2 !== peg$FAILED) { s3 = []; @@ -4797,7 +4823,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e141); } + if (peg$silentFails === 0) { peg$fail(peg$e142); } } if (s4 === peg$FAILED) { s4 = peg$currPos; @@ -4813,15 +4839,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8220) { - s6 = peg$c128; + s6 = peg$c129; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e142); } + if (peg$silentFails === 0) { peg$fail(peg$e143); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f121(s1); + s4 = peg$f122(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -4844,15 +4870,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8221) { - s6 = peg$c129; + s6 = peg$c130; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e143); } + if (peg$silentFails === 0) { peg$fail(peg$e144); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f122(s1); + s4 = peg$f123(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -4875,15 +4901,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s6 = peg$c130; + s6 = peg$c131; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e144); } + if (peg$silentFails === 0) { peg$fail(peg$e145); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f123(s1); + s4 = peg$f124(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -4905,7 +4931,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e141); } + if (peg$silentFails === 0) { peg$fail(peg$e142); } } if (s4 === peg$FAILED) { s4 = peg$currPos; @@ -4921,15 +4947,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8220) { - s6 = peg$c128; + s6 = peg$c129; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e142); } + if (peg$silentFails === 0) { peg$fail(peg$e143); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f121(s1); + s4 = peg$f122(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -4952,15 +4978,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8221) { - s6 = peg$c129; + s6 = peg$c130; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e143); } + if (peg$silentFails === 0) { peg$fail(peg$e144); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f122(s1); + s4 = peg$f123(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -4983,15 +5009,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s6 = peg$c130; + s6 = peg$c131; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e144); } + if (peg$silentFails === 0) { peg$fail(peg$e145); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f123(s1); + s4 = peg$f124(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -5008,7 +5034,7 @@ function peg$parse(input, options) { s4 = peg$parseclosingQuote(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f124(s1, s3, s4); + s0 = peg$f125(s1, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -5020,7 +5046,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e138); } + if (peg$silentFails === 0) { peg$fail(peg$e139); } } return s0; @@ -5035,7 +5061,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e140); } + if (peg$silentFails === 0) { peg$fail(peg$e141); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -5073,7 +5099,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e145); } + if (peg$silentFails === 0) { peg$fail(peg$e146); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -5082,7 +5108,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e145); } + if (peg$silentFails === 0) { peg$fail(peg$e146); } } } s2 = []; @@ -5091,7 +5117,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e146); } + if (peg$silentFails === 0) { peg$fail(peg$e147); } } while (s3 !== peg$FAILED) { s2.push(s3); @@ -5100,7 +5126,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e146); } + if (peg$silentFails === 0) { peg$fail(peg$e147); } } } s3 = []; @@ -5109,7 +5135,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e147); } + if (peg$silentFails === 0) { peg$fail(peg$e148); } } while (s4 !== peg$FAILED) { s3.push(s4); @@ -5118,7 +5144,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e147); } + if (peg$silentFails === 0) { peg$fail(peg$e148); } } } s4 = peg$parseoperator(); @@ -5137,7 +5163,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e148); } + if (peg$silentFails === 0) { peg$fail(peg$e149); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -5146,7 +5172,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e148); } + if (peg$silentFails === 0) { peg$fail(peg$e149); } } } s2 = peg$currPos; @@ -5193,7 +5219,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e149); } + if (peg$silentFails === 0) { peg$fail(peg$e150); } } } } @@ -5209,7 +5235,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e150); } + if (peg$silentFails === 0) { peg$fail(peg$e151); } } if (s0 === peg$FAILED) { s0 = peg$currPos; @@ -5238,24 +5264,24 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c131) { + if (s1.toLowerCase() === peg$c132) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e151); } + if (peg$silentFails === 0) { peg$fail(peg$e152); } } if (s1 === peg$FAILED) { s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c132) { + if (s1.toLowerCase() === peg$c133) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e152); } + if (peg$silentFails === 0) { peg$fail(peg$e153); } } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f125(); + s1 = peg$f126(); } s0 = s1; @@ -5267,24 +5293,24 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c133) { + if (s1.toLowerCase() === peg$c134) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e153); } + if (peg$silentFails === 0) { peg$fail(peg$e154); } } if (s1 === peg$FAILED) { s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c134) { + if (s1.toLowerCase() === peg$c135) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e154); } + if (peg$silentFails === 0) { peg$fail(peg$e155); } } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f126(); + s1 = peg$f127(); } s0 = s1; @@ -5296,24 +5322,24 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c135) { + if (s1.toLowerCase() === peg$c136) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e155); } + if (peg$silentFails === 0) { peg$fail(peg$e156); } } if (s1 === peg$FAILED) { s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c136) { + if (s1.toLowerCase() === peg$c137) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e156); } + if (peg$silentFails === 0) { peg$fail(peg$e157); } } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f127(); + s1 = peg$f128(); } s0 = s1; diff --git a/src/libs/SearchParser/autocompleteParser.peggy b/src/libs/SearchParser/autocompleteParser.peggy index 966f5aec3edf..420d059bf5b9 100644 --- a/src/libs/SearchParser/autocompleteParser.peggy +++ b/src/libs/SearchParser/autocompleteParser.peggy @@ -87,6 +87,7 @@ autocompleteKey "key" / total / tag / category + / vendor / to / taxRate / from diff --git a/src/libs/SearchParser/baseRules.peggy b/src/libs/SearchParser/baseRules.peggy index 3cecfde34284..dce474b431e6 100644 --- a/src/libs/SearchParser/baseRules.peggy +++ b/src/libs/SearchParser/baseRules.peggy @@ -29,6 +29,7 @@ groupCurrency / "group-currency"i { return "groupCurrency"; } tag = "tag"i { return "tag"; } category = "category"i { return "category"; } +vendor = "vendor"i { return "vendor"; } to = "to"i { return "to"; } exporter = "exporter"i { return "exporter"; } payer = "payer"i { return "payer"; } diff --git a/src/libs/SearchParser/searchParser.js b/src/libs/SearchParser/searchParser.js index ac786bf9fe6f..55bba132eb2b 100644 --- a/src/libs/SearchParser/searchParser.js +++ b/src/libs/SearchParser/searchParser.js @@ -201,126 +201,127 @@ function peg$parse(input, options) { var peg$c14 = "group-currency"; var peg$c15 = "tag"; var peg$c16 = "category"; - var peg$c17 = "to"; - var peg$c18 = "exporter"; - var peg$c19 = "payer"; - var peg$c20 = "paidBy"; - var peg$c21 = "paid-by"; - var peg$c22 = "taxrate"; - var peg$c23 = "tax-rate"; - var peg$c24 = "cardID"; - var peg$c25 = "card"; - var peg$c26 = "bankAccount"; - var peg$c27 = "bank-account"; - var peg$c28 = "from"; - var peg$c29 = "attendee"; - var peg$c30 = "expenseType"; - var peg$c31 = "expense-type"; - var peg$c32 = "receiptType"; - var peg$c33 = "receipt-type"; - var peg$c34 = "transactionStatus"; - var peg$c35 = "transaction-status"; - var peg$c36 = "withdrawalType"; - var peg$c37 = "withdrawal-type"; - var peg$c38 = "withdrawalStatus"; - var peg$c39 = "withdrawal-status"; - var peg$c40 = "paidStatus"; - var peg$c41 = "paid-status"; - var peg$c42 = "withdrawalid"; - var peg$c43 = "withdrawal-id"; - var peg$c44 = "billable"; - var peg$c45 = "declined"; - var peg$c46 = "reimbursable"; - var peg$c47 = "type"; - var peg$c48 = "status"; - var peg$c49 = "sortBy"; - var peg$c50 = "sort-by"; - var peg$c51 = "sortOrder"; - var peg$c52 = "sort-order"; - var peg$c53 = "policyID"; - var peg$c54 = "workspace"; - var peg$c55 = "submitted"; - var peg$c56 = "approved"; - var peg$c57 = "anyapproval"; - var peg$c58 = "any-approval"; - var peg$c59 = "paid"; - var peg$c60 = "exported"; - var peg$c61 = "posted"; - var peg$c62 = "withdrawn"; - var peg$c63 = "groupby"; - var peg$c64 = "group-by"; - var peg$c65 = "limit"; - var peg$c66 = "feed"; - var peg$c67 = "title"; - var peg$c68 = "submitteruserid"; - var peg$c69 = "submitter-user-id"; - var peg$c70 = "submitterpayrollid"; - var peg$c71 = "submitter-payroll-id"; - var peg$c72 = "orderdealnumbers"; - var peg$c73 = "order-deal-numbers"; - var peg$c74 = "assignee"; - var peg$c75 = "createdby"; - var peg$c76 = "created-by"; - var peg$c77 = "action"; - var peg$c78 = "total"; - var peg$c79 = "has"; - var peg$c80 = "is"; - var peg$c81 = "purchaseamount"; - var peg$c82 = "purchase-amount"; - var peg$c83 = "purchasecurrency"; - var peg$c84 = "purchase-currency"; - var peg$c85 = "amountdebited"; - var peg$c86 = "amount-debited"; - var peg$c87 = "amountreimbursed"; - var peg$c88 = "amount-reimbursed"; - var peg$c89 = "columns"; - var peg$c90 = "view"; - var peg$c91 = "compare"; - var peg$c92 = "per-diem"; - var peg$c93 = "drafts"; - var peg$c94 = "draft"; - var peg$c95 = "tax"; - var peg$c96 = "policy-name"; - var peg$c97 = "long-report-id"; - var peg$c98 = "exported-to"; - var peg$c99 = "exportedto"; - var peg$c100 = "exchange-rate"; - var peg$c101 = "reimbursable-total"; - var peg$c102 = "non-reimbursable-total"; - var peg$c103 = "group-from"; - var peg$c104 = "group-expenses"; - var peg$c105 = "group-total"; - var peg$c106 = "group-card"; - var peg$c107 = "group-feed"; - var peg$c108 = "group-bank-account"; - var peg$c109 = "group-withdrawn"; - var peg$c110 = "group-withdrawal-id"; - var peg$c111 = "group-amount-debited"; - var peg$c112 = "group-amount-reimbursed"; - var peg$c113 = "group-category"; - var peg$c114 = "group-tag"; - var peg$c115 = "group-merchant"; - var peg$c116 = "group-day"; - var peg$c117 = "group-month"; - var peg$c118 = "group-week"; - var peg$c119 = "group-year"; - var peg$c120 = "group-quarter"; - var peg$c121 = "*:"; - var peg$c122 = "!="; - var peg$c123 = ">="; - var peg$c124 = ">"; - var peg$c125 = "<="; - var peg$c126 = "<"; - var peg$c127 = "\\"; - var peg$c128 = "\u201C"; - var peg$c129 = "\u201D"; - var peg$c130 = "\""; - var peg$c131 = "footercount"; - var peg$c132 = "footer-count"; - var peg$c133 = "footercurrency"; - var peg$c134 = "footer-currency"; - var peg$c135 = "footertotal"; - var peg$c136 = "footer-total"; + var peg$c17 = "vendor"; + var peg$c18 = "to"; + var peg$c19 = "exporter"; + var peg$c20 = "payer"; + var peg$c21 = "paidBy"; + var peg$c22 = "paid-by"; + var peg$c23 = "taxrate"; + var peg$c24 = "tax-rate"; + var peg$c25 = "cardID"; + var peg$c26 = "card"; + var peg$c27 = "bankAccount"; + var peg$c28 = "bank-account"; + var peg$c29 = "from"; + var peg$c30 = "attendee"; + var peg$c31 = "expenseType"; + var peg$c32 = "expense-type"; + var peg$c33 = "receiptType"; + var peg$c34 = "receipt-type"; + var peg$c35 = "transactionStatus"; + var peg$c36 = "transaction-status"; + var peg$c37 = "withdrawalType"; + var peg$c38 = "withdrawal-type"; + var peg$c39 = "withdrawalStatus"; + var peg$c40 = "withdrawal-status"; + var peg$c41 = "paidStatus"; + var peg$c42 = "paid-status"; + var peg$c43 = "withdrawalid"; + var peg$c44 = "withdrawal-id"; + var peg$c45 = "billable"; + var peg$c46 = "declined"; + var peg$c47 = "reimbursable"; + var peg$c48 = "type"; + var peg$c49 = "status"; + var peg$c50 = "sortBy"; + var peg$c51 = "sort-by"; + var peg$c52 = "sortOrder"; + var peg$c53 = "sort-order"; + var peg$c54 = "policyID"; + var peg$c55 = "workspace"; + var peg$c56 = "submitted"; + var peg$c57 = "approved"; + var peg$c58 = "anyapproval"; + var peg$c59 = "any-approval"; + var peg$c60 = "paid"; + var peg$c61 = "exported"; + var peg$c62 = "posted"; + var peg$c63 = "withdrawn"; + var peg$c64 = "groupby"; + var peg$c65 = "group-by"; + var peg$c66 = "limit"; + var peg$c67 = "feed"; + var peg$c68 = "title"; + var peg$c69 = "submitteruserid"; + var peg$c70 = "submitter-user-id"; + var peg$c71 = "submitterpayrollid"; + var peg$c72 = "submitter-payroll-id"; + var peg$c73 = "orderdealnumbers"; + var peg$c74 = "order-deal-numbers"; + var peg$c75 = "assignee"; + var peg$c76 = "createdby"; + var peg$c77 = "created-by"; + var peg$c78 = "action"; + var peg$c79 = "total"; + var peg$c80 = "has"; + var peg$c81 = "is"; + var peg$c82 = "purchaseamount"; + var peg$c83 = "purchase-amount"; + var peg$c84 = "purchasecurrency"; + var peg$c85 = "purchase-currency"; + var peg$c86 = "amountdebited"; + var peg$c87 = "amount-debited"; + var peg$c88 = "amountreimbursed"; + var peg$c89 = "amount-reimbursed"; + var peg$c90 = "columns"; + var peg$c91 = "view"; + var peg$c92 = "compare"; + var peg$c93 = "per-diem"; + var peg$c94 = "drafts"; + var peg$c95 = "draft"; + var peg$c96 = "tax"; + var peg$c97 = "policy-name"; + var peg$c98 = "long-report-id"; + var peg$c99 = "exported-to"; + var peg$c100 = "exportedto"; + var peg$c101 = "exchange-rate"; + var peg$c102 = "reimbursable-total"; + var peg$c103 = "non-reimbursable-total"; + var peg$c104 = "group-from"; + var peg$c105 = "group-expenses"; + var peg$c106 = "group-total"; + var peg$c107 = "group-card"; + var peg$c108 = "group-feed"; + var peg$c109 = "group-bank-account"; + var peg$c110 = "group-withdrawn"; + var peg$c111 = "group-withdrawal-id"; + var peg$c112 = "group-amount-debited"; + var peg$c113 = "group-amount-reimbursed"; + var peg$c114 = "group-category"; + var peg$c115 = "group-tag"; + var peg$c116 = "group-merchant"; + var peg$c117 = "group-day"; + var peg$c118 = "group-month"; + var peg$c119 = "group-week"; + var peg$c120 = "group-year"; + var peg$c121 = "group-quarter"; + var peg$c122 = "*:"; + var peg$c123 = "!="; + var peg$c124 = ">="; + var peg$c125 = ">"; + var peg$c126 = "<="; + var peg$c127 = "<"; + var peg$c128 = "\\"; + var peg$c129 = "\u201C"; + var peg$c130 = "\u201D"; + var peg$c131 = "\""; + var peg$c132 = "footercount"; + var peg$c133 = "footer-count"; + var peg$c134 = "footercurrency"; + var peg$c135 = "footer-currency"; + var peg$c136 = "footertotal"; + var peg$c137 = "footer-total"; var peg$r0 = /^[^ \t\r\n\xA0]/; var peg$r1 = /^[ \t\r\n\xA0,:=<>!]/; @@ -360,143 +361,144 @@ function peg$parse(input, options) { var peg$e19 = peg$literalExpectation("group-currency", true); var peg$e20 = peg$literalExpectation("tag", true); var peg$e21 = peg$literalExpectation("category", true); - var peg$e22 = peg$literalExpectation("to", true); - var peg$e23 = peg$literalExpectation("exporter", true); - var peg$e24 = peg$literalExpectation("payer", true); - var peg$e25 = peg$literalExpectation("paidBy", false); - var peg$e26 = peg$literalExpectation("paid-by", true); - var peg$e27 = peg$literalExpectation("taxRate", true); - var peg$e28 = peg$literalExpectation("tax-rate", true); - var peg$e29 = peg$literalExpectation("cardID", false); - var peg$e30 = peg$literalExpectation("card", true); - var peg$e31 = peg$literalExpectation("bankAccount", false); - var peg$e32 = peg$literalExpectation("bank-account", true); - var peg$e33 = peg$literalExpectation("from", true); - var peg$e34 = peg$literalExpectation("attendee", true); - var peg$e35 = peg$literalExpectation("expenseType", false); - var peg$e36 = peg$literalExpectation("expense-type", true); - var peg$e37 = peg$literalExpectation("receiptType", false); - var peg$e38 = peg$literalExpectation("receipt-type", true); - var peg$e39 = peg$literalExpectation("transactionStatus", false); - var peg$e40 = peg$literalExpectation("transaction-status", true); - var peg$e41 = peg$literalExpectation("withdrawalType", false); - var peg$e42 = peg$literalExpectation("withdrawal-type", true); - var peg$e43 = peg$literalExpectation("withdrawalStatus", false); - var peg$e44 = peg$literalExpectation("withdrawal-status", true); - var peg$e45 = peg$literalExpectation("paidStatus", false); - var peg$e46 = peg$literalExpectation("paid-status", true); - var peg$e47 = peg$literalExpectation("withdrawalID", true); - var peg$e48 = peg$literalExpectation("withdrawal-id", true); - var peg$e49 = peg$literalExpectation("billable", true); - var peg$e50 = peg$literalExpectation("declined", true); - var peg$e51 = peg$literalExpectation("reimbursable", true); - var peg$e52 = peg$literalExpectation("type", true); - var peg$e53 = peg$literalExpectation("status", true); - var peg$e54 = peg$literalExpectation("sortBy", false); - var peg$e55 = peg$literalExpectation("sort-by", true); - var peg$e56 = peg$literalExpectation("sortOrder", false); - var peg$e57 = peg$literalExpectation("sort-order", true); - var peg$e58 = peg$literalExpectation("policyID", false); - var peg$e59 = peg$literalExpectation("workspace", true); - var peg$e60 = peg$literalExpectation("submitted", true); - var peg$e61 = peg$literalExpectation("approved", true); - var peg$e62 = peg$literalExpectation("anyApproval", true); - var peg$e63 = peg$literalExpectation("any-approval", true); - var peg$e64 = peg$literalExpectation("paid", true); - var peg$e65 = peg$literalExpectation("exported", true); - var peg$e66 = peg$literalExpectation("posted", true); - var peg$e67 = peg$literalExpectation("withdrawn", true); - var peg$e68 = peg$literalExpectation("groupBy", true); - var peg$e69 = peg$literalExpectation("group-by", true); - var peg$e70 = peg$literalExpectation("limit", true); - var peg$e71 = peg$literalExpectation("feed", true); - var peg$e72 = peg$literalExpectation("title", true); - var peg$e73 = peg$literalExpectation("submitterUserID", true); - var peg$e74 = peg$literalExpectation("submitter-user-id", true); - var peg$e75 = peg$literalExpectation("submitterPayrollID", true); - var peg$e76 = peg$literalExpectation("submitter-payroll-id", true); - var peg$e77 = peg$literalExpectation("orderDealNumbers", true); - var peg$e78 = peg$literalExpectation("order-deal-numbers", true); - var peg$e79 = peg$literalExpectation("assignee", true); - var peg$e80 = peg$literalExpectation("createdBy", true); - var peg$e81 = peg$literalExpectation("created-by", true); - var peg$e82 = peg$literalExpectation("action", true); - var peg$e83 = peg$literalExpectation("total", true); - var peg$e84 = peg$literalExpectation("has", true); - var peg$e85 = peg$literalExpectation("is", true); - var peg$e86 = peg$literalExpectation("purchaseAmount", true); - var peg$e87 = peg$literalExpectation("purchase-amount", true); - var peg$e88 = peg$literalExpectation("purchaseCurrency", true); - var peg$e89 = peg$literalExpectation("purchase-currency", true); - var peg$e90 = peg$literalExpectation("amountDebited", true); - var peg$e91 = peg$literalExpectation("amount-debited", true); - var peg$e92 = peg$literalExpectation("amountReimbursed", true); - var peg$e93 = peg$literalExpectation("amount-reimbursed", true); - var peg$e94 = peg$literalExpectation("columns", true); - var peg$e95 = peg$literalExpectation("view", true); - var peg$e96 = peg$literalExpectation("compare", true); - var peg$e97 = peg$literalExpectation("per-diem", true); - var peg$e98 = peg$literalExpectation("drafts", true); - var peg$e99 = peg$literalExpectation("draft", true); - var peg$e100 = peg$literalExpectation("tax", true); - var peg$e101 = peg$literalExpectation("policy-name", true); - var peg$e102 = peg$literalExpectation("long-report-id", true); - var peg$e103 = peg$literalExpectation("exported-to", true); - var peg$e104 = peg$classExpectation([":", "="], false, false); - var peg$e105 = peg$literalExpectation("exportedTo", true); - var peg$e106 = peg$literalExpectation("exchange-rate", true); - var peg$e107 = peg$literalExpectation("reimbursable-total", true); - var peg$e108 = peg$literalExpectation("non-reimbursable-total", true); - var peg$e109 = peg$literalExpectation("group-from", true); - var peg$e110 = peg$literalExpectation("group-expenses", true); - var peg$e111 = peg$literalExpectation("group-total", true); - var peg$e112 = peg$literalExpectation("group-card", true); - var peg$e113 = peg$literalExpectation("group-feed", true); - var peg$e114 = peg$literalExpectation("group-bank-account", true); - var peg$e115 = peg$literalExpectation("group-withdrawn", true); - var peg$e116 = peg$literalExpectation("group-withdrawal-id", true); - var peg$e117 = peg$literalExpectation("group-amount-debited", true); - var peg$e118 = peg$literalExpectation("group-amount-reimbursed", true); - var peg$e119 = peg$literalExpectation("group-category", true); - var peg$e120 = peg$literalExpectation("group-tag", true); - var peg$e121 = peg$literalExpectation("group-merchant", true); - var peg$e122 = peg$literalExpectation("group-day", true); - var peg$e123 = peg$literalExpectation("group-month", true); - var peg$e124 = peg$literalExpectation("group-week", true); - var peg$e125 = peg$literalExpectation("group-year", true); - var peg$e126 = peg$literalExpectation("group-quarter", true); - var peg$e127 = peg$otherExpectation("operator"); - var peg$e128 = peg$literalExpectation("*:", false); - var peg$e129 = peg$literalExpectation("!=", false); - var peg$e130 = peg$literalExpectation(">=", false); - var peg$e131 = peg$literalExpectation(">", false); - var peg$e132 = peg$literalExpectation("<=", false); - var peg$e133 = peg$literalExpectation("<", false); - var peg$e134 = peg$literalExpectation("\\", false); - var peg$e135 = peg$classExpectation([",", "\"", "\u201D", "\u201C", "\\"], false, false); - var peg$e136 = peg$otherExpectation("word"); - var peg$e137 = peg$classExpectation([" ", ",", "\t", "\n", "\r", "\xA0"], true, false); - var peg$e138 = peg$otherExpectation("whitespace"); - var peg$e139 = peg$classExpectation([" ", "\t", "\r", "\n", "\xA0"], false, false); - var peg$e140 = peg$otherExpectation("quote"); - var peg$e141 = peg$classExpectation([" ", ",", "\"", "\u201D", "\u201C", "\t", "\n", "\r", "\xA0"], true, false); - var peg$e142 = peg$classExpectation(["\"", ["\u201C", "\u201D"]], false, false); - var peg$e143 = peg$classExpectation(["\"", "\u201D", "\u201C", "\r", "\n"], true, false); - var peg$e144 = peg$literalExpectation("\u201C", false); - var peg$e145 = peg$literalExpectation("\u201D", false); - var peg$e146 = peg$literalExpectation("\"", false); - var peg$e147 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"], ["0", "9"]], false, false); - var peg$e148 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false); - var peg$e149 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0"], false, false); - var peg$e150 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"]], false, false); - var peg$e151 = peg$classExpectation([","], false, false); - var peg$e152 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ","], false, false); - var peg$e153 = peg$literalExpectation("footerCount", true); - var peg$e154 = peg$literalExpectation("footer-count", true); - var peg$e155 = peg$literalExpectation("footerCurrency", true); - var peg$e156 = peg$literalExpectation("footer-currency", true); - var peg$e157 = peg$literalExpectation("footerTotal", true); - var peg$e158 = peg$literalExpectation("footer-total", true); + var peg$e22 = peg$literalExpectation("vendor", true); + var peg$e23 = peg$literalExpectation("to", true); + var peg$e24 = peg$literalExpectation("exporter", true); + var peg$e25 = peg$literalExpectation("payer", true); + var peg$e26 = peg$literalExpectation("paidBy", false); + var peg$e27 = peg$literalExpectation("paid-by", true); + var peg$e28 = peg$literalExpectation("taxRate", true); + var peg$e29 = peg$literalExpectation("tax-rate", true); + var peg$e30 = peg$literalExpectation("cardID", false); + var peg$e31 = peg$literalExpectation("card", true); + var peg$e32 = peg$literalExpectation("bankAccount", false); + var peg$e33 = peg$literalExpectation("bank-account", true); + var peg$e34 = peg$literalExpectation("from", true); + var peg$e35 = peg$literalExpectation("attendee", true); + var peg$e36 = peg$literalExpectation("expenseType", false); + var peg$e37 = peg$literalExpectation("expense-type", true); + var peg$e38 = peg$literalExpectation("receiptType", false); + var peg$e39 = peg$literalExpectation("receipt-type", true); + var peg$e40 = peg$literalExpectation("transactionStatus", false); + var peg$e41 = peg$literalExpectation("transaction-status", true); + var peg$e42 = peg$literalExpectation("withdrawalType", false); + var peg$e43 = peg$literalExpectation("withdrawal-type", true); + var peg$e44 = peg$literalExpectation("withdrawalStatus", false); + var peg$e45 = peg$literalExpectation("withdrawal-status", true); + var peg$e46 = peg$literalExpectation("paidStatus", false); + var peg$e47 = peg$literalExpectation("paid-status", true); + var peg$e48 = peg$literalExpectation("withdrawalID", true); + var peg$e49 = peg$literalExpectation("withdrawal-id", true); + var peg$e50 = peg$literalExpectation("billable", true); + var peg$e51 = peg$literalExpectation("declined", true); + var peg$e52 = peg$literalExpectation("reimbursable", true); + var peg$e53 = peg$literalExpectation("type", true); + var peg$e54 = peg$literalExpectation("status", true); + var peg$e55 = peg$literalExpectation("sortBy", false); + var peg$e56 = peg$literalExpectation("sort-by", true); + var peg$e57 = peg$literalExpectation("sortOrder", false); + var peg$e58 = peg$literalExpectation("sort-order", true); + var peg$e59 = peg$literalExpectation("policyID", false); + var peg$e60 = peg$literalExpectation("workspace", true); + var peg$e61 = peg$literalExpectation("submitted", true); + var peg$e62 = peg$literalExpectation("approved", true); + var peg$e63 = peg$literalExpectation("anyApproval", true); + var peg$e64 = peg$literalExpectation("any-approval", true); + var peg$e65 = peg$literalExpectation("paid", true); + var peg$e66 = peg$literalExpectation("exported", true); + var peg$e67 = peg$literalExpectation("posted", true); + var peg$e68 = peg$literalExpectation("withdrawn", true); + var peg$e69 = peg$literalExpectation("groupBy", true); + var peg$e70 = peg$literalExpectation("group-by", true); + var peg$e71 = peg$literalExpectation("limit", true); + var peg$e72 = peg$literalExpectation("feed", true); + var peg$e73 = peg$literalExpectation("title", true); + var peg$e74 = peg$literalExpectation("submitterUserID", true); + var peg$e75 = peg$literalExpectation("submitter-user-id", true); + var peg$e76 = peg$literalExpectation("submitterPayrollID", true); + var peg$e77 = peg$literalExpectation("submitter-payroll-id", true); + var peg$e78 = peg$literalExpectation("orderDealNumbers", true); + var peg$e79 = peg$literalExpectation("order-deal-numbers", true); + var peg$e80 = peg$literalExpectation("assignee", true); + var peg$e81 = peg$literalExpectation("createdBy", true); + var peg$e82 = peg$literalExpectation("created-by", true); + var peg$e83 = peg$literalExpectation("action", true); + var peg$e84 = peg$literalExpectation("total", true); + var peg$e85 = peg$literalExpectation("has", true); + var peg$e86 = peg$literalExpectation("is", true); + var peg$e87 = peg$literalExpectation("purchaseAmount", true); + var peg$e88 = peg$literalExpectation("purchase-amount", true); + var peg$e89 = peg$literalExpectation("purchaseCurrency", true); + var peg$e90 = peg$literalExpectation("purchase-currency", true); + var peg$e91 = peg$literalExpectation("amountDebited", true); + var peg$e92 = peg$literalExpectation("amount-debited", true); + var peg$e93 = peg$literalExpectation("amountReimbursed", true); + var peg$e94 = peg$literalExpectation("amount-reimbursed", true); + var peg$e95 = peg$literalExpectation("columns", true); + var peg$e96 = peg$literalExpectation("view", true); + var peg$e97 = peg$literalExpectation("compare", true); + var peg$e98 = peg$literalExpectation("per-diem", true); + var peg$e99 = peg$literalExpectation("drafts", true); + var peg$e100 = peg$literalExpectation("draft", true); + var peg$e101 = peg$literalExpectation("tax", true); + var peg$e102 = peg$literalExpectation("policy-name", true); + var peg$e103 = peg$literalExpectation("long-report-id", true); + var peg$e104 = peg$literalExpectation("exported-to", true); + var peg$e105 = peg$classExpectation([":", "="], false, false); + var peg$e106 = peg$literalExpectation("exportedTo", true); + var peg$e107 = peg$literalExpectation("exchange-rate", true); + var peg$e108 = peg$literalExpectation("reimbursable-total", true); + var peg$e109 = peg$literalExpectation("non-reimbursable-total", true); + var peg$e110 = peg$literalExpectation("group-from", true); + var peg$e111 = peg$literalExpectation("group-expenses", true); + var peg$e112 = peg$literalExpectation("group-total", true); + var peg$e113 = peg$literalExpectation("group-card", true); + var peg$e114 = peg$literalExpectation("group-feed", true); + var peg$e115 = peg$literalExpectation("group-bank-account", true); + var peg$e116 = peg$literalExpectation("group-withdrawn", true); + var peg$e117 = peg$literalExpectation("group-withdrawal-id", true); + var peg$e118 = peg$literalExpectation("group-amount-debited", true); + var peg$e119 = peg$literalExpectation("group-amount-reimbursed", true); + var peg$e120 = peg$literalExpectation("group-category", true); + var peg$e121 = peg$literalExpectation("group-tag", true); + var peg$e122 = peg$literalExpectation("group-merchant", true); + var peg$e123 = peg$literalExpectation("group-day", true); + var peg$e124 = peg$literalExpectation("group-month", true); + var peg$e125 = peg$literalExpectation("group-week", true); + var peg$e126 = peg$literalExpectation("group-year", true); + var peg$e127 = peg$literalExpectation("group-quarter", true); + var peg$e128 = peg$otherExpectation("operator"); + var peg$e129 = peg$literalExpectation("*:", false); + var peg$e130 = peg$literalExpectation("!=", false); + var peg$e131 = peg$literalExpectation(">=", false); + var peg$e132 = peg$literalExpectation(">", false); + var peg$e133 = peg$literalExpectation("<=", false); + var peg$e134 = peg$literalExpectation("<", false); + var peg$e135 = peg$literalExpectation("\\", false); + var peg$e136 = peg$classExpectation([",", "\"", "\u201D", "\u201C", "\\"], false, false); + var peg$e137 = peg$otherExpectation("word"); + var peg$e138 = peg$classExpectation([" ", ",", "\t", "\n", "\r", "\xA0"], true, false); + var peg$e139 = peg$otherExpectation("whitespace"); + var peg$e140 = peg$classExpectation([" ", "\t", "\r", "\n", "\xA0"], false, false); + var peg$e141 = peg$otherExpectation("quote"); + var peg$e142 = peg$classExpectation([" ", ",", "\"", "\u201D", "\u201C", "\t", "\n", "\r", "\xA0"], true, false); + var peg$e143 = peg$classExpectation(["\"", ["\u201C", "\u201D"]], false, false); + var peg$e144 = peg$classExpectation(["\"", "\u201D", "\u201C", "\r", "\n"], true, false); + var peg$e145 = peg$literalExpectation("\u201C", false); + var peg$e146 = peg$literalExpectation("\u201D", false); + var peg$e147 = peg$literalExpectation("\"", false); + var peg$e148 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"], ["0", "9"]], false, false); + var peg$e149 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false); + var peg$e150 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0"], false, false); + var peg$e151 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"]], false, false); + var peg$e152 = peg$classExpectation([","], false, false); + var peg$e153 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ","], false, false); + var peg$e154 = peg$literalExpectation("footerCount", true); + var peg$e155 = peg$literalExpectation("footer-count", true); + var peg$e156 = peg$literalExpectation("footerCurrency", true); + var peg$e157 = peg$literalExpectation("footer-currency", true); + var peg$e158 = peg$literalExpectation("footerTotal", true); + var peg$e159 = peg$literalExpectation("footer-total", true); var peg$f0 = function(filters) { return applyDefaults(filters); }; var peg$f1 = function(head, tail) { @@ -609,131 +611,132 @@ function peg$parse(input, options) { var peg$f17 = function() { return "groupCurrency"; }; var peg$f18 = function() { return "tag"; }; var peg$f19 = function() { return "category"; }; - var peg$f20 = function() { return "to"; }; - var peg$f21 = function() { return "exporter"; }; - var peg$f22 = function() { return "payer"; }; - var peg$f23 = function() { return "paidBy"; }; - var peg$f24 = function() { return "taxRate"; }; - var peg$f25 = function() { return "cardID"; }; - var peg$f26 = function() { return "bankAccount"; }; - var peg$f27 = function() { return "from"; }; - var peg$f28 = function() {return "attendee"}; - var peg$f29 = function() { return "expenseType"; }; - var peg$f30 = function() { return "receiptType"; }; - var peg$f31 = function() { return "transactionStatus"; }; - var peg$f32 = function() { return "withdrawalType"; }; - var peg$f33 = function() { return "withdrawalStatus"; }; - var peg$f34 = function() { return "paidStatus"; }; - var peg$f35 = function() { return "withdrawalID"; }; - var peg$f36 = function() { return "billable"; }; - var peg$f37 = function() { return "declined"; }; - var peg$f38 = function() { return "reimbursable"; }; - var peg$f39 = function() { return "type"; }; - var peg$f40 = function() { return "status"; }; - var peg$f41 = function() { return "sortBy"; }; - var peg$f42 = function() { return "sortOrder"; }; - var peg$f43 = function() { return "policyID"; }; - var peg$f44 = function() { return "submitted"; }; - var peg$f45 = function() { return "approved"; }; - var peg$f46 = function() { return "anyApproval"; }; + var peg$f20 = function() { return "vendor"; }; + var peg$f21 = function() { return "to"; }; + var peg$f22 = function() { return "exporter"; }; + var peg$f23 = function() { return "payer"; }; + var peg$f24 = function() { return "paidBy"; }; + var peg$f25 = function() { return "taxRate"; }; + var peg$f26 = function() { return "cardID"; }; + var peg$f27 = function() { return "bankAccount"; }; + var peg$f28 = function() { return "from"; }; + var peg$f29 = function() {return "attendee"}; + var peg$f30 = function() { return "expenseType"; }; + var peg$f31 = function() { return "receiptType"; }; + var peg$f32 = function() { return "transactionStatus"; }; + var peg$f33 = function() { return "withdrawalType"; }; + var peg$f34 = function() { return "withdrawalStatus"; }; + var peg$f35 = function() { return "paidStatus"; }; + var peg$f36 = function() { return "withdrawalID"; }; + var peg$f37 = function() { return "billable"; }; + var peg$f38 = function() { return "declined"; }; + var peg$f39 = function() { return "reimbursable"; }; + var peg$f40 = function() { return "type"; }; + var peg$f41 = function() { return "status"; }; + var peg$f42 = function() { return "sortBy"; }; + var peg$f43 = function() { return "sortOrder"; }; + var peg$f44 = function() { return "policyID"; }; + var peg$f45 = function() { return "submitted"; }; + var peg$f46 = function() { return "approved"; }; var peg$f47 = function() { return "anyApproval"; }; - var peg$f48 = function() { return "paid"; }; - var peg$f49 = function() { return "exported"; }; - var peg$f50 = function() { return "posted"; }; - var peg$f51 = function() { return "withdrawn"; }; - var peg$f52 = function() { return "groupBy"; }; - var peg$f53 = function() { return "limit"; }; - var peg$f54 = function() { return "feed"; }; - var peg$f55 = function() { return "title"; }; - var peg$f56 = function() { return "submitterUserID"; }; - var peg$f57 = function() { return "submitterPayrollID"; }; - var peg$f58 = function() { return "orderDealNumbers"; }; - var peg$f59 = function() { return "assignee"; }; - var peg$f60 = function() { return "createdBy"; }; - var peg$f61 = function() { return "action"; }; - var peg$f62 = function() {return "total"; }; - var peg$f63 = function() {return "has"; }; - var peg$f64 = function() {return "is"; }; - var peg$f65 = function() {return "purchaseAmount"}; - var peg$f66 = function() {return "purchaseCurrency"}; - var peg$f67 = function() {return "amountDebited"}; - var peg$f68 = function() {return "amountReimbursed"}; - var peg$f69 = function() { + var peg$f48 = function() { return "anyApproval"; }; + var peg$f49 = function() { return "paid"; }; + var peg$f50 = function() { return "exported"; }; + var peg$f51 = function() { return "posted"; }; + var peg$f52 = function() { return "withdrawn"; }; + var peg$f53 = function() { return "groupBy"; }; + var peg$f54 = function() { return "limit"; }; + var peg$f55 = function() { return "feed"; }; + var peg$f56 = function() { return "title"; }; + var peg$f57 = function() { return "submitterUserID"; }; + var peg$f58 = function() { return "submitterPayrollID"; }; + var peg$f59 = function() { return "orderDealNumbers"; }; + var peg$f60 = function() { return "assignee"; }; + var peg$f61 = function() { return "createdBy"; }; + var peg$f62 = function() { return "action"; }; + var peg$f63 = function() {return "total"; }; + var peg$f64 = function() {return "has"; }; + var peg$f65 = function() {return "is"; }; + var peg$f66 = function() {return "purchaseAmount"}; + var peg$f67 = function() {return "purchaseCurrency"}; + var peg$f68 = function() {return "amountDebited"}; + var peg$f69 = function() {return "amountReimbursed"}; + var peg$f70 = function() { isColumnsContext = true; return "columns"; }; - var peg$f70 = function() {return "view"}; - var peg$f71 = function() {return "compare"}; - var peg$f72 = function() { return isColumnsContext; }; - var peg$f73 = function() { return "perDiem"; }; - var peg$f74 = function() { return "drafts"; }; - var peg$f75 = function() { return "originalamount"; }; - var peg$f76 = function() { return "taxAmount"; }; - var peg$f77 = function() { return "taxrate"; }; - var peg$f78 = function() { return "policyname"; }; - var peg$f79 = function() { return "withdrawalID"; }; - var peg$f80 = function() { return "bankAccount"; }; - var peg$f81 = function() { return "reportID"; }; - var peg$f82 = function() { return "base62ReportID"; }; - var peg$f83 = function() { return "exportedto"; }; - var peg$f84 = function() { return "exportedTo"; }; + var peg$f71 = function() {return "view"}; + var peg$f72 = function() {return "compare"}; + var peg$f73 = function() { return isColumnsContext; }; + var peg$f74 = function() { return "perDiem"; }; + var peg$f75 = function() { return "drafts"; }; + var peg$f76 = function() { return "originalamount"; }; + var peg$f77 = function() { return "taxAmount"; }; + var peg$f78 = function() { return "taxrate"; }; + var peg$f79 = function() { return "policyname"; }; + var peg$f80 = function() { return "withdrawalID"; }; + var peg$f81 = function() { return "bankAccount"; }; + var peg$f82 = function() { return "reportID"; }; + var peg$f83 = function() { return "base62ReportID"; }; + var peg$f84 = function() { return "exportedto"; }; var peg$f85 = function() { return "exportedTo"; }; - var peg$f86 = function() { return "exchangeRate"; }; - var peg$f87 = function() { return "reimbursableTotal"; }; - var peg$f88 = function() { return "nonReimbursableTotal"; }; - var peg$f89 = function() { return "groupFrom"; }; - var peg$f90 = function() { return "groupExpenses"; }; - var peg$f91 = function() { return "groupTotal"; }; - var peg$f92 = function() { return "groupCard"; }; - var peg$f93 = function() { return "groupFeed"; }; - var peg$f94 = function() { return "groupBankAccount"; }; - var peg$f95 = function() { return "groupWithdrawn"; }; - var peg$f96 = function() { return "groupWithdrawalID"; }; - var peg$f97 = function() { return "groupAmountDebited"; }; - var peg$f98 = function() { return "groupAmountReimbursed"; }; - var peg$f99 = function() { return "amountDebited"; }; - var peg$f100 = function() { return "amountReimbursed"; }; - var peg$f101 = function() { return "groupCategory"; }; - var peg$f102 = function() { return "groupTag"; }; - var peg$f103 = function() { return "groupMerchant"; }; - var peg$f104 = function() { return "groupday"; }; - var peg$f105 = function() { return "groupmonth"; }; - var peg$f106 = function() { return "groupweek"; }; - var peg$f107 = function() { return "groupyear"; }; - var peg$f108 = function() { return "groupquarter"; }; - var peg$f109 = function() { return "contains"; }; - var peg$f110 = function() { return "eq"; }; - var peg$f111 = function() { return "neq"; }; - var peg$f112 = function() { return "gte"; }; - var peg$f113 = function() { return "gt"; }; - var peg$f114 = function() { return "lte"; }; - var peg$f115 = function() { return "lt"; }; - var peg$f116 = function(o) { + var peg$f86 = function() { return "exportedTo"; }; + var peg$f87 = function() { return "exchangeRate"; }; + var peg$f88 = function() { return "reimbursableTotal"; }; + var peg$f89 = function() { return "nonReimbursableTotal"; }; + var peg$f90 = function() { return "groupFrom"; }; + var peg$f91 = function() { return "groupExpenses"; }; + var peg$f92 = function() { return "groupTotal"; }; + var peg$f93 = function() { return "groupCard"; }; + var peg$f94 = function() { return "groupFeed"; }; + var peg$f95 = function() { return "groupBankAccount"; }; + var peg$f96 = function() { return "groupWithdrawn"; }; + var peg$f97 = function() { return "groupWithdrawalID"; }; + var peg$f98 = function() { return "groupAmountDebited"; }; + var peg$f99 = function() { return "groupAmountReimbursed"; }; + var peg$f100 = function() { return "amountDebited"; }; + var peg$f101 = function() { return "amountReimbursed"; }; + var peg$f102 = function() { return "groupCategory"; }; + var peg$f103 = function() { return "groupTag"; }; + var peg$f104 = function() { return "groupMerchant"; }; + var peg$f105 = function() { return "groupday"; }; + var peg$f106 = function() { return "groupmonth"; }; + var peg$f107 = function() { return "groupweek"; }; + var peg$f108 = function() { return "groupyear"; }; + var peg$f109 = function() { return "groupquarter"; }; + var peg$f110 = function() { return "contains"; }; + var peg$f111 = function() { return "eq"; }; + var peg$f112 = function() { return "neq"; }; + var peg$f113 = function() { return "gte"; }; + var peg$f114 = function() { return "gt"; }; + var peg$f115 = function() { return "lte"; }; + var peg$f116 = function() { return "lt"; }; + var peg$f117 = function(o) { if (nameOperator) { expectingNestedQuote = (o === "eq" || o === "contains"); } isColumnsContext = false; return o; }; - var peg$f117 = function(c) { return c; }; - var peg$f118 = function(chars) { return chars.join("").trim(); }; - var peg$f119 = function() { + var peg$f118 = function(c) { return c; }; + var peg$f119 = function(chars) { return chars.join("").trim(); }; + var peg$f120 = function() { isColumnsContext = false; return "and"; }; - var peg$f120 = function() { return expectingNestedQuote; }; - var peg$f121 = function(start, inner, end) { //handle no-breaking space + var peg$f121 = function() { return expectingNestedQuote; }; + var peg$f122 = function(start, inner, end) { //handle no-breaking space return [...start, '"', ...inner, '"', ...end].join(""); }; - var peg$f122 = function(start) {return "“"}; - var peg$f123 = function(start) {return "”"}; - var peg$f124 = function(start) {return "\""}; - var peg$f125 = function(start, inner, end) { + var peg$f123 = function(start) {return "“"}; + var peg$f124 = function(start) {return "”"}; + var peg$f125 = function(start) {return "\""}; + var peg$f126 = function(start, inner, end) { return [...start, '"', ...inner, '"'].join(""); }; - var peg$f126 = function() { return "footerCount"; }; - var peg$f127 = function() { return "footerCurrency"; }; - var peg$f128 = function() { return "footerTotal"; }; + var peg$f127 = function() { return "footerCount"; }; + var peg$f128 = function() { return "footerCurrency"; }; + var peg$f129 = function() { return "footerTotal"; }; var peg$currPos = options.peg$currPos | 0; var peg$savedPos = peg$currPos; var peg$posDetailsCache = [{ line: 1, column: 1 }]; @@ -1261,95 +1264,98 @@ function peg$parse(input, options) { if (s1 === peg$FAILED) { s1 = peg$parsecategory(); if (s1 === peg$FAILED) { - s1 = peg$parseto(); + s1 = peg$parsevendor(); if (s1 === peg$FAILED) { - s1 = peg$parsetaxRate(); + s1 = peg$parseto(); if (s1 === peg$FAILED) { - s1 = peg$parsecardID(); + s1 = peg$parsetaxRate(); if (s1 === peg$FAILED) { - s1 = peg$parsebankAccount(); + s1 = peg$parsecardID(); if (s1 === peg$FAILED) { - s1 = peg$parsefrom(); + s1 = peg$parsebankAccount(); if (s1 === peg$FAILED) { - s1 = peg$parseattendee(); + s1 = peg$parsefrom(); if (s1 === peg$FAILED) { - s1 = peg$parsepayer(); + s1 = peg$parseattendee(); if (s1 === peg$FAILED) { - s1 = peg$parsepaidBy(); + s1 = peg$parsepayer(); if (s1 === peg$FAILED) { - s1 = peg$parseexporter(); + s1 = peg$parsepaidBy(); if (s1 === peg$FAILED) { - s1 = peg$parseexpenseType(); + s1 = peg$parseexporter(); if (s1 === peg$FAILED) { - s1 = peg$parsereceiptType(); + s1 = peg$parseexpenseType(); if (s1 === peg$FAILED) { - s1 = peg$parsetransactionStatus(); + s1 = peg$parsereceiptType(); if (s1 === peg$FAILED) { - s1 = peg$parsewithdrawalType(); + s1 = peg$parsetransactionStatus(); if (s1 === peg$FAILED) { - s1 = peg$parsewithdrawalStatus(); + s1 = peg$parsewithdrawalType(); if (s1 === peg$FAILED) { - s1 = peg$parsepaidStatus(); + s1 = peg$parsewithdrawalStatus(); if (s1 === peg$FAILED) { - s1 = peg$parsewithdrawalID(); + s1 = peg$parsepaidStatus(); if (s1 === peg$FAILED) { - s1 = peg$parsesubmitted(); + s1 = peg$parsewithdrawalID(); if (s1 === peg$FAILED) { - s1 = peg$parseanyApproval(); + s1 = peg$parsesubmitted(); if (s1 === peg$FAILED) { - s1 = peg$parseapproved(); + s1 = peg$parseanyApproval(); if (s1 === peg$FAILED) { - s1 = peg$parsepaid(); + s1 = peg$parseapproved(); if (s1 === peg$FAILED) { - s1 = peg$parseexportedTo(); + s1 = peg$parsepaid(); if (s1 === peg$FAILED) { - s1 = peg$parseexported(); + s1 = peg$parseexportedTo(); 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$parsesubmitterUserID(); + s1 = peg$parsetitle(); if (s1 === peg$FAILED) { - s1 = peg$parsesubmitterPayrollID(); + s1 = peg$parsesubmitterUserID(); if (s1 === peg$FAILED) { - s1 = peg$parseorderDealNumbers(); + s1 = peg$parsesubmitterPayrollID(); if (s1 === peg$FAILED) { - s1 = peg$parseassignee(); + s1 = peg$parseorderDealNumbers(); 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$parsedeclined(); + s1 = peg$parsebillable(); if (s1 === peg$FAILED) { - s1 = peg$parseaction(); + s1 = peg$parsedeclined(); if (s1 === peg$FAILED) { - s1 = peg$parsehas(); + s1 = peg$parseaction(); if (s1 === peg$FAILED) { - s1 = peg$parseis(); + s1 = peg$parsehas(); if (s1 === peg$FAILED) { - s1 = peg$parsepurchaseCurrency(); + s1 = peg$parseis(); if (s1 === peg$FAILED) { - s1 = peg$parsepurchaseAmount(); + s1 = peg$parsepurchaseCurrency(); if (s1 === peg$FAILED) { - s1 = peg$parsepolicyID(); + s1 = peg$parsepurchaseAmount(); if (s1 === peg$FAILED) { - s1 = peg$parsestatus(); + s1 = peg$parsepolicyID(); if (s1 === peg$FAILED) { - s1 = peg$parsefooterCount(); + s1 = peg$parsestatus(); if (s1 === peg$FAILED) { - s1 = peg$parsefooterCurrency(); + s1 = peg$parsefooterCount(); if (s1 === peg$FAILED) { - s1 = peg$parsefooterTotal(); + s1 = peg$parsefooterCurrency(); if (s1 === peg$FAILED) { - s1 = peg$parsereportFieldDynamic(); + s1 = peg$parsefooterTotal(); + if (s1 === peg$FAILED) { + s1 = peg$parsereportFieldDynamic(); + } } } } @@ -1840,13 +1846,13 @@ function peg$parse(input, options) { return s0; } - function peg$parseto() { + function peg$parsevendor() { var s0, s1; s0 = peg$currPos; - s1 = input.substr(peg$currPos, 2); + s1 = input.substr(peg$currPos, 6); if (s1.toLowerCase() === peg$c17) { - peg$currPos += 2; + peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$e22); } @@ -1860,13 +1866,13 @@ function peg$parse(input, options) { return s0; } - function peg$parseexporter() { + function peg$parseto() { var s0, s1; s0 = peg$currPos; - s1 = input.substr(peg$currPos, 8); + s1 = input.substr(peg$currPos, 2); if (s1.toLowerCase() === peg$c18) { - peg$currPos += 8; + peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$e23); } @@ -1880,13 +1886,13 @@ function peg$parse(input, options) { return s0; } - function peg$parsepayer() { + function peg$parseexporter() { var s0, s1; s0 = peg$currPos; - s1 = input.substr(peg$currPos, 5); + s1 = input.substr(peg$currPos, 8); if (s1.toLowerCase() === peg$c19) { - peg$currPos += 5; + peg$currPos += 8; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$e24); } @@ -1900,28 +1906,48 @@ function peg$parse(input, options) { return s0; } + function peg$parsepayer() { + var s0, s1; + + s0 = peg$currPos; + s1 = input.substr(peg$currPos, 5); + if (s1.toLowerCase() === peg$c20) { + peg$currPos += 5; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e25); } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f23(); + } + s0 = s1; + + return s0; + } + function peg$parsepaidBy() { var s0, s1; - if (input.substr(peg$currPos, 6) === peg$c20) { - s0 = peg$c20; + if (input.substr(peg$currPos, 6) === peg$c21) { + s0 = peg$c21; peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e25); } + if (peg$silentFails === 0) { peg$fail(peg$e26); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 7); - if (s1.toLowerCase() === peg$c21) { + if (s1.toLowerCase() === peg$c22) { peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e26); } + if (peg$silentFails === 0) { peg$fail(peg$e27); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f23(); + s1 = peg$f24(); } s0 = s1; } @@ -1933,24 +1959,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 7); - if (s0.toLowerCase() === peg$c22) { + if (s0.toLowerCase() === peg$c23) { peg$currPos += 7; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e27); } + if (peg$silentFails === 0) { peg$fail(peg$e28); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c23) { + if (s1.toLowerCase() === peg$c24) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e28); } + if (peg$silentFails === 0) { peg$fail(peg$e29); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f24(); + s1 = peg$f25(); } s0 = s1; } @@ -1961,25 +1987,25 @@ function peg$parse(input, options) { function peg$parsecardID() { var s0, s1; - if (input.substr(peg$currPos, 6) === peg$c24) { - s0 = peg$c24; + if (input.substr(peg$currPos, 6) === peg$c25) { + s0 = peg$c25; peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e29); } + if (peg$silentFails === 0) { peg$fail(peg$e30); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c25) { + if (s1.toLowerCase() === peg$c26) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e30); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f25(); + s1 = peg$f26(); } s0 = s1; } @@ -1990,25 +2016,25 @@ function peg$parse(input, options) { function peg$parsebankAccount() { var s0, s1; - if (input.substr(peg$currPos, 11) === peg$c26) { - s0 = peg$c26; + if (input.substr(peg$currPos, 11) === peg$c27) { + s0 = peg$c27; peg$currPos += 11; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e31); } + if (peg$silentFails === 0) { peg$fail(peg$e32); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c27) { + if (s1.toLowerCase() === peg$c28) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e32); } + if (peg$silentFails === 0) { peg$fail(peg$e33); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f26(); + s1 = peg$f27(); } s0 = s1; } @@ -2021,15 +2047,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c28) { + if (s1.toLowerCase() === peg$c29) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e33); } + if (peg$silentFails === 0) { peg$fail(peg$e34); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f27(); + s1 = peg$f28(); } s0 = s1; @@ -2041,15 +2067,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c29) { + if (s1.toLowerCase() === peg$c30) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e34); } + if (peg$silentFails === 0) { peg$fail(peg$e35); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f28(); + s1 = peg$f29(); } s0 = s1; @@ -2059,25 +2085,25 @@ function peg$parse(input, options) { function peg$parseexpenseType() { var s0, s1; - if (input.substr(peg$currPos, 11) === peg$c30) { - s0 = peg$c30; + if (input.substr(peg$currPos, 11) === peg$c31) { + s0 = peg$c31; peg$currPos += 11; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e35); } + if (peg$silentFails === 0) { peg$fail(peg$e36); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c31) { + if (s1.toLowerCase() === peg$c32) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e36); } + if (peg$silentFails === 0) { peg$fail(peg$e37); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f29(); + s1 = peg$f30(); } s0 = s1; } @@ -2088,25 +2114,25 @@ function peg$parse(input, options) { function peg$parsereceiptType() { var s0, s1; - if (input.substr(peg$currPos, 11) === peg$c32) { - s0 = peg$c32; + if (input.substr(peg$currPos, 11) === peg$c33) { + s0 = peg$c33; peg$currPos += 11; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } + if (peg$silentFails === 0) { peg$fail(peg$e38); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c33) { + if (s1.toLowerCase() === peg$c34) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e38); } + if (peg$silentFails === 0) { peg$fail(peg$e39); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f30(); + s1 = peg$f31(); } s0 = s1; } @@ -2117,25 +2143,25 @@ function peg$parse(input, options) { function peg$parsetransactionStatus() { var s0, s1; - if (input.substr(peg$currPos, 17) === peg$c34) { - s0 = peg$c34; + if (input.substr(peg$currPos, 17) === peg$c35) { + s0 = peg$c35; peg$currPos += 17; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e39); } + if (peg$silentFails === 0) { peg$fail(peg$e40); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 18); - if (s1.toLowerCase() === peg$c35) { + if (s1.toLowerCase() === peg$c36) { peg$currPos += 18; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e40); } + if (peg$silentFails === 0) { peg$fail(peg$e41); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f31(); + s1 = peg$f32(); } s0 = s1; } @@ -2146,25 +2172,25 @@ function peg$parse(input, options) { function peg$parsewithdrawalType() { var s0, s1; - if (input.substr(peg$currPos, 14) === peg$c36) { - s0 = peg$c36; + if (input.substr(peg$currPos, 14) === peg$c37) { + s0 = peg$c37; peg$currPos += 14; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e41); } + if (peg$silentFails === 0) { peg$fail(peg$e42); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c37) { + if (s1.toLowerCase() === peg$c38) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e42); } + if (peg$silentFails === 0) { peg$fail(peg$e43); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f32(); + s1 = peg$f33(); } s0 = s1; } @@ -2175,25 +2201,25 @@ function peg$parse(input, options) { function peg$parsewithdrawalStatus() { var s0, s1; - if (input.substr(peg$currPos, 16) === peg$c38) { - s0 = peg$c38; + if (input.substr(peg$currPos, 16) === peg$c39) { + s0 = peg$c39; peg$currPos += 16; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e43); } + if (peg$silentFails === 0) { peg$fail(peg$e44); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 17); - if (s1.toLowerCase() === peg$c39) { + if (s1.toLowerCase() === peg$c40) { peg$currPos += 17; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e44); } + if (peg$silentFails === 0) { peg$fail(peg$e45); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f33(); + s1 = peg$f34(); } s0 = s1; } @@ -2204,25 +2230,25 @@ function peg$parse(input, options) { function peg$parsepaidStatus() { var s0, s1; - if (input.substr(peg$currPos, 10) === peg$c40) { - s0 = peg$c40; + if (input.substr(peg$currPos, 10) === peg$c41) { + s0 = peg$c41; peg$currPos += 10; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e45); } + if (peg$silentFails === 0) { peg$fail(peg$e46); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c41) { + if (s1.toLowerCase() === peg$c42) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e46); } + if (peg$silentFails === 0) { peg$fail(peg$e47); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f34(); + s1 = peg$f35(); } s0 = s1; } @@ -2234,24 +2260,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 12); - if (s0.toLowerCase() === peg$c42) { + if (s0.toLowerCase() === peg$c43) { peg$currPos += 12; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e47); } + if (peg$silentFails === 0) { peg$fail(peg$e48); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 13); - if (s1.toLowerCase() === peg$c43) { + if (s1.toLowerCase() === peg$c44) { peg$currPos += 13; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e48); } + if (peg$silentFails === 0) { peg$fail(peg$e49); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f35(); + s1 = peg$f36(); } s0 = s1; } @@ -2264,15 +2290,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c44) { + if (s1.toLowerCase() === peg$c45) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e49); } + if (peg$silentFails === 0) { peg$fail(peg$e50); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f36(); + s1 = peg$f37(); } s0 = s1; @@ -2284,15 +2310,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c45) { + if (s1.toLowerCase() === peg$c46) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e50); } + if (peg$silentFails === 0) { peg$fail(peg$e51); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f37(); + s1 = peg$f38(); } s0 = s1; @@ -2304,15 +2330,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c46) { + if (s1.toLowerCase() === peg$c47) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e51); } + if (peg$silentFails === 0) { peg$fail(peg$e52); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f38(); + s1 = peg$f39(); } s0 = s1; @@ -2324,15 +2350,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c47) { + if (s1.toLowerCase() === peg$c48) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e52); } + if (peg$silentFails === 0) { peg$fail(peg$e53); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f39(); + s1 = peg$f40(); } s0 = s1; @@ -2344,15 +2370,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c48) { + if (s1.toLowerCase() === peg$c49) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e53); } + if (peg$silentFails === 0) { peg$fail(peg$e54); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f40(); + s1 = peg$f41(); } s0 = s1; @@ -2362,25 +2388,25 @@ function peg$parse(input, options) { function peg$parsesortBy() { var s0, s1; - if (input.substr(peg$currPos, 6) === peg$c49) { - s0 = peg$c49; + if (input.substr(peg$currPos, 6) === peg$c50) { + s0 = peg$c50; peg$currPos += 6; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e54); } + if (peg$silentFails === 0) { peg$fail(peg$e55); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 7); - if (s1.toLowerCase() === peg$c50) { + if (s1.toLowerCase() === peg$c51) { peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e55); } + if (peg$silentFails === 0) { peg$fail(peg$e56); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f41(); + s1 = peg$f42(); } s0 = s1; } @@ -2391,25 +2417,25 @@ function peg$parse(input, options) { function peg$parsesortOrder() { var s0, s1; - if (input.substr(peg$currPos, 9) === peg$c51) { - s0 = peg$c51; + if (input.substr(peg$currPos, 9) === peg$c52) { + s0 = peg$c52; peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e56); } + if (peg$silentFails === 0) { peg$fail(peg$e57); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c52) { + if (s1.toLowerCase() === peg$c53) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e57); } + if (peg$silentFails === 0) { peg$fail(peg$e58); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f42(); + s1 = peg$f43(); } s0 = s1; } @@ -2420,25 +2446,25 @@ function peg$parse(input, options) { function peg$parsepolicyID() { var s0, s1; - if (input.substr(peg$currPos, 8) === peg$c53) { - s0 = peg$c53; + if (input.substr(peg$currPos, 8) === peg$c54) { + s0 = peg$c54; peg$currPos += 8; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e58); } + if (peg$silentFails === 0) { peg$fail(peg$e59); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c54) { + if (s1.toLowerCase() === peg$c55) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e59); } + if (peg$silentFails === 0) { peg$fail(peg$e60); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f43(); + s1 = peg$f44(); } s0 = s1; } @@ -2451,15 +2477,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c55) { + if (s1.toLowerCase() === peg$c56) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e60); } + if (peg$silentFails === 0) { peg$fail(peg$e61); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f44(); + s1 = peg$f45(); } s0 = s1; @@ -2471,15 +2497,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c56) { + if (s1.toLowerCase() === peg$c57) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e61); } + if (peg$silentFails === 0) { peg$fail(peg$e62); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f45(); + s1 = peg$f46(); } s0 = s1; @@ -2491,29 +2517,29 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c57) { + if (s1.toLowerCase() === peg$c58) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e62); } + if (peg$silentFails === 0) { peg$fail(peg$e63); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f46(); + s1 = peg$f47(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c58) { + if (s1.toLowerCase() === peg$c59) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e63); } + if (peg$silentFails === 0) { peg$fail(peg$e64); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f47(); + s1 = peg$f48(); } s0 = s1; } @@ -2526,15 +2552,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c59) { + if (s1.toLowerCase() === peg$c60) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e64); } + if (peg$silentFails === 0) { peg$fail(peg$e65); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f48(); + s1 = peg$f49(); } s0 = s1; @@ -2546,15 +2572,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c60) { + if (s1.toLowerCase() === peg$c61) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e65); } + if (peg$silentFails === 0) { peg$fail(peg$e66); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f49(); + s1 = peg$f50(); } s0 = s1; @@ -2566,15 +2592,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c61) { + if (s1.toLowerCase() === peg$c62) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e66); } + if (peg$silentFails === 0) { peg$fail(peg$e67); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f50(); + s1 = peg$f51(); } s0 = s1; @@ -2586,15 +2612,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c62) { + if (s1.toLowerCase() === peg$c63) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e67); } + if (peg$silentFails === 0) { peg$fail(peg$e68); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f51(); + s1 = peg$f52(); } s0 = s1; @@ -2605,24 +2631,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 7); - if (s0.toLowerCase() === peg$c63) { + if (s0.toLowerCase() === peg$c64) { peg$currPos += 7; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e68); } + if (peg$silentFails === 0) { peg$fail(peg$e69); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c64) { + if (s1.toLowerCase() === peg$c65) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e69); } + if (peg$silentFails === 0) { peg$fail(peg$e70); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f52(); + s1 = peg$f53(); } s0 = s1; } @@ -2635,15 +2661,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 5); - if (s1.toLowerCase() === peg$c65) { + if (s1.toLowerCase() === peg$c66) { peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e70); } + if (peg$silentFails === 0) { peg$fail(peg$e71); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f53(); + s1 = peg$f54(); } s0 = s1; @@ -2655,15 +2681,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c66) { + if (s1.toLowerCase() === peg$c67) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e71); } + if (peg$silentFails === 0) { peg$fail(peg$e72); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f54(); + s1 = peg$f55(); } s0 = s1; @@ -2675,15 +2701,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 5); - if (s1.toLowerCase() === peg$c67) { + if (s1.toLowerCase() === peg$c68) { peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e72); } + if (peg$silentFails === 0) { peg$fail(peg$e73); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f55(); + s1 = peg$f56(); } s0 = s1; @@ -2694,24 +2720,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 15); - if (s0.toLowerCase() === peg$c68) { + if (s0.toLowerCase() === peg$c69) { peg$currPos += 15; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e73); } + if (peg$silentFails === 0) { peg$fail(peg$e74); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 17); - if (s1.toLowerCase() === peg$c69) { + if (s1.toLowerCase() === peg$c70) { peg$currPos += 17; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e74); } + if (peg$silentFails === 0) { peg$fail(peg$e75); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f56(); + s1 = peg$f57(); } s0 = s1; } @@ -2723,24 +2749,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 18); - if (s0.toLowerCase() === peg$c70) { + if (s0.toLowerCase() === peg$c71) { peg$currPos += 18; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e75); } + if (peg$silentFails === 0) { peg$fail(peg$e76); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 20); - if (s1.toLowerCase() === peg$c71) { + if (s1.toLowerCase() === peg$c72) { peg$currPos += 20; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e76); } + if (peg$silentFails === 0) { peg$fail(peg$e77); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f57(); + s1 = peg$f58(); } s0 = s1; } @@ -2752,24 +2778,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 16); - if (s0.toLowerCase() === peg$c72) { + if (s0.toLowerCase() === peg$c73) { peg$currPos += 16; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e77); } + if (peg$silentFails === 0) { peg$fail(peg$e78); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 18); - if (s1.toLowerCase() === peg$c73) { + if (s1.toLowerCase() === peg$c74) { peg$currPos += 18; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e78); } + if (peg$silentFails === 0) { peg$fail(peg$e79); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f58(); + s1 = peg$f59(); } s0 = s1; } @@ -2782,15 +2808,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c74) { + if (s1.toLowerCase() === peg$c75) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e79); } + if (peg$silentFails === 0) { peg$fail(peg$e80); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f59(); + s1 = peg$f60(); } s0 = s1; @@ -2801,24 +2827,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 9); - if (s0.toLowerCase() === peg$c75) { + if (s0.toLowerCase() === peg$c76) { peg$currPos += 9; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e80); } + if (peg$silentFails === 0) { peg$fail(peg$e81); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c76) { + if (s1.toLowerCase() === peg$c77) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e81); } + if (peg$silentFails === 0) { peg$fail(peg$e82); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f60(); + s1 = peg$f61(); } s0 = s1; } @@ -2831,15 +2857,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c77) { + if (s1.toLowerCase() === peg$c78) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e82); } + if (peg$silentFails === 0) { peg$fail(peg$e83); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f61(); + s1 = peg$f62(); } s0 = s1; @@ -2851,15 +2877,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 5); - if (s1.toLowerCase() === peg$c78) { + if (s1.toLowerCase() === peg$c79) { peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e83); } + if (peg$silentFails === 0) { peg$fail(peg$e84); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f62(); + s1 = peg$f63(); } s0 = s1; @@ -2871,15 +2897,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 3); - if (s1.toLowerCase() === peg$c79) { + if (s1.toLowerCase() === peg$c80) { peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e84); } + if (peg$silentFails === 0) { peg$fail(peg$e85); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f63(); + s1 = peg$f64(); } s0 = s1; @@ -2891,15 +2917,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 2); - if (s1.toLowerCase() === peg$c80) { + if (s1.toLowerCase() === peg$c81) { peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e85); } + if (peg$silentFails === 0) { peg$fail(peg$e86); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f64(); + s1 = peg$f65(); } s0 = s1; @@ -2910,24 +2936,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 14); - if (s0.toLowerCase() === peg$c81) { + if (s0.toLowerCase() === peg$c82) { peg$currPos += 14; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e86); } + if (peg$silentFails === 0) { peg$fail(peg$e87); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c82) { + if (s1.toLowerCase() === peg$c83) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e87); } + if (peg$silentFails === 0) { peg$fail(peg$e88); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f65(); + s1 = peg$f66(); } s0 = s1; } @@ -2939,24 +2965,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 16); - if (s0.toLowerCase() === peg$c83) { + if (s0.toLowerCase() === peg$c84) { peg$currPos += 16; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e88); } + if (peg$silentFails === 0) { peg$fail(peg$e89); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 17); - if (s1.toLowerCase() === peg$c84) { + if (s1.toLowerCase() === peg$c85) { peg$currPos += 17; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e89); } + if (peg$silentFails === 0) { peg$fail(peg$e90); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f66(); + s1 = peg$f67(); } s0 = s1; } @@ -2968,24 +2994,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 13); - if (s0.toLowerCase() === peg$c85) { + if (s0.toLowerCase() === peg$c86) { peg$currPos += 13; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e90); } + if (peg$silentFails === 0) { peg$fail(peg$e91); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c86) { + if (s1.toLowerCase() === peg$c87) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e91); } + if (peg$silentFails === 0) { peg$fail(peg$e92); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f67(); + s1 = peg$f68(); } s0 = s1; } @@ -2997,24 +3023,24 @@ function peg$parse(input, options) { var s0, s1; s0 = input.substr(peg$currPos, 16); - if (s0.toLowerCase() === peg$c87) { + if (s0.toLowerCase() === peg$c88) { peg$currPos += 16; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e92); } + if (peg$silentFails === 0) { peg$fail(peg$e93); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 17); - if (s1.toLowerCase() === peg$c88) { + if (s1.toLowerCase() === peg$c89) { peg$currPos += 17; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e93); } + if (peg$silentFails === 0) { peg$fail(peg$e94); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f68(); + s1 = peg$f69(); } s0 = s1; } @@ -3027,15 +3053,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 7); - if (s1.toLowerCase() === peg$c89) { + if (s1.toLowerCase() === peg$c90) { peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e94); } + if (peg$silentFails === 0) { peg$fail(peg$e95); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f69(); + s1 = peg$f70(); } s0 = s1; @@ -3047,15 +3073,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 4); - if (s1.toLowerCase() === peg$c90) { + if (s1.toLowerCase() === peg$c91) { peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e95); } + if (peg$silentFails === 0) { peg$fail(peg$e96); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f70(); + s1 = peg$f71(); } s0 = s1; @@ -3067,15 +3093,15 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 7); - if (s1.toLowerCase() === peg$c91) { + if (s1.toLowerCase() === peg$c92) { peg$currPos += 7; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e96); } + if (peg$silentFails === 0) { peg$fail(peg$e97); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f71(); + s1 = peg$f72(); } s0 = s1; @@ -3087,7 +3113,7 @@ function peg$parse(input, options) { s0 = peg$currPos; peg$savedPos = peg$currPos; - s1 = peg$f72(); + s1 = peg$f73(); if (s1) { s1 = undefined; } else { @@ -3222,11 +3248,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c92) { + if (s1.toLowerCase() === peg$c93) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e97); } + if (peg$silentFails === 0) { peg$fail(peg$e98); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3241,7 +3267,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f73(); + s0 = peg$f74(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3259,19 +3285,19 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c93) { + if (s1.toLowerCase() === peg$c94) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e98); } + if (peg$silentFails === 0) { peg$fail(peg$e99); } } if (s1 === peg$FAILED) { s1 = input.substr(peg$currPos, 5); - if (s1.toLowerCase() === peg$c94) { + if (s1.toLowerCase() === peg$c95) { peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e99); } + if (peg$silentFails === 0) { peg$fail(peg$e100); } } } if (s1 !== peg$FAILED) { @@ -3287,7 +3313,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f74(); + s0 = peg$f75(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3305,11 +3331,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c82) { + if (s1.toLowerCase() === peg$c83) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e87); } + if (peg$silentFails === 0) { peg$fail(peg$e88); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3324,7 +3350,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f75(); + s0 = peg$f76(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3342,11 +3368,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 3); - if (s1.toLowerCase() === peg$c95) { + if (s1.toLowerCase() === peg$c96) { peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e100); } + if (peg$silentFails === 0) { peg$fail(peg$e101); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3361,7 +3387,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f76(); + s0 = peg$f77(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3379,11 +3405,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c23) { + if (s1.toLowerCase() === peg$c24) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e28); } + if (peg$silentFails === 0) { peg$fail(peg$e29); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3398,7 +3424,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f77(); + s0 = peg$f78(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3416,11 +3442,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c96) { + if (s1.toLowerCase() === peg$c97) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e101); } + if (peg$silentFails === 0) { peg$fail(peg$e102); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3435,7 +3461,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f78(); + s0 = peg$f79(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3453,11 +3479,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 13); - if (s1.toLowerCase() === peg$c43) { + if (s1.toLowerCase() === peg$c44) { peg$currPos += 13; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e48); } + if (peg$silentFails === 0) { peg$fail(peg$e49); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3472,7 +3498,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f79(); + s0 = peg$f80(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3490,11 +3516,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c27) { + if (s1.toLowerCase() === peg$c28) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e32); } + if (peg$silentFails === 0) { peg$fail(peg$e33); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3509,7 +3535,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f80(); + s0 = peg$f81(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3527,11 +3553,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c97) { + if (s1.toLowerCase() === peg$c98) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e102); } + if (peg$silentFails === 0) { peg$fail(peg$e103); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3546,7 +3572,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f81(); + s0 = peg$f82(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3583,7 +3609,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f82(); + s0 = peg$f83(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3601,11 +3627,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c98) { + if (s1.toLowerCase() === peg$c99) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e103); } + if (peg$silentFails === 0) { peg$fail(peg$e104); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3620,7 +3646,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f83(); + s0 = peg$f84(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3645,7 +3671,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e104); } + if (peg$silentFails === 0) { peg$fail(peg$e105); } } if (s2 !== peg$FAILED) { s1 = [s1, s2]; @@ -3664,11 +3690,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c99) { + if (s1.toLowerCase() === peg$c100) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e105); } + if (peg$silentFails === 0) { peg$fail(peg$e106); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3683,7 +3709,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f84(); + s0 = peg$f85(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3695,11 +3721,11 @@ function peg$parse(input, options) { if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c98) { + if (s1.toLowerCase() === peg$c99) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e103); } + if (peg$silentFails === 0) { peg$fail(peg$e104); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3714,7 +3740,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f85(); + s0 = peg$f86(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3733,11 +3759,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 13); - if (s1.toLowerCase() === peg$c100) { + if (s1.toLowerCase() === peg$c101) { peg$currPos += 13; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e106); } + if (peg$silentFails === 0) { peg$fail(peg$e107); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3752,7 +3778,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f86(); + s0 = peg$f87(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3770,11 +3796,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 18); - if (s1.toLowerCase() === peg$c101) { + if (s1.toLowerCase() === peg$c102) { peg$currPos += 18; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e107); } + if (peg$silentFails === 0) { peg$fail(peg$e108); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3789,7 +3815,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f87(); + s0 = peg$f88(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3807,11 +3833,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 22); - if (s1.toLowerCase() === peg$c102) { + if (s1.toLowerCase() === peg$c103) { peg$currPos += 22; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e108); } + if (peg$silentFails === 0) { peg$fail(peg$e109); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3826,7 +3852,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f88(); + s0 = peg$f89(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3844,11 +3870,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c103) { + if (s1.toLowerCase() === peg$c104) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e109); } + if (peg$silentFails === 0) { peg$fail(peg$e110); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3863,7 +3889,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f89(); + s0 = peg$f90(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3881,11 +3907,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c104) { + if (s1.toLowerCase() === peg$c105) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e110); } + if (peg$silentFails === 0) { peg$fail(peg$e111); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3900,7 +3926,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f90(); + s0 = peg$f91(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3918,11 +3944,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c105) { + if (s1.toLowerCase() === peg$c106) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e111); } + if (peg$silentFails === 0) { peg$fail(peg$e112); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3937,7 +3963,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f91(); + s0 = peg$f92(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3955,11 +3981,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c106) { + if (s1.toLowerCase() === peg$c107) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e112); } + if (peg$silentFails === 0) { peg$fail(peg$e113); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3974,7 +4000,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f92(); + s0 = peg$f93(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3992,11 +4018,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c107) { + if (s1.toLowerCase() === peg$c108) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e113); } + if (peg$silentFails === 0) { peg$fail(peg$e114); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4011,7 +4037,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f93(); + s0 = peg$f94(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4029,11 +4055,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 18); - if (s1.toLowerCase() === peg$c108) { + if (s1.toLowerCase() === peg$c109) { peg$currPos += 18; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e114); } + if (peg$silentFails === 0) { peg$fail(peg$e115); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4048,7 +4074,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f94(); + s0 = peg$f95(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4066,11 +4092,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c109) { + if (s1.toLowerCase() === peg$c110) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e115); } + if (peg$silentFails === 0) { peg$fail(peg$e116); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4085,7 +4111,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f95(); + s0 = peg$f96(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4103,11 +4129,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 19); - if (s1.toLowerCase() === peg$c110) { + if (s1.toLowerCase() === peg$c111) { peg$currPos += 19; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e116); } + if (peg$silentFails === 0) { peg$fail(peg$e117); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4122,7 +4148,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f96(); + s0 = peg$f97(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4140,11 +4166,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 20); - if (s1.toLowerCase() === peg$c111) { + if (s1.toLowerCase() === peg$c112) { peg$currPos += 20; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e117); } + if (peg$silentFails === 0) { peg$fail(peg$e118); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4159,7 +4185,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f97(); + s0 = peg$f98(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4177,11 +4203,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 23); - if (s1.toLowerCase() === peg$c112) { + if (s1.toLowerCase() === peg$c113) { peg$currPos += 23; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e118); } + if (peg$silentFails === 0) { peg$fail(peg$e119); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4196,7 +4222,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f98(); + s0 = peg$f99(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4214,11 +4240,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c86) { + if (s1.toLowerCase() === peg$c87) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e91); } + if (peg$silentFails === 0) { peg$fail(peg$e92); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4233,7 +4259,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f99(); + s0 = peg$f100(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4251,11 +4277,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 17); - if (s1.toLowerCase() === peg$c88) { + if (s1.toLowerCase() === peg$c89) { peg$currPos += 17; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e93); } + if (peg$silentFails === 0) { peg$fail(peg$e94); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4270,7 +4296,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f100(); + s0 = peg$f101(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4288,11 +4314,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c113) { + if (s1.toLowerCase() === peg$c114) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e119); } + if (peg$silentFails === 0) { peg$fail(peg$e120); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4307,7 +4333,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f101(); + s0 = peg$f102(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4325,11 +4351,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c114) { + if (s1.toLowerCase() === peg$c115) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e120); } + if (peg$silentFails === 0) { peg$fail(peg$e121); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4344,7 +4370,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f102(); + s0 = peg$f103(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4362,11 +4388,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c115) { + if (s1.toLowerCase() === peg$c116) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e121); } + if (peg$silentFails === 0) { peg$fail(peg$e122); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4381,7 +4407,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f103(); + s0 = peg$f104(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4399,11 +4425,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 9); - if (s1.toLowerCase() === peg$c116) { + if (s1.toLowerCase() === peg$c117) { peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e122); } + if (peg$silentFails === 0) { peg$fail(peg$e123); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4418,7 +4444,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f104(); + s0 = peg$f105(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4436,11 +4462,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c117) { + if (s1.toLowerCase() === peg$c118) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e123); } + if (peg$silentFails === 0) { peg$fail(peg$e124); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4455,7 +4481,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f105(); + s0 = peg$f106(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4473,11 +4499,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c118) { + if (s1.toLowerCase() === peg$c119) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e124); } + if (peg$silentFails === 0) { peg$fail(peg$e125); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4492,7 +4518,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f106(); + s0 = peg$f107(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4510,11 +4536,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c119) { + if (s1.toLowerCase() === peg$c120) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e125); } + if (peg$silentFails === 0) { peg$fail(peg$e126); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4529,7 +4555,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f107(); + s0 = peg$f108(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4547,11 +4573,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 13); - if (s1.toLowerCase() === peg$c120) { + if (s1.toLowerCase() === peg$c121) { peg$currPos += 13; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e126); } + if (peg$silentFails === 0) { peg$fail(peg$e127); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -4566,7 +4592,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f108(); + s0 = peg$f109(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4584,16 +4610,16 @@ function peg$parse(input, options) { peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c121) { - s1 = peg$c121; + if (input.substr(peg$currPos, 2) === peg$c122) { + s1 = peg$c122; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e128); } + if (peg$silentFails === 0) { peg$fail(peg$e129); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f109(); + s1 = peg$f110(); } s0 = s1; if (s0 === peg$FAILED) { @@ -4603,81 +4629,81 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e104); } + if (peg$silentFails === 0) { peg$fail(peg$e105); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f110(); + s1 = peg$f111(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c122) { - s1 = peg$c122; + if (input.substr(peg$currPos, 2) === peg$c123) { + s1 = peg$c123; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e129); } + if (peg$silentFails === 0) { peg$fail(peg$e130); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f111(); + s1 = peg$f112(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c123) { - s1 = peg$c123; + if (input.substr(peg$currPos, 2) === peg$c124) { + s1 = peg$c124; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e130); } + if (peg$silentFails === 0) { peg$fail(peg$e131); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f112(); + s1 = peg$f113(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 62) { - s1 = peg$c124; + s1 = peg$c125; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e131); } + if (peg$silentFails === 0) { peg$fail(peg$e132); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f113(); + s1 = peg$f114(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c125) { - s1 = peg$c125; + if (input.substr(peg$currPos, 2) === peg$c126) { + s1 = peg$c126; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e132); } + if (peg$silentFails === 0) { peg$fail(peg$e133); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f114(); + s1 = peg$f115(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 60) { - s1 = peg$c126; + s1 = peg$c127; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e133); } + if (peg$silentFails === 0) { peg$fail(peg$e134); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f115(); + s1 = peg$f116(); } s0 = s1; } @@ -4689,7 +4715,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e127); } + if (peg$silentFails === 0) { peg$fail(peg$e128); } } return s0; @@ -4702,7 +4728,7 @@ function peg$parse(input, options) { s1 = peg$parseoperator(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f116(s1); + s1 = peg$f117(s1); } s0 = s1; @@ -4714,11 +4740,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c127; + s1 = peg$c128; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e134); } + if (peg$silentFails === 0) { peg$fail(peg$e135); } } if (s1 !== peg$FAILED) { s2 = input.charAt(peg$currPos); @@ -4726,11 +4752,11 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e135); } + if (peg$silentFails === 0) { peg$fail(peg$e136); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f117(s2); + s0 = peg$f118(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4756,7 +4782,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e137); } + if (peg$silentFails === 0) { peg$fail(peg$e138); } } } if (s2 !== peg$FAILED) { @@ -4769,7 +4795,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e137); } + if (peg$silentFails === 0) { peg$fail(peg$e138); } } } } @@ -4778,13 +4804,13 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f118(s1); + s1 = peg$f119(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e136); } + if (peg$silentFails === 0) { peg$fail(peg$e137); } } return s0; @@ -4796,7 +4822,7 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parse_(); peg$savedPos = s0; - s1 = peg$f119(); + s1 = peg$f120(); s0 = s1; return s0; @@ -4812,7 +4838,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e139); } + if (peg$silentFails === 0) { peg$fail(peg$e140); } } while (s1 !== peg$FAILED) { s0.push(s1); @@ -4821,12 +4847,12 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e139); } + if (peg$silentFails === 0) { peg$fail(peg$e140); } } } peg$silentFails--; s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e138); } + if (peg$silentFails === 0) { peg$fail(peg$e139); } return s0; } @@ -4836,7 +4862,7 @@ function peg$parse(input, options) { s0 = peg$currPos; peg$savedPos = peg$currPos; - s1 = peg$f120(); + s1 = peg$f121(); if (s1) { s1 = undefined; } else { @@ -4873,7 +4899,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e141); } + if (peg$silentFails === 0) { peg$fail(peg$e142); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -4882,7 +4908,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e141); } + if (peg$silentFails === 0) { peg$fail(peg$e142); } } } s2 = input.charAt(peg$currPos); @@ -4890,7 +4916,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e142); } + if (peg$silentFails === 0) { peg$fail(peg$e143); } } if (s2 !== peg$FAILED) { s3 = []; @@ -4901,7 +4927,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e143); } + if (peg$silentFails === 0) { peg$fail(peg$e144); } } } while (s4 !== peg$FAILED) { @@ -4913,7 +4939,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e143); } + if (peg$silentFails === 0) { peg$fail(peg$e144); } } } } @@ -4922,7 +4948,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e142); } + if (peg$silentFails === 0) { peg$fail(peg$e143); } } if (s4 !== peg$FAILED) { s5 = []; @@ -4931,7 +4957,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e137); } + if (peg$silentFails === 0) { peg$fail(peg$e138); } } while (s6 !== peg$FAILED) { s5.push(s6); @@ -4940,11 +4966,11 @@ function peg$parse(input, options) { peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e137); } + if (peg$silentFails === 0) { peg$fail(peg$e138); } } } peg$savedPos = s0; - s0 = peg$f121(s1, s3, s5); + s0 = peg$f122(s1, s3, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -4956,7 +4982,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e140); } + if (peg$silentFails === 0) { peg$fail(peg$e141); } } return s0; @@ -4973,7 +4999,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e141); } + if (peg$silentFails === 0) { peg$fail(peg$e142); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -4982,7 +5008,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e141); } + if (peg$silentFails === 0) { peg$fail(peg$e142); } } } s2 = input.charAt(peg$currPos); @@ -4990,7 +5016,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e142); } + if (peg$silentFails === 0) { peg$fail(peg$e143); } } if (s2 !== peg$FAILED) { s3 = []; @@ -5001,7 +5027,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e143); } + if (peg$silentFails === 0) { peg$fail(peg$e144); } } if (s4 === peg$FAILED) { s4 = peg$currPos; @@ -5017,15 +5043,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8220) { - s6 = peg$c128; + s6 = peg$c129; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e144); } + if (peg$silentFails === 0) { peg$fail(peg$e145); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f122(s1); + s4 = peg$f123(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -5048,15 +5074,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8221) { - s6 = peg$c129; + s6 = peg$c130; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e145); } + if (peg$silentFails === 0) { peg$fail(peg$e146); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f123(s1); + s4 = peg$f124(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -5079,15 +5105,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s6 = peg$c130; + s6 = peg$c131; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e146); } + if (peg$silentFails === 0) { peg$fail(peg$e147); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f124(s1); + s4 = peg$f125(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -5109,7 +5135,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e143); } + if (peg$silentFails === 0) { peg$fail(peg$e144); } } if (s4 === peg$FAILED) { s4 = peg$currPos; @@ -5125,15 +5151,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8220) { - s6 = peg$c128; + s6 = peg$c129; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e144); } + if (peg$silentFails === 0) { peg$fail(peg$e145); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f122(s1); + s4 = peg$f123(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -5156,15 +5182,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8221) { - s6 = peg$c129; + s6 = peg$c130; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e145); } + if (peg$silentFails === 0) { peg$fail(peg$e146); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f123(s1); + s4 = peg$f124(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -5187,15 +5213,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s6 = peg$c130; + s6 = peg$c131; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e146); } + if (peg$silentFails === 0) { peg$fail(peg$e147); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f124(s1); + s4 = peg$f125(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -5212,7 +5238,7 @@ function peg$parse(input, options) { s4 = peg$parseclosingQuote(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f125(s1, s3, s4); + s0 = peg$f126(s1, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -5224,7 +5250,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e140); } + if (peg$silentFails === 0) { peg$fail(peg$e141); } } return s0; @@ -5239,7 +5265,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e142); } + if (peg$silentFails === 0) { peg$fail(peg$e143); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -5277,7 +5303,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e147); } + if (peg$silentFails === 0) { peg$fail(peg$e148); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -5286,7 +5312,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e147); } + if (peg$silentFails === 0) { peg$fail(peg$e148); } } } s2 = []; @@ -5295,7 +5321,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e148); } + if (peg$silentFails === 0) { peg$fail(peg$e149); } } while (s3 !== peg$FAILED) { s2.push(s3); @@ -5304,7 +5330,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e148); } + if (peg$silentFails === 0) { peg$fail(peg$e149); } } } s3 = []; @@ -5313,7 +5339,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e149); } + if (peg$silentFails === 0) { peg$fail(peg$e150); } } while (s4 !== peg$FAILED) { s3.push(s4); @@ -5322,7 +5348,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e149); } + if (peg$silentFails === 0) { peg$fail(peg$e150); } } } s4 = peg$parseoperator(); @@ -5341,7 +5367,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e150); } + if (peg$silentFails === 0) { peg$fail(peg$e151); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -5350,7 +5376,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e150); } + if (peg$silentFails === 0) { peg$fail(peg$e151); } } } s2 = peg$currPos; @@ -5397,7 +5423,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e151); } + if (peg$silentFails === 0) { peg$fail(peg$e152); } } } } @@ -5413,7 +5439,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e152); } + if (peg$silentFails === 0) { peg$fail(peg$e153); } } if (s0 === peg$FAILED) { s0 = peg$currPos; @@ -5442,24 +5468,24 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c131) { + if (s1.toLowerCase() === peg$c132) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e153); } + if (peg$silentFails === 0) { peg$fail(peg$e154); } } if (s1 === peg$FAILED) { s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c132) { + if (s1.toLowerCase() === peg$c133) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e154); } + if (peg$silentFails === 0) { peg$fail(peg$e155); } } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f126(); + s1 = peg$f127(); } s0 = s1; @@ -5471,24 +5497,24 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c133) { + if (s1.toLowerCase() === peg$c134) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e155); } + if (peg$silentFails === 0) { peg$fail(peg$e156); } } if (s1 === peg$FAILED) { s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c134) { + if (s1.toLowerCase() === peg$c135) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e156); } + if (peg$silentFails === 0) { peg$fail(peg$e157); } } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f127(); + s1 = peg$f128(); } s0 = s1; @@ -5500,24 +5526,24 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c135) { + if (s1.toLowerCase() === peg$c136) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e157); } + if (peg$silentFails === 0) { peg$fail(peg$e158); } } if (s1 === peg$FAILED) { s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c136) { + if (s1.toLowerCase() === peg$c137) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e158); } + if (peg$silentFails === 0) { peg$fail(peg$e159); } } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f128(); + s1 = peg$f129(); } s0 = s1; diff --git a/src/libs/SearchParser/searchParser.peggy b/src/libs/SearchParser/searchParser.peggy index 75238c3cbcfc..e6aa8f8f3751 100644 --- a/src/libs/SearchParser/searchParser.peggy +++ b/src/libs/SearchParser/searchParser.peggy @@ -289,6 +289,7 @@ key "key" / groupCurrency / tag / category + / vendor / to / taxRate / cardID diff --git a/src/libs/SearchQueryUtils.ts b/src/libs/SearchQueryUtils.ts index d97328d375b5..1a819c81c26c 100644 --- a/src/libs/SearchQueryUtils.ts +++ b/src/libs/SearchQueryUtils.ts @@ -1508,6 +1508,7 @@ function buildQueryStringFromFilterFormValues(filterValues: Partial uniqueCategories.has(name)) .concat(hasEmptyCategoriesInFilter ? [CONST.SEARCH.CATEGORY_EMPTY_VALUE] : []); } + if (filterKey === CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDOR) { + // Vendor names are matched by text on the server and the synced vendor lists load lazily, so the typed values are kept as-is. + filtersForm[addNegation(filterKey, isNegated)] = filterValues; + } if (filterKey === CONST.SEARCH.SYNTAX_FILTER_KEYS.KEYWORD) { filtersForm[filterKey] = filterValues ?.map((filter) => { diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index 3bf74e6abdbb..4f4ce5769db4 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -5745,6 +5745,10 @@ const FILTER_VIEW_MAP = { labelKey: 'common.tag', icon: 'Tag', }, + [CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDOR]: { + labelKey: 'common.vendor', + icon: 'Building', + }, [CONST.SEARCH.SYNTAX_FILTER_KEYS.TAX_RATE]: { labelKey: 'workspace.taxes.taxRate', icon: 'Percent', @@ -5983,6 +5987,13 @@ function getDisplayValue( .join(', '); } + if (key === FILTER_KEYS.VENDOR || key === FILTER_KEYS.VENDOR_NOT) { + return form[key] + ?.sort((a, b) => sortOptionsWithEmptyValue(a, b, localeCompare)) + .map((value) => (value === CONST.SEARCH.VENDOR_EMPTY_VALUE ? translate('search.noVendor') : value)) + .join(', '); + } + if (key === FILTER_KEYS.CURRENCY || key === FILTER_KEYS.CURRENCY_NOT || key === FILTER_KEYS.PURCHASE_CURRENCY || key === FILTER_KEYS.PURCHASE_CURRENCY_NOT) { return form[key]?.sort(localeCompare).join(', '); } diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index 84badc48dd84..2207c8f26cec 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -2723,6 +2723,7 @@ export { handlePreventSearchAPI, openSearchCardFiltersPage, openSearchCategoryFiltersPage, + openSearchVendorFiltersPage, openSearchTagFiltersPage, ALL_POLICY_IDS_KEY, setSearchTagFiltersPagination, diff --git a/src/types/form/SearchAdvancedFiltersForm.ts b/src/types/form/SearchAdvancedFiltersForm.ts index b0744c0c3c8f..714eafe749ad 100644 --- a/src/types/form/SearchAdvancedFiltersForm.ts +++ b/src/types/form/SearchAdvancedFiltersForm.ts @@ -148,6 +148,9 @@ const FILTER_KEYS = { CATEGORY_NOT: 'categoryNot', CATEGORY: 'category', + VENDOR_NOT: 'vendorNot', + VENDOR: 'vendor', + CARD_ID_NOT: 'cardIDNot', CARD_ID: 'cardID', @@ -325,6 +328,8 @@ const ALLOWED_TYPE_FILTERS: Record> = { FILTER_KEYS.CATEGORY_NOT, FILTER_KEYS.TAG, FILTER_KEYS.TAG_NOT, + FILTER_KEYS.VENDOR, + FILTER_KEYS.VENDOR_NOT, FILTER_KEYS.PAYER, FILTER_KEYS.PAYER_NOT, FILTER_KEYS.PAID_BY, @@ -835,6 +840,9 @@ type SearchAdvancedFiltersForm = Form< [FILTER_KEYS.CATEGORY]: string[]; [FILTER_KEYS.CATEGORY_NOT]: string[]; + [FILTER_KEYS.VENDOR]: string[]; + [FILTER_KEYS.VENDOR_NOT]: string[]; + [FILTER_KEYS.POLICY_ID]: string[]; [FILTER_KEYS.POLICY_ID_NOT]: string[]; diff --git a/tests/unit/PolicyUtilsTest.ts b/tests/unit/PolicyUtilsTest.ts index a47b25e292d6..ba3e84f13bd7 100644 --- a/tests/unit/PolicyUtilsTest.ts +++ b/tests/unit/PolicyUtilsTest.ts @@ -22,6 +22,7 @@ import { canUnarchivePolicy, evaluateApprovalWorkflowRule, findVendorByID, + getVendorFeaturePolicyIDs, getVendorDisplayName, hasCompanyAddress, hasReadOnlyAllReportsAccess, @@ -6600,7 +6601,7 @@ describe('PolicyUtils', () => { }); }); - describe('hasVendorFeatureOnAnyPolicy', () => { + describe('hasVendorFeatureOnAnyPolicy and getVendorFeaturePolicyIDs', () => { const qboPolicy: Policy = {...buildQBOPolicy(CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.CREDIT_CARD), id: 'qbo'}; const xeroPolicy: Policy = {...buildXeroPolicy(), id: 'xero'}; const campfirePolicy = createMock({id: 'campfire', connections: {[CONST.POLICY.CONNECTIONS.NAME.CAMPFIRE]: {config: {isConfigured: true}}}}); @@ -6663,6 +6664,19 @@ describe('PolicyUtils', () => { // Then the feature is not available on any workspace because Business Central still depends on the beta expect(isVendorFeatureAvailable).toBe(false); }); + + it('lists the workspaces that have the vendor feature', () => { + // Given QBO, Xero and Business Central workspaces next to one with no accounting connection + const policies = {[qboKey]: qboPolicy, [xeroKey]: xeroPolicy, [businessCentralKey]: businessCentralPolicy, [plainKey]: plainPolicy}; + + // When the workspace IDs are listed with and without the vendorMatching beta + const policyIDsWithBeta = getVendorFeaturePolicyIDs(policies, true); + const policyIDsWithoutBeta = getVendorFeaturePolicyIDs(policies, false); + + // Then every connected workspace is listed with the beta, and Business Central is dropped without it because it still depends on the beta + expect(policyIDsWithBeta.toSorted()).toEqual(['businessCentral', 'qbo', 'xero']); + expect(policyIDsWithoutBeta.toSorted()).toEqual(['qbo', 'xero']); + }); }); describe('getVendorDisplayName', () => { diff --git a/tests/unit/Search/SearchQueryUtilsTest.ts b/tests/unit/Search/SearchQueryUtilsTest.ts index 9e80544b68e4..3159ce5d84a1 100644 --- a/tests/unit/Search/SearchQueryUtilsTest.ts +++ b/tests/unit/Search/SearchQueryUtilsTest.ts @@ -577,6 +577,31 @@ describe('SearchQueryUtils', () => { expect(result).toEqual('type:expense policyID:12345 amount<100'); }); + test('vendor filter value', () => { + const filterValues: Partial = { + type: 'expense', + vendor: ['Acme', 'none'], + }; + + const result = buildQueryStringFromFilterFormValues(filterValues); + + expect(result).toEqual('type:expense vendor:Acme,none'); + }); + + test('negated vendor filter value', () => { + // Given a filter form that excludes a vendor + const filterValues: Partial = { + type: 'expense', + vendorNot: ['Acme'], + }; + + // When the query string is built from the form + const result = buildQueryStringFromFilterFormValues(filterValues); + + // Then the vendor filter keeps its negation so the exclusion is not turned into a match + expect(result).toEqual('type:expense -vendor:Acme'); + }); + test('receipt type filter value', () => { const filterValues: Partial = { type: 'expense', @@ -1656,6 +1681,40 @@ describe('SearchQueryUtils', () => { }); }); + test('vendor filter keeps the typed names and the empty value', () => { + const queryString = 'sortBy:date sortOrder:desc type:expense vendor:"Acme Tools",none'; + const queryJSON = buildSearchQueryJSON(queryString); + + if (!queryJSON) { + throw new Error('Failed to parse query string'); + } + + const result = buildFilterFormValuesFromQuery(queryJSON, {}, {}, {}, {}, {}, {}); + + expect(result).toEqual({ + type: 'expense', + vendor: ['Acme Tools', 'none'], + }); + }); + + test('negated vendor filter is kept in the negated form key', () => { + // Given a typed query that excludes a vendor + const queryJSON = buildSearchQueryJSON('sortBy:date sortOrder:desc type:expense -vendor:"Acme Tools"'); + + if (!queryJSON) { + throw new Error('Failed to parse query string'); + } + + // When the filter form is built from the query + const result = buildFilterFormValuesFromQuery(queryJSON, {}, {}, {}, {}, {}, {}); + + // Then the exclusion lands in vendorNot so applying the form keeps it an exclusion + expect(result).toEqual({ + type: 'expense', + vendorNot: ['Acme Tools'], + }); + }); + test('action filter should be set to undefined if the input value is invalid', () => { const policyCategories = {}; const currencyList = {}; diff --git a/tests/unit/SearchAutocompleteUtilsTest.ts b/tests/unit/SearchAutocompleteUtilsTest.ts index c1ca2c0e4de6..1ef2434b37d8 100644 --- a/tests/unit/SearchAutocompleteUtilsTest.ts +++ b/tests/unit/SearchAutocompleteUtilsTest.ts @@ -157,6 +157,19 @@ describe('SearchAutocompleteUtils', () => { expect(result).toEqual([]); }); + it('should highlight VENDOR filter with a typed vendor name', () => { + // Given a typed vendor filter, whose names are matched by text on the server + const input = 'vendor:"Acme Tools"'; + + // When the input is parsed for highlighting + const result = parseForLiveMarkdown(input, currentUserName, mockSubstitutionMap, mockUserLogins, mockCurrencyList, mockCategoryList, mockTagList, mockExportedToList); + + // Then the vendor value is highlighted like other free-text filters + expect(result).toEqual([ + {start: 7, type: 'mention-user', length: 12}, // vendor:"Acme Tools" + ]); + }); + it('should highlight EXPORTED_TO filter when value is in predefined integrations or custom template list', () => { const input = 'exported-to:Xero'; diff --git a/tests/unit/hooks/useAdvancedSearchFilters.test.ts b/tests/unit/hooks/useAdvancedSearchFilters.test.ts index b8424496dd33..71b64312da65 100644 --- a/tests/unit/hooks/useAdvancedSearchFilters.test.ts +++ b/tests/unit/hooks/useAdvancedSearchFilters.test.ts @@ -7,6 +7,7 @@ import useAdvancedSearchFilters from '@hooks/useAdvancedSearchFilters'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {Policy, PolicyTagLists} from '@src/types/onyx'; +import type {Connections} from '@src/types/onyx/Policy'; import type * as NativeNavigation from '@react-navigation/native'; @@ -14,6 +15,7 @@ import React from 'react'; import Onyx from 'react-native-onyx'; import createRandomPolicy from '../../utils/collections/policies'; +import createMock from '../../utils/createMock'; import waitForBatchedUpdates from '../../utils/waitForBatchedUpdates'; jest.mock('@src/libs/Log'); @@ -177,6 +179,37 @@ describe('useAdvancedSearchFilters', () => { }); }); + describe('vendor filter visibility', () => { + it('hides the vendor filter when no workspace has the vendor feature', async () => { + await Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}1`, buildPolicy(1, {connections: undefined})); + + const {result} = renderHook(() => useAdvancedSearchFilters(undefined), {wrapper}); + + await waitFor(() => { + const allKeys = result.current.flat(); + expect(allKeys).toContain(CONST.SEARCH.SYNTAX_FILTER_KEYS.CATEGORY); + expect(allKeys).not.toContain(CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDOR); + }); + }); + + it('shows the vendor filter when a workspace exports QBO card expenses as credit card transactions', async () => { + const connections = createMock({ + [CONST.POLICY.CONNECTIONS.NAME.QBO]: { + config: {nonReimbursableExpensesExportDestination: CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.CREDIT_CARD}, + data: {vendors: []}, + }, + }); + await Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}1`, buildPolicy(1, {connections})); + + const {result} = renderHook(() => useAdvancedSearchFilters(undefined), {wrapper}); + + await waitFor(() => { + const allKeys = result.current.flat(); + expect(allKeys).toContain(CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDOR); + }); + }); + }); + describe('tax filter visibility', () => { it('hides tax filter when no policies have taxes enabled', async () => { const policy = buildPolicy(1, {tax: {trackingEnabled: false}}); From c65428c8b77d4f2a4196e2af26b6a2990a380f6b Mon Sep 17 00:00:00 2001 From: Krishna Chaitanya Date: Mon, 19 Oct 2026 18:25:53 +0530 Subject: [PATCH 2/4] List workspace vendors from connections in the Search Vendor filter --- src/ONYXKEYS.ts | 8 - .../FilterComponents/VendorSelector.tsx | 58 ++----- src/hooks/useLoadSearchVendorData.ts | 59 ------- src/libs/API/types.ts | 2 - src/libs/ExportOnyxState/masking.ts | 1 - src/libs/actions/Search.ts | 1 - tests/ui/VendorSelectorTest.tsx | 156 ++++++++++++++++++ 7 files changed, 172 insertions(+), 113 deletions(-) delete mode 100644 src/hooks/useLoadSearchVendorData.ts create mode 100644 tests/ui/VendorSelectorTest.tsx diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 1a71b5e10d55..3e1c1496626d 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -529,12 +529,6 @@ const ONYXKEYS = { /** Set while search filter category data is loading */ RAM_ONLY_IS_LOADING_SEARCH_FILTERS_CATEGORY_DATA: 'isLoadingSearchFiltersCategoryData', - /** Set whether the search filters vendor data has loaded */ - IS_SEARCH_FILTERS_VENDOR_DATA_LOADED: 'isSearchFiltersVendorDataLoaded', - - /** Set while search filter vendor data is loading */ - RAM_ONLY_IS_LOADING_SEARCH_FILTERS_VENDOR_DATA: 'isLoadingSearchFiltersVendorData', - HAS_LOADED_APP: 'hasLoadedApp', IS_TEST_TOOLS_MODAL_OPEN: 'isTestToolsModalOpen', @@ -1861,8 +1855,6 @@ type OnyxValuesMapping = { [ONYXKEYS.RAM_ONLY_IS_LOADING_RULES]: boolean; [ONYXKEYS.RAM_ONLY_IS_LOADING_SEARCH_FILTERS_CARD_DATA]: boolean; [ONYXKEYS.RAM_ONLY_IS_LOADING_SEARCH_FILTERS_CATEGORY_DATA]: boolean; - [ONYXKEYS.IS_SEARCH_FILTERS_VENDOR_DATA_LOADED]: boolean; - [ONYXKEYS.RAM_ONLY_IS_LOADING_SEARCH_FILTERS_VENDOR_DATA]: boolean; [ONYXKEYS.IS_LOADING_SUBSCRIPTION_DATA]: boolean; [ONYXKEYS.IS_PENDING_UPDATE_PERSONAL_KARMA]: boolean; [ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN]: boolean; diff --git a/src/components/Search/FilterComponents/VendorSelector.tsx b/src/components/Search/FilterComponents/VendorSelector.tsx index 84fc959dd390..fdd9721aabe6 100644 --- a/src/components/Search/FilterComponents/VendorSelector.tsx +++ b/src/components/Search/FilterComponents/VendorSelector.tsx @@ -1,25 +1,16 @@ -import ActivityIndicator from '@components/ActivityIndicator'; import type {Filter, SearchFilterCommonProps} from '@components/Search/types'; -import useLoadSearchVendorData from '@hooks/useLoadSearchVendorData'; import useLocalize from '@hooks/useLocalize'; import useOnyx from '@hooks/useOnyx'; import usePermissions from '@hooks/usePermissions'; -import useTheme from '@hooks/useTheme'; -import useThemeStyles from '@hooks/useThemeStyles'; -import {getVendorFeaturePolicyIDs} from '@libs/PolicyUtils'; -import {getAllPolicyValues, sortOptionsWithEmptyValue} from '@libs/SearchQueryUtils'; +import {getMatchingVendors, getVendorFeaturePolicyIDs} from '@libs/PolicyUtils'; +import {sortOptionsWithEmptyValue} from '@libs/SearchQueryUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import type {Policy, PolicyVendors} from '@src/types/onyx'; -import {getEmptyObject} from '@src/types/utils/EmptyObject'; -import type {OnyxCollection} from 'react-native-onyx'; - -import React, {useCallback} from 'react'; -import {View} from 'react-native'; +import React from 'react'; import MultiSelect from './MultiSelect'; @@ -31,15 +22,16 @@ function VendorSelector({value = [], policyID, selectionListTextInputStyle, sele const {translate, localeCompare} = useLocalize(); const {isBetaEnabled} = usePermissions(); const isVendorMatchingBetaEnabled = isBetaEnabled(CONST.BETAS.VENDOR_MATCHING); - const {isLoadingInitialVendors} = useLoadSearchVendorData({shouldRefresh: true}); - const theme = useTheme(); - const styles = useThemeStyles(); - const vendorFeaturePolicyIDsSelector = useCallback( - (allPolicies: OnyxCollection) => getVendorFeaturePolicyIDs(allPolicies, isVendorMatchingBetaEnabled), - [isVendorMatchingBetaEnabled], + + const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY); + + // Uses the same synced vendors the expense Vendor field offers. + const vendorNamesByPolicyID = Object.fromEntries( + getVendorFeaturePolicyIDs(allPolicies, isVendorMatchingBetaEnabled).map((id) => [ + id, + getMatchingVendors(allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${id}`]).map((vendor) => vendor.name), + ]), ); - const [vendorFeaturePolicyIDs] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: vendorFeaturePolicyIDsSelector}); - const [allPolicyVendors = getEmptyObject>>()] = useOnyx(ONYXKEYS.COLLECTION.POLICY_VENDORS); const noVendorLabel = translate('search.noVendor'); const selectedVendorItems = value.map((vendor) => { @@ -49,18 +41,12 @@ function VendorSelector({value = [], policyID, selectionListTextInputStyle, sele return {text: vendor, value: vendor}; }); - // Vendor lists are only offered for the workspaces where the vendor feature is on, so stale lists left behind by a - // disconnected integration never surface in the picker. - const eligiblePolicyIDs = new Set(vendorFeaturePolicyIDs); - const eligiblePolicyVendors: OnyxCollection = Object.fromEntries( - Object.entries(allPolicyVendors).filter(([key]) => eligiblePolicyIDs.has(key.replace(ONYXKEYS.COLLECTION.POLICY_VENDORS, ''))), - ); - + const isPolicySelected = (id: string) => !policyID?.value?.length || policyID.isNegated !== policyID.value.includes(id); const vendorItems = [{text: noVendorLabel, value: CONST.SEARCH.VENDOR_EMPTY_VALUE as string}]; const uniqueVendorNames = new Set( - getAllPolicyValues(policyID?.value?.length ? policyID : undefined, ONYXKEYS.COLLECTION.POLICY_VENDORS, eligiblePolicyVendors).flatMap((policyVendors) => - Object.values(policyVendors ?? {}).map((vendor) => vendor.name), - ), + Object.entries(vendorNamesByPolicyID) + .filter(([id]) => isPolicySelected(id)) + .flatMap(([, vendorNames]) => vendorNames), ); vendorItems.push( ...Array.from(uniqueVendorNames) @@ -69,18 +55,6 @@ function VendorSelector({value = [], policyID, selectionListTextInputStyle, sele .toSorted((a, b) => sortOptionsWithEmptyValue(a.text, b.text, localeCompare)), ); - if (isLoadingInitialVendors) { - return ( - - - - ); - } - return ( { - if (areVendorsLoaded || isLoadingVendors !== undefined) { - hasObservedVendorRequestStateRef.current = true; - } - - const wasVendorRequestStateCleared = hasRequestedVendorDataRef.current && hasObservedVendorRequestStateRef.current && !areVendorsLoaded && isLoadingVendors === undefined; - if (wasVendorRequestStateCleared) { - hasRequestedVendorDataRef.current = false; - hasObservedVendorRequestStateRef.current = false; - } - - if (!shouldLoad) { - hasRequestedVendorDataRef.current = false; - hasObservedVendorRequestStateRef.current = false; - return; - } - - if (isLoadingVendors) { - hasRequestedVendorDataRef.current = true; - return; - } - - if (isOffline || hasRequestedVendorDataRef.current || (areVendorsLoaded && !shouldRefresh)) { - return; - } - hasRequestedVendorDataRef.current = true; - openSearchVendorFiltersPage(); - }, [areVendorsLoaded, isLoadingVendors, isOffline, shouldLoad, shouldRefresh]); - - const isLoadingInitialVendors = shouldLoad && !areVendorsLoaded && !isOffline && isLoadingVendors !== false; - - return {areVendorsLoaded, isLoadingInitialVendors, isOffline}; -} - -export default useLoadSearchVendorData; diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index 15d99d3eccfd..28288a96db6c 100644 --- a/src/libs/API/types.ts +++ b/src/libs/API/types.ts @@ -1656,7 +1656,6 @@ const READ_COMMANDS = { OPEN_SEARCH_PAGE: 'OpenSearchPage', OPEN_SEARCH_CARD_FILTERS_PAGE: 'OpenSearchCardFiltersPage', OPEN_SEARCH_CATEGORY_FILTERS_PAGE: 'OpenSearchCategoryFiltersPage', - OPEN_SEARCH_VENDOR_FILTERS_PAGE: 'OpenSearchVendorFiltersPage', SEARCH: 'Search', GET_INSIGHTS: 'GetInsights', GET_TRANSACTIONS_CONVERTED_AMOUNT: 'GetTransactionsConvertedAmount', @@ -1844,7 +1843,6 @@ type ReadCommandParameters = { [READ_COMMANDS.OPEN_DRAFT_DISTANCE_EXPENSE]: null; [READ_COMMANDS.OPEN_SEARCH_CARD_FILTERS_PAGE]: null; [READ_COMMANDS.OPEN_SEARCH_CATEGORY_FILTERS_PAGE]: null; - [READ_COMMANDS.OPEN_SEARCH_VENDOR_FILTERS_PAGE]: null; [READ_COMMANDS.START_ISSUE_NEW_CARD_FLOW]: Parameters.StartIssueNewCardFlowParams; [READ_COMMANDS.OPEN_CARD_DETAILS_PAGE]: Parameters.OpenCardDetailsPageParams; [READ_COMMANDS.GET_CORPAY_ONBOARDING_FIELDS]: Parameters.GetCorpayOnboardingFieldsParams; diff --git a/src/libs/ExportOnyxState/masking.ts b/src/libs/ExportOnyxState/masking.ts index 0bc83ea7ad9d..19414a189282 100644 --- a/src/libs/ExportOnyxState/masking.ts +++ b/src/libs/ExportOnyxState/masking.ts @@ -260,7 +260,6 @@ const safeOnyxKeys = new Set([ ONYXKEYS.IS_PLAID_DISABLED, ONYXKEYS.IS_SEARCH_FILTERS_CARD_DATA_LOADED, ONYXKEYS.IS_SEARCH_FILTERS_CATEGORY_DATA_LOADED, - ONYXKEYS.IS_SEARCH_FILTERS_VENDOR_DATA_LOADED, ONYXKEYS.IS_SENTRY_DEBUG_ENABLED, ONYXKEYS.IS_SENTRY_SEND_ENABLED, ONYXKEYS.IS_SWITCHING_TO_DELEGATOR, diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index 2207c8f26cec..84badc48dd84 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -2723,7 +2723,6 @@ export { handlePreventSearchAPI, openSearchCardFiltersPage, openSearchCategoryFiltersPage, - openSearchVendorFiltersPage, openSearchTagFiltersPage, ALL_POLICY_IDS_KEY, setSearchTagFiltersPagination, diff --git a/tests/ui/VendorSelectorTest.tsx b/tests/ui/VendorSelectorTest.tsx new file mode 100644 index 000000000000..6c4fa2ce9538 --- /dev/null +++ b/tests/ui/VendorSelectorTest.tsx @@ -0,0 +1,156 @@ +import {render} from '@testing-library/react-native'; + +import MultiSelect from '@components/Search/FilterComponents/MultiSelect'; +import VendorSelector from '@components/Search/FilterComponents/VendorSelector'; + +import CONST from '@src/CONST'; +import ONYXKEYS from '@src/ONYXKEYS'; +import type {Policy} from '@src/types/onyx'; +import type {Connections, QBONonReimbursableExportAccountType} from '@src/types/onyx/Policy'; + +import React from 'react'; + +import createRandomPolicy from '../utils/collections/policies'; +import createMock from '../utils/createMock'; + +const mockOnyxData: Record = {}; + +jest.mock('@components/Search/FilterComponents/MultiSelect', () => jest.fn(() => null)); +jest.mock('@hooks/usePermissions', () => jest.fn(() => ({isBetaEnabled: () => true}))); +jest.mock('@hooks/useLocalize', () => + jest.fn(() => ({ + translate: (key: string) => key, + localeCompare: (a: string, b: string) => a.localeCompare(b), + })), +); +jest.mock('@hooks/useOnyx', () => + jest.fn((key: string, options?: {selector?: (value: unknown) => unknown}) => { + const value = mockOnyxData[key]; + return [options?.selector ? options.selector(value) : value, {status: 'loaded'}]; + }), +); + +/** QBO workspace with its synced vendors in its connections, exporting card expenses to the given destination. */ +const buildQBOPolicy = ( + policyID: string, + vendorNames: string[], + exportDestination: QBONonReimbursableExportAccountType = CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.CREDIT_CARD, +): Policy => + createMock({ + ...createRandomPolicy(0), + id: policyID, + connections: createMock({ + [CONST.POLICY.CONNECTIONS.NAME.QBO]: { + config: {nonReimbursableExpensesExportDestination: exportDestination}, + data: {vendors: vendorNames.map((name) => ({id: `${policyID}-${name}`, name, currency: 'USD'}))}, + }, + }), + }); + +describe('VendorSelector', () => { + const mockedMultiSelect = jest.mocked(MultiSelect); + const getItemTexts = () => mockedMultiSelect.mock.lastCall?.[0].items.map((item) => item.text); + + beforeEach(() => { + mockedMultiSelect.mockClear(); + for (const key of Object.keys(mockOnyxData)) { + delete mockOnyxData[key]; + } + }); + + it('lists the vendors in the connections of a workspace with the vendor feature', () => { + // Given a member's workspace whose connections carry synced vendors + mockOnyxData[ONYXKEYS.COLLECTION.POLICY] = {[`${ONYXKEYS.COLLECTION.POLICY}qbo`]: buildQBOPolicy('qbo', ['Zeta Supplies', 'Acme Tools'])}; + + // When the vendor picker renders + render( + , + ); + + // Then the workspace's vendors are offered after "No vendor", read from the same connections that turn the vendor feature on + expect(getItemTexts()).toEqual(['search.noVendor', 'Acme Tools', 'Zeta Supplies']); + }); + + it('lists a vendor name once when several workspaces sync it', () => { + // Given two vendor workspaces that both sync a vendor with the same name + mockOnyxData[ONYXKEYS.COLLECTION.POLICY] = { + [`${ONYXKEYS.COLLECTION.POLICY}first`]: buildQBOPolicy('first', ['Acme Tools', 'Bravo Freight']), + [`${ONYXKEYS.COLLECTION.POLICY}second`]: buildQBOPolicy('second', ['Acme Tools']), + }; + + // When the vendor picker renders + render( + , + ); + + // Then the shared name appears once, because the filter matches vendors by name + expect(getItemTexts()).toEqual(['search.noVendor', 'Acme Tools', 'Bravo Freight']); + }); + + it('leaves out the vendors of workspaces without the vendor feature', () => { + // Given a QBO workspace that exports card expenses as vendor bills, which syncs vendors but has no vendor feature + mockOnyxData[ONYXKEYS.COLLECTION.POLICY] = { + [`${ONYXKEYS.COLLECTION.POLICY}bill`]: buildQBOPolicy('bill', ['Bill Vendor'], CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.VENDOR_BILL), + }; + + // When the vendor picker renders + render( + , + ); + + // Then only "No vendor" is offered + expect(getItemTexts()).toEqual(['search.noVendor']); + }); + + it('only lists the vendors of the selected workspaces', () => { + // Given two vendor workspaces and a workspace filter that selects only the first one + mockOnyxData[ONYXKEYS.COLLECTION.POLICY] = { + [`${ONYXKEYS.COLLECTION.POLICY}first`]: buildQBOPolicy('first', ['Acme Tools']), + [`${ONYXKEYS.COLLECTION.POLICY}second`]: buildQBOPolicy('second', ['Zeta Supplies']), + }; + + // When the vendor picker renders with that workspace filter + render( + , + ); + + // Then only the selected workspace's vendors are offered + expect(getItemTexts()).toEqual(['search.noVendor', 'Acme Tools']); + }); + + it('leaves out the vendors of excluded workspaces', () => { + // Given two vendor workspaces and a workspace filter that excludes the first one + mockOnyxData[ONYXKEYS.COLLECTION.POLICY] = { + [`${ONYXKEYS.COLLECTION.POLICY}first`]: buildQBOPolicy('first', ['Acme Tools']), + [`${ONYXKEYS.COLLECTION.POLICY}second`]: buildQBOPolicy('second', ['Zeta Supplies']), + }; + + // When the vendor picker renders with that negated workspace filter + render( + , + ); + + // Then only the vendors of the workspaces that are not excluded are offered + expect(getItemTexts()).toEqual(['search.noVendor', 'Zeta Supplies']); + }); +}); From 5f5317b0a1cfef7d022fde89e8c0bcae931acf0f Mon Sep 17 00:00:00 2001 From: Krishna Chaitanya Date: Tue, 20 Oct 2026 13:21:29 +0530 Subject: [PATCH 3/4] Let React Compiler memoize the vendor selector and document the vendor tests --- src/hooks/useAdvancedSearchFilters.ts | 6 +----- tests/unit/Search/SearchQueryUtilsTest.ts | 6 ++++++ tests/unit/hooks/useAdvancedSearchFilters.test.ts | 6 ++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/hooks/useAdvancedSearchFilters.ts b/src/hooks/useAdvancedSearchFilters.ts index 324589b35b36..902a319e7730 100644 --- a/src/hooks/useAdvancedSearchFilters.ts +++ b/src/hooks/useAdvancedSearchFilters.ts @@ -11,7 +11,6 @@ import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; import {filterCardsHiddenFromSearch} from '@selectors/Card'; import {emailSelector} from '@selectors/Session'; -import {useCallback} from 'react'; import useLocalize from './useLocalize'; import useOnyx from './useOnyx'; @@ -323,10 +322,7 @@ function useAdvancedSearchFilters(type: SearchDataTypes | undefined) { const [policyDerived] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: policyDerivedSelector}); const {isBetaEnabled} = usePermissions(); const isVendorMatchingBetaEnabled = isBetaEnabled(CONST.BETAS.VENDOR_MATCHING); - const isVendorFilterAvailableSelector = useCallback( - (allPolicies: OnyxCollection) => hasVendorFeatureOnAnyPolicy(allPolicies, isVendorMatchingBetaEnabled), - [isVendorMatchingBetaEnabled], - ); + const isVendorFilterAvailableSelector = (allPolicies: OnyxCollection) => hasVendorFeatureOnAnyPolicy(allPolicies, isVendorMatchingBetaEnabled); const [isVendorFilterAvailable = false] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: isVendorFilterAvailableSelector}); const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST); diff --git a/tests/unit/Search/SearchQueryUtilsTest.ts b/tests/unit/Search/SearchQueryUtilsTest.ts index 3159ce5d84a1..f2238873ad91 100644 --- a/tests/unit/Search/SearchQueryUtilsTest.ts +++ b/tests/unit/Search/SearchQueryUtilsTest.ts @@ -578,13 +578,16 @@ describe('SearchQueryUtils', () => { }); test('vendor filter value', () => { + // Given a filter form with a picked vendor and the "No vendor" option const filterValues: Partial = { type: 'expense', vendor: ['Acme', 'none'], }; + // When the query string is built from the form const result = buildQueryStringFromFilterFormValues(filterValues); + // Then both values are written to one vendor filter so the search matches either of them expect(result).toEqual('type:expense vendor:Acme,none'); }); @@ -1682,6 +1685,7 @@ describe('SearchQueryUtils', () => { }); test('vendor filter keeps the typed names and the empty value', () => { + // Given a typed query with a quoted vendor name and the empty value const queryString = 'sortBy:date sortOrder:desc type:expense vendor:"Acme Tools",none'; const queryJSON = buildSearchQueryJSON(queryString); @@ -1689,8 +1693,10 @@ describe('SearchQueryUtils', () => { throw new Error('Failed to parse query string'); } + // When the filter form is built from the query const result = buildFilterFormValuesFromQuery(queryJSON, {}, {}, {}, {}, {}, {}); + // Then both values are kept as typed, since vendor names are matched by text and not checked against a list expect(result).toEqual({ type: 'expense', vendor: ['Acme Tools', 'none'], diff --git a/tests/unit/hooks/useAdvancedSearchFilters.test.ts b/tests/unit/hooks/useAdvancedSearchFilters.test.ts index 71b64312da65..70d57b41eaa3 100644 --- a/tests/unit/hooks/useAdvancedSearchFilters.test.ts +++ b/tests/unit/hooks/useAdvancedSearchFilters.test.ts @@ -181,10 +181,13 @@ describe('useAdvancedSearchFilters', () => { describe('vendor filter visibility', () => { it('hides the vendor filter when no workspace has the vendor feature', async () => { + // Given a workspace with no accounting connection await Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}1`, buildPolicy(1, {connections: undefined})); + // When the advanced filters are listed const {result} = renderHook(() => useAdvancedSearchFilters(undefined), {wrapper}); + // Then the vendor filter is hidden because no workspace has vendors to pick from, while other filters still show await waitFor(() => { const allKeys = result.current.flat(); expect(allKeys).toContain(CONST.SEARCH.SYNTAX_FILTER_KEYS.CATEGORY); @@ -193,6 +196,7 @@ describe('useAdvancedSearchFilters', () => { }); it('shows the vendor filter when a workspace exports QBO card expenses as credit card transactions', async () => { + // Given a workspace that exports QBO card expenses as credit card transactions, which is when expenses get a vendor const connections = createMock({ [CONST.POLICY.CONNECTIONS.NAME.QBO]: { config: {nonReimbursableExpensesExportDestination: CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.CREDIT_CARD}, @@ -201,8 +205,10 @@ describe('useAdvancedSearchFilters', () => { }); await Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}1`, buildPolicy(1, {connections})); + // When the advanced filters are listed const {result} = renderHook(() => useAdvancedSearchFilters(undefined), {wrapper}); + // Then the vendor filter is shown so those expenses can be filtered by vendor await waitFor(() => { const allKeys = result.current.flat(); expect(allKeys).toContain(CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDOR); From 377252e7badd42b6bc617e69a052b9549bc143ae Mon Sep 17 00:00:00 2001 From: Krishna Chaitanya Date: Tue, 20 Oct 2026 16:12:53 +0530 Subject: [PATCH 4/4] Resolve workspace names and keep unsynced selected vendors in the vendor picker --- .../FilterComponents/VendorSelector.tsx | 12 +++-- tests/ui/VendorSelectorTest.tsx | 46 +++++++++++++++++++ 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/components/Search/FilterComponents/VendorSelector.tsx b/src/components/Search/FilterComponents/VendorSelector.tsx index fdd9721aabe6..b2a705549aa3 100644 --- a/src/components/Search/FilterComponents/VendorSelector.tsx +++ b/src/components/Search/FilterComponents/VendorSelector.tsx @@ -5,7 +5,7 @@ import useOnyx from '@hooks/useOnyx'; import usePermissions from '@hooks/usePermissions'; import {getMatchingVendors, getVendorFeaturePolicyIDs} from '@libs/PolicyUtils'; -import {sortOptionsWithEmptyValue} from '@libs/SearchQueryUtils'; +import {getAllPolicyValues, sortOptionsWithEmptyValue} from '@libs/SearchQueryUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -41,11 +41,12 @@ function VendorSelector({value = [], policyID, selectionListTextInputStyle, sele return {text: vendor, value: vendor}; }); - const isPolicySelected = (id: string) => !policyID?.value?.length || policyID.isNegated !== policyID.value.includes(id); + // The workspace filter can hold workspace names as well as IDs, so it is resolved to the matching workspaces first. + const selectedPolicyIDs = policyID?.value?.length ? new Set(getAllPolicyValues(policyID, ONYXKEYS.COLLECTION.POLICY, allPolicies).map((policy) => policy.id)) : undefined; const vendorItems = [{text: noVendorLabel, value: CONST.SEARCH.VENDOR_EMPTY_VALUE as string}]; const uniqueVendorNames = new Set( Object.entries(vendorNamesByPolicyID) - .filter(([id]) => isPolicySelected(id)) + .filter(([id]) => !selectedPolicyIDs || selectedPolicyIDs.has(id)) .flatMap(([, vendorNames]) => vendorNames), ); vendorItems.push( @@ -55,6 +56,11 @@ function VendorSelector({value = [], policyID, selectionListTextInputStyle, sele .toSorted((a, b) => sortOptionsWithEmptyValue(a.text, b.text, localeCompare)), ); + // Selected vendors that are not in the synced lists, such as a typed name or one from a workspace the filter leaves out, stay listed after "No vendor" so they can be deselected. + const vendorItemValues = new Set(vendorItems.map((item) => item.value)); + const missingSelectedVendorItems = selectedVendorItems.filter((item) => !vendorItemValues.has(item.value)).toSorted((a, b) => localeCompare(a.text, b.text)); + vendorItems.splice(1, 0, ...missingSelectedVendorItems); + return ( { // Then only the vendors of the workspaces that are not excluded are offered expect(getItemTexts()).toEqual(['search.noVendor', 'Zeta Supplies']); }); + + it('resolves workspace names in the workspace filter', () => { + // Given two named vendor workspaces and typed workspace filters that use a workspace name instead of its ID + mockOnyxData[ONYXKEYS.COLLECTION.POLICY] = { + [`${ONYXKEYS.COLLECTION.POLICY}first`]: {...buildQBOPolicy('first', ['Acme Tools']), name: 'First Workspace'}, + [`${ONYXKEYS.COLLECTION.POLICY}second`]: {...buildQBOPolicy('second', ['Zeta Supplies']), name: 'Second Workspace'}, + }; + + // When the vendor picker renders with the name selected, and then with the name excluded + render( + , + ); + const selectedItemTexts = getItemTexts(); + render( + , + ); + + // Then the name is matched to its workspace, so selecting it lists that workspace's vendors and excluding it drops them + expect(selectedItemTexts).toEqual(['search.noVendor', 'Acme Tools']); + expect(getItemTexts()).toEqual(['search.noVendor', 'Zeta Supplies']); + }); + + it('keeps selected vendors that are not in the synced lists', () => { + // Given a vendor workspace and a selected vendor that none of the loaded workspaces sync, such as one typed in the search router + mockOnyxData[ONYXKEYS.COLLECTION.POLICY] = {[`${ONYXKEYS.COLLECTION.POLICY}qbo`]: buildQBOPolicy('qbo', ['Acme Tools'])}; + + // When the vendor picker renders with that selection + render( + , + ); + + // Then the selected vendor is listed after "No vendor", so it shows as selected and can be deselected + expect(getItemTexts()).toEqual(['search.noVendor', 'Typed Vendor', 'Acme Tools']); + }); });