<commit_before>FactlinkApp.module "FacebookRenewal", (FacebookRenewal, FactlinkApp, Backbone, Marionette, $, _) ->

  class IframeView extends Backbone.Marionette.ItemView
    template:
      text: """
        <iframe src="/auth/facebook"></iframe>
      """

  FacebookRenewal.addInitializer ->
    if currentUser?.get('services')['facebook']
      checkRenewal()
      currentUser.on 'change', checkRenewal

  timeout     = null
  justRenewed = false

  almostExpired = ->
    days         = 24*60*60*1000
    expiresAt    = currentUser.get('services')['facebook_expiresAt']
    expiryDate   = new Date(expiresAt*1000)
    timeToExpiry = expiryDate - new Date

    not justRenewed and timeToExpiry < 14*days

  tryRenewal = ->
    return if timeout
    FactlinkApp.facebookRenewalRegion.show new IframeView
    timeout = setTimeout tryManualRenewal, 10000<commit_msg>fix typo<commit_after>FactlinkApp.module "FacebookRenewal", (FacebookRenewal, FactlinkApp, Backbone, Marionette, $, _) ->

  class IframeView extends Backbone.Marionette.ItemView
    template:
      text: """
        <iframe src="/auth/facebook"></iframe>
      """

  FacebookRenewal.addInitializer ->
    if currentUser?.get('services')['facebook']
      checkRenewal()
      currentUser.on 'change', checkRenewal

  timeout     = null
  justRenewed = false

  almostExpired = ->
    days         = 24*60*60*1000
    expiresAt    = currentUser.get('services')['facebook_expires_at']
    expiryDate   = new Date(expiresAt*1000)
    timeToExpiry = expiryDate - new Date

    not justRenewed and timeToExpiry < 14*days

  tryRenewal = ->
    return if timeout
    FactlinkApp.facebookRenewalRegion.show new IframeView
    timeout = setTimeout tryManualRenewal, 10000
{'fraction_non_alphanumeric': 0.10380622837370242, 'fraction_numerical': 0.02422145328719723, 'mean_word_length': 3.4260204081632653, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6432854', 'n_tokens_mistral': 622, 'n_tokens_neox': 539, 'n_words': 106}