"use strict";
/* eslint-disable-next-line no-unused-vars */
function __export(m) {
/* eslint-disable-next-line no-prototype-builtins */
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable-next-line no-unused-vars */
var jtv = require('@mojotech/json-type-validation');
/* eslint-disable-next-line no-unused-vars */
var damlTypes = require('@daml/types');

var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = require('../../../../DA/Internal/Template');

var Fairmint_OpenCapTable_Types_Core = require('../../../../Fairmint/OpenCapTable/Types/Core/module');


exports.OcfObjectType = {
  OcfObjIssuer: 'OcfObjIssuer',
  OcfObjStakeholder: 'OcfObjStakeholder',
  OcfObjStockClass: 'OcfObjStockClass',
  OcfObjStockLegendTemplate: 'OcfObjStockLegendTemplate',
  OcfObjStockPlan: 'OcfObjStockPlan',
  OcfObjValuation: 'OcfObjValuation',
  OcfObjVestingTerms: 'OcfObjVestingTerms',
  OcfObjFinancing: 'OcfObjFinancing',
  OcfObjDocument: 'OcfObjDocument',
  OcfObjCeStakeholderRelationship: 'OcfObjCeStakeholderRelationship',
  OcfObjCeStakeholderStatus: 'OcfObjCeStakeholderStatus',
  OcfObjTxIssuerAuthorizedSharesAdjustment: 'OcfObjTxIssuerAuthorizedSharesAdjustment',
  OcfObjTxStockClassConversionRatioAdjustment: 'OcfObjTxStockClassConversionRatioAdjustment',
  OcfObjTxStockClassAuthorizedSharesAdjustment: 'OcfObjTxStockClassAuthorizedSharesAdjustment',
  OcfObjTxStockClassSplit: 'OcfObjTxStockClassSplit',
  OcfObjTxStockPlanPoolAdjustment: 'OcfObjTxStockPlanPoolAdjustment',
  OcfObjTxStockPlanReturnToPool: 'OcfObjTxStockPlanReturnToPool',
  OcfObjTxConvertibleAcceptance: 'OcfObjTxConvertibleAcceptance',
  OcfObjTxConvertibleCancellation: 'OcfObjTxConvertibleCancellation',
  OcfObjTxConvertibleConversion: 'OcfObjTxConvertibleConversion',
  OcfObjTxConvertibleIssuance: 'OcfObjTxConvertibleIssuance',
  OcfObjTxConvertibleRetraction: 'OcfObjTxConvertibleRetraction',
  OcfObjTxConvertibleTransfer: 'OcfObjTxConvertibleTransfer',
  OcfObjTxEquityCompensationAcceptance: 'OcfObjTxEquityCompensationAcceptance',
  OcfObjTxEquityCompensationCancellation: 'OcfObjTxEquityCompensationCancellation',
  OcfObjTxEquityCompensationExercise: 'OcfObjTxEquityCompensationExercise',
  OcfObjTxEquityCompensationIssuance: 'OcfObjTxEquityCompensationIssuance',
  OcfObjTxEquityCompensationRelease: 'OcfObjTxEquityCompensationRelease',
  OcfObjTxEquityCompensationRetraction: 'OcfObjTxEquityCompensationRetraction',
  OcfObjTxEquityCompensationTransfer: 'OcfObjTxEquityCompensationTransfer',
  OcfObjTxEquityCompensationRepricing: 'OcfObjTxEquityCompensationRepricing',
  OcfObjTxPlanSecurityAcceptance: 'OcfObjTxPlanSecurityAcceptance',
  OcfObjTxPlanSecurityCancellation: 'OcfObjTxPlanSecurityCancellation',
  OcfObjTxPlanSecurityExercise: 'OcfObjTxPlanSecurityExercise',
  OcfObjTxPlanSecurityIssuance: 'OcfObjTxPlanSecurityIssuance',
  OcfObjTxPlanSecurityRelease: 'OcfObjTxPlanSecurityRelease',
  OcfObjTxPlanSecurityRetraction: 'OcfObjTxPlanSecurityRetraction',
  OcfObjTxPlanSecurityTransfer: 'OcfObjTxPlanSecurityTransfer',
  OcfObjTxStockAcceptance: 'OcfObjTxStockAcceptance',
  OcfObjTxStockCancellation: 'OcfObjTxStockCancellation',
  OcfObjTxStockConversion: 'OcfObjTxStockConversion',
  OcfObjTxStockIssuance: 'OcfObjTxStockIssuance',
  OcfObjTxStockReissuance: 'OcfObjTxStockReissuance',
  OcfObjTxStockConsolidation: 'OcfObjTxStockConsolidation',
  OcfObjTxStockRepurchase: 'OcfObjTxStockRepurchase',
  OcfObjTxStockRetraction: 'OcfObjTxStockRetraction',
  OcfObjTxStockTransfer: 'OcfObjTxStockTransfer',
  OcfObjTxWarrantAcceptance: 'OcfObjTxWarrantAcceptance',
  OcfObjTxWarrantCancellation: 'OcfObjTxWarrantCancellation',
  OcfObjTxWarrantExercise: 'OcfObjTxWarrantExercise',
  OcfObjTxWarrantIssuance: 'OcfObjTxWarrantIssuance',
  OcfObjTxWarrantRetraction: 'OcfObjTxWarrantRetraction',
  OcfObjTxWarrantTransfer: 'OcfObjTxWarrantTransfer',
  OcfObjTxVestingAcceleration: 'OcfObjTxVestingAcceleration',
  OcfObjTxVestingStart: 'OcfObjTxVestingStart',
  OcfObjTxVestingEvent: 'OcfObjTxVestingEvent',
  keys: ['OcfObjIssuer','OcfObjStakeholder','OcfObjStockClass','OcfObjStockLegendTemplate','OcfObjStockPlan','OcfObjValuation','OcfObjVestingTerms','OcfObjFinancing','OcfObjDocument','OcfObjCeStakeholderRelationship','OcfObjCeStakeholderStatus','OcfObjTxIssuerAuthorizedSharesAdjustment','OcfObjTxStockClassConversionRatioAdjustment','OcfObjTxStockClassAuthorizedSharesAdjustment','OcfObjTxStockClassSplit','OcfObjTxStockPlanPoolAdjustment','OcfObjTxStockPlanReturnToPool','OcfObjTxConvertibleAcceptance','OcfObjTxConvertibleCancellation','OcfObjTxConvertibleConversion','OcfObjTxConvertibleIssuance','OcfObjTxConvertibleRetraction','OcfObjTxConvertibleTransfer','OcfObjTxEquityCompensationAcceptance','OcfObjTxEquityCompensationCancellation','OcfObjTxEquityCompensationExercise','OcfObjTxEquityCompensationIssuance','OcfObjTxEquityCompensationRelease','OcfObjTxEquityCompensationRetraction','OcfObjTxEquityCompensationTransfer','OcfObjTxEquityCompensationRepricing','OcfObjTxPlanSecurityAcceptance','OcfObjTxPlanSecurityCancellation','OcfObjTxPlanSecurityExercise','OcfObjTxPlanSecurityIssuance','OcfObjTxPlanSecurityRelease','OcfObjTxPlanSecurityRetraction','OcfObjTxPlanSecurityTransfer','OcfObjTxStockAcceptance','OcfObjTxStockCancellation','OcfObjTxStockConversion','OcfObjTxStockIssuance','OcfObjTxStockReissuance','OcfObjTxStockConsolidation','OcfObjTxStockRepurchase','OcfObjTxStockRetraction','OcfObjTxStockTransfer','OcfObjTxWarrantAcceptance','OcfObjTxWarrantCancellation','OcfObjTxWarrantExercise','OcfObjTxWarrantIssuance','OcfObjTxWarrantRetraction','OcfObjTxWarrantTransfer','OcfObjTxVestingAcceleration','OcfObjTxVestingStart','OcfObjTxVestingEvent',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfObjectType.OcfObjIssuer), jtv.constant(exports.OcfObjectType.OcfObjStakeholder), jtv.constant(exports.OcfObjectType.OcfObjStockClass), jtv.constant(exports.OcfObjectType.OcfObjStockLegendTemplate), jtv.constant(exports.OcfObjectType.OcfObjStockPlan), jtv.constant(exports.OcfObjectType.OcfObjValuation), jtv.constant(exports.OcfObjectType.OcfObjVestingTerms), jtv.constant(exports.OcfObjectType.OcfObjFinancing), jtv.constant(exports.OcfObjectType.OcfObjDocument), jtv.constant(exports.OcfObjectType.OcfObjCeStakeholderRelationship), jtv.constant(exports.OcfObjectType.OcfObjCeStakeholderStatus), jtv.constant(exports.OcfObjectType.OcfObjTxIssuerAuthorizedSharesAdjustment), jtv.constant(exports.OcfObjectType.OcfObjTxStockClassConversionRatioAdjustment), jtv.constant(exports.OcfObjectType.OcfObjTxStockClassAuthorizedSharesAdjustment), jtv.constant(exports.OcfObjectType.OcfObjTxStockClassSplit), jtv.constant(exports.OcfObjectType.OcfObjTxStockPlanPoolAdjustment), jtv.constant(exports.OcfObjectType.OcfObjTxStockPlanReturnToPool), jtv.constant(exports.OcfObjectType.OcfObjTxConvertibleAcceptance), jtv.constant(exports.OcfObjectType.OcfObjTxConvertibleCancellation), jtv.constant(exports.OcfObjectType.OcfObjTxConvertibleConversion), jtv.constant(exports.OcfObjectType.OcfObjTxConvertibleIssuance), jtv.constant(exports.OcfObjectType.OcfObjTxConvertibleRetraction), jtv.constant(exports.OcfObjectType.OcfObjTxConvertibleTransfer), jtv.constant(exports.OcfObjectType.OcfObjTxEquityCompensationAcceptance), jtv.constant(exports.OcfObjectType.OcfObjTxEquityCompensationCancellation), jtv.constant(exports.OcfObjectType.OcfObjTxEquityCompensationExercise), jtv.constant(exports.OcfObjectType.OcfObjTxEquityCompensationIssuance), jtv.constant(exports.OcfObjectType.OcfObjTxEquityCompensationRelease), jtv.constant(exports.OcfObjectType.OcfObjTxEquityCompensationRetraction), jtv.constant(exports.OcfObjectType.OcfObjTxEquityCompensationTransfer), jtv.constant(exports.OcfObjectType.OcfObjTxEquityCompensationRepricing), jtv.constant(exports.OcfObjectType.OcfObjTxPlanSecurityAcceptance), jtv.constant(exports.OcfObjectType.OcfObjTxPlanSecurityCancellation), jtv.constant(exports.OcfObjectType.OcfObjTxPlanSecurityExercise), jtv.constant(exports.OcfObjectType.OcfObjTxPlanSecurityIssuance), jtv.constant(exports.OcfObjectType.OcfObjTxPlanSecurityRelease), jtv.constant(exports.OcfObjectType.OcfObjTxPlanSecurityRetraction), jtv.constant(exports.OcfObjectType.OcfObjTxPlanSecurityTransfer), jtv.constant(exports.OcfObjectType.OcfObjTxStockAcceptance), jtv.constant(exports.OcfObjectType.OcfObjTxStockCancellation), jtv.constant(exports.OcfObjectType.OcfObjTxStockConversion), jtv.constant(exports.OcfObjectType.OcfObjTxStockIssuance), jtv.constant(exports.OcfObjectType.OcfObjTxStockReissuance), jtv.constant(exports.OcfObjectType.OcfObjTxStockConsolidation), jtv.constant(exports.OcfObjectType.OcfObjTxStockRepurchase), jtv.constant(exports.OcfObjectType.OcfObjTxStockRetraction), jtv.constant(exports.OcfObjectType.OcfObjTxStockTransfer), jtv.constant(exports.OcfObjectType.OcfObjTxWarrantAcceptance), jtv.constant(exports.OcfObjectType.OcfObjTxWarrantCancellation), jtv.constant(exports.OcfObjectType.OcfObjTxWarrantExercise), jtv.constant(exports.OcfObjectType.OcfObjTxWarrantIssuance), jtv.constant(exports.OcfObjectType.OcfObjTxWarrantRetraction), jtv.constant(exports.OcfObjectType.OcfObjTxWarrantTransfer), jtv.constant(exports.OcfObjectType.OcfObjTxVestingAcceleration), jtv.constant(exports.OcfObjectType.OcfObjTxVestingStart), jtv.constant(exports.OcfObjectType.OcfObjTxVestingEvent)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfObjectReference = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({object_id: damlTypes.Text.decoder, object_type: exports.OcfObjectType.decoder, }); }),
  encode: function (__typed__) {
  return {
    object_id: damlTypes.Text.encode(__typed__.object_id),
    object_type: exports.OcfObjectType.encode(__typed__.object_type),
  };
}
,
};



