"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 Fairmint_OpenCapTable_Types_Monetary = require('../../../../Fairmint/OpenCapTable/Types/Monetary/module');
var Fairmint_OpenCapTable_Types_Stock = require('../../../../Fairmint/OpenCapTable/Types/Stock/module');


exports.OcfConversionTrigger = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({conversion_right: exports.OcfAnyConversionRight.decoder, trigger_id: damlTypes.Text.decoder, type_: exports.OcfConversionTriggerType.decoder, nickname: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), trigger_condition: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), trigger_date: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), trigger_description: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), }); }),
  encode: function (__typed__) {
  return {
    conversion_right: exports.OcfAnyConversionRight.encode(__typed__.conversion_right),
    trigger_id: damlTypes.Text.encode(__typed__.trigger_id),
    type_: exports.OcfConversionTriggerType.encode(__typed__.type_),
    nickname: damlTypes.Optional(damlTypes.Text).encode(__typed__.nickname),
    trigger_condition: damlTypes.Optional(damlTypes.Text).encode(__typed__.trigger_condition),
    trigger_date: damlTypes.Optional(damlTypes.Time).encode(__typed__.trigger_date),
    trigger_description: damlTypes.Optional(damlTypes.Text).encode(__typed__.trigger_description),
  };
}
,
};



exports.OcfAnyConversionRight = {
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.object({tag: jtv.constant('OcfRightConvertible'), value: exports.OcfConvertibleConversionRight.decoder, }), jtv.object({tag: jtv.constant('OcfRightWarrant'), value: exports.OcfWarrantConversionRight.decoder, }), jtv.object({tag: jtv.constant('OcfRightStockClass'), value: exports.OcfStockClassConversionRight.decoder, })); }),
  encode: function (__typed__) {
  switch(__typed__.tag) {
    case 'OcfRightConvertible': return {tag: __typed__.tag, value: exports.OcfConvertibleConversionRight.encode(__typed__.value)};
    case 'OcfRightWarrant': return {tag: __typed__.tag, value: exports.OcfWarrantConversionRight.encode(__typed__.value)};
    case 'OcfRightStockClass': return {tag: __typed__.tag, value: exports.OcfStockClassConversionRight.encode(__typed__.value)};
    default: throw 'unrecognized type tag: ' + __typed__.tag + ' while serializing a value of type OcfAnyConversionRight';
  }
}
,
};



exports.OcfStockClassConversionRight = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({conversion_mechanism: exports.OcfConversionMechanism.decoder, conversion_trigger: exports.OcfConversionTrigger.decoder, converts_to_stock_class_id: damlTypes.Text.decoder, type_: damlTypes.Text.decoder, ceiling_price_per_share: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), conversion_price: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), custom_description: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), discount_rate: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Numeric(10)).decoder), expires_at: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), floor_price_per_share: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), percent_of_capitalization: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Numeric(10)).decoder), ratio: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Stock.OcfRatio).decoder), reference_share_price: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), reference_valuation_price_per_share: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), valuation_cap: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), }); }),
  encode: function (__typed__) {
  return {
    conversion_mechanism: exports.OcfConversionMechanism.encode(__typed__.conversion_mechanism),
    conversion_trigger: exports.OcfConversionTrigger.encode(__typed__.conversion_trigger),
    converts_to_stock_class_id: damlTypes.Text.encode(__typed__.converts_to_stock_class_id),
    type_: damlTypes.Text.encode(__typed__.type_),
    ceiling_price_per_share: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.ceiling_price_per_share),
    conversion_price: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.conversion_price),
    custom_description: damlTypes.Optional(damlTypes.Text).encode(__typed__.custom_description),
    discount_rate: damlTypes.Optional(damlTypes.Numeric(10)).encode(__typed__.discount_rate),
    expires_at: damlTypes.Optional(damlTypes.Time).encode(__typed__.expires_at),
    floor_price_per_share: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.floor_price_per_share),
    percent_of_capitalization: damlTypes.Optional(damlTypes.Numeric(10)).encode(__typed__.percent_of_capitalization),
    ratio: damlTypes.Optional(Fairmint_OpenCapTable_Types_Stock.OcfRatio).encode(__typed__.ratio),
    reference_share_price: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.reference_share_price),
    reference_valuation_price_per_share: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.reference_valuation_price_per_share),
    valuation_cap: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.valuation_cap),
  };
}
,
};



