'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-1141a245.js');
const index$1 = require('./index-a2e99c85.js');
const kimlikApi = require('./kimlik-api-663f4884.js');
const UyeApiDemo = require('./UyeApiDemo-68d79782.js');
const pairConfig = require('./pair-config-589dabd2.js');
const tableConfig = require('./table-config-969d3038.js');
const BaseField = require('./BaseField-381327a9.js');
const membership = require('./membership-e87e02ed.js');
const dataModel = require('./data-model-01c368bc.js');
const CalendarConfig = require('./CalendarConfig-998f742e.js');
const User = require('./User-dbfbd45e.js');
const appConfig = require('./app-config-d402bbe9.js');
const cardListViewConfig = require('./card-list-view-config-ba20191c.js');
const viewConfig = require('./view-config-52c16db0.js');
const atamaMemberPairDetailViewConfig = require('./atama-member-pair-detail-view-config-7afc2686.js');
const atamaMemberPairsOverviewViewConfig = require('./atama-member-pairs-overview-view-config-904db6a2.js');
const takvimAvailabilitySettingsViewConfig = require('./takvim-availability-settings-view-config-331316b7.js');
const Availability = require('./Availability-4c8ccc7e.js');
require('./reference-field-1239b0c3.js');
require('./index-2eea69a0.js');
require('./index-0783d14f.js');
require('./FieldModelGenerator-d61f01d4.js');
require('./index-9d3d3d15.js');
require('./index-9fd84b93.js');
require('./index-61f9621a.js');
require('./apiBase-6c66ff1b.js');
require('./data-transfer-field-e8417d5f.js');
require('./filter-d5040f65.js');
require('./UserSettings-2a2399b1.js');
require('./date-utils-86cd43eb.js');
require('./string-de672b69.js');
require('./FieldGenerator-279a646b.js');
require('./date-a24d7714.js');

class Event extends dataModel.DataModel {
  static decode(json) {
    return Object.assign(Object.create(Event.prototype), json);
  }
}

const dvnSpaces = (config) => ({
  dvnSpaces1: tableConfig.Space.decode({
    _id: 'dvnSpaces1',
    _created: new Date(),
    _updated: new Date(),
    name: 'Hexadrop Mentorship',
    logoUrl: `${config.assetsPath}/img/spaces/hexadrop.png`,
  }),
});

const atamaMeetingStructureConfigs = (config) => ({
  atamaMeetingStructureConfigs1: pairConfig.MeetingStructureConfig.decode({
    _id: 'atamaMeetingStructureConfigs1',
    _created: new Date(),
    _updated: new Date(),
    base: 'khanguru',
    meetingConfigs: [
      {
        id: '8nn549d7c589nm3358ng',
        name: 'Introduction Meeting',
        meetingCount: 1,
      },
      {
        id: 'ca43340lann8ng',
        name: 'Career Planning',
        meetingCount: 1,
      },
      {
        id: 's3558ngac589n853ms',
        name: 'Setting Action Items',
        meetingCount: 1,
      },
      {
        id: '3val7a589n',
        name: 'Evaluation',
        meetingCount: 1,
      },
    ],
    name: 'mentoring-structure',
    space: dvnSpaces(config).dvnSpaces1,
  }),
});

const takvimCalendarConfigs = (config) => ({
  takvimCalendarConfigsBasic: CalendarConfig.CalendarConfig.decode({
    _id: 'takvimCalendarConfigsBasic',
    _created: new Date(),
    _updated: new Date(),
    base: 'khanguru',
    space: dvnSpaces(config).dvnSpaces1,
    name: 'takvimCalendarConfigsBasic',
    membershipPreferences: [
      {
        membershipConfig: membership.MembershipConfig.decode({ _id: 'mentors' }),
        canCreateAvailableTime: true,
        eligibleMembershipsForCustomTime: [
          membership.MembershipConfig.decode({ _id: 'mentees' }),
        ]
      },
      {
        membershipConfig: membership.MembershipConfig.decode({ _id: 'mentees' }),
        canCreateAvailableTime: true,
      },
    ]
  }),
});

