text: import{html as e,PolymerElement as t}from"../../../../@polymer/polymer/polymer-element.js";import"../../../../@polymer/iron-ajax/iron-ajax.js";import"../../../../@polymer/paper-item/paper-item.js";import"../../../../@polymer/polymer/lib/elements/dom-repeat.js";import"../../../elmsln-loading/elmsln-loading.js";import"./lrnapp-block-recent-comments-comment.js";class LrnappBlockRecentComments extends t{static get template(){return e`
        <style include="paper-item-styles">
          :host {
            display: block;
          }
          lrnapp-block-recent-comments-comment .comment-text {
            height: 50px;
            overflow: hidden;
            font-size: 12px;
            font-weight: normal;
          }
        </style>
        <div id="loading">
          <h3>Loading..</h3>
          <elmsln-loading color="grey-text" size="large"></elmsln-loading>
        </div>
        <iron-ajax
          auto=""
          url="{{sourcePath}}"
          handle-as="json"
          last-response="{{response}}"
          on-response="handleResponse"
        ></iron-ajax>
        <template
          is="dom-repeat"
          items="[[_toArray(response.data)]]"
          as="comment"
        >
          <lrnapp-block-recent-comments-comment
            comment-user="{{comment.relationships.author.data}}"
            comment-title="{{comment.attributes.subject}}"
            action-view="{{_getViewLink(comment.relationships.node.data.id)}}"
            date-updated="{{comment.attributes.changed}}"
            class="ferpa-protect"
          >
            <div class="comment-text">[[comment.attributes.body]]</div>
          </lrnapp-block-recent-comments-comment>
        </template>
      `}static get tag(){return"lrnapp-block-recent-comments"}static get properties(){return{elmslnCourse:{type:String},elmslnSection:{type:String},basePath:{type:String},csrfToken:{type:String},endPoint:{type:String},sourcePath:{type:String,notify:!0},response:{type:Array,notify:!0}}}handleResponse(e){this.$.loading.hidden=!0}_getViewLink(e){return this.basePath+"lrnapp-studio-submission/submissions/"+e}_toArray(e){return null==e?[]:Object.keys(e).map((function(t){return e[t]}))}}window.customElements.define(LrnappBlockRecentComments.tag,LrnappBlockRecentComments);export{LrnappBlockRecentComments};