exports.OcfConvertibleConversionRight = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({conversion_mechanism: exports.OcfConvertibleConversionMechanism.decoder, type_: damlTypes.Text.decoder, converts_to_future_round: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Bool).decoder), converts_to_stock_class_id: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), }); }),
  encode: function (__typed__) {
  return {
    conversion_mechanism: exports.OcfConvertibleConversionMechanism.encode(__typed__.conversion_mechanism),
    type_: damlTypes.Text.encode(__typed__.type_),
    converts_to_future_round: damlTypes.Optional(damlTypes.Bool).encode(__typed__.converts_to_future_round),
    converts_to_stock_class_id: damlTypes.Optional(damlTypes.Text).encode(__typed__.converts_to_stock_class_id),
  };
}
,
};



exports.OcfConvertibleConversionMechanism = {
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.object({tag: jtv.constant('OcfConvMechSAFE'), value: exports.OcfSAFEConversionMechanism.decoder, }), jtv.object({tag: jtv.constant('OcfConvMechNote'), value: exports.OcfNoteConversionMechanism.decoder, }), jtv.object({tag: jtv.constant('OcfConvMechCustom'), value: exports.OcfCustomConversionMechanism.decoder, }), jtv.object({tag: jtv.constant('OcfConvMechPercentCapitalization'), value: exports.OcfPercentCapitalizationConversionMechanism.decoder, }), jtv.object({tag: jtv.constant('OcfConvMechFixedAmount'), value: exports.OcfFixedAmountConversionMechanism.decoder, }), jtv.object({tag: jtv.constant('OcfConvMechPpsBased'), value: exports.OcfSharePriceBasedConversionMechanism.decoder, }), jtv.object({tag: jtv.constant('OcfConvMechValuationBased'), value: exports.OcfValuationBasedConversionMechanism.decoder, }), jtv.object({tag: jtv.constant('OcfConvMechRatio'), value: Fairmint_OpenCapTable_Types_Stock.OcfRatio.decoder, })); }),
  encode: function (__typed__) {
  switch(__typed__.tag) {
    case 'OcfConvMechSAFE': return {tag: __typed__.tag, value: exports.OcfSAFEConversionMechanism.encode(__typed__.value)};
    case 'OcfConvMechNote': return {tag: __typed__.tag, value: exports.OcfNoteConversionMechanism.encode(__typed__.value)};
    case 'OcfConvMechCustom': return {tag: __typed__.tag, value: exports.OcfCustomConversionMechanism.encode(__typed__.value)};
    case 'OcfConvMechPercentCapitalization': return {tag: __typed__.tag, value: exports.OcfPercentCapitalizationConversionMechanism.encode(__typed__.value)};
    case 'OcfConvMechFixedAmount': return {tag: __typed__.tag, value: exports.OcfFixedAmountConversionMechanism.encode(__typed__.value)};
    case 'OcfConvMechPpsBased': return {tag: __typed__.tag, value: exports.OcfSharePriceBasedConversionMechanism.encode(__typed__.value)};
    case 'OcfConvMechValuationBased': return {tag: __typed__.tag, value: exports.OcfValuationBasedConversionMechanism.encode(__typed__.value)};
    case 'OcfConvMechRatio': return {tag: __typed__.tag, value: Fairmint_OpenCapTable_Types_Stock.OcfRatio.encode(__typed__.value)};
    default: throw 'unrecognized type tag: ' + __typed__.tag + ' while serializing a value of type OcfConvertibleConversionMechanism';
  }
}
,
};



