<commit_before>class ActivityListItemView extends KDListItemView

  getActivityChildConstructors = ->
    JStatusUpdate       : StatusActivityItemView
    JCodeSnip           : CodesnipActivityItemView
    JQuestionActivity   : QuestionActivityItemView
    JDiscussion         : DiscussionActivityItemView
    JLink               : LinkActivityItemView
    JTutorial           : TutorialActivityItemView
    JBlogPost           : BlogPostActivityItemView

    NewMemberBucketData   : NewMemberBucketView

  getActivityChildCssClass = ->

    CFollowerBucket           : "system-message"
    CFolloweeBucket           : "system-message"
    CNewMemberBucket          : "system-message"
    CInstallerBucket          : "system-message"

    CFollowerBucketActivity   : "system-message"
    CFolloweeBucketActivity   : "system-message"
    CNewMemberBucketActivity  : "system-message"
    CInstallerBucketActivity  : "system-message"
    NewMemberBucketData       : "system-message"

  getBucketMap =->
    JAccount  : AccountFollowBucketItemView
    JTag      : TagFollowBucketItemView
    JApp      : AppFollowBucketItemView

  constructor:(options = {},data)->

    options.type = "activity"

    super options, data

    {constructorName} = data.bongo_
    @setClass getActivityChildCssClass()[constructorName]

    @bindTransitionEnd()

  viewAppended:->
    @addChildView @getData()

  addChildView:(data, callback)->
    # return
    return unless data.bongo_
    {constructorName} = data.bongo_

    childConstructor =
      if /^CNewMemberBucket$/.test constructorName
        NewMemberBucketItemView
        # KDView
      else if /Bucket$/.test constructorName
        getBucketMap()[data.sourceName]
      else
        getActivityChildConstructors()[constructorName]

    if childConstructor
      childView = new childConstructor
        delegate : @
      , data
      @addSubView childView
      callback?()

  partial:-> ''

  show:(callback)->

    @getData().fetchTeaser? (err, teaser)=>
      @addChildView teaser, => @slideIn()

  slideIn:(callback=noop)->
    @once 'transitionend', callback.bind this
    @unsetClass 'hidden-item'

  slideOut:(callback=noop)->
    @once 'transitionend', callback.bind this
    @setClass 'hidden-item'<commit_msg>JNewStatusUpdate: add defensive checks for new status update<commit_after>class ActivityListItemView extends KDListItemView

  getActivityChildConstructors = ->
    JStatusUpdate       : StatusActivityItemView
    JCodeSnip           : CodesnipActivityItemView
    JQuestionActivity   : QuestionActivityItemView
    JDiscussion         : DiscussionActivityItemView
    JLink               : LinkActivityItemView
    JTutorial           : TutorialActivityItemView
    JBlogPost           : BlogPostActivityItemView

    NewMemberBucketData   : NewMemberBucketView

  getActivityChildCssClass = ->

    CFollowerBucket           : "system-message"
    CFolloweeBucket           : "system-message"
    CNewMemberBucket          : "system-message"
    CInstallerBucket          : "system-message"

    CFollowerBucketActivity   : "system-message"
    CFolloweeBucketActivity   : "system-message"
    CNewMemberBucketActivity  : "system-message"
    CInstallerBucketActivity  : "system-message"
    NewMemberBucketData       : "system-message"

  getBucketMap =->
    JAccount  : AccountFollowBucketItemView
    JTag      : TagFollowBucketItemView
    JApp      : AppFollowBucketItemView

  constructor:(options = {},data)->

    options.type = "activity"

    super options, data

    {constructorName} = data.bongo_
    @setClass getActivityChildCssClass()[constructorName]

    @bindTransitionEnd()

  viewAppended:->
    @addChildView @getData()

  addChildView:(data, callback)->
    # return
    return unless data?.bongo_
    {constructorName} = data.bongo_

    childConstructor =
      if /^CNewMemberBucket$/.test constructorName
        NewMemberBucketItemView
        # KDView
      else if /Bucket$/.test constructorName
        getBucketMap()[data.sourceName]
      else
        getActivityChildConstructors()[constructorName]

    if childConstructor
      childView = new childConstructor
        delegate : @
      , data
      @addSubView childView
      callback?()

  partial:-> ''

  show:(callback)->

    @getData().fetchTeaser? (err, teaser)=>
      if teaser
        @addChildView teaser, => @slideIn()

  slideIn:(callback=noop)->
    @once 'transitionend', callback.bind this
    @unsetClass 'hidden-item'

  slideOut:(callback=noop)->
    @once 'transitionend', callback.bind this
    @setClass 'hidden-item'
{'fraction_non_alphanumeric': 0.08268059181897303, 'fraction_numerical': 0.0, 'mean_word_length': 2.88917089678511, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, 'https://': 0, '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': '7324165', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1232, 'n_words': 238}