System.register(["./p-343b3b10.system.js","./p-a0c1f16a.system.js","./p-b195a819.system.js","./p-5f7bc72e.system.js","./p-da593370.system.js","./p-1708d7ff.system.js","./p-e8fb2c75.system.js","./p-867d31c0.system.js","./p-a56cdd14.system.js","./p-6e7162e6.system.js","./p-6e679e9d.system.js","./p-abcb59d4.system.js","./p-ebdd1444.system.js","./p-6c3e6bdc.system.js","./p-356c131c.system.js","./p-d65f6afe.system.js","./p-0aeb0fcc.system.js","./p-dd468f04.system.js","./p-97c19fd0.system.js","./p-5a92fdf2.system.js","./p-93d5c6db.system.js","./p-cb044807.system.js","./p-d309ff13.system.js","./p-ea3ce2c4.system.js","./p-90b7d919.system.js","./p-58d55c18.system.js","./p-26d154e9.system.js","./p-83a23a40.system.js","./p-1e21bde6.system.js","./p-d3ef0b9c.system.js","./p-fe1f76a3.system.js","./p-66d9c61b.system.js","./p-83b75450.system.js","./p-b20bab7e.system.js","./p-4e674be5.system.js","./p-48ea6857.system.js","./p-b0e93f3a.system.js","./p-b3cf23d4.system.js"],(function(s){"use strict";var t,n,e,i,o,c,f,r,u;return{setters:[function(s){t=s.r;n=s.c;e=s.h;i=s.H},function(s){o=s.I},function(){},function(){},function(){},function(s){c=s.c},function(s){f=s.a},function(s){r=s.g;u=s.a},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var a=s("mentornity_follow_button",function(){function s(s){var e=this;t(this,s);this.action=n(this,"action",7);this.invalidation=n(this,"invalidation",7);this.isProgressing=false;this.toggleFollowStatus=function(){var s=e.item.subscription;var t=(s===null||s===void 0?void 0:s.isFollowing)||false;e.isProgressing=true;if(s){c(u,r().headers).followUnfollowSubscription(s._id,t?"unfollow":"follow").then((function(){e.invalidation.emit(new o("mentornity-follow-button","mentornity-user-detail-page"))})).finally((function(){return e.isProgressing=false}))}else{var n=e.data.mentornityCookieContext,i=n.groupId,f=n.userId;var a=!!i;var l=e.item.mentorship;var d=l.organisation;c(u,r().headers).createSubscription({organisation:{_type:"reference",_class:"organisations",_id:d._id},subscribed:{_type:"reference",_class:"users",_id:f},subscriber:{_type:"reference",_class:a?"groups":"users",_id:a?i:f},createdBy:{_type:"reference",_class:"users",_id:f},mentorship:{_type:"reference",_class:"mentorships",_id:l._id},status:"active",isFollowing:true}).then((function(){e.invalidation.emit(new o("mentornity-follow-button","mentornity-user-detail-page"))})).finally((function(){return e.isProgressing=false}))}}}s.prototype.render=function(){var s,t;var n=((s=this.item.subscription)===null||s===void 0?void 0:s.isFollowing)||false;var o=((t=this.data)===null||t===void 0?void 0:t.language)||"en";return e(i,{class:"d-flex"},e("dvn-button",{disabled:this.isProgressing,onClick:this.toggleFollowStatus,tint:"primary",view:"flat"},f(o,n?"unfollow":"follow")))};return s}())}}}));