exports.OcfWarrantConversionRight = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({conversion_mechanism: exports.OcfWarrantConversionMechanism.decoder, type_: damlTypes.Text.decoder, converts_to_future_round: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Bool).decoder), converts_to_stock_class_id: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), }); }),
  encode: function (__typed__) {
  return {
    conversion_mechanism: exports.OcfWarrantConversionMechanism.encode(__typed__.conversion_mechanism),
    type_: damlTypes.Text.encode(__typed__.type_),
    converts_to_future_round: damlTypes.Optional(damlTypes.Bool).encode(__typed__.converts_to_future_round),
    converts_to_stock_class_id: damlTypes.Optional(damlTypes.Text).encode(__typed__.converts_to_stock_class_id),
  };
}
,
};



exports.OcfWarrantConversionMechanism = {
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.object({tag: jtv.constant('OcfWarrantMechanismCustom'), value: exports.OcfWarrantConversionMechanism.OcfWarrantMechanismCustom.decoder, }), jtv.object({tag: jtv.constant('OcfWarrantMechanismPercentCapitalization'), value: exports.OcfWarrantConversionMechanism.OcfWarrantMechanismPercentCapitalization.decoder, }), jtv.object({tag: jtv.constant('OcfWarrantMechanismFixedAmount'), value: exports.OcfWarrantConversionMechanism.OcfWarrantMechanismFixedAmount.decoder, }), jtv.object({tag: jtv.constant('OcfWarrantMechanismValuationBased'), value: exports.OcfWarrantConversionMechanism.OcfWarrantMechanismValuationBased.decoder, }), jtv.object({tag: jtv.constant('OcfWarrantMechanismPpsBased'), value: exports.OcfWarrantConversionMechanism.OcfWarrantMechanismPpsBased.decoder, })); }),
  encode: function (__typed__) {
  switch(__typed__.tag) {
    case 'OcfWarrantMechanismCustom': return {tag: __typed__.tag, value: exports.OcfWarrantConversionMechanism.OcfWarrantMechanismCustom.encode(__typed__.value)};
    case 'OcfWarrantMechanismPercentCapitalization': return {tag: __typed__.tag, value: exports.OcfWarrantConversionMechanism.OcfWarrantMechanismPercentCapitalization.encode(__typed__.value)};
    case 'OcfWarrantMechanismFixedAmount': return {tag: __typed__.tag, value: exports.OcfWarrantConversionMechanism.OcfWarrantMechanismFixedAmount.encode(__typed__.value)};
    case 'OcfWarrantMechanismValuationBased': return {tag: __typed__.tag, value: exports.OcfWarrantConversionMechanism.OcfWarrantMechanismValuationBased.encode(__typed__.value)};
    case 'OcfWarrantMechanismPpsBased': return {tag: __typed__.tag, value: exports.OcfWarrantConversionMechanism.OcfWarrantMechanismPpsBased.encode(__typed__.value)};
    default: throw 'unrecognized type tag: ' + __typed__.tag + ' while serializing a value of type OcfWarrantConversionMechanism';
  }
}
,
  OcfWarrantMechanismCustom:({
    decoder: damlTypes.lazyMemo(function () { return jtv.object({custom_conversion_description: damlTypes.Text.decoder, }); }),
    encode: function (__typed__) {
  return {
    custom_conversion_description: damlTypes.Text.encode(__typed__.custom_conversion_description),
  };
}
,
  }),
  OcfWarrantMechanismPercentCapitalization:({
    decoder: damlTypes.lazyMemo(function () { return jtv.object({converts_to_percent: damlTypes.Numeric(10).decoder, capitalization_definition: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), capitalization_definition_rules: jtv.Decoder.withDefault(null, damlTypes.Optional(exports.OcfCapitalizationDefinitionRules).decoder), }); }),
    encode: function (__typed__) {
  return {
    converts_to_percent: damlTypes.Numeric(10).encode(__typed__.converts_to_percent),
    capitalization_definition: damlTypes.Optional(damlTypes.Text).encode(__typed__.capitalization_definition),
    capitalization_definition_rules: damlTypes.Optional(exports.OcfCapitalizationDefinitionRules).encode(__typed__.capitalization_definition_rules),
  };
}
,
  }),
  OcfWarrantMechanismFixedAmount:({
    decoder: damlTypes.lazyMemo(function () { return jtv.object({converts_to_quantity: damlTypes.Numeric(10).decoder, }); }),
    encode: function (__typed__) {
  return {
    converts_to_quantity: damlTypes.Numeric(10).encode(__typed__.converts_to_quantity),
  };
}
,
  }),
  OcfWarrantMechanismValuationBased:({
    decoder: damlTypes.lazyMemo(function () { return jtv.object({valuation_type: damlTypes.Text.decoder, valuation_amount: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), capitalization_definition: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), capitalization_definition_rules: jtv.Decoder.withDefault(null, damlTypes.Optional(exports.OcfCapitalizationDefinitionRules).decoder), }); }),
    encode: function (__typed__) {
  return {
    valuation_type: damlTypes.Text.encode(__typed__.valuation_type),
    valuation_amount: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.valuation_amount),
    capitalization_definition: damlTypes.Optional(damlTypes.Text).encode(__typed__.capitalization_definition),
    capitalization_definition_rules: damlTypes.Optional(exports.OcfCapitalizationDefinitionRules).encode(__typed__.capitalization_definition_rules),
  };
}
,
  }),
  OcfWarrantMechanismPpsBased:({
    decoder: damlTypes.lazyMemo(function () { return jtv.object({description: damlTypes.Text.decoder, discount: damlTypes.Bool.decoder, discount_percentage: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Numeric(10)).decoder), discount_amount: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), }); }),
    encode: function (__typed__) {
  return {
    description: damlTypes.Text.encode(__typed__.description),
    discount: damlTypes.Bool.encode(__typed__.discount),
    discount_percentage: damlTypes.Optional(damlTypes.Numeric(10)).encode(__typed__.discount_percentage),
    discount_amount: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.discount_amount),
  };
}
,
  }),
};













