<commit_before>{{#unless showPaymentHistory}}
  {{#nypr-card classNames="nypr-membership-info" title="Giving History" as |card|}}

  {{#card.header as |header|}}
    {{header.title text="Giving History"}}
  {{/card.header}}

    {{!--
    Possible user states to handle:
    1. Active sustaining pledge (activeSustainingPledges)
    2. Active one-time pledge, e.g. donated within last year (activeOneTimePledges)
    3. Expired/declined sustaining pledge (isLapsedSustainer)
    4. Expired/lapsed one-time pledge (isLapsedOneTimeMember)
    5. Never pledged (isNonMember)
    --}}

    {{#if pledges.isPending}}
      {{animated-loading-icon color="#CCC" classNames="membership-loading-animation"}}
    {{/if}}
    {{#if pledges.isFulfilled}}
      <div class="pledge-order-info">
        {{#if mostRecentSustainingPledgesPerOrderCode}}
          <h2 class="active-donations-header">Active Recurring Donations</h2>
          {{#each mostRecentSustainingPledgesPerOrderCode as |pledge|}}
            <div class="pledge-container">
              <div class="pledge-info-container">
                <div class="pledge-fund-name">
                  <div class="pledge-fund">{{pledge.fund}}</div>
                </div>
                <div class="pledge-info">
                  <div class="pledge-order-price">${{pledge.orderPrice}}{{if pledge.isSustainer ' / month' }}</div>
                  <div class="pledge-hyphen-separator">-</div>
                  <div class="pledge-order-cc-type">{{pledge.creditCardType}} {{pledge.creditCardLast4Digits}}</div>
                </div>
              </div>
              <div class="pledge-update-link">
                <a href="https://pledge3.wnyc.org/donate/membership-sustainer/sustainer/sustainer?order_id={{pledge.orderKey}}">Update</a>
              </div>
            </div>
          {{/each}}

        {{else if activeOneTimePledges}}
          <div class="pledge-active-onetime-member">
            <p class="last-pledge-date">You last donated on <span class="pledge-date">{{moment-format mostRecentPledge.orderDate 'MMMM D, YYYY'}}</span>.</p>
            <a class="pledge-donate-button-link" href="https://pledge3.wnyc.org/donate/membership-sustainer/sustainer/?order_id={{mostRecentPledge.orderKey}}" target="_blank">
              <p class="pledge-donate-button">Make another donation</p>
            </a>
          </div>

        {{else if isLapsedOneTimeMember}}
          <div class="pledge-active-onetime-member">
            <p class="last-pledge-date">It looks like you haven’t given since
              {{moment-format mostRecentPledge.orderDate 'MMM. D, YYYY'}}.  Take
              a moment to renew your membership right now!</p>
            <a class="pledge-donate-button-link"
                href="https://pledge3.wnyc.org/donate/membership-sustainer/sustainer/?order_id={{mostRecentPledge.orderKey}}"
                target="_blank">
              <p class="pledge-donate-button">Donate to renew</p>
            </a>
          </div>

        {{else if isLapsedSustainer}}
          <div class="pledge-lapsed-sustainer">
            <p class="last-pledge-date">Your sustaining donations have expired.</p>
            <a class="pledge-donate-button-link" href="https://pledge3.wnyc.org/donate/membership-sustainer/sustainer/" target="_blank">
              <p class="pledge-donate-button">Become a member</p>
            </a>
          </div>

        {{else}} {{! i.e. isNonMember }}
          <div class="pledge-non-member">
            <p class="last-pledge-date">Our records show you're not a member yet. How about changing that right now, and help pay for all of the great programming you hear on WNYC.</p>
            <a class="pledge-donate-button-link" href="https://pledge3.wnyc.org/donate/membership-sustainer/sustainer/" target="_blank">
              <p class="pledge-donate-button">Become a member</p>
            </a>
          </div>
        {{/if}}
      </div>
    {{/if}}

    <div class="pledge-tools">
      {{#if pledges}}
      <div class="pledge-payment-history"><span {{action (action (mut showPaymentHistory) (not showPaymentHistory))}}>Giving History</span></div>
      {{/if}}
      <div class="pledge-help-link"><span {{action (action (mut disableModal) true)}}>Help</span></div>

    </div>
  {{/nypr-card}}

  {{#if disableModal}}
    {{#nypr-account-modal title="Membership Help" closeAction=(action (mut disableModal) false) as |m|}}
      {{#m.body}}
      <p>
        If you've donated but don't see your donation info here, it may be because you've donated with a different email. You can change your donation email in your Personal Info section.
      </p>
      <p>
        Other questions: <a href="/support/faq/">Check out our FAQs</a><br/>
        Or contact us: <a href="/contact">wnyc.org/contact</a> or 646-829-4000
      </p>
      {{/m.body}}
      {{#m.footer}}
        <button
          class="nypr-account-confirm"
          data-test-selector="confirm-disable"
          {{action (action (mut disableModal) false)}}>Got it!</button>
      {{/m.footer}}
    {{/nypr-account-modal}}
  {{/if}}

{{else}}
  {{#nypr-card classNames="nypr-membership-info pledge-history" as |card|}}
    {{#card.header as |header|}}
      {{header.button
        class="nypr-card-edit-btn pledge-payment-history-back-button"
        click=(action (mut showPaymentHistory) false)
        text=(if showPaymentHistory 'Back' 'Back')}}
      {{header.title text="Giving History" classNames="pledge-history-title"}}
    {{/card.header}}
      {{#each sortedPledges as |pledge|}}
      <div class="pledge-container pledge-history-container">
        <div class="pledge-date">{{moment-format pledge.orderDate 'MMM D, YYYY'}}</div>
        <div class="pledge-fund-and-premium">
          <div>{{pledge.fund}}</div>
          <div class="pledge-premium">{{pledge.premium}}</div>
        </div>
        <div class="pledge-order-price">${{pledge.orderPrice}}</div>
        <div class="recurring-label">{{if pledge.isSustainer 'Recurring' 'One-time'}}</div>
      </div>
      {{/each}}
  {{/nypr-card}}
{{/unless}}
<commit_msg>Changing header back to Membership Info<commit_after>{{#unless showPaymentHistory}}
  {{#nypr-card classNames="nypr-membership-info" title="Membership Info" as |card|}}

  {{#card.header as |header|}}
    {{header.title text="Membership Info"}}
  {{/card.header}}

    {{!--
    Possible user states to handle:
    1. Active sustaining pledge (activeSustainingPledges)
    2. Active one-time pledge, e.g. donated within last year (activeOneTimePledges)
    3. Expired/declined sustaining pledge (isLapsedSustainer)
    4. Expired/lapsed one-time pledge (isLapsedOneTimeMember)
    5. Never pledged (isNonMember)
    --}}

    {{#if pledges.isPending}}
      {{animated-loading-icon color="#CCC" classNames="membership-loading-animation"}}
    {{/if}}
    {{#if pledges.isFulfilled}}
      <div class="pledge-order-info">
        {{#if mostRecentSustainingPledgesPerOrderCode}}
          <h2 class="active-donations-header">Active Recurring Donations</h2>
          {{#each mostRecentSustainingPledgesPerOrderCode as |pledge|}}
            <div class="pledge-container">
              <div class="pledge-info-container">
                <div class="pledge-fund-name">
                  <div class="pledge-fund">{{pledge.fund}}</div>
                </div>
                <div class="pledge-info">
                  <div class="pledge-order-price">${{pledge.orderPrice}}{{if pledge.isSustainer ' / month' }}</div>
                  <div class="pledge-hyphen-separator">-</div>
                  <div class="pledge-order-cc-type">{{pledge.creditCardType}} {{pledge.creditCardLast4Digits}}</div>
                </div>
              </div>
              <div class="pledge-update-link">
                <a href="https://pledge3.wnyc.org/donate/membership-sustainer/sustainer/sustainer?order_id={{pledge.orderKey}}">Update</a>
              </div>
            </div>
          {{/each}}

        {{else if activeOneTimePledges}}
          <div class="pledge-active-onetime-member">
            <p class="last-pledge-date">You last donated on <span class="pledge-date">{{moment-format mostRecentPledge.orderDate 'MMMM D, YYYY'}}</span>.</p>
            <a class="pledge-donate-button-link" href="https://pledge3.wnyc.org/donate/membership-sustainer/sustainer/?order_id={{mostRecentPledge.orderKey}}" target="_blank">
              <p class="pledge-donate-button">Make another donation</p>
            </a>
          </div>

        {{else if isLapsedOneTimeMember}}
          <div class="pledge-active-onetime-member">
            <p class="last-pledge-date">It looks like you haven’t given since
              {{moment-format mostRecentPledge.orderDate 'MMM. D, YYYY'}}.  Take
              a moment to renew your membership right now!</p>
            <a class="pledge-donate-button-link"
                href="https://pledge3.wnyc.org/donate/membership-sustainer/sustainer/?order_id={{mostRecentPledge.orderKey}}"
                target="_blank">
              <p class="pledge-donate-button">Donate to renew</p>
            </a>
          </div>

        {{else if isLapsedSustainer}}
          <div class="pledge-lapsed-sustainer">
            <p class="last-pledge-date">Your sustaining donations have expired.</p>
            <a class="pledge-donate-button-link" href="https://pledge3.wnyc.org/donate/membership-sustainer/sustainer/" target="_blank">
              <p class="pledge-donate-button">Become a member</p>
            </a>
          </div>

        {{else}} {{! i.e. isNonMember }}
          <div class="pledge-non-member">
            <p class="last-pledge-date">Our records show you're not a member yet. How about changing that right now, and help pay for all of the great programming you hear on WNYC.</p>
            <a class="pledge-donate-button-link" href="https://pledge3.wnyc.org/donate/membership-sustainer/sustainer/" target="_blank">
              <p class="pledge-donate-button">Become a member</p>
            </a>
          </div>
        {{/if}}
      </div>
    {{/if}}

    <div class="pledge-tools">
      {{#if pledges}}
      <div class="pledge-payment-history"><span {{action (action (mut showPaymentHistory) (not showPaymentHistory))}}>Giving History</span></div>
      {{/if}}
      <div class="pledge-help-link"><span {{action (action (mut disableModal) true)}}>Help</span></div>

    </div>
  {{/nypr-card}}

  {{#if disableModal}}
    {{#nypr-account-modal title="Membership Help" closeAction=(action (mut disableModal) false) as |m|}}
      {{#m.body}}
      <p>
        If you've donated but don't see your donation info here, it may be because you've donated with a different email. You can change your donation email in your Personal Info section.
      </p>
      <p>
        Other questions: <a href="/support/faq/">Check out our FAQs</a><br/>
        Or contact us: <a href="/contact">wnyc.org/contact</a> or 646-829-4000
      </p>
      {{/m.body}}
      {{#m.footer}}
        <button
          class="nypr-account-confirm"
          data-test-selector="confirm-disable"
          {{action (action (mut disableModal) false)}}>Got it!</button>
      {{/m.footer}}
    {{/nypr-account-modal}}
  {{/if}}

{{else}}
  {{#nypr-card classNames="nypr-membership-info pledge-history" as |card|}}
    {{#card.header as |header|}}
      {{header.button
        class="nypr-card-edit-btn pledge-payment-history-back-button"
        click=(action (mut showPaymentHistory) false)
        text=(if showPaymentHistory 'Back' 'Back')}}
      {{header.title text="Giving History" classNames="pledge-history-title"}}
    {{/card.header}}
      {{#each sortedPledges as |pledge|}}
      <div class="pledge-container pledge-history-container">
        <div class="pledge-date">{{moment-format pledge.orderDate 'MMM D, YYYY'}}</div>
        <div class="pledge-fund-and-premium">
          <div>{{pledge.fund}}</div>
          <div class="pledge-premium">{{pledge.premium}}</div>
        </div>
        <div class="pledge-order-price">${{pledge.orderPrice}}</div>
        <div class="recurring-label">{{if pledge.isSustainer 'Recurring' 'One-time'}}</div>
      </div>
      {{/each}}
  {{/nypr-card}}
{{/unless}}

{'fraction_non_alphanumeric': 0.16310204081632654, 'fraction_numerical': 0.0037551020408163266, 'mean_word_length': 2.6096051856216853, 'pattern_counts': {'":': 0, '<': 189, '<?xml version=': 0, '>': 189, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1372839', 'n_tokens_mistral': 4004, 'n_tokens_neox': 3839, 'n_words': 769}