{"size": 77353, "ext": "js", "max_stars_repo_path": "client/component/engage_article/build/tui_bundle.legacy.js", "max_stars_repo_name": "mohitjangra6017/tx_data", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/component/engage_article/build/tui_bundle.legacy.js", "max_issues_repo_name": "mohitjangra6017/tx_data", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "client/component/engage_article/build/tui_bundle.legacy.js", "max_forks_repo_name": "mohitjangra6017/tx_data", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 77353.0, "max_line_length": 77353, "alphanum_fraction": 0.720385764}
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(i,a,function(t){return e[t]}.bind(null,a));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="0fXA")}({"+1Jo":function(e,t){e.exports=tui.require("totara_engage/components/icons/access/computed/AccessIcon")},"+MEP":function(e,t){e.exports=tui.require("tui/components/profile/MiniProfileCard")},"/w+c":function(e,t){e.exports=tui.require("engage_article/components/form/EditArticleContentForm")},"0fXA":function(e,t,n){!function(){"use strict";"undefined"!=typeof tui&&tui._bundle.isLoaded("engage_article")?console.warn('[tui bundle] The bundle "engage_article" is already loaded, skipping initialisation.'):(tui._bundle.register("engage_article"),tui._bundle.addModulesFromContext("engage_article/components",n("JCx+")),tui._bundle.addModulesFromContext("engage_article/pages",n("LpuE")))}()},"12HA":function(e,t){e.exports=tui.require("tui/config")},"2Tgs":function(e,t){},"2wGN":function(e,t,n){"use strict";n.r(t);var i=n("g0Fk"),a=n.n(i),r=n("/w+c"),o=n.n(r),s=n("H/tB"),l=n.n(s),c=n("dkcK"),d=n("d4pu"),u={components:{InlineEditing:a.a,EditArticleForm:o.a},props:{resourceId:{type:[String,Number],required:!0},title:{type:String,required:!0},content:{type:String,required:!0},updateAble:{type:Boolean,required:!0}},data:function(){return{editing:!1,submitting:!1}},mounted:function(){this.$_scan()},updated:function(){this.$_scan()},methods:{$_scan:function(){var e=this;this.$nextTick().then((function(){var t=e.$refs.content;t&&l.a.scan(t)}))},updateArticle:function(e){var t=this,n=e.content,i=e.format,a=e.itemId;this.submitting=!0,this.$apollo.mutate({mutation:c.a,variables:{resourceid:this.resourceId,content:n,format:i,draft_id:a},updateQuery:function(e,n){e.writeQuery({query:d.a,variables:{resourceid:t.resourceId},data:n})}}).finally((function(){t.editing=!1,t.submitting=!1}))}}},m=(n("hh05"),n("KHd+")),v=function(e){e.options.__langStrings={engage_article:["editarticlecontent"]}},k=Object(m.a)(u,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"tui-engageArticleContent"},[n("InlineEditing",{directives:[{name:"show",rawName:"v-show",value:!e.editing,expression:"!editing"}],attrs:{"button-aria-label":e.$str("editarticlecontent","engage_article",e.title),"full-width":!0,"restricted-mode":!0,"update-able":e.updateAble},on:{click:function(t){e.editing=!0}}},[n("div",{ref:"content",staticClass:"tui-engageArticleContent__content",attrs:{slot:"content"},domProps:{innerHTML:e._s(e.content)},slot:"content"})]),e._v(" "),e.editing?n("EditArticleForm",{attrs:{"resource-id":e.resourceId,submitting:e.submitting},on:{submit:e.updateArticle,cancel:function(t){e.editing=!1}}}):e._e()],1)}),[],!1,null,null,null);"function"==typeof v&&v(k),k.options.__hasBlocks={script:!0,template:!0};t.default=k.exports},"2wx7":function(e,t){e.exports=tui.require("editor_weka/components/Weka")},"4Lp8":function(e,t){e.exports=tui.require("totara_engage/mixins/container_mixin")},"5h9J":function(e,t){e.exports=tui.require("tui/components/buttons/ButtonIcon")},"5v9U":function(e,t){e.exports=tui.require("totara_comment/components/box/SidePanelCommentBox")},"6pgr":function(e,t){},"6v2W":function(e,t,n){"use strict";n.r(t);var i=n("W9ne"),a=n.n(i),r=n("fPwS"),o=n.n(r),s=n("tyu8"),l={components:{ResourcePlaylistBox:a.a,Loading:o.a},props:{resourceId:{type:[String,Number],required:!0}},data:function(){return{loading:!1,show:!0}},computed:{urlSource:function(){return s.UrlSourceType.article(this.resourceId)}}},c=(n("AVNA"),n("KHd+")),d=function(e){e.options.__langStrings={engage_article:["appears_in"]}},u=Object(c.a)(l,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"tui-engageArticlePlaylistBox"},[e.show?[n("p",{staticClass:"tui-engageArticlePlaylistBox__label"},[n("span",[e._v("\n        "+e._s(e.$str("appears_in","engage_article"))+"\n      ")]),e._v(" "),e.loading?n("Loading"):e._e()],1),e._v(" "),n("ResourcePlaylistBox",{staticClass:"tui-engageArticlePlaylistBox__playlistsBox",attrs:{"resource-id":e.resourceId,"url-source":e.urlSource},on:{"update-has-playlists":function(t){e.show=t},"load-records":function(t){e.loading=t}}})]:e._e()],2)}),[],!1,null,null,null);"function"==typeof d&&d(u),u.options.__hasBlocks={script:!0,template:!0};t.default=u.exports},"7YYo":function(e,t,n){"use strict";n.r(t);n("NsSX");var i=n("KHd+"),a=Object(i.a)({},(function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"tui-engageArticleSeparator"})}),[],!1,null,null,null);a.options.__hasBlocks={script:!1,template:!0};t.default=a.exports},AVNA:function(e,t){},BMhI:function(e,t,n){"use strict";n.r(t);var i={mixins:[n("tyu8").imageMixin]},a=(n("BjeO"),n("KHd+")),r=function(e){e.options.__langStrings={engage_article:["image_alt"]}},o=Object(a.a)(i,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"tui-engageArticleImage"},[t("img",{staticClass:"tui-engageArticleImage__img",attrs:{src:this.image,alt:this.$str("image_alt","engage_article",this.name)}})])}),[],!1,null,null,null);"function"==typeof r&&r(o),o.options.__hasBlocks={script:!0,template:!0};t.default=o.exports},BN8m:function(e,t){e.exports=tui.require("tui/components/buttons/ButtonGroup")},BjeO:function(e,t){},"C+/B":function(e,t){e.exports=tui.require("tui/components/modal/ConfirmationModal")},EtS8:function(e,t,n){"use strict";n.r(t);var i=n("ZYet"),a=n.n(i),r=n("K59g"),o=n.n(r),s=n("vyVp"),l={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"engage_article_create_article"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"content"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_text"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"format"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"access"}},type:{kind:"NamedType",name:{kind:"Name",value:"totara_engage_access"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"topics"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timeview"}},type:{kind:"NamedType",name:{kind:"Name",value:"totara_engage_timeview"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shares"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"totara_engage_recipient_in"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"draft_id"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"article"},name:{kind:"Name",value:"engage_article_create"},arguments:[{kind:"Argument",name:{kind:"Name",value:"content"},value:{kind:"Variable",name:{kind:"Name",value:"content"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"Variable",name:{kind:"Name",value:"format"}}},{kind:"Argument",name:{kind:"Name",value:"access"},value:{kind:"Variable",name:{kind:"Name",value:"access"}}},{kind:"Argument",name:{kind:"Name",value:"topics"},value:{kind:"Variable",name:{kind:"Name",value:"topics"}}},{kind:"Argument",name:{kind:"Name",value:"timeview"},value:{kind:"Variable",name:{kind:"Name",value:"timeview"}}},{kind:"Argument",name:{kind:"Name",value:"shares"},value:{kind:"Variable",name:{kind:"Name",value:"shares"}}},{kind:"Argument",name:{kind:"Name",value:"draft_id"},value:{kind:"Variable",name:{kind:"Name",value:"draft_id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"resource"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"access"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"time"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"context_id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fullname"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profileimagealt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profileimageurl"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"HTML"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"format"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"image"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owned"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timeview"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"sharedbycount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reacted"},arguments:[],directives:[]}]}}]}}]},c=n("tyu8"),d=n("4Lp8"),u=n.n(d),m={components:{ArticleForm:a.a,AccessForm:o.a},mixins:[u.a],props:{showNotification:{type:Boolean}},data:function(){return{stage:0,maxStage:1,article:{name:"",content:null,itemId:null},submitting:!1,defaultAccess:"PRIVATE"}},computed:{privateDisabled:function(){return!!this.containerValues.access&&!c.AccessManager.isPrivate(this.containerValues.access)},restrictedDisabled:function(){return!!this.containerValues.access&&c.AccessManager.isPublic(this.containerValues.access)}},methods:{next:function(e){var t=e.content,n=e.name,i=e.itemId;this.stage<this.maxStage&&(this.stage+=1),this.article.content=t,this.article.name=n,this.article.itemId=i,this.$emit("change-title",this.stage)},back:function(){this.stage>0&&(this.stage-=1),this.$emit("change-title",this.stage)},done:function(e){var t=this,n=e.access,i=e.topics,a=e.timeView,r=e.shares;this.submitting=!0;var o={content:this.article.content,name:this.article.name,access:n,topics:i.map((function(e){return e.id})),shares:r,draft_id:this.article.itemId};a&&(o.timeview=a),this.$apollo.mutate({mutation:l,refetchQueries:["totara_engage_contribution_cards","container_workspace_contribution_cards","container_workspace_shared_cards"],variables:o,update:function(e,n){var i=n.data.article.resource.id;t.$emit("done",{resourceId:i})}}).then((function(e){e.data.article&&t.showNotification&&!t.container&&Object(s.notify)({message:t.$str("created","engage_article"),type:"success"}),t.$emit("cancel")})).finally((function(){t.submitting=!1}))}}},v=(n("2Tgs"),n("KHd+")),k=function(e){e.options.__langStrings={engage_article:["created"]}},g=Object(v.a)(m,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"tui-engageCreateArticle"},[n("ArticleForm",{directives:[{name:"show",rawName:"v-show",value:0===e.stage,expression:"stage === 0"}],attrs:{"article-name":e.article.name,"article-content":e.article.content},on:{next:e.next,cancel:function(t){return e.$emit("cancel")},"unsaved-changes":function(t){return e.$emit("unsaved-changes")}}}),e._v(" "),n("AccessForm",{directives:[{name:"show",rawName:"v-show",value:1===e.stage,expression:"stage === 1"}],attrs:{"item-id":"0",component:"engage_article","show-back":!0,submitting:e.submitting,"selected-access":e.containerValues.access||e.defaultAccess,"private-disabled":e.privateDisabled,"restricted-disabled":e.restrictedDisabled,container:e.container,"enable-time-view":!0},on:{done:e.done,back:e.back,cancel:function(t){return e.$emit("cancel")}}})],1)}),[],!1,null,null,null);"function"==typeof k&&k(g),g.options.__hasBlocks={script:!0,template:!0};t.default=g.exports},FhEx:function(e,t){e.exports=tui.require("totara_engage/components/sidepanel/media/MediaSetting")},"H/tB":function(e,t){e.exports=tui.require("tui/tui")},I9Nn:function(e,t){e.exports=tui.require("engage_article/components/content/ArticleTitle")},"JCx+":function(e,t,n){var i={"./CreateArticle":"EtS8","./CreateArticle.vue":"EtS8","./card/ArticleCard":"f0XX","./card/ArticleCard.vue":"f0XX","./card/ArticleCardImage":"BMhI","./card/ArticleCardImage.vue":"BMhI","./card/RelatedCard":"ZwY9","./card/RelatedCard.vue":"ZwY9","./content/ArticleContent":"2wGN","./content/ArticleContent.vue":"2wGN","./content/ArticleTitle":"Z5qJ","./content/ArticleTitle.vue":"Z5qJ","./form/ArticleForm":"Y4zg","./form/ArticleForm.vue":"Y4zg","./form/EditArticleContentForm":"U1rY","./form/EditArticleContentForm.vue":"U1rY","./form/EditArticleTitleForm":"y4Yj","./form/EditArticleTitleForm.vue":"y4Yj","./separator/ArticleSeparator":"7YYo","./separator/ArticleSeparator.vue":"7YYo","./sidepanel/ArticleSidePanel":"n4/j","./sidepanel/ArticleSidePanel.vue":"n4/j","./sidepanel/Related":"siqe","./sidepanel/Related.vue":"siqe","./sidepanel/content/ArticlePlaylistBox":"6v2W","./sidepanel/content/ArticlePlaylistBox.vue":"6v2W"};function a(e){var t=r(e);return n(t)}function r(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}a.keys=function(){return Object.keys(i)},a.resolve=r,e.exports=a,a.id="JCx+"},JXQf:function(e,t){e.exports=tui.require("tui/components/loading/Loader")},K59g:function(e,t){e.exports=tui.require("totara_engage/components/form/AccessForm")},KGcv:function(e,t){e.exports=tui.require("tui/components/dropdown/DropdownItem")},"KHd+":function(e,t,n){"use strict";function i(e,t,n,i,a,r,o,s){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),o?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},c._ssrRegister=l):a&&(l=s?function(){a.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:a),l)if(c.functional){c._injectStyles=l;var d=c.render;c.render=function(e,t){return l.call(t),d(e,t)}}else{var u=c.beforeCreate;c.beforeCreate=u?[].concat(u,l):[l]}return{exports:e,options:c}}n.d(t,"a",(function(){return i}))},LJiL:function(e,t){e.exports=tui.require("totara_engage/components/sidepanel/access/AccessDisplay")},LpuE:function(e,t,n){var i={"./ArticleView":"eQMv","./ArticleView.vue":"eQMv"};function a(e){var t=r(e);return n(t)}function r(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}a.keys=function(){return Object.keys(i)},a.resolve=r,e.exports=a,a.id="LpuE"},Mxwz:function(e,t){},NsSX:function(e,t){},OMaT:function(e,t){},OhEh:function(e,t){e.exports=tui.require("engage_article/components/sidepanel/content/ArticlePlaylistBox")},QGXx:function(e,t){e.exports=tui.require("totara_engage/components/buttons/DoneCancelGroup")},QOO2:function(e,t){e.exports=tui.require("tui/components/icons/Like")},"T+9K":function(e,t){e.exports=tui.require("totara_engage/components/page/LayoutOneColumnContentWithSidePanel")},U1rY:function(e,t,n){"use strict";n.r(t);var i=n("nEm4"),a=n.n(i),r=n("JXQf"),o=n.n(r),s=n("2wx7"),l=n.n(s),c=n("kkOl"),d=n.n(c),u=n("QGXx"),m=n.n(u),v=n("oMGV"),k=n.n(v),g={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"engage_article_draft_item"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"resourceid"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"draft"},name:{kind:"Name",value:"engage_article_draft_item"},arguments:[{kind:"Argument",name:{kind:"Name",value:"resourceid"},value:{kind:"Variable",name:{kind:"Name",value:"resourceid"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"resourceid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"content"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"format"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"file_item_id"},arguments:[],directives:[]}]}}]}}]},p={components:{DoneCancelGroup:m.a,Form:a.a,Loader:o.a,UnsavedChangesWarning:k.a,Weka:l.a},props:{resourceId:{type:[String,Number],required:!0},submitting:Boolean},apollo:{draft:{query:g,fetchPolicy:"network-only",variables:function(){return{resourceid:this.resourceId}},result:function(e){var t=e.data.draft.content;t&&(this.content=d.a.fromDoc(JSON.parse(t)))}}},data:function(){return{draft:{},editorMounted:!1,content:d.a.empty()}},methods:{submit:function(){var e={resourceId:this.resourceId,content:JSON.stringify(this.content.getDoc()),format:this.draft.format,itemId:this.content.fileStorageItemId};this.$emit("submit",e)}}},f=(n("ql3h"),n("KHd+")),_=Object(f.a)(p,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Form",{staticClass:"tui-engageEditArticleContentForm"},[n("Loader",{attrs:{fullpage:!0,loading:!e.editorMounted}}),e._v(" "),e.content.isEmpty||e.submitting?e._e():n("UnsavedChangesWarning",{attrs:{value:e.content}}),e._v(" "),e.$apollo.loading?e._e():n("Weka",{staticClass:"tui-engageEditArticleContentForm__editor",attrs:{"usage-identifier":{component:"engage_article",area:"content",instanceId:e.resourceId},variant:"engage_article-content","file-item-id":e.draft.file_item_id},on:{ready:function(t){e.editorMounted=!0}},model:{value:e.content,callback:function(t){e.content=t},expression:"content"}}),e._v(" "),n("DoneCancelGroup",{staticClass:"tui-engageEditArticleContentForm__buttons",attrs:{loading:e.submitting,disabled:e.content.isEmpty||e.submitting},on:{done:e.submit,cancel:function(t){return e.$emit("cancel")}}})],1)}),[],!1,null,null,null);_.options.__hasBlocks={script:!0,template:!0};t.default=_.exports},UpZR:function(e,t){e.exports=tui.require("tui/apollo_client")},W27q:function(e,t){e.exports=tui.require("totara_engage/components/sidepanel/EngageSidePanel")},W9ne:function(e,t){e.exports=tui.require("totara_playlist/components/box/ResourcePlaylistBox")},Xpd9:function(e,t){e.exports=tui.require("totara_engage/components/icons/StatIcon")},Y4zg:function(e,t,n){"use strict";n.r(t);var i=n("yXPU"),a=n.n(i),r=n("o0o1"),o=n.n(r),s=n("oMuj"),l=n.n(s),c=n("BN8m"),d=n.n(c),u=n("nXMa"),m=n.n(u),v=n("vF5l"),k=n.n(v),g=n("2wx7"),p=n.n(g),f=n("kkOl"),_=n.n(f),h=n("nEm4"),b=n.n(h),N=n("i/kK"),y=n.n(N),x=n("e3MU"),w=n.n(x),F=n("oMGV"),S=n.n(F),A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"core_file_unused_draft_item_id"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"item_id"},name:{kind:"Name",value:"core_file_unused_draft_item_id"},arguments:[],directives:[]}]}}]},C={components:{InputText:l.a,ButtonGroup:d.a,Button:k.a,CancelButton:m.a,Weka:p.a,Form:b.a,FormRow:y.a,InfoIconButton:w.a,UnsavedChangesWarning:S.a},props:{articleContent:{type:String,default:""},articleName:{type:String,required:!0}},data:function(){return{name:this.articleName,content:_.a.empty(),draftId:null}},computed:{disabled:function(){return 0===this.name.length||this.content.isEmpty},hasChanges:function(){return this.name.length>0||!this.content.isEmpty}},watch:{articleContent:{immediate:!0,handler:function(e){if(e)try{this.content=_.a.fromDoc(JSON.parse(e))}catch(e){this.content=_.a.empty()}}},hasChanges:{handler:function(){this.$emit("unsaved-changes")}}},mounted:function(){var e=this;return a()(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$_loadDraftId();case 2:case"end":return t.stop()}}),t)})))()},methods:{$_loadDraftId:function(){var e=this;return a()(o.a.mark((function t(){var n,i;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$apollo.mutate({mutation:A});case 2:n=t.sent,i=n.data.item_id,e.draftId=i;case 5:case"end":return t.stop()}}),t)})))()},submit:function(){var e={name:this.name,content:JSON.stringify(this.content.getDoc()),itemId:this.draftId};this.$emit("next",e),this.$_loadDraftId()}}},T=(n("zzob"),n("KHd+")),V=function(e){e.options.__langStrings={core:["next"],totara_core:["save"],engage_article:["entertitle","entercontent","articletitle","content","createarticleshort"],totara_engage:["contributetip","contributetip_help","hashtags"]}},I=Object(T.a)(C,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Form",{staticClass:"tui-engageArticleForm",attrs:{vertical:!0,"input-width":"full"}},[n("FormRow",{staticClass:"tui-engageArticleForm__title",attrs:{hidden:!0,label:e.$str("articletitle","engage_article"),required:!0},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.id;return[n("InputText",{attrs:{id:i,name:"article-title",maxlength:75,placeholder:e.$str("entertitle","engage_article"),required:!0},model:{value:e.name,callback:function(t){e.name=t},expression:"name"}})]}}])}),e._v(" "),n("div",{staticClass:"tui-engageArticleForm__description"},[n("FormRow",{staticClass:"tui-engageArticleForm__description-formRow",attrs:{hidden:!0,label:e.$str("content","engage_article"),required:!0,"is-stacked":!1},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.id;return[e.draftId?n("Weka",{staticClass:"tui-engageArticleForm__editor",attrs:{id:i,"usage-identifier":{component:"engage_article",area:"content"},variant:"engage_article-content","file-item-id":e.draftId,placeholder:e.$str("entercontent","engage_article")},model:{value:e.content,callback:function(t){e.content=t},expression:"content"}}):e._e()]}}])}),e._v(" "),n("div",{staticClass:"tui-engageArticleForm__description-tip"},[n("p",[e._v(e._s(e.$str("contributetip","totara_engage")))]),e._v(" "),n("InfoIconButton",{attrs:{"is-help-for":e.$str("hashtags","totara_engage")}},[e._v("\n        "+e._s(e.$str("contributetip_help","totara_engage"))+"\n      ")])],1)],1),e._v(" "),n("ButtonGroup",{staticClass:"tui-engageArticleForm__buttons"},[n("Button",{attrs:{styleclass:{primary:"true"},disabled:e.disabled,"aria-label":e.$str("createarticleshort","engage_article"),text:e.$str("next","core")},on:{click:e.submit}}),e._v(" "),n("CancelButton",{on:{click:function(t){return e.$emit("cancel")}}})],1),e._v(" "),e.hasChanges?n("UnsavedChangesWarning",{attrs:{value:{hasChanges:e.hasChanges}}}):e._e()],1)}),[],!1,null,null,null);"function"==typeof V&&V(I),I.options.__hasBlocks={script:!0,template:!0};t.default=I.exports},Z5qJ:function(e,t,n){"use strict";n.r(t);var i=n("g0Fk"),a=n.n(i),r=n("bxuo"),o=n.n(r),s=n("wBfT"),l=n.n(s),c=n("kZ6F"),d=n.n(c),u=n("dkcK"),m=n("d4pu"),v={components:{EditArticleTitleForm:l.a,InlineEditing:a.a,BookmarkButton:o.a,ArticleSeparator:d.a},props:{title:{type:String,required:!0},updateAble:{type:Boolean,required:!0},bookmarked:{type:Boolean,required:!0},resourceId:{type:[Number,String],required:!0},owned:{type:Boolean,required:!0},showBookmarkButton:{type:Boolean,default:!0}},data:function(){return{editing:!1,submitting:!1}},watch:{editing:{handler:function(){this.editing?window.addEventListener("beforeunload",this.$_unloadHandler):window.removeEventListener("beforeunload",this.$_unloadHandler)}}},methods:{$_unloadHandler:function(e){e.preventDefault();var t=this.$str("unsaved_changes_warning","totara_engage");return e.returnValue=t,t},updateTitle:function(e){var t=this;this.submitting=!0,this.$apollo.mutate({mutation:u.a,refetchAll:!1,variables:{resourceid:this.resourceId,name:e},updateQuery:function(e,n){e.writeQuery({query:m.a,variables:{resourceid:t.resourceId},data:n})}}).finally((function(){t.submitting=!1,t.editing=!1}))}}},k=(n("OMaT"),n("KHd+")),g=function(e){e.options.__langStrings={totara_engage:["unsaved_changes_warning"],engage_article:["editarticletitle"]}},p=Object(k.a)(v,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"tui-engageArticleTitle"},[n("div",{staticClass:"tui-engageArticleTitle__head"},[n("InlineEditing",{directives:[{name:"show",rawName:"v-show",value:!e.editing,expression:"!editing"}],attrs:{"button-aria-label":e.$str("editarticletitle","engage_article",e.title),"update-able":e.updateAble,"full-width":!0},on:{click:function(t){e.editing=!0}}},[n("h3",{staticClass:"tui-engageArticleTitle__title",attrs:{slot:"content"},slot:"content"},[e._v("\n        "+e._s(e.title)+"\n      ")])]),e._v(" "),e.editing?n("EditArticleTitleForm",{attrs:{title:e.title,submitting:e.submitting},on:{cancel:function(t){e.editing=!1},submit:e.updateTitle}}):e._e(),e._v(" "),e.showBookmarkButton?n("BookmarkButton",{attrs:{primary:!1,circle:!0,bookmarked:e.bookmarked,size:"300"},on:{click:function(t){return e.$emit("bookmark",t)}}}):e._e()],1),e._v(" "),n("ArticleSeparator")],1)}),[],!1,null,null,null);"function"==typeof g&&g(p),p.options.__hasBlocks={script:!0,template:!0};t.default=p.exports},ZYet:function(e,t){e.exports=tui.require("engage_article/components/form/ArticleForm")},ZwY9:function(e,t,n){"use strict";n.r(t);var i=n("jJ8l"),a=n.n(i),r=n("khcT"),o=n.n(r),s=n("QOO2"),l=n.n(s),c=n("tyu8"),d=n("bxuo"),u={components:{BookmarkButton:n.n(d).a,Card:a.a,TimeIcon:o.a,Like:l.a},props:{resourceId:{type:[Number,String],required:!0},name:{type:String,required:!0},bookmarked:{type:Boolean,default:!1},image:{type:String,required:!0},imageAlt:String,reactions:{type:[Number,String],required:!0},timeview:{type:String,default:""},url:{type:String,required:!0}},data:function(){return{innerBookmarked:this.bookmarked}},computed:{timeviewString:function(){return c.TimeViewType.isLessThanFive(this.timeview)?this.$str("timelessthanfive","engage_article"):c.TimeViewType.isFiveToTen(this.timeview)?this.$str("timefivetoten","engage_article"):c.TimeViewType.isMoreThanTen(this.timeview)?this.$str("timemorethanten","engage_article"):""},imageStyle:function(){return{backgroundImage:"url(".concat(this.image,"})")}}},methods:{handleClickBookmark:function(){this.innerBookmarked=!this.innerBookmarked,this.$emit("update",this.resourceId,this.innerBookmarked)},handleClickCard:function(){window.location.href=this.url}}},m=(n("Mxwz"),n("KHd+")),v=function(e){e.options.__langStrings={totara_engage:["time","like"],engage_article:["timelessthanfive","timefivetoten","timemorethanten"]}},k=Object(m.a)(u,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Card",{staticClass:"tui-engageArticleRelatedCard",attrs:{clickable:!0},on:{click:e.handleClickCard}},[n("div",{staticClass:"tui-engageArticleRelatedCard__img",style:e.imageStyle},[e.imageAlt?n("span",{staticClass:"sr-only"},[e._v(e._s(e.imageAlt))]):e._e()]),e._v(" "),n("section",{staticClass:"tui-engageArticleRelatedCard__content"},[n("a",{attrs:{href:e.url}},[e._v("\n      "+e._s(e.name)+"\n    ")]),e._v(" "),n("p",[e.timeviewString?n("span",{staticClass:"tui-engageArticleRelatedCard__timeview"},[n("TimeIcon",{attrs:{size:"200",alt:e.$str("time","totara_engage"),"custom-class":"tui-engageArticleRelatedCard--dimmed"}}),e._v("\n        "+e._s(e.timeviewString)+"\n      ")],1):e._e(),e._v(" "),n("Like",{attrs:{size:"200",alt:e.$str("like","totara_engage"),"custom-class":"tui-engageArticleRelatedCard--dimmed"}}),e._v(" "),n("span",[e._v(e._s(e.reactions))])],1)]),e._v(" "),n("BookmarkButton",{staticClass:"tui-engageArticleRelatedCard__bookmark",attrs:{size:"300",bookmarked:e.innerBookmarked,primary:!1,circle:!1,small:!0,transparent:!0},on:{click:e.handleClickBookmark}})],1)}),[],!1,null,null,null);"function"==typeof v&&v(k),k.options.__hasBlocks={script:!0,template:!0};t.default=k.exports},biEG:function(e,t){},bxuo:function(e,t){e.exports=tui.require("totara_engage/components/buttons/BookmarkButton")},cBYx:function(e,t){e.exports=tui.require("engage_article/components/content/ArticleContent")},ccUt:function(e,t){e.exports=tui.require("totara_engage/components/card/CardHeader")},d4pu:function(e,t,n){"use strict";t.a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"engage_article_get_article"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"article"},name:{kind:"Name",value:"engage_article_get_article"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"resource"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"access"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"time"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"context_id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"card_display"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_alt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"display_fields"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"associate_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_custom"},arguments:[],directives:[]}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"HTML"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"format"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"image"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"updateable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owned"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"catalog"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"timedescription"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timeview"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sharedbycount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bookmarked"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reacted"},arguments:[],directives:[]}]}}]}}]}},ddnO:function(e,t){},dkcK:function(e,t,n){"use strict";t.a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"engage_article_update_article"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_text"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"resourceid"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"content"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"access"}},type:{kind:"NamedType",name:{kind:"Name",value:"totara_engage_access"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"topics"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"format"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timeview"}},type:{kind:"NamedType",name:{kind:"Name",value:"totara_engage_timeview"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shares"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"totara_engage_recipient_in"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"draft_id"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"article"},name:{kind:"Name",value:"engage_article_update"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"resourceid"},value:{kind:"Variable",name:{kind:"Name",value:"resourceid"}}},{kind:"Argument",name:{kind:"Name",value:"content"},value:{kind:"Variable",name:{kind:"Name",value:"content"}}},{kind:"Argument",name:{kind:"Name",value:"access"},value:{kind:"Variable",name:{kind:"Name",value:"access"}}},{kind:"Argument",name:{kind:"Name",value:"topics"},value:{kind:"Variable",name:{kind:"Name",value:"topics"}}},{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"Variable",name:{kind:"Name",value:"format"}}},{kind:"Argument",name:{kind:"Name",value:"timeview"},value:{kind:"Variable",name:{kind:"Name",value:"timeview"}}},{kind:"Argument",name:{kind:"Name",value:"shares"},value:{kind:"Variable",name:{kind:"Name",value:"shares"}}},{kind:"Argument",name:{kind:"Name",value:"draft_id"},value:{kind:"Variable",name:{kind:"Name",value:"draft_id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"resource"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"access"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"time"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"context_id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"card_display"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_alt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_picture_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"display_fields"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"label"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"associate_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_custom"},arguments:[],directives:[]}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"HTML"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"format"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"image"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"updateable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owned"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"timedescription"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timeview"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sharedbycount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bookmarked"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reacted"},arguments:[],directives:[]}]}}]}}]}},e3MU:function(e,t){e.exports=tui.require("tui/components/buttons/InfoIconButton")},eE7E:function(e,t){e.exports=tui.require("engage_article/components/card/RelatedCard")},eF33:function(e,t){},eQMv:function(e,t,n){"use strict";n.r(t);var i=n("T+9K"),a=n.n(i),r=n("JXQf"),o=n.n(r),s=n("vLZY"),l=n.n(s),c=n("cBYx"),d=n.n(c),u=n("I9Nn"),m=n.n(u),v=n("w07m"),k=n.n(v),g=n("d4pu"),p=n("vN5C"),f={components:{ArticleTitle:m.a,ArticleSidePanel:l.a,ArticleContent:d.a,Layout:a.a,Loader:o.a,ResourceNavigationBar:k.a},props:{resourceId:{type:Number,required:!0},backButton:{type:Object,required:!1},navigationButtons:{type:Object,required:!1},interactor:{type:Object,default:function(){return{user_id:0,can_bookmark:!1,can_comment:!1,can_react:!1,can_share:!1}}}},data:function(){return{article:{},bookmarked:!1}},computed:{articleName:function(){return this.article.resource&&this.article.resource.name?this.article.resource.name:""}},apollo:{article:{query:g.a,variables:function(){return{id:this.resourceId}},result:function(e){var t=e.data.article;this.bookmarked=t.bookmarked}}},methods:{updateBookmark:function(){var e=this;this.bookmarked=!this.bookmarked,this.$apollo.mutate({mutation:p.a,refetchAll:!1,variables:{itemid:this.resourceId,component:"engage_article",bookmarked:this.bookmarked},update:function(t){var n=t.readQuery({query:g.a,variables:{id:e.resourceId}}).article;(n=Object.assign({},n)).bookmarked=e.bookmarked,t.writeQuery({query:g.a,variables:{id:e.resourceId},data:{article:n}})}})}}},_=(n("eF33"),n("KHd+")),h=function(e){e.options.__langStrings={engage_article:["entercontent","entertitle"]}},b=Object(_.a)(f,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Layout",{staticClass:"tui-engageArticleView",scopedSlots:e._u([e.backButton||e.navigationButtons?{key:"header",fn:function(){return[n("ResourceNavigationBar",{staticClass:"tui-engageArticleView__backButton",attrs:{"back-button":e.backButton,"navigation-buttons":e.navigationButtons}})]},proxy:!0}:null,{key:"column",fn:function(){return[n("Loader",{attrs:{loading:e.$apollo.loading,fullpage:!0}}),e._v(" "),e.$apollo.loading?e._e():n("div",{staticClass:"tui-engageArticleView__layout"},[n("ArticleTitle",{attrs:{title:e.articleName,"resource-id":e.resourceId,owned:e.article.owned,bookmarked:e.bookmarked,"update-able":e.article.updateable,"show-bookmark-button":e.interactor.can_bookmark},on:{bookmark:e.updateBookmark}}),e._v(" "),n("ArticleContent",{attrs:{title:e.articleName,"update-able":e.article.updateable,content:e.article.content,"resource-id":e.resourceId}})],1)]},proxy:!0},{key:"sidepanel",fn:function(){return[n("ArticleSidePanel",{attrs:{"resource-id":e.resourceId,interactor:e.interactor}})]},proxy:!0}],null,!0)})}),[],!1,null,null,null);"function"==typeof h&&h(b),b.options.__hasBlocks={script:!0,template:!0};t.default=b.exports},f0XX:function(e,t,n){"use strict";n.r(t);var i=n("kQ5c"),a=n.n(i),r=n("qyfC"),o=n.n(r),s=n("Xpd9"),l=n.n(s),c=n("ccUt"),d=n.n(c),u=n("5h9J"),m=n.n(u),v=n("oB6E"),k=n.n(v),g=n("qQx0"),p=n.n(g),f=n("QOO2"),_=n.n(f),h=n("in8C"),b=n.n(h),N=n("sxi1"),y=n.n(N),x=n("tyu8"),w=n("+1Jo"),F=n.n(w),S=n("khcT"),A=n.n(S),C=n("bxuo"),T=n.n(C),V=n("vN5C"),I={components:{AccessIcon:F.a,AddToListIcon:p.a,BaseCard:a.a,BookmarkButton:T.a,ButtonIcon:m.a,CardHeader:d.a,ImageHeader:o.a,MoreIcon:y.a,ShareIcon:k.a,StatIcon:l.a,TimeIcon:A.a},mixins:[x.cardMixin],data:function(){return{actions:[{alt:this.$str("addtoplaylist","engage_article"),component:"AddToListIcon"},{alt:this.$str("share","totara_engage"),component:"ShareIcon"},{alt:this.$str("more","totara_engage"),component:"MoreIcon"}],extraData:JSON.parse(this.extra),innerBookmarked:this.bookmarked,hovered:!1,statIcons:[]}},computed:{getTimeView:function(){return x.TimeViewType.isLessThanFive(this.extraData.timeview)?this.$str("timelessthanfive","engage_article"):x.TimeViewType.isFiveToTen(this.extraData.timeview)?this.$str("timefivetoten","engage_article"):x.TimeViewType.isMoreThanTen(this.extraData.timeview)?this.$str("timemorethanten","engage_article"):null},getRoleAttr:function(){return this.extraData.alt?null:"presentation"},imageStyle:function(){return{backgroundImage:"url(".concat(this.extraData.image,"})")}}},created:function(){this.$_setStatIcons()},methods:{$_handleHovered:function(e){this.hovered=e},$_setStatIcons:function(){if(!x.AccessManager.isPrivate(this.access)){var e=[{type:"reaction",title:this.$str("numberoflikes","totara_engage",this.totalReactions),icon:_.a,statNumber:this.totalReactions},{type:"comment",title:this.$str("numberofcomments","totara_engage",this.totalComments),icon:b.a,statNumber:this.totalComments}];x.AccessManager.isRestricted(this.access)?this.statIcons=e:x.AccessManager.isPublic(this.access)&&(this.statIcons=e.concat([{type:"share",title:this.$str("numberofshares","totara_engage",this.sharedbycount),icon:k.a,statNumber:this.sharedbycount},{type:"playlistUsage",title:this.$str("numberwithinplaylist","engage_article",this.extraData.usage),icon:p.a,statNumber:this.extraData.usage}]))}},updateBookmark:function(){this.innerBookmarked=!this.innerBookmarked,this.$apollo.mutate({mutation:V.a,refetchAll:!1,refetchQueries:["totara_engage_contribution_cards"],variables:{itemid:this.instanceId,component:"engage_article",bookmarked:this.innerBookmarked}})}}},B=(n("ieMF"),n("KHd+")),$=function(e){e.options.__langStrings={engage_article:["addtoplaylist","numberwithinplaylist","timelessthanfive","timefivetoten","timemorethanten"],totara_engage:["more","share","numberofcomments","numberoflikes","numberofshares","time"]}},q=Object(B.a)(I,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("BaseCard",{staticClass:"tui-engageArticleCard",attrs:{"data-card-unique":e.instanceId,href:e.url,"show-footnotes":e.showFootnotes,footnotes:e.footnotes},on:{mouseover:function(t){return e.$_handleHovered(!0)},mouseleave:function(t){return e.$_handleHovered(!1)}}},[n("ImageHeader",{staticClass:"tui-engageArticleCard__imageheader",attrs:{slot:"header-image","show-cover":e.hovered},slot:"header-image"},[n("div",{staticClass:"tui-engageArticleCard__image",style:e.imageStyle,attrs:{slot:"image",role:e.getRoleAttr},slot:"image"},[e.extraData.alt?n("span",{staticClass:"sr-only"},[e._v(e._s(e.extraData.alt))]):e._e()]),e._v(" "),n("div",{staticClass:"tui-engageArticleCard__icons",attrs:{slot:"actions"},slot:"actions"},e._l(e.actions,(function(e,t){return n("ButtonIcon",{key:t,attrs:{"aria-label":e.alt,styleclass:{primary:!1,circle:!0}}},[n(e.component,{tag:"component"})],1)})),1)]),e._v(" "),n("CardHeader",{staticClass:"tui-engageArticleCard__header",attrs:{slot:"header"},slot:"header"},[n("div",{staticClass:"tui-engageArticleCard__bar",attrs:{slot:"first"},slot:"first"},[e.showBookmark?n("BookmarkButton",{staticClass:"tui-engageArticleCard__bookmark",attrs:{size:"300",bookmarked:e.innerBookmarked,primary:!1,circle:!1,small:!0,transparent:!0},on:{click:e.updateBookmark}}):e._e()],1),e._v(" "),n("a",{staticClass:"tui-engageArticleCard__link",attrs:{slot:"second",href:e.url},slot:"second"},[n("h3",{staticClass:"tui-engageArticleCard__title",attrs:{id:e.labelId}},[e._v("\n        "+e._s(e.name)+"\n      ")])]),e._v(" "),e.extraData.timeview?n("div",{staticClass:"tui-engageArticleCard__subTitle",attrs:{slot:"third"},slot:"third"},[n("TimeIcon",{attrs:{size:"200",alt:e.$str("time","totara_engage"),"custom-class":"tui-icon--dimmed"}}),e._v(" "),n("span",{staticClass:"tui-engageArticleCard__subTitle-text"},[e._v(e._s(e.getTimeView))])],1):e._e()]),e._v(" "),n("div",{staticClass:"tui-engageArticleCard__footer",attrs:{slot:"footer"},slot:"footer"},[e._l(e.statIcons,(function(e){return n("StatIcon",{key:e.type,attrs:{title:e.title,"stat-number":e.statNumber}},[n(e.icon,{tag:"component",attrs:{title:e.title}})],1)})),e._v(" "),n("AccessIcon",{attrs:{access:e.access,size:"300","custom-class":"tui-engageArticleCard__visibilityIcon"}})],2)],1)}),[],!1,null,null,null);"function"==typeof $&&$(q),q.options.__hasBlocks={script:!0,template:!0};t.default=q.exports},fPwS:function(e,t){e.exports=tui.require("tui/components/icons/Loading")},g0Fk:function(e,t){e.exports=tui.require("totara_engage/components/form/InlineEditing")},hh05:function(e,t){},"i/kK":function(e,t){e.exports=tui.require("tui/components/form/FormRow")},ieMF:function(e,t){},in8C:function(e,t){e.exports=tui.require("tui/components/icons/Comment")},jJ8l:function(e,t){e.exports=tui.require("tui/components/card/Card")},kQ5c:function(e,t){e.exports=tui.require("totara_engage/components/card/BaseCard")},kZ6F:function(e,t){e.exports=tui.require("engage_article/components/separator/ArticleSeparator")},khcT:function(e,t){e.exports=tui.require("tui/components/icons/Time")},kkOl:function(e,t){e.exports=tui.require("editor_weka/WekaValue")},ls82:function(e,t,n){var i=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",r=i.asyncIterator||"@@asyncIterator",o=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,i){var a=t&&t.prototype instanceof u?t:u,r=Object.create(a.prototype),o=new x(i||[]);return r._invoke=function(e,t,n){var i="suspendedStart";return function(a,r){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===a)throw r;return F()}for(n.method=a,n.arg=r;;){var o=n.delegate;if(o){var s=b(o,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=c(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}(e,n,o),r}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d={};function u(){}function m(){}function v(){}var k={};k[a]=function(){return this};var g=Object.getPrototypeOf,p=g&&g(g(w([])));p&&p!==t&&n.call(p,a)&&(k=p);var f=v.prototype=u.prototype=Object.create(k);function _(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function h(e,t){var i;this._invoke=function(a,r){function o(){return new t((function(i,o){!function i(a,r,o,s){var l=c(e[a],e,r);if("throw"!==l.type){var d=l.arg,u=d.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){i("next",e,o,s)}),(function(e){i("throw",e,o,s)})):t.resolve(u).then((function(e){d.value=e,o(d)}),(function(e){return i("throw",e,o,s)}))}s(l.arg)}(a,r,i,o)}))}return i=i?i.then(o,o):o()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=c(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,d;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function y(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function w(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:F}}function F(){return{value:void 0,done:!0}}return m.prototype=f.constructor=v,v.constructor=m,m.displayName=s(v,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,s(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e},e.awrap=function(e){return{__await:e}},_(h.prototype),h.prototype[r]=function(){return this},e.AsyncIterator=h,e.async=function(t,n,i,a,r){void 0===r&&(r=Promise);var o=new h(l(t,n,i,a),r);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},_(f),s(f,o,"Generator"),f[a]=function(){return this},f.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},e.values=w,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(y),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return o.type="throw",o.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a],o=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var s=n.call(r,"catchLoc"),l=n.call(r,"finallyLoc");if(s&&l){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var r=a;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=e,o.arg=t,r?(this.method="next",this.next=r.finallyLoc,d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),y(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var a=i.arg;y(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:w(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},"n4/j":function(e,t,n){"use strict";n.r(t);var i=n("yXPU"),a=n.n(i),r=n("o0o1"),o=n.n(r),s=n("UpZR"),l=n.n(s),c=n("JXQf"),d=n.n(c),u=n("5v9U"),m=n.n(u),v=n("LJiL"),k=n.n(v),g=n("sy3s"),p=n.n(g),f=n("W27q"),_=n.n(f),h=n("C+/B"),b=n.n(h),N=n("FhEx"),y=n.n(N),x=n("+MEP"),w=n.n(x),F=n("KGcv"),S=n.n(F),A=n("OhEh"),C=n.n(A),T=n("nWV2"),V=n.n(T),I=n("vyVp"),B=n("tyu8"),$=n("d4pu"),q=n("dkcK"),E={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"engage_article_delete_article"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"resourceid"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"result"},name:{kind:"Name",value:"engage_article_delete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"resourceid"},value:{kind:"Variable",name:{kind:"Name",value:"resourceid"}}}],directives:[]}]}}]},D={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"totara_engage_advanced_features"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"features"},name:{kind:"Name",value:"totara_engage_advanced_features"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"library"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"recommenders"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"workspaces"},arguments:[],directives:[]}]}}]}}]},L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"totara_reportedcontent_create_review"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"component"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_component"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"area"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_area"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"item_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"url"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_url"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"review"},name:{kind:"Name",value:"totara_reportedcontent_create_review"},arguments:[{kind:"Argument",name:{kind:"Name",value:"component"},value:{kind:"Variable",name:{kind:"Name",value:"component"}}},{kind:"Argument",name:{kind:"Name",value:"area"},value:{kind:"Variable",name:{kind:"Name",value:"area"}}},{kind:"Argument",name:{kind:"Name",value:"item_id"},value:{kind:"Variable",name:{kind:"Name",value:"item_id"}}},{kind:"Argument",name:{kind:"Name",value:"url"},value:{kind:"Variable",name:{kind:"Name",value:"url"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"success"},arguments:[],directives:[]}]}}]}}]},O={components:{AccessDisplay:k.a,AccessSetting:p.a,ArticlePlaylistBox:C.a,EngageSidePanel:_.a,ConfirmationModal:b.a,Loader:d.a,MediaSetting:y.a,Related:V.a,SidePanelCommentBox:m.a,MiniProfileCard:w.a,DropdownItem:S.a},props:{resourceId:{type:[Number,String],required:!0},interactor:{type:Object,default:function(){return{user_id:0,can_bookmark:!1,can_comment:!1,can_react:!1,can_share:!1}}}},apollo:{article:{query:$.a,variables:function(){return{id:this.resourceId}}},features:{query:D}},data:function(){return{article:{},deleting:!1,submitting:!1,openModalFromButtonLabel:!1,openModalFromAction:!1,features:{}}},computed:{user:function(){return this.article.resource&&this.article.resource.user?this.article.resource.user:{}},shareButtonLabel:function(){return this.article.owned?this.$str("shareresource","engage_article",this.article.resource.name):this.$str("reshareresource","engage_article",this.article.resource.name)},likeButtonLabel:function(){return this.article.reacted?this.$str("removelikearticle","engage_article",this.article.resource.name):this.$str("likearticle","engage_article",this.article.resource.name)},featureRecommenders:function(){return this.features&&this.features.recommenders},isPrivateResource:function(){return B.AccessManager.isPrivate(this.article.resource.access)}},methods:{updateAccess:function(e){var t=this,n=e.access,i=e.topics,a=e.shares,r=e.timeView;this.submitting=!0,this.$apollo.mutate({mutation:q.a,refetchAll:!1,variables:{resourceid:this.resourceId,access:n,topics:i.map((function(e){return e.id})),shares:a,timeview:r},update:function(e,n){var i=n.data;e.writeQuery({query:$.a,variables:{id:t.resourceId},data:i})}}).finally((function(){t.submitting=!1}))},handleDelete:function(){var e=this;this.deleting=!0,this.$apollo.mutate({mutation:E,variables:{resourceid:this.resourceId},refetchAll:!1}).then((function(t){t.data.result&&(e.$children.openModal=!1,window.location.href=e.$url("/totara/engage/your_resources.php"))}))},updateLikeStatus:function(e){var t=l.a.readQuery({query:$.a,variables:{id:this.resourceId}}).article;(t=Object.assign({},t)).reacted=e,l.a.writeQuery({query:$.a,variables:{id:this.resourceId},data:{article:t}})},reportResource:function(){var e=this;return a()(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.submitting){t.next=2;break}return t.abrupt("return");case 2:return e.submitting=!0,t.prev=3,t.next=6,e.$apollo.mutate({mutation:L,refetchAll:!1,variables:{component:"engage_article",area:"",item_id:e.resourceId,url:window.location.href}}).then((function(e){return e.data.review}));case 6:if(!t.sent.success){t.next=12;break}return t.next=10,Object(I.notify)({message:e.$str("reported","totara_reportedcontent"),type:"success"});case 10:t.next=14;break;case 12:return t.next=14,Object(I.notify)({message:e.$str("reported_failed","totara_reportedcontent"),type:"error"});case 14:t.next=20;break;case 16:return t.prev=16,t.t0=t.catch(3),t.next=20,Object(I.notify)({message:e.$str("error:reportresource","engage_article"),type:"error"});case 20:return t.prev=20,e.submitting=!1,t.finish(20);case 23:case"end":return t.stop()}}),t,null,[[3,16,20,23]])})))()}}},M=(n("ddnO"),n("KHd+")),P=function(e){e.options.__langStrings={engage_article:["deletewarningmsg","deletewarningtitle","reshareresource","shareresource","timelessthanfive","timefivetoten","timemorethanten","likearticle","removelikearticle","reportresource","error:reportresource"],core:["delete"],totara_reportedcontent:["reported","reported_failed"]}},j=Object(M.a)(O,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.$apollo.loading?e._e():n("EngageSidePanel",{staticClass:"tui-engageArticleSidePanel",attrs:{"show-related":e.featureRecommenders},scopedSlots:e._u([{key:"modal",fn:function(){return[n("ConfirmationModal",{attrs:{open:e.openModalFromAction,loading:e.deleting,title:e.$str("deletewarningtitle","engage_article"),"confirm-button-text":e.$str("delete","core")},on:{confirm:e.handleDelete,cancel:function(t){e.openModalFromAction=!1}}},[e._v("\n      "+e._s(e.$str("deletewarningmsg","engage_article"))+"\n    ")])]},proxy:!0},{key:"overview",fn:function(){return[n("Loader",{attrs:{fullpage:!0,loading:e.submitting}}),e._v(" "),n("p",{staticClass:"tui-engageArticleSidePanel__timeDescription"},[e._v("\n      "+e._s(e.article.timedescription)+"\n    ")]),e._v(" "),e.article.owned||e.article.updateable?n("AccessSetting",{attrs:{"item-id":e.resourceId,component:"engage_article","access-value":e.article.resource.access,topics:e.article.topics,submitting:!1,"open-access-modal":e.openModalFromButtonLabel,"selected-time-view":e.article.timeview,"enable-time-view":!0},on:{"access-update":e.updateAccess,"close-modal":function(t){e.openModalFromButtonLabel=!1}}}):n("AccessDisplay",{attrs:{"access-value":e.article.resource.access,"time-view":e.article.timeview,topics:e.article.topics,"show-button":!1}}),e._v(" "),n("MediaSetting",{attrs:{owned:e.article.owned,"access-value":e.article.resource.access,"instance-id":e.resourceId,"share-button-aria-label":e.shareButtonLabel,"shared-by-count":e.article.sharedbycount,"like-button-aria-label":e.likeButtonLabel,liked:e.article.reacted,"show-like-button":e.interactor.can_react,"show-share-button":e.interactor.can_share,"component-name":"engage_article"},on:{"access-update":e.updateAccess,"access-modal":function(t){e.openModalFromButtonLabel=!0},"update-like-status":e.updateLikeStatus}}),e._v(" "),n("ArticlePlaylistBox",{staticClass:"tui-engageArticleSidePanel__playlistBox",attrs:{"resource-id":e.resourceId}})]},proxy:!0},{key:"comments",fn:function(){return[n("SidePanelCommentBox",{attrs:{component:"engage_article",area:"comment","editor-variant":"engage_article-comment","instance-id":e.resourceId,"editor-context-id":e.article.resource.context_id,"show-comment":e.interactor.can_comment}})]},proxy:!0},e.featureRecommenders?{key:"related",fn:function(){return[n("Related",{attrs:{component:"engage_article",area:"related","resource-id":e.resourceId}})]},proxy:!0}:null],null,!0)},[n("MiniProfileCard",{attrs:{slot:"author-profile",display:e.user.card_display,"no-border":!0,"no-padding":!0},slot:"author-profile",scopedSlots:e._u([{key:"drop-down-items",fn:function(){return[e.article.owned||e.article.updateable?n("DropdownItem",{on:{click:function(t){e.openModalFromAction=!0}}},[e._v("\n        "+e._s(e.$str("delete","core"))+"\n      ")]):e._e(),e._v(" "),e.article.owned?e._e():n("DropdownItem",{on:{click:e.reportResource}},[e._v("\n        "+e._s(e.$str("reportresource","engage_article"))+"\n      ")])]},proxy:!0}],null,!1,131156119)})],1)}),[],!1,null,null,null);"function"==typeof P&&P(j),j.options.__hasBlocks={script:!0,template:!0};t.default=j.exports},nEm4:function(e,t){e.exports=tui.require("tui/components/form/Form")},nWV2:function(e,t){e.exports=tui.require("engage_article/components/sidepanel/Related")},nXMa:function(e,t){e.exports=tui.require("tui/components/buttons/Cancel")},o0o1:function(e,t,n){e.exports=n("ls82")},oB6E:function(e,t){e.exports=tui.require("tui/components/icons/Share")},oMGV:function(e,t){e.exports=tui.require("totara_engage/components/form/UnsavedChangesWarning")},oMuj:function(e,t){e.exports=tui.require("tui/components/form/InputText")},qQx0:function(e,t){e.exports=tui.require("tui/components/icons/AddToList")},ql3h:function(e,t){},qyfC:function(e,t){e.exports=tui.require("totara_engage/components/card/ImageHeader")},siqe:function(e,t,n){"use strict";n.r(t);var i=n("eE7E"),a=n.n(i),r=n("tyu8"),o=n("12HA"),s={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ml_recommender_get_recommended_articles"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"article_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"cursor"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_text"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"source"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"theme"}},type:{kind:"NamedType",name:{kind:"Name",value:"param_component"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"cursor"},name:{kind:"Name",value:"ml_recommender_recommended_articles_cursor"},arguments:[{kind:"Argument",name:{kind:"Name",value:"article_id"},value:{kind:"Variable",name:{kind:"Name",value:"article_id"}}},{kind:"Argument",name:{kind:"Name",value:"cursor"},value:{kind:"Variable",name:{kind:"Name",value:"cursor"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"total"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"next"},arguments:[],directives:[]}]}},{kind:"Field",alias:{kind:"Name",value:"articles"},name:{kind:"Name",value:"ml_recommender_recommended_articles"},arguments:[{kind:"Argument",name:{kind:"Name",value:"article_id"},value:{kind:"Variable",name:{kind:"Name",value:"article_id"}}},{kind:"Argument",name:{kind:"Name",value:"cursor"},value:{kind:"Variable",name:{kind:"Name",value:"cursor"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"instanceid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"summary"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"component"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tuicomponent"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"access"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"comments"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reactions"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timecreated"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sharedbycount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bookmarked"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"extra"},arguments:[{kind:"Argument",name:{kind:"Name",value:"theme"},value:{kind:"Variable",name:{kind:"Name",value:"theme"}}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"owned"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fullname"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profileimageurl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profileimagealt"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[{kind:"Argument",name:{kind:"Name",value:"format"},value:{kind:"EnumValue",value:"PLAIN"}}],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"Variable",name:{kind:"Name",value:"source"}}}],directives:[]}]}}]}}]},l=n("vN5C"),c={components:{RelatedCard:a.a},props:{resourceId:{type:[Number,String],required:!0}},apollo:{articles:{query:s,refetchAll:!1,variables:function(){return{article_id:this.resourceId,source:r.UrlSourceType.article(this.resourceId),theme:o.config.theme.name}},update:function(e){return e.articles.length<=0?[]:(this.$emit("show-related"),e.articles.map((function(e){var t=e.bookmarked,n=e.extra,i=e.name,a=e.instanceid,r=e.reactions,o=e.url,s=JSON.parse(n);return{bookmarked:t,instanceid:a,image:s.image,alt:s.alt,name:i,reactions:r,timeview:s.timeview,url:o}})))}}},data:function(){return{articles:[]}},methods:{getRecommendations:function(){var e=this;this.$apollo.query({query:s,refetchAll:!1,variables:{article_id:this.resourceId,source:r.UrlSourceType.article(this.resourceId),theme:o.config.theme.name}}).then((function(t){var n=t.data;n.articles.length<=0||(e.$emit("show-related"),e.articles=n.articles.map((function(e){var t=e.bookmarked,n=e.extra,i=e.name,a=e.instanceid,r=e.reactions,o=e.url,s=JSON.parse(n);return{bookmarked:t,instanceid:a,image:s.image,name:i,reactions:r,timeview:s.timeview,url:o}})))}))},update:function(e,t){this.$apollo.mutate({mutation:l.a,refetchAll:!1,variables:{itemid:e,component:"engage_article",bookmarked:t}})}}},d=(n("6pgr"),n("KHd+")),u=function(e){e.options.__langStrings={core:["noresults"]}},m=Object(d.a)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.articles.length>0?n("div",{staticClass:"tui-engageArticleRelated"},e._l(e.articles,(function(t){var i=t.bookmarked,a=t.instanceid,r=t.image,o=t.alt,s=t.name,l=t.reactions,c=t.timeview,d=t.url;return n("article",{key:a},[n("RelatedCard",{attrs:{"resource-id":a,bookmarked:i,image:r,"image-alt":o,name:s,reactions:l,timeview:c,url:d},on:{update:e.update}})],1)})),0):e.$apollo.loading?e._e():n("span",{staticClass:"tui-engageArticleRelated__noResults"},[e._v("\n  "+e._s(e.$str("noresults","core"))+"\n")])}),[],!1,null,null,null);"function"==typeof u&&u(m),m.options.__hasBlocks={script:!0,template:!0};t.default=m.exports},sxi1:function(e,t){e.exports=tui.require("tui/components/icons/More")},sy3s:function(e,t){e.exports=tui.require("totara_engage/components/sidepanel/access/AccessSetting")},tyu8:function(e,t){e.exports=tui.require("totara_engage/index")},vF5l:function(e,t){e.exports=tui.require("tui/components/buttons/Button")},vLZY:function(e,t){e.exports=tui.require("engage_article/components/sidepanel/ArticleSidePanel")},vN5C:function(e,t,n){"use strict";t.a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"totara_engage_update_bookmark"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"itemid"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_integer"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"component"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_component"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"bookmarked"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"param_boolean"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"result"},name:{kind:"Name",value:"totara_engage_update_bookmark"},arguments:[{kind:"Argument",name:{kind:"Name",value:"itemid"},value:{kind:"Variable",name:{kind:"Name",value:"itemid"}}},{kind:"Argument",name:{kind:"Name",value:"component"},value:{kind:"Variable",name:{kind:"Name",value:"component"}}},{kind:"Argument",name:{kind:"Name",value:"bookmarked"},value:{kind:"Variable",name:{kind:"Name",value:"bookmarked"}}}],directives:[]}]}}]}},vyVp:function(e,t){e.exports=tui.require("tui/notifications")},w07m:function(e,t){e.exports=tui.require("totara_engage/components/header/ResourceNavigationBar")},wBfT:function(e,t){e.exports=tui.require("engage_article/components/form/EditArticleTitleForm")},y4Yj:function(e,t,n){"use strict";n.r(t);var i=n("nEm4"),a=n.n(i),r=n("oMuj"),o=n.n(r),s=n("QGXx"),l={components:{DoneCancelGroup:n.n(s).a,Form:a.a,InputText:o.a},props:{submitting:{type:Boolean,default:!1},title:{type:String,required:!0}},data:function(){return{innerTitle:this.title}}},c=(n("biEG"),n("KHd+")),d=function(e){e.options.__langStrings={engage_article:["articletitle","entertitle"]}},u=Object(c.a)(l,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Form",{staticClass:"tui-engageEditArticleTitleForm"},[n("InputText",{staticClass:"tui-engageEditArticleTitleForm__input",attrs:{name:"title",disabled:e.submitting,maxlength:60,placeholder:e.$str("entertitle","engage_article"),"aria-label":e.$str("articletitle","engage_article")},on:{submit:function(t){return e.$emit("submit",e.innerTitle)}},model:{value:e.innerTitle,callback:function(t){e.innerTitle=t},expression:"innerTitle"}}),e._v(" "),n("DoneCancelGroup",{attrs:{loading:e.submitting,disabled:e.submitting||!e.innerTitle},on:{done:function(t){return e.$emit("submit",e.innerTitle)},cancel:function(t){return e.$emit("cancel")}}})],1)}),[],!1,null,null,null);"function"==typeof d&&d(u),u.options.__hasBlocks={script:!0,template:!0};t.default=u.exports},yXPU:function(e,t){function n(e,t,n,i,a,r,o){try{var s=e[r](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,a)}e.exports=function(e){return function(){var t=this,i=arguments;return new Promise((function(a,r){var o=e.apply(t,i);function s(e){n(o,a,r,s,l,"next",e)}function l(e){n(o,a,r,s,l,"throw",e)}s(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},zzob:function(e,t){}});