exports.OcfConvertibleType = {
  OcfConvertibleNote: 'OcfConvertibleNote',
  OcfConvertibleSafe: 'OcfConvertibleSafe',
  OcfConvertibleSecurity: 'OcfConvertibleSecurity',
  keys: ['OcfConvertibleNote','OcfConvertibleSafe','OcfConvertibleSecurity',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfConvertibleType.OcfConvertibleNote), jtv.constant(exports.OcfConvertibleType.OcfConvertibleSafe), jtv.constant(exports.OcfConvertibleType.OcfConvertibleSecurity)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfConversionTriggerType = {
  OcfTriggerTypeTypeAutomaticOnCondition: 'OcfTriggerTypeTypeAutomaticOnCondition',
  OcfTriggerTypeTypeAutomaticOnDate: 'OcfTriggerTypeTypeAutomaticOnDate',
  OcfTriggerTypeTypeElectiveInRange: 'OcfTriggerTypeTypeElectiveInRange',
  OcfTriggerTypeTypeElectiveOnCondition: 'OcfTriggerTypeTypeElectiveOnCondition',
  OcfTriggerTypeTypeElectiveAtWill: 'OcfTriggerTypeTypeElectiveAtWill',
  OcfTriggerTypeTypeUnspecified: 'OcfTriggerTypeTypeUnspecified',
  keys: ['OcfTriggerTypeTypeAutomaticOnCondition','OcfTriggerTypeTypeAutomaticOnDate','OcfTriggerTypeTypeElectiveInRange','OcfTriggerTypeTypeElectiveOnCondition','OcfTriggerTypeTypeElectiveAtWill','OcfTriggerTypeTypeUnspecified',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfConversionTriggerType.OcfTriggerTypeTypeAutomaticOnCondition), jtv.constant(exports.OcfConversionTriggerType.OcfTriggerTypeTypeAutomaticOnDate), jtv.constant(exports.OcfConversionTriggerType.OcfTriggerTypeTypeElectiveInRange), jtv.constant(exports.OcfConversionTriggerType.OcfTriggerTypeTypeElectiveOnCondition), jtv.constant(exports.OcfConversionTriggerType.OcfTriggerTypeTypeElectiveAtWill), jtv.constant(exports.OcfConversionTriggerType.OcfTriggerTypeTypeUnspecified)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfNoteConversionMechanism = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({compounding_type: exports.OcfCompoundingType.decoder, day_count_convention: exports.OcfDayCountType.decoder, interest_accrual_period: exports.OcfAccrualPeriodType.decoder, interest_payout: exports.OcfInterestPayoutType.decoder, interest_rates: damlTypes.List(exports.OcfInterestRate).decoder, capitalization_definition: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), capitalization_definition_rules: jtv.Decoder.withDefault(null, damlTypes.Optional(exports.OcfCapitalizationDefinitionRules).decoder), conversion_discount: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Numeric(10)).decoder), conversion_mfn: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Bool).decoder), conversion_valuation_cap: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), exit_multiple: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Stock.OcfRatio).decoder), }); }),
  encode: function (__typed__) {
  return {
    compounding_type: exports.OcfCompoundingType.encode(__typed__.compounding_type),
    day_count_convention: exports.OcfDayCountType.encode(__typed__.day_count_convention),
    interest_accrual_period: exports.OcfAccrualPeriodType.encode(__typed__.interest_accrual_period),
    interest_payout: exports.OcfInterestPayoutType.encode(__typed__.interest_payout),
    interest_rates: damlTypes.List(exports.OcfInterestRate).encode(__typed__.interest_rates),
    capitalization_definition: damlTypes.Optional(damlTypes.Text).encode(__typed__.capitalization_definition),
    capitalization_definition_rules: damlTypes.Optional(exports.OcfCapitalizationDefinitionRules).encode(__typed__.capitalization_definition_rules),
    conversion_discount: damlTypes.Optional(damlTypes.Numeric(10)).encode(__typed__.conversion_discount),
    conversion_mfn: damlTypes.Optional(damlTypes.Bool).encode(__typed__.conversion_mfn),
    conversion_valuation_cap: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.conversion_valuation_cap),
    exit_multiple: damlTypes.Optional(Fairmint_OpenCapTable_Types_Stock.OcfRatio).encode(__typed__.exit_multiple),
  };
}
,
};