const atamaPairConfigs = (config) => ({
  // simple pair config
  atamaPairConfigs1: pairConfig.PairConfig.decode({
    _id: 'atamaPairConfigs1',
    _created: new Date(),
    _updated: new Date(),
    actionPermissions: {
      leader: {
        completePair: true,
      }
    },
    base: 'khanguru',
    fields: [
      {
        type: 'reference',
        id: 'leader',
        otherCollection: 'uyeMembershipsMentors',
        fields: [],
        title: 'Leader',
      },
      {
        type: 'reference',
        id: 'follower',
        otherCollection: 'uyeMembershipsMentees',
        fields: [],
        title: 'Follower',
      },
      {
        id: 'status',
        title: 'Status',
        type: 'text',
      },
    ],
    name: 'atamaPairsSimplePairs',
    space: dvnSpaces(config).dvnSpaces1,
    calendarConfig: takvimCalendarConfigs(config).takvimCalendarConfigsBasic.toDBRef('takvimCalendarConfigs'),
    structure: atamaMeetingStructureConfigs(config).atamaMeetingStructureConfigs1,
  }),
  // simple pair config with selection
  atamaPairConfigs2: pairConfig.PairConfig.decode({
    _id: 'atamaPairConfigs2',
    _created: new Date(),
    _updated: new Date(),
    actionPermissions: {
      leader: {
        completePair: true,
      }
    },
    base: 'khanguru',
    fields: [
      {
        type: 'reference',
        id: 'leader',
        otherCollection: 'uyeMembershipsMentors',
        fields: [],
        title: 'Leader',
      },
      {
        type: 'reference',
        id: 'follower',
        otherCollection: 'uyeMembershipsMentees',
        fields: [],
        title: 'Follower',
      },
      {
        id: 'status',
        title: 'Status',
        type: 'text',
      },
    ],
    name: 'atamaPairsSimplePairs',
    selection: {
      follower: {
        pairLimit: 2,
        selectionLimit: 5,
        rules: [
          new pairConfig.Rule([
            {
              firstField: BaseField.BaseField.decode({ id: 'city', type: 'text' }),
              comparison: pairConfig.Comparison.eq,
              secondField: BaseField.BaseField.decode({ id: 'city', type: 'text' }),
            }
          ], pairConfig.RuleType.comparison),
        ],
        status: 'active',
      },
    },
    space: dvnSpaces(config).dvnSpaces1,
    // structure: atamaMeetingStructureConfigs(config).atamaMeetingStructureConfigs1,
  }),
  // structured pair config with selection
  atamaPairConfigs3: pairConfig.PairConfig.decode({
    _id: 'atamaPairConfigs3',
    _created: new Date(),
    _updated: new Date(),
    actionPermissions: {
      leader: {
        completePair: true,
      }
    },
    base: 'khanguru',
    fields: [
      {
        type: 'reference',
        id: 'leader',
        otherCollection: 'uyeMembershipsMentors',
        fields: [],
        title: 'Leader',
      },
      {
        type: 'reference',
        id: 'follower',
        otherCollection: 'uyeMembershipsMentees',
        fields: [],
        title: 'Follower',
      },
      {
        id: 'status',
        title: 'Status',
        type: 'text',
      },
    ],
    name: 'atamaPairsSimplePairs',
    selection: {
      follower: {
        pairLimit: 2,
        selectionLimit: 5,
        rules: [
          new pairConfig.Rule([
            {
              firstField: BaseField.BaseField.decode({ id: 'city', type: 'text' }),
              comparison: pairConfig.Comparison.eq,
              secondField: BaseField.BaseField.decode({ id: 'city', type: 'text' }),
            }
          ], pairConfig.RuleType.comparison),
        ],
        status: 'active',
      },
    },
    space: dvnSpaces(config).dvnSpaces1,
    structure: atamaMeetingStructureConfigs(config).atamaMeetingStructureConfigs1,
  }),
});

const kimlikUsers = (config) => ({
  kimlikUsers1: User.User.decode({
    _id: 'kimlikUsers1',
    _created: new Date(),
    _updated: new Date(),
    firstName: 'Emir',
    lastName: 'Turan',
    email: 'emir.turan@acme.com',
    imageUrl: `${config.assetsPath}/img/people/man-1.jpg`,
    status: 'active',
  }),
  kimlikUsers2: User.User.decode({
    _id: 'kimlikUsers2',
    _created: new Date(),
    _updated: new Date(),
    firstName: 'Ege',
    lastName: 'Can',
    email: 'user-2@khanguru.com',
    imageUrl: `${config.assetsPath}/img/people/man-2.jpg`,
    status: 'active',
  }),
  kimlikUsers3: User.User.decode({
    _id: 'kimlikUsers3',
    _created: new Date(),
    _updated: new Date(),
    firstName: 'Ellie',
    lastName: 'Max',
    email: 'ellie.max@acme.com',
    imageUrl: `${config.assetsPath}/img/people/woman-1.jpg`,
    status: 'inactive',
  }),
  kimlikUsers4: User.User.decode({
    _id: 'kimlikUsers4',
    _created: new Date(),
    _updated: new Date(),
    firstName: 'John',
    lastName: 'Alone',
    email: 'user-4@khanguru.com',
    status: 'active',
  }),
  kimlikUsers5: User.User.decode({
    _id: 'kimlikUsers5',
    _created: new Date(),
    _updated: new Date(),
    firstName: 'Sema',
    lastName: 'Melek',
    email: 'user-5@khanguru.com',
    status: 'active',
  }),
  kimlikUsers6: User.User.decode({
    _id: 'kimlikUsers6',
    _created: new Date(),
    _updated: new Date(),
    firstName: 'Christoph',
    lastName: 'Portman',
    email: 'user-6@khanguru.com',
    imageUrl: `${config.assetsPath}/img/people/man-3.jpg`,
    status: 'active',
  }),
});

class Agreement extends dataModel.DataModel {
  static decode(json) {
    return Object.assign(Object.create(Agreement.prototype), json);
  }
}

