import{r as registerInstance,h}from"./index-ecdfb761.js";import{i as injectNotifier}from"./index-1e6a7311.js";import"./apiBase-6015f41f.js";import"./data-transfer-field-2f305919.js";import"./filter-cbaa3d7d.js";import{g as getSessionDetails,c as createMentornityApiInstance,m as mentornityApiEndpoint,h as MentornityViewConfigViewName}from"./session-2a491341.js";import{a as getFormViewConfig,b as getFormParameters}from"./wrapper-util-2b15cdf3.js";import"./state-tunnel-04c0b67a.js";import"./BaseField-0b01dc2c.js";import"./membership-b6639471.js";import"./data-model-88af49fc.js";import"./table-config-d73a72ab.js";import"./FieldModelGenerator-378c8613.js";import"./reference-field-a5b414d1.js";import"./index-61dcd269.js";import"./FieldGenerator-3ae403b2.js";import"./date-1bc489bd.js";import"./index-4e451db4.js";import"./index-23baeeef.js";import"./index-09efdc01.js";import"./index-150b6a59.js";import"./string-3065a411.js";import"./User-72c4643a.js";import"./UserSettings-7e4170a7.js";import"./cookie-5d9f5819.js";import"./kimlik-api-fddeac81.js";import"./_commonjsHelpers-27f122dd.js";import"./index-d3bd30bd.js";import"./mentorinty-bridge-api-5ca2d652.js";import"./index-e66e8eca.js";import"./attachment-961dd228.js";import"./CalendarConfig-412d1b0f.js";import"./index-3bf9b308.js";import"./sozluk-entries-1e8f5234.js";import"./i18n-09a07b97.js";import"./i18n-0e757ca5.js";import"./calendar-470c802a.js";import"./index-a3ca021c.js";import"./moment-65eca6b3.js";import"./ModifierTrimmer-2f77f917.js";import"./InterceptorHandler-6474bcf4.js";import"./ValidatorLength-f56a7c14.js";import"./form-view-config-e5a5ced8.js";import"./view-config-1ed8c59f.js";import"./common-wrapper-util-e4afa19b.js";import"./models-f0bc20c6.js";import"./actions-b9a0f808.js";var MentornityMembershipSettingsWrapper=function(){function e(e){registerInstance(this,e);this.isViewConfigWrapperLoaded=false}e.prototype.onInvalidation=function(e){this.notifier.showCustomNotification(e.detail.notification)};e.prototype.componentWillLoad=function(){var e=this;var i=getSessionDetails(),t=i.context,r=t.organisationId,n=t.role,o=t.userId,a=i.headers;var s=createMentornityApiInstance(mentornityApiEndpoint,a);s.getOrganisationConfig(r).then((function(i){e.organisationConfig=i}));var p=n==="mentor"?MentornityViewConfigViewName.MentorInfoForm:MentornityViewConfigViewName.MenteeInfoForm;s.getViewConfig(r,p).then((function(i){e.viewConfigWrapper=i})).finally((function(){return e.isViewConfigWrapperLoaded=true}));s.get("users",o).then((function(i){e.user=i}));s.getMetadataOfUser(r,n==="mentor"?"mentors":"mentees",o).then((function(i){e.userMetadata=i}));if(n==="mentor"){s.getMentorshipOfUser(r,o).then((function(i){e.userMentorship=i}))}};e.prototype.render=function(){var e=this,i=e.isViewConfigWrapperLoaded,t=e.language,r=e.organisationConfig,n=e.user,o=e.userMentorship,a=e.userMetadata,s=e.viewConfigWrapper;var p=getSessionDetails().context;if(!i||!r||!n||!a||p.role==="mentor"&&!o){return h("mentornity-root-wrapper",null,h("div",{class:"d-flex justify-content-center pt-3"},h("dvn-progress",{indefinite:true})))}var m={firstName:true,lastName:true};var f=["bio","skills","title"];var d=!this.organisationConfig.webAppConfiguration.membershipForm;var c=getFormViewConfig(p,t,r,s,n,a,o);if(s){(s.dvnAppViewConfig.table.fields||[]).forEach((function(e){var i=!f.includes(e.id);if(d||i){m[e.id]=true}}));c.ui.fields=c.ui.fields.filter((function(e){return m[e.fieldId]}))}return h("mentornity-root-wrapper",null,h("dvn-card",null,h("dvn-app-view-form-view",{params:getFormParameters(p,r,n,a,o),view:c})))};return e}();injectNotifier(MentornityMembershipSettingsWrapper);export{MentornityMembershipSettingsWrapper as mentornity_membership_settings_wrapper};