exports.OcfSAFEConversionMechanism = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({conversion_mfn: damlTypes.Bool.decoder, capitalization_definition: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), capitalization_definition_rules: jtv.Decoder.withDefault(null, damlTypes.Optional(exports.OcfCapitalizationDefinitionRules).decoder), conversion_discount: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Numeric(10)).decoder), conversion_timing: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), conversion_valuation_cap: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), exit_multiple: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Stock.OcfRatio).decoder), }); }),
  encode: function (__typed__) {
  return {
    conversion_mfn: damlTypes.Bool.encode(__typed__.conversion_mfn),
    capitalization_definition: damlTypes.Optional(damlTypes.Text).encode(__typed__.capitalization_definition),
    capitalization_definition_rules: damlTypes.Optional(exports.OcfCapitalizationDefinitionRules).encode(__typed__.capitalization_definition_rules),
    conversion_discount: damlTypes.Optional(damlTypes.Numeric(10)).encode(__typed__.conversion_discount),
    conversion_timing: damlTypes.Optional(damlTypes.Text).encode(__typed__.conversion_timing),
    conversion_valuation_cap: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.conversion_valuation_cap),
    exit_multiple: damlTypes.Optional(Fairmint_OpenCapTable_Types_Stock.OcfRatio).encode(__typed__.exit_multiple),
  };
}
,
};