const onayAgreements = (_config) => ({
  onayAgreements1: Agreement.decode({
    _id: 'onayAgreements1',
    _created: new Date(),
    _updated: new Date(),
    content: 'Content of the **agreement 1**',
    title: 'Agreement for All Members',
  }),
  onayAgreements2: Agreement.decode({
    _id: 'onayAgreements2',
    _created: new Date(),
    _updated: new Date(),
    content: 'Content of the **agreement 2**',
    title: 'Agreement for Mentors',
  }),
  onayAgreements3: Agreement.decode({
    _id: 'onayAgreements3',
    _created: new Date(),
    _updated: new Date(),
    content: 'Content of the **agreement 3**',
    title: 'Agreement for Mentees',
  }),
});

const onayConsents = (config) => ({
  onayConsents1: UyeApiDemo.AgreementConsent.decode({
    _id: 'onayConsents1',
    _created: new Date(),
    _updated: new Date(),
    agreement: onayAgreements().onayAgreements1.toObject(),
    user: kimlikUsers(config).kimlikUsers4.toObject(),
  }),
  onayConsents2: UyeApiDemo.AgreementConsent.decode({
    _id: 'onayConsents2',
    _created: new Date(),
    _updated: new Date(),
    agreement: onayAgreements().onayAgreements3.toObject(),
    user: kimlikUsers(config).kimlikUsers4.toObject(),
  }),
  onayConsents3: UyeApiDemo.AgreementConsent.decode({
    _id: 'onayConsents3',
    _created: new Date(),
    _updated: new Date(),
    agreement: onayAgreements().onayAgreements1.toObject(),
    user: kimlikUsers(config).kimlikUsers3.toObject(),
  }),
  onayConsents4: UyeApiDemo.AgreementConsent.decode({
    _id: 'onayConsents4',
    _created: new Date(),
    _updated: new Date(),
    agreement: onayAgreements().onayAgreements2.toObject(),
    user: kimlikUsers(config).kimlikUsers3.toObject(),
  }),
  onayConsents5: UyeApiDemo.AgreementConsent.decode({
    _id: 'onayConsents5',
    _created: new Date(),
    _updated: new Date(),
    agreement: onayAgreements().onayAgreements1.toObject(),
    user: kimlikUsers(config).kimlikUsers6.toObject(),
  }),
  onayConsents6: UyeApiDemo.AgreementConsent.decode({
    _id: 'onayConsents6',
    _created: new Date(),
    _updated: new Date(),
    agreement: onayAgreements().onayAgreements2.toObject(),
    user: kimlikUsers(config).kimlikUsers6.toObject(),
  }),
  onayConsents7: UyeApiDemo.AgreementConsent.decode({
    _id: 'onayConsents7',
    _created: new Date(),
    _updated: new Date(),
    agreement: onayAgreements().onayAgreements1.toObject(),
    user: kimlikUsers(config).kimlikUsers5.toObject(),
  }),
  onayConsents8: UyeApiDemo.AgreementConsent.decode({
    _id: 'onayConsents8',
    _created: new Date(),
    _updated: new Date(),
    agreement: onayAgreements().onayAgreements3.toObject(),
    user: kimlikUsers(config).kimlikUsers5.toObject(),
  }),
});

// import { onayAgreements } from './onay-agreements';
const uyeMembershipConfigs = (config) => ({
  // mentees table
  uyeMembershipConfigs1: membership.MembershipConfig.decode({
    _id: 'uyeMembershipConfigs1',
    _created: new Date(),
    _updated: new Date(),
    agreements: [
    // onayAgreements(config).onayAgreements1.toObject(),
    // onayAgreements(config).onayAgreements3.toObject(),
    ],
    base: 'khanguru',
    enforceRequiredInfo: false,
    fields: [
      {
        type: 'reference',
        id: 'user',
        otherCollection: 'users',
        isSingle: true,
        fields: [
          {
            type: 'text',
            id: 'firstName'
          },
          {
            type: 'text',
            id: 'lastName'
          },
        ]
      },
      {
        id: 'city',
        required: false,
        title: 'City',
        type: 'text',
      },
      {
        id: 'bio',
        lines: 5,
        linesMax: 25,
        title: 'Bio',
        type: 'text',
      },
    ],
    name: 'uyeMembershipsMentees',
    roleName: 'mentee',
    space: dvnSpaces(config).dvnSpaces1,
  }),
  // mentors table
  uyeMembershipConfigs2: membership.MembershipConfig.decode({
    _id: 'uyeMembershipConfigs2',
    _created: new Date(),
    _updated: new Date(),
    agreements: [
    // onayAgreements(config).onayAgreements1.toObject(),
    // onayAgreements(config).onayAgreements2.toObject(),
    ],
    base: 'khanguru',
    fields: [
      {
        type: 'reference',
        id: 'user',
        otherCollection: 'users',
        isSingle: true,
        fields: [
          {
            type: 'text',
            id: 'firstName'
          },
          {
            type: 'text',
            id: 'lastName'
          },
          {
            type: 'text',
            id: 'imageUrl'
          },
        ]
      },
      {
        id: 'city',
        required: true,
        title: 'City',
        type: 'text',
      },
      {
        id: 'company',
        title: 'Company',
        type: 'text',
      },
      {
        id: 'title',
        title: 'Title',
        type: 'text',
      },
      {
        id: 'bio',
        title: 'Bio',
        type: 'text',
      },
    ],
    name: 'uyeMembershipsMentors',
    roleName: 'mentor',
    space: dvnSpaces(config).dvnSpaces1,
  }),
});

