var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var a=0,r=t.length,s;a<r;a++){if(s||!(a in t)){if(!s)s=Array.prototype.slice.call(t,0,a);s[a]=t[a]}}return e.concat(s||Array.prototype.slice.call(t))};System.register(["./p-7a93391b.system.js","./p-d548b705.system.js","./p-34aaddc8.system.js","./p-e1b18076.system.js","./p-dfb1d72b.system.js","./p-2c94eaa0.system.js","./p-b1e4c9f9.system.js","./p-c8cd0c1c.system.js","./p-512597e1.system.js","./p-17ac6394.system.js","./p-cf414e13.system.js","./p-2975a410.system.js","./p-a0c1f16a.system.js","./p-db5487c5.system.js","./p-0bbf3c73.system.js","./p-da593370.system.js","./p-8293eefa.system.js","./p-175b60af.system.js"],(function(e){"use strict";var t,i,a,r,s,n,o,m,l,d,u,f,c,p,y,b,v,h;return{setters:[function(e){t=e.g},function(e){i=e.N},function(e){a=e.T},function(e){r=e.M},function(e){s=e.V},function(e){n=e.F},function(e){o=e.T},function(e){m=e.A},function(e){l=e.c;d=e.f},function(e){u=e.a;f=e.s;c=e.b},function(e){p=e.c},function(e){y=e.a},function(e){b=e.N},function(){},function(){},function(){},function(e){v=e.m},function(e){h=e.g}],execute:function(){e({a:g,b:M,g:F});var j={formView:{fetchError:"Fetching data failed.",retry:"Retry",submit:"Update Info"},formFields:{bio:"Bio",firstName:"First name",lastName:"Last name",pairLimit:"Pair limit",skills:"Professional Expertise",title:"Title"}};var _={formView:{fetchError:"Veri alırken hata oluştu.",retry:"Tekrar Dene",submit:"Bilgileri Güncelle"},formFields:{bio:"Kısaca kendinizi tanıtın",firstName:"İsim",lastName:"Soyisim",pairLimit:"Eşleşme sınırı",skills:"Uzmanlık Alanlarınız",title:"Ünvan"}};var w=undefined&&undefined.__rest||function(e,t){var i={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)i[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++){if(t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r]))i[a[r]]=e[a[r]]}return i};var N=function(){function e(e,t,i){this.user=e;this.userMetadata=t;this.userMentorship=i;var a=h().headers;this.api=l(v,a)}e.prototype.onSubmit=function(e){var t=this;var i=e.detail.values;var a=i.firstName,r=i.lastName,s=i.bio,n=i.skills,o=i.title,m=i.subscriptionLimit,l=w(i,["firstName","lastName","bio","skills","title","subscriptionLimit"]);var d={firstName:a,lastName:r,bio:s,skills:n,title:o};var u={subscriptionLimit:parseInt(m)};var f=l;return new Promise((function(e,i){var a=[t.api.update("users",t.user._id,d)];if(t.userMetadata){a.push(t.api.update("metadatas",t.userMetadata._id,{data:f}))}if(t.userMentorship&&m!==undefined){a.push(t.api.update("mentorships",t.userMentorship._id,u))}Promise.all(a).then((function(){return e({events:[new b(y.congratulate("Info updated"))]})})).catch((function(){i(["Unexpected error"])}))}))};return e}();function M(e,t,i,a,r){var s={firstName:i.firstName,lastName:i.lastName,bio:i.bio,title:i.title,skills:i.skills};var n=e.role;var o=n==="mentor"?t.metadatas.mentorsCanEditMetadata:t.metadatas.menteesCanEditMetadata;if(o){var m=((n==="mentor"?t.metadatas.mentor:t.metadatas.mentee)||[]).map(u);m.forEach((function(e){s[e.id]=a.data[e.id]}))}if(r){s.subscriptionLimit=r.subscriptionLimit}return s}function g(e,t,i,a,r,s,l){var d;if(!i){return null}var u=t==="tr"?_:j;var f=e.role;var c=F(u,f,i);var y=((d=a===null||a===void 0?void 0:a.dvnAppViewConfig)===null||d===void 0?void 0:d.ui.fields)||p(c);var b=f==="mentor"?i.metadatas.mentorsCanEditMetadata:i.metadatas.menteesCanEditMetadata;return n.decode({_id:"update-membership-info-page",base:"mentornity",title:"My info",table:o.decode({name:"mentees",fields:c}),type:m.FormView,handler:new N(r,b?s:undefined,l),ui:{fields:y,i18n:u.formView}})}function F(e,n,o){var m=n==="mentor"?o.profileFieldVisibilities.mentor:o.profileFieldVisibilities.mentee;var l=__spreadArray([new a("firstName",e.formFields.firstName).addInterceptor("onSubmit",new s(2,32)).addInterceptor("onSubmit",new r).require(),new a("lastName",e.formFields.lastName).addInterceptor("onSubmit",new s(2,32)).addInterceptor("onSubmit",new r).require()],[new a("title",e.formFields.title).addInterceptor("onSubmit",new r),new a("bio",e.formFields.bio).setLines(3).setLinesMax(10),t({id:"skills",title:e.formFields.skills,type:"multiple-choice",inputType:"select",options:f.map((function(e){return{label:c[e],value:e}}))})].filter((function(e){return m[e.id]})),true);var p=n==="mentor"?o.metadatas.mentorsCanEditMetadata:o.metadatas.menteesCanEditMetadata;var y=[];if(p){y=((n==="mentor"?o.metadatas.mentor:o.metadatas.mentee)||[]).map(u)}var b=o.mentorMenteeSubscription===d.Restricted;var v=n==="mentor"&&b?__spreadArray(__spreadArray(__spreadArray([],l,true),[new i("subscriptionLimit",e.formFields.pairLimit)],false),y,true):__spreadArray(__spreadArray([],l,true),y,true);return v}}}}));