exports.OcfValuationBasedConversionMechanism = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({valuation_type: exports.OcfValuationBasedFormulaType.decoder, capitalization_definition: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), capitalization_definition_rules: jtv.Decoder.withDefault(null, damlTypes.Optional(exports.OcfCapitalizationDefinitionRules).decoder), valuation_amount: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), }); }),
  encode: function (__typed__) {
  return {
    valuation_type: exports.OcfValuationBasedFormulaType.encode(__typed__.valuation_type),
    capitalization_definition: damlTypes.Optional(damlTypes.Text).encode(__typed__.capitalization_definition),
    capitalization_definition_rules: damlTypes.Optional(exports.OcfCapitalizationDefinitionRules).encode(__typed__.capitalization_definition_rules),
    valuation_amount: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.valuation_amount),
  };
}
,
};



exports.OcfValuationBasedFormulaType = {
  OcfValuationCap: 'OcfValuationCap',
  OcfValuationFixed: 'OcfValuationFixed',
  OcfValuationActual: 'OcfValuationActual',
  keys: ['OcfValuationCap','OcfValuationFixed','OcfValuationActual',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfValuationBasedFormulaType.OcfValuationCap), jtv.constant(exports.OcfValuationBasedFormulaType.OcfValuationFixed), jtv.constant(exports.OcfValuationBasedFormulaType.OcfValuationActual)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfSharePriceBasedConversionMechanism = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({description: damlTypes.Text.decoder, discount: damlTypes.Bool.decoder, discount_amount: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), discount_percentage: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Numeric(10)).decoder), }); }),
  encode: function (__typed__) {
  return {
    description: damlTypes.Text.encode(__typed__.description),
    discount: damlTypes.Bool.encode(__typed__.discount),
    discount_amount: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.discount_amount),
    discount_percentage: damlTypes.Optional(damlTypes.Numeric(10)).encode(__typed__.discount_percentage),
  };
}
,
};



exports.OcfPercentCapitalizationConversionMechanism = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({converts_to_percent: damlTypes.Numeric(10).decoder, capitalization_definition: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), capitalization_definition_rules: jtv.Decoder.withDefault(null, damlTypes.Optional(exports.OcfCapitalizationDefinitionRules).decoder), }); }),
  encode: function (__typed__) {
  return {
    converts_to_percent: damlTypes.Numeric(10).encode(__typed__.converts_to_percent),
    capitalization_definition: damlTypes.Optional(damlTypes.Text).encode(__typed__.capitalization_definition),
    capitalization_definition_rules: damlTypes.Optional(exports.OcfCapitalizationDefinitionRules).encode(__typed__.capitalization_definition_rules),
  };
}
,
};



exports.OcfFixedAmountConversionMechanism = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({converts_to_quantity: damlTypes.Numeric(10).decoder, }); }),
  encode: function (__typed__) {
  return {
    converts_to_quantity: damlTypes.Numeric(10).encode(__typed__.converts_to_quantity),
  };
}
,
};



exports.OcfCustomConversionMechanism = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({custom_conversion_description: damlTypes.Text.decoder, }); }),
  encode: function (__typed__) {
  return {
    custom_conversion_description: damlTypes.Text.encode(__typed__.custom_conversion_description),
  };
}
,
};



exports.OcfRatioConversionMechanism = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({conversion_price: Fairmint_OpenCapTable_Types_Monetary.OcfMonetary.decoder, ratio: Fairmint_OpenCapTable_Types_Stock.OcfRatio.decoder, rounding_type: exports.OcfRoundingType.decoder, }); }),
  encode: function (__typed__) {
  return {
    conversion_price: Fairmint_OpenCapTable_Types_Monetary.OcfMonetary.encode(__typed__.conversion_price),
    ratio: Fairmint_OpenCapTable_Types_Stock.OcfRatio.encode(__typed__.ratio),
    rounding_type: exports.OcfRoundingType.encode(__typed__.rounding_type),
  };
}
,
};