const uyeMembershipsMentees = (config) => ({
  uyeMembershipsMentees1: membership.Membership.decode({
    _id: 'uyeMembershipsMentees1',
    _created: new Date(),
    _updated: new Date(),
    config: uyeMembershipConfigs(config).uyeMembershipConfigs1.toObject(),
    consents: [],
    status: 'active',
    user: kimlikUsers(config).kimlikUsers1.toObject(),
  }),
  uyeMembershipsMentees2: membership.Membership.decode({
    _id: 'uyeMembershipsMentees2',
    _created: new Date(),
    _updated: new Date(),
    bio: 'Teeths are just coming',
    city: 'Van',
    config: uyeMembershipConfigs(config).uyeMembershipConfigs1.toObject(),
    consents: [],
    status: 'inactive',
    user: kimlikUsers(config).kimlikUsers2.toObject(),
  }),
  uyeMembershipsMentees3: membership.Membership.decode({
    _id: 'uyeMembershipsMentees3',
    _created: new Date(),
    _updated: new Date(),
    city: 'Berlin',
    config: uyeMembershipConfigs(config).uyeMembershipConfigs1.toObject(),
    consents: [],
    status: 'active',
    user: kimlikUsers(config).kimlikUsers6.toObject(),
  }),
  uyeMembershipsMentees4: membership.Membership.decode({
    _id: 'uyeMembershipsMentees4',
    _created: new Date(),
    _updated: new Date(),
    city: 'London',
    config: uyeMembershipConfigs(config).uyeMembershipConfigs1.toObject(),
    consents: [
      onayConsents(config).onayConsents1.toObject(),
      onayConsents(config).onayConsents2.toObject(),
    ],
    status: 'active',
    user: kimlikUsers(config).kimlikUsers4.toObject(),
  }),
  uyeMembershipsMentees6: membership.Membership.decode({
    _id: 'uyeMembershipsMentees6',
    _created: new Date(),
    _updated: new Date(),
    bio: 'Lived happy for a while',
    city: 'Los Angeles',
    config: uyeMembershipConfigs(config).uyeMembershipConfigs1.toObject(),
    consents: [
      onayConsents(config).onayConsents1.toObject(),
      onayConsents(config).onayConsents2.toObject(),
    ],
    status: 'active',
    user: kimlikUsers(config).kimlikUsers5.toObject(),
  }),
});

const uyeMembershipsMentors = (config) => ({
  uyeMembershipsMentors1: membership.Membership.decode({
    _id: 'uyeMembershipsMentors1',
    _created: new Date(),
    _updated: new Date(),
    city: 'Istanbul',
    company: 'Peak Games',
    title: 'Chief Design Officer',
    bio: 'Worked in different teams and companies to build beatiful and easy-to-use user interfaces.',
    config: uyeMembershipConfigs(config).uyeMembershipConfigs2.toObject(),
    consents: [
    // onayConsents(config).onayConsents3.toObject(),
    // onayConsents(config).onayConsents4.toObject(),
    ],
    status: 'inactive',
    user: kimlikUsers(config).kimlikUsers3.toObject(),
  }),
  uyeMembershipsMentors2: membership.Membership.decode({
    _id: 'uyeMembershipsMentors2',
    _created: new Date(),
    _updated: new Date(),
    company: 'GoEuro',
    title: 'Senior Software Architect',
    bio: 'Open Source enthusiast, Go geek and camper. Born and raised in Switzerland, now living in Berlin.',
    city: 'Berlin',
    config: uyeMembershipConfigs(config).uyeMembershipConfigs2.toObject(),
    consents: [
      onayConsents(config).onayConsents3.toObject(),
      onayConsents(config).onayConsents4.toObject(),
    ],
    status: 'active',
    user: kimlikUsers(config).kimlikUsers6.toObject(),
  }),
});

const atamaPairsSimplePairs = (config) => ({
  atamaPairsSimplePairs1: dataModel.DataModel.decode({
    _id: 'atamaPairsSimplePairs1',
    _created: new Date(),
    _updated: new Date(),
    follower: [
      uyeMembershipsMentees(config).uyeMembershipsMentees1.toObject()
    ],
    leader: [
      uyeMembershipsMentors(config).uyeMembershipsMentors1.toObject()
    ],
    status: 'active',
  }),
  atamaPairsSimplePairss: dataModel.DataModel.decode({
    _id: 'atamaPairsSimplePairs2',
    _created: new Date(),
    _updated: new Date(),
    follower: [
      uyeMembershipsMentees(config).uyeMembershipsMentees1.toObject()
    ],
    leader: [
      uyeMembershipsMentors(config).uyeMembershipsMentors2.toObject()
    ],
    status: 'active',
  }),
});

