<commit_before><% title @chat_room.name %>
<% activate_nav! :community if params[:id] == 'general' %>
<%= track 'product.chat.viewed', ProductSerializer.new(@product, scope: current_user) %>

<%= render partial: 'shared/navbar', locals: { bounties_link: true } %>

<div class="modal fade"
     id="create-task"
     tabindex="-1"
     role="dialog"
     aria-labelledby="createTask"
     aria-hidden="true">
</div>

<style>
.chat-wrapper {
  background-color: white;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
</style>

<style>

  .channel-list-active,
  .channel-list-active:hover {
    background-color: rgba(0, 0, 0, .2);

    padding: 0 24px;
    margin-left: -24px;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
  }

  .inactive,
  .inactive:hover {
    color: rgba(255, 255, 255, .8) !important;
  }

  .nc {
    background: white;
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;

    display: -webkit-box;      /* OLD - iOS 6-, Safari 3.1-6 */
    display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
    display: -ms-flexbox;      /* TWEENER - IE 10 */
    display: -webkit-flex;     /* NEW - Chrome */
    display: flex;             /* NEW, Spec - Opera 12.1, Firefox 20+ */

    justify-content: center;
  }

  .nc-channels {
    background-color: #353941;
    color: rgba(255, 255, 255, .6);

    min-width: 220px;
    max-width: 220px;

    overflow-x: hidden;
    overflow-y: auto;
  }

  /*.nc-channels a {
    color: rgba(255, 255, 255, .6);
  }*/

  .nc-messages {
    width: 100%;

    display: -webkit-box;      /* OLD - iOS 6-, Safari 3.1-6 */
    display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
    display: -ms-flexbox;      /* TWEENER - IE 10 */
    display: -webkit-flex;     /* NEW - Chrome */
    display: flex;             /* NEW, Spec - Opera 12.1, Firefox 20+ */

    -webkit-flex-direction: column;
    -moz-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;

    flex-wrap: nowrap;
    justify-content: flex-end;
    align-content: stretch;
    align-items: stretch;

    flex-grow: 1;
    -webkit-flex-grow: 1;
  }

  .nc-messages-content {
    overflow-x: hidden;
    overflow-y: auto;
    flex-grow: 1;
    -webkit-flex-grow: 1;
  }

  .nc-messages-footer {
    min-height: 80px;
  }

</style>


<div class="chat-wrapper">

  <div class="nc">

    <div class="nc-channels hidden-xs visible-sm-block visible-md-block visible-lg-block">

      <% if @chat_room.product %>
        <a class="block px3 mt2 mb1" href="<%= product_path(@chat_room.product) %>" target="_blank">
          <h4 class="mt0 mb0" style="color:rgba(255,255,255,.6)">
            <span class="icon icon-chevron-left icon-left mxn1"></span>
            <%= @chat_room.product.name %>
          </h4>
        </a>

        <a class="block px3 mb2" href="<%= product_wips_path(@chat_room.product) %>" target="_blank">
          <h5 class="mt0 mb0" style="color:rgba(255,255,255,.6)">
            <%= @chat_room.product.name %> Bounties
          </h5>
        </a>

        <hr class="mt0 mb0" style="border-color:rgba(0,0,0,0.1)">
      <% end %>

      <div class="p3">
        <h5 class="mt0 mb2" style="color:rgba(255,255,255,.6)">Channels</h5>
        <%= react_component 'ChannelsList', currentRoom: @chat_room.key %>
      </div>

      <hr class="mt0 mb0" style="border-color:rgba(0,0,0,0.1)">

      <div class="p3">
        <h5 class="mt0 mb2" style="color:rgba(255,255,255,.6)">People</h5>
        <div class="js-members"></div>
      </div>
    </div>

    <div class="nc-messages">
      <div class="nc-messages-content">

        <div class="chat js-chat">
          <div class="py2 px3">
            <div class="align-center mb2">
              <a class="btn btn-default btn-block btn-sm js-chat-load-more" href="<%= api_chat_room_comments_path(@chat_room, format: 'json') %>" style="margin-top: 36px;">Load more</a>
            </div>

            <div class="js-activity-stream"></div>
          </div>
        </div>

      </div>

      <div class="nc-messages-footer px3 py2">

        <div class="js-chat-actions">
          <%= render 'discussions/chat_box' %>
         </div>

      </div>

    </div>
  </div>

</div>


<% content_for :javascript do %>
  <script>
    <% if @chat_room.product %>
      app.product = new Product(<%= json @chat_room.product, scope: current_user %>);
    <% end %>
    app.chatRoom = <%== ChatRoomSerializer.new(@chat_room).to_json %>;

    <% if signed_in? %>
      app.chatRoom.readRaptorChatPath = '<%== ReadraptorTracker.new(@chat_room.key, current_user.id).url %>';
    <% end %>

    $(document).ready(function() {
      var activityStream = new ActivityStream(<%=
        json @activity_stream.map {|a, _|
          ActivitySerializer.new(a, scope: current_user)
        }
      %>);
      activityStream.url = '<%= api_chat_room_comments_path(@chat_room) %>';
      activityStream.id = '<%= @chat_room.id %>'
      activityStream.product = new Product(<%= json @product, scope: current_user %>);

      pusher.connection.bind('connected', function() {
        activityStream.listenForRemote(pusher, pusher.connection);

        window.presenceChannel = pusher.subscribe('presence-' + activityStream.channelName())

        $('.js-members').each(function() {
          var component = React.render(
            MembersView({
              channel: presenceChannel,
              url: '<%= api_chat_room_users_path(@chat_room) %>'
            }),
            this
          );
        });

        var alreadyJoined = {};

        presenceChannel.bind(
          'pusher:member_added',
          function memberJoined(member) {<commit_msg>Allow chat rooms to not have a product<commit_after><% title @chat_room.name %>
<% activate_nav! :community if params[:id] == 'general' %>
<%= track 'product.chat.viewed', ProductSerializer.new(@product, scope: current_user) %>

<%= render partial: 'shared/navbar', locals: { bounties_link: true } %>

<div class="modal fade"
     id="create-task"
     tabindex="-1"
     role="dialog"
     aria-labelledby="createTask"
     aria-hidden="true">
</div>

<style>
.chat-wrapper {
  background-color: white;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
</style>

<style>

  .channel-list-active,
  .channel-list-active:hover {
    background-color: rgba(0, 0, 0, .2);

    padding: 0 24px;
    margin-left: -24px;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
  }

  .inactive,
  .inactive:hover {
    color: rgba(255, 255, 255, .8) !important;
  }

  .nc {
    background: white;
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;

    display: -webkit-box;      /* OLD - iOS 6-, Safari 3.1-6 */
    display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
    display: -ms-flexbox;      /* TWEENER - IE 10 */
    display: -webkit-flex;     /* NEW - Chrome */
    display: flex;             /* NEW, Spec - Opera 12.1, Firefox 20+ */

    justify-content: center;
  }

  .nc-channels {
    background-color: #353941;
    color: rgba(255, 255, 255, .6);

    min-width: 220px;
    max-width: 220px;

    overflow-x: hidden;
    overflow-y: auto;
  }

  /*.nc-channels a {
    color: rgba(255, 255, 255, .6);
  }*/

  .nc-messages {
    width: 100%;

    display: -webkit-box;      /* OLD - iOS 6-, Safari 3.1-6 */
    display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
    display: -ms-flexbox;      /* TWEENER - IE 10 */
    display: -webkit-flex;     /* NEW - Chrome */
    display: flex;             /* NEW, Spec - Opera 12.1, Firefox 20+ */

    -webkit-flex-direction: column;
    -moz-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;

    flex-wrap: nowrap;
    justify-content: flex-end;
    align-content: stretch;
    align-items: stretch;

    flex-grow: 1;
    -webkit-flex-grow: 1;
  }

  .nc-messages-content {
    overflow-x: hidden;
    overflow-y: auto;
    flex-grow: 1;
    -webkit-flex-grow: 1;
  }

  .nc-messages-footer {
    min-height: 80px;
  }

</style>


<div class="chat-wrapper">

  <div class="nc">

    <div class="nc-channels hidden-xs visible-sm-block visible-md-block visible-lg-block">

      <% if @chat_room.product %>
        <a class="block px3 mt2 mb1" href="<%= product_path(@chat_room.product) %>" target="_blank">
          <h4 class="mt0 mb0" style="color:rgba(255,255,255,.6)">
            <span class="icon icon-chevron-left icon-left mxn1"></span>
            <%= @chat_room.product.name %>
          </h4>
        </a>

        <a class="block px3 mb2" href="<%= product_wips_path(@chat_room.product) %>" target="_blank">
          <h5 class="mt0 mb0" style="color:rgba(255,255,255,.6)">
            <%= @chat_room.product.name %> Bounties
          </h5>
        </a>

        <hr class="mt0 mb0" style="border-color:rgba(0,0,0,0.1)">
      <% end %>

      <div class="p3">
        <h5 class="mt0 mb2" style="color:rgba(255,255,255,.6)">Channels</h5>
        <%= react_component 'ChannelsList', currentRoom: @chat_room.key %>
      </div>

      <hr class="mt0 mb0" style="border-color:rgba(0,0,0,0.1)">

      <div class="p3">
        <h5 class="mt0 mb2" style="color:rgba(255,255,255,.6)">People</h5>
        <div class="js-members"></div>
      </div>
    </div>

    <div class="nc-messages">
      <div class="nc-messages-content">

        <div class="chat js-chat">
          <div class="py2 px3">
            <div class="align-center mb2">
              <a class="btn btn-default btn-block btn-sm js-chat-load-more" href="<%= api_chat_room_comments_path(@chat_room, format: 'json') %>" style="margin-top: 36px;">Load more</a>
            </div>

            <div class="js-activity-stream"></div>
          </div>
        </div>

      </div>

      <div class="nc-messages-footer px3 py2">

        <div class="js-chat-actions">
          <%= render 'discussions/chat_box' %>
         </div>

      </div>

    </div>
  </div>

</div>


<% content_for :javascript do %>
  <script>
    <% if @chat_room.product %>
      app.product = new Product(<%= json @chat_room.product, scope: current_user %>);
    <% end %>
    app.chatRoom = <%== ChatRoomSerializer.new(@chat_room).to_json %>;

    <% if signed_in? %>
      app.chatRoom.readRaptorChatPath = '<%== ReadraptorTracker.new(@chat_room.key, current_user.id).url %>';
    <% end %>

    $(document).ready(function() {
      var activityStream = new ActivityStream(<%=
        json @activity_stream.map {|a, _|
          ActivitySerializer.new(a, scope: current_user)
        }
      %>);
      activityStream.url = '<%= api_chat_room_comments_path(@chat_room) %>';
      activityStream.id = '<%= @chat_room.id %>'
      activityStream.product = app.product

      pusher.connection.bind('connected', function() {
        activityStream.listenForRemote(pusher, pusher.connection);

        window.presenceChannel = pusher.subscribe('presence-' + activityStream.channelName())

        $('.js-members').each(function() {
          var component = React.render(
            MembersView({
              channel: presenceChannel,
              url: '<%= api_chat_room_users_path(@chat_room) %>'
            }),
            this
          );
        });

        var alreadyJoined = {};

        presenceChannel.bind(
          'pusher:member_added',
          function memberJoined(member) {
{'fraction_non_alphanumeric': 0.17122514543717982, 'fraction_numerical': 0.03177910914300599, 'mean_word_length': 2.32986412257878, 'pattern_counts': {'":': 0, '<': 160, '<?xml version=': 0, '>': 160, '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': '2867558', 'n_tokens_mistral': 4331, 'n_tokens_neox': 3905, 'n_words': 796}