exports.OcfConversionMechanism = {
  OcfConversionMechanismRatioConversion: 'OcfConversionMechanismRatioConversion',
  OcfConversionMechanismPercentCapitalizationConversion: 'OcfConversionMechanismPercentCapitalizationConversion',
  OcfConversionMechanismFixedAmountConversion: 'OcfConversionMechanismFixedAmountConversion',
  OcfConversionMechanismValuationBasedConversion: 'OcfConversionMechanismValuationBasedConversion',
  OcfConversionMechanismPpsBasedConversion: 'OcfConversionMechanismPpsBasedConversion',
  OcfConversionMechanismSAFEConversion: 'OcfConversionMechanismSAFEConversion',
  OcfConversionMechanismNoteConversion: 'OcfConversionMechanismNoteConversion',
  OcfConversionMechanismCustomConversion: 'OcfConversionMechanismCustomConversion',
  keys: ['OcfConversionMechanismRatioConversion','OcfConversionMechanismPercentCapitalizationConversion','OcfConversionMechanismFixedAmountConversion','OcfConversionMechanismValuationBasedConversion','OcfConversionMechanismPpsBasedConversion','OcfConversionMechanismSAFEConversion','OcfConversionMechanismNoteConversion','OcfConversionMechanismCustomConversion',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfConversionMechanism.OcfConversionMechanismRatioConversion), jtv.constant(exports.OcfConversionMechanism.OcfConversionMechanismPercentCapitalizationConversion), jtv.constant(exports.OcfConversionMechanism.OcfConversionMechanismFixedAmountConversion), jtv.constant(exports.OcfConversionMechanism.OcfConversionMechanismValuationBasedConversion), jtv.constant(exports.OcfConversionMechanism.OcfConversionMechanismPpsBasedConversion), jtv.constant(exports.OcfConversionMechanism.OcfConversionMechanismSAFEConversion), jtv.constant(exports.OcfConversionMechanism.OcfConversionMechanismNoteConversion), jtv.constant(exports.OcfConversionMechanism.OcfConversionMechanismCustomConversion)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfCapitalizationDefinitionRules = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({include_additional_option_pool_topup: damlTypes.Bool.decoder, include_new_money: damlTypes.Bool.decoder, include_option_pool_topup_for_promised_options: damlTypes.Bool.decoder, include_other_converting_securities: damlTypes.Bool.decoder, include_outstanding_options: damlTypes.Bool.decoder, include_outstanding_shares: damlTypes.Bool.decoder, include_outstanding_unissued_options: damlTypes.Bool.decoder, include_this_security: damlTypes.Bool.decoder, }); }),
  encode: function (__typed__) {
  return {
    include_additional_option_pool_topup: damlTypes.Bool.encode(__typed__.include_additional_option_pool_topup),
    include_new_money: damlTypes.Bool.encode(__typed__.include_new_money),
    include_option_pool_topup_for_promised_options: damlTypes.Bool.encode(__typed__.include_option_pool_topup_for_promised_options),
    include_other_converting_securities: damlTypes.Bool.encode(__typed__.include_other_converting_securities),
    include_outstanding_options: damlTypes.Bool.encode(__typed__.include_outstanding_options),
    include_outstanding_shares: damlTypes.Bool.encode(__typed__.include_outstanding_shares),
    include_outstanding_unissued_options: damlTypes.Bool.encode(__typed__.include_outstanding_unissued_options),
    include_this_security: damlTypes.Bool.encode(__typed__.include_this_security),
  };
}
,
};