function decodeViewConfig(json) {
  if (json.type === viewConfig.AppViewType.ListViewCard) {
    return cardListViewConfig.CardListViewConfig.decode(json);
  }
  else if (json.type === viewConfig.AppViewType.PairListViewCard) {
    return cardListViewConfig.CardListViewConfig.decode(json);
  }
  else if (json.type === viewConfig.AppViewType.PairListViewCard) {
    return cardListViewConfig.CardListViewConfig.decode(json);
  }
  else if (json.type === viewConfig.AppViewType.AtamaMemberPairDetailView) {
    return atamaMemberPairDetailViewConfig.AtamaMemberPairDetailViewConfig.decode(json);
  }
  else if (json.type === viewConfig.AppViewType.AtamaMemberPairsOverviewView) {
    return atamaMemberPairsOverviewViewConfig.AtamaMemberPairsOverviewViewConfig.decode(json);
  }
  else if (json.type === viewConfig.AppViewType.TakvimAvailabilitySettingsView) {
    return takvimAvailabilitySettingsViewConfig.TakvimAvailabilitySettingsViewConfig.decode(json);
  }
  return viewConfig.DvnAppViewConfig.decode(json);
}

const dvnViewConfigs = (config) => ({
  // all mentees card list view
  dvnViewConfigs1: decodeViewConfig({
    _id: 'dvnViewConfigs1',
    _created: new Date(),
    _updated: new Date(),
    base: 'khanguru',
    ui: {
      main: {
        cardViewConfig: {
          header: {
            title: {
              fieldId: 'user.firstName',
            },
          },
          body: {
            fields: [
              { fieldId: 'city' },
              { fieldId: 'bio' },
            ]
          }
        },
      },
    },
    space: dvnSpaces(config).dvnSpaces1,
    title: 'Mentees',
    type: 'list-view-card',
    table: uyeMembershipConfigs(config).uyeMembershipConfigs1.toObject(),
    query: {
      fields: [
        { fieldId: 'bio' },
        { fieldId: 'city' },
      ]
    },
  }),
  // all mentors card list view
  dvnViewConfigs2: decodeViewConfig({
    _id: 'dvnViewConfigs2',
    _created: new Date(),
    _updated: new Date(),
    base: 'khanguru',
    ui: {
      main: {
        cardViewConfig: {
          header: {
            title: {
              fieldId: 'user.firstName',
            },
          },
          body: {
            fields: [
              { fieldId: 'bio' },
              { fieldId: 'city' },
              { fieldId: 'company' },
              { fieldId: 'title' },
            ]
          }
        },
      },
    },
    space: dvnSpaces(config).dvnSpaces1,
    title: 'Mentors',
    type: 'list-view-card',
    table: uyeMembershipConfigs(config).uyeMembershipConfigs2.toObject(),
    query: {
      fields: [
        { fieldId: 'bio' },
        { fieldId: 'city' },
        { fieldId: 'company' },
        { fieldId: 'title' },
        { fieldId: 'user' },
      ]
    }
  }),
  // pair card list view for mentors to view mentees in simple-pairs table
  dvnViewConfigs3: decodeViewConfig({
    _id: 'dvnViewConfigs3',
    _created: new Date(),
    _updated: new Date(),
    base: 'khanguru',
    ui: {
      main: {
        cardViewConfig: {
          header: {
            title: {
              fieldId: 'user.firstName',
            },
          },
          body: {
            fields: [
              { fieldId: 'city' },
              { fieldId: 'bio' },
            ]
          },
          footer: {
            actions: [
              {
                data: {
                  type: 'navigation',
                  direction: 'forward',
                  placement: 'view',
                  viewId: 'dvnViewConfigs5',
                  params: {
                    conversionConfig: {
                      'item._id': 'memberToViewRefFieldValue',
                      'item.pairId': 'pairId',
                    }
                  }
                },
                ui: {
                  label: 'View Detail',
                  name: 'open-pair-detail-view',
                  view: 'flat'
                }
              }
            ]
          }
        },
      },
    },
    space: dvnSpaces(config).dvnSpaces1,
    title: 'My Mentees',
    type: 'atama-member-pairs-overview-view',
    table: atamaPairConfigs(config).atamaPairConfigs1.toObject(),
    params: {
      userRefFieldId: {
        required: true,
        value: 'leader'
      },
      memberToViewRefFieldId: {
        required: true,
        value: 'follower',
      }
    },
  }),
  // pair card list view for mentees to view mentors in simple-pairs table
  dvnViewConfigs4: decodeViewConfig({
    _id: 'dvnViewConfigs4',
    _created: new Date(),
    _updated: new Date(),
    base: 'khanguru',
    ui: {
      main: {
        cardViewConfig: {
          header: {
            cover: {
              //   aspectRatio: 16 / 9,
              //   fieldId: 'imageUrl',
              size: 100,
            },
            image: {
              fieldId: 'user.imageUrl',
              size: 72,
            },
            title: {
              fieldId: 'name',
            },
          },
          body: {
            fields: [
              { fieldId: 'company' },
              { fieldId: 'title', lines: 1 },
              { fieldId: 'city' },
            ]
          },
          footer: {
            actions: [
              {
                data: {
                  type: 'navigation',
                  direction: 'forward',
                  placement: 'view',
                  viewId: 'dvnViewConfigs9',
                  params: {
                    conversionConfig: {
                      'item._id': 'memberToViewRefFieldValue',
                      'item.pairId': 'pairId',
                    }
                  }
                },
                ui: {
                  label: 'View User & Meet',
                  name: 'open-pair-detail-view',
                  view: 'ghost',
                }
              }
            ]
          }
        },
      },
    },
    space: dvnSpaces(config).dvnSpaces1,
    title: 'My Mentors',
    type: 'atama-member-pairs-overview-view',
    table: atamaPairConfigs(config).atamaPairConfigs1.toObject(),
    params: {
      userRefFieldId: {
        required: true,
        value: 'follower'
      },
      memberToViewRefFieldId: {
        required: true,
        value: 'leader',
      },
      viewIdToNavigateToSelectPair: {
        required: true,
        value: 'dvnViewConfigs6',
      },
    },
  }),
  // pair detail view for mentors to view the mentee and the other details (sessions, etc)
  dvnViewConfigs5: decodeViewConfig({
    _id: 'dvnViewConfigs5',
    _created: new Date(),
    _updated: new Date(),
    base: 'khanguru',
    ui: {
      main: {
        infoSummaryCardViewConfig: {
          header: {},
          body: {
            fields: [
              { fieldId: 'city' },
            ],
          },
          footer: {}
        },
        infoDetailCardViewConfig: {
          header: {},
          body: {
            fields: [
              { fieldId: 'city' },
              { fieldId: 'bio' },
            ],
          },
          footer: {}
        },
      },
    },
    space: dvnSpaces(config).dvnSpaces1,
    title: 'Pair Details',
    type: 'atama-member-pair-detail-view',
    table: atamaPairConfigs(config).atamaPairConfigs1.toObject(),
    params: {
      userRefFieldId: {
        required: true,
        value: 'leader'
      },
      memberToViewRefFieldId: {
        required: true,
        value: 'follower',
      },
      memberToViewRefFieldValue: {
        required: true,
      },
      pairId: {
        required: true,
      },
      viewIdToNavigateOnEndPair: {
        required: true,
        value: 'dvnViewConfigs3',
      }
    },
  }),
  // selection view for mentees to select mentors in simple-pairs table
  dvnViewConfigs6: decodeViewConfig({
    _id: 'dvnViewConfigs6',
    _created: new Date(),
    _updated: new Date(),
    base: 'khanguru',
    ui: {
      main: {
        cardViewConfig: {
          header: {
            title: {
              fieldId: 'user.firstName',
            },
          },
          body: {
            fields: [
              { fieldId: 'company' },
              { fieldId: 'title' },
            ]
          },
        },
      },
    },
    space: dvnSpaces(config).dvnSpaces1,
    title: 'Select Mentors',
    type: 'atama-member-pair-selection-view',
    table: atamaPairConfigs(config).atamaPairConfigs1.toObject(),
    params: {
      userRefFieldId: {
        required: true,
        value: 'follower'
      },
      memberToViewRefFieldId: {
        required: true,
        value: 'leader',
      },
      viewIdToNavigateOnSelectionDone: {
        required: true,
        value: 'dvnViewConfigs4',
      },
    },
  }),
  // availability settings
  dvnViewConfigs7: decodeViewConfig({
    _id: 'dvnViewConfigs7',
    _created: new Date(),
    _updated: new Date(),
    base: 'khanguru',
    ui: {},
    space: dvnSpaces(config).dvnSpaces1,
    title: 'My Available Times',
    type: 'takvim-availability-settings-view',
    table: takvimCalendarConfigs(config).takvimCalendarConfigsBasic.toObject(),
  }),
  // edit membership info form for mentees
  dvnViewConfigs8: decodeViewConfig({
    _id: 'dvnViewConfigs8',
    _created: new Date(),
    _updated: new Date(),
    base: 'khanguru',
    ui: {},
    space: dvnSpaces(config).dvnSpaces1,
    title: 'My Info',
    type: 'member-info-form-view',
    table: uyeMembershipConfigs(config).uyeMembershipConfigs1.toObject(),
  }),
  // pair detail view for mentees to view the mentor and the other details (sessions, etc)
  dvnViewConfigs9: decodeViewConfig({
    _id: 'dvnViewConfigs9',
    _created: new Date(),
    _updated: new Date(),
    base: 'khanguru',
    ui: {
      main: {
        infoSummaryCardViewConfig: {
          header: {},
          body: {
            fields: [
              { fieldId: 'company' },
              { fieldId: 'title' },
              { fieldId: 'city' },
            ],
          },
          footer: {}
        },
        infoDetailCardViewConfig: {
          header: {},
          body: {
            fields: [
              { fieldId: 'company' },
              { fieldId: 'title' },
              { fieldId: 'city' },
              { fieldId: 'bio' },
            ],
          },
          footer: {}
        },
      },
    },
    space: dvnSpaces(config).dvnSpaces1,
    title: 'Pair Details',
    type: 'atama-member-pair-detail-view',
    table: atamaPairConfigs(config).atamaPairConfigs1.toObject(),
    params: {
      userRefFieldId: {
        required: true,
        value: 'follower'
      },
      memberToViewRefFieldId: {
        required: true,
        value: 'leader',
      },
      memberToViewRefFieldValue: {
        required: true,
      },
      pairId: {
        required: true,
      },
      viewIdToNavigateOnEndPair: {
        required: true,
        value: 'dvnViewConfigs3',
      }
    },
  }),
});

