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AEKC,EAAAA,EAAAA,IADArC,EAAAsC,KAAKC,EAAE,kCAAD,gBALjBJ,EAAAA,EAAAA,QAOMD,EAAAA,EAAAA,IASK,KATLM,EASK,gBARH9C,EAAAA,EAAAA,IAOKuC,EAAAA,GAAA,MAfbQ,EAAAA,EAAAA,IAQ8BzC,EAAAsB,UAAXoB,KAAO,WAAlBhD,EAAAA,EAAAA,IAOK,MAP4BU,IAAKsC,EAAQC,IAAAA,EAC5CC,EAAAA,EAAAA,IAKgCC,EAAA,CALtBF,GAAID,EAAQC,GACZ,oBAAmBD,EAAQI,iBAC3B,yBAAwBJ,EAAQK,qBAChC,aAAYL,EAAQM,UACpB,gBAAeC,EAAAnC,aACfoC,KAAMR,EAAQQ,MAAAA,KAAAA,EAAAA,CAAAA,KAAAA,oBAAAA,yBAAAA,aAAAA,gBAAAA,cAAAA,QAAAA,EAAAA,KAAAA,EAAAA,IAdlCf,EAAAA,EAAAA,OAiBiBnC,EAAAwB,WAAQ,WAAnB9B,EAAAA,EAAAA,IAIM,MAJNyD,EAIM,EAHJP,EAAAA,EAAAA,IAEcQ,EAAA,CAFDxD,MAAM,aAAcC,QAAOwD,EAAAzB,mBAAAA,CAlBhD0B,SAAAC,EAAAA,EAAAA,KAmBU,IAAkD,EAnB5DpB,EAAAA,EAAAA,KAAAE,EAAAA,EAAAA,IAmBarC,EAAAsC,KAAKC,EAAE,uCAAD,MAnBnBiB,EAAA,sBAAAC,EAAAA,EAAAA,IAAA,cAAAA,EAAAA,EAAAA,IAAA,aCOA,O","sources":["webpack://agra/./app/javascript/components/buttons/link-button.vue","webpack://agra/./app/javascript/components/buttons/link-button.vue?a3b9","webpack://agra/./app/javascript/petition/comments/comments-list.vue","webpack://agra/./app/javascript/petition/comments/comments-list.vue?2ce3"],"sourcesContent":["<template>\n  <button type=\"button\" class=\"btn btn-link\" @click=\"$emit('click')\">\n    <slot />\n  </button>\n</template>\n\n<script>\nexport default {\n  emits: ['click']\n}\n</script>\n","import { render } from \"./link-button.vue?vue&type=template&id=bbab6e5a\"\nimport script from \"./link-button.vue?vue&type=script&lang=js\"\nexport * from \"./link-button.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"../../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","<template>\n  <div class=\"comments\">\n    <template v-if=\"comments.length\">\n      <hr>\n      <h2 class=\"comments-box-title mt-5\">\n        {{ i18n.t('petitions.comments.index.text') }}\n      </h2>\n      <ul class=\"comments-box list-unstyled mt30\">\n        <li v-for=\"comment in comments\" :key=\"comment.id\">\n          <comment :id=\"comment.id\"\n                   :awaiting-approval=\"comment.awaitingApproval\"\n                   :commenter-display-name=\"comment.commenterDisplayName\"\n                   :created-at=\"comment.createdAt\"\n                   :petition-slug=\"petitionSlug\"\n                   :text=\"comment.text\" />\n        </li>\n      </ul>\n      <div v-if=\"nextPage\" class=\"d-flex justify-content-end\">\n        <link-button class=\"small-text\" @click=\"fetchMoreComments\">\n          {{ i18n.t('petitions.comments.index.read_more') }}\n        </link-button>\n      </div>\n    </template>\n  </div>\n</template>\n\n<script>\nimport Comment from './comment'\nimport LinkButton from '@/components/buttons/link-button'\nimport { mapActions, mapMutations, mapState } from 'vuex'\n\nexport default {\n  components: { Comment, LinkButton },\n\n  props: {\n    initialComments: {\n      type: Array,\n      required: true\n    },\n    moreComments: {\n      type: Boolean,\n      required: true\n    },\n    petitionSlug: {\n      type: String,\n      required: true\n    }\n  },\n\n  computed: {\n    ...mapState('comments', ['comments', 'nextPage'])\n  },\n\n  mounted() {\n    this.setPetitionSlug(this.petitionSlug)\n    this.initializeComments({comments: this.initialComments, currentPage: 1, nextPage: this.moreComments ? 2 : null})\n  },\n\n  methods: {\n    ...mapActions('comments', ['fetchNextPageOfComments']),\n    ...mapMutations('comments', ['initializeComments', 'setPetitionSlug']),\n    fetchMoreComments() {\n      this.fetchNextPageOfComments(this.petitionSlug)\n    }\n  }\n}\n</script>\n","import { render } from \"./comments-list.vue?vue&type=template&id=9dcb03d2\"\nimport script from \"./comments-list.vue?vue&type=script&lang=js\"\nexport * from \"./comments-list.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"../../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__"],"names":["emits","_createElementBlock","type","class","onClick","_cache","$event","_ctx","$emit","_renderSlot","$slots","key","components","Comment","LinkButton","props","initialComments","Array","required","moreComments","Boolean","petitionSlug","String","computed","mapState","mounted","this","setPetitionSlug","initializeComments","comments","currentPage","nextPage","methods","mapActions","mapMutations","fetchMoreComments","fetchNextPageOfComments","__exports__","_hoisted_1","length","_Fragment","_createElementVNode","_createTextVNode","_hoisted_2","_toDisplayString","i18n","t","_hoisted_3","_renderList","comment","id","_createVNode","_component_comment","awaitingApproval","commenterDisplayName","createdAt","$props","text","_hoisted_4","_component_link_button","$options","default","_withCtx","_","_createCommentVNode"],"sourceRoot":""}