{"version":3,"file":"donation-page.js","sources":["../../Trilogy.Bundler.Site.ClientApp/src/donation-page/state.ts","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/common/currency.ts","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/donor-covered-fees.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/contact.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/employment.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/payment-credit-card.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/payment-electronic-check.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/payment.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/common/donation-buttons.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/tip.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/checkout-cart.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/event-attendance.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/custom-checkbox.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/common/terms.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/common/page-header.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/actions.ts","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/common/processing-indicator.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/mandatory-fee.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/attribution.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/pac-contact.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/checkout/checkout.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/confirmation/confirmation.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/recipient-goal.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/recipient-donation.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/recipient-helper.ts","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/recipient-teaser.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/recipient-photo.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/recipient-info.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/recipient-featured-banner.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/recipient-custom-fields.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/recipient-card.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/recipient-card-list.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/recipient-description.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/single-recipient-card.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/slate-cart.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/split-it.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/weighted-split-it.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/max-out.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/featured-toggle.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/slate-filters.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/extended-profile.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/recipient-dialog.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/notification-banner.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/pac-donation-toggle.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/slate/slate.tsx","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/cart-calculator.ts","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/reducers.ts","../../Trilogy.Bundler.Site.ClientApp/src/donation-page/donation-page.tsx"],"sourcesContent":["import { createContext, Dispatch } from \"react\";\r\nimport { ApiError } from \"../common\";\r\nimport { Action } from \"./actions\";\r\n\r\n// STATE\r\nexport class SuggestedAmount {\r\n constructor(public readonly amount: number) {\r\n this.kind = \"suggested\";\r\n }\r\n\r\n readonly kind: string;\r\n}\r\n\r\nexport class OtherAmount {\r\n constructor(public amt: number, public amtStr: string = \"\") {\r\n this.kind = \"other\";\r\n\r\n if (amtStr) {\r\n const decimalIndex = amtStr.indexOf(\".\");\r\n if (decimalIndex > -1) {\r\n // Don't allow more than 2 decimal points\r\n this.amountString = amtStr.substr(0, decimalIndex + 3);\r\n this.amount = parseFloat(this.amountString);\r\n } else {\r\n this.amountString = amtStr;\r\n this.amount = Math.round(amt * 100) / 100;\r\n }\r\n } else {\r\n this.amount = Math.round(amt * 100) / 100;\r\n this.amountString = amt.toFixed(2);\r\n }\r\n }\r\n\r\n readonly amount: number;\r\n readonly amountString: string;\r\n readonly kind: string;\r\n}\r\n\r\nexport type DonationAmount = SuggestedAmount | OtherAmount;\r\nexport type DonorType = \"Default\" | \"Individual\" | \"FederalPac\";\r\n\r\nexport interface DonationPageState {\r\n apiErrors: ApiError[];\r\n cartAmounts: CartAmounts;\r\n checkoutForm: CheckoutForm;\r\n configuration: {\r\n checkout: CheckoutConfiguration,\r\n slate: SlateConfiguration,\r\n conditionalDonating: ConditionalDonatingConfiguration,\r\n confirmation: ConfirmationConfiguration,\r\n earmarking: EarmarkingConfiguration,\r\n event: EventConfiguration,\r\n donationLimit: DonationLimitConfiguration,\r\n pacDonation: PacDonationConfiguration,\r\n status: \"Loading\" | \"NotFound\" | \"Published\" | \"Unpublished\" | \"Closed\" | \"Archived\" | \"ReadyForReview\",\r\n context: \"StandardPage\" | \"RecipientPage\",\r\n pagePermissionLevel: \"Everyone\" | \"Authenticated\" | \"VIP\" | \"Administrator\"\r\n };\r\n createSubscription: boolean;\r\n currentUser?: CurrentUser;\r\n donorType: DonorType;\r\n donorTypeUpdated: boolean;\r\n filters: Filters;\r\n donationLimit: DonationLimit;\r\n maxOut: {\r\n showDialog: boolean;\r\n };\r\n processingIndicator: ProcessingIndicator;\r\n recipients: Recipient[];\r\n recipientDialog: RecipientDialog;\r\n sourceCode: string;\r\n utmTracking: {\r\n campaign: string;\r\n content: string;\r\n medium: string;\r\n source: string;\r\n term: string;\r\n }\r\n terms: Term[];\r\n urlSlug: string;\r\n}\r\n\r\nexport interface DonationLimit {\r\n limitReached: boolean;\r\n donatedAmount: number;\r\n}\r\n\r\nexport interface CartAmounts {\r\n base: number;\r\n total: number;\r\n mandatoryFee: number;\r\n donorCoveredFees: number;\r\n tip: number;\r\n}\r\n\r\nexport interface ConditionalDonatingConfiguration {\r\n enabled: boolean;\r\n conditionContent: string;\r\n}\r\n\r\nexport interface EarmarkingConfiguration {\r\n enabled: boolean;\r\n}\r\n\r\nexport interface DonationLimitConfiguration {\r\n enabled: boolean;\r\n limit: number;\r\n remaining: number;\r\n donationTotal: number;\r\n}\r\n\r\nexport interface PacDonationConfiguration {\r\n enabled: boolean;\r\n defaultDonorType: DonorType;\r\n}\r\n\r\nexport interface SlateConfiguration {\r\n featuredRecipients: {\r\n enabled: boolean;\r\n defaultFilter: \"All\" | \"Featured\";\r\n viewAllText: string;\r\n viewFeaturedText: string;\r\n bannerText: string;\r\n }\r\n filters: {\r\n enabled: boolean;\r\n customField1: CustomFieldFilter;\r\n customField2: CustomFieldFilter;\r\n displayName: boolean;\r\n office: boolean;\r\n state: boolean;\r\n politicalParty: boolean;\r\n }\r\n goal: {\r\n enabled: boolean;\r\n }\r\n footerHtml: string;\r\n header: Header\r\n maxOut: {\r\n enabled: boolean;\r\n title: string;\r\n content: string;\r\n button: string;\r\n thresholdAmount: number;\r\n }\r\n recipientTemplate: {\r\n enableProfileTeaser: boolean;\r\n infoTemplate: string;\r\n layout: string;\r\n }\r\n recipientDialog: {\r\n enabled: boolean;\r\n showDialogLabel: string;\r\n extendedProfileTitle: string;\r\n }\r\n splitIt: {\r\n enabled: boolean;\r\n title: string;\r\n content: string;\r\n button: string;\r\n }\r\n weightedSplitIt: {\r\n enabled: boolean;\r\n title: string;\r\n content: string;\r\n button: string;\r\n }\r\n subscription: {\r\n enabled: boolean;\r\n }\r\n suggestedDonationAmounts: number[];\r\n}\r\n\r\nexport interface AttributionList {\r\n id: string,\r\n members: string[]\r\n}\r\n\r\nexport interface CheckoutConfiguration {\r\n header: Header,\r\n donationAttribution: {\r\n attributionLists: AttributionList[];\r\n content: string;\r\n enabled: boolean;\r\n required: boolean;\r\n title: string;\r\n },\r\n donorCoveredFees: {\r\n enabled: boolean;\r\n title: string;\r\n checkboxLabel: string;\r\n content: string;\r\n creditCardBase: number;\r\n creditCardRate: number;\r\n electronicCheckBase: number;\r\n electronicCheckRate: number;\r\n },\r\n tip: {\r\n content: string,\r\n enabled: boolean,\r\n suggestedAmounts: number[],\r\n title: string,\r\n recipient?: TipRecipient | null\r\n },\r\n customCheckbox: {\r\n checked: boolean,\r\n content: string | null,\r\n enabled: boolean,\r\n name: string | null,\r\n required: boolean,\r\n title: string | null\r\n },\r\n emailNote: string | null,\r\n employmentNote: string | null,\r\n textMessagingOptIn: {\r\n enabled: boolean,\r\n label: string | null\r\n },\r\n mandatoryFee: {\r\n enabled: boolean,\r\n baseAmount: number,\r\n rate: number,\r\n maximumAmount: number | null,\r\n title: string,\r\n content: string,\r\n lineItemText: string\r\n }\r\n}\r\n\r\nexport interface CurrentUser {\r\n address: string;\r\n city: string;\r\n displayName: string;\r\n email: string;\r\n employer: string;\r\n employerAddress: string;\r\n employerCity: string;\r\n employerPostalCode: string;\r\n employerState: string;\r\n firstName: string;\r\n id: string;\r\n lastName: string;\r\n occupation: string;\r\n paymentAuthorizationDisplayName: string;\r\n paymentAuthorizationSaved: boolean;\r\n phoneNumber: string;\r\n postalCode: string;\r\n state: string;\r\n}\r\n\r\nexport interface ConfirmationConfiguration {\r\n header: Header;\r\n}\r\n\r\nexport interface EventConfiguration {\r\n enabled: boolean;\r\n}\r\n\r\nexport interface QueryRecipient {\r\n identifier: string;\r\n amount?: number;\r\n}\r\n\r\nexport interface Header {\r\n title: string;\r\n content: string;\r\n html: string;\r\n}\r\n\r\nexport interface Term {\r\n id: string;\r\n content: string;\r\n}\r\n\r\nexport interface RecipientDialog {\r\n recipientId?: string | null;\r\n show: boolean;\r\n}\r\n\r\nexport interface ProcessingIndicator {\r\n message?: string;\r\n show: boolean;\r\n}\r\n\r\nexport interface Filters {\r\n featured: boolean;\r\n displayName: string;\r\n states: string[];\r\n offices: string[];\r\n politicalParties: string[];\r\n customField1: string[];\r\n customField2: string[];\r\n}\r\n\r\nexport interface CustomFieldFilter {\r\n enabled: boolean;\r\n label: string;\r\n}\r\n\r\nexport interface TipRecipient {\r\n contributionLimit: number;\r\n identifier: string;\r\n displayName: string;\r\n termIds: string[];\r\n}\r\n\r\nexport interface RecipientLinks {\r\n facebook?: string | null;\r\n instragram?: string | null;\r\n site?: string | null;\r\n twitter?: string | null;\r\n youTube?: string | null;\r\n}\r\n\r\nexport interface RecipientProfileField {\r\n name: string;\r\n order: number;\r\n value: string;\r\n}\r\n\r\nexport interface Recipient {\r\n attribution: string;\r\n attributionListId: string;\r\n customField1: string;\r\n customField2: string;\r\n cycle: string;\r\n displayName: string;\r\n extendedProfileFields: RecipientProfileField[];\r\n earmarked: boolean;\r\n identifier: string;\r\n state: string;\r\n district: string;\r\n disclaimer: string;\r\n links: RecipientLinks;\r\n office: string;\r\n politicalParty: string;\r\n description: string;\r\n contributionLimit: number;\r\n donationAmount: DonationAmount;\r\n weight: number;\r\n featured: boolean;\r\n order: number;\r\n profileTeaser: string;\r\n requireEmployerAddress: boolean;\r\n recipientType: string;\r\n termIds: string[];\r\n goal: {\r\n achieved: boolean,\r\n amount: number,\r\n percent: number,\r\n progress: number,\r\n remaining: number\r\n },\r\n legalName: string;\r\n pausedStatus: {\r\n paused: boolean,\r\n message: string\r\n };\r\n}\r\n\r\nexport interface CheckoutForm {\r\n attributionFields: string[];\r\n contact: {\r\n firstName: string;\r\n lastName: string;\r\n streetAddress: string;\r\n city: string;\r\n state: string;\r\n postalCode: string;\r\n email: string;\r\n phoneNumber: string;\r\n textMessagingOptIn: boolean;\r\n };\r\n employment: {\r\n status: \"Employed\" | \"Retired\" | \"NotEmployed\"\r\n employer: string;\r\n occupation: string\r\n streetAddress: string;\r\n city: string;\r\n state: string;\r\n postalCode: string;\r\n };\r\n donorCoveredFees: {\r\n enabled: boolean;\r\n amount?: number;\r\n };\r\n eventAttendance: {\r\n attending: boolean;\r\n numberOfAttendees: number;\r\n };\r\n payment: {\r\n paymentMethod: \"CreditCard\" | \"ElectronicCheck\";\r\n useStoredPaymentAuthorization: boolean;\r\n rememberPayment: boolean;\r\n password: string;\r\n confirmPassword: string;\r\n creditCard: {\r\n cardNumber: string;\r\n expirationMonth: string;\r\n expirationYear: string;\r\n securityCode: string;\r\n } | null;\r\n electronicCheck: {\r\n accountType: \"Checking\" | \"Savings\";\r\n accountNumber: string;\r\n routingNumber: string;\r\n } | null;\r\n paymentCheckbox: boolean;\r\n },\r\n tip: {\r\n amount: number;\r\n }\r\n}\r\n\r\n// INITIAL STATE\r\nconst getArrayFromQueryString = (field: string): string[] => {\r\n const value = new URLSearchParams(window.location.search).get(field);\r\n if (!value) {\r\n return [];\r\n }\r\n return value.split(\",\");\r\n}\r\n\r\nconst initialFilters = {\r\n featured: true,\r\n displayName: \"\",\r\n states: getArrayFromQueryString(\"state\"),\r\n offices: getArrayFromQueryString(\"office\"),\r\n politicalParties: getArrayFromQueryString(\"party\"),\r\n customField1: [],\r\n customField2: []\r\n}\r\n\r\nconst initialCheckoutForm: CheckoutForm = {\r\n attributionFields: [],\r\n contact: {\r\n firstName: \"\",\r\n lastName: \"\",\r\n streetAddress: \"\",\r\n city: \"\",\r\n state: \"\",\r\n postalCode: \"\",\r\n email: \"\",\r\n phoneNumber: \"\",\r\n textMessagingOptIn: false\r\n },\r\n employment: {\r\n status: \"Employed\",\r\n employer: \"\",\r\n streetAddress: \"\",\r\n city: \"\",\r\n state: \"\",\r\n postalCode: \"\",\r\n occupation: \"\"\r\n },\r\n donorCoveredFees: {\r\n enabled: false,\r\n amount: 0\r\n },\r\n eventAttendance: {\r\n attending: true,\r\n numberOfAttendees: 1\r\n },\r\n payment: {\r\n paymentMethod: \"CreditCard\",\r\n useStoredPaymentAuthorization: false,\r\n rememberPayment: false,\r\n password: \"\",\r\n confirmPassword: \"\",\r\n creditCard: {\r\n cardNumber: \"\",\r\n expirationMonth: \"\",\r\n expirationYear: \"\",\r\n securityCode: \"\"\r\n },\r\n electronicCheck: {\r\n accountType: \"Checking\",\r\n accountNumber: \"\",\r\n routingNumber: \"\"\r\n },\r\n paymentCheckbox: false\r\n },\r\n tip: {\r\n amount: 0\r\n }\r\n}\r\n\r\nconst initialCheckoutConfiguration = {\r\n header: {\r\n title: \"\",\r\n content: \"\",\r\n html: \"\"\r\n },\r\n donationAttribution: {\r\n enabled: false,\r\n required: false,\r\n content: \"\",\r\n title: \"\",\r\n attributionLists: []\r\n },\r\n donorCoveredFees: {\r\n enabled: false,\r\n title: \"\",\r\n checkboxLabel: \"\",\r\n content: \"\",\r\n creditCardBase: 0,\r\n creditCardRate: 0,\r\n electronicCheckBase: 0,\r\n electronicCheckRate: 0\r\n },\r\n tip: {\r\n content: \"\",\r\n enabled: false,\r\n suggestedAmounts: [],\r\n title: \"\",\r\n recipient: null\r\n },\r\n customCheckbox: {\r\n checked: false,\r\n content: \"\",\r\n enabled: false,\r\n name: \"\",\r\n required: true,\r\n title: \"\"\r\n },\r\n emailNote: \"\",\r\n employmentNote: \"\",\r\n textMessagingOptIn: {\r\n enabled: false,\r\n label: \"\"\r\n },\r\n terms: [],\r\n mandatoryFee: {\r\n enabled: false,\r\n baseAmount: 0,\r\n rate: 0,\r\n maximumAmount: null,\r\n title: \"\",\r\n content: \"\",\r\n lineItemText: \"\"\r\n }\r\n}\r\n\r\nconst initialConditionalDonatingConfiguration = {\r\n enabled: false,\r\n conditionContent: \"\"\r\n}\r\n\r\nconst initialEventConfiguration = {\r\n enabled: false\r\n}\r\n\r\nconst initialPacDonationConfiguration: PacDonationConfiguration = {\r\n enabled: false,\r\n defaultDonorType: \"Default\"\r\n}\r\n\r\nconst initialSlateConfiguration = {\r\n featuredRecipients: {\r\n enabled: true,\r\n defaultFilter: <\"All\" | \"Featured\">\"Featured\",\r\n viewAllText: \"\",\r\n viewFeaturedText: \"\",\r\n bannerText: \"\"\r\n },\r\n filters: {\r\n enabled: false,\r\n customField1: {\r\n enabled: false,\r\n label: \"\"\r\n },\r\n customField2: {\r\n enabled: false,\r\n label: \"\"\r\n },\r\n displayName: false,\r\n office: false,\r\n state: false,\r\n politicalParty: false\r\n },\r\n footerHtml: \"\",\r\n goal: {\r\n enabled: false\r\n },\r\n header: {\r\n title: \"\",\r\n content: \"\",\r\n html: \"\"\r\n },\r\n maxOut: {\r\n enabled: false,\r\n title: \"\",\r\n content: \"\",\r\n button: \"\",\r\n thresholdAmount: 0\r\n },\r\n recipientDialog: {\r\n enabled: false,\r\n showDialogLabel: \"\",\r\n extendedProfileTitle: \"\"\r\n },\r\n recipientTemplate: {\r\n enableProfileTeaser: false,\r\n enableGoal: false,\r\n infoTemplate: \"\",\r\n layout: \"\"\r\n },\r\n splitIt: {\r\n enabled: false,\r\n title: \"\",\r\n content: \"\",\r\n button: \"\"\r\n },\r\n weightedSplitIt: {\r\n enabled: false,\r\n title: \"\",\r\n content: \"\",\r\n button: \"\"\r\n },\r\n subscription: {\r\n enabled: false\r\n },\r\n suggestedDonationAmounts: [10, 25, 50, 100, 250],\r\n\r\n detailsTemplate: \"\"\r\n}\r\n\r\nexport const initialDonationPageState: DonationPageState = {\r\n configuration: {\r\n checkout: initialCheckoutConfiguration,\r\n context: \"StandardPage\",\r\n conditionalDonating: initialConditionalDonatingConfiguration,\r\n donationLimit: {\r\n enabled: false,\r\n limit: 0,\r\n remaining: 0,\r\n donationTotal: 0\r\n },\r\n earmarking: {\r\n enabled: false\r\n },\r\n event: initialEventConfiguration,\r\n pacDonation: initialPacDonationConfiguration,\r\n slate: initialSlateConfiguration,\r\n status: \"Loading\",\r\n confirmation: {\r\n header: {\r\n title: \"\",\r\n content: \"\",\r\n html: \"\"\r\n }\r\n },\r\n pagePermissionLevel: \"Everyone\"\r\n },\r\n cartAmounts: {\r\n base: 0,\r\n total: 0,\r\n mandatoryFee: 0,\r\n donorCoveredFees: 0,\r\n tip: 0\r\n },\r\n createSubscription: false,\r\n donorType: \"Default\",\r\n donorTypeUpdated: false,\r\n donationLimit: {\r\n limitReached: false,\r\n donatedAmount: 0\r\n },\r\n recipients: [],\r\n terms: [],\r\n filters: initialFilters,\r\n checkoutForm: initialCheckoutForm,\r\n recipientDialog: { recipientId: null, show: false },\r\n sourceCode: new URLSearchParams(window.location.search).get(\"sc\") || \"\",\r\n utmTracking: {\r\n campaign: new URLSearchParams(window.location.search).get(\"utm_campaign\") || \"\",\r\n content: new URLSearchParams(window.location.search).get(\"utm_content\") || \"\",\r\n medium: new URLSearchParams(window.location.search).get(\"utm_medium\") || \"\",\r\n source: new URLSearchParams(window.location.search).get(\"utm_source\") || \"\",\r\n term: new URLSearchParams(window.location.search).get(\"utm_term\") || \"\"\r\n },\r\n apiErrors: [],\r\n processingIndicator: { show: false, message: \"\" },\r\n urlSlug: \"\",\r\n maxOut: {\r\n showDialog: false\r\n }\r\n}\r\n\r\nexport const getFilteredRecipients = (state: DonationPageState) => {\r\n const filters = state.filters;\r\n let filteredRecipients = state.recipients\r\n .filter(r => !filters.displayName || r.displayName.toLowerCase().indexOf(filters.displayName.toLowerCase()) != -1)\r\n .filter(r => filters.states.length == 0 || filters.states.indexOf(r.state) != -1)\r\n .filter(r => filters.offices.length == 0 || filters.offices.indexOf(r.office) != -1)\r\n .filter(r => filters.politicalParties.length == 0 || filters.politicalParties.indexOf(r.politicalParty) != -1)\r\n .filter(r => filters.customField1.length == 0 || filters.customField1.indexOf(r.customField1) != -1)\r\n .filter(r => filters.customField2.length == 0 || filters.customField2.indexOf(r.customField2) != -1);\r\n\r\n const featuredFilterEnabled = state.configuration.slate.featuredRecipients.enabled || false;\r\n\r\n if (featuredFilterEnabled) {\r\n filteredRecipients = filteredRecipients.filter(r => filters.featured ? r.featured : true)\r\n }\r\n\r\n return filteredRecipients;\r\n}\r\n\r\n// CONTEXTS\r\nlet initialDonationPageStateContext = { state: initialDonationPageState, dispatch: (action: Action) => { } }\r\nexport const DonationPageStateContext = createContext<{ state: DonationPageState, dispatch: Dispatch {tipConfiguration.content} {t.content} {conditionalDonatingConfig.conditionContent} I agree that my Pledge can be collected (and my payment method debited) when the following condition is met: I understand that my payment is being made to Democracy Engine, who accepts the responsibility of distributing the funds to my designated recipient(s) in accordance with applicable campaign finance laws. My card or bank statement will show a payment to “Democracy Engine” or “DEMENG” and if there are any issues or discrepancies with the payment or I wish to revoke the payment, I can contact Democracy Engine at support@democracyengine.com. Democracy Engine will charge each recipient an applicable service fee. By clicking on the “{donateText}” button you confirm that the following statements are true and accurate: {config.content.replaceAll(\" \", \"\")} {config.content.replaceAll(\" \", \"\")} {recipient?.profileTeaser} {slateConfig.recipientDialog.showDialogLabel} { slateConfig.recipientDialog.showDialogLabel } No Matches {recipient?.description} {splitIt.content} {config.content} {maxOut.content}{CurrencyFormatter.format(state.cartAmounts.total)}
;\r\n\r\n const editButton = navigateToSlate()}>Edit;\r\n const toggleRecipientsButton = toggleRecipients()}>{showRecipients ? \"Hide Details\" : \"Show Details\"};\r\n\r\n const recurringNotification = state.configuration.slate.subscription.enabled\r\n ? (state.createSubscription ? : <>>)\r\n : <>>\r\n\r\n return (\r\n \r\n {recipientListItems}\r\n
\r\n }\r\n {recurringNotification}\r\n {editButton}\r\n {recipientListItems.length > 0 && toggleRecipientsButton}\r\n {config.title}
\r\n {contentElement}\r\n \r\n )\r\n });\r\n\r\n if (tipAmount) {\r\n lineItemRows.push({r.displayName} ({r.legalName}) \r\n {CurrencyFormatter.format(r.donationAmount.amount)} \r\n );\r\n }\r\n\r\n if (coveredFeesAmount) {\r\n lineItemRows.push({state.configuration.checkout.tip.recipient?.displayName} {CurrencyFormatter.format(tipAmount)} );\r\n }\r\n\r\n if (mandatoryFeeAmount) {\r\n lineItemRows.push(Processing Fees {CurrencyFormatter.format(coveredFeesAmount)} );\r\n }\r\n\r\n return (\r\n <>\r\n {state.configuration.checkout.mandatoryFee.lineItemText} {CurrencyFormatter.format(mandatoryFeeAmount)} \r\n \r\n {lineItemRows}\r\n \r\n
\r\n \r\n {showDialog && showDialogLink &&
\r\n {recipientCards}\r\n
\r\n >);\r\n }\r\n}\r\n","import React, { useContext, useMemo } from \"react\";\r\nimport { RecipientContext } from \"../state\";\r\nimport \"./recipient-description.css\";\r\n\r\nexport const RecipientDescription = ({ show }: { show?: boolean }) => {\r\n const recipient = useContext(RecipientContext);\r\n\r\n const isHtml = recipient.description?.indexOf('<') >= 0;\r\n const descriptionElement = isHtml && recipient?.description\r\n ? \r\n : {formatAmount(cartAmounts.base)}
;\r\n\r\n const continueButton = \r\n\r\n const expressDonateButton = ;\r\n\r\n const clearButton = cartAmounts.total > 0\r\n ? dispatch({ type: ActionType.ClearRecipientAmounts })}>Clear\r\n : <>>\r\n\r\n const subscriptionCheckbox = state.configuration.slate.subscription.enabled\r\n ? \r\n : <>>\r\n\r\n if (showExpressDonate) {\r\n return (\r\n \r\n {recipientListItems}\r\n
}\r\n {continueButton}\r\n {subscriptionCheckbox}\r\n {clearButton}\r\n {splitIt.title}
\r\n {config.title}
\r\n {maxOut.title}
\r\n