const dvnAppConfigs = (config) => ({
  // app for mentors
  dvnAppConfigs1: appConfig.AppConfig.decode({
    _id: 'dvnAppConfigs1',
    _created: new Date(),
    _updated: new Date(),
    mainContent: {
      centered: true,
    },
    mainNavigation: {
      items: [
        {
          ui: {
            title: 'My Mentees'
          },
          viewId: 'dvnViewConfigs3', // simple pair list to view its mentees
        },
        {
          ui: {
            title: 'Mentees'
          },
          viewId: 'dvnViewConfigs1', // mentees card view list
        },
        {
          ui: {
            title: 'Mentors'
          },
          viewId: 'dvnViewConfigs2', // mentors card view list
        },
        {
          ui: {
            title: 'My Available Times'
          },
          viewId: 'dvnViewConfigs7',
        },
      ],
      centered: true
    },
    space: dvnSpaces(config).dvnSpaces1,
    membership: uyeMembershipConfigs(config).uyeMembershipConfigs2,
    views: [
      dvnViewConfigs(config).dvnViewConfigs1,
      dvnViewConfigs(config).dvnViewConfigs2,
      dvnViewConfigs(config).dvnViewConfigs3,
      dvnViewConfigs(config).dvnViewConfigs5,
      dvnViewConfigs(config).dvnViewConfigs7, // availability settings
    ],
  }),
  // app for mentees
  dvnAppConfigs2: appConfig.AppConfig.decode({
    _id: 'dvnAppConfigs2',
    _created: new Date(),
    _updated: new Date(),
    mainContent: {
      centered: true,
    },
    mainNavigation: {
      items: [
        {
          ui: {
            title: 'My Mentors'
          },
          viewId: 'dvnViewConfigs4', // simple pair list to view its mentors
        },
        {
          ui: {
            title: 'All Mentees'
          },
          viewId: 'dvnViewConfigs1', // mentees card view list
        },
        {
          ui: {
            title: 'My Info'
          },
          viewId: 'dvnViewConfigs8',
        },
      ],
      centered: true
    },
    space: dvnSpaces(config).dvnSpaces1,
    membership: uyeMembershipConfigs(config).uyeMembershipConfigs1,
    views: [
      dvnViewConfigs(config).dvnViewConfigs1,
      dvnViewConfigs(config).dvnViewConfigs4,
      dvnViewConfigs(config).dvnViewConfigs6,
      dvnViewConfigs(config).dvnViewConfigs8,
      dvnViewConfigs(config).dvnViewConfigs9, // mentor detail page
    ],
  }),
});