exports.OcfCapitalizationDefinition = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({exclude_security_ids: damlTypes.List(damlTypes.Text).decoder, include_security_ids: damlTypes.List(damlTypes.Text).decoder, include_stock_class_ids: damlTypes.List(damlTypes.Text).decoder, include_stock_plans_ids: damlTypes.List(damlTypes.Text).decoder, }); }),
  encode: function (__typed__) {
  return {
    exclude_security_ids: damlTypes.List(damlTypes.Text).encode(__typed__.exclude_security_ids),
    include_security_ids: damlTypes.List(damlTypes.Text).encode(__typed__.include_security_ids),
    include_stock_class_ids: damlTypes.List(damlTypes.Text).encode(__typed__.include_stock_class_ids),
    include_stock_plans_ids: damlTypes.List(damlTypes.Text).encode(__typed__.include_stock_plans_ids),
  };
}
,
};



exports.OcfInterestRate = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({accrual_start_date: damlTypes.Time.decoder, rate: damlTypes.Numeric(10).decoder, accrual_end_date: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), }); }),
  encode: function (__typed__) {
  return {
    accrual_start_date: damlTypes.Time.encode(__typed__.accrual_start_date),
    rate: damlTypes.Numeric(10).encode(__typed__.rate),
    accrual_end_date: damlTypes.Optional(damlTypes.Time).encode(__typed__.accrual_end_date),
  };
}
,
};



exports.OcfAccrualPeriodType = {
  OcfAccrualDaily: 'OcfAccrualDaily',
  OcfAccrualMonthly: 'OcfAccrualMonthly',
  OcfAccrualQuarterly: 'OcfAccrualQuarterly',
  OcfAccrualSemiAnnual: 'OcfAccrualSemiAnnual',
  OcfAccrualAnnual: 'OcfAccrualAnnual',
  keys: ['OcfAccrualDaily','OcfAccrualMonthly','OcfAccrualQuarterly','OcfAccrualSemiAnnual','OcfAccrualAnnual',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfAccrualPeriodType.OcfAccrualDaily), jtv.constant(exports.OcfAccrualPeriodType.OcfAccrualMonthly), jtv.constant(exports.OcfAccrualPeriodType.OcfAccrualQuarterly), jtv.constant(exports.OcfAccrualPeriodType.OcfAccrualSemiAnnual), jtv.constant(exports.OcfAccrualPeriodType.OcfAccrualAnnual)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfRoundingType = {
  OcfRoundingCeiling: 'OcfRoundingCeiling',
  OcfRoundingFloor: 'OcfRoundingFloor',
  OcfRoundingNormal: 'OcfRoundingNormal',
  keys: ['OcfRoundingCeiling','OcfRoundingFloor','OcfRoundingNormal',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfRoundingType.OcfRoundingCeiling), jtv.constant(exports.OcfRoundingType.OcfRoundingFloor), jtv.constant(exports.OcfRoundingType.OcfRoundingNormal)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfDayCountType = {
  OcfDayCountActual365: 'OcfDayCountActual365',
  OcfDayCount30_360: 'OcfDayCount30_360',
  keys: ['OcfDayCountActual365','OcfDayCount30_360',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfDayCountType.OcfDayCountActual365), jtv.constant(exports.OcfDayCountType.OcfDayCount30_360)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfCompoundingType = {
  OcfCompounding: 'OcfCompounding',
  OcfSimple: 'OcfSimple',
  keys: ['OcfCompounding','OcfSimple',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfCompoundingType.OcfCompounding), jtv.constant(exports.OcfCompoundingType.OcfSimple)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfInterestPayoutType = {
  OcfInterestPayoutDeferred: 'OcfInterestPayoutDeferred',
  OcfInterestPayoutCash: 'OcfInterestPayoutCash',
  keys: ['OcfInterestPayoutDeferred','OcfInterestPayoutCash',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfInterestPayoutType.OcfInterestPayoutDeferred), jtv.constant(exports.OcfInterestPayoutType.OcfInterestPayoutCash)); }),
  encode: function (__typed__) { return __typed__; },
};

