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


exports.StockClassOcfData = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({id: damlTypes.Text.decoder, class_type: Fairmint_OpenCapTable_Types.OcfStockClassType.decoder, default_id_prefix: damlTypes.Text.decoder, initial_shares_authorized: damlTypes.Numeric(10).decoder, name: damlTypes.Text.decoder, seniority: damlTypes.Numeric(10).decoder, votes_per_share: damlTypes.Numeric(10).decoder, comments: damlTypes.List(damlTypes.Text).decoder, conversion_rights: damlTypes.List(Fairmint_OpenCapTable_Types.OcfStockClassConversionRight).decoder, board_approval_date: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), liquidation_preference_multiple: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Numeric(10)).decoder), par_value: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types.OcfMonetary).decoder), participation_cap_multiple: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Numeric(10)).decoder), price_per_share: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types.OcfMonetary).decoder), stockholder_approval_date: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), }); }),
  encode: function (__typed__) {
  return {
    id: damlTypes.Text.encode(__typed__.id),
    class_type: Fairmint_OpenCapTable_Types.OcfStockClassType.encode(__typed__.class_type),
    default_id_prefix: damlTypes.Text.encode(__typed__.default_id_prefix),
    initial_shares_authorized: damlTypes.Numeric(10).encode(__typed__.initial_shares_authorized),
    name: damlTypes.Text.encode(__typed__.name),
    seniority: damlTypes.Numeric(10).encode(__typed__.seniority),
    votes_per_share: damlTypes.Numeric(10).encode(__typed__.votes_per_share),
    comments: damlTypes.List(damlTypes.Text).encode(__typed__.comments),
    conversion_rights: damlTypes.List(Fairmint_OpenCapTable_Types.OcfStockClassConversionRight).encode(__typed__.conversion_rights),
    board_approval_date: damlTypes.Optional(damlTypes.Time).encode(__typed__.board_approval_date),
    liquidation_preference_multiple: damlTypes.Optional(damlTypes.Numeric(10)).encode(__typed__.liquidation_preference_multiple),
    par_value: damlTypes.Optional(Fairmint_OpenCapTable_Types.OcfMonetary).encode(__typed__.par_value),
    participation_cap_multiple: damlTypes.Optional(damlTypes.Numeric(10)).encode(__typed__.participation_cap_multiple),
    price_per_share: damlTypes.Optional(Fairmint_OpenCapTable_Types.OcfMonetary).encode(__typed__.price_per_share),
    stockholder_approval_date: damlTypes.Optional(damlTypes.Time).encode(__typed__.stockholder_approval_date),
  };
}
,
};



exports.StockClass = damlTypes.assembleTemplate(
{
  templateId: '#OpenCapTable-v26:Fairmint.OpenCapTable.OCF.StockClass:StockClass',
  templateIdWithPackageId: '6262fe13fb1ecdf62d70b4412921c1a04085ab7cb8ac7035fc47ae80e5ff779e:Fairmint.OpenCapTable.OCF.StockClass:StockClass',
  keyDecoder: damlTypes.lazyMemo(function () { return jtv.constant(undefined); }),
  keyEncode: function () { throw 'EncodeError'; },
  decoder: damlTypes.lazyMemo(function () { return jtv.object({context: Fairmint_OpenCapTable_Types.Context.decoder, stock_class_data: exports.StockClassOcfData.decoder, }); }),
  encode: function (__typed__) {
  return {
    context: Fairmint_OpenCapTable_Types.Context.encode(__typed__.context),
    stock_class_data: exports.StockClassOcfData.encode(__typed__.stock_class_data),
  };
}
,
  Archive: {
    template: function () { return exports.StockClass; },
    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.StockClass, ['6262fe13fb1ecdf62d70b4412921c1a04085ab7cb8ac7035fc47ae80e5ff779e', '#OpenCapTable-v26']);