const takvimAvailabilities = (config) => ({
  // single day
  takvimAvailabilities1: Availability.Availability.decode({
    _id: 'takvimAvailabilities1',
    _created: new Date(),
    _updated: new Date(),
    config: takvimCalendarConfigs(config).takvimCalendarConfigsBasic.toObject(),
    user: kimlikUsers(config).kimlikUsers3.toObject(),
    startDate: '2021-05-21T10:00:00Z',
    endDate: '2021-05-21T12:00:00Z',
    meetingDuration: 60,
    breakDuration: 15,
    recurrence: 'once',
  }),
  // single day
  takvimAvailabilities12: Availability.Availability.decode({
    _id: 'takvimAvailabilities1',
    _created: new Date(),
    _updated: new Date(),
    config: takvimCalendarConfigs(config).takvimCalendarConfigsBasic.toObject(),
    user: kimlikUsers(config).kimlikUsers3.toObject(),
    startDate: '2021-05-02T07:00:00Z',
    endDate: '2021-05-02T20:00:00Z',
    meetingDuration: 90,
    recurrence: 'once',
  }),
  // recurring on tuesdays
  // takvimAvailabilities2: Availability.decode({
  //   _id: 'takvimAvailabilities2',
  //   _created: new Date(),
  //   _updated: new Date(),
  //   config: takvimCalendarConfigs(config).takvimCalendarConfigsBasic.toObject(),
  //   user: kimlikUsers(config).kimlikUsers3.toObject(),
  //   startDate:'2021-04-01T10:00:00Z',
  //   endDate:'2021-04-01T18:00:00Z',
  //   meetingDuration: 60,
  //   recurrence: 'weekly',
  // }),
  // recurring on wednesdays
  takvimAvailabilities3: Availability.Availability.decode({
    _id: 'takvimAvailabilities3',
    _created: new Date(),
    _updated: new Date(),
    config: takvimCalendarConfigs(config).takvimCalendarConfigsBasic.toObject(),
    user: kimlikUsers(config).kimlikUsers3.toObject(),
    startDate: '2021-04-02T10:00:00Z',
    endDate: '2021-04-02T12:00:00Z',
    meetingDuration: 30,
    recurrence: 'weekly',
  }),
  // recurring on wednesdays
  takvimAvailabilities4: Availability.Availability.decode({
    _id: 'takvimAvailabilities4',
    _created: new Date(),
    _updated: new Date(),
    config: takvimCalendarConfigs(config).takvimCalendarConfigsBasic.toObject(),
    user: kimlikUsers(config).kimlikUsers3.toObject(),
    startDate: '2021-04-02T14:00:00Z',
    endDate: '2021-04-02T18:00:00Z',
    meetingDuration: 60,
    recurrence: 'weekly',
  }),
});