exports.DocumentOcfData = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({id: damlTypes.Text.decoder, md5: damlTypes.Text.decoder, comments: damlTypes.List(damlTypes.Text).decoder, related_objects: damlTypes.List(exports.OcfObjectReference).decoder, path: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), uri: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), }); }),
  encode: function (__typed__) {
  return {
    id: damlTypes.Text.encode(__typed__.id),
    md5: damlTypes.Text.encode(__typed__.md5),
    comments: damlTypes.List(damlTypes.Text).encode(__typed__.comments),
    related_objects: damlTypes.List(exports.OcfObjectReference).encode(__typed__.related_objects),
    path: damlTypes.Optional(damlTypes.Text).encode(__typed__.path),
    uri: damlTypes.Optional(damlTypes.Text).encode(__typed__.uri),
  };
}
,
};



exports.Document = damlTypes.assembleTemplate(
{
  templateId: '#OpenCapTable-v34:Fairmint.OpenCapTable.OCF.Document:Document',
  templateIdWithPackageId: '0eb2e2e43d1d241492077e84452c7ffb63dd34a9af49ddec0dba636351f6486b:Fairmint.OpenCapTable.OCF.Document:Document',
  keyDecoder: damlTypes.lazyMemo(function () { return jtv.constant(undefined); }),
  keyEncode: function () { throw 'EncodeError'; },
  decoder: damlTypes.lazyMemo(function () { return jtv.object({context: Fairmint_OpenCapTable_Types_Core.Context.decoder, document_data: exports.DocumentOcfData.decoder, }); }),
  encode: function (__typed__) {
  return {
    context: Fairmint_OpenCapTable_Types_Core.Context.encode(__typed__.context),
    document_data: exports.DocumentOcfData.encode(__typed__.document_data),
  };
}
,
  Archive: {
    template: function () { return exports.Document; },
    choiceName: 'Archive',
    argumentDecoder: damlTypes.lazyMemo(function () { return pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69.DA.Internal.Template.Archive.decoder; }),
    argumentEncode: function (__typed__) { return pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69.DA.Internal.Template.Archive.encode(__typed__); },
    resultDecoder: damlTypes.lazyMemo(function () { return damlTypes.Unit.decoder; }),
    resultEncode: function (__typed__) { return damlTypes.Unit.encode(__typed__); },
  },
}

);


damlTypes.registerTemplate(exports.Document, ['0eb2e2e43d1d241492077e84452c7ffb63dd34a9af49ddec0dba636351f6486b', '#OpenCapTable-v34']);