const takvimEvents = (config) => ({
  takvimEvents1: Event.decode({
    _id: 'takvimEvents1',
    _created: new Date(),
    _updated: new Date(),
    config: takvimCalendarConfigs(config).takvimCalendarConfigsBasic.toObject(),
    user: kimlikUsers(config).kimlikUsers3.toObject(),
    startDate: '2021-05-21T10:00:00Z',
    endDate: '2021-05-21T12:00:00Z',
    meetingType: '8nn549d7c589nm3358ng',
    guests: [
      kimlikUsers(config).kimlikUsers1.toDBRef('kimlikUsers'),
      kimlikUsers(config).kimlikUsers3.toDBRef('kimlikUsers'),
    ],
  }),
  takvimEvents2: Event.decode({
    _id: 'takvimEvents2',
    _created: new Date(),
    _updated: new Date(),
    config: takvimCalendarConfigs(config).takvimCalendarConfigsBasic.toObject(),
    user: kimlikUsers(config).kimlikUsers3.toObject(),
    startDate: '2021-05-22T10:00:00Z',
    endDate: '2021-05-22T12:00:00Z',
    meetingType: 'ca43340lann8ng',
    guests: [
      kimlikUsers(config).kimlikUsers1.toDBRef('kimlikUsers'),
      kimlikUsers(config).kimlikUsers3.toDBRef('kimlikUsers'),
    ],
  }),
});

const demoDB = (config) => ({
  atamaMeetingStructureConfigs: atamaMeetingStructureConfigs(config),
  atamaPairConfigs: atamaPairConfigs(config),
  atamaPairsSimplePairs: atamaPairsSimplePairs(config),
  dvnAppConfigs: dvnAppConfigs(config),
  dvnSpaces: dvnSpaces(config),
  dvnViewConfigs: dvnViewConfigs(config),
  kimlikUsers: kimlikUsers(config),
  onayAgreements: onayAgreements(),
  onayConsents: onayConsents(config),
  takvimCalendarConfigs: takvimCalendarConfigs(config),
  takvimAvailabilities: takvimAvailabilities(config),
  takvimEvents: takvimEvents(config),
  uyeMembershipConfigs: uyeMembershipConfigs(config),
  uyeMembershipsMentees: uyeMembershipsMentees(config),
  uyeMembershipsMentors: uyeMembershipsMentors(config),
});

const logLevel = 'debug';
const KhanguruDemoMentorshipSpace = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.path = '/';
    this.navigate = (config) => {
      this.logger.debugGroup('navigate', {
        from: this.path,
        to: config.path,
      });
      this.path = config.path;
    };
  }
  componentWillLoad() {
    const assetsPath = index.getAssetPath(`./assets`);
    const database = JSON.parse(JSON.stringify(demoDB({ assetsPath })));
    this.logger = new index$1.Logger('KhanguruDemoMentorshipSpace').setLevel(logLevel);
    this.logger.infoGroup('componentWillLoad', { storageKey: this.storageKey });
    this.storage = new UyeApiDemo.InstanceStorage(this.storageKey, this.logger);
    this.storage.save(kimlikApi.STORAGE_KEY_KIMLIK_TOKEN, 'kimlikUsers1-jwt');
    this.apiAtama = new UyeApiDemo.AtamaApiDemo(database, this.logger);
    this.apiData = new UyeApiDemo.DataApiDemo(database, this.logger);
    this.apiKimlik = new UyeApiDemo.KimlikApiDemo(database, this.storage, this.logger);
    this.apiTakvim = new UyeApiDemo.TakvimApiDemo(database, this.storage, this.logger);
    this.apiUye = new UyeApiDemo.UyeApiDemo(database, this.storage, this.logger);
    this.path = this.initialPath || location.pathname;
    this.apiSozluk = new index$1.SozlukApi();
  }
  render() {
    return (index.h(index.Host, null, index.h("dvn-app-root", { apiAtama: this.apiAtama, apiData: this.apiData, apiKimlik: this.apiKimlik, apiSozluk: this.apiSozluk, apiTakvim: this.apiTakvim, apiUye: this.apiUye, navigate: this.navigate, path: this.path, logger: this.logger, storage: this.storage })));
  }
  static get assetsDirs() { return ["assets"]; }
};

exports.khanguru_demo_mentorship_space = KhanguruDemoMentorshipSpace;
