\";\n }\n else {\n const userInfo = matchValue;\n const profileId = Session__GetCurrentProfileId(this$) | 0;\n return Response_ProfileInfo__DisplayName(find((pr) => (pr.Id === profileId), userInfo.Profiles));\n }\n}\n\nexport function Session__GetCurrentProfile(this$) {\n const matchValue = this$.UserInfo;\n if (matchValue == null) {\n return undefined;\n }\n else {\n const userInfo = matchValue;\n const matchValue_1 = this$.CurrentProfile;\n if (matchValue_1 == null) {\n return head(userInfo.Profiles);\n }\n else {\n const profileId = matchValue_1 | 0;\n return tryFind((p) => (p.Id === profileId), userInfo.Profiles);\n }\n }\n}\n\nexport function Session__GetCurrentProfileId(this$) {\n const matchValue = Session__GetCurrentProfile(this$);\n if (matchValue == null) {\n const result = localStorage.getItem(lastProfileIdKey);\n if (isNullOrWhiteSpace(result)) {\n return -1;\n }\n else {\n return parse(result, 511, false, 32) | 0;\n }\n }\n else {\n return matchValue.Id | 0;\n }\n}\n\nexport function Session__UpdateCurrentProvile(this$) {\n const matchValue = this$.UserInfo;\n if (matchValue == null) {\n }\n else {\n const userInfo = matchValue;\n localStorage.setItem(lastProfileIdKey, int32ToString(Session__GetCurrentProfileId(this$)));\n }\n}\n\nexport function Session__GetActiveWorkoutRecord(this$) {\n const matchValue = Session__GetCurrentProfile(this$);\n if (matchValue == null) {\n return undefined;\n }\n else {\n return matchValue.ActiveWorkout;\n }\n}\n\nexport function Session__GetActiveWorkoutId(this$) {\n return map((record) => record.Id, map((tuple) => tuple[1], Session__GetActiveWorkoutRecord(this$)));\n}\n\nexport function Session__SetActiveWorkoutRecord_Z2D8A2414(this$, activeRecord) {\n let bind$0040;\n let newProfile;\n const matchValue = Session__GetCurrentProfile(this$);\n if (matchValue == null) {\n throw new Error(\"No current profile\");\n }\n else {\n const profile = matchValue;\n newProfile = (new Response_ProfileInfo(profile.Id, profile.IsPrimary, profile.FullName, profile.DateOfBirth, profile.Gender, profile.Country_IsoCode, activeRecord));\n }\n const newProfiles = filter((profile_1) => (newProfile.Id === profile_1.Id), value_1(this$.UserInfo).Profiles);\n return new Session(this$.LoggedIn, (bind$0040 = value_1(this$.UserInfo), new Response_UserInfo(bind$0040.Id, bind$0040.Name, bind$0040.Email, bind$0040.ReadOnly, cons(newProfile, newProfiles), bind$0040.SiteSettings, bind$0040.ServerVersion, bind$0040.ClientConfigVariables)), this$.CurrentProfile);\n}\n\nexport function Session__GetDisplayCurrency(this$) {\n return \"USD\";\n}\n\nexport function Session__SiteSettings(this$) {\n return value_1(this$.UserInfo).SiteSettings;\n}\n\n","import { value, some } from \"../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport * as common from \"../../src/javascript/common.js\";\n\nexport const isDevelopment = false;\n\n/**\n * Logs error to the console during development\n */\nexport function Log_developmentError(error) {\n if (isDevelopment) {\n console.error(some(error));\n }\n}\n\nexport const Config_placeLookupId = \"placeLookupInput\";\n\nexport function Config_variable(name) {\n return common.getConfigVariable(name);\n}\n\nfunction Config_demoUsers() {\n return Config_variable(\"DEMO_USER\");\n}\n\nexport function Config_releaseVersion() {\n return Config_variable(\"RELEASE_VERSION\");\n}\n\nexport function Config_isDemoUser(session) {\n const username = value(session.UserInfo).Name;\n return Config_demoUsers() === username;\n}\n\nexport const Config_defaultDateForNow = \"now\";\n\nexport function Config_getDefaultDiaryDate(session) {\n if (Config_isDemoUser(session)) {\n const fromDate = Config_variable(\"DEMO_USER_RANGE_FROM\");\n if (fromDate.length > 0) {\n return fromDate;\n }\n else {\n const toDate = Config_variable(\"DEMO_USER_RANGE_TO\");\n if (toDate.length > 0) {\n return toDate;\n }\n else {\n return Config_defaultDateForNow;\n }\n }\n }\n else {\n return Config_defaultDateForNow;\n }\n}\n\nexport function Config_getUserTimeZone(session) {\n if (Config_isDemoUser(session)) {\n return \"UTC\";\n }\n else {\n return common.getTimezoneName();\n }\n}\n\n","import { Constraints_minMaxConstraint, Constraints_collectConstraintsErrors, Constraints_applyConstraintsGetErrors, Constraints_minMaxOptLengthConstraint } from \"../Omnicv.Shared.Common/Validation.js\";\nimport { head, empty, ofArray, singleton } from \"../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { tryFind } from \"../fable_modules/fable-library-js.4.24.0/Map.js\";\nimport { Union, Record } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { list_type, tuple_type, lambda_type, union_type, class_type, bool_type, uint8_type, enum_type, int32_type, record_type, option_type, string_type, float64_type, int64_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { compare } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { PagingOptions_$reflection, EventInfo_$reflection } from \"../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { printf, toText } from \"../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { ChangelogEntry, Version, ProductInformation, Changelog, defaultWeb, defaultContacts, defaultAuthors } from \"../Omnicv.Shared.Common/ProductDetails.js\";\nimport { parse } from \"../fable_modules/fable-library-js.4.24.0/Date.js\";\n\nconst notesConstraints = singleton((name) => ((value) => Constraints_minMaxOptLengthConstraint(5, 1000, name, value)));\n\nexport const notesName = \"Notes\";\n\nfunction getNotesErrors(notes) {\n return Constraints_applyConstraintsGetErrors(notesConstraints, notesName, notes);\n}\n\nexport function validateNotes(notes) {\n return tryFind(notesName, Constraints_collectConstraintsErrors(singleton(getNotesErrors(notes))));\n}\n\nconst weightConstraints = singleton((name) => ((value) => Constraints_minMaxConstraint(1, 500, name, value)));\n\nexport const weightName = \"Weight\";\n\nfunction getWeightErrors(weight) {\n return Constraints_applyConstraintsGetErrors(weightConstraints, weightName, weight);\n}\n\nexport function validateWeight(weight) {\n return tryFind(weightName, Constraints_collectConstraintsErrors(singleton(getWeightErrors(weight))));\n}\n\nconst temperatureConstraints = singleton((name) => ((value) => Constraints_minMaxConstraint(1, 50, name, value)));\n\nexport const temperatureName = \"Temperature\";\n\nfunction getTemperatureErrors(temperature) {\n return Constraints_applyConstraintsGetErrors(temperatureConstraints, temperatureName, temperature);\n}\n\nexport function validateTemperature(temperature) {\n return tryFind(temperatureName, Constraints_collectConstraintsErrors(singleton(getTemperatureErrors(temperature))));\n}\n\nconst pressureConstraints = singleton((name) => ((value) => Constraints_minMaxConstraint(1, 500, name, value)));\n\nexport const systolicName = \"Systolic\";\n\nexport const diastolicName = \"Diastolic\";\n\nfunction getPressureErrors(name, pressure) {\n return Constraints_applyConstraintsGetErrors(pressureConstraints, name, pressure);\n}\n\nexport function validateSystolic(pressure) {\n return tryFind(systolicName, Constraints_collectConstraintsErrors(singleton(getPressureErrors(systolicName, pressure))));\n}\n\nexport function validateDiastolic(pressure) {\n return tryFind(diastolicName, Constraints_collectConstraintsErrors(singleton(getPressureErrors(diastolicName, pressure))));\n}\n\nfunction getRatingErrors(rating) {\n return Constraints_applyConstraintsGetErrors(singleton((name_1) => ((value) => Constraints_minMaxConstraint(1, 10, name_1, value))), \"Rating\", rating);\n}\n\nexport class WeightRecord extends Record {\n constructor(Id, Weight, Notes) {\n super();\n this.Id = Id;\n this.Weight = Weight;\n this.Notes = Notes;\n }\n}\n\nexport function WeightRecord_$reflection() {\n return record_type(\"Omnicv.Shared.PhysicalAPI.WeightRecord\", [], WeightRecord, () => [[\"Id\", int64_type], [\"Weight\", float64_type], [\"Notes\", option_type(string_type)]]);\n}\n\nfunction WeightRecord_Validator_Z880D0EE(record) {\n return Constraints_collectConstraintsErrors(ofArray([getWeightErrors(record.Weight), getNotesErrors(record.Notes)]));\n}\n\nexport function WeightRecord_Default() {\n return new WeightRecord(0n, 0, undefined);\n}\n\nexport function WeightRecord__Validate(this$) {\n return WeightRecord_Validator_Z880D0EE(this$);\n}\n\nexport function WeightRecord__ValidateField_Z721C83C5(this$, name) {\n return tryFind(name, WeightRecord__Validate(this$));\n}\n\nexport class TemperatureRecord extends Record {\n constructor(Id, Temperature, Notes) {\n super();\n this.Id = Id;\n this.Temperature = Temperature;\n this.Notes = Notes;\n }\n}\n\nexport function TemperatureRecord_$reflection() {\n return record_type(\"Omnicv.Shared.PhysicalAPI.TemperatureRecord\", [], TemperatureRecord, () => [[\"Id\", int64_type], [\"Temperature\", float64_type], [\"Notes\", option_type(string_type)]]);\n}\n\nfunction TemperatureRecord_Validator_Z70227002(record) {\n return Constraints_collectConstraintsErrors(ofArray([getTemperatureErrors(record.Temperature), getNotesErrors(record.Notes)]));\n}\n\nexport function TemperatureRecord_Default() {\n return new TemperatureRecord(0n, 0, undefined);\n}\n\nexport function TemperatureRecord__Validate(this$) {\n return TemperatureRecord_Validator_Z70227002(this$);\n}\n\nexport function TemperatureRecord__ValidateField_Z721C83C5(this$, name) {\n return tryFind(name, TemperatureRecord__Validate(this$));\n}\n\nexport class BloodPressureRecord extends Record {\n constructor(Id, Systolic, Diastolic, Notes) {\n super();\n this.Id = Id;\n this.Systolic = Systolic;\n this.Diastolic = Diastolic;\n this.Notes = Notes;\n }\n}\n\nexport function BloodPressureRecord_$reflection() {\n return record_type(\"Omnicv.Shared.PhysicalAPI.BloodPressureRecord\", [], BloodPressureRecord, () => [[\"Id\", int64_type], [\"Systolic\", float64_type], [\"Diastolic\", float64_type], [\"Notes\", option_type(string_type)]]);\n}\n\nfunction BloodPressureRecord_Validator_21088E9D(record) {\n const rangeNotInverted = (record.Systolic <= record.Diastolic) ? [systolicName, `Systolic [${record.Systolic} must be greater than diastolic [${record.Diastolic}`] : undefined;\n return Constraints_collectConstraintsErrors(ofArray([getPressureErrors(systolicName, record.Systolic), getPressureErrors(diastolicName, record.Diastolic), getNotesErrors(record.Notes), rangeNotInverted]));\n}\n\nexport function BloodPressureRecord_Default() {\n return new BloodPressureRecord(0n, 0, 0, undefined);\n}\n\nexport function BloodPressureRecord__Validate(this$) {\n return BloodPressureRecord_Validator_21088E9D(this$);\n}\n\nexport function BloodPressureRecord__ValidateField_Z721C83C5(this$, name) {\n return tryFind(name, BloodPressureRecord__Validate(this$));\n}\n\nexport const bodilyFunctions = ofArray([[1, \"Number 1\"], [2, \"Number 2\"]]);\n\nexport const duringSleepOptions = ofArray([[undefined, \"Auto\"], [true, \"During sleep\"], [false, \"When awake\"]]);\n\nexport const bodilyFunctionsEmojis = ofArray([[1, \"🌊\"], [2, \"💩\"]]);\n\nexport class BodilyFunctionsRecord extends Record {\n constructor(Id, FunctionType, DurationSec, Rating, DuringSleep, Notes) {\n super();\n this.Id = Id;\n this.FunctionType = (FunctionType | 0);\n this.DurationSec = (DurationSec | 0);\n this.Rating = Rating;\n this.DuringSleep = DuringSleep;\n this.Notes = Notes;\n }\n}\n\nexport function BodilyFunctionsRecord_$reflection() {\n return record_type(\"Omnicv.Shared.PhysicalAPI.BodilyFunctionsRecord\", [], BodilyFunctionsRecord, () => [[\"Id\", int64_type], [\"FunctionType\", enum_type(\"Omnicv.Shared.PhysicalAPI.BodilyFunctions\", int32_type, [[\"Urination\", 1], [\"Defecation\", 2]])], [\"DurationSec\", int32_type], [\"Rating\", uint8_type], [\"DuringSleep\", option_type(bool_type)], [\"Notes\", option_type(string_type)]]);\n}\n\nfunction BodilyFunctionsRecord_Validator_5C9DD176(record) {\n return Constraints_collectConstraintsErrors(ofArray([getRatingErrors(~~record.Rating), getNotesErrors(record.Notes)]));\n}\n\nexport function BodilyFunctionsRecord_Default() {\n return new BodilyFunctionsRecord(0n, 1, 60, 0 & 0xFF, undefined, undefined);\n}\n\nexport function BodilyFunctionsRecord__Validate(this$) {\n return BodilyFunctionsRecord_Validator_5C9DD176(this$);\n}\n\nexport function BodilyFunctionsRecord__ValidateField_Z721C83C5(this$, name) {\n return tryFind(name, BodilyFunctionsRecord__Validate(this$));\n}\n\nexport class PhysicalSearchOptions extends Record {\n constructor(DateFrom, DateTo, Notes) {\n super();\n this.DateFrom = DateFrom;\n this.DateTo = DateTo;\n this.Notes = Notes;\n }\n}\n\nexport function PhysicalSearchOptions_$reflection() {\n return record_type(\"Omnicv.Shared.PhysicalAPI.PhysicalSearchOptions\", [], PhysicalSearchOptions, () => [[\"DateFrom\", option_type(class_type(\"System.DateTime\"))], [\"DateTo\", option_type(class_type(\"System.DateTime\"))], [\"Notes\", option_type(string_type)]]);\n}\n\nexport function PhysicalSearchOptions__Validate(this$) {\n if (((this$.DateFrom == null) && (this$.DateTo == null)) && (this$.Notes == null)) {\n return \"At least one parameter must be populated\";\n }\n else if (((this$.DateFrom != null) && (this$.DateTo != null)) && (compare(this$.DateFrom, this$.DateTo) >= 0)) {\n return \"From must be smaller than To\";\n }\n else {\n return undefined;\n }\n}\n\nexport class UnifiedRecord extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Weight\", \"BloodPressure\", \"BodilyFunctions\", \"Temperature\"];\n }\n}\n\nexport function UnifiedRecord_$reflection() {\n return union_type(\"Omnicv.Shared.PhysicalAPI.UnifiedRecord\", [], UnifiedRecord, () => [[[\"Item\", WeightRecord_$reflection()]], [[\"Item\", BloodPressureRecord_$reflection()]], [[\"Item\", BodilyFunctionsRecord_$reflection()]], [[\"Item\", TemperatureRecord_$reflection()]]]);\n}\n\nexport class RecordService$1 extends Record {\n constructor(Add, Edit, GetRecord, GetRecords, SearchRecords) {\n super();\n this.Add = Add;\n this.Edit = Edit;\n this.GetRecord = GetRecord;\n this.GetRecords = GetRecords;\n this.SearchRecords = SearchRecords;\n }\n}\n\nexport function RecordService$1_$reflection(gen0) {\n return record_type(\"Omnicv.Shared.PhysicalAPI.RecordService`1\", [gen0], RecordService$1, () => [[\"Add\", lambda_type(EventInfo_$reflection(), lambda_type(gen0, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [EventInfo_$reflection()])))], [\"Edit\", lambda_type(EventInfo_$reflection(), lambda_type(gen0, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [EventInfo_$reflection()])))], [\"GetRecord\", lambda_type(int32_type, lambda_type(int64_type, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [tuple_type(EventInfo_$reflection(), gen0)])))], [\"GetRecords\", lambda_type(int32_type, lambda_type(PagingOptions_$reflection(), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [list_type(tuple_type(EventInfo_$reflection(), gen0))])))], [\"SearchRecords\", lambda_type(int32_type, lambda_type(PhysicalSearchOptions_$reflection(), lambda_type(PagingOptions_$reflection(), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [list_type(tuple_type(EventInfo_$reflection(), gen0))]))))]]);\n}\n\nexport class UnifiedService extends Record {\n constructor(GetRecords) {\n super();\n this.GetRecords = GetRecords;\n }\n}\n\nexport function UnifiedService_$reflection() {\n return record_type(\"Omnicv.Shared.PhysicalAPI.UnifiedService\", [], UnifiedService, () => [[\"GetRecords\", lambda_type(int32_type, lambda_type(PagingOptions_$reflection(), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [list_type(tuple_type(EventInfo_$reflection(), UnifiedRecord_$reflection()))])))]]);\n}\n\nexport function UnifiedService_RouteBuilder(_arg, m) {\n return toText(printf(\"/api/auth/mod/phys/unified/%s\"))(m);\n}\n\nexport class PhysicalModule {\n constructor() {\n this.initialTimestamp = parse(\"2021-11-13T19:53:00\");\n this.latestTimestamp = this.initialTimestamp;\n }\n get Details() {\n const this$ = this;\n const Description = \"Physical, body and well-being tracking module. Log your weight, height, blood pressure and other physical parameters and activities\";\n return new ProductInformation(\"Omnicv.Physical\", this$.initialTimestamp, this$.latestTimestamp, \"Physical\", Description, empty(), PhysicalModule__get_CurrentVersion(this$), singleton(defaultAuthors), defaultContacts, defaultWeb, undefined, undefined, new Changelog(1, [PhysicalModule__get_Changelog(this$)]));\n }\n RegisteredTypes() {\n return ofArray([WeightRecord_$reflection(), BloodPressureRecord_$reflection(), BodilyFunctionsRecord_$reflection(), TemperatureRecord_$reflection()]);\n }\n}\n\nexport function PhysicalModule_$reflection() {\n return class_type(\"Omnicv.Shared.PhysicalAPI.PhysicalModule\", undefined, PhysicalModule);\n}\n\nexport function PhysicalModule_$ctor() {\n return new PhysicalModule();\n}\n\nexport function PhysicalModule__get_Changelog(this$) {\n return singleton(new ChangelogEntry(this$.initialTimestamp, new Version(1, 0, 1, undefined), \"Initial release\"));\n}\n\nexport function PhysicalModule__get_CurrentVersion(this$) {\n return head(PhysicalModule__get_Changelog(this$)).Version;\n}\n\n","import { Constraints_isValidCurrencyOpt, Constraints_isValidCurrency, Constraints_greaterThanConstraint, Constraints_minConstraint, Constraints_minMaxOptConstraint, Constraints_minMaxOptLengthConstraint, Constraints_collectConstraintsErrors, Constraints_applyConstraintsGetErrors, Constraints_minMaxLengthConstraint } from \"../Omnicv.Shared.Common/Validation.js\";\nimport { head, isEmpty, append, sum, filter as filter_2, map, forAll, empty, ofArray, singleton } from \"../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { FSharpMap__get_Count, FSharpMap__ContainsKey, FSharpMap__get_Item, ofList, tryFind } from \"../fable_modules/fable-library-js.4.24.0/Map.js\";\nimport { op_Addition, get_MinusOne, get_One, op_Division, op_Multiply, op_UnaryNegation, get_Zero, fromParts } from \"../fable_modules/fable-library-js.4.24.0/Decimal.js\";\nimport Decimal from \"../fable_modules/fable-library-js.4.24.0/Decimal.js\";\nimport { parse, compare } from \"../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport { defaultArg, value as value_10 } from \"../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { Union, Record } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { array_type, uint8_type, union_type, unit_type, list_type, tuple_type, lambda_type, bool_type, class_type, option_type, enum_type, int32_type, int64_type, record_type, decimal_type, string_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { printf, toFail } from \"../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { curry2, bigintHash, compare as compare_1, structuralHash, equals, comparePrimitives, compareArrays } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { DataPoint_$reflection, PagingOptions_$reflection, EventInfo_$reflection } from \"../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { exists } from \"../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { List_groupBy } from \"../fable_modules/fable-library-js.4.24.0/Seq2.js\";\nimport { compare as compare_2, equals as equals_1 } from \"../fable_modules/fable-library-js.4.24.0/BigInt.js\";\nimport { ChangelogEntry, Version, ProductInformation, Changelog, defaultWeb, defaultContacts, defaultAuthors } from \"../Omnicv.Shared.Common/ProductDetails.js\";\n\nconst nameConstraints = singleton((name) => ((value) => Constraints_minMaxLengthConstraint(1, 256, name, value)));\n\nexport const nameName = \"Name\";\n\nfunction getNameErrors(name) {\n return Constraints_applyConstraintsGetErrors(nameConstraints, nameName, name);\n}\n\nexport function validateName(name) {\n return tryFind(nameName, Constraints_collectConstraintsErrors(singleton(getNameErrors(name))));\n}\n\nconst notesConstraints = singleton((name) => ((value) => Constraints_minMaxOptLengthConstraint(5, 1000, name, value)));\n\nexport const notesName = \"Notes\";\n\nfunction getNotesErrors(notes) {\n return Constraints_applyConstraintsGetErrors(notesConstraints, notesName, notes);\n}\n\nexport function validateNotes(notes) {\n return tryFind(notesName, Constraints_collectConstraintsErrors(singleton(getNotesErrors(notes))));\n}\n\nconst instrumentConstraints = singleton((name) => ((value) => Constraints_minMaxOptLengthConstraint(1, 50, name, value)));\n\nexport const instrumentName = \"Instrument\";\n\nfunction getInstrumentErrors(instrument) {\n return Constraints_applyConstraintsGetErrors(instrumentConstraints, instrumentName, instrument);\n}\n\nexport function validateInstrument(instrument) {\n return tryFind(instrumentName, Constraints_collectConstraintsErrors(singleton(getInstrumentErrors(instrument))));\n}\n\nconst interestRateConstraints = singleton((() => {\n const minValue = fromParts(1000, 0, 0, true, 0);\n const maxValue = fromParts(1000, 0, 0, false, 0);\n return (name) => ((value) => Constraints_minMaxOptConstraint(minValue, maxValue, name, value));\n})());\n\nexport const interestRateName = \"InterestRate\";\n\nfunction getInterestRateErrors(interestRate) {\n return Constraints_applyConstraintsGetErrors(interestRateConstraints, interestRateName, interestRate);\n}\n\nexport function validateInterestRate(interestRate) {\n return tryFind(interestRateName, Constraints_collectConstraintsErrors(singleton(getInterestRateErrors(interestRate))));\n}\n\nconst identifierConstraints = singleton((name) => ((value) => Constraints_minMaxOptLengthConstraint(1, 256, name, value)));\n\nexport const identifierName = \"Identifier\";\n\nfunction getIdentifierErrors(identifier) {\n return Constraints_applyConstraintsGetErrors(identifierConstraints, identifierName, identifier);\n}\n\nexport function validateIdentifier(identifier) {\n return tryFind(identifierName, Constraints_collectConstraintsErrors(singleton(getIdentifierErrors(identifier))));\n}\n\nconst quantityConstraints = singleton((name) => ((value) => Constraints_minConstraint(get_Zero, name, value)));\n\nexport const quantityName = \"Quantity\";\n\nfunction getQuantityErrors(quantity) {\n return Constraints_applyConstraintsGetErrors(quantityConstraints, quantityName, quantity);\n}\n\nexport function validateQuantity(quantity) {\n return tryFind(quantityName, Constraints_collectConstraintsErrors(singleton(getQuantityErrors(quantity))));\n}\n\nconst unitPriceConstraints = singleton((name) => ((value) => Constraints_greaterThanConstraint(get_Zero, name, value)));\n\nexport const unitPriceName = \"UnitPrice\";\n\nfunction getUnitPriceErrors(unitPrice) {\n return Constraints_applyConstraintsGetErrors(unitPriceConstraints, unitPriceName, unitPrice);\n}\n\nexport function validateUnitPrice(unitPrice) {\n return tryFind(unitPriceName, Constraints_collectConstraintsErrors(singleton(getUnitPriceErrors(unitPrice))));\n}\n\nconst currencyConstraints = singleton((name) => ((value) => Constraints_isValidCurrency(name, value)));\n\nexport const currencyName = \"Currency\";\n\nfunction getCurrencyErrors(currency) {\n return Constraints_applyConstraintsGetErrors(currencyConstraints, currencyName, currency);\n}\n\nexport function validateCurrency(currency) {\n return tryFind(currencyName, Constraints_collectConstraintsErrors(singleton(getCurrencyErrors(currency))));\n}\n\nconst displayCurrencyConstraints = singleton((name) => ((value) => Constraints_isValidCurrencyOpt(name, value)));\n\nexport const displayCurrencyName = \"DisplayCurrency\";\n\nfunction getDisplayCurrencyErrors(displayCurrency) {\n return Constraints_applyConstraintsGetErrors(displayCurrencyConstraints, displayCurrencyName, displayCurrency);\n}\n\nexport function validateDisplayCurrency(displayCurrency) {\n return tryFind(displayCurrencyName, Constraints_collectConstraintsErrors(singleton(getDisplayCurrencyErrors(displayCurrency))));\n}\n\nexport function isActive(activeFrom, activeTo, date) {\n if ((activeFrom != null) && (compare(value_10(activeFrom), date) > 0)) {\n return false;\n }\n else {\n return !((activeTo != null) && (compare(value_10(activeTo), date) < 0));\n }\n}\n\nexport class CurrencyValue extends Record {\n constructor(Currency, Value) {\n super();\n this.Currency = Currency;\n this.Value = Value;\n }\n}\n\nexport function CurrencyValue_$reflection() {\n return record_type(\"Omnicv.Shared.FinancialAPI.CurrencyValue\", [], CurrencyValue, () => [[\"Currency\", string_type], [\"Value\", decimal_type]]);\n}\n\nexport function CurrencyValue_op_UnaryNegation_4EF17D2F(value) {\n return new CurrencyValue(value.Currency, op_UnaryNegation(value.Value));\n}\n\nexport function CurrencyValue_op_Multiply_1FE6124A(value, other) {\n return new CurrencyValue(value.Currency, op_Multiply(value.Value, other));\n}\n\nexport class Group extends Record {\n constructor(Id, GroupType, ProfileId, ParentId, CreatedAt, UpdatedAt, Name, Notes, Weight, DisplayCurrency) {\n super();\n this.Id = Id;\n this.GroupType = (GroupType | 0);\n this.ProfileId = (ProfileId | 0);\n this.ParentId = ParentId;\n this.CreatedAt = CreatedAt;\n this.UpdatedAt = UpdatedAt;\n this.Name = Name;\n this.Notes = Notes;\n this.Weight = (Weight | 0);\n this.DisplayCurrency = DisplayCurrency;\n }\n}\n\nexport function Group_$reflection() {\n return record_type(\"Omnicv.Shared.FinancialAPI.Group\", [], Group, () => [[\"Id\", int64_type], [\"GroupType\", enum_type(\"Omnicv.Shared.FinancialAPI.GroupType\", int32_type, [[\"Assets\", 1], [\"Cashflows\", 2]])], [\"ProfileId\", int32_type], [\"ParentId\", option_type(int64_type)], [\"CreatedAt\", class_type(\"System.DateTime\")], [\"UpdatedAt\", class_type(\"System.DateTime\")], [\"Name\", string_type], [\"Notes\", option_type(string_type)], [\"Weight\", int32_type], [\"DisplayCurrency\", option_type(string_type)]]);\n}\n\nexport function Group_Default_7F9DDECF(timestamp) {\n return new Group(0n, 1, 0, undefined, timestamp, timestamp, \"\", undefined, 0, undefined);\n}\n\nfunction Group_Validator_4FDF7BFC(record) {\n return Constraints_collectConstraintsErrors(ofArray([getNameErrors(record.Name), getNotesErrors(record.Notes), getDisplayCurrencyErrors(record.DisplayCurrency)]));\n}\n\nexport function Group__Validate(this$) {\n return Group_Validator_4FDF7BFC(this$);\n}\n\nexport function needsUnitPrice(assetType) {\n return assetType === 2;\n}\n\nexport function isLiability(assetType) {\n switch (assetType) {\n case 0:\n case 1:\n case 2:\n case 7:\n case 9:\n return false;\n case 100:\n return true;\n default:\n return toFail(printf(\"Unknown account type %A\"))(assetType);\n }\n}\n\nconst frequencyFactors = ofList(ofArray([[[1, 5], fromParts(3650, 0, 0, false, 1)], [[2, 5], op_Division(fromParts(3650, 0, 0, false, 1), fromParts(70, 0, 0, false, 1))], [[3, 5], fromParts(120, 0, 0, false, 1)], [[4, 5], fromParts(40, 0, 0, false, 1)], [[5, 5], get_One]]), {\n Compare: compareArrays,\n});\n\nexport function getConversionFactor(this$, other) {\n if (this$ === other) {\n return get_One;\n }\n else if (this$ === 5) {\n return op_Division(get_One, FSharpMap__get_Item(frequencyFactors, [other, this$]));\n }\n else if (other === 5) {\n return FSharpMap__get_Item(frequencyFactors, [this$, other]);\n }\n else {\n return op_Multiply(getConversionFactor(this$, 5), getConversionFactor(5, other));\n }\n}\n\nexport function valueToFrequency(value, this$, other) {\n return CurrencyValue_op_Multiply_1FE6124A(value, getConversionFactor(this$, other));\n}\n\nexport function adjustForFrequency(value, this$, other) {\n return valueToFrequency(value, this$, other);\n}\n\nexport class AssetValueRecord extends Record {\n constructor(Id, AssetId, Quantity, UnitPrice, Notes) {\n super();\n this.Id = Id;\n this.AssetId = AssetId;\n this.Quantity = Quantity;\n this.UnitPrice = UnitPrice;\n this.Notes = Notes;\n }\n}\n\nexport function AssetValueRecord_$reflection() {\n return record_type(\"Omnicv.Shared.FinancialAPI.AssetValueRecord\", [], AssetValueRecord, () => [[\"Id\", int64_type], [\"AssetId\", int64_type], [\"Quantity\", decimal_type], [\"UnitPrice\", decimal_type], [\"Notes\", option_type(string_type)]]);\n}\n\nfunction AssetValueRecord_Validator_47F190F5(record) {\n return Constraints_collectConstraintsErrors(ofArray([getQuantityErrors(record.Quantity), getUnitPriceErrors(record.UnitPrice), getNotesErrors(record.Notes)]));\n}\n\nexport function AssetValueRecord_Default() {\n return new AssetValueRecord(0n, 0n, get_Zero, get_Zero, undefined);\n}\n\nexport function AssetValueRecord__Validate(this$) {\n return AssetValueRecord_Validator_47F190F5(this$);\n}\n\nexport class AssetValueService extends Record {\n constructor(Add, Edit, GetRecord, GetRecords, GetRecordsForChart, DeleteRecord) {\n super();\n this.Add = Add;\n this.Edit = Edit;\n this.GetRecord = GetRecord;\n this.GetRecords = GetRecords;\n this.GetRecordsForChart = GetRecordsForChart;\n this.DeleteRecord = DeleteRecord;\n }\n}\n\nexport function AssetValueService_$reflection() {\n return record_type(\"Omnicv.Shared.FinancialAPI.AssetValueService\", [], AssetValueService, () => [[\"Add\", lambda_type(EventInfo_$reflection(), lambda_type(AssetValueRecord_$reflection(), lambda_type(bool_type, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [EventInfo_$reflection()]))))], [\"Edit\", lambda_type(EventInfo_$reflection(), lambda_type(AssetValueRecord_$reflection(), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [EventInfo_$reflection()])))], [\"GetRecord\", lambda_type(int32_type, lambda_type(int64_type, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [tuple_type(EventInfo_$reflection(), AssetValueRecord_$reflection())])))], [\"GetRecords\", lambda_type(int32_type, lambda_type(int64_type, lambda_type(PagingOptions_$reflection(), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [list_type(tuple_type(EventInfo_$reflection(), AssetValueRecord_$reflection()))]))))], [\"GetRecordsForChart\", lambda_type(int32_type, lambda_type(int64_type, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [list_type(DataPoint_$reflection())])))], [\"DeleteRecord\", lambda_type(int32_type, lambda_type(int64_type, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [unit_type])))]]);\n}\n\nexport class AutomaticCashflow extends Record {\n constructor(Name, CashflowType, Quantity, Frequency, AssetId, ActiveFrom, ActiveTo, InterestRate, Currency) {\n super();\n this.Name = Name;\n this.CashflowType = (CashflowType | 0);\n this.Quantity = Quantity;\n this.Frequency = (Frequency | 0);\n this.AssetId = AssetId;\n this.ActiveFrom = ActiveFrom;\n this.ActiveTo = ActiveTo;\n this.InterestRate = InterestRate;\n this.Currency = Currency;\n }\n}\n\nexport function AutomaticCashflow_$reflection() {\n return record_type(\"Omnicv.Shared.FinancialAPI.AutomaticCashflow\", [], AutomaticCashflow, () => [[\"Name\", string_type], [\"CashflowType\", enum_type(\"Omnicv.Shared.FinancialAPI.CashflowType\", int32_type, [[\"Income\", 1], [\"Expense\", 2]])], [\"Quantity\", decimal_type], [\"Frequency\", enum_type(\"Omnicv.Shared.FinancialAPI.Frequency\", int32_type, [[\"Daily\", 1], [\"Weekly\", 2], [\"Monthly\", 3], [\"Quarterly\", 4], [\"Yearly\", 5]])], [\"AssetId\", option_type(int64_type)], [\"ActiveFrom\", option_type(class_type(\"System.DateTime\"))], [\"ActiveTo\", option_type(class_type(\"System.DateTime\"))], [\"InterestRate\", option_type(decimal_type)], [\"Currency\", string_type]]);\n}\n\nexport function AutomaticCashflow__GetValue_7F9DDECF(this$, date) {\n const value = new CurrencyValue(this$.Currency, this$.Quantity);\n const matchValue = this$.CashflowType | 0;\n switch (matchValue) {\n case 1:\n return value;\n case 2:\n return CurrencyValue_op_UnaryNegation_4EF17D2F(value);\n default:\n throw new Error(\"Unsupported cashflow type\");\n }\n}\n\nexport function AutomaticCashflow__IsActive_7F9DDECF(this$, date) {\n return isActive(this$.ActiveFrom, this$.ActiveTo, date);\n}\n\nexport class AssetInfo extends Record {\n constructor(Id, ProfileId, GroupId, AssetType, CreatedAt, UpdatedAt, Name, Notes, Weight, Identifier, LatestAssetValueId, Currency, Instrument, InterestRate, ActiveFrom, ActiveTo) {\n super();\n this.Id = Id;\n this.ProfileId = (ProfileId | 0);\n this.GroupId = GroupId;\n this.AssetType = (AssetType | 0);\n this.CreatedAt = CreatedAt;\n this.UpdatedAt = UpdatedAt;\n this.Name = Name;\n this.Notes = Notes;\n this.Weight = (Weight | 0);\n this.Identifier = Identifier;\n this.LatestAssetValueId = LatestAssetValueId;\n this.Currency = Currency;\n this.Instrument = Instrument;\n this.InterestRate = InterestRate;\n this.ActiveFrom = ActiveFrom;\n this.ActiveTo = ActiveTo;\n }\n}\n\nexport function AssetInfo_$reflection() {\n return record_type(\"Omnicv.Shared.FinancialAPI.AssetInfo\", [], AssetInfo, () => [[\"Id\", int64_type], [\"ProfileId\", int32_type], [\"GroupId\", int64_type], [\"AssetType\", enum_type(\"Omnicv.Shared.FinancialAPI.AssetType\", int32_type, [[\"Cash\", 0], [\"CashAccount\", 1], [\"FinancialInstrument\", 2], [\"RealEstate\", 7], [\"Loan\", 9], [\"Debt\", 100]])], [\"CreatedAt\", class_type(\"System.DateTime\")], [\"UpdatedAt\", class_type(\"System.DateTime\")], [\"Name\", string_type], [\"Notes\", option_type(string_type)], [\"Weight\", int32_type], [\"Identifier\", option_type(string_type)], [\"LatestAssetValueId\", option_type(int64_type)], [\"Currency\", string_type], [\"Instrument\", option_type(string_type)], [\"InterestRate\", option_type(decimal_type)], [\"ActiveFrom\", option_type(class_type(\"System.DateTime\"))], [\"ActiveTo\", option_type(class_type(\"System.DateTime\"))]]);\n}\n\nexport function AssetInfo_Default_7F9DDECF(timestamp) {\n return new AssetInfo(0n, 0, 0n, 0, timestamp, timestamp, \"\", undefined, 0, undefined, undefined, \"\", undefined, undefined, undefined, undefined);\n}\n\nfunction AssetInfo_Validator_Z6FD9FBA3(record) {\n return Constraints_collectConstraintsErrors(ofArray([getNameErrors(record.Name), getNotesErrors(record.Notes), getInstrumentErrors(record.Instrument), getInterestRateErrors(record.InterestRate), getIdentifierErrors(record.Identifier), getCurrencyErrors(record.Currency)]));\n}\n\nexport function AssetInfo__Validate(this$) {\n return AssetInfo_Validator_Z6FD9FBA3(this$);\n}\n\nexport function AssetInfo__ValidateField_Z721C83C5(this$, name) {\n return tryFind(name, AssetInfo__Validate(this$));\n}\n\nexport function AssetInfo__GetValue_Z33CCF5CA(this$, value) {\n if (value == null) {\n return new CurrencyValue(this$.Currency, get_Zero);\n }\n else {\n const value_1 = value[1];\n return new CurrencyValue(this$.Currency, op_Multiply(op_Multiply(isLiability(this$.AssetType) ? get_MinusOne : get_One, value_1.Quantity), value_1.UnitPrice));\n }\n}\n\nexport function AssetInfo__GetAutomaticCashflows_Z33CCF5CA(this$, value) {\n if (value == null) {\n return empty();\n }\n else {\n const value_1 = value[1];\n const date = value[0];\n const matchValue = this$.AssetType | 0;\n switch (matchValue) {\n case 1:\n return singleton(new AutomaticCashflow(`Cashflow from ${this$.Name}`, 1, value_1.Quantity, 3, this$.Id, date, this$.ActiveTo, this$.InterestRate, this$.Currency));\n case 9:\n return empty();\n case 100:\n return empty();\n default:\n return empty();\n }\n }\n}\n\nexport class CashflowInfo extends Record {\n constructor(Id, ProfileId, CashflowType, GroupId, CreatedAt, UpdatedAt, Name, Notes, Weight, Currency, Quantity, Frequency, AssetId, ActiveFrom, ActiveTo) {\n super();\n this.Id = Id;\n this.ProfileId = (ProfileId | 0);\n this.CashflowType = (CashflowType | 0);\n this.GroupId = GroupId;\n this.CreatedAt = CreatedAt;\n this.UpdatedAt = UpdatedAt;\n this.Name = Name;\n this.Notes = Notes;\n this.Weight = (Weight | 0);\n this.Currency = Currency;\n this.Quantity = Quantity;\n this.Frequency = (Frequency | 0);\n this.AssetId = AssetId;\n this.ActiveFrom = ActiveFrom;\n this.ActiveTo = ActiveTo;\n }\n}\n\nexport function CashflowInfo_$reflection() {\n return record_type(\"Omnicv.Shared.FinancialAPI.CashflowInfo\", [], CashflowInfo, () => [[\"Id\", int64_type], [\"ProfileId\", int32_type], [\"CashflowType\", enum_type(\"Omnicv.Shared.FinancialAPI.CashflowType\", int32_type, [[\"Income\", 1], [\"Expense\", 2]])], [\"GroupId\", int64_type], [\"CreatedAt\", class_type(\"System.DateTime\")], [\"UpdatedAt\", class_type(\"System.DateTime\")], [\"Name\", string_type], [\"Notes\", option_type(string_type)], [\"Weight\", int32_type], [\"Currency\", string_type], [\"Quantity\", decimal_type], [\"Frequency\", enum_type(\"Omnicv.Shared.FinancialAPI.Frequency\", int32_type, [[\"Daily\", 1], [\"Weekly\", 2], [\"Monthly\", 3], [\"Quarterly\", 4], [\"Yearly\", 5]])], [\"AssetId\", option_type(int64_type)], [\"ActiveFrom\", option_type(class_type(\"System.DateTime\"))], [\"ActiveTo\", option_type(class_type(\"System.DateTime\"))]]);\n}\n\nexport function CashflowInfo_Default_7F9DDECF(timestamp) {\n return new CashflowInfo(0n, 0, 1, 0n, timestamp, timestamp, \"\", undefined, 0, \"\", get_Zero, 3, undefined, undefined, undefined);\n}\n\nfunction CashflowInfo_Validator_13C44C26(record) {\n return Constraints_collectConstraintsErrors(ofArray([getNameErrors(record.Name), getNotesErrors(record.Notes), getCurrencyErrors(record.Currency)]));\n}\n\nexport function CashflowInfo__Validate(this$) {\n return CashflowInfo_Validator_13C44C26(this$);\n}\n\nexport function CashflowInfo__GetValue(this$) {\n const value = new CurrencyValue(this$.Currency, this$.Quantity);\n const matchValue = this$.CashflowType | 0;\n switch (matchValue) {\n case 1:\n return value;\n case 2:\n return CurrencyValue_op_UnaryNegation_4EF17D2F(value);\n default:\n throw new Error(\"Unsupported cashflow type\");\n }\n}\n\nexport function CashflowInfo__IsActive_7F9DDECF(this$, date) {\n return isActive(this$.ActiveFrom, this$.ActiveTo, date);\n}\n\nexport class GroupNode extends Record {\n constructor(Data, Children) {\n super();\n this.Data = Data;\n this.Children = Children;\n }\n}\n\nexport function GroupNode_$reflection() {\n return record_type(\"Omnicv.Shared.FinancialAPI.GroupNode\", [], GroupNode, () => [[\"Data\", Group_$reflection()], [\"Children\", list_type(ChildNode$_$reflection())]]);\n}\n\nexport class ChildNode$ extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Group\", \"Asset\", \"Cashflow\"];\n }\n}\n\nexport function ChildNode$_$reflection() {\n return union_type(\"Omnicv.Shared.FinancialAPI.ChildNode\", [], ChildNode$, () => [[[\"Item1\", GroupNode_$reflection()], [\"Item2\", CurrencyValue_$reflection()]], [[\"Item1\", AssetInfo_$reflection()], [\"Item2\", CurrencyValue_$reflection()]], [[\"Item1\", Cashflow_$reflection()], [\"Item2\", CurrencyValue_$reflection()]]]);\n}\n\nexport class Cashflow extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Standard\", \"Automatic\"];\n }\n}\n\nexport function Cashflow_$reflection() {\n return union_type(\"Omnicv.Shared.FinancialAPI.Cashflow\", [], Cashflow, () => [[[\"Item\", CashflowInfo_$reflection()]], [[\"Item\", AutomaticCashflow_$reflection()]]]);\n}\n\nfunction noneOrPred(pred, value) {\n if (value == null) {\n return true;\n }\n else {\n return pred(value_10(value));\n }\n}\n\nfunction stringFilter(str, filter) {\n return noneOrPred((value) => (str.toLocaleLowerCase().indexOf(value.toLocaleLowerCase()) >= 0), filter);\n}\n\nfunction stringsFilter(strs, filter) {\n return exists((str) => stringFilter(str, filter), strs);\n}\n\nexport class EntryFilter extends Record {\n constructor(Currency, Content, AssetType, CashflowType) {\n super();\n this.Currency = Currency;\n this.Content = Content;\n this.AssetType = AssetType;\n this.CashflowType = CashflowType;\n }\n}\n\nexport function EntryFilter_$reflection() {\n return record_type(\"Omnicv.Shared.FinancialAPI.EntryFilter\", [], EntryFilter, () => [[\"Currency\", option_type(string_type)], [\"Content\", option_type(string_type)], [\"AssetType\", option_type(enum_type(\"Omnicv.Shared.FinancialAPI.AssetType\", int32_type, [[\"Cash\", 0], [\"CashAccount\", 1], [\"FinancialInstrument\", 2], [\"RealEstate\", 7], [\"Loan\", 9], [\"Debt\", 100]]))], [\"CashflowType\", option_type(enum_type(\"Omnicv.Shared.FinancialAPI.CashflowType\", int32_type, [[\"Income\", 1], [\"Expense\", 2]]))]]);\n}\n\nexport function EntryFilter_get_Empty() {\n return new EntryFilter(undefined, undefined, undefined, undefined);\n}\n\nexport function EntryFilter__Match_4FDF7BFC(this$, node) {\n return forAll((x) => x, singleton(stringsFilter([node.Name, defaultArg(node.Notes, \"\")], this$.Content)));\n}\n\nexport function EntryFilter__Match_Z1534E064(this$, node) {\n return EntryFilter__Match_4FDF7BFC(this$, node.Data);\n}\n\nexport function EntryFilter__Match_Z6FD9FBA3(this$, asset) {\n return forAll((x) => x, ofArray([stringFilter(asset.Currency, this$.Currency), stringsFilter([asset.Name, defaultArg(asset.Notes, \"\")], this$.Content), noneOrPred((value_1) => (value_1 === asset.AssetType), this$.AssetType)]));\n}\n\nexport function EntryFilter__Match_13C44C26(this$, cashflow) {\n return forAll((x) => x, ofArray([stringFilter(cashflow.Currency, this$.Currency), stringsFilter([cashflow.Name, defaultArg(cashflow.Notes, \"\")], this$.Content), noneOrPred((value_1) => (value_1 === cashflow.CashflowType), this$.CashflowType)]));\n}\n\nexport function EntryFilter__Match_Z2451782B(this$, cashflow) {\n return forAll((x) => x, ofArray([stringFilter(cashflow.Currency, this$.Currency), stringFilter(cashflow.Name, this$.Content), noneOrPred((value) => (value === cashflow.CashflowType), this$.CashflowType)]));\n}\n\nexport function EntryFilter__Match_6E47A7A8(this$, cashflow) {\n if (cashflow.tag === 1) {\n return EntryFilter__Match_Z2451782B(this$, cashflow.fields[0]);\n }\n else {\n return EntryFilter__Match_13C44C26(this$, cashflow.fields[0]);\n }\n}\n\nexport class FinancialHierarchy extends Record {\n constructor(Groups, Assets, Cashflows, LatestValues, FxRates, DisplayCurrency) {\n super();\n this.Groups = Groups;\n this.Assets = Assets;\n this.Cashflows = Cashflows;\n this.LatestValues = LatestValues;\n this.FxRates = FxRates;\n this.DisplayCurrency = DisplayCurrency;\n }\n}\n\nexport function FinancialHierarchy_$reflection() {\n return record_type(\"Omnicv.Shared.FinancialAPI.FinancialHierarchy\", [], FinancialHierarchy, () => [[\"Groups\", list_type(Group_$reflection())], [\"Assets\", list_type(AssetInfo_$reflection())], [\"Cashflows\", list_type(CashflowInfo_$reflection())], [\"LatestValues\", class_type(\"Microsoft.FSharp.Collections.FSharpMap`2\", [int64_type, tuple_type(class_type(\"System.DateTime\"), AssetValueRecord_$reflection())])], [\"FxRates\", class_type(\"Microsoft.FSharp.Collections.FSharpMap`2\", [tuple_type(string_type, string_type), decimal_type])], [\"DisplayCurrency\", string_type]]);\n}\n\nexport function FinancialHierarchy__BuildMapTree_Z59A20369(this$, filter) {\n return ofList(map((t) => [t, FinancialHierarchy__BuildTree(this$, t, filter)], ofArray([1, 2])), {\n Compare: comparePrimitives,\n });\n}\n\nexport function FinancialHierarchy__BuildTree(this$, groupType, filter) {\n const hasFilter = !equals(filter, EntryFilter_get_Empty());\n const groupMapping = ofList(List_groupBy((group_1) => group_1.ParentId, filter_2((cashflow) => EntryFilter__Match_4FDF7BFC(filter, cashflow), filter_2((group) => (group.GroupType === groupType), this$.Groups)), {\n Equals: equals,\n GetHashCode: structuralHash,\n }), {\n Compare: compare_1,\n });\n const assetMappings = ofList(List_groupBy((asset) => asset.GroupId, filter_2((cashflow_1) => EntryFilter__Match_Z6FD9FBA3(filter, cashflow_1), this$.Assets), {\n Equals: equals_1,\n GetHashCode: bigintHash,\n }), {\n Compare: compare_2,\n });\n const cashflowMappings = ofList(List_groupBy((cashflow_3) => cashflow_3.GroupId, filter_2((cashflow_2) => EntryFilter__Match_13C44C26(filter, cashflow_2), this$.Cashflows), {\n Equals: equals_1,\n GetHashCode: bigintHash,\n }), {\n Compare: compare_2,\n });\n const sumCurrencyValues = (targetCurrency, values) => sum(map((value) => {\n if (targetCurrency === value.Currency) {\n return value.Value;\n }\n else {\n return op_Multiply(value.Value, FSharpMap__get_Item(this$.FxRates, [value.Currency, targetCurrency]));\n }\n }, values), {\n GetZero: () => (new Decimal(\"0\")),\n Add: op_Addition,\n });\n const build = (parentDisplayCurrency, groupNode) => {\n let group_2, matchValue, list_12;\n const group_3 = groupNode.Data;\n const displayCurrency = defaultArg(group_3.DisplayCurrency, parentDisplayCurrency);\n const children = append((group_2 = group_3, (matchValue = (group_2.GroupType | 0), (matchValue === 1) ? map((asset_1) => (new ChildNode$(1, [asset_1, AssetInfo__GetValue_Z33CCF5CA(asset_1, tryFind(asset_1.Id, this$.LatestValues))])), FSharpMap__ContainsKey(assetMappings, group_2.Id) ? FSharpMap__get_Item(assetMappings, group_2.Id) : empty()) : ((matchValue === 2) ? map((cashflow_4) => (new ChildNode$(2, [new Cashflow(0, [cashflow_4]), adjustForFrequency(CashflowInfo__GetValue(cashflow_4), cashflow_4.Frequency, 3)])), FSharpMap__ContainsKey(cashflowMappings, group_2.Id) ? FSharpMap__get_Item(cashflowMappings, group_2.Id) : empty()) : toFail(printf(\"Unsupported group type %A\"))(matchValue)))), map((tupledArg_1) => (new ChildNode$(0, [tupledArg_1[0], tupledArg_1[1]])), filter_2((tupledArg) => !(isEmpty(tupledArg[0].Children) && hasFilter), (list_12 = map((group_4) => (new GroupNode(group_4, empty())), FSharpMap__ContainsKey(groupMapping, group_3.Id) ? FSharpMap__get_Item(groupMapping, group_3.Id) : empty()), map(curry2(build)(displayCurrency), list_12)))));\n return [new GroupNode(groupNode.Data, children), new CurrencyValue(displayCurrency, sumCurrencyValues(displayCurrency, map((child) => {\n switch (child.tag) {\n case 1:\n return child.fields[1];\n case 2:\n return child.fields[1];\n default:\n return child.fields[1];\n }\n }, children)))];\n };\n let finalTL;\n const list_17 = map((group_5) => (new GroupNode(group_5, empty())), (FSharpMap__get_Count(groupMapping) > 0) ? FSharpMap__get_Item(groupMapping, undefined) : empty());\n finalTL = map(curry2(build)(this$.DisplayCurrency), list_17);\n return [finalTL, new CurrencyValue(this$.DisplayCurrency, sumCurrencyValues(this$.DisplayCurrency, map((tuple) => tuple[1], finalTL)))];\n}\n\nexport class FinancialService extends Record {\n constructor(GetHierarchy, ImportHierarchyData, GetAssetValuesForChart, AddGroup, EditGroup, DeleteGroup, AddAsset, EditAsset, DeleteAsset, GetAsset, AddCashflow, EditCashflow, DeleteCashflow) {\n super();\n this.GetHierarchy = GetHierarchy;\n this.ImportHierarchyData = ImportHierarchyData;\n this.GetAssetValuesForChart = GetAssetValuesForChart;\n this.AddGroup = AddGroup;\n this.EditGroup = EditGroup;\n this.DeleteGroup = DeleteGroup;\n this.AddAsset = AddAsset;\n this.EditAsset = EditAsset;\n this.DeleteAsset = DeleteAsset;\n this.GetAsset = GetAsset;\n this.AddCashflow = AddCashflow;\n this.EditCashflow = EditCashflow;\n this.DeleteCashflow = DeleteCashflow;\n }\n}\n\nexport function FinancialService_$reflection() {\n return record_type(\"Omnicv.Shared.FinancialAPI.FinancialService\", [], FinancialService, () => [[\"GetHierarchy\", lambda_type(int32_type, lambda_type(string_type, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [FinancialHierarchy_$reflection()])))], [\"ImportHierarchyData\", lambda_type(int32_type, lambda_type(array_type(uint8_type), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [unit_type])))], [\"GetAssetValuesForChart\", lambda_type(int32_type, lambda_type(string_type, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [list_type(DataPoint_$reflection())])))], [\"AddGroup\", lambda_type(Group_$reflection(), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [int64_type]))], [\"EditGroup\", lambda_type(Group_$reflection(), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [Group_$reflection()]))], [\"DeleteGroup\", lambda_type(int32_type, lambda_type(int64_type, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [unit_type])))], [\"AddAsset\", lambda_type(AssetInfo_$reflection(), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [int64_type]))], [\"EditAsset\", lambda_type(AssetInfo_$reflection(), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [AssetInfo_$reflection()]))], [\"DeleteAsset\", lambda_type(int32_type, lambda_type(int64_type, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [unit_type])))], [\"GetAsset\", lambda_type(int32_type, lambda_type(int64_type, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [AssetInfo_$reflection()])))], [\"AddCashflow\", lambda_type(CashflowInfo_$reflection(), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [int64_type]))], [\"EditCashflow\", lambda_type(CashflowInfo_$reflection(), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [CashflowInfo_$reflection()]))], [\"DeleteCashflow\", lambda_type(int32_type, lambda_type(int64_type, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [unit_type])))]]);\n}\n\nexport class FinancialModule {\n constructor() {\n this.initialTimestamp = parse(\"2021-12-14T21:51:00\");\n this.latestTimestamp = this.initialTimestamp;\n }\n get Details() {\n const this$ = this;\n return new ProductInformation(\"Omnicv.Financial\", this$.initialTimestamp, this$.latestTimestamp, \"Financial\", \"Track your financial data: expenses, wealth, pensions etc.\", empty(), FinancialModule__get_CurrentVersion(this$), singleton(defaultAuthors), defaultContacts, defaultWeb, undefined, undefined, new Changelog(1, [FinancialModule__get_Changelog(this$)]));\n }\n RegisteredTypes() {\n return singleton(AssetValueRecord_$reflection());\n }\n}\n\nexport function FinancialModule_$reflection() {\n return class_type(\"Omnicv.Shared.FinancialAPI.FinancialModule\", undefined, FinancialModule);\n}\n\nexport function FinancialModule_$ctor() {\n return new FinancialModule();\n}\n\nexport function FinancialModule__get_Changelog(this$) {\n return singleton(new ChangelogEntry(this$.initialTimestamp, new Version(1, 0, 1, undefined), \"Initial release\"));\n}\n\nexport function FinancialModule__get_CurrentVersion(this$) {\n return head(FinancialModule__get_Changelog(this$)).Version;\n}\n\n","import { tryFind, ofList } from \"../fable_modules/fable-library-js.4.24.0/Map.js\";\nimport { ofArray, partition, find, length as length_1, map } from \"../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { comparePrimitives } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { class_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { length } from \"../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { ofList as ofList_1 } from \"../fable_modules/fable-library-js.4.24.0/Set.js\";\nimport { FSharpResult$2 } from \"../fable_modules/fable-library-js.4.24.0/Result.js\";\nimport { value } from \"../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { DiaryModule_$ctor } from \"../modules/Omnicv.Diary.Shared/DiaryAPI.js\";\nimport { PhysicalModule_$ctor } from \"./PhysicalAPI.js\";\nimport { FinancialModule_$ctor } from \"./FinancialAPI.js\";\nimport { FitnessModule_$ctor } from \"./FitnessAPI.js\";\n\nexport class Registry$1 {\n constructor(init) {\n this.modules = init;\n this.lookup = ofList(map((m) => {\n let copyOfStruct;\n return [((copyOfStruct = m, copyOfStruct.Details)).Name, m];\n }, init), {\n Compare: comparePrimitives,\n });\n }\n}\n\nexport function Registry$1_$reflection(gen0) {\n return class_type(\"Omnicv.Shared.Registration.Registry`1\", [gen0], Registry$1);\n}\n\nexport function Registry$1_$ctor_Z1FA48BC9(init) {\n return new Registry$1(init);\n}\n\nexport function Registry$1__get_Modules(this$) {\n return this$.modules;\n}\n\nexport function Registry$1__get_Validate(this$) {\n if (length(ofList_1(map((m) => m.Details.Name.toLowerCase(), this$.modules), {\n Compare: comparePrimitives,\n })) !== length_1(this$.modules)) {\n return new FSharpResult$2(1, [\"There are duplicate modules\"]);\n }\n else {\n return new FSharpResult$2(0, [undefined]);\n }\n}\n\nexport function Registry$1__GetModule_Z721C83C5(this$, name) {\n return find((m) => {\n let copyOfStruct;\n return ((copyOfStruct = m, copyOfStruct.Details)).Name === name;\n }, Registry$1__get_Modules(this$));\n}\n\nexport function Registry$1__MatchModules_7F866359(this$, modules) {\n const patternInput = partition((tupledArg) => (tupledArg[1] != null), map((m) => [m, tryFind(m, this$.lookup)], modules));\n return [map((tupledArg_1) => value(tupledArg_1[1]), patternInput[0]), map((tupledArg_2) => tupledArg_2[0], patternInput[1])];\n}\n\nexport const sharedRegistry = Registry$1_$ctor_Z1FA48BC9(ofArray([DiaryModule_$ctor(), PhysicalModule_$ctor(), FinancialModule_$ctor(), FitnessModule_$ctor()]));\n\n","import { some, value } from \"../fable-library-js.4.24.0/Option.js\";\n\nexport function tuple(a, b) {\n let matchResult, a_1, b_1;\n if (a != null) {\n if (b != null) {\n matchResult = 0;\n a_1 = value(a);\n b_1 = value(b);\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return [a_1, b_1];\n default:\n return undefined;\n }\n}\n\nexport function ofFunc(f, arg) {\n try {\n return some(f(arg));\n }\n catch (matchValue) {\n return undefined;\n }\n}\n\n","import { FSharpRef, Record } from \"../fable-library-js.4.24.0/Types.js\";\nimport { record_type, class_type, list_type, string_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { ofArray, collect, map as map_1, concat, singleton, tail, cons, empty, head, isEmpty } from \"../fable-library-js.4.24.0/List.js\";\nimport { FSharpResult$2 } from \"../fable-library-js.4.24.0/Result.js\";\nimport { tryParse } from \"../fable-library-js.4.24.0/Int32.js\";\nimport { substring, isNullOrEmpty, split, join } from \"../fable-library-js.4.24.0/String.js\";\nimport { ofSeq, empty as empty_1, tryFind } from \"../fable-library-js.4.24.0/Map.js\";\nimport { some, bind } from \"../fable-library-js.4.24.0/Option.js\";\nimport { equalsWith, item } from \"../fable-library-js.4.24.0/Array.js\";\nimport { ofFunc, tuple } from \"./prelude.fs.js\";\nimport { comparePrimitives, defaultOf } from \"../fable-library-js.4.24.0/Util.js\";\nimport { map as map_2, choose } from \"../fable-library-js.4.24.0/Seq.js\";\n\nexport class State$1 extends Record {\n constructor(visited, unvisited, args, value) {\n super();\n this.visited = visited;\n this.unvisited = unvisited;\n this.args = args;\n this.value = value;\n }\n}\n\nexport function State$1_$reflection(gen0) {\n return record_type(\"Elmish.UrlParser.State`1\", [gen0], State$1, () => [[\"visited\", list_type(string_type)], [\"unvisited\", list_type(string_type)], [\"args\", class_type(\"Microsoft.FSharp.Collections.FSharpMap`2\", [string_type, string_type])], [\"value\", gen0]]);\n}\n\nexport function StateModule_mkState(visited, unvisited, args, value) {\n return new State$1(visited, unvisited, args, value);\n}\n\nexport function StateModule_map(f, _arg) {\n return new State$1(_arg.visited, _arg.unvisited, _arg.args, f(_arg.value));\n}\n\nexport function custom(tipe, stringToSomething) {\n return (_arg) => {\n const unvisited = _arg.unvisited;\n if (!isEmpty(unvisited)) {\n const next = head(unvisited);\n const matchValue = stringToSomething(next);\n if (matchValue.tag === 1) {\n return empty();\n }\n else {\n return singleton(StateModule_mkState(cons(next, _arg.visited), tail(unvisited), _arg.args, _arg.value(matchValue.fields[0])));\n }\n }\n else {\n return empty();\n }\n };\n}\n\nexport function str(state) {\n return custom(\"string\", (ResultValue) => (new FSharpResult$2(0, [ResultValue])))(state);\n}\n\nexport function i32(state) {\n return custom(\"i32\", (arg_1) => {\n let _arg;\n let outArg = 0;\n _arg = [tryParse(arg_1, 511, false, 32, new FSharpRef(() => outArg, (v) => {\n outArg = (v | 0);\n })), outArg];\n return _arg[0] ? (new FSharpResult$2(0, [_arg[1]])) : (new FSharpResult$2(1, [\"Can\\'t parse int\"]));\n })(state);\n}\n\nexport function s(str_1) {\n return (_arg) => {\n const unvisited = _arg.unvisited;\n if (!isEmpty(unvisited)) {\n const next = head(unvisited);\n if (next === str_1) {\n return singleton(StateModule_mkState(cons(next, _arg.visited), tail(unvisited), _arg.args, _arg.value));\n }\n else {\n return empty();\n }\n }\n else {\n return empty();\n }\n };\n}\n\nexport function remaining(s_1) {\n return singleton(StateModule_mkState(concat([s_1.visited, s_1.unvisited]), empty(), s_1.args, s_1.value(join(\"/\", s_1.unvisited))));\n}\n\nexport function map(subValue, parse_1) {\n return (_arg) => map_1((arg10$0040) => StateModule_map(_arg.value, arg10$0040), parse_1(new State$1(_arg.visited, _arg.unvisited, _arg.args, subValue)));\n}\n\nexport function oneOf(parsers, state) {\n return collect((parser) => parser(state), parsers);\n}\n\nexport function top(state) {\n return singleton(state);\n}\n\nexport function customParam(key, func) {\n return (_arg) => {\n const args = _arg.args;\n return singleton(StateModule_mkState(_arg.visited, _arg.unvisited, args, _arg.value(func(tryFind(key, args)))));\n };\n}\n\nexport function stringParam(name) {\n return customParam(name, (x) => x);\n}\n\nexport const intParamHelp = (option) => bind((value) => {\n let matchValue;\n let outArg = 0;\n matchValue = [tryParse(value, 511, false, 32, new FSharpRef(() => outArg, (v) => {\n outArg = (v | 0);\n })), outArg];\n if (matchValue[0]) {\n return matchValue[1];\n }\n else {\n return undefined;\n }\n}, option);\n\nexport function intParam(name) {\n return customParam(name, intParamHelp);\n}\n\nexport function parseHelp(states_mut) {\n parseHelp:\n while (true) {\n const states = states_mut;\n if (!isEmpty(states)) {\n const state = head(states);\n const matchValue = state.unvisited;\n let matchResult;\n if (!isEmpty(matchValue)) {\n if (head(matchValue) === \"\") {\n if (isEmpty(tail(matchValue))) {\n matchResult = 1;\n }\n else {\n matchResult = 2;\n }\n }\n else {\n matchResult = 2;\n }\n }\n else {\n matchResult = 0;\n }\n switch (matchResult) {\n case 0:\n return some(state.value);\n case 1:\n return some(state.value);\n default: {\n states_mut = tail(states);\n continue parseHelp;\n }\n }\n }\n else {\n return undefined;\n }\n break;\n }\n}\n\nexport function splitUrl(url) {\n const matchValue = ofArray(url.split(\"/\"));\n let matchResult, segments, segments_1;\n if (!isEmpty(matchValue)) {\n if (head(matchValue) === \"\") {\n matchResult = 0;\n segments = tail(matchValue);\n }\n else {\n matchResult = 1;\n segments_1 = matchValue;\n }\n }\n else {\n matchResult = 1;\n segments_1 = matchValue;\n }\n switch (matchResult) {\n case 0:\n return segments;\n default:\n return segments_1;\n }\n}\n\n/**\n * parse a given part of the location\n */\nexport function parse(parser, url, args) {\n return parseHelp(parser(new State$1(empty(), splitUrl(url), args, (x) => x)));\n}\n\nexport function toKeyValuePair(segment) {\n let key;\n const matchValue = split(segment, [\"=\"], undefined, 0);\n let matchResult;\n if (!equalsWith((x, y) => (x === y), matchValue, defaultOf()) && (matchValue.length === 2)) {\n matchResult = 0;\n }\n else if (!equalsWith((x_1, y_1) => (x_1 === y_1), matchValue, defaultOf()) && (matchValue.length === 1)) {\n if ((key = item(0, matchValue), segment.startsWith(key))) {\n matchResult = 1;\n }\n else {\n matchResult = 2;\n }\n }\n else {\n matchResult = 2;\n }\n switch (matchResult) {\n case 0: {\n const value = item(1, matchValue);\n return tuple(ofFunc(decodeURIComponent, item(0, matchValue)), ofFunc(decodeURIComponent, value));\n }\n case 1:\n return tuple(ofFunc(decodeURIComponent, item(0, matchValue)), \"\");\n default:\n return undefined;\n }\n}\n\nexport function parseParams(querystring) {\n if (isNullOrEmpty(querystring)) {\n return empty_1({\n Compare: comparePrimitives,\n });\n }\n else {\n return ofSeq(choose((x_1) => x_1, map_2(toKeyValuePair, split(querystring.startsWith(\"?\") ? substring(querystring, 1) : querystring, [\"&\"], undefined, 0))), {\n Compare: comparePrimitives,\n });\n }\n}\n\nexport function parseUrl(parser, url) {\n const pos = url.indexOf(\"?\") | 0;\n if (pos >= 0) {\n return parse(parser, substring(url, 0, pos), parseParams(substring(url, pos + 1)));\n }\n else {\n return parse(parser, url, empty_1({\n Compare: comparePrimitives,\n }));\n }\n}\n\n","import { filter, partition, foldBack, choose, append, iterate, cons, map, concat, empty } from \"../fable-library-js.4.24.0/List.js\";\nimport { join } from \"../fable-library-js.4.24.0/String.js\";\nimport { compare, disposeSafe } from \"../fable-library-js.4.24.0/Util.js\";\nimport { ofList, add, contains, empty as empty_1 } from \"../fable-library-js.4.24.0/Set.js\";\n\n/**\n * None - no subscriptions, also known as `[]`\n */\nexport function Sub_none() {\n return empty();\n}\n\n/**\n * Aggregate multiple subscriptions\n */\nexport function Sub_batch(subs) {\n return concat(subs);\n}\n\n/**\n * When emitting the message, map to another type.\n * To avoid ID conflicts with other components, scope SubIds with a prefix.\n */\nexport function Sub_map(idPrefix, f, sub) {\n return map((tupledArg) => [cons(idPrefix, tupledArg[0]), (dispatch) => tupledArg[1]((arg) => {\n dispatch(f(arg));\n })], sub);\n}\n\nexport function Sub_Internal_SubId_toString(subId) {\n return join(\"/\", subId);\n}\n\nexport function Sub_Internal_Fx_warnDupe(onError, subId) {\n const ex = new Error(\"Duplicate SubId\");\n return onError([\"Duplicate SubId: \" + Sub_Internal_SubId_toString(subId), ex]);\n}\n\nexport function Sub_Internal_Fx_tryStop(onError, subId, sub) {\n try {\n disposeSafe(sub);\n }\n catch (ex) {\n onError([\"Error stopping subscription: \" + Sub_Internal_SubId_toString(subId), ex]);\n }\n}\n\nexport function Sub_Internal_Fx_tryStart(onError, dispatch, subId, start) {\n try {\n return [subId, start(dispatch)];\n }\n catch (ex) {\n onError([\"Error starting subscription: \" + Sub_Internal_SubId_toString(subId), ex]);\n return undefined;\n }\n}\n\nexport function Sub_Internal_Fx_stop(onError, subs) {\n iterate((tupledArg) => {\n Sub_Internal_Fx_tryStop(onError, tupledArg[0], tupledArg[1]);\n }, subs);\n}\n\nexport function Sub_Internal_Fx_change(onError, dispatch, dupes, toStop, toKeep, toStart) {\n iterate((subId) => {\n Sub_Internal_Fx_warnDupe(onError, subId);\n }, dupes);\n iterate((tupledArg) => {\n Sub_Internal_Fx_tryStop(onError, tupledArg[0], tupledArg[1]);\n }, toStop);\n return append(toKeep, choose((tupledArg_1) => Sub_Internal_Fx_tryStart(onError, dispatch, tupledArg_1[0], tupledArg_1[1]), toStart));\n}\n\nexport function Sub_Internal_NewSubs_init() {\n return [empty(), empty_1({\n Compare: compare,\n }), empty()];\n}\n\nexport function Sub_Internal_NewSubs__newSubs() {\n return Sub_Internal_NewSubs_init()[2];\n}\n\nexport function Sub_Internal_NewSubs__newKeys() {\n return Sub_Internal_NewSubs_init()[1];\n}\n\nexport function Sub_Internal_NewSubs__dupes() {\n return Sub_Internal_NewSubs_init()[0];\n}\n\nexport function Sub_Internal_NewSubs_update(subId, start, dupes, newKeys, newSubs) {\n if (contains(subId, newKeys)) {\n return [cons(subId, dupes), newKeys, newSubs];\n }\n else {\n return [dupes, add(subId, newKeys), cons([subId, start], newSubs)];\n }\n}\n\nexport function Sub_Internal_NewSubs_calculate(subs) {\n return foldBack((tupledArg, tupledArg_1) => Sub_Internal_NewSubs_update(tupledArg[0], tupledArg[1], tupledArg_1[0], tupledArg_1[1], tupledArg_1[2]), subs, Sub_Internal_NewSubs_init());\n}\n\nexport const Sub_Internal_empty = empty();\n\nexport function Sub_Internal_diff(activeSubs, sub) {\n const keys = ofList(map((tuple) => tuple[0], activeSubs), {\n Compare: compare,\n });\n const patternInput = Sub_Internal_NewSubs_calculate(sub);\n const newKeys = patternInput[1];\n const dupes = patternInput[0];\n if (keys.Equals(newKeys)) {\n return [dupes, empty(), activeSubs, empty()];\n }\n else {\n const patternInput_1 = partition((tupledArg) => contains(tupledArg[0], newKeys), activeSubs);\n return [dupes, patternInput_1[1], patternInput_1[0], filter((tupledArg_1) => !contains(tupledArg_1[0], keys), patternInput[2])];\n }\n}\n\n","import { compare } from \"./Util.js\";\nimport { unfold, delay } from \"./Seq.js\";\nimport { toUInt64, toInt64, op_Addition, fromZero } from \"./BigInt.js\";\nimport { op_Addition as op_Addition_1, fromParts } from \"./Decimal.js\";\nexport function makeRangeStepFunction(step, stop, zero, add) {\n const stepComparedWithZero = compare(step, zero) | 0;\n if (stepComparedWithZero === 0) {\n throw new Error(\"The step of a range cannot be zero\");\n }\n const stepGreaterThanZero = stepComparedWithZero > 0;\n return (x) => {\n const comparedWithLast = compare(x, stop) | 0;\n return ((stepGreaterThanZero && (comparedWithLast <= 0)) ? true : (!stepGreaterThanZero && (comparedWithLast >= 0))) ? [x, add(x, step)] : undefined;\n };\n}\nexport function integralRangeStep(start, step, stop, zero, add) {\n const stepFn = makeRangeStepFunction(step, stop, zero, add);\n return delay(() => unfold(stepFn, start));\n}\nexport function rangeBigInt(start, step, stop) {\n return integralRangeStep(start, step, stop, fromZero(), op_Addition);\n}\nexport function rangeDecimal(start, step, stop) {\n return integralRangeStep(start, step, stop, fromParts(0, 0, 0, false, 0), op_Addition_1);\n}\nexport function rangeDouble(start, step, stop) {\n return integralRangeStep(start, step, stop, 0, (x, y) => (x + y));\n}\nexport function rangeInt64(start, step, stop) {\n return integralRangeStep(start, step, stop, 0n, (x, y) => toInt64(op_Addition(x, y)));\n}\nexport function rangeUInt64(start, step, stop) {\n return integralRangeStep(start, step, stop, 0n, (x, y) => toUInt64(op_Addition(x, y)));\n}\nexport function rangeChar(start, stop) {\n const intStop = ~~stop.charCodeAt(0) | 0;\n return delay(() => unfold((c) => {\n if (c <= intStop) {\n return [String.fromCharCode(c), c + 1];\n }\n else {\n return undefined;\n }\n }, ~~start.charCodeAt(0)));\n}\n","import { Union } from \"../fable-library-js.4.24.0/Types.js\";\nimport { class_type, union_type, int32_type, array_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { setItem, item as item_1, fill } from \"../fable-library-js.4.24.0/Array.js\";\nimport { max } from \"../fable-library-js.4.24.0/Double.js\";\nimport { some } from \"../fable-library-js.4.24.0/Option.js\";\nimport { singleton, collect, take, skip, append, delay } from \"../fable-library-js.4.24.0/Seq.js\";\nimport { defaultOf } from \"../fable-library-js.4.24.0/Util.js\";\nimport { rangeDouble } from \"../fable-library-js.4.24.0/Range.js\";\n\nexport class RingState$1 extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Writable\", \"ReadWritable\"];\n }\n}\n\nexport function RingState$1_$reflection(gen0) {\n return union_type(\"Elmish.RingState`1\", [gen0], RingState$1, () => [[[\"wx\", array_type(gen0)], [\"ix\", int32_type]], [[\"rw\", array_type(gen0)], [\"wix\", int32_type], [\"rix\", int32_type]]]);\n}\n\nexport class RingBuffer$1 {\n constructor(size) {\n this.state = (new RingState$1(0, [fill(new Array(max(size, 10)), 0, max(size, 10), null), 0]));\n }\n}\n\nexport function RingBuffer$1_$reflection(gen0) {\n return class_type(\"Elmish.RingBuffer`1\", [gen0], RingBuffer$1);\n}\n\nexport function RingBuffer$1_$ctor_Z524259A4(size) {\n return new RingBuffer$1(size);\n}\n\nexport function RingBuffer$1__Pop(__) {\n const matchValue = __.state;\n if (matchValue.tag === 1) {\n const wix = matchValue.fields[1] | 0;\n const rix = matchValue.fields[2] | 0;\n const items = matchValue.fields[0];\n const rix$0027 = ((rix + 1) % items.length) | 0;\n if (rix$0027 === wix) {\n __.state = (new RingState$1(0, [items, wix]));\n }\n else {\n __.state = (new RingState$1(1, [items, wix, rix$0027]));\n }\n return some(item_1(rix, items));\n }\n else {\n return undefined;\n }\n}\n\nexport function RingBuffer$1__Push_2B595(__, item) {\n const matchValue = __.state;\n if (matchValue.tag === 1) {\n const wix_1 = matchValue.fields[1] | 0;\n const rix = matchValue.fields[2] | 0;\n const items_1 = matchValue.fields[0];\n setItem(items_1, wix_1, item);\n const wix$0027 = ((wix_1 + 1) % items_1.length) | 0;\n if (wix$0027 === rix) {\n __.state = (new RingState$1(1, [RingBuffer$1__doubleSize(__, rix, items_1), items_1.length, 0]));\n }\n else {\n __.state = (new RingState$1(1, [items_1, wix$0027, rix]));\n }\n }\n else {\n const ix = matchValue.fields[1] | 0;\n const items = matchValue.fields[0];\n setItem(items, ix, item);\n const wix = ((ix + 1) % items.length) | 0;\n __.state = (new RingState$1(1, [items, wix, ix]));\n }\n}\n\nexport function RingBuffer$1__doubleSize(this$, ix, items) {\n return Array.from(delay(() => append(skip(ix, items), delay(() => append(take(ix, items), delay(() => collect((matchValue) => singleton(defaultOf()), rangeDouble(0, 1, items.length))))))));\n}\n\n","import { Record } from \"../fable-library-js.4.24.0/Types.js\";\nimport { record_type, bool_type, class_type, string_type, tuple_type, list_type, lambda_type, unit_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { Sub_Internal_Fx_change, Sub_Internal_diff, Sub_Internal_Fx_stop, Sub_Internal_empty, Sub_none } from \"./sub.fs.js\";\nimport { curry3, curry2, uncurry2 } from \"../fable-library-js.4.24.0/Util.js\";\nimport { Log_toConsole, Log_onError } from \"./prelude.fs.js\";\nimport { Cmd_exec, Cmd_none } from \"./cmd.fs.js\";\nimport { map as map_1 } from \"../fable-library-js.4.24.0/List.js\";\nimport { RingBuffer$1__Pop, RingBuffer$1__Push_2B595, RingBuffer$1_$ctor_Z524259A4 } from \"./ring.fs.js\";\nimport { value as value_2 } from \"../fable-library-js.4.24.0/Option.js\";\nimport { printf, toText } from \"../fable-library-js.4.24.0/String.js\";\n\nexport class Program$4 extends Record {\n constructor(init, update, subscribe, view, setState, onError, termination) {\n super();\n this.init = init;\n this.update = update;\n this.subscribe = subscribe;\n this.view = view;\n this.setState = setState;\n this.onError = onError;\n this.termination = termination;\n }\n}\n\nexport function Program$4_$reflection(gen0, gen1, gen2, gen3) {\n return record_type(\"Elmish.Program`4\", [gen0, gen1, gen2, gen3], Program$4, () => [[\"init\", lambda_type(gen0, tuple_type(gen1, list_type(lambda_type(lambda_type(gen2, unit_type), unit_type))))], [\"update\", lambda_type(gen2, lambda_type(gen1, tuple_type(gen1, list_type(lambda_type(lambda_type(gen2, unit_type), unit_type)))))], [\"subscribe\", lambda_type(gen1, list_type(tuple_type(list_type(string_type), lambda_type(lambda_type(gen2, unit_type), class_type(\"System.IDisposable\")))))], [\"view\", lambda_type(gen1, lambda_type(lambda_type(gen2, unit_type), gen3))], [\"setState\", lambda_type(gen1, lambda_type(lambda_type(gen2, unit_type), unit_type))], [\"onError\", lambda_type(tuple_type(string_type, class_type(\"System.Exception\")), unit_type)], [\"termination\", tuple_type(lambda_type(gen2, bool_type), lambda_type(gen1, unit_type))]]);\n}\n\n/**\n * Typical program, new commands are produced by `init` and `update` along with the new state.\n */\nexport function ProgramModule_mkProgram(init, update, view) {\n return new Program$4(init, update, (_arg) => Sub_none(), view, uncurry2((model) => {\n const f1 = curry2(view)(model);\n return (arg) => {\n f1(arg);\n };\n }), (tupledArg) => {\n Log_onError(tupledArg[0], tupledArg[1]);\n }, [(_arg_1) => false, (value_1) => {\n }]);\n}\n\n/**\n * Simple program that produces only new state with `init` and `update`.\n */\nexport function ProgramModule_mkSimple(init, update, view) {\n return new Program$4((arg) => [init(arg), Cmd_none()], uncurry2((msg) => {\n const f1_1 = curry2(update)(msg);\n return (arg_1) => [f1_1(arg_1), Cmd_none()];\n }), (_arg) => Sub_none(), view, uncurry2((model) => {\n const f1_2 = curry2(view)(model);\n return (arg_2) => {\n f1_2(arg_2);\n };\n }), (tupledArg) => {\n Log_onError(tupledArg[0], tupledArg[1]);\n }, [(_arg_1) => false, (value_1) => {\n }]);\n}\n\n/**\n * Subscribe to external source of events, overrides existing subscription.\n * Return the subscriptions that should be active based on the current model.\n * Subscriptions will be started or stopped automatically to match.\n */\nexport function ProgramModule_withSubscription(subscribe, program) {\n return new Program$4(program.init, program.update, subscribe, program.view, program.setState, program.onError, program.termination);\n}\n\n/**\n * Map existing subscription to external source of events.\n */\nexport function ProgramModule_mapSubscription(map, program) {\n return new Program$4(program.init, program.update, curry2(map)(program.subscribe), program.view, program.setState, program.onError, program.termination);\n}\n\n/**\n * Trace all the updates to the console\n */\nexport function ProgramModule_withConsoleTrace(program) {\n return new Program$4((arg) => {\n const patternInput = program.init(arg);\n const initModel = patternInput[0];\n Log_toConsole(\"Initial state:\", initModel);\n return [initModel, patternInput[1]];\n }, (msg, model) => {\n Log_toConsole(\"New message:\", msg);\n const patternInput_1 = program.update(msg, model);\n const newModel = patternInput_1[0];\n Log_toConsole(\"Updated state:\", newModel);\n return [newModel, patternInput_1[1]];\n }, (model_1) => {\n const sub = program.subscribe(model_1);\n Log_toConsole(\"Updated subs:\", map_1((tuple) => tuple[0], sub));\n return sub;\n }, program.view, program.setState, program.onError, program.termination);\n}\n\n/**\n * Trace all the messages as they update the model and subscriptions\n */\nexport function ProgramModule_withTrace(trace, program) {\n return new Program$4(program.init, (msg, model) => {\n const patternInput = program.update(msg, model);\n const state = patternInput[0];\n trace(msg, state, map_1((tuple) => tuple[0], program.subscribe(state)));\n return [state, patternInput[1]];\n }, program.subscribe, program.view, program.setState, program.onError, program.termination);\n}\n\n/**\n * Handle dispatch loop exceptions\n */\nexport function ProgramModule_withErrorHandler(onError, program) {\n return new Program$4(program.init, program.update, program.subscribe, program.view, program.setState, onError, program.termination);\n}\n\n/**\n * Exit criteria and the handler, overrides existing.\n */\nexport function ProgramModule_withTermination(predicate, terminate, program) {\n return new Program$4(program.init, program.update, program.subscribe, program.view, program.setState, program.onError, [predicate, terminate]);\n}\n\n/**\n * Map existing criteria and the handler.\n */\nexport function ProgramModule_mapTermination(map, program) {\n return new Program$4(program.init, program.update, program.subscribe, program.view, program.setState, program.onError, map(program.termination));\n}\n\n/**\n * Map existing error handler and return new `Program`\n */\nexport function ProgramModule_mapErrorHandler(map, program) {\n return new Program$4(program.init, program.update, program.subscribe, program.view, program.setState, curry2(map)(program.onError), program.termination);\n}\n\n/**\n * Get the current error handler\n */\nexport function ProgramModule_onError(program) {\n return program.onError;\n}\n\n/**\n * Function to render the view with the latest state\n */\nexport function ProgramModule_withSetState(setState, program) {\n return new Program$4(program.init, program.update, program.subscribe, program.view, setState, program.onError, program.termination);\n}\n\n/**\n * Return the function to render the state\n */\nexport function ProgramModule_setState(program) {\n return curry2(program.setState);\n}\n\n/**\n * Return the view function\n */\nexport function ProgramModule_view(program) {\n return curry2(program.view);\n}\n\n/**\n * Return the init function\n */\nexport function ProgramModule_init(program) {\n return program.init;\n}\n\n/**\n * Return the update function\n */\nexport function ProgramModule_update(program) {\n return curry2(program.update);\n}\n\n/**\n * Map the program type\n */\nexport function ProgramModule_map(mapInit, mapUpdate, mapView, mapSetState, mapSubscribe, mapTermination, program) {\n const init = curry2(mapInit)(program.init);\n const update = curry3(mapUpdate)(curry2(program.update));\n const view = curry3(mapView)(curry2(program.view));\n const setState = curry3(mapSetState)(curry2(program.setState));\n return new Program$4(init, uncurry2(update), curry2(mapSubscribe)(program.subscribe), uncurry2(view), uncurry2(setState), program.onError, mapTermination(program.termination));\n}\n\n/**\n * Start the program loop.\n * syncDispatch: specify how to serialize dispatch calls.\n * arg: argument to pass to the init() function.\n * program: program created with 'mkSimple' or 'mkProgram'.\n */\nexport function ProgramModule_runWithDispatch(syncDispatch, arg, program) {\n let tupledArg_1;\n const patternInput = program.init(arg);\n const model = patternInput[0];\n const sub = program.subscribe(model);\n const patternInput_1 = program.termination;\n const rb = RingBuffer$1_$ctor_Z524259A4(10);\n let reentered = false;\n let state = model;\n let activeSubs = Sub_Internal_empty;\n let terminated = false;\n const dispatch = (msg) => {\n if (!terminated) {\n RingBuffer$1__Push_2B595(rb, msg);\n if (!reentered) {\n reentered = true;\n processMsgs();\n reentered = false;\n }\n }\n };\n const dispatch$0027 = curry2(syncDispatch)(dispatch);\n const processMsgs = () => {\n let tupledArg;\n let nextMsg = RingBuffer$1__Pop(rb);\n while (!terminated && (nextMsg != null)) {\n const msg_1 = value_2(nextMsg);\n try {\n if (patternInput_1[0](msg_1)) {\n Sub_Internal_Fx_stop(program.onError, activeSubs);\n patternInput_1[1](state);\n terminated = true;\n }\n else {\n const patternInput_2 = program.update(msg_1, state);\n const model$0027 = patternInput_2[0];\n const sub$0027 = program.subscribe(model$0027);\n program.setState(model$0027, dispatch$0027);\n activeSubs = ((tupledArg = Sub_Internal_diff(activeSubs, sub$0027), Sub_Internal_Fx_change(program.onError, dispatch$0027, tupledArg[0], tupledArg[1], tupledArg[2], tupledArg[3])));\n Cmd_exec((ex) => {\n program.onError([toText(printf(\"Error handling the message: %A\"))(msg_1), ex]);\n }, dispatch$0027, patternInput_2[1]);\n state = model$0027;\n }\n }\n catch (ex_1) {\n program.onError([toText(printf(\"Unable to process the message: %A\"))(msg_1), ex_1]);\n }\n nextMsg = RingBuffer$1__Pop(rb);\n }\n };\n reentered = true;\n program.setState(model, dispatch$0027);\n activeSubs = ((tupledArg_1 = Sub_Internal_diff(activeSubs, sub), Sub_Internal_Fx_change(program.onError, dispatch$0027, tupledArg_1[0], tupledArg_1[1], tupledArg_1[2], tupledArg_1[3])));\n Cmd_exec((ex_2) => {\n program.onError([toText(printf(\"Error intitializing:\")), ex_2]);\n }, dispatch$0027, patternInput[1]);\n processMsgs();\n reentered = false;\n}\n\n/**\n * Start the single-threaded dispatch loop.\n * arg: argument to pass to the 'init' function.\n * program: program created with 'mkSimple' or 'mkProgram'.\n */\nexport function ProgramModule_runWith(arg, program) {\n ProgramModule_runWithDispatch(uncurry2((x) => x), arg, program);\n}\n\n/**\n * Start the dispatch loop with `unit` for the init() function.\n */\nexport function ProgramModule_run(program) {\n ProgramModule_runWith(undefined, program);\n}\n\n","import { FSharpRef, Union } from \"../fable-library-js.4.24.0/Types.js\";\nimport { union_type, class_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { ofArray, singleton } from \"../fable-library-js.4.24.0/List.js\";\nimport { Cmd_map } from \"../Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { ProgramModule_map } from \"../Fable.Elmish.4.2.0/program.fs.js\";\nimport { Sub_map, Sub_batch } from \"../Fable.Elmish.4.2.0/sub.fs.js\";\n\nexport class Navigable$1 extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Change\", \"UserMsg\"];\n }\n}\n\nexport function Navigable$1_$reflection(gen0) {\n return union_type(\"Elmish.Navigation.Navigable`1\", [gen0], Navigable$1, () => [[[\"Item\", class_type(\"Browser.Types.Location\", undefined)]], [[\"Item\", gen0]]]);\n}\n\n/**\n * Modify current location\n */\nexport function Navigation_modifyUrl(newUrl) {\n return singleton((_arg) => {\n history.replaceState(undefined, \"\", newUrl);\n });\n}\n\n/**\n * Push new location into history and navigate there\n */\nexport function Navigation_newUrl(newUrl) {\n return singleton((_arg) => {\n history.pushState(undefined, \"\", newUrl);\n const ev = new CustomEvent(\"NavigatedEvent\");\n window.dispatchEvent(ev);\n });\n}\n\n/**\n * Jump to some point in history (positve=forward, nagative=backward)\n */\nexport function Navigation_jump(n) {\n return singleton((_arg) => {\n history.go(n);\n });\n}\n\n/**\n * Add the navigation to a program made with `mkProgram` or `mkSimple`.\n * urlUpdate: similar to `update` function, but receives parsed url instead of message as an input.\n */\nexport function ProgramModule_toNavigable(parser, urlUpdate, program) {\n const onChangeRef = new FSharpRef((_arg) => {\n throw new Error(\"`onChangeRef` has not been initialized.\\nThis should not happen, please open an issue if the problem persist\");\n });\n const map = (tupledArg) => [tupledArg[0], Cmd_map((Item) => (new Navigable$1(1, [Item])), tupledArg[1])];\n return ProgramModule_map((userInit, unitVar_1) => map(userInit(parser(window.location))), (userUpdate, msg, model_1) => map((msg.tag === 1) ? userUpdate(msg.fields[0])(model_1) : urlUpdate(parser(msg.fields[0]), model_1)), (userView, model_4, dispatch_2) => userView(model_4)((arg_1) => {\n dispatch_2(new Navigable$1(1, [arg_1]));\n }), (userSetState, model_3, dispatch_1) => {\n userSetState(model_3)((arg) => {\n dispatch_1(new Navigable$1(1, [arg]));\n });\n }, (userSubscribe, model_2) => Sub_batch(ofArray([singleton([singleton(\"onLocationChange\"), (dispatch) => {\n let lastLocation = undefined;\n onChangeRef.contents = ((_arg_1) => {\n let matchResult_1, href_1;\n if (lastLocation != null) {\n if (lastLocation === window.location.href) {\n matchResult_1 = 0;\n href_1 = lastLocation;\n }\n else {\n matchResult_1 = 1;\n }\n }\n else {\n matchResult_1 = 1;\n }\n switch (matchResult_1) {\n case 0: {\n break;\n }\n case 1: {\n lastLocation = window.location.href;\n dispatch(new Navigable$1(0, [window.location]));\n break;\n }\n }\n });\n window.addEventListener(\"popstate\", onChangeRef.contents);\n window.addEventListener(\"hashchange\", onChangeRef.contents);\n window.addEventListener(\"NavigatedEvent\", onChangeRef.contents);\n return {\n Dispose() {\n window.removeEventListener(\"popstate\", onChangeRef.contents);\n window.removeEventListener(\"hashchange\", onChangeRef.contents);\n window.removeEventListener(\"NavigatedEvent\", onChangeRef.contents);\n },\n };\n }]), Sub_map(\"user\", (Item_1) => (new Navigable$1(1, [Item_1])), userSubscribe(model_2))])), (tupledArg_1) => [(_arg_2) => {\n if (_arg_2.tag === 1) {\n return tupledArg_1[0](_arg_2.fields[0]);\n }\n else {\n return false;\n }\n }, (model_5) => {\n window.removeEventListener(\"popstate\", onChangeRef.contents);\n window.removeEventListener(\"hashchange\", onChangeRef.contents);\n window.removeEventListener(\"NavigatedEvent\", onChangeRef.contents);\n tupledArg_1[1](model_5);\n }], program);\n}\n\n","import { FSharpRef, Union } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { union_type, option_type, int64_type, string_type, int32_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { oneOf, top, stringParam, remaining, str, i32, s as s_1, map, custom } from \"../fable_modules/Fable.Elmish.UrlParser.1.0.2/parser.fs.js\";\nimport { tryParse } from \"../fable_modules/fable-library-js.4.24.0/Long.js\";\nimport { FSharpResult$2 } from \"../fable_modules/fable-library-js.4.24.0/Result.js\";\nimport { ofArray, collect } from \"../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { Navigation_newUrl, Navigation_modifyUrl } from \"../fable_modules/Fable.Elmish.Browser.4.0.3/navigation.fs.js\";\n\nexport class Route extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Index\", \"NotFound\", \"About\", \"Login\", \"MyProfile\", \"AddProfile\", \"EditProfile\", \"StaticPublicPage\", \"Contact\", \"ViewDiary\", \"AddDiary\", \"EditDiary\", \"AddReview\", \"EditReview\", \"AddInteraction\", \"EditInteraction\", \"SearchDiaryByTags\", \"SearchDiary\", \"ViewPhysical\", \"ViewBodilyFunctions\", \"ViewWeight\", \"AddWeight\", \"EditWeight\", \"AddBodilyFunctions\", \"EditBodilyFunctions\", \"AddBloodPressure\", \"EditBloodPressure\", \"AddTemperature\", \"EditTemperature\", \"ViewFinancial\", \"ViewAsset\", \"ViewAssetsSummary\", \"ViewFitness\", \"AddTrainingPlan\", \"EditTrainingPlan\", \"ViewTrainingPlan\", \"AddWorkout\", \"EditWorkout\", \"ViewWorkout\", \"ViewWorkouts\", \"AddExercise\", \"EditExercise\", \"ViewExercise\", \"ViewExercises\", \"ViewExerciseRecord\", \"AddExerciseRecord\", \"EditExerciseRecord\", \"AddAllWorkoutExerciseRecords\", \"StartWorkoutRecord\", \"EditWorkoutRecord\"];\n }\n}\n\nexport function Route_$reflection() {\n return union_type(\"Omnicv.Client.Router.Route\", [], Route, () => [[], [], [], [], [], [], [[\"Item\", int32_type]], [[\"Item\", string_type]], [], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", int64_type]], [[\"Item\", string_type]], [[\"Item\", int64_type]], [[\"Item\", string_type]], [[\"Item\", int64_type]], [[\"Item\", string_type]], [], [], [], [], [], [[\"Item\", int64_type]], [], [[\"Item\", int64_type]], [], [[\"Item\", int64_type]], [], [[\"Item\", int64_type]], [], [[\"Item\", int64_type]], [], [], [], [[\"Item\", int64_type]], [[\"Item\", int64_type]], [], [[\"Item\", int64_type]], [[\"Item\", int64_type]], [], [], [[\"Item\", int64_type]], [[\"Item\", int64_type]], [], [[\"Item1\", int32_type], [\"Item2\", int64_type]], [[\"Item1\", int32_type], [\"Item2\", int64_type], [\"Item3\", option_type(string_type)]], [[\"Item1\", int32_type], [\"Item2\", int64_type]], [[\"Item\", int64_type]], [[\"Item\", int64_type]], [[\"Item\", int64_type]]]);\n}\n\nexport const RouteModule_defaultRoute = new Route(0, []);\n\nexport function RouteModule_i64(state) {\n return custom(\"i64\", (arg_1) => {\n let _arg;\n let outArg = 0n;\n _arg = [tryParse(arg_1, 511, false, 64, new FSharpRef(() => outArg, (v) => {\n outArg = v;\n })), outArg];\n return _arg[0] ? (new FSharpResult$2(0, [_arg[1]])) : (new FSharpResult$2(1, [\"Can\\'t parse int64\"]));\n })(state);\n}\n\nfunction RouteModule_curry2(f, x, y) {\n return f([x, y]);\n}\n\nfunction RouteModule_curry3(f, x, y, z) {\n return f([x, y, z]);\n}\n\nexport function RouteModule_toHash(route) {\n let param_1;\n return \"#\" + ((route.tag === 1) ? \"not-found\" : ((route.tag === 2) ? \"about\" : ((route.tag === 3) ? \"login\" : ((route.tag === 4) ? \"profile\" : ((route.tag === 5) ? \"add/profile\" : ((route.tag === 6) ? (`edit/profile/${route.fields[0]}`) : ((route.tag === 8) ? \"contact\" : ((route.tag === 7) ? (`page/${route.fields[0]}`) : ((route.tag === 9) ? (`diary/view/${route.fields[0]}`) : ((route.tag === 10) ? (`diary/add/${route.fields[0]}`) : ((route.tag === 11) ? (`diary/edit/${route.fields[0]}`) : ((route.tag === 12) ? (`review/add/${route.fields[0]}`) : ((route.tag === 13) ? (`review/edit/${route.fields[0]}`) : ((route.tag === 14) ? (`inter/add/${route.fields[0]}`) : ((route.tag === 15) ? (`inter/edit/${route.fields[0]}`) : ((route.tag === 16) ? (`diary/search-tags/${route.fields[0]}`) : ((route.tag === 17) ? \"diary/search\" : ((route.tag === 18) ? \"phys/view\" : ((route.tag === 19) ? \"phys/view/bf\" : ((route.tag === 20) ? \"phys/view/weight\" : ((route.tag === 21) ? \"phys/add/weight\" : ((route.tag === 22) ? (`phys/edit/weight/${route.fields[0]}`) : ((route.tag === 25) ? \"phys/add/bp\" : ((route.tag === 26) ? (`phys/edit/bp/${route.fields[0]}`) : ((route.tag === 23) ? \"phys/add/bf\" : ((route.tag === 24) ? (`phys/edit/bf/${route.fields[0]}`) : ((route.tag === 27) ? \"phys/add/temp\" : ((route.tag === 28) ? (`phys/edit/temp/${route.fields[0]}`) : ((route.tag === 29) ? \"fin/view\" : ((route.tag === 30) ? (`fin/asset/${route.fields[0]}`) : ((route.tag === 31) ? \"fin/summary\" : ((route.tag === 32) ? \"fit/view\" : ((route.tag === 33) ? \"fit/add/plan\" : ((route.tag === 34) ? (`fit/edit/plan/${route.fields[0]}`) : ((route.tag === 35) ? (`fit/view/plan/${route.fields[0]}`) : ((route.tag === 39) ? \"fit/workouts\" : ((route.tag === 36) ? \"fit/add/workout\" : ((route.tag === 37) ? (`fit/edit/workout/${route.fields[0]}`) : ((route.tag === 38) ? (`fit/view/workout/${route.fields[0]}`) : ((route.tag === 40) ? \"fit/add/exercise\" : ((route.tag === 41) ? (`fit/edit/exercise/${route.fields[0]}`) : ((route.tag === 42) ? (`fit/view/exercise/${route.fields[0]}`) : ((route.tag === 43) ? \"fit/exercises\" : ((route.tag === 44) ? (`fit/exercise-rec/view/${route.fields[0]}/${route.fields[1]}`) : ((route.tag === 45) ? ((param_1 = route.fields[2], `fit/exercise-rec/add/${route.fields[0]}/${route.fields[1]}?${(param_1 == null) ? \"\" : (`workout=${param_1}`)}`)) : ((route.tag === 46) ? (`fit/exercise-rec/edit/${route.fields[0]}/${route.fields[1]}`) : ((route.tag === 47) ? (`fit/workout/add-all/${route.fields[0]}`) : ((route.tag === 48) ? (`fit/workout/start/${route.fields[0]}`) : ((route.tag === 49) ? (`fit/workout/edit/${route.fields[0]}`) : \"home\")))))))))))))))))))))))))))))))))))))))))))))))));\n}\n\nexport const RouteModule_routeParser = (() => {\n let parseBefore, parseAfter, parseBefore_4, parseBefore_2, parseAfter_2, parseBefore_6, parseBefore_10, parseBefore_8, parseAfter_8, parseBefore_14, parseBefore_12, parseAfter_12, parseBefore_18, parseBefore_16, parseAfter_16, parseBefore_22, parseBefore_20, parseAfter_20, parseBefore_26, parseBefore_24, parseAfter_24, parseBefore_30, parseBefore_28, parseAfter_28, parseBefore_34, parseBefore_32, parseAfter_32, parseBefore_38, parseBefore_36, parseAfter_36, parseBefore_40, parseAfter_40, parseBefore_42, parseAfter_42, parseBefore_46, parseBefore_44, parseAfter_44, parseAfter_46, parseBefore_50, parseBefore_48, parseAfter_48, parseAfter_50, parseBefore_54, parseBefore_52, parseAfter_52, parseAfter_54, parseBefore_60, parseBefore_58, parseBefore_56, parseAfter_56, parseAfter_58, parseBefore_64, parseBefore_62, parseAfter_62, parseAfter_64, parseBefore_70, parseBefore_68, parseBefore_66, parseAfter_66, parseAfter_68, parseBefore_74, parseBefore_72, parseAfter_72, parseAfter_74, parseBefore_80, parseBefore_78, parseBefore_76, parseAfter_76, parseAfter_78, parseBefore_84, parseBefore_82, parseAfter_82, parseAfter_84, parseBefore_90, parseBefore_88, parseBefore_86, parseAfter_86, parseAfter_88, parseBefore_92, parseAfter_92, parseBefore_96, parseBefore_94, parseAfter_94, parseBefore_98, parseAfter_98, parseBefore_100, parseAfter_100, parseBefore_104, parseBefore_102, parseAfter_102, parseAfter_104, parseBefore_110, parseBefore_108, parseBefore_106, parseAfter_106, parseAfter_108, parseBefore_116, parseBefore_114, parseBefore_112, parseAfter_112, parseAfter_114, parseBefore_120, parseBefore_118, parseAfter_118, parseAfter_120, parseBefore_126, parseBefore_124, parseBefore_122, parseAfter_122, parseAfter_124, parseBefore_132, parseBefore_130, parseBefore_128, parseAfter_128, parseAfter_130, parseBefore_134, parseAfter_134, parseBefore_138, parseBefore_136, parseAfter_136, parseAfter_138, parseBefore_144, parseBefore_142, parseBefore_140, parseAfter_140, parseAfter_142, parseBefore_150, parseBefore_148, parseBefore_146, parseAfter_146, parseAfter_148, parseBefore_152, parseAfter_152, parseBefore_160, parseBefore_158, parseBefore_156, parseBefore_154, parseAfter_154, parseAfter_156, parser, parseBefore_168, parseBefore_166, parseBefore_164, parseBefore_162, parseAfter_162, parseAfter_164, queryParser, parseBefore_176, parseBefore_174, parseBefore_172, parseBefore_170, parseAfter_170, parseAfter_172, parseBefore_182, parseBefore_180, parseBefore_178, parseAfter_178, parseAfter_180, parseBefore_188, parseBefore_186, parseBefore_184, parseAfter_184, parseAfter_186, parseBefore_194, parseBefore_192, parseBefore_190, parseAfter_190, parseAfter_192;\n const values = ofArray([map(new Route(0, []), s_1(\"home\")), map(new Route(1, []), s_1(\"not-found\")), map(new Route(2, []), s_1(\"about\")), map(new Route(3, []), s_1(\"login\")), map(new Route(4, []), s_1(\"profile\")), map(new Route(5, []), (parseBefore = s_1(\"add\"), (parseAfter = s_1(\"profile\"), (state) => collect(parseAfter, parseBefore(state))))), map((Item) => (new Route(6, [Item])), (parseBefore_4 = ((parseBefore_2 = s_1(\"edit\"), (parseAfter_2 = s_1(\"profile\"), (state_2) => collect(parseAfter_2, parseBefore_2(state_2))))), (state_5) => collect(i32, parseBefore_4(state_5)))), map(new Route(8, []), s_1(\"contact\")), map((Item_1) => (new Route(7, [Item_1])), (parseBefore_6 = s_1(\"page\"), (state_8) => collect(str, parseBefore_6(state_8)))), map((Item_2) => (new Route(9, [Item_2])), (parseBefore_10 = ((parseBefore_8 = s_1(\"diary\"), (parseAfter_8 = s_1(\"view\"), (state_10) => collect(parseAfter_8, parseBefore_8(state_10))))), (state_13) => collect(str, parseBefore_10(state_13)))), map((Item_3) => (new Route(10, [Item_3])), (parseBefore_14 = ((parseBefore_12 = s_1(\"diary\"), (parseAfter_12 = s_1(\"add\"), (state_15) => collect(parseAfter_12, parseBefore_12(state_15))))), (state_18) => collect(str, parseBefore_14(state_18)))), map((Item_4) => (new Route(11, [Item_4])), (parseBefore_18 = ((parseBefore_16 = s_1(\"diary\"), (parseAfter_16 = s_1(\"edit\"), (state_20) => collect(parseAfter_16, parseBefore_16(state_20))))), (state_23) => collect(RouteModule_i64, parseBefore_18(state_23)))), map((Item_5) => (new Route(12, [Item_5])), (parseBefore_22 = ((parseBefore_20 = s_1(\"review\"), (parseAfter_20 = s_1(\"add\"), (state_25) => collect(parseAfter_20, parseBefore_20(state_25))))), (state_28) => collect(str, parseBefore_22(state_28)))), map((Item_6) => (new Route(13, [Item_6])), (parseBefore_26 = ((parseBefore_24 = s_1(\"review\"), (parseAfter_24 = s_1(\"edit\"), (state_30) => collect(parseAfter_24, parseBefore_24(state_30))))), (state_33) => collect(RouteModule_i64, parseBefore_26(state_33)))), map((Item_7) => (new Route(14, [Item_7])), (parseBefore_30 = ((parseBefore_28 = s_1(\"inter\"), (parseAfter_28 = s_1(\"add\"), (state_35) => collect(parseAfter_28, parseBefore_28(state_35))))), (state_38) => collect(str, parseBefore_30(state_38)))), map((Item_8) => (new Route(15, [Item_8])), (parseBefore_34 = ((parseBefore_32 = s_1(\"inter\"), (parseAfter_32 = s_1(\"edit\"), (state_40) => collect(parseAfter_32, parseBefore_32(state_40))))), (state_43) => collect(RouteModule_i64, parseBefore_34(state_43)))), map((Item_9) => (new Route(16, [Item_9])), (parseBefore_38 = ((parseBefore_36 = s_1(\"diary\"), (parseAfter_36 = s_1(\"search-tags\"), (state_45) => collect(parseAfter_36, parseBefore_36(state_45))))), (state_47) => collect(remaining, parseBefore_38(state_47)))), map(new Route(17, []), (parseBefore_40 = s_1(\"diary\"), (parseAfter_40 = s_1(\"search\"), (state_49) => collect(parseAfter_40, parseBefore_40(state_49))))), map(new Route(18, []), (parseBefore_42 = s_1(\"phys\"), (parseAfter_42 = s_1(\"view\"), (state_51) => collect(parseAfter_42, parseBefore_42(state_51))))), map(new Route(19, []), (parseBefore_46 = ((parseBefore_44 = s_1(\"phys\"), (parseAfter_44 = s_1(\"view\"), (state_53) => collect(parseAfter_44, parseBefore_44(state_53))))), (parseAfter_46 = s_1(\"bf\"), (state_55) => collect(parseAfter_46, parseBefore_46(state_55))))), map(new Route(20, []), (parseBefore_50 = ((parseBefore_48 = s_1(\"phys\"), (parseAfter_48 = s_1(\"view\"), (state_57) => collect(parseAfter_48, parseBefore_48(state_57))))), (parseAfter_50 = s_1(\"weight\"), (state_59) => collect(parseAfter_50, parseBefore_50(state_59))))), map(new Route(21, []), (parseBefore_54 = ((parseBefore_52 = s_1(\"phys\"), (parseAfter_52 = s_1(\"add\"), (state_61) => collect(parseAfter_52, parseBefore_52(state_61))))), (parseAfter_54 = s_1(\"weight\"), (state_63) => collect(parseAfter_54, parseBefore_54(state_63))))), map((Item_10) => (new Route(22, [Item_10])), (parseBefore_60 = ((parseBefore_58 = ((parseBefore_56 = s_1(\"phys\"), (parseAfter_56 = s_1(\"edit\"), (state_65) => collect(parseAfter_56, parseBefore_56(state_65))))), (parseAfter_58 = s_1(\"weight\"), (state_67) => collect(parseAfter_58, parseBefore_58(state_67))))), (state_70) => collect(RouteModule_i64, parseBefore_60(state_70)))), map(new Route(25, []), (parseBefore_64 = ((parseBefore_62 = s_1(\"phys\"), (parseAfter_62 = s_1(\"add\"), (state_72) => collect(parseAfter_62, parseBefore_62(state_72))))), (parseAfter_64 = s_1(\"bp\"), (state_74) => collect(parseAfter_64, parseBefore_64(state_74))))), map((Item_11) => (new Route(26, [Item_11])), (parseBefore_70 = ((parseBefore_68 = ((parseBefore_66 = s_1(\"phys\"), (parseAfter_66 = s_1(\"edit\"), (state_76) => collect(parseAfter_66, parseBefore_66(state_76))))), (parseAfter_68 = s_1(\"bp\"), (state_78) => collect(parseAfter_68, parseBefore_68(state_78))))), (state_81) => collect(RouteModule_i64, parseBefore_70(state_81)))), map(new Route(23, []), (parseBefore_74 = ((parseBefore_72 = s_1(\"phys\"), (parseAfter_72 = s_1(\"add\"), (state_83) => collect(parseAfter_72, parseBefore_72(state_83))))), (parseAfter_74 = s_1(\"bf\"), (state_85) => collect(parseAfter_74, parseBefore_74(state_85))))), map((Item_12) => (new Route(24, [Item_12])), (parseBefore_80 = ((parseBefore_78 = ((parseBefore_76 = s_1(\"phys\"), (parseAfter_76 = s_1(\"edit\"), (state_87) => collect(parseAfter_76, parseBefore_76(state_87))))), (parseAfter_78 = s_1(\"bf\"), (state_89) => collect(parseAfter_78, parseBefore_78(state_89))))), (state_92) => collect(RouteModule_i64, parseBefore_80(state_92)))), map(new Route(27, []), (parseBefore_84 = ((parseBefore_82 = s_1(\"phys\"), (parseAfter_82 = s_1(\"add\"), (state_94) => collect(parseAfter_82, parseBefore_82(state_94))))), (parseAfter_84 = s_1(\"temp\"), (state_96) => collect(parseAfter_84, parseBefore_84(state_96))))), map((Item_13) => (new Route(28, [Item_13])), (parseBefore_90 = ((parseBefore_88 = ((parseBefore_86 = s_1(\"phys\"), (parseAfter_86 = s_1(\"edit\"), (state_98) => collect(parseAfter_86, parseBefore_86(state_98))))), (parseAfter_88 = s_1(\"temp\"), (state_100) => collect(parseAfter_88, parseBefore_88(state_100))))), (state_103) => collect(RouteModule_i64, parseBefore_90(state_103)))), map(new Route(29, []), (parseBefore_92 = s_1(\"fin\"), (parseAfter_92 = s_1(\"view\"), (state_105) => collect(parseAfter_92, parseBefore_92(state_105))))), map((Item_14) => (new Route(30, [Item_14])), (parseBefore_96 = ((parseBefore_94 = s_1(\"fin\"), (parseAfter_94 = s_1(\"asset\"), (state_107) => collect(parseAfter_94, parseBefore_94(state_107))))), (state_110) => collect(RouteModule_i64, parseBefore_96(state_110)))), map(new Route(31, []), (parseBefore_98 = s_1(\"fin\"), (parseAfter_98 = s_1(\"summary\"), (state_112) => collect(parseAfter_98, parseBefore_98(state_112))))), map(new Route(32, []), (parseBefore_100 = s_1(\"fit\"), (parseAfter_100 = s_1(\"view\"), (state_114) => collect(parseAfter_100, parseBefore_100(state_114))))), map(new Route(33, []), (parseBefore_104 = ((parseBefore_102 = s_1(\"fit\"), (parseAfter_102 = s_1(\"add\"), (state_116) => collect(parseAfter_102, parseBefore_102(state_116))))), (parseAfter_104 = s_1(\"plan\"), (state_118) => collect(parseAfter_104, parseBefore_104(state_118))))), map((Item_15) => (new Route(34, [Item_15])), (parseBefore_110 = ((parseBefore_108 = ((parseBefore_106 = s_1(\"fit\"), (parseAfter_106 = s_1(\"edit\"), (state_120) => collect(parseAfter_106, parseBefore_106(state_120))))), (parseAfter_108 = s_1(\"plan\"), (state_122) => collect(parseAfter_108, parseBefore_108(state_122))))), (state_125) => collect(RouteModule_i64, parseBefore_110(state_125)))), map((Item_16) => (new Route(35, [Item_16])), (parseBefore_116 = ((parseBefore_114 = ((parseBefore_112 = s_1(\"fit\"), (parseAfter_112 = s_1(\"view\"), (state_127) => collect(parseAfter_112, parseBefore_112(state_127))))), (parseAfter_114 = s_1(\"plan\"), (state_129) => collect(parseAfter_114, parseBefore_114(state_129))))), (state_132) => collect(RouteModule_i64, parseBefore_116(state_132)))), map(new Route(36, []), (parseBefore_120 = ((parseBefore_118 = s_1(\"fit\"), (parseAfter_118 = s_1(\"add\"), (state_134) => collect(parseAfter_118, parseBefore_118(state_134))))), (parseAfter_120 = s_1(\"workout\"), (state_136) => collect(parseAfter_120, parseBefore_120(state_136))))), map((Item_17) => (new Route(37, [Item_17])), (parseBefore_126 = ((parseBefore_124 = ((parseBefore_122 = s_1(\"fit\"), (parseAfter_122 = s_1(\"edit\"), (state_138) => collect(parseAfter_122, parseBefore_122(state_138))))), (parseAfter_124 = s_1(\"workout\"), (state_140) => collect(parseAfter_124, parseBefore_124(state_140))))), (state_143) => collect(RouteModule_i64, parseBefore_126(state_143)))), map((Item_18) => (new Route(38, [Item_18])), (parseBefore_132 = ((parseBefore_130 = ((parseBefore_128 = s_1(\"fit\"), (parseAfter_128 = s_1(\"view\"), (state_145) => collect(parseAfter_128, parseBefore_128(state_145))))), (parseAfter_130 = s_1(\"workout\"), (state_147) => collect(parseAfter_130, parseBefore_130(state_147))))), (state_150) => collect(RouteModule_i64, parseBefore_132(state_150)))), map(new Route(39, []), (parseBefore_134 = s_1(\"fit\"), (parseAfter_134 = s_1(\"workouts\"), (state_152) => collect(parseAfter_134, parseBefore_134(state_152))))), map(new Route(40, []), (parseBefore_138 = ((parseBefore_136 = s_1(\"fit\"), (parseAfter_136 = s_1(\"add\"), (state_154) => collect(parseAfter_136, parseBefore_136(state_154))))), (parseAfter_138 = s_1(\"exercise\"), (state_156) => collect(parseAfter_138, parseBefore_138(state_156))))), map((Item_19) => (new Route(41, [Item_19])), (parseBefore_144 = ((parseBefore_142 = ((parseBefore_140 = s_1(\"fit\"), (parseAfter_140 = s_1(\"edit\"), (state_158) => collect(parseAfter_140, parseBefore_140(state_158))))), (parseAfter_142 = s_1(\"exercise\"), (state_160) => collect(parseAfter_142, parseBefore_142(state_160))))), (state_163) => collect(RouteModule_i64, parseBefore_144(state_163)))), map((Item_20) => (new Route(42, [Item_20])), (parseBefore_150 = ((parseBefore_148 = ((parseBefore_146 = s_1(\"fit\"), (parseAfter_146 = s_1(\"view\"), (state_165) => collect(parseAfter_146, parseBefore_146(state_165))))), (parseAfter_148 = s_1(\"exercise\"), (state_167) => collect(parseAfter_148, parseBefore_148(state_167))))), (state_170) => collect(RouteModule_i64, parseBefore_150(state_170)))), map(new Route(43, []), (parseBefore_152 = s_1(\"fit\"), (parseAfter_152 = s_1(\"exercises\"), (state_172) => collect(parseAfter_152, parseBefore_152(state_172))))), map((x) => ((y) => RouteModule_curry2((tupledArg) => (new Route(44, [tupledArg[0], tupledArg[1]])), x, y)), (parseBefore_160 = ((parseBefore_158 = ((parseBefore_156 = ((parseBefore_154 = s_1(\"fit\"), (parseAfter_154 = s_1(\"exercise-rec\"), (state_174) => collect(parseAfter_154, parseBefore_154(state_174))))), (parseAfter_156 = s_1(\"view\"), (state_176) => collect(parseAfter_156, parseBefore_156(state_176))))), (state_179) => collect(i32, parseBefore_158(state_179)))), (state_182) => collect(RouteModule_i64, parseBefore_160(state_182)))), map((x_1) => ((y_1) => ((z) => RouteModule_curry3((tupledArg_1) => (new Route(45, [tupledArg_1[0], tupledArg_1[1], tupledArg_1[2]])), x_1, y_1, z))), (parser = ((parseBefore_168 = ((parseBefore_166 = ((parseBefore_164 = ((parseBefore_162 = s_1(\"fit\"), (parseAfter_162 = s_1(\"exercise-rec\"), (state_184) => collect(parseAfter_162, parseBefore_162(state_184))))), (parseAfter_164 = s_1(\"add\"), (state_186) => collect(parseAfter_164, parseBefore_164(state_186))))), (state_189) => collect(i32, parseBefore_166(state_189)))), (state_192) => collect(RouteModule_i64, parseBefore_168(state_192)))), (queryParser = stringParam(\"workout\"), (state_194) => collect(queryParser, parser(state_194))))), map((x_2) => ((y_2) => RouteModule_curry2((tupledArg_2) => (new Route(46, [tupledArg_2[0], tupledArg_2[1]])), x_2, y_2)), (parseBefore_176 = ((parseBefore_174 = ((parseBefore_172 = ((parseBefore_170 = s_1(\"fit\"), (parseAfter_170 = s_1(\"exercise-rec\"), (state_196) => collect(parseAfter_170, parseBefore_170(state_196))))), (parseAfter_172 = s_1(\"edit\"), (state_198) => collect(parseAfter_172, parseBefore_172(state_198))))), (state_201) => collect(i32, parseBefore_174(state_201)))), (state_204) => collect(RouteModule_i64, parseBefore_176(state_204)))), map((Item_28) => (new Route(47, [Item_28])), (parseBefore_182 = ((parseBefore_180 = ((parseBefore_178 = s_1(\"fit\"), (parseAfter_178 = s_1(\"workout\"), (state_206) => collect(parseAfter_178, parseBefore_178(state_206))))), (parseAfter_180 = s_1(\"add-all\"), (state_208) => collect(parseAfter_180, parseBefore_180(state_208))))), (state_211) => collect(RouteModule_i64, parseBefore_182(state_211)))), map((Item_29) => (new Route(48, [Item_29])), (parseBefore_188 = ((parseBefore_186 = ((parseBefore_184 = s_1(\"fit\"), (parseAfter_184 = s_1(\"workout\"), (state_213) => collect(parseAfter_184, parseBefore_184(state_213))))), (parseAfter_186 = s_1(\"start\"), (state_215) => collect(parseAfter_186, parseBefore_186(state_215))))), (state_218) => collect(RouteModule_i64, parseBefore_188(state_218)))), map((Item_30) => (new Route(49, [Item_30])), (parseBefore_194 = ((parseBefore_192 = ((parseBefore_190 = s_1(\"fit\"), (parseAfter_190 = s_1(\"workout\"), (state_220) => collect(parseAfter_190, parseBefore_190(state_220))))), (parseAfter_192 = s_1(\"edit\"), (state_222) => collect(parseAfter_192, parseBefore_192(state_222))))), (state_225) => collect(RouteModule_i64, parseBefore_194(state_225)))), map(new Route(0, []), top), map(new Route(0, []), s_1(\"index\"))]);\n return (state_228) => oneOf(values, state_228);\n})();\n\nexport function Router_href(route) {\n return [\"href\", RouteModule_toHash(route)];\n}\n\nexport function Router_modifyUrl(route) {\n return Navigation_modifyUrl(RouteModule_toHash(route));\n}\n\nexport function Router_newUrl(route) {\n return Navigation_newUrl(RouteModule_toHash(route));\n}\n\nexport function Router_modifyLocation(route) {\n window.location.href = RouteModule_toHash(route);\n}\n\n","import { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions__AddProp_ZCC5A61F, Common_GenericOptions__AddCaseName_1505, Color_ofColor, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection, Size_ISize_$reflection, Color_IColor_$reflection } from \"../Common.fs.js\";\nimport { union_type, string_type, lambda_type, unit_type, list_type, class_type, bool_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\nimport { Reflection_getCaseName } from \"../Common.fs.js\";\nimport { DOMAttr, HTMLAttr } from \"../../Fable.React.9.4.0/Fable.React.Props.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\nimport { singleton, empty, cons, map, exists } from \"../../fable-library-js.4.24.0/List.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Color\", \"Size\", \"is-fullwidth\", \"is-link\", \"is-outlined\", \"is-inverted\", \"is-text\", \"is-ghost\", \"is-rounded\", \"is-expanded\", \"is-hovered\", \"is-focused\", \"is-active\", \"is-loading\", \"is-static\", \"is-light\", \"Disabled\", \"Props\", \"OnClick\", \"CustomClass\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Button.Option\", [], Option, () => [[[\"Item\", Color_IColor_$reflection()]], [[\"Item\", Size_ISize_$reflection()]], [], [], [], [], [], [], [], [], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [], [[\"Item\", bool_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", lambda_type(class_type(\"Browser.Types.MouseEvent\", undefined), unit_type)]], [[\"Item\", string_type]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\nexport function btnView(element, options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n let matchResult, state;\n switch (option.tag) {\n case 1: {\n matchResult = 1;\n break;\n }\n case 3:\n case 2:\n case 4:\n case 5:\n case 6:\n case 8:\n case 9:\n case 7:\n case 15: {\n matchResult = 2;\n break;\n }\n case 16: {\n matchResult = 4;\n break;\n }\n case 18: {\n matchResult = 5;\n break;\n }\n case 17: {\n matchResult = 6;\n break;\n }\n case 19: {\n matchResult = 7;\n break;\n }\n case 20: {\n matchResult = 8;\n break;\n }\n case 10: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n case 11: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n case 12: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n case 13: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n case 14: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n default:\n matchResult = 0;\n }\n switch (matchResult) {\n case 0:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Color_ofColor(option.fields[0]));\n case 1:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Reflection_getCaseName(option.fields[0]));\n case 2:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n case 3:\n if (state) {\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n else {\n return result;\n }\n case 4:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(79, [option.fields[0]]));\n case 5:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new DOMAttr(40, [option.fields[0]]));\n case 6:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 7:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n }\n }, \"button\"), element, children);\n}\n\n/**\n * Generate \n */\nexport function button(options, children) {\n return btnView((props, children_1) => react.createElement(\"button\", keyValueList(props, 1), ...children_1), options, children);\n}\n\n/**\n * Generate \n */\nexport function span(options, children) {\n return btnView((props, children_1) => react.createElement(\"span\", keyValueList(props, 1), ...children_1), options, children);\n}\n\n/**\n * Generate \n */\nexport function a(options, children) {\n return btnView((props, children_1) => react.createElement(\"a\", keyValueList(props, 1), ...children_1), options, children);\n}\n\nexport function Input_btnInput(typ, options) {\n if (exists((opts) => {\n if (opts.tag === 17) {\n return true;\n }\n else {\n return false;\n }\n }, options)) {\n return btnView((options_1, _arg) => react.createElement(\"input\", keyValueList(options_1, 1)), map((opts_1) => {\n if (opts_1.tag === 17) {\n return new Option(17, [cons(new HTMLAttr(159, [typ]), opts_1.fields[0])]);\n }\n else {\n return opts_1;\n }\n }, options), empty());\n }\n else {\n return btnView((options_2, _arg_1) => react.createElement(\"input\", keyValueList(options_2, 1)), cons(new Option(17, [singleton(new HTMLAttr(159, [typ]))]), options), empty());\n }\n}\n\n/**\n * Generate \n */\nexport function Input_reset(options) {\n return Input_btnInput(\"reset\", options);\n}\n\n/**\n * Generate \n */\nexport function Input_submit(options) {\n return Input_btnInput(\"submit\", options);\n}\n\nexport class List_Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"has-addons\", \"is-centered\", \"is-right\", \"are-small\", \"are-medium\", \"are-large\", \"Props\", \"CustomClass\", \"Modifiers\"];\n }\n}\n\nexport function List_Option_$reflection() {\n return union_type(\"Fulma.Button.List.Option\", [], List_Option, () => [[], [], [], [], [], [], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", string_type]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate
\n */\nexport function list(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 6:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 7:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 8:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n }, \"buttons\"), (props_1, children_1) => react.createElement(\"div\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n","import { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { Common_parseOptions, Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions__AddCaseName_1505, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection, Size_ISize_$reflection } from \"../Common.fs.js\";\nimport { union_type, list_type, class_type, string_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\nimport { Reflection_getCaseName } from \"../Common.fs.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Size\", \"is-left\", \"is-right\", \"CustomClass\", \"Props\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Icon.Option\", [], Option, () => [[[\"Item\", Size_ISize_$reflection()]], [], [], [[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate \n */\nexport function icon(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 1:\n case 2:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n case 4:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 3:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 5:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Reflection_getCaseName(option.fields[0]));\n }\n }, \"icon\"), (props_1, children_1) => react.createElement(\"span\", keyValueList(props_1, 1), ...children_1), children);\n}\n\nexport function Text_span(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"icon-text\"), (props, children_1) => react.createElement(\"span\", keyValueList(props, 1), ...children_1), children);\n}\n\nexport function Text_div(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"icon-text\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\n","import { Union, Record } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { Router_modifyLocation, Route_$reflection } from \"./Router.js\";\nimport { bool_type, union_type, record_type, int64_type, lambda_type, string_type, option_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { Fa_i, Fa_IconOption_$reflection } from \"../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { filter, map, empty, ofArray, singleton } from \"../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { Session_$reflection } from \"./SharedView.js\";\nimport { list as list_3, Option, button } from \"../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { Color_IColor, Size_ISize } from \"../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { icon as icon_1 } from \"../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport * as react from \"react\";\nimport { defaultOf } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { value as value_1 } from \"../fable_modules/fable-library-js.4.24.0/Option.js\";\n\nexport class Actions extends Record {\n constructor(NewNow, NewDate, Edit, View, ViewAll) {\n super();\n this.NewNow = NewNow;\n this.NewDate = NewDate;\n this.Edit = Edit;\n this.View = View;\n this.ViewAll = ViewAll;\n }\n}\n\nexport function Actions_$reflection() {\n return record_type(\"Omnicv.Client.Common.ClientModule.Actions\", [], Actions, () => [[\"NewNow\", option_type(Route_$reflection())], [\"NewDate\", option_type(lambda_type(string_type, Route_$reflection()))], [\"Edit\", option_type(lambda_type(int64_type, Route_$reflection()))], [\"View\", option_type(lambda_type(int64_type, Route_$reflection()))], [\"ViewAll\", option_type(Route_$reflection())]]);\n}\n\nexport class IconType extends Union {\n constructor(Item) {\n super();\n this.tag = 0;\n this.fields = [Item];\n }\n cases() {\n return [\"FontAwesome\"];\n }\n}\n\nexport function IconType_$reflection() {\n return union_type(\"Omnicv.Client.Common.ClientModule.IconType\", [], IconType, () => [[[\"Item\", Fa_IconOption_$reflection()]]]);\n}\n\nexport function IconType__ToIcon(this$) {\n return Fa_i(singleton(this$.fields[0]), []);\n}\n\nexport class ModuleDescriptor extends Record {\n constructor(Icon, View) {\n super();\n this.Icon = Icon;\n this.View = View;\n }\n}\n\nexport function ModuleDescriptor_$reflection() {\n return record_type(\"Omnicv.Client.Common.ClientModule.ModuleDescriptor\", [], ModuleDescriptor, () => [[\"Icon\", IconType_$reflection()], [\"View\", option_type(lambda_type(Session_$reflection(), Route_$reflection()))]]);\n}\n\nexport class EntryDescriptor extends Record {\n constructor(Name, Caption, Details, Icon, Actions, IsFavourite) {\n super();\n this.Name = Name;\n this.Caption = Caption;\n this.Details = Details;\n this.Icon = Icon;\n this.Actions = Actions;\n this.IsFavourite = IsFavourite;\n }\n}\n\nexport function EntryDescriptor_$reflection() {\n return record_type(\"Omnicv.Client.Common.ClientModule.EntryDescriptor\", [], EntryDescriptor, () => [[\"Name\", string_type], [\"Caption\", string_type], [\"Details\", string_type], [\"Icon\", IconType_$reflection()], [\"Actions\", Actions_$reflection()], [\"IsFavourite\", bool_type]]);\n}\n\nexport function EntryDescriptor__GetButton(this$, colour, isDisabled, onClick) {\n let children;\n const children_4 = [(children = [button(ofArray([new Option(0, [colour]), new Option(16, [isDisabled]), new Option(18, [onClick]), new Option(1, [new Size_ISize(2, [])])]), singleton(icon_1(empty(), singleton(IconType__ToIcon(this$.Icon)))))], react.createElement(\"div\", {}, ...children)), react.createElement(\"div\", {\n className: \"button-caption\",\n }, this$.Caption)];\n return react.createElement(\"div\", {\n className: \"button-wrapper\",\n }, ...children_4);\n}\n\nexport function EntryDescriptor__GetNewDateButton(this$, isDisabled, param) {\n const matchValue = this$.Actions.NewDate;\n if (matchValue != null) {\n const route = matchValue;\n return EntryDescriptor__GetButton(this$, new Color_IColor(6, []), isDisabled, (_arg) => {\n Router_modifyLocation(route(param));\n });\n }\n else {\n return defaultOf();\n }\n}\n\nexport function EntryDescriptor__GetNewNowButton_Z1FBCCD16(this$, isDisabled) {\n const matchValue = this$.Actions.NewNow;\n if (matchValue != null) {\n const route = matchValue;\n return EntryDescriptor__GetButton(this$, new Color_IColor(6, []), isDisabled, (_arg) => {\n Router_modifyLocation(route);\n });\n }\n else {\n return defaultOf();\n }\n}\n\nexport function getModuleNewDateButtons(clientModule, isDisabled, param) {\n const children = [list_3(empty(), map((des) => EntryDescriptor__GetNewDateButton(des, isDisabled, param), clientModule.EntryDescriptors()))];\n return react.createElement(\"div\", {\n className: \"block\",\n }, ...children);\n}\n\nexport function getModuleNewNowButtons(clientModule, isDisabled) {\n const children = [list_3(empty(), map((des) => EntryDescriptor__GetNewNowButton_Z1FBCCD16(des, isDisabled), clientModule.EntryDescriptors()))];\n return react.createElement(\"div\", {\n className: \"block\",\n }, ...children);\n}\n\nexport function getModuleViewAllButtons(clientModule, isDisabled) {\n const children = [list_3(empty(), map(value_1, filter((option) => (option != null), map((des) => {\n const matchValue = des.Actions.ViewAll;\n if (matchValue != null) {\n const route = matchValue;\n return EntryDescriptor__GetButton(des, new Color_IColor(5, []), isDisabled, (_arg) => {\n Router_modifyLocation(route);\n });\n }\n else {\n return undefined;\n }\n }, clientModule.EntryDescriptors()))))];\n return react.createElement(\"div\", {\n className: \"block\",\n }, ...children);\n}\n\n","import { Fa_IconOption } from \"../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { EntryDescriptor, Actions, ModuleDescriptor, IconType } from \"../../Omnicv.Client.Common/ClientModule.js\";\nimport { Config_defaultDateForNow, Config_getDefaultDiaryDate } from \"../../Omnicv.Client.Common/Extensions.js\";\nimport { Route } from \"../../Omnicv.Client.Common/Router.js\";\nimport { ofArray } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { DiaryModule_$reflection, DiaryModule } from \"../Omnicv.Diary.Shared/DiaryAPI.js\";\nimport { class_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\n\nexport class DiaryClientModule extends DiaryModule {\n constructor() {\n super();\n }\n Descriptor() {\n return new ModuleDescriptor(new IconType(new Fa_IconOption(11, [\"fas fa-journal-whills\"])), (session) => (new Route(9, [Config_getDefaultDiaryDate(session)])));\n }\n EntryDescriptors() {\n return ofArray([new EntryDescriptor(\"DiaryRecord\", \"Diary\", \"Diary entries\", new IconType(new Fa_IconOption(11, [\"fas fa-journal-whills\"])), new Actions(new Route(10, [Config_defaultDateForNow]), (Item) => (new Route(10, [Item])), (Item_1) => (new Route(11, [Item_1])), undefined, undefined), true), new EntryDescriptor(\"ReviewRecord\", \"Review\", \"Review your experiences\", new IconType(new Fa_IconOption(11, [\"fas fa-star-half-alt\"])), new Actions(new Route(12, [Config_defaultDateForNow]), (Item_2) => (new Route(12, [Item_2])), (Item_3) => (new Route(13, [Item_3])), undefined, undefined), false), new EntryDescriptor(\"InteractionRecord\", \"Interaction\", \"Track your interactions with others\", new IconType(new Fa_IconOption(11, [\"fas fa-phone-alt\"])), new Actions(new Route(14, [Config_defaultDateForNow]), (Item_4) => (new Route(14, [Item_4])), (Item_5) => (new Route(15, [Item_5])), undefined, undefined), false)]);\n }\n}\n\nexport function DiaryClientModule_$reflection() {\n return class_type(\"Omnicv.Client.Diary.DiaryClientModule\", undefined, DiaryClientModule, DiaryModule_$reflection());\n}\n\nexport function DiaryClientModule_$ctor() {\n return new DiaryClientModule();\n}\n\n","import { Fa_IconOption } from \"./fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { EntryDescriptor, Actions, ModuleDescriptor, IconType } from \"./Omnicv.Client.Common/ClientModule.js\";\nimport { Route } from \"./Omnicv.Client.Common/Router.js\";\nimport { ofArray } from \"./fable_modules/fable-library-js.4.24.0/List.js\";\nimport { PhysicalModule_$reflection, PhysicalModule } from \"./Omnicv.Shared/PhysicalAPI.js\";\nimport { class_type } from \"./fable_modules/fable-library-js.4.24.0/Reflection.js\";\n\nexport class PhysicalClientModule extends PhysicalModule {\n constructor() {\n super();\n }\n Descriptor() {\n return new ModuleDescriptor(new IconType(new Fa_IconOption(11, [\"fas fa-ambulance\"])), (_arg) => (new Route(18, [])));\n }\n EntryDescriptors() {\n return ofArray([new EntryDescriptor(\"WeightRecord\", \"Weight\", \"Track your weight\", new IconType(new Fa_IconOption(11, [\"fas fa-balance-scale-left\"])), new Actions(new Route(21, []), undefined, (Item) => (new Route(22, [Item])), undefined, new Route(20, [])), false), new EntryDescriptor(\"BloodPressureRecord\", \"Blood Pressure\", \"Track your blood pressure\", new IconType(new Fa_IconOption(11, [\"fas fa-heartbeat\"])), new Actions(new Route(25, []), undefined, (Item_1) => (new Route(26, [Item_1])), undefined, undefined), false), new EntryDescriptor(\"BodilyFunctionsRecord\", \"Elimination\", \"Track your bodily functions\", new IconType(new Fa_IconOption(11, [\"fas fa-toilet\"])), new Actions(new Route(23, []), undefined, (Item_2) => (new Route(24, [Item_2])), undefined, new Route(19, [])), true), new EntryDescriptor(\"TemperatureRecord\", \"Temperature\", \"Track your temperature\", new IconType(new Fa_IconOption(11, [\"fas fa-temperature-high\"])), new Actions(new Route(27, []), undefined, (Item_3) => (new Route(28, [Item_3])), undefined, undefined), false)]);\n }\n}\n\nexport function PhysicalClientModule_$reflection() {\n return class_type(\"Omnicv.Client.Physical.PhysicalClientModule\", undefined, PhysicalClientModule, PhysicalModule_$reflection());\n}\n\nexport function PhysicalClientModule_$ctor() {\n return new PhysicalClientModule();\n}\n\n","import { Fa_IconOption } from \"./fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { EntryDescriptor, Actions, ModuleDescriptor, IconType } from \"./Omnicv.Client.Common/ClientModule.js\";\nimport { Route } from \"./Omnicv.Client.Common/Router.js\";\nimport { singleton } from \"./fable_modules/fable-library-js.4.24.0/List.js\";\nimport { FinancialModule_$reflection, FinancialModule } from \"./Omnicv.Shared/FinancialAPI.js\";\nimport { class_type } from \"./fable_modules/fable-library-js.4.24.0/Reflection.js\";\n\nexport class FinancialClientModule extends FinancialModule {\n constructor() {\n super();\n }\n Descriptor() {\n return new ModuleDescriptor(new IconType(new Fa_IconOption(11, [\"fas fa-money-bill\"])), (_arg) => (new Route(29, [])));\n }\n EntryDescriptors() {\n return singleton(new EntryDescriptor(\"AssetValueRecord\", \"Asset value\", \"Record the value of your assets\", new IconType(new Fa_IconOption(11, [\"fas fa-balance-scale-left\"])), new Actions(undefined, undefined, undefined, undefined, undefined), false));\n }\n}\n\nexport function FinancialClientModule_$reflection() {\n return class_type(\"Omnicv.Client.Financial.FinancialClientModule\", undefined, FinancialClientModule, FinancialModule_$reflection());\n}\n\nexport function FinancialClientModule_$ctor() {\n return new FinancialClientModule();\n}\n\n","import { Fa_IconOption } from \"./fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { EntryDescriptor, Actions, ModuleDescriptor, IconType } from \"./Omnicv.Client.Common/ClientModule.js\";\nimport { Route } from \"./Omnicv.Client.Common/Router.js\";\nimport { ofArray } from \"./fable_modules/fable-library-js.4.24.0/List.js\";\nimport { FitnessModule_$reflection, FitnessModule } from \"./Omnicv.Shared/FitnessAPI.js\";\nimport { class_type } from \"./fable_modules/fable-library-js.4.24.0/Reflection.js\";\n\nexport class FitnessClientModule extends FitnessModule {\n constructor() {\n super();\n }\n Descriptor() {\n return new ModuleDescriptor(new IconType(new Fa_IconOption(11, [\"fas fa-running\"])), (_arg) => (new Route(32, [])));\n }\n EntryDescriptors() {\n return ofArray([new EntryDescriptor(\"RepsWithWeightRecord\", \"Reps with weight\", \"Record reps of weight lifting exercises\", new IconType(new Fa_IconOption(11, [\"fas fa-dumbbell\"])), new Actions(undefined, undefined, undefined, undefined, undefined), false), new EntryDescriptor(\"RepsWithBodyWeightRecord\", \"Reps with body weight\", \"Record reps of body weight exercises\", new IconType(new Fa_IconOption(11, [\"fas fa-walking\"])), new Actions(undefined, undefined, undefined, undefined, undefined), false), new EntryDescriptor(\"EnduranceRecord\", \"Endurance exercises\", \"Record workouts for endurance exercises\", new IconType(new Fa_IconOption(11, [\"fas fa-swimmer\"])), new Actions(undefined, undefined, undefined, undefined, undefined), false), new EntryDescriptor(\"IntervalsDurationRecord\", \"Interval/HIIT duration exercises\", \"Record workouts for time-based interval/circuit/HIIT exercises\", new IconType(new Fa_IconOption(11, [\"fas fa-stopwatch\"])), new Actions(undefined, undefined, undefined, undefined, undefined), false), new EntryDescriptor(\"IntervalsRepsRecord\", \"Interval/HIIT reps exercises\", \"Record workouts for reps-based interval/circuit/HIIT exercises\", new IconType(new Fa_IconOption(11, [\"fas fa-digital-tachograph\"])), new Actions(undefined, undefined, undefined, undefined, undefined), false), new EntryDescriptor(\"WorkoutRecord\", \"Record a complete workout\", \"Record all exercises for a single workout\", new IconType(new Fa_IconOption(11, [\"fas fa-dumbbell\"])), new Actions(undefined, undefined, undefined, undefined, undefined), false)]);\n }\n}\n\nexport function FitnessClientModule_$reflection() {\n return class_type(\"Omnicv.Client.Fitness.FitnessClientModule\", undefined, FitnessClientModule, FitnessModule_$reflection());\n}\n\nexport function FitnessClientModule_$ctor() {\n return new FitnessClientModule();\n}\n\n","import { Registry$1_$ctor_Z1FA48BC9 } from \"./Omnicv.Shared/ModulesRegistration.js\";\nimport { DiaryClientModule_$ctor } from \"./modules/Omnicv.Diary.Client/DiaryClientModule.js\";\nimport { PhysicalClientModule_$ctor } from \"./PhysicalClientModule.js\";\nimport { FinancialClientModule_$ctor } from \"./FinancialClientModule.js\";\nimport { FitnessClientModule_$ctor } from \"./FitnessClientModule.js\";\nimport { ofArray } from \"./fable_modules/fable-library-js.4.24.0/List.js\";\n\nexport const clientModuleRegistry = Registry$1_$ctor_Z1FA48BC9(ofArray([DiaryClientModule_$ctor(), PhysicalClientModule_$ctor(), FinancialClientModule_$ctor(), FitnessClientModule_$ctor()]));\n\n","import { reverse, empty, cons, fold } from \"../fable-library-js.4.24.0/List.js\";\nimport { toString } from \"../fable-library-js.4.24.0/Types.js\";\nimport { join } from \"../fable-library-js.4.24.0/String.js\";\n\nexport function Helpers_extractClasses(xs) {\n return fold((tupledArg, x) => {\n const classes = tupledArg[0];\n const props = tupledArg[1];\n const matchValue = x;\n if (matchValue[0] === \"className\") {\n return [cons(toString(matchValue[1]), classes), props];\n }\n else {\n return [classes, cons(x, props)];\n }\n }, [empty(), empty()], reverse(xs));\n}\n\nexport function Helpers_combineClasses(cn, xs) {\n const tupledArg = Helpers_extractClasses(xs);\n return cons([\"className\", join(\" \", cons(cn, tupledArg[0]))], tupledArg[1]);\n}\n\n","import { toString, Union } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { union_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { newGuid } from \"../../fable_modules/fable-library-js.4.24.0/Guid.js\";\nimport { createElement } from \"react\";\nimport { createObj } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { Helpers_combineClasses } from \"../../fable_modules/Feliz.Bulma.3.0.0/ElementBuilders.fs.js\";\nimport { ofArray } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { reactApi } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\n\nexport class Class extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Link\", \"Info\", \"Success\", \"Warning\", \"Danger\"];\n }\n}\n\nexport function Class_$reflection() {\n return union_type(\"Omnicv.Client.Components.Notification.Class\", [], Class, () => [[], [], [], [], []]);\n}\n\nexport function Class__get_ToClassName(this$) {\n return \"is-\" + toString(this$).toLocaleLowerCase();\n}\n\nfunction closeById(id) {\n const contentElement = document.getElementById(id);\n contentElement.hidden = true;\n}\n\nexport function closeable(text, notificationClass) {\n let elems;\n let id;\n let copyOfStruct = newGuid();\n id = copyOfStruct;\n return createElement(\"div\", createObj(ofArray([[\"id\", id], [\"className\", \"notification \" + Class__get_ToClassName(notificationClass)], (elems = [createElement(\"button\", createObj(Helpers_combineClasses(\"button\", ofArray([[\"className\", \"delete\"], [\"onClick\", (_arg) => {\n closeById(id);\n }]])))), text], [\"children\", reactApi.Children.toArray(Array.from(elems))])])));\n}\n\n","import { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { union_type, string_type, list_type, class_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\nimport { Common_GenericOptions__AddCaseName_1505, Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection } from \"../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"is-fluid\", \"is-widescreen\", \"is-fullhd\", \"Props\", \"CustomClass\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Container.Option\", [], Option, () => [[], [], [], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", string_type]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate
\n */\nexport function container(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 3:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 4:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 5:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n }, \"container\"), (props_1, children_1) => react.createElement(\"div\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n","import { Common_GenericOptions__AddCaseName_1505, Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions__AddProp_ZCC5A61F, Modifier_IModifier_$reflection, Common_parseOptions, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7 } from \"../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\nimport { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { union_type, lambda_type, unit_type, string_type, list_type, class_type, bool_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\nimport { HTMLAttr, DOMAttr } from \"../../Fable.React.9.4.0/Fable.React.Props.fs.js\";\n\n/**\n * Generate \n */\nexport function menu(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"menu\"), (props, children_1) => react.createElement(\"aside\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function label(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"menu-label\"), (props, children_1) => react.createElement(\"p\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function list(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"menu-list\"), (props, children_1) => react.createElement(\"ul\", keyValueList(props, 1), ...children_1), children);\n}\n\nexport class Item_Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"is-active\", \"Props\", \"CustomClass\", \"OnClick\", \"Href\", \"Modifiers\"];\n }\n}\n\nexport function Item_Option_$reflection() {\n return union_type(\"Fulma.Menu.Item.Option\", [], Item_Option, () => [[[\"Item\", bool_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", string_type]], [[\"Item\", lambda_type(class_type(\"Browser.Types.MouseEvent\", undefined), unit_type)]], [[\"Item\", string_type]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\nfunction Item_generateAnchor(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 3:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new DOMAttr(40, [option.fields[0]]));\n case 4:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(94, [option.fields[0]]));\n case 1:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 2:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 5:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n if (option.fields[0]) {\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n else {\n return result;\n }\n }\n }), (props_1, children_1) => react.createElement(\"a\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n/**\n * Generate \n * You control the `a` element\n */\nexport function Item_li(options, children) {\n const children_1 = [Item_generateAnchor(options, children)];\n return react.createElement(\"li\", {}, ...children_1);\n}\n\n/**\n * Generate \n */\nexport function Item_a(options, children) {\n return Item_generateAnchor(options, children);\n}\n\n","import { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddProps_Z4E55E0BD, Color_ofColor, Common_GenericOptions__AddCaseName_1505, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection, Color_IColor_$reflection, Size_ISize_$reflection } from \"../Common.fs.js\";\nimport { union_type, string_type, list_type, class_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\nimport { some } from \"../../fable-library-js.4.24.0/Option.js\";\nimport { Reflection_getCaseName } from \"../Common.fs.js\";\nimport { cons } from \"../../fable-library-js.4.24.0/List.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Size\", \"Color\", \"is-delete\", \"is-light\", \"Props\", \"CustomClass\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Tag.Option\", [], Option, () => [[[\"Item\", Size_ISize_$reflection()]], [[\"Item\", Color_IColor_$reflection()]], [], [], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", string_type]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate \n */\nexport function tag(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n let matchResult, size, color, props, customClass, modifiers;\n switch (option.tag) {\n case 2:\n case 3: {\n matchResult = 2;\n break;\n }\n case 1: {\n matchResult = 3;\n color = option.fields[0];\n break;\n }\n case 4: {\n matchResult = 4;\n props = option.fields[0];\n break;\n }\n case 5: {\n matchResult = 5;\n customClass = option.fields[0];\n break;\n }\n case 6: {\n matchResult = 6;\n modifiers = option.fields[0];\n break;\n }\n default:\n if (option.fields[0].tag === 0) {\n matchResult = 0;\n }\n else {\n matchResult = 1;\n size = option.fields[0];\n }\n }\n switch (matchResult) {\n case 0: {\n console.warn(some(\"`is-small` is not a valid size for the tag element\"));\n return result;\n }\n case 1:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Reflection_getCaseName(size));\n case 2:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n case 3:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Color_ofColor(color));\n case 4:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, props);\n case 5:\n return Common_GenericOptions__AddClass_Z721C83C5(result, customClass);\n default:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, modifiers);\n }\n }, \"tag\"), (props_1, children_1) => react.createElement(\"span\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function delete$(options, children) {\n return tag(cons(new Option(2, []), options), children);\n}\n\nexport class List_Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"has-addons\", \"is-centered\", \"is-right\", \"are-small\", \"are-medium\", \"are-large\", \"Props\", \"CustomClass\", \"Modifiers\"];\n }\n}\n\nexport function List_Option_$reflection() {\n return union_type(\"Fulma.Tag.List.Option\", [], List_Option, () => [[], [], [], [], [], [], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", string_type]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate
\n */\nexport function list(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 6:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 7:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 8:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n }, \"tags\"), (props_1, children_1) => react.createElement(\"div\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n","import { Union } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { union_type, lambda_type, unit_type, float64_type, bool_type, int32_type, string_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { keyValueList } from \"../../fable_modules/fable-library-js.4.24.0/MapUtil.js\";\nimport * as react from \"react\";\nimport react_rating_stars_component from \"react-rating-stars-component\";\n\nexport class RatingStarsProps extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"ActiveColor\", \"Count\", \"Edit\", \"IsHalf\", \"Size\", \"Value\", \"OnChange\"];\n }\n}\n\nexport function RatingStarsProps_$reflection() {\n return union_type(\"Omnicv.Client.Components.RatingStars.RatingStarsProps\", [], RatingStarsProps, () => [[[\"Item\", string_type]], [[\"Item\", int32_type]], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [[\"Item\", int32_type]], [[\"Item\", float64_type]], [[\"Item\", lambda_type(float64_type, unit_type)]]]);\n}\n\nexport function ratingStars(props) {\n const props_1 = keyValueList(props, 1);\n return react.createElement(react_rating_stars_component, props_1);\n}\n\n","import { Common_GenericOptions__AddCaseName_1505, Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions__AddProps_Z4E55E0BD, Modifier_IModifier_$reflection, Common_parseOptions, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7 } from \"../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\nimport { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { union_type, string_type, list_type, class_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\n\n/**\n * Generate
\n */\nexport function card(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"card\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function header(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"card-header\"), (props, children_1) => react.createElement(\"header\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate
\n */\nexport function content(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"card-content\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function footer(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"card-footer\"), (props, children_1) => react.createElement(\"footer\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate
\n */\nexport function image(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"card-image\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\nexport class Header_Title_Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"is-centered\", \"Props\", \"CustomClass\", \"Modifiers\"];\n }\n}\n\nexport function Header_Title_Option_$reflection() {\n return union_type(\"Fulma.Card.Header.Title.Option\", [], Header_Title_Option, () => [[], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", string_type]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate \n */\nexport function Header_icon(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"card-header-icon\"), (props, children_1) => react.createElement(\"a\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function Header_title(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 1:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 2:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 3:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n }, \"card-header-title\"), (props_1, children_1) => react.createElement(\"p\", keyValueList(props_1, 1), ...children_1), children);\n}\n\nexport function Footer_itemView(element, options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"card-footer-item\"), element, children);\n}\n\n/**\n * Generate \n */\nexport function Footer_div(x, y) {\n return Footer_itemView((props, children) => react.createElement(\"div\", keyValueList(props, 1), ...children), x, y);\n}\n\n/**\n * Generate \n */\nexport function Footer_p(x, y) {\n return Footer_itemView((props, children) => react.createElement(\"p\", keyValueList(props, 1), ...children), x, y);\n}\n\n/**\n * Generate \n */\nexport function Footer_a(x, y) {\n return Footer_itemView((props, children) => react.createElement(\"a\", keyValueList(props, 1), ...children), x, y);\n}\n\n","import { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { Common_GenericOptions__AddCaseName_1505, Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection, Size_ISize_$reflection } from \"../Common.fs.js\";\nimport { union_type, list_type, class_type, string_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\nimport { Reflection_getCaseName } from \"../Common.fs.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Size\", \"CustomClass\", \"Props\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Content.Option\", [], Option, () => [[[\"Item\", Size_ISize_$reflection()]], [[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate
\n */\nexport function content(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 2:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 1:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 3:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Reflection_getCaseName(option.fields[0]));\n }\n }, \"content\"), (props_1, children_1) => react.createElement(\"div\", keyValueList(props_1, 1), ...children_1), children);\n}\n\nexport class Ol_Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"is-lower-roman\", \"is-upper-roman\", \"is-lower-alpha\", \"is-upper-alpha\", \"CustomClass\", \"Modifiers\", \"Props\"];\n }\n}\n\nexport function Ol_Option_$reflection() {\n return union_type(\"Fulma.Content.Ol.Option\", [], Ol_Option, () => [[], [], [], [], [[\"Item\", string_type]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]]]);\n}\n\n/**\n * Generate \n */\nexport function Ol_ol(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 6:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 4:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 5:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n }), (props_1, children_1) => react.createElement(\"ol\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n","import { Record } from \"../fable-library-js.4.24.0/Types.js\";\nimport { record_type, int32_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { maxBy, minBy } from \"../fable-library-js.4.24.0/List.js\";\nimport { compareArrays } from \"../fable-library-js.4.24.0/Util.js\";\n\nexport class MarkdownRange extends Record {\n constructor(StartLine, StartColumn, EndLine, EndColumn) {\n super();\n this.StartLine = (StartLine | 0);\n this.StartColumn = (StartColumn | 0);\n this.EndLine = (EndLine | 0);\n this.EndColumn = (EndColumn | 0);\n }\n}\n\nexport function MarkdownRange_$reflection() {\n return record_type(\"Fable.Formatting.Markdown.MarkdownRange\", [], MarkdownRange, () => [[\"StartLine\", int32_type], [\"StartColumn\", int32_type], [\"EndLine\", int32_type], [\"EndColumn\", int32_type]]);\n}\n\nexport const MarkdownRangeModule_zero = new MarkdownRange(0, 0, 0, 0);\n\nexport function MarkdownRangeModule_mergeRanges(ranges) {\n const startRange = minBy((r) => [r.StartLine, r.StartColumn], ranges, {\n Compare: compareArrays,\n });\n const endRange = maxBy((r_1) => [r_1.EndLine, r_1.EndColumn], ranges, {\n Compare: compareArrays,\n });\n return new MarkdownRange(startRange.StartLine, startRange.StartColumn, endRange.EndLine, endRange.EndColumn);\n}\n\n","import { ofSeq, empty, tail as tail_6, head, isEmpty, reverse, cons } from \"../fable-library-js.4.24.0/List.js\";\nimport { compare, equals } from \"../fable-library-js.4.24.0/Util.js\";\nimport { singleton, map, append, empty as empty_1, delay } from \"../fable-library-js.4.24.0/Seq.js\";\nimport { Union } from \"../fable-library-js.4.24.0/Types.js\";\nimport { union_type, list_type } from \"../fable-library-js.4.24.0/Reflection.js\";\n\n/**\n * Partitions list into an initial sequence (while the\n * specified predicate returns true) and a rest of the list.\n */\nexport function List_partitionWhile(p, input) {\n const loop = (acc_mut, _arg_mut) => {\n loop:\n while (true) {\n const acc = acc_mut, _arg = _arg_mut;\n let matchResult, hd_1, tl_1, rest;\n if (!isEmpty(_arg)) {\n if (p(head(_arg))) {\n matchResult = 0;\n hd_1 = head(_arg);\n tl_1 = tail_6(_arg);\n }\n else {\n matchResult = 1;\n rest = _arg;\n }\n }\n else {\n matchResult = 1;\n rest = _arg;\n }\n switch (matchResult) {\n case 0: {\n acc_mut = cons(hd_1, acc);\n _arg_mut = tl_1;\n continue loop;\n }\n default:\n return [reverse(acc), rest];\n }\n break;\n }\n };\n return loop(empty(), input);\n}\n\n/**\n * Partitions list into an initial sequence (while the specified predicate\n * returns true) and a rest of the list. The predicate gets the entire\n * tail of the list and can perform lookahead.\n */\nexport function List_partitionWhileLookahead(p, input) {\n const loop = (acc_mut, _arg_mut) => {\n loop:\n while (true) {\n const acc = acc_mut, _arg = _arg_mut;\n let matchResult, hd_1, tl_1, rest;\n if (!isEmpty(_arg)) {\n if (p(cons(head(_arg), tail_6(_arg)))) {\n matchResult = 0;\n hd_1 = head(_arg);\n tl_1 = tail_6(_arg);\n }\n else {\n matchResult = 1;\n rest = _arg;\n }\n }\n else {\n matchResult = 1;\n rest = _arg;\n }\n switch (matchResult) {\n case 0: {\n acc_mut = cons(hd_1, acc);\n _arg_mut = tl_1;\n continue loop;\n }\n default:\n return [reverse(acc), rest];\n }\n break;\n }\n };\n return loop(empty(), input);\n}\n\n/**\n * Partitions list into an initial sequence (while the\n * specified predicate returns 'false') and a rest of the list.\n */\nexport function List_partitionUntil(p, input) {\n return List_partitionWhile((arg) => !p(arg), input);\n}\n\n/**\n * Partitions list into an initial sequence (while the\n * specified predicate returns 'false') and a rest of the list.\n */\nexport function List_partitionUntilLookahead(p, input) {\n return List_partitionWhileLookahead((arg) => !p(arg), input);\n}\n\n/**\n * Iterates over the elements of the list and calls the first function for\n * every element. Between each two elements, the second function is called.\n */\nexport function List_iterInterleaved(f_mut, g_mut, input_mut) {\n List_iterInterleaved:\n while (true) {\n const f = f_mut, g = g_mut, input = input_mut;\n if (isEmpty(input)) {\n }\n else if (isEmpty(tail_6(input))) {\n f(head(input));\n }\n else {\n f(head(input));\n g();\n f_mut = f;\n g_mut = g;\n input_mut = cons(head(tail_6(input)), tail_6(tail_6(input)));\n continue List_iterInterleaved;\n }\n break;\n }\n}\n\n/**\n * Partitions the input list into two parts - the break is added\n * at a point where the list starts with the specified sub-list.\n */\nexport function List_partitionUntilEquals(endl, input) {\n const loop = (acc_mut, _arg_mut) => {\n let loop_1;\n loop:\n while (true) {\n const acc = acc_mut, _arg = _arg_mut;\n if ((loop_1 = ((start_1_mut, list_1_mut) => {\n loop_1:\n while (true) {\n const start_1 = start_1_mut, list_1 = list_1_mut;\n let matchResult, x_1, xs_1, y_1, ys_1;\n if (isEmpty(start_1)) {\n matchResult = 1;\n }\n else if (!isEmpty(list_1)) {\n if (equals(head(start_1), head(list_1))) {\n matchResult = 0;\n x_1 = head(start_1);\n xs_1 = tail_6(start_1);\n y_1 = head(list_1);\n ys_1 = tail_6(list_1);\n }\n else {\n matchResult = 2;\n }\n }\n else {\n matchResult = 2;\n }\n switch (matchResult) {\n case 0: {\n start_1_mut = xs_1;\n list_1_mut = ys_1;\n continue loop_1;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_1(endl, _arg))) {\n return [reverse(acc), _arg];\n }\n else if (isEmpty(_arg)) {\n return undefined;\n }\n else {\n acc_mut = cons(head(_arg), acc);\n _arg_mut = tail_6(_arg);\n continue loop;\n }\n break;\n }\n };\n return loop(empty(), input);\n}\n\n/**\n * A function that nests items of the input sequence\n * that do not match a specified predicate under the\n * last item that matches the predicate.\n */\nexport function List_nestUnderLastMatching(f, input) {\n const loop = (input_1) => delay(() => {\n const patternInput = List_partitionUntil(f, input_1);\n const other = patternInput[1];\n const matchValue = reverse(patternInput[0]);\n if (isEmpty(matchValue)) {\n if (equals(other, empty())) {\n return empty_1();\n }\n else {\n throw new Error(\"Should start with true\\\\nParameter name: \");\n return empty_1();\n }\n }\n else {\n return append(map((p) => [p, empty()], reverse(tail_6(matchValue))), delay(() => {\n const patternInput_1 = List_partitionUntil((arg) => !f(arg), other);\n return append(singleton([head(matchValue), patternInput_1[0]]), delay(() => loop(patternInput_1[1])));\n }));\n }\n });\n return ofSeq(loop(input));\n}\n\nexport class Tree$1 extends Union {\n constructor(Item1, Item2) {\n super();\n this.tag = 0;\n this.fields = [Item1, Item2];\n }\n cases() {\n return [\"Node\"];\n }\n}\n\nexport function Tree$1_$reflection(gen0) {\n return union_type(\"Fable.Formatting.Collections.Tree`1\", [gen0], Tree$1, () => [[[\"Item1\", gen0], [\"Item2\", list_type(Tree$1_$reflection(gen0))]]]);\n}\n\nfunction Tree_takeAtLevel(indent, tail) {\n let matchResult, i_1, tail_2, value_1, tail_5;\n if (!isEmpty(tail)) {\n if (compare(head(tail)[0], indent) >= 0) {\n matchResult = 0;\n i_1 = head(tail)[0];\n tail_2 = tail_6(tail);\n value_1 = head(tail)[1];\n }\n else {\n matchResult = 1;\n tail_5 = tail;\n }\n }\n else {\n matchResult = 1;\n tail_5 = tail;\n }\n switch (matchResult) {\n case 0: {\n const patternInput = Tree_takeDeeperThan(i_1, tail_2);\n const patternInput_1 = Tree_takeAtLevel(indent, patternInput[1]);\n return [cons(new Tree$1(value_1, patternInput[0]), patternInput_1[0]), patternInput_1[1]];\n }\n default:\n return [empty(), tail_5];\n }\n}\n\nfunction Tree_takeDeeperThan(indent, tail) {\n let matchResult, i_1, tail_2, value_1, tail_5;\n if (!isEmpty(tail)) {\n if (compare(head(tail)[0], indent) > 0) {\n matchResult = 0;\n i_1 = head(tail)[0];\n tail_2 = tail_6(tail);\n value_1 = head(tail)[1];\n }\n else {\n matchResult = 1;\n tail_5 = tail;\n }\n }\n else {\n matchResult = 1;\n tail_5 = tail;\n }\n switch (matchResult) {\n case 0: {\n const patternInput = Tree_takeDeeperThan(i_1, tail_2);\n const patternInput_1 = Tree_takeAtLevel(i_1, patternInput[1]);\n return [cons(new Tree$1(value_1, patternInput[0]), patternInput_1[0]), patternInput_1[1]];\n }\n default:\n return [empty(), tail_5];\n }\n}\n\n/**\n * Turns a list of items with an indentation specified by an integer\n * into a tree where indented items are children.\n */\nexport function Tree_ofIndentedList(input) {\n const patternInput = Tree_takeAtLevel(0, input);\n if (!equals(patternInput[1], empty())) {\n throw new Error(\"Wrong indentation\");\n }\n return patternInput[0];\n}\n\n","import { split, replace, trimStart, trimEnd, substring, isNullOrWhiteSpace } from \"../fable-library-js.4.24.0/String.js\";\nimport { some } from \"../fable-library-js.4.24.0/Option.js\";\nimport { takeWhile as takeWhile_1, skipWhile, toArray, empty, reverse, cons, map as map_1, ofArray, tail, head, isEmpty } from \"../fable-library-js.4.24.0/List.js\";\nimport { forAll, empty as empty_1, singleton, collect, delay, toList, windowed, exists, min, isEmpty as isEmpty_1, filter, takeWhile, length, map } from \"../fable-library-js.4.24.0/Seq.js\";\nimport { isLetter, isWhiteSpace } from \"../fable-library-js.4.24.0/Char.js\";\nimport { defaultOf, equals, comparePrimitives } from \"../fable-library-js.4.24.0/Util.js\";\nimport { MarkdownRange } from \"./Range.fs.js\";\nimport { List_partitionWhile } from \"./Collections.fs.js\";\nimport { item } from \"../fable-library-js.4.24.0/Array.js\";\nimport { tryGetValue } from \"../fable-library-js.4.24.0/MapUtil.js\";\nimport { FSharpRef } from \"../fable-library-js.4.24.0/Types.js\";\n\nexport function Log_warn(s) {\n console.log(s);\n}\n\n/**\n * Matches when a string is a whitespace or null\n */\nexport function String_$007CWhiteSpace$007C_$007C(s) {\n if (isNullOrWhiteSpace(s)) {\n return some(undefined);\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Returns a string trimmed from both start and end\n */\nexport function String_$007CTrimBoth$007C(text) {\n return text.trim();\n}\n\n/**\n * Matches when a string starts with the specified sub-string\n */\nexport function String_$007CStartsWith$007C_$007C(start, text) {\n if (text.startsWith(start)) {\n return substring(text, start.length);\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Matches when a string starts with the specified sub-string\n * The matched string is trimmed from all whitespace.\n */\nexport function String_$007CStartsWithTrim$007C_$007C(start, text) {\n if (text.startsWith(start)) {\n return substring(text, start.length).trim();\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Matches when a string starts with the given value and ends\n * with a given value (and returns the rest of it)\n */\nexport function String_$007CStartsAndEndsWith$007C_$007C(starts, ends, s) {\n if ((s.startsWith(starts) && s.endsWith(ends)) && (s.length >= (starts.length + ends.length))) {\n return substring(s, starts.length, (s.length - starts.length) - ends.length);\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Matches when a string starts with the given value and ends\n * with a given value (and returns trimmed body)\n */\nexport function String_$007CStartsAndEndsWithTrim$007C_$007C(args_, args__1, _arg) {\n let activePatternResult;\n const tupledArg = [args_, args__1];\n activePatternResult = String_$007CStartsAndEndsWith$007C_$007C(tupledArg[0], tupledArg[1], _arg);\n if (activePatternResult != null) {\n const activePatternResult_1 = String_$007CTrimBoth$007C(activePatternResult);\n return activePatternResult_1;\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Matches when a string starts with a sub-string wrapped using the\n * opening and closing sub-string specified in the parameter.\n * For example \"[aa]bc\" is wrapped in [ and ] pair. Returns the wrapped\n * text together with the rest.\n */\nexport function String_$007CStartsWithWrapped$007C_$007C(starts, ends, text) {\n if (text.startsWith(starts)) {\n const id = text.indexOf(ends, starts.length) | 0;\n if (id >= 0) {\n return [substring(text, starts.length, id - starts.length), substring(text, id + ends.length, (text.length - id) - ends.length)];\n }\n else {\n return undefined;\n }\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Ignores everything until a end-line character is detected, returns the remaining string.\n */\nexport function String_$007CSkipSingleLine$007C(text) {\n const tryEol = (eolList_mut) => {\n tryEol:\n while (true) {\n const eolList = eolList_mut;\n if (!isEmpty(eolList)) {\n const h = head(eolList);\n const matchValue = text.indexOf(h) | 0;\n if (matchValue < 0) {\n eolList_mut = tail(eolList);\n continue tryEol;\n }\n else {\n return substring(text, matchValue + h.length);\n }\n }\n else {\n return text;\n }\n break;\n }\n };\n const result = tryEol(ofArray([\"\\r\\n\", \"\\n\"]));\n const skipped = substring(text, 0, text.length - result.length);\n if (!isNullOrWhiteSpace(skipped)) {\n Log_warn(`skipped '${skipped}' which contains non-whitespace character!`);\n }\n if (result === text) {\n Log_warn(`could not skip a line of ${text}, because no line-ending character was found!`);\n }\n return result;\n}\n\n/**\n * Given a list of lines indented with certan number of whitespace\n * characters (spaces), remove the spaces from the beginning of each line\n * and return the string as a list of lines\n */\nexport function String_removeSpaces(lines) {\n let spaces;\n const xs = map((line) => length(takeWhile(isWhiteSpace, line.split(\"\"))), filter((arg) => !isNullOrWhiteSpace(arg), lines));\n spaces = (isEmpty_1(xs) ? 0 : min(xs, {\n Compare: comparePrimitives,\n }));\n return map_1((line_1) => {\n if (isNullOrWhiteSpace(line_1)) {\n return \"\";\n }\n else {\n return substring(line_1, spaces);\n }\n }, lines);\n}\n\n/**\n * Matches when a string is a whitespace or null\n */\nexport function StringPosition_$007CWhiteSpace$007C_$007C(s, _n) {\n if (isNullOrWhiteSpace(s)) {\n return some(undefined);\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Matches when a string does starts with non-whitespace\n */\nexport function StringPosition_$007CUnindented$007C_$007C(s, _n) {\n if (!isNullOrWhiteSpace(s) && (s.trimStart() === s)) {\n return some(undefined);\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Returns a string trimmed from both start and end\n */\nexport function StringPosition_$007CTrimBoth$007C(text, n) {\n let inputRecord;\n const trimmedStart = text.trimStart();\n const trimmed = trimmedStart.trimEnd();\n return [trimmed, (inputRecord = n, new MarkdownRange(inputRecord.StartLine, (n.StartColumn + text.length) - trimmedStart.length, inputRecord.EndLine, (n.EndColumn - trimmedStart.length) + trimmed.length))];\n}\n\n/**\n * Returns a string trimmed from the end\n */\nexport function StringPosition_$007CTrimEnd$007C(text, n) {\n let inputRecord;\n const trimmed = text.trimEnd();\n return [trimmed, (inputRecord = n, new MarkdownRange(inputRecord.StartLine, inputRecord.StartColumn, inputRecord.EndLine, (n.EndColumn - text.length) + trimmed.length))];\n}\n\n/**\n * Returns a string trimmed from the start\n */\nexport function StringPosition_$007CTrimStart$007C(text, n) {\n let inputRecord;\n const trimmed = text.trimStart();\n return [trimmed, (inputRecord = n, new MarkdownRange(inputRecord.StartLine, (n.StartColumn + text.length) - trimmed.length, inputRecord.EndLine, inputRecord.EndColumn))];\n}\n\n/**\n * Returns a string trimmed from the end using characters given as a parameter\n */\nexport function StringPosition_$007CTrimEndUsing$007C(chars, text, n) {\n let inputRecord;\n const trimmed = trimEnd(text, ...Array.from(chars));\n return [trimmed, (inputRecord = n, new MarkdownRange(inputRecord.StartLine, inputRecord.StartColumn, inputRecord.EndLine, (n.EndColumn - text.length) + trimmed.length))];\n}\n\n/**\n * Returns a string trimmed from the start together with\n * the number of skipped whitespace characters\n */\nexport function StringPosition_$007CTrimStartAndCount$007C(text, n) {\n let inputRecord;\n const trimmed = trimStart(text, \" \", \"\\t\");\n const len = (text.length - trimmed.length) | 0;\n return [len, replace(substring(text, 0, len), \"\\t\", \" \").length, [trimmed, (inputRecord = n, new MarkdownRange(inputRecord.StartLine, (n.StartColumn + text.length) - trimmed.length, inputRecord.EndLine, inputRecord.EndColumn))]];\n}\n\n/**\n * Matches when a string starts with any of the specified sub-strings\n */\nexport function StringPosition_$007CStartsWithAny$007C_$007C(starts, text, _n) {\n if (exists((value) => text.startsWith(value), starts)) {\n return some(undefined);\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Matches when a string starts with the specified sub-string\n */\nexport function StringPosition_$007CStartsWith$007C_$007C(start, text, n) {\n let inputRecord;\n if (text.startsWith(start)) {\n return [substring(text, start.length), (inputRecord = n, new MarkdownRange(inputRecord.StartLine, (n.StartColumn + text.length) - start.length, inputRecord.EndLine, inputRecord.EndColumn))];\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Matches when a string starts with the specified sub-string\n * The matched string is trimmed from all whitespace.\n */\nexport function StringPosition_$007CStartsWithTrim$007C_$007C(start, text, n) {\n let inputRecord;\n if (text.startsWith(start)) {\n return [substring(text, start.length).trim(), (inputRecord = n, new MarkdownRange(inputRecord.StartLine, (n.StartColumn + text.length) - start.length, inputRecord.EndLine, inputRecord.EndColumn))];\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Matches when a string starts with the specified sub-string (ignoring whitespace at the start)\n * The matched string is trimmed from all whitespace.\n */\nexport function StringPosition_$007CStartsWithNTimesTrimIgnoreStartWhitespace$007C_$007C(start, text, _n) {\n if (text.indexOf(start) >= 0) {\n const beforeStart = substring(text, 0, text.indexOf(start));\n if (isNullOrWhiteSpace(beforeStart)) {\n const startAndRest = substring(text, beforeStart.length);\n const startNum = length(takeWhile((y) => (start === y), map((chars) => (chars.join('')), windowed(start.length, startAndRest.split(\"\"))))) | 0;\n return [startNum, beforeStart.length, substring(text, beforeStart.length + (start.length * startNum)).trim()];\n }\n else {\n return undefined;\n }\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Matches when a string starts with the given value and ends\n * with a given value (and returns the rest of it)\n */\nexport function StringPosition_$007CStartsAndEndsWith$007C_$007C(starts, ends, s, n) {\n let inputRecord;\n if ((s.startsWith(starts) && s.endsWith(ends)) && (s.length >= (starts.length + ends.length))) {\n return [substring(s, starts.length, (s.length - starts.length) - ends.length), (inputRecord = n, new MarkdownRange(inputRecord.StartLine, (n.StartColumn + s.length) - starts.length, inputRecord.EndLine, (n.EndColumn - s.length) + ends.length))];\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Matches when a string starts with the given value and ends\n * with a given value (and returns trimmed body)\n */\nexport function StringPosition_$007CStartsAndEndsWithTrim$007C_$007C(args_, args__1, _arg1_, _arg1__1) {\n const _arg = [_arg1_, _arg1__1];\n let activePatternResult;\n const tupledArg = [args_, args__1];\n activePatternResult = StringPosition_$007CStartsAndEndsWith$007C_$007C(tupledArg[0], tupledArg[1], _arg[0], _arg[1]);\n if (activePatternResult != null) {\n let activePatternResult_1;\n const tupledArg_1 = activePatternResult;\n activePatternResult_1 = StringPosition_$007CTrimBoth$007C(tupledArg_1[0], tupledArg_1[1]);\n return activePatternResult_1;\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Matches when a string starts with a non-zero number of complete\n * repetitions of the specified parameter (and returns the number\n * of repetitions, together with the rest of the string)\n * \n * let (StartsWithRepeated \"/\\\" (2, \" abc\")) = \"/\\/\\ abc\"\n */\nexport function StringPosition_$007CStartsWithRepeated$007C_$007C(repeated, text, ln) {\n let inputRecord;\n const loop = (i_mut) => {\n loop:\n while (true) {\n const i = i_mut;\n if (i === text.length) {\n return i | 0;\n }\n else if (text[i] !== repeated[i % repeated.length]) {\n return i | 0;\n }\n else {\n i_mut = (i + 1);\n continue loop;\n }\n break;\n }\n };\n const n = loop(0) | 0;\n if ((n === 0) ? true : ((n % repeated.length) !== 0)) {\n return undefined;\n }\n else {\n return [~~(n / repeated.length), [substring(text, n, text.length - n), (inputRecord = ln, new MarkdownRange(inputRecord.StartLine, n, inputRecord.EndLine, inputRecord.EndColumn))]];\n }\n}\n\n/**\n * Matches when a string starts with a sub-string wrapped using the\n * opening and closing sub-string specified in the parameter.\n * For example \"[aa]bc\" is wrapped in [ and ] pair. Returns the wrapped\n * text together with the rest.\n */\nexport function StringPosition_$007CStartsWithWrapped$007C_$007C(starts, ends, text, n) {\n let inputRecord;\n if (text.startsWith(starts)) {\n const id = text.indexOf(ends, starts.length) | 0;\n if (id >= 0) {\n return [substring(text, starts.length, id - starts.length), [substring(text, id + ends.length, (text.length - id) - ends.length), (inputRecord = n, new MarkdownRange(inputRecord.StartLine, id + ends.length, inputRecord.EndLine, inputRecord.EndColumn))]];\n }\n else {\n return undefined;\n }\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Matches when a string consists of some number of\n * complete repetitions of a specified sub-string.\n */\nexport function StringPosition_$007CEqualsRepeated$007C_$007C(repeated, _n, _arg1_, _arg1__1) {\n const _arg = [_arg1_, _arg1__1];\n let matchResult, _n_1;\n const activePatternResult = StringPosition_$007CStartsWithRepeated$007C_$007C(repeated, _arg[0], _arg[1]);\n if (activePatternResult != null) {\n if (activePatternResult[1][0] === \"\") {\n matchResult = 0;\n _n_1 = activePatternResult[0];\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return some(undefined);\n default:\n return undefined;\n }\n}\n\n/**\n * Matches a list if it starts with a bracketed list. Nested brackets\n * are skipped (by counting opening and closing brackets) and can be\n * escaped using the '\\' symbol.\n */\nexport function List_$007CBracketDelimited$007C_$007C(startc, endc, input) {\n const loop = (acc_mut, count_mut, _arg_mut) => {\n loop:\n while (true) {\n const acc = acc_mut, count = count_mut, _arg = _arg_mut;\n let matchResult, x_10, xs_10, x_11, xs_11, x_12, xs_12, x_13, xs_13, x_14, xs_14;\n if (isEmpty(_arg)) {\n matchResult = 5;\n }\n else if (head(_arg) === \"\\\\\") {\n if (!isEmpty(tail(_arg))) {\n if (head(tail(_arg)) === endc) {\n matchResult = 0;\n x_10 = head(tail(_arg));\n xs_10 = tail(tail(_arg));\n }\n else if ((head(_arg) === endc) && (count === 0)) {\n matchResult = 1;\n x_11 = head(_arg);\n xs_11 = tail(_arg);\n }\n else if (head(_arg) === endc) {\n matchResult = 2;\n x_12 = head(_arg);\n xs_12 = tail(_arg);\n }\n else if (head(_arg) === startc) {\n matchResult = 3;\n x_13 = head(_arg);\n xs_13 = tail(_arg);\n }\n else {\n matchResult = 4;\n x_14 = head(_arg);\n xs_14 = tail(_arg);\n }\n }\n else if ((head(_arg) === endc) && (count === 0)) {\n matchResult = 1;\n x_11 = head(_arg);\n xs_11 = tail(_arg);\n }\n else if (head(_arg) === endc) {\n matchResult = 2;\n x_12 = head(_arg);\n xs_12 = tail(_arg);\n }\n else if (head(_arg) === startc) {\n matchResult = 3;\n x_13 = head(_arg);\n xs_13 = tail(_arg);\n }\n else {\n matchResult = 4;\n x_14 = head(_arg);\n xs_14 = tail(_arg);\n }\n }\n else if ((head(_arg) === endc) && (count === 0)) {\n matchResult = 1;\n x_11 = head(_arg);\n xs_11 = tail(_arg);\n }\n else if (head(_arg) === endc) {\n matchResult = 2;\n x_12 = head(_arg);\n xs_12 = tail(_arg);\n }\n else if (head(_arg) === startc) {\n matchResult = 3;\n x_13 = head(_arg);\n xs_13 = tail(_arg);\n }\n else {\n matchResult = 4;\n x_14 = head(_arg);\n xs_14 = tail(_arg);\n }\n switch (matchResult) {\n case 0: {\n acc_mut = cons(x_10, acc);\n count_mut = count;\n _arg_mut = xs_10;\n continue loop;\n }\n case 1:\n return [reverse(acc), xs_11];\n case 2: {\n acc_mut = cons(x_12, acc);\n count_mut = (count - 1);\n _arg_mut = xs_12;\n continue loop;\n }\n case 3: {\n acc_mut = cons(x_13, acc);\n count_mut = (count + 1);\n _arg_mut = xs_13;\n continue loop;\n }\n case 4: {\n acc_mut = cons(x_14, acc);\n count_mut = count;\n _arg_mut = xs_14;\n continue loop;\n }\n default:\n return undefined;\n }\n break;\n }\n };\n let matchResult_1, x_16, xs_16;\n if (!isEmpty(input)) {\n if (head(input) === startc) {\n matchResult_1 = 0;\n x_16 = head(input);\n xs_16 = tail(input);\n }\n else {\n matchResult_1 = 1;\n }\n }\n else {\n matchResult_1 = 1;\n }\n switch (matchResult_1) {\n case 0:\n return loop(empty(), 0, xs_16);\n default:\n return undefined;\n }\n}\n\n/**\n * Returns a list of characters as a string.\n */\nexport function List_$007CAsString$007C(chars) {\n return toArray(chars).join('');\n}\n\n/**\n * Removes blank lines from the start and the end of a list\n */\nexport function Lines_$007CTrimBlank$007C(lines) {\n return reverse(skipWhile((tupledArg_1) => isNullOrWhiteSpace(tupledArg_1[0]), reverse(skipWhile((tupledArg) => isNullOrWhiteSpace(tupledArg[0]), lines))));\n}\n\n/**\n * Matches when there are some lines at the beginning that are\n * either empty (or whitespace) or start with the specified string.\n * Returns all such lines from the beginning until a different line.\n */\nexport function Lines_$007CTakeStartingWithOrBlank$007C_$007C(start, input) {\n const matchValue = List_partitionWhile((s) => {\n if (isNullOrWhiteSpace(s)) {\n return true;\n }\n else {\n return s.startsWith(start);\n }\n }, input);\n if (!equals(matchValue[0], empty())) {\n return [matchValue[0], matchValue[1]];\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Matches when there are some lines at the beginning that are\n * either empty (or whitespace) or start with at least 4 spaces (a tab counts as 4 spaces here).\n * Returns all such lines from the beginning until a different line and\n * the number of spaces the first line started with.\n */\nexport function Lines_$007CTakeCodeBlock$007C_$007C(input) {\n const matchValue = List_partitionWhile((tupledArg) => {\n const s_1 = tupledArg[0];\n if (isNullOrWhiteSpace(s_1)) {\n return true;\n }\n else {\n const normalized = replace(s_1, \"\\t\", \" \");\n return (normalized.length >= 4) && (substring(normalized, 0, 4) === (Array(4 + 1).join(\" \")));\n }\n }, input);\n if (!equals(matchValue[0], empty()) && (4 >= 4)) {\n return [4, matchValue[0], matchValue[1]];\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Removes whitespace lines from the beginning of the list\n */\nexport function Lines_$007CTrimBlankStart$007C(lines) {\n return [takeWhile_1((tupledArg) => isNullOrWhiteSpace(tupledArg[0]), lines), skipWhile((tupledArg_1) => isNullOrWhiteSpace(tupledArg_1[0]), lines)];\n}\n\n/**\n * Trims all lines of the current paragraph\n */\nexport function Lines_$007CTrimParagraphLines$007C(lines) {\n return map_1((tupledArg_1) => {\n let inputRecord;\n const s = tupledArg_1[0];\n const n_1 = tupledArg_1[1];\n const endsWithTwoSpaces = s.endsWith(\" \");\n const trimmed = trimEnd(s, \" \") + (endsWithTwoSpaces ? \" \" : \"\");\n return [trimmed, (inputRecord = n_1, new MarkdownRange(inputRecord.StartLine, inputRecord.StartColumn, inputRecord.EndLine, (n_1.EndColumn - s.length) + trimmed.length))];\n }, map_1((tupledArg) => StringPosition_$007CTrimStart$007C(tupledArg[0], tupledArg[1]), lines));\n}\n\n/**\n * Parameterized pattern that assigns the specified value to the\n * first component of a tuple. Usage:\n * \n * match str with\n * | Let 1 (n, \"one\") | Let 2 (n, \"two\") -> n\n */\nexport function $007CLet$007C(a, b) {\n return [a, b];\n}\n\n/**\n * Utility for parsing commands. Commands can be used in different places. We\n * recognize `key1=value, key2=value` and also `key1:value, key2:value`\n * The key of the command should be identifier with just\n * characters in it - otherwise, the parsing fails.\n */\nexport function $007CParseCommands$007C_$007C(str) {\n const kvs = toList(delay(() => collect((cmd) => {\n const kv = split(cmd, [\"=\", \":\"]);\n return (kv.length === 2) ? singleton([item(0, kv).trim(), item(1, kv).trim()]) : ((kv.length === 1) ? singleton([item(0, kv).trim(), \"\"]) : empty_1());\n }, split(str, [\",\"], undefined, 0))));\n if (forAll((arg) => forAll((c) => {\n if (isLetter(c) ? true : (c === \"_\")) {\n return true;\n }\n else {\n return c === \"-\";\n }\n }, arg[0].split(\"\")), kvs) && !equals(kvs, empty())) {\n return new Map(kvs);\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Utility for parsing commands - this deals with a single command.\n * The key of the command should be identifier with just\n * characters in it - otherwise, the parsing fails.\n */\nexport function $007CParseCommand$007C_$007C(cmd) {\n const kv = split(cmd, [\"=\", \":\"]);\n if ((kv.length >= 1) && !forAll(isLetter, item(0, kv).split(\"\"))) {\n return undefined;\n }\n else {\n switch (kv.length) {\n case 2:\n return [item(0, kv).trim(), item(1, kv).trim()];\n case 1:\n return [item(0, kv).trim(), \"\"];\n default:\n return undefined;\n }\n }\n}\n\n/**\n * Lookup in a dictionary\n */\nexport function $007CCommand$007C_$007C(k, d) {\n let matchValue;\n let outArg = defaultOf();\n matchValue = [tryGetValue(d, k, new FSharpRef(() => outArg, (v) => {\n outArg = v;\n })), outArg];\n if (matchValue[0]) {\n return some(matchValue[1]);\n }\n else {\n return undefined;\n }\n}\n\n","import { Union } from \"../fable-library-js.4.24.0/Types.js\";\nimport { tuple_type, char_type, int32_type, class_type, list_type, option_type, string_type, union_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { MarkdownRange_$reflection } from \"./Range.fs.js\";\nimport { tail, head, empty, reverse, length, cons, concat, singleton, isEmpty } from \"../fable-library-js.4.24.0/List.js\";\nimport { FSharpChoice$3, FSharpChoice$2 } from \"../fable-library-js.4.24.0/Choice.js\";\n\nexport class MarkdownListKind extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Ordered\", \"Unordered\"];\n }\n}\n\nexport function MarkdownListKind_$reflection() {\n return union_type(\"Fable.Formatting.Markdown.MarkdownListKind\", [], MarkdownListKind, () => [[], []]);\n}\n\nexport class MarkdownColumnAlignment extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"AlignLeft\", \"AlignRight\", \"AlignCenter\", \"AlignDefault\"];\n }\n}\n\nexport function MarkdownColumnAlignment_$reflection() {\n return union_type(\"Fable.Formatting.Markdown.MarkdownColumnAlignment\", [], MarkdownColumnAlignment, () => [[], [], [], []]);\n}\n\nexport class MarkdownSpan extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Literal\", \"InlineCode\", \"Strong\", \"Emphasis\", \"AnchorLink\", \"DirectLink\", \"IndirectLink\", \"DirectImage\", \"IndirectImage\", \"HardLineBreak\", \"LatexInlineMath\", \"LatexDisplayMath\", \"EmbedSpans\"];\n }\n}\n\nexport function MarkdownSpan_$reflection() {\n return union_type(\"Fable.Formatting.Markdown.MarkdownSpan\", [], MarkdownSpan, () => [[[\"text\", string_type], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"code\", string_type], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"body\", list_type(MarkdownSpan_$reflection())], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"body\", list_type(MarkdownSpan_$reflection())], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"link\", string_type], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"body\", list_type(MarkdownSpan_$reflection())], [\"link\", string_type], [\"title\", option_type(string_type)], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"body\", list_type(MarkdownSpan_$reflection())], [\"original\", string_type], [\"key\", string_type], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"body\", string_type], [\"link\", string_type], [\"title\", option_type(string_type)], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"body\", string_type], [\"link\", string_type], [\"key\", string_type], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"range\", option_type(MarkdownRange_$reflection())]], [[\"code\", string_type], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"code\", string_type], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"customSpans\", class_type(\"Fable.Formatting.Markdown.MarkdownEmbedSpans\")], [\"range\", option_type(MarkdownRange_$reflection())]]]);\n}\n\nexport class MarkdownParagraph extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Heading\", \"Paragraph\", \"CodeBlock\", \"InlineHtmlBlock\", \"ListBlock\", \"QuotedBlock\", \"Span\", \"LatexBlock\", \"HorizontalRule\", \"TableBlock\", \"OtherBlock\", \"EmbedParagraphs\", \"YamlFrontmatter\", \"OutputBlock\"];\n }\n}\n\nexport function MarkdownParagraph_$reflection() {\n return union_type(\"Fable.Formatting.Markdown.MarkdownParagraph\", [], MarkdownParagraph, () => [[[\"size\", int32_type], [\"body\", list_type(MarkdownSpan_$reflection())], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"body\", list_type(MarkdownSpan_$reflection())], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"code\", string_type], [\"executionCount\", option_type(int32_type)], [\"language\", string_type], [\"ignoredLine\", string_type], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"code\", string_type], [\"executionCount\", option_type(int32_type)], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"kind\", MarkdownListKind_$reflection()], [\"items\", list_type(list_type(MarkdownParagraph_$reflection()))], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"paragraphs\", list_type(MarkdownParagraph_$reflection())], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"body\", list_type(MarkdownSpan_$reflection())], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"env\", string_type], [\"body\", list_type(string_type)], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"character\", char_type], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"headers\", option_type(list_type(list_type(MarkdownParagraph_$reflection())))], [\"alignments\", list_type(MarkdownColumnAlignment_$reflection())], [\"rows\", list_type(list_type(list_type(MarkdownParagraph_$reflection())))], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"lines\", list_type(tuple_type(string_type, MarkdownRange_$reflection()))], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"customParagraphs\", class_type(\"Fable.Formatting.Markdown.MarkdownEmbedParagraphs\")], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"yaml\", list_type(string_type)], [\"range\", option_type(MarkdownRange_$reflection())]], [[\"output\", string_type], [\"kind\", string_type], [\"executionCount\", option_type(int32_type)]]]);\n}\n\nexport function Dsl_$0023(value) {\n return new MarkdownParagraph(0, [1, value, undefined]);\n}\n\nexport function Dsl_$0023$0023(value) {\n return new MarkdownParagraph(0, [2, value, undefined]);\n}\n\nexport function Dsl_$0023$0023$0023(value) {\n return new MarkdownParagraph(0, [3, value, undefined]);\n}\n\nexport function Dsl_$0023$0023$0023$0023(value) {\n return new MarkdownParagraph(0, [4, value, undefined]);\n}\n\nexport function Dsl_$0023$0023$0023$0023$0023(value) {\n return new MarkdownParagraph(0, [5, value, undefined]);\n}\n\nexport function Dsl_strong(value) {\n return new MarkdownSpan(2, [value, undefined]);\n}\n\nexport function Dsl_p(value) {\n return new MarkdownParagraph(1, [value, undefined]);\n}\n\nexport function Dsl_span(value) {\n return new MarkdownParagraph(6, [value, undefined]);\n}\n\nexport function Dsl_op_BangBang(value) {\n return new MarkdownSpan(0, [value, undefined]);\n}\n\nexport function Dsl_link(content, url) {\n return new MarkdownSpan(5, [content, url, undefined, undefined]);\n}\n\nexport function Dsl_ul(value) {\n return new MarkdownParagraph(4, [new MarkdownListKind(1, []), value, undefined]);\n}\n\nexport function Dsl_ol(value) {\n return new MarkdownParagraph(4, [new MarkdownListKind(0, []), value, undefined]);\n}\n\nexport function Dsl_table(headers, alignments, rows) {\n return new MarkdownParagraph(9, [isEmpty(headers) ? undefined : headers, alignments, rows, undefined]);\n}\n\nexport function Dsl_img(body, link) {\n return new MarkdownSpan(7, [body, link, undefined, undefined]);\n}\n\nexport class MarkdownPatterns_SpanLeafInfo extends Union {\n constructor(Item) {\n super();\n this.tag = 0;\n this.fields = [Item];\n }\n cases() {\n return [\"SL\"];\n }\n}\n\nexport function MarkdownPatterns_SpanLeafInfo_$reflection() {\n return union_type(\"Fable.Formatting.Markdown.MarkdownPatterns.SpanLeafInfo\", [], MarkdownPatterns_SpanLeafInfo, () => [[[\"Item\", MarkdownSpan_$reflection()]]]);\n}\n\nexport class MarkdownPatterns_SpanNodeInfo extends Union {\n constructor(Item) {\n super();\n this.tag = 0;\n this.fields = [Item];\n }\n cases() {\n return [\"SN\"];\n }\n}\n\nexport function MarkdownPatterns_SpanNodeInfo_$reflection() {\n return union_type(\"Fable.Formatting.Markdown.MarkdownPatterns.SpanNodeInfo\", [], MarkdownPatterns_SpanNodeInfo, () => [[[\"Item\", MarkdownSpan_$reflection()]]]);\n}\n\nexport class MarkdownPatterns_ParagraphSpansInfo extends Union {\n constructor(Item) {\n super();\n this.tag = 0;\n this.fields = [Item];\n }\n cases() {\n return [\"PS\"];\n }\n}\n\nexport function MarkdownPatterns_ParagraphSpansInfo_$reflection() {\n return union_type(\"Fable.Formatting.Markdown.MarkdownPatterns.ParagraphSpansInfo\", [], MarkdownPatterns_ParagraphSpansInfo, () => [[[\"Item\", MarkdownParagraph_$reflection()]]]);\n}\n\nexport class MarkdownPatterns_ParagraphLeafInfo extends Union {\n constructor(Item) {\n super();\n this.tag = 0;\n this.fields = [Item];\n }\n cases() {\n return [\"PL\"];\n }\n}\n\nexport function MarkdownPatterns_ParagraphLeafInfo_$reflection() {\n return union_type(\"Fable.Formatting.Markdown.MarkdownPatterns.ParagraphLeafInfo\", [], MarkdownPatterns_ParagraphLeafInfo, () => [[[\"Item\", MarkdownParagraph_$reflection()]]]);\n}\n\nexport class MarkdownPatterns_ParagraphNestedInfo extends Union {\n constructor(Item) {\n super();\n this.tag = 0;\n this.fields = [Item];\n }\n cases() {\n return [\"PN\"];\n }\n}\n\nexport function MarkdownPatterns_ParagraphNestedInfo_$reflection() {\n return union_type(\"Fable.Formatting.Markdown.MarkdownPatterns.ParagraphNestedInfo\", [], MarkdownPatterns_ParagraphNestedInfo, () => [[[\"Item\", MarkdownParagraph_$reflection()]]]);\n}\n\nexport function MarkdownPatterns_$007CSpanLeaf$007CSpanNode$007C(span) {\n let matchResult, spans;\n switch (span.tag) {\n case 2: {\n matchResult = 1;\n spans = span.fields[0];\n break;\n }\n case 3: {\n matchResult = 1;\n spans = span.fields[0];\n break;\n }\n case 5: {\n matchResult = 1;\n spans = span.fields[0];\n break;\n }\n case 6: {\n matchResult = 1;\n spans = span.fields[0];\n break;\n }\n default:\n matchResult = 0;\n }\n switch (matchResult) {\n case 0:\n return new FSharpChoice$2(0, [new MarkdownPatterns_SpanLeafInfo(span)]);\n default:\n return new FSharpChoice$2(1, [[new MarkdownPatterns_SpanNodeInfo(span), spans]]);\n }\n}\n\nexport function MarkdownPatterns_SpanLeaf(_arg) {\n return _arg.fields[0];\n}\n\nexport function MarkdownPatterns_SpanNode(_arg, spans) {\n const span = _arg.fields[0];\n switch (span.tag) {\n case 2:\n return new MarkdownSpan(2, [spans, span.fields[1]]);\n case 3:\n return new MarkdownSpan(3, [spans, span.fields[1]]);\n case 5:\n return new MarkdownSpan(5, [spans, span.fields[1], span.fields[2], span.fields[3]]);\n case 6:\n return new MarkdownSpan(6, [spans, span.fields[1], span.fields[2], span.fields[3]]);\n default:\n throw new Error(\"Incorrect SpanNodeInfo\\\\nParameter name: \");\n }\n}\n\nexport function MarkdownPatterns_$007CParagraphLeaf$007CParagraphNested$007CParagraphSpans$007C(par) {\n let matchResult, spans;\n switch (par.tag) {\n case 10:\n case 13:\n case 2:\n case 3:\n case 11:\n case 7:\n case 12:\n case 8: {\n matchResult = 1;\n break;\n }\n case 4: {\n matchResult = 2;\n break;\n }\n case 5: {\n matchResult = 3;\n break;\n }\n case 9: {\n matchResult = 4;\n break;\n }\n case 1: {\n matchResult = 0;\n spans = par.fields[0];\n break;\n }\n case 6: {\n matchResult = 0;\n spans = par.fields[0];\n break;\n }\n default: {\n matchResult = 0;\n spans = par.fields[1];\n }\n }\n switch (matchResult) {\n case 0:\n return new FSharpChoice$3(2, [[new MarkdownPatterns_ParagraphSpansInfo(par), spans]]);\n case 1:\n return new FSharpChoice$3(0, [new MarkdownPatterns_ParagraphLeafInfo(par)]);\n case 2:\n return new FSharpChoice$3(1, [[new MarkdownPatterns_ParagraphNestedInfo(par), par.fields[1]]]);\n case 3:\n return new FSharpChoice$3(1, [[new MarkdownPatterns_ParagraphNestedInfo(par), singleton(par.fields[0])]]);\n default: {\n const rows = par.fields[2];\n const headers = par.fields[0];\n if (headers != null) {\n return new FSharpChoice$3(1, [[new MarkdownPatterns_ParagraphNestedInfo(par), concat(cons(headers, rows))]]);\n }\n else {\n return new FSharpChoice$3(1, [[new MarkdownPatterns_ParagraphNestedInfo(par), concat(rows)]]);\n }\n }\n }\n}\n\nexport function MarkdownPatterns_ParagraphSpans(_arg, spans) {\n const par = _arg.fields[0];\n switch (par.tag) {\n case 0:\n return new MarkdownParagraph(0, [par.fields[0], spans, par.fields[2]]);\n case 1:\n return new MarkdownParagraph(1, [spans, par.fields[1]]);\n case 6:\n return new MarkdownParagraph(6, [spans, par.fields[1]]);\n default:\n throw new Error(\"Incorrect ParagraphSpansInfo.\\\\nParameter name: \");\n }\n}\n\nexport function MarkdownPatterns_ParagraphLeaf(_arg) {\n return _arg.fields[0];\n}\n\nexport function MarkdownPatterns_ParagraphNested(_arg, pars) {\n const par = _arg.fields[0];\n switch (par.tag) {\n case 4:\n return new MarkdownParagraph(4, [par.fields[0], pars, par.fields[2]]);\n case 5:\n return new MarkdownParagraph(5, [concat(pars), par.fields[1]]);\n case 9: {\n const r_2 = par.fields[3];\n const alignments = par.fields[1];\n let rows;\n const n = length(alignments) | 0;\n const loop = (n_1_mut, left_mut, ansList_mut, curList_mut, items_mut) => {\n loop:\n while (true) {\n const n_1 = n_1_mut, left = left_mut, ansList = ansList_mut, curList = curList_mut, items = items_mut;\n if (isEmpty(items) && isEmpty(curList)) {\n return reverse(ansList);\n }\n else if ((left === 0) ? true : isEmpty(items)) {\n n_1_mut = n_1;\n left_mut = n_1;\n ansList_mut = cons(reverse(curList), ansList);\n curList_mut = empty();\n items_mut = items;\n continue loop;\n }\n else {\n n_1_mut = n_1;\n left_mut = (left - 1);\n ansList_mut = ansList;\n curList_mut = cons(head(items), curList);\n items_mut = tail(items);\n continue loop;\n }\n break;\n }\n };\n rows = loop(n, n, empty(), empty(), pars);\n if (isEmpty(rows) ? true : (par.fields[0] == null)) {\n return new MarkdownParagraph(9, [undefined, alignments, rows, r_2]);\n }\n else {\n return new MarkdownParagraph(9, [head(rows), alignments, tail(rows), r_2]);\n }\n }\n default:\n throw new Error(\"Incorrect ParagraphNestedInfo.\\\\nParameter name: \");\n }\n}\n\n","import { Lines_$007CTrimParagraphLines$007C, StringPosition_$007CStartsWithWrapped$007C_$007C, Lines_$007CTrimBlankStart$007C, StringPosition_$007CStartsWith$007C_$007C, StringPosition_$007CStartsAndEndsWith$007C_$007C, StringPosition_$007CUnindented$007C_$007C, StringPosition_$007CWhiteSpace$007C_$007C, StringPosition_$007CStartsWithAny$007C_$007C, StringPosition_$007CTrimStartAndCount$007C, $007CLet$007C, StringPosition_$007CStartsWithNTimesTrimIgnoreStartWhitespace$007C_$007C, Lines_$007CTrimBlank$007C, Lines_$007CTakeCodeBlock$007C_$007C, StringPosition_$007CEqualsRepeated$007C_$007C, StringPosition_$007CTrimEnd$007C, StringPosition_$007CStartsWithRepeated$007C_$007C, List_$007CAsString$007C, List_$007CBracketDelimited$007C_$007C, StringPosition_$007CTrimBoth$007C } from \"./StringParsing.fs.js\";\nimport { printf, toFail, join, split, isNullOrWhiteSpace, replicate, getCharAtIndex, isNullOrEmpty, trimStart, trimEnd, substring } from \"../fable-library-js.4.24.0/String.js\";\nimport { zip, replicate as replicate_1, forAll as forAll_1, choose, skipWhile, map, takeWhile, initialize, ofSeq, append as append_1, splitAt, toArray, singleton, ofArray, length, skip, empty, cons, reverse, ofArrayWithTail, tail, head, isEmpty } from \"../fable-library-js.4.24.0/List.js\";\nimport { exists, empty as empty_1, toArray as toArray_1, take, tryFind, collect, toList, forAll, singleton as singleton_1, append, delay, tryPick } from \"../fable-library-js.4.24.0/Seq.js\";\nimport { List_nestUnderLastMatching, Tree$1, Tree_ofIndentedList, List_partitionWhileLookahead, List_partitionUntilLookahead, List_partitionUntil, List_partitionWhile, List_partitionUntilEquals } from \"./Collections.fs.js\";\nimport { MarkdownParagraph, MarkdownColumnAlignment, MarkdownListKind, MarkdownSpan } from \"./MarkdownModel.fs.js\";\nimport { create, match } from \"../fable-library-js.4.24.0/RegExp.js\";\nimport { Record } from \"../fable-library-js.4.24.0/Types.js\";\nimport { record_type, enum_type, int32_type, bool_type, class_type, tuple_type, option_type, string_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { MarkdownRangeModule_mergeRanges, MarkdownRangeModule_zero, MarkdownRange, MarkdownRange_$reflection } from \"./Range.fs.js\";\nimport { equals, Lazy } from \"../fable-library-js.4.24.0/Util.js\";\nimport { isDigit, isWhiteSpace } from \"../fable-library-js.4.24.0/Char.js\";\nimport { item as item_2, map as map_1 } from \"../fable-library-js.4.24.0/Array.js\";\nimport { some, value as value_14 } from \"../fable-library-js.4.24.0/Option.js\";\nimport { rangeDouble } from \"../fable-library-js.4.24.0/Range.js\";\nimport { addToDict } from \"../fable-library-js.4.24.0/MapUtil.js\";\n\n/**\n * Splits a link formatted as `http://link \"title\"` into a link part\n * and an optional title part (may be wrapped using quote or double-quotes)\n */\nexport function getLinkAndTitle(_arg1_, _arg1__1) {\n const _arg = [_arg1_, _arg1__1];\n const input = StringPosition_$007CTrimBoth$007C(_arg[0], _arg[1])[0];\n let patternInput;\n if (input.length === 0) {\n patternInput = [\"\", undefined];\n }\n else {\n const c = input[input.length - 1];\n if ((c === \"\\'\") ? true : (c === \"\\\"\")) {\n const start = input.indexOf(c) | 0;\n patternInput = [substring(input, 0, start).trim(), substring(input, start + 1, (input.length - 2) - start).trim()];\n }\n else {\n patternInput = [input, undefined];\n }\n }\n return [trimEnd(trimStart(patternInput[0], \"<\"), \">\"), patternInput[1]];\n}\n\n/**\n * Matches a list if it starts with a sub-list that is delimited\n * using the specified delimiters. Returns a wrapped list and the rest.\n * \n * This is similar to `List.Delimited`, but it skips over escaped characters.\n */\nexport function $007CDelimitedMarkdown$007C_$007C(bracket, input) {\n let loop_2;\n const loop = (acc_mut, _arg_mut) => {\n let loop_1;\n loop:\n while (true) {\n const acc = acc_mut, _arg = _arg_mut;\n let activePatternResult;\n const input_1 = _arg;\n let matchResult, c, rest;\n if (!isEmpty(input_1)) {\n if (head(input_1) === \"\\\\\") {\n if (!isEmpty(tail(input_1))) {\n switch (head(tail(input_1))) {\n case \"!\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"#\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"$\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"(\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \")\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"*\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"+\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"-\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \".\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \">\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"[\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"\\\\\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"]\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"_\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"`\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"{\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"}\": {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n default:\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n activePatternResult = [c, rest];\n break;\n }\n default:\n activePatternResult = undefined;\n }\n if (activePatternResult != null) {\n const x_2 = activePatternResult[0];\n const xs_2 = activePatternResult[1];\n acc_mut = ofArrayWithTail([x_2, \"\\\\\"], acc);\n _arg_mut = xs_2;\n continue loop;\n }\n else if ((loop_1 = ((start_1_mut, list_1_mut) => {\n loop_1:\n while (true) {\n const start_1 = start_1_mut, list_1 = list_1_mut;\n let matchResult_1, x_1, xs_1, y_1, ys_1;\n if (isEmpty(start_1)) {\n matchResult_1 = 1;\n }\n else if (!isEmpty(list_1)) {\n if (head(start_1) === head(list_1)) {\n matchResult_1 = 0;\n x_1 = head(start_1);\n xs_1 = tail(start_1);\n y_1 = head(list_1);\n ys_1 = tail(list_1);\n }\n else {\n matchResult_1 = 2;\n }\n }\n else {\n matchResult_1 = 2;\n }\n switch (matchResult_1) {\n case 0: {\n start_1_mut = xs_1;\n list_1_mut = ys_1;\n continue loop_1;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_1(bracket, _arg))) {\n return [reverse(acc), _arg];\n }\n else if (isEmpty(_arg)) {\n return undefined;\n }\n else {\n acc_mut = cons(head(_arg), acc);\n _arg_mut = tail(_arg);\n continue loop;\n }\n break;\n }\n };\n if ((loop_2 = ((start_1_1_mut, list_1_1_mut) => {\n loop_2:\n while (true) {\n const start_1_1 = start_1_1_mut, list_1_1 = list_1_1_mut;\n let matchResult_2, x_1_1, xs_1_1, y_1_1, ys_1_1;\n if (isEmpty(start_1_1)) {\n matchResult_2 = 1;\n }\n else if (!isEmpty(list_1_1)) {\n if (head(start_1_1) === head(list_1_1)) {\n matchResult_2 = 0;\n x_1_1 = head(start_1_1);\n xs_1_1 = tail(start_1_1);\n y_1_1 = head(list_1_1);\n ys_1_1 = tail(list_1_1);\n }\n else {\n matchResult_2 = 2;\n }\n }\n else {\n matchResult_2 = 2;\n }\n switch (matchResult_2) {\n case 0: {\n start_1_1_mut = xs_1_1;\n list_1_1_mut = ys_1_1;\n continue loop_2;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_2(bracket, input))) {\n const matchValue_2 = loop(empty(), skip(length(bracket), input));\n if (matchValue_2 == null) {\n return undefined;\n }\n else {\n const post = matchValue_2[1];\n return [matchValue_2[0], skip(length(bracket), post)];\n }\n }\n else {\n return undefined;\n }\n}\n\n/**\n * This is similar to `List.Delimited`, but it skips over Latex inline math characters.\n */\nexport function $007CDelimitedLatexDisplayMath$007C_$007C(bracket, input) {\n let loop_2;\n const loop = (acc_mut, _arg_mut) => {\n let loop_1;\n loop:\n while (true) {\n const acc = acc_mut, _arg = _arg_mut;\n let activePatternResult;\n const input_1 = _arg;\n let matchResult, c, rest;\n if (!isEmpty(input_1)) {\n if (head(input_1) === \"\\\\\") {\n if (!isEmpty(tail(input_1))) {\n if (head(tail(input_1)) === \"$\") {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n activePatternResult = [c, rest];\n break;\n }\n default:\n activePatternResult = undefined;\n }\n if (activePatternResult != null) {\n const x_2 = activePatternResult[0];\n const xs_2 = activePatternResult[1];\n acc_mut = ofArrayWithTail([x_2, \"\\\\\"], acc);\n _arg_mut = xs_2;\n continue loop;\n }\n else if ((loop_1 = ((start_1_mut, list_1_mut) => {\n loop_1:\n while (true) {\n const start_1 = start_1_mut, list_1 = list_1_mut;\n let matchResult_1, x_1, xs_1, y_1, ys_1;\n if (isEmpty(start_1)) {\n matchResult_1 = 1;\n }\n else if (!isEmpty(list_1)) {\n if (head(start_1) === head(list_1)) {\n matchResult_1 = 0;\n x_1 = head(start_1);\n xs_1 = tail(start_1);\n y_1 = head(list_1);\n ys_1 = tail(list_1);\n }\n else {\n matchResult_1 = 2;\n }\n }\n else {\n matchResult_1 = 2;\n }\n switch (matchResult_1) {\n case 0: {\n start_1_mut = xs_1;\n list_1_mut = ys_1;\n continue loop_1;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_1(bracket, _arg))) {\n return [reverse(acc), _arg];\n }\n else if (isEmpty(_arg)) {\n return undefined;\n }\n else {\n acc_mut = cons(head(_arg), acc);\n _arg_mut = tail(_arg);\n continue loop;\n }\n break;\n }\n };\n if ((loop_2 = ((start_1_1_mut, list_1_1_mut) => {\n loop_2:\n while (true) {\n const start_1_1 = start_1_1_mut, list_1_1 = list_1_1_mut;\n let matchResult_2, x_1_1, xs_1_1, y_1_1, ys_1_1;\n if (isEmpty(start_1_1)) {\n matchResult_2 = 1;\n }\n else if (!isEmpty(list_1_1)) {\n if (head(start_1_1) === head(list_1_1)) {\n matchResult_2 = 0;\n x_1_1 = head(start_1_1);\n xs_1_1 = tail(start_1_1);\n y_1_1 = head(list_1_1);\n ys_1_1 = tail(list_1_1);\n }\n else {\n matchResult_2 = 2;\n }\n }\n else {\n matchResult_2 = 2;\n }\n switch (matchResult_2) {\n case 0: {\n start_1_1_mut = xs_1_1;\n list_1_1_mut = ys_1_1;\n continue loop_2;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_2(bracket, input))) {\n const matchValue_2 = loop(empty(), skip(length(bracket), input));\n if (matchValue_2 == null) {\n return undefined;\n }\n else {\n const post = matchValue_2[1];\n return [matchValue_2[0], skip(length(bracket), post)];\n }\n }\n else {\n return undefined;\n }\n}\n\n/**\n * This is similar to `List.Delimited`, but it skips over Latex inline math characters.\n */\nexport function $007CDelimitedLatexInlineMath$007C_$007C(bracket, input) {\n let loop_2;\n const loop = (acc_mut, _arg_mut) => {\n let loop_1;\n loop:\n while (true) {\n const acc = acc_mut, _arg = _arg_mut;\n let activePatternResult;\n const input_1 = _arg;\n let matchResult, c, rest;\n if (!isEmpty(input_1)) {\n if (head(input_1) === \"\\\\\") {\n if (!isEmpty(tail(input_1))) {\n if (head(tail(input_1)) === \"$\") {\n matchResult = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n activePatternResult = [c, rest];\n break;\n }\n default:\n activePatternResult = undefined;\n }\n if (activePatternResult != null) {\n const x_2 = activePatternResult[0];\n const xs_2 = activePatternResult[1];\n acc_mut = ofArrayWithTail([x_2, \"\\\\\"], acc);\n _arg_mut = xs_2;\n continue loop;\n }\n else if ((loop_1 = ((start_1_mut, list_1_mut) => {\n loop_1:\n while (true) {\n const start_1 = start_1_mut, list_1 = list_1_mut;\n let matchResult_1, x_1, xs_1, y_1, ys_1;\n if (isEmpty(start_1)) {\n matchResult_1 = 1;\n }\n else if (!isEmpty(list_1)) {\n if (head(start_1) === head(list_1)) {\n matchResult_1 = 0;\n x_1 = head(start_1);\n xs_1 = tail(start_1);\n y_1 = head(list_1);\n ys_1 = tail(list_1);\n }\n else {\n matchResult_1 = 2;\n }\n }\n else {\n matchResult_1 = 2;\n }\n switch (matchResult_1) {\n case 0: {\n start_1_mut = xs_1;\n list_1_mut = ys_1;\n continue loop_1;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_1(bracket, _arg))) {\n return [reverse(acc), _arg];\n }\n else if (isEmpty(_arg)) {\n return undefined;\n }\n else {\n acc_mut = cons(head(_arg), acc);\n _arg_mut = tail(_arg);\n continue loop;\n }\n break;\n }\n };\n if ((loop_2 = ((start_1_1_mut, list_1_1_mut) => {\n loop_2:\n while (true) {\n const start_1_1 = start_1_1_mut, list_1_1 = list_1_1_mut;\n let matchResult_2, x_1_1, xs_1_1, y_1_1, ys_1_1;\n if (isEmpty(start_1_1)) {\n matchResult_2 = 1;\n }\n else if (!isEmpty(list_1_1)) {\n if (head(start_1_1) === head(list_1_1)) {\n matchResult_2 = 0;\n x_1_1 = head(start_1_1);\n xs_1_1 = tail(start_1_1);\n y_1_1 = head(list_1_1);\n ys_1_1 = tail(list_1_1);\n }\n else {\n matchResult_2 = 2;\n }\n }\n else {\n matchResult_2 = 2;\n }\n switch (matchResult_2) {\n case 0: {\n start_1_1_mut = xs_1_1;\n list_1_1_mut = ys_1_1;\n continue loop_2;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_2(bracket, input))) {\n const matchValue_2 = loop(empty(), skip(length(bracket), input));\n if (matchValue_2 == null) {\n return undefined;\n }\n else {\n const post = matchValue_2[1];\n return [matchValue_2[0], skip(length(bracket), post)];\n }\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Recognizes an indirect link written using `[body][key]` or just `[key]`\n * The key can be preceeded by a space or other single whitespace thing.\n */\nexport function $007CIndirectLink$007C_$007C(_arg) {\n let matchResult, body, link, rest;\n const activePatternResult = List_$007CBracketDelimited$007C_$007C(\"[\", \"]\", _arg);\n if (activePatternResult != null) {\n if (!isEmpty(activePatternResult[1])) {\n if (head(activePatternResult[1]) === \"\\r\") {\n if (!isEmpty(tail(activePatternResult[1]))) {\n if (head(tail(activePatternResult[1])) === \"\\n\") {\n const activePatternResult_1 = List_$007CBracketDelimited$007C_$007C(\"[\", \"]\", tail(tail(activePatternResult[1])));\n if (activePatternResult_1 != null) {\n const activePatternResult_2 = List_$007CAsString$007C(activePatternResult_1[0]);\n matchResult = 0;\n body = activePatternResult[0];\n link = activePatternResult_2;\n rest = activePatternResult_1[1];\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return [body, link, (\"\\r\\n[\" + link) + \"]\", rest];\n default: {\n let matchResult_1, body_1, c, link_1, rest_1;\n const activePatternResult_3 = List_$007CBracketDelimited$007C_$007C(\"[\", \"]\", _arg);\n if (activePatternResult_3 != null) {\n if (!isEmpty(activePatternResult_3[1])) {\n switch (head(activePatternResult_3[1])) {\n case \"\\n\": {\n const activePatternResult_4 = List_$007CBracketDelimited$007C_$007C(\"[\", \"]\", tail(activePatternResult_3[1]));\n if (activePatternResult_4 != null) {\n const activePatternResult_5 = List_$007CAsString$007C(activePatternResult_4[0]);\n matchResult_1 = 0;\n body_1 = activePatternResult_3[0];\n c = head(activePatternResult_3[1]);\n link_1 = activePatternResult_5;\n rest_1 = activePatternResult_4[1];\n }\n else {\n matchResult_1 = 1;\n }\n break;\n }\n case \" \": {\n const activePatternResult_6 = List_$007CBracketDelimited$007C_$007C(\"[\", \"]\", tail(activePatternResult_3[1]));\n if (activePatternResult_6 != null) {\n const activePatternResult_7 = List_$007CAsString$007C(activePatternResult_6[0]);\n matchResult_1 = 0;\n body_1 = activePatternResult_3[0];\n c = head(activePatternResult_3[1]);\n link_1 = activePatternResult_7;\n rest_1 = activePatternResult_6[1];\n }\n else {\n matchResult_1 = 1;\n }\n break;\n }\n default:\n matchResult_1 = 1;\n }\n }\n else {\n matchResult_1 = 1;\n }\n }\n else {\n matchResult_1 = 1;\n }\n switch (matchResult_1) {\n case 0:\n return [body_1, link_1, ((c + \"[\") + link_1) + \"]\", rest_1];\n default: {\n let matchResult_2, body_2, link_2, rest_2;\n const activePatternResult_8 = List_$007CBracketDelimited$007C_$007C(\"[\", \"]\", _arg);\n if (activePatternResult_8 != null) {\n const activePatternResult_9 = List_$007CBracketDelimited$007C_$007C(\"[\", \"]\", activePatternResult_8[1]);\n if (activePatternResult_9 != null) {\n const activePatternResult_10 = List_$007CAsString$007C(activePatternResult_9[0]);\n matchResult_2 = 0;\n body_2 = activePatternResult_8[0];\n link_2 = activePatternResult_10;\n rest_2 = activePatternResult_9[1];\n }\n else {\n matchResult_2 = 1;\n }\n }\n else {\n matchResult_2 = 1;\n }\n switch (matchResult_2) {\n case 0:\n return [body_2, link_2, (\"[\" + link_2) + \"]\", rest_2];\n default: {\n const activePatternResult_11 = List_$007CBracketDelimited$007C_$007C(\"[\", \"]\", _arg);\n if (activePatternResult_11 != null) {\n const body_3 = activePatternResult_11[0];\n const rest_3 = activePatternResult_11[1];\n return [body_3, \"\", \"\", rest_3];\n }\n else {\n return undefined;\n }\n }\n }\n }\n }\n }\n }\n}\n\n/**\n * Recognize a direct link written using `[body](http://url \"with title\")`\n */\nexport function $007CDirectLink$007C_$007C(_arg) {\n let matchResult, body, link, rest;\n const activePatternResult = List_$007CBracketDelimited$007C_$007C(\"[\", \"]\", _arg);\n if (activePatternResult != null) {\n const activePatternResult_1 = List_$007CBracketDelimited$007C_$007C(\"(\", \")\", activePatternResult[1]);\n if (activePatternResult_1 != null) {\n matchResult = 0;\n body = activePatternResult[0];\n link = activePatternResult_1[0];\n rest = activePatternResult_1[1];\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return [body, link, rest];\n default:\n return undefined;\n }\n}\n\n/**\n * Recognizes an automatic link written using `http://url` or `https://url`\n */\nexport function $007CAutoLink$007C_$007C(input) {\n return tryPick((scheme) => {\n let loop, loop_1;\n const prefix = ofArray(scheme.split(\"\"));\n let activePatternResult;\n const startl = prefix;\n const endl = singleton(\" \");\n const input_1 = input;\n if ((loop = ((start_1_mut, list_1_mut) => {\n loop:\n while (true) {\n const start_1 = start_1_mut, list_1 = list_1_mut;\n let matchResult, x_1, xs_1, y_1, ys_1;\n if (isEmpty(start_1)) {\n matchResult = 1;\n }\n else if (!isEmpty(list_1)) {\n if (head(start_1) === head(list_1)) {\n matchResult = 0;\n x_1 = head(start_1);\n xs_1 = tail(start_1);\n y_1 = head(list_1);\n ys_1 = tail(list_1);\n }\n else {\n matchResult = 2;\n }\n }\n else {\n matchResult = 2;\n }\n switch (matchResult) {\n case 0: {\n start_1_mut = xs_1;\n list_1_mut = ys_1;\n continue loop;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop(startl, input_1))) {\n const matchValue_1 = List_partitionUntilEquals(endl, skip(length(startl), input_1));\n if (matchValue_1 == null) {\n activePatternResult = undefined;\n }\n else {\n const post = matchValue_1[1];\n activePatternResult = [matchValue_1[0], skip(length(endl), post), length(startl), length(endl)];\n }\n }\n else {\n activePatternResult = undefined;\n }\n if (activePatternResult != null) {\n const activePatternResult_1 = List_$007CAsString$007C(activePatternResult[0]);\n const _e = activePatternResult[3] | 0;\n const _s = activePatternResult[2] | 0;\n const rest = activePatternResult[1];\n return [scheme + activePatternResult_1, cons(\" \", rest)];\n }\n else {\n let activePatternResult_2;\n const input_2 = input;\n activePatternResult_2 = (((loop_1 = ((start_1_1_mut, list_1_1_mut) => {\n loop_1:\n while (true) {\n const start_1_1 = start_1_1_mut, list_1_1 = list_1_1_mut;\n let matchResult_1, x_1_1, xs_1_1, y_1_1, ys_1_1;\n if (isEmpty(start_1_1)) {\n matchResult_1 = 1;\n }\n else if (!isEmpty(list_1_1)) {\n if (head(start_1_1) === head(list_1_1)) {\n matchResult_1 = 0;\n x_1_1 = head(start_1_1);\n xs_1_1 = tail(start_1_1);\n y_1_1 = head(list_1_1);\n ys_1_1 = tail(list_1_1);\n }\n else {\n matchResult_1 = 2;\n }\n }\n else {\n matchResult_1 = 2;\n }\n switch (matchResult_1) {\n case 0: {\n start_1_1_mut = xs_1_1;\n list_1_1_mut = ys_1_1;\n continue loop_1;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_1(prefix, input_2))) ? input_2 : undefined);\n if (activePatternResult_2 != null) {\n const activePatternResult_3 = List_$007CAsString$007C(activePatternResult_2);\n return [activePatternResult_3, empty()];\n }\n else {\n return undefined;\n }\n }\n }, [\"http://\", \"https://\"]);\n}\n\n/**\n * Recognizes some form of emphasis using `**bold**` or `*italic*`\n * (both can be also marked using underscore).\n * TODO: This does not handle nested emphasis well.\n */\nexport function $007CEmphasised$007C_$007C(_arg) {\n let matchResult, _tail, input;\n if (!isEmpty(_arg)) {\n switch (head(_arg)) {\n case \"*\": {\n matchResult = 0;\n _tail = tail(_arg);\n input = _arg;\n break;\n }\n case \"_\": {\n matchResult = 0;\n _tail = tail(_arg);\n input = _arg;\n break;\n }\n default:\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n let matchResult_1, body, rest;\n const activePatternResult = $007CDelimitedMarkdown$007C_$007C(ofArray([\"_\", \"_\", \"_\"]), input);\n if (activePatternResult != null) {\n matchResult_1 = 0;\n body = activePatternResult[0];\n rest = activePatternResult[1];\n }\n else {\n const activePatternResult_1 = $007CDelimitedMarkdown$007C_$007C(ofArray([\"*\", \"*\", \"*\"]), input);\n if (activePatternResult_1 != null) {\n matchResult_1 = 0;\n body = activePatternResult_1[0];\n rest = activePatternResult_1[1];\n }\n else {\n matchResult_1 = 1;\n }\n }\n switch (matchResult_1) {\n case 0:\n return [body, (arg_1) => {\n let tupledArg;\n return new MarkdownSpan(2, [singleton((tupledArg = arg_1, new MarkdownSpan(3, [tupledArg[0], tupledArg[1]]))), undefined]);\n }, rest];\n default: {\n let matchResult_2, body_2, rest_1;\n const activePatternResult_2 = $007CDelimitedMarkdown$007C_$007C(ofArray([\"_\", \"_\"]), input);\n if (activePatternResult_2 != null) {\n matchResult_2 = 0;\n body_2 = activePatternResult_2[0];\n rest_1 = activePatternResult_2[1];\n }\n else {\n const activePatternResult_3 = $007CDelimitedMarkdown$007C_$007C(ofArray([\"*\", \"*\"]), input);\n if (activePatternResult_3 != null) {\n matchResult_2 = 0;\n body_2 = activePatternResult_3[0];\n rest_1 = activePatternResult_3[1];\n }\n else {\n matchResult_2 = 1;\n }\n }\n switch (matchResult_2) {\n case 0:\n return [body_2, (tupledArg_1) => (new MarkdownSpan(2, [tupledArg_1[0], tupledArg_1[1]])), rest_1];\n default: {\n let matchResult_3, body_4, rest_2;\n const activePatternResult_4 = $007CDelimitedMarkdown$007C_$007C(singleton(\"_\"), input);\n if (activePatternResult_4 != null) {\n matchResult_3 = 0;\n body_4 = activePatternResult_4[0];\n rest_2 = activePatternResult_4[1];\n }\n else {\n const activePatternResult_5 = $007CDelimitedMarkdown$007C_$007C(singleton(\"*\"), input);\n if (activePatternResult_5 != null) {\n matchResult_3 = 0;\n body_4 = activePatternResult_5[0];\n rest_2 = activePatternResult_5[1];\n }\n else {\n matchResult_3 = 1;\n }\n }\n switch (matchResult_3) {\n case 0:\n return [body_4, (tupledArg_2) => (new MarkdownSpan(3, [tupledArg_2[0], tupledArg_2[1]])), rest_2];\n default:\n return undefined;\n }\n }\n }\n }\n }\n }\n default:\n return undefined;\n }\n}\n\nexport function $007CHtmlEntity$007C_$007C(input) {\n let value;\n let matchResult;\n if (!isEmpty(input)) {\n if (head(input) === \"&\") {\n matchResult = 0;\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n const match$0027 = match(create(\"^&(?:#x[a-f0-9]{1,8}|#[0-9]{1,8}|[a-z][a-z0-9]{1,31});\"), (value = toArray(input), value.join('')));\n if (match$0027 != null) {\n const entity = match$0027[0];\n return [entity, splitAt(entity.length, input)[1]];\n }\n else {\n return undefined;\n }\n }\n default:\n return undefined;\n }\n}\n\nexport class ParsingContext extends Record {\n constructor(Links, Newline, IsFirst, CurrentRange, ParseOptions) {\n super();\n this.Links = Links;\n this.Newline = Newline;\n this.IsFirst = IsFirst;\n this.CurrentRange = CurrentRange;\n this.ParseOptions = (ParseOptions | 0);\n }\n}\n\nexport function ParsingContext_$reflection() {\n return record_type(\"Fable.Formatting.Markdown.Parser.ParsingContext\", [], ParsingContext, () => [[\"Links\", class_type(\"System.Collections.Generic.Dictionary`2\", [string_type, tuple_type(string_type, option_type(string_type))])], [\"Newline\", string_type], [\"IsFirst\", bool_type], [\"CurrentRange\", option_type(MarkdownRange_$reflection())], [\"ParseOptions\", enum_type(\"Fable.Formatting.Markdown.MarkdownParseOptions\", int32_type, [[\"None\", 0], [\"ParseCodeAsOther\", 1], [\"ParseNonCodeAsOther\", 2], [\"AllowYamlFrontMatter\", 4]])]]);\n}\n\nexport function ParsingContext__get_ParseCodeAsOther(x) {\n return (x.ParseOptions & 1) !== 0;\n}\n\nexport function ParsingContext__get_ParseNonCodeAsOther(x) {\n return (x.ParseOptions & 2) !== 0;\n}\n\nexport function ParsingContext__get_AllowYamlFrontMatter(x) {\n return (x.ParseOptions & 4) !== 0;\n}\n\n/**\n * Parses a body of a paragraph and recognizes all inline tags.\n */\nexport function parseChars(acc, input, ctx) {\n return delay(() => {\n let matchValue_30, n_3, inputRecord_3, loop_13, loop_12, rest_11, link, _s, _e, loop, str_1, loop_2, str_3, loop_4, str_5, loop_6, str_7, loop_8, str_9, loop_10, str_11;\n const accLiterals = new Lazy(() => {\n let inputRecord, matchValue_1, n_1, inputRecord_1;\n if (isEmpty(acc)) {\n return [empty(), ctx];\n }\n else {\n let range;\n const matchValue = ctx.CurrentRange;\n if (matchValue == null) {\n range = undefined;\n }\n else {\n const n = matchValue;\n range = ((inputRecord = n, new MarkdownRange(inputRecord.StartLine, inputRecord.StartColumn, inputRecord.EndLine, n.StartColumn + length(acc))));\n }\n const ctx_1 = new ParsingContext(ctx.Links, ctx.Newline, ctx.IsFirst, (matchValue_1 = ctx.CurrentRange, (matchValue_1 == null) ? undefined : ((n_1 = matchValue_1, (inputRecord_1 = n_1, new MarkdownRange(inputRecord_1.StartLine, n_1.StartColumn + length(acc), inputRecord_1.EndLine, inputRecord_1.EndColumn))))), ctx.ParseOptions);\n return [singleton(new MarkdownSpan(0, [toArray(reverse(acc)).join(''), range])), ctx_1];\n }\n });\n const matchValue_2 = input;\n let matchResult, rest_6, entity, rest_7, rest_8, c_6, rest_9, body, e, rest_10, s;\n if (!isEmpty(matchValue_2)) {\n switch (head(matchValue_2)) {\n case \" \": {\n if (!isEmpty(tail(matchValue_2))) {\n if (head(tail(matchValue_2)) === \" \") {\n if (!isEmpty(tail(tail(matchValue_2)))) {\n switch (head(tail(tail(matchValue_2)))) {\n case \"\\n\": {\n matchResult = 0;\n rest_6 = tail(tail(tail(matchValue_2)));\n break;\n }\n case \"\\r\": {\n if (!isEmpty(tail(tail(tail(matchValue_2))))) {\n if (head(tail(tail(tail(matchValue_2)))) === \"\\n\") {\n matchResult = 0;\n rest_6 = tail(tail(tail(tail(matchValue_2))));\n }\n else {\n matchResult = 0;\n rest_6 = tail(tail(tail(matchValue_2)));\n }\n }\n else {\n matchResult = 0;\n rest_6 = tail(tail(tail(matchValue_2)));\n }\n break;\n }\n default: {\n const activePatternResult = $007CHtmlEntity$007C_$007C(matchValue_2);\n if (activePatternResult != null) {\n matchResult = 1;\n entity = activePatternResult[0];\n rest_7 = activePatternResult[1];\n }\n else {\n let activePatternResult_1;\n const input_1 = matchValue_2;\n let matchResult_5, c, rest;\n if (!isEmpty(input_1)) {\n if (head(input_1) === \"\\\\\") {\n if (!isEmpty(tail(input_1))) {\n switch (head(tail(input_1))) {\n case \"!\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"#\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"$\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"(\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \")\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"*\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"+\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"-\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \".\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \">\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"[\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"\\\\\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"]\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"_\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"`\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"{\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n case \"}\": {\n matchResult_5 = 0;\n c = head(tail(input_1));\n rest = tail(tail(input_1));\n break;\n }\n default:\n matchResult_5 = 1;\n }\n }\n else {\n matchResult_5 = 1;\n }\n }\n else {\n matchResult_5 = 1;\n }\n }\n else {\n matchResult_5 = 1;\n }\n switch (matchResult_5) {\n case 0: {\n activePatternResult_1 = [c, rest];\n break;\n }\n default:\n activePatternResult_1 = undefined;\n }\n if (activePatternResult_1 != null) {\n matchResult = 3;\n c_6 = activePatternResult_1[0];\n rest_9 = activePatternResult_1[1];\n }\n else {\n let activePatternResult_2;\n const startl = ofArray([\"`\", \" \"]);\n const endl = ofArray([\" \", \"`\"]);\n const input_2 = matchValue_2;\n if ((loop = ((start_1_mut, list_1_1_mut) => {\n loop:\n while (true) {\n const start_1 = start_1_mut, list_1_1 = list_1_1_mut;\n let matchResult_6, x_1, xs_1, y_1, ys_1;\n if (isEmpty(start_1)) {\n matchResult_6 = 1;\n }\n else if (!isEmpty(list_1_1)) {\n if (head(start_1) === head(list_1_1)) {\n matchResult_6 = 0;\n x_1 = head(start_1);\n xs_1 = tail(start_1);\n y_1 = head(list_1_1);\n ys_1 = tail(list_1_1);\n }\n else {\n matchResult_6 = 2;\n }\n }\n else {\n matchResult_6 = 2;\n }\n switch (matchResult_6) {\n case 0: {\n start_1_mut = xs_1;\n list_1_1_mut = ys_1;\n continue loop;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop(startl, input_2))) {\n const matchValue_4 = List_partitionUntilEquals(endl, skip(length(startl), input_2));\n if (matchValue_4 == null) {\n activePatternResult_2 = undefined;\n }\n else {\n const post = matchValue_4[1];\n activePatternResult_2 = [matchValue_4[0], skip(length(endl), post), length(startl), length(endl)];\n }\n }\n else {\n activePatternResult_2 = undefined;\n }\n if (activePatternResult_2 != null) {\n matchResult = 4;\n body = activePatternResult_2[0];\n e = activePatternResult_2[3];\n rest_10 = activePatternResult_2[1];\n s = activePatternResult_2[2];\n }\n else {\n let activePatternResult_3;\n const input_3 = matchValue_2;\n const strs = List_partitionWhile((i) => (i === \"`\"), input_3)[0];\n activePatternResult_3 = (!isEmpty(strs) ? ((str_1 = initialize(length(strs), (_arg) => \"`\"), (input_4) => {\n let loop_1;\n const startl_1 = str_1;\n const endl_1 = str_1;\n const input_5 = input_4;\n if ((loop_1 = ((start_1_1_mut, list_1_2_mut) => {\n loop_1:\n while (true) {\n const start_1_1 = start_1_1_mut, list_1_2 = list_1_2_mut;\n let matchResult_7, x_1_1, xs_1_1, y_1_1, ys_1_1;\n if (isEmpty(start_1_1)) {\n matchResult_7 = 1;\n }\n else if (!isEmpty(list_1_2)) {\n if (head(start_1_1) === head(list_1_2)) {\n matchResult_7 = 0;\n x_1_1 = head(start_1_1);\n xs_1_1 = tail(start_1_1);\n y_1_1 = head(list_1_2);\n ys_1_1 = tail(list_1_2);\n }\n else {\n matchResult_7 = 2;\n }\n }\n else {\n matchResult_7 = 2;\n }\n switch (matchResult_7) {\n case 0: {\n start_1_1_mut = xs_1_1;\n list_1_2_mut = ys_1_1;\n continue loop_1;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_1(startl_1, input_5))) {\n const matchValue_6 = List_partitionUntilEquals(endl_1, skip(length(startl_1), input_5));\n if (matchValue_6 == null) {\n return undefined;\n }\n else {\n const post_1 = matchValue_6[1];\n return [matchValue_6[0], skip(length(endl_1), post_1), length(startl_1), length(endl_1)];\n }\n }\n else {\n return undefined;\n }\n }))(input_3) : undefined);\n if (activePatternResult_3 != null) {\n matchResult = 4;\n body = activePatternResult_3[0];\n e = activePatternResult_3[3];\n rest_10 = activePatternResult_3[1];\n s = activePatternResult_3[2];\n }\n else {\n matchResult = 5;\n }\n }\n }\n }\n }\n }\n }\n else {\n const activePatternResult_4 = $007CHtmlEntity$007C_$007C(matchValue_2);\n if (activePatternResult_4 != null) {\n matchResult = 1;\n entity = activePatternResult_4[0];\n rest_7 = activePatternResult_4[1];\n }\n else {\n let activePatternResult_5;\n const input_6 = matchValue_2;\n let matchResult_8, c_1, rest_1;\n if (!isEmpty(input_6)) {\n if (head(input_6) === \"\\\\\") {\n if (!isEmpty(tail(input_6))) {\n switch (head(tail(input_6))) {\n case \"!\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \"#\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \"$\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \"(\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \")\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \"*\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \"+\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \"-\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \".\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \">\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \"[\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \"\\\\\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \"]\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \"_\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \"`\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \"{\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n case \"}\": {\n matchResult_8 = 0;\n c_1 = head(tail(input_6));\n rest_1 = tail(tail(input_6));\n break;\n }\n default:\n matchResult_8 = 1;\n }\n }\n else {\n matchResult_8 = 1;\n }\n }\n else {\n matchResult_8 = 1;\n }\n }\n else {\n matchResult_8 = 1;\n }\n switch (matchResult_8) {\n case 0: {\n activePatternResult_5 = [c_1, rest_1];\n break;\n }\n default:\n activePatternResult_5 = undefined;\n }\n if (activePatternResult_5 != null) {\n matchResult = 3;\n c_6 = activePatternResult_5[0];\n rest_9 = activePatternResult_5[1];\n }\n else {\n let activePatternResult_6;\n const startl_2 = ofArray([\"`\", \" \"]);\n const endl_2 = ofArray([\" \", \"`\"]);\n const input_7 = matchValue_2;\n if ((loop_2 = ((start_1_2_mut, list_1_3_mut) => {\n loop_2:\n while (true) {\n const start_1_2 = start_1_2_mut, list_1_3 = list_1_3_mut;\n let matchResult_9, x_1_2, xs_1_2, y_1_2, ys_1_2;\n if (isEmpty(start_1_2)) {\n matchResult_9 = 1;\n }\n else if (!isEmpty(list_1_3)) {\n if (head(start_1_2) === head(list_1_3)) {\n matchResult_9 = 0;\n x_1_2 = head(start_1_2);\n xs_1_2 = tail(start_1_2);\n y_1_2 = head(list_1_3);\n ys_1_2 = tail(list_1_3);\n }\n else {\n matchResult_9 = 2;\n }\n }\n else {\n matchResult_9 = 2;\n }\n switch (matchResult_9) {\n case 0: {\n start_1_2_mut = xs_1_2;\n list_1_3_mut = ys_1_2;\n continue loop_2;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_2(startl_2, input_7))) {\n const matchValue_8 = List_partitionUntilEquals(endl_2, skip(length(startl_2), input_7));\n if (matchValue_8 == null) {\n activePatternResult_6 = undefined;\n }\n else {\n const post_2 = matchValue_8[1];\n activePatternResult_6 = [matchValue_8[0], skip(length(endl_2), post_2), length(startl_2), length(endl_2)];\n }\n }\n else {\n activePatternResult_6 = undefined;\n }\n if (activePatternResult_6 != null) {\n matchResult = 4;\n body = activePatternResult_6[0];\n e = activePatternResult_6[3];\n rest_10 = activePatternResult_6[1];\n s = activePatternResult_6[2];\n }\n else {\n let activePatternResult_7;\n const input_8 = matchValue_2;\n const strs_1 = List_partitionWhile((i_1) => (i_1 === \"`\"), input_8)[0];\n activePatternResult_7 = (!isEmpty(strs_1) ? ((str_3 = initialize(length(strs_1), (_arg_1) => \"`\"), (input_9) => {\n let loop_3;\n const startl_3 = str_3;\n const endl_3 = str_3;\n const input_10 = input_9;\n if ((loop_3 = ((start_1_3_mut, list_1_4_mut) => {\n loop_3:\n while (true) {\n const start_1_3 = start_1_3_mut, list_1_4 = list_1_4_mut;\n let matchResult_10, x_1_3, xs_1_3, y_1_3, ys_1_3;\n if (isEmpty(start_1_3)) {\n matchResult_10 = 1;\n }\n else if (!isEmpty(list_1_4)) {\n if (head(start_1_3) === head(list_1_4)) {\n matchResult_10 = 0;\n x_1_3 = head(start_1_3);\n xs_1_3 = tail(start_1_3);\n y_1_3 = head(list_1_4);\n ys_1_3 = tail(list_1_4);\n }\n else {\n matchResult_10 = 2;\n }\n }\n else {\n matchResult_10 = 2;\n }\n switch (matchResult_10) {\n case 0: {\n start_1_3_mut = xs_1_3;\n list_1_4_mut = ys_1_3;\n continue loop_3;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_3(startl_3, input_10))) {\n const matchValue_10 = List_partitionUntilEquals(endl_3, skip(length(startl_3), input_10));\n if (matchValue_10 == null) {\n return undefined;\n }\n else {\n const post_3 = matchValue_10[1];\n return [matchValue_10[0], skip(length(endl_3), post_3), length(startl_3), length(endl_3)];\n }\n }\n else {\n return undefined;\n }\n }))(input_8) : undefined);\n if (activePatternResult_7 != null) {\n matchResult = 4;\n body = activePatternResult_7[0];\n e = activePatternResult_7[3];\n rest_10 = activePatternResult_7[1];\n s = activePatternResult_7[2];\n }\n else {\n matchResult = 5;\n }\n }\n }\n }\n }\n }\n else {\n const activePatternResult_8 = $007CHtmlEntity$007C_$007C(matchValue_2);\n if (activePatternResult_8 != null) {\n matchResult = 1;\n entity = activePatternResult_8[0];\n rest_7 = activePatternResult_8[1];\n }\n else {\n let activePatternResult_9;\n const input_11 = matchValue_2;\n let matchResult_11, c_2, rest_2;\n if (!isEmpty(input_11)) {\n if (head(input_11) === \"\\\\\") {\n if (!isEmpty(tail(input_11))) {\n switch (head(tail(input_11))) {\n case \"!\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \"#\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \"$\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \"(\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \")\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \"*\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \"+\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \"-\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \".\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \">\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \"[\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \"\\\\\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \"]\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \"_\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \"`\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \"{\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n case \"}\": {\n matchResult_11 = 0;\n c_2 = head(tail(input_11));\n rest_2 = tail(tail(input_11));\n break;\n }\n default:\n matchResult_11 = 1;\n }\n }\n else {\n matchResult_11 = 1;\n }\n }\n else {\n matchResult_11 = 1;\n }\n }\n else {\n matchResult_11 = 1;\n }\n switch (matchResult_11) {\n case 0: {\n activePatternResult_9 = [c_2, rest_2];\n break;\n }\n default:\n activePatternResult_9 = undefined;\n }\n if (activePatternResult_9 != null) {\n matchResult = 3;\n c_6 = activePatternResult_9[0];\n rest_9 = activePatternResult_9[1];\n }\n else {\n let activePatternResult_10;\n const startl_4 = ofArray([\"`\", \" \"]);\n const endl_4 = ofArray([\" \", \"`\"]);\n const input_12 = matchValue_2;\n if ((loop_4 = ((start_1_4_mut, list_1_5_mut) => {\n loop_4:\n while (true) {\n const start_1_4 = start_1_4_mut, list_1_5 = list_1_5_mut;\n let matchResult_12, x_1_4, xs_1_4, y_1_4, ys_1_4;\n if (isEmpty(start_1_4)) {\n matchResult_12 = 1;\n }\n else if (!isEmpty(list_1_5)) {\n if (head(start_1_4) === head(list_1_5)) {\n matchResult_12 = 0;\n x_1_4 = head(start_1_4);\n xs_1_4 = tail(start_1_4);\n y_1_4 = head(list_1_5);\n ys_1_4 = tail(list_1_5);\n }\n else {\n matchResult_12 = 2;\n }\n }\n else {\n matchResult_12 = 2;\n }\n switch (matchResult_12) {\n case 0: {\n start_1_4_mut = xs_1_4;\n list_1_5_mut = ys_1_4;\n continue loop_4;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_4(startl_4, input_12))) {\n const matchValue_12 = List_partitionUntilEquals(endl_4, skip(length(startl_4), input_12));\n if (matchValue_12 == null) {\n activePatternResult_10 = undefined;\n }\n else {\n const post_4 = matchValue_12[1];\n activePatternResult_10 = [matchValue_12[0], skip(length(endl_4), post_4), length(startl_4), length(endl_4)];\n }\n }\n else {\n activePatternResult_10 = undefined;\n }\n if (activePatternResult_10 != null) {\n matchResult = 4;\n body = activePatternResult_10[0];\n e = activePatternResult_10[3];\n rest_10 = activePatternResult_10[1];\n s = activePatternResult_10[2];\n }\n else {\n let activePatternResult_11;\n const input_13 = matchValue_2;\n const strs_2 = List_partitionWhile((i_2) => (i_2 === \"`\"), input_13)[0];\n activePatternResult_11 = (!isEmpty(strs_2) ? ((str_5 = initialize(length(strs_2), (_arg_2) => \"`\"), (input_14) => {\n let loop_5;\n const startl_5 = str_5;\n const endl_5 = str_5;\n const input_15 = input_14;\n if ((loop_5 = ((start_1_5_mut, list_1_6_mut) => {\n loop_5:\n while (true) {\n const start_1_5 = start_1_5_mut, list_1_6 = list_1_6_mut;\n let matchResult_13, x_1_5, xs_1_5, y_1_5, ys_1_5;\n if (isEmpty(start_1_5)) {\n matchResult_13 = 1;\n }\n else if (!isEmpty(list_1_6)) {\n if (head(start_1_5) === head(list_1_6)) {\n matchResult_13 = 0;\n x_1_5 = head(start_1_5);\n xs_1_5 = tail(start_1_5);\n y_1_5 = head(list_1_6);\n ys_1_5 = tail(list_1_6);\n }\n else {\n matchResult_13 = 2;\n }\n }\n else {\n matchResult_13 = 2;\n }\n switch (matchResult_13) {\n case 0: {\n start_1_5_mut = xs_1_5;\n list_1_6_mut = ys_1_5;\n continue loop_5;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_5(startl_5, input_15))) {\n const matchValue_14 = List_partitionUntilEquals(endl_5, skip(length(startl_5), input_15));\n if (matchValue_14 == null) {\n return undefined;\n }\n else {\n const post_5 = matchValue_14[1];\n return [matchValue_14[0], skip(length(endl_5), post_5), length(startl_5), length(endl_5)];\n }\n }\n else {\n return undefined;\n }\n }))(input_13) : undefined);\n if (activePatternResult_11 != null) {\n matchResult = 4;\n body = activePatternResult_11[0];\n e = activePatternResult_11[3];\n rest_10 = activePatternResult_11[1];\n s = activePatternResult_11[2];\n }\n else {\n matchResult = 5;\n }\n }\n }\n }\n }\n }\n else {\n const activePatternResult_12 = $007CHtmlEntity$007C_$007C(matchValue_2);\n if (activePatternResult_12 != null) {\n matchResult = 1;\n entity = activePatternResult_12[0];\n rest_7 = activePatternResult_12[1];\n }\n else {\n let activePatternResult_13;\n const input_16 = matchValue_2;\n let matchResult_14, c_3, rest_3;\n if (!isEmpty(input_16)) {\n if (head(input_16) === \"\\\\\") {\n if (!isEmpty(tail(input_16))) {\n switch (head(tail(input_16))) {\n case \"!\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \"#\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \"$\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \"(\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \")\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \"*\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \"+\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \"-\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \".\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \">\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \"[\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \"\\\\\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \"]\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \"_\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \"`\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \"{\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n case \"}\": {\n matchResult_14 = 0;\n c_3 = head(tail(input_16));\n rest_3 = tail(tail(input_16));\n break;\n }\n default:\n matchResult_14 = 1;\n }\n }\n else {\n matchResult_14 = 1;\n }\n }\n else {\n matchResult_14 = 1;\n }\n }\n else {\n matchResult_14 = 1;\n }\n switch (matchResult_14) {\n case 0: {\n activePatternResult_13 = [c_3, rest_3];\n break;\n }\n default:\n activePatternResult_13 = undefined;\n }\n if (activePatternResult_13 != null) {\n matchResult = 3;\n c_6 = activePatternResult_13[0];\n rest_9 = activePatternResult_13[1];\n }\n else {\n let activePatternResult_14;\n const startl_6 = ofArray([\"`\", \" \"]);\n const endl_6 = ofArray([\" \", \"`\"]);\n const input_17 = matchValue_2;\n if ((loop_6 = ((start_1_6_mut, list_1_7_mut) => {\n loop_6:\n while (true) {\n const start_1_6 = start_1_6_mut, list_1_7 = list_1_7_mut;\n let matchResult_15, x_1_6, xs_1_6, y_1_6, ys_1_6;\n if (isEmpty(start_1_6)) {\n matchResult_15 = 1;\n }\n else if (!isEmpty(list_1_7)) {\n if (head(start_1_6) === head(list_1_7)) {\n matchResult_15 = 0;\n x_1_6 = head(start_1_6);\n xs_1_6 = tail(start_1_6);\n y_1_6 = head(list_1_7);\n ys_1_6 = tail(list_1_7);\n }\n else {\n matchResult_15 = 2;\n }\n }\n else {\n matchResult_15 = 2;\n }\n switch (matchResult_15) {\n case 0: {\n start_1_6_mut = xs_1_6;\n list_1_7_mut = ys_1_6;\n continue loop_6;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_6(startl_6, input_17))) {\n const matchValue_16 = List_partitionUntilEquals(endl_6, skip(length(startl_6), input_17));\n if (matchValue_16 == null) {\n activePatternResult_14 = undefined;\n }\n else {\n const post_6 = matchValue_16[1];\n activePatternResult_14 = [matchValue_16[0], skip(length(endl_6), post_6), length(startl_6), length(endl_6)];\n }\n }\n else {\n activePatternResult_14 = undefined;\n }\n if (activePatternResult_14 != null) {\n matchResult = 4;\n body = activePatternResult_14[0];\n e = activePatternResult_14[3];\n rest_10 = activePatternResult_14[1];\n s = activePatternResult_14[2];\n }\n else {\n let activePatternResult_15;\n const input_18 = matchValue_2;\n const strs_3 = List_partitionWhile((i_3) => (i_3 === \"`\"), input_18)[0];\n activePatternResult_15 = (!isEmpty(strs_3) ? ((str_7 = initialize(length(strs_3), (_arg_3) => \"`\"), (input_19) => {\n let loop_7;\n const startl_7 = str_7;\n const endl_7 = str_7;\n const input_20 = input_19;\n if ((loop_7 = ((start_1_7_mut, list_1_8_mut) => {\n loop_7:\n while (true) {\n const start_1_7 = start_1_7_mut, list_1_8 = list_1_8_mut;\n let matchResult_16, x_1_7, xs_1_7, y_1_7, ys_1_7;\n if (isEmpty(start_1_7)) {\n matchResult_16 = 1;\n }\n else if (!isEmpty(list_1_8)) {\n if (head(start_1_7) === head(list_1_8)) {\n matchResult_16 = 0;\n x_1_7 = head(start_1_7);\n xs_1_7 = tail(start_1_7);\n y_1_7 = head(list_1_8);\n ys_1_7 = tail(list_1_8);\n }\n else {\n matchResult_16 = 2;\n }\n }\n else {\n matchResult_16 = 2;\n }\n switch (matchResult_16) {\n case 0: {\n start_1_7_mut = xs_1_7;\n list_1_8_mut = ys_1_7;\n continue loop_7;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_7(startl_7, input_20))) {\n const matchValue_18 = List_partitionUntilEquals(endl_7, skip(length(startl_7), input_20));\n if (matchValue_18 == null) {\n return undefined;\n }\n else {\n const post_7 = matchValue_18[1];\n return [matchValue_18[0], skip(length(endl_7), post_7), length(startl_7), length(endl_7)];\n }\n }\n else {\n return undefined;\n }\n }))(input_18) : undefined);\n if (activePatternResult_15 != null) {\n matchResult = 4;\n body = activePatternResult_15[0];\n e = activePatternResult_15[3];\n rest_10 = activePatternResult_15[1];\n s = activePatternResult_15[2];\n }\n else {\n matchResult = 5;\n }\n }\n }\n }\n }\n break;\n }\n case \"&\": {\n const activePatternResult_16 = $007CHtmlEntity$007C_$007C(matchValue_2);\n if (activePatternResult_16 != null) {\n matchResult = 1;\n entity = activePatternResult_16[0];\n rest_7 = activePatternResult_16[1];\n }\n else {\n matchResult = 2;\n rest_8 = tail(matchValue_2);\n }\n break;\n }\n default: {\n const activePatternResult_17 = $007CHtmlEntity$007C_$007C(matchValue_2);\n if (activePatternResult_17 != null) {\n matchResult = 1;\n entity = activePatternResult_17[0];\n rest_7 = activePatternResult_17[1];\n }\n else {\n let activePatternResult_18;\n const input_21 = matchValue_2;\n let matchResult_17, c_4, rest_4;\n if (!isEmpty(input_21)) {\n if (head(input_21) === \"\\\\\") {\n if (!isEmpty(tail(input_21))) {\n switch (head(tail(input_21))) {\n case \"!\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \"#\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \"$\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \"(\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \")\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \"*\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \"+\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \"-\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \".\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \">\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \"[\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \"\\\\\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \"]\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \"_\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \"`\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \"{\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n case \"}\": {\n matchResult_17 = 0;\n c_4 = head(tail(input_21));\n rest_4 = tail(tail(input_21));\n break;\n }\n default:\n matchResult_17 = 1;\n }\n }\n else {\n matchResult_17 = 1;\n }\n }\n else {\n matchResult_17 = 1;\n }\n }\n else {\n matchResult_17 = 1;\n }\n switch (matchResult_17) {\n case 0: {\n activePatternResult_18 = [c_4, rest_4];\n break;\n }\n default:\n activePatternResult_18 = undefined;\n }\n if (activePatternResult_18 != null) {\n matchResult = 3;\n c_6 = activePatternResult_18[0];\n rest_9 = activePatternResult_18[1];\n }\n else {\n let activePatternResult_19;\n const startl_8 = ofArray([\"`\", \" \"]);\n const endl_8 = ofArray([\" \", \"`\"]);\n const input_22 = matchValue_2;\n if ((loop_8 = ((start_1_8_mut, list_1_9_mut) => {\n loop_8:\n while (true) {\n const start_1_8 = start_1_8_mut, list_1_9 = list_1_9_mut;\n let matchResult_18, x_1_8, xs_1_8, y_1_8, ys_1_8;\n if (isEmpty(start_1_8)) {\n matchResult_18 = 1;\n }\n else if (!isEmpty(list_1_9)) {\n if (head(start_1_8) === head(list_1_9)) {\n matchResult_18 = 0;\n x_1_8 = head(start_1_8);\n xs_1_8 = tail(start_1_8);\n y_1_8 = head(list_1_9);\n ys_1_8 = tail(list_1_9);\n }\n else {\n matchResult_18 = 2;\n }\n }\n else {\n matchResult_18 = 2;\n }\n switch (matchResult_18) {\n case 0: {\n start_1_8_mut = xs_1_8;\n list_1_9_mut = ys_1_8;\n continue loop_8;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_8(startl_8, input_22))) {\n const matchValue_20 = List_partitionUntilEquals(endl_8, skip(length(startl_8), input_22));\n if (matchValue_20 == null) {\n activePatternResult_19 = undefined;\n }\n else {\n const post_8 = matchValue_20[1];\n activePatternResult_19 = [matchValue_20[0], skip(length(endl_8), post_8), length(startl_8), length(endl_8)];\n }\n }\n else {\n activePatternResult_19 = undefined;\n }\n if (activePatternResult_19 != null) {\n matchResult = 4;\n body = activePatternResult_19[0];\n e = activePatternResult_19[3];\n rest_10 = activePatternResult_19[1];\n s = activePatternResult_19[2];\n }\n else {\n let activePatternResult_20;\n const input_23 = matchValue_2;\n const strs_4 = List_partitionWhile((i_4) => (i_4 === \"`\"), input_23)[0];\n activePatternResult_20 = (!isEmpty(strs_4) ? ((str_9 = initialize(length(strs_4), (_arg_4) => \"`\"), (input_24) => {\n let loop_9;\n const startl_9 = str_9;\n const endl_9 = str_9;\n const input_25 = input_24;\n if ((loop_9 = ((start_1_9_mut, list_1_10_mut) => {\n loop_9:\n while (true) {\n const start_1_9 = start_1_9_mut, list_1_10 = list_1_10_mut;\n let matchResult_19, x_1_9, xs_1_9, y_1_9, ys_1_9;\n if (isEmpty(start_1_9)) {\n matchResult_19 = 1;\n }\n else if (!isEmpty(list_1_10)) {\n if (head(start_1_9) === head(list_1_10)) {\n matchResult_19 = 0;\n x_1_9 = head(start_1_9);\n xs_1_9 = tail(start_1_9);\n y_1_9 = head(list_1_10);\n ys_1_9 = tail(list_1_10);\n }\n else {\n matchResult_19 = 2;\n }\n }\n else {\n matchResult_19 = 2;\n }\n switch (matchResult_19) {\n case 0: {\n start_1_9_mut = xs_1_9;\n list_1_10_mut = ys_1_9;\n continue loop_9;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_9(startl_9, input_25))) {\n const matchValue_22 = List_partitionUntilEquals(endl_9, skip(length(startl_9), input_25));\n if (matchValue_22 == null) {\n return undefined;\n }\n else {\n const post_9 = matchValue_22[1];\n return [matchValue_22[0], skip(length(endl_9), post_9), length(startl_9), length(endl_9)];\n }\n }\n else {\n return undefined;\n }\n }))(input_23) : undefined);\n if (activePatternResult_20 != null) {\n matchResult = 4;\n body = activePatternResult_20[0];\n e = activePatternResult_20[3];\n rest_10 = activePatternResult_20[1];\n s = activePatternResult_20[2];\n }\n else {\n matchResult = 5;\n }\n }\n }\n }\n }\n }\n }\n else {\n const activePatternResult_21 = $007CHtmlEntity$007C_$007C(matchValue_2);\n if (activePatternResult_21 != null) {\n matchResult = 1;\n entity = activePatternResult_21[0];\n rest_7 = activePatternResult_21[1];\n }\n else {\n let activePatternResult_22;\n const input_26 = matchValue_2;\n let matchResult_20, c_5, rest_5;\n if (!isEmpty(input_26)) {\n if (head(input_26) === \"\\\\\") {\n if (!isEmpty(tail(input_26))) {\n switch (head(tail(input_26))) {\n case \"!\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \"#\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \"$\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \"(\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \")\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \"*\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \"+\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \"-\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \".\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \">\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \"[\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \"\\\\\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \"]\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \"_\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \"`\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \"{\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n case \"}\": {\n matchResult_20 = 0;\n c_5 = head(tail(input_26));\n rest_5 = tail(tail(input_26));\n break;\n }\n default:\n matchResult_20 = 1;\n }\n }\n else {\n matchResult_20 = 1;\n }\n }\n else {\n matchResult_20 = 1;\n }\n }\n else {\n matchResult_20 = 1;\n }\n switch (matchResult_20) {\n case 0: {\n activePatternResult_22 = [c_5, rest_5];\n break;\n }\n default:\n activePatternResult_22 = undefined;\n }\n if (activePatternResult_22 != null) {\n matchResult = 3;\n c_6 = activePatternResult_22[0];\n rest_9 = activePatternResult_22[1];\n }\n else {\n let activePatternResult_23;\n const startl_10 = ofArray([\"`\", \" \"]);\n const endl_10 = ofArray([\" \", \"`\"]);\n const input_27 = matchValue_2;\n if ((loop_10 = ((start_1_10_mut, list_1_11_mut) => {\n loop_10:\n while (true) {\n const start_1_10 = start_1_10_mut, list_1_11 = list_1_11_mut;\n let matchResult_21, x_1_10, xs_1_10, y_1_10, ys_1_10;\n if (isEmpty(start_1_10)) {\n matchResult_21 = 1;\n }\n else if (!isEmpty(list_1_11)) {\n if (head(start_1_10) === head(list_1_11)) {\n matchResult_21 = 0;\n x_1_10 = head(start_1_10);\n xs_1_10 = tail(start_1_10);\n y_1_10 = head(list_1_11);\n ys_1_10 = tail(list_1_11);\n }\n else {\n matchResult_21 = 2;\n }\n }\n else {\n matchResult_21 = 2;\n }\n switch (matchResult_21) {\n case 0: {\n start_1_10_mut = xs_1_10;\n list_1_11_mut = ys_1_10;\n continue loop_10;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_10(startl_10, input_27))) {\n const matchValue_24 = List_partitionUntilEquals(endl_10, skip(length(startl_10), input_27));\n if (matchValue_24 == null) {\n activePatternResult_23 = undefined;\n }\n else {\n const post_10 = matchValue_24[1];\n activePatternResult_23 = [matchValue_24[0], skip(length(endl_10), post_10), length(startl_10), length(endl_10)];\n }\n }\n else {\n activePatternResult_23 = undefined;\n }\n if (activePatternResult_23 != null) {\n matchResult = 4;\n body = activePatternResult_23[0];\n e = activePatternResult_23[3];\n rest_10 = activePatternResult_23[1];\n s = activePatternResult_23[2];\n }\n else {\n let activePatternResult_24;\n const input_28 = matchValue_2;\n const strs_5 = List_partitionWhile((i_5) => (i_5 === \"`\"), input_28)[0];\n activePatternResult_24 = (!isEmpty(strs_5) ? ((str_11 = initialize(length(strs_5), (_arg_5) => \"`\"), (input_29) => {\n let loop_11;\n const startl_11 = str_11;\n const endl_11 = str_11;\n const input_30 = input_29;\n if ((loop_11 = ((start_1_11_mut, list_1_12_mut) => {\n loop_11:\n while (true) {\n const start_1_11 = start_1_11_mut, list_1_12 = list_1_12_mut;\n let matchResult_22, x_1_11, xs_1_11, y_1_11, ys_1_11;\n if (isEmpty(start_1_11)) {\n matchResult_22 = 1;\n }\n else if (!isEmpty(list_1_12)) {\n if (head(start_1_11) === head(list_1_12)) {\n matchResult_22 = 0;\n x_1_11 = head(start_1_11);\n xs_1_11 = tail(start_1_11);\n y_1_11 = head(list_1_12);\n ys_1_11 = tail(list_1_12);\n }\n else {\n matchResult_22 = 2;\n }\n }\n else {\n matchResult_22 = 2;\n }\n switch (matchResult_22) {\n case 0: {\n start_1_11_mut = xs_1_11;\n list_1_12_mut = ys_1_11;\n continue loop_11;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_11(startl_11, input_30))) {\n const matchValue_26 = List_partitionUntilEquals(endl_11, skip(length(startl_11), input_30));\n if (matchValue_26 == null) {\n return undefined;\n }\n else {\n const post_11 = matchValue_26[1];\n return [matchValue_26[0], skip(length(endl_11), post_11), length(startl_11), length(endl_11)];\n }\n }\n else {\n return undefined;\n }\n }))(input_28) : undefined);\n if (activePatternResult_24 != null) {\n matchResult = 4;\n body = activePatternResult_24[0];\n e = activePatternResult_24[3];\n rest_10 = activePatternResult_24[1];\n s = activePatternResult_24[2];\n }\n else {\n matchResult = 5;\n }\n }\n }\n }\n }\n switch (matchResult) {\n case 0: {\n const patternInput_6 = accLiterals.Value;\n const ctx_2 = patternInput_6[1];\n return append(patternInput_6[0], delay(() => append(singleton_1(new MarkdownSpan(9, [ctx_2.CurrentRange])), delay(() => parseChars(empty(), rest_6, ctx_2)))));\n }\n case 1: {\n const patternInput_7 = accLiterals.Value;\n const ctx_3 = patternInput_7[1];\n return append(patternInput_7[0], delay(() => append(singleton_1(new MarkdownSpan(0, [entity, ctx_3.CurrentRange])), delay(() => parseChars(empty(), rest_7, ctx_3)))));\n }\n case 2:\n return parseChars(ofArrayWithTail([\";\", \"p\", \"m\", \"a\", \"&\"], acc), rest_8, ctx);\n case 3:\n return parseChars(cons(c_6, acc), rest_9, ctx);\n case 4: {\n const patternInput_8 = accLiterals.Value;\n const ctx_4 = patternInput_8[1];\n return append(patternInput_8[0], delay(() => {\n let inputRecord_2;\n let rng;\n const matchValue_27 = ctx_4.CurrentRange;\n if (matchValue_27 == null) {\n rng = undefined;\n }\n else {\n const n_2 = matchValue_27;\n rng = ((inputRecord_2 = n_2, new MarkdownRange(inputRecord_2.StartLine, n_2.StartColumn + s, inputRecord_2.EndLine, n_2.EndColumn - e)));\n }\n return append(singleton_1(new MarkdownSpan(1, [(toArray(body).join('')).trim(), rng])), delay(() => parseChars(empty(), rest_10, ctx_4)));\n }));\n }\n default: {\n let matchResult_1, body_1, rest_12, body_2, rest_13, _e_1, _s_1, link_1, rest_14;\n const activePatternResult_25 = $007CDelimitedLatexDisplayMath$007C_$007C(ofArray([\"$\", \"$\"]), matchValue_2);\n if (activePatternResult_25 != null) {\n matchResult_1 = 0;\n body_1 = activePatternResult_25[0];\n rest_12 = activePatternResult_25[1];\n }\n else {\n const activePatternResult_26 = $007CDelimitedLatexInlineMath$007C_$007C(singleton(\"$\"), matchValue_2);\n if (activePatternResult_26 != null) {\n matchResult_1 = 1;\n body_2 = activePatternResult_26[0];\n rest_13 = activePatternResult_26[1];\n }\n else {\n let activePatternResult_27;\n const startl_12 = singleton(\"<\");\n const endl_12 = singleton(\">\");\n const input_31 = matchValue_2;\n if ((loop_12 = ((start_1_12_mut, list_1_13_mut) => {\n loop_12:\n while (true) {\n const start_1_12 = start_1_12_mut, list_1_13 = list_1_13_mut;\n let matchResult_4, x_1_12, xs_1_12, y_1_12, ys_1_12;\n if (isEmpty(start_1_12)) {\n matchResult_4 = 1;\n }\n else if (!isEmpty(list_1_13)) {\n if (head(start_1_12) === head(list_1_13)) {\n matchResult_4 = 0;\n x_1_12 = head(start_1_12);\n xs_1_12 = tail(start_1_12);\n y_1_12 = head(list_1_13);\n ys_1_12 = tail(list_1_13);\n }\n else {\n matchResult_4 = 2;\n }\n }\n else {\n matchResult_4 = 2;\n }\n switch (matchResult_4) {\n case 0: {\n start_1_12_mut = xs_1_12;\n list_1_13_mut = ys_1_12;\n continue loop_12;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_12(startl_12, input_31))) {\n const matchValue_29 = List_partitionUntilEquals(endl_12, skip(length(startl_12), input_31));\n if (matchValue_29 == null) {\n activePatternResult_27 = undefined;\n }\n else {\n const post_12 = matchValue_29[1];\n activePatternResult_27 = [matchValue_29[0], skip(length(endl_12), post_12), length(startl_12), length(endl_12)];\n }\n }\n else {\n activePatternResult_27 = undefined;\n }\n if (activePatternResult_27 != null) {\n const activePatternResult_28 = List_$007CAsString$007C(activePatternResult_27[0]);\n if ((rest_11 = activePatternResult_27[1], (link = activePatternResult_28, (_s = (activePatternResult_27[2] | 0), (_e = (activePatternResult_27[3] | 0), forAll((arg) => !isWhiteSpace(arg), link.split(\"\")) && ((link.indexOf(\"@\") >= 0) ? true : (link.indexOf(\"://\") >= 0))))))) {\n matchResult_1 = 2;\n _e_1 = activePatternResult_27[3];\n _s_1 = activePatternResult_27[2];\n link_1 = activePatternResult_28;\n rest_14 = activePatternResult_27[1];\n }\n else {\n matchResult_1 = 3;\n }\n }\n else {\n matchResult_1 = 3;\n }\n }\n }\n switch (matchResult_1) {\n case 0: {\n const patternInput_9 = accLiterals.Value;\n const ctx_5 = patternInput_9[1];\n return append(patternInput_9[0], delay(() => append(singleton_1(new MarkdownSpan(11, [(toArray(body_1).join('')).trim(), ctx_5.CurrentRange])), delay(() => parseChars(empty(), rest_12, ctx_5)))));\n }\n case 1: {\n const patternInput_10 = accLiterals.Value;\n const ctx_6 = patternInput_10[1];\n const ctx_7 = new ParsingContext(ctx_6.Links, ctx_6.Newline, ctx_6.IsFirst, (matchValue_30 = ctx_6.CurrentRange, (matchValue_30 == null) ? undefined : ((n_3 = matchValue_30, (inputRecord_3 = n_3, new MarkdownRange(inputRecord_3.StartLine, n_3.StartColumn + 1, inputRecord_3.EndLine, inputRecord_3.EndColumn))))), ctx_6.ParseOptions);\n return append(patternInput_10[0], delay(() => {\n let matchValue_31, n_4, inputRecord_4;\n const code = (toArray(body_2).join('')).trim();\n return append(singleton_1(new MarkdownSpan(10, [code, (matchValue_31 = ctx_7.CurrentRange, (matchValue_31 == null) ? undefined : ((n_4 = matchValue_31, (inputRecord_4 = n_4, new MarkdownRange(inputRecord_4.StartLine, inputRecord_4.StartColumn, inputRecord_4.EndLine, n_4.StartColumn + code.length)))))])), delay(() => parseChars(empty(), rest_13, ctx_7)));\n }));\n }\n case 2: {\n const patternInput_11 = accLiterals.Value;\n const ctx_8 = patternInput_11[1];\n return append(patternInput_11[0], delay(() => append(singleton_1(new MarkdownSpan(5, [singleton(new MarkdownSpan(0, [link_1, ctx_8.CurrentRange])), link_1, undefined, ctx_8.CurrentRange])), delay(() => parseChars(empty(), rest_14, ctx_8)))));\n }\n default: {\n let matchResult_2, _e_2, _s_2, rest_15, tag, body_3, link_2, rest_16, body_4, link_4, original, rest_17, link_5, rest_18, body_5, link_6, rest_19, body_6, link_8, original_1, rest_20, body_7, f, rest_21, rest_22, rest_23, x_15, xs_15;\n let activePatternResult_29;\n const startl_13 = singleton(\"<\");\n const endl_13 = singleton(\">\");\n const input_32 = matchValue_2;\n if ((loop_13 = ((start_1_13_mut, list_1_14_mut) => {\n loop_13:\n while (true) {\n const start_1_13 = start_1_13_mut, list_1_14 = list_1_14_mut;\n let matchResult_3, x_1_13, xs_1_13, y_1_13, ys_1_13;\n if (isEmpty(start_1_13)) {\n matchResult_3 = 1;\n }\n else if (!isEmpty(list_1_14)) {\n if (head(start_1_13) === head(list_1_14)) {\n matchResult_3 = 0;\n x_1_13 = head(start_1_13);\n xs_1_13 = tail(start_1_13);\n y_1_13 = head(list_1_14);\n ys_1_13 = tail(list_1_14);\n }\n else {\n matchResult_3 = 2;\n }\n }\n else {\n matchResult_3 = 2;\n }\n switch (matchResult_3) {\n case 0: {\n start_1_13_mut = xs_1_13;\n list_1_14_mut = ys_1_13;\n continue loop_13;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_13(startl_13, input_32))) {\n const matchValue_33 = List_partitionUntilEquals(endl_13, skip(length(startl_13), input_32));\n if (matchValue_33 == null) {\n activePatternResult_29 = undefined;\n }\n else {\n const post_13 = matchValue_33[1];\n activePatternResult_29 = [matchValue_33[0], skip(length(endl_13), post_13), length(startl_13), length(endl_13)];\n }\n }\n else {\n activePatternResult_29 = undefined;\n }\n if (activePatternResult_29 != null) {\n matchResult_2 = 0;\n _e_2 = activePatternResult_29[3];\n _s_2 = activePatternResult_29[2];\n rest_15 = activePatternResult_29[1];\n tag = activePatternResult_29[0];\n }\n else {\n const activePatternResult_30 = $007CDirectLink$007C_$007C(matchValue_2);\n if (activePatternResult_30 != null) {\n matchResult_2 = 1;\n body_3 = activePatternResult_30[0];\n link_2 = activePatternResult_30[1];\n rest_16 = activePatternResult_30[2];\n }\n else {\n const activePatternResult_31 = $007CIndirectLink$007C_$007C(matchValue_2);\n if (activePatternResult_31 != null) {\n matchResult_2 = 2;\n body_4 = activePatternResult_31[0];\n link_4 = activePatternResult_31[1];\n original = activePatternResult_31[2];\n rest_17 = activePatternResult_31[3];\n }\n else {\n const activePatternResult_32 = $007CAutoLink$007C_$007C(matchValue_2);\n if (activePatternResult_32 != null) {\n matchResult_2 = 3;\n link_5 = activePatternResult_32[0];\n rest_18 = activePatternResult_32[1];\n }\n else if (isEmpty(matchValue_2)) {\n const activePatternResult_33 = $007CEmphasised$007C_$007C(matchValue_2);\n if (activePatternResult_33 != null) {\n matchResult_2 = 6;\n body_7 = activePatternResult_33[0];\n f = activePatternResult_33[1];\n rest_21 = activePatternResult_33[2];\n }\n else {\n matchResult_2 = 10;\n }\n }\n else {\n switch (head(matchValue_2)) {\n case \"!\": {\n const activePatternResult_34 = $007CDirectLink$007C_$007C(tail(matchValue_2));\n if (activePatternResult_34 != null) {\n matchResult_2 = 4;\n body_5 = activePatternResult_34[0];\n link_6 = activePatternResult_34[1];\n rest_19 = activePatternResult_34[2];\n }\n else {\n const activePatternResult_35 = $007CIndirectLink$007C_$007C(tail(matchValue_2));\n if (activePatternResult_35 != null) {\n matchResult_2 = 5;\n body_6 = activePatternResult_35[0];\n link_8 = activePatternResult_35[1];\n original_1 = activePatternResult_35[2];\n rest_20 = activePatternResult_35[3];\n }\n else {\n const activePatternResult_36 = $007CEmphasised$007C_$007C(matchValue_2);\n if (activePatternResult_36 != null) {\n matchResult_2 = 6;\n body_7 = activePatternResult_36[0];\n f = activePatternResult_36[1];\n rest_21 = activePatternResult_36[2];\n }\n else {\n matchResult_2 = 9;\n x_15 = head(matchValue_2);\n xs_15 = tail(matchValue_2);\n }\n }\n }\n break;\n }\n case \"<\": {\n const activePatternResult_37 = $007CEmphasised$007C_$007C(matchValue_2);\n if (activePatternResult_37 != null) {\n matchResult_2 = 6;\n body_7 = activePatternResult_37[0];\n f = activePatternResult_37[1];\n rest_21 = activePatternResult_37[2];\n }\n else {\n matchResult_2 = 7;\n rest_22 = tail(matchValue_2);\n }\n break;\n }\n case \">\": {\n const activePatternResult_38 = $007CEmphasised$007C_$007C(matchValue_2);\n if (activePatternResult_38 != null) {\n matchResult_2 = 6;\n body_7 = activePatternResult_38[0];\n f = activePatternResult_38[1];\n rest_21 = activePatternResult_38[2];\n }\n else {\n matchResult_2 = 8;\n rest_23 = tail(matchValue_2);\n }\n break;\n }\n default: {\n const activePatternResult_39 = $007CEmphasised$007C_$007C(matchValue_2);\n if (activePatternResult_39 != null) {\n matchResult_2 = 6;\n body_7 = activePatternResult_39[0];\n f = activePatternResult_39[1];\n rest_21 = activePatternResult_39[2];\n }\n else {\n matchResult_2 = 9;\n x_15 = head(matchValue_2);\n xs_15 = tail(matchValue_2);\n }\n }\n }\n }\n }\n }\n }\n switch (matchResult_2) {\n case 0:\n return parseChars(append_1(cons(\">\", reverse(tag)), cons(\"<\", acc)), rest_15, ctx);\n case 1: {\n const patternInput_12 = accLiterals.Value;\n const ctx_9 = patternInput_12[1];\n return append(patternInput_12[0], delay(() => {\n const patternInput_13 = getLinkAndTitle(toArray(link_2).join(''), MarkdownRangeModule_zero);\n return append(singleton_1(new MarkdownSpan(5, [ofSeq(parseChars(empty(), body_3, ctx_9)), patternInput_13[0], patternInput_13[1], ctx_9.CurrentRange])), delay(() => parseChars(empty(), rest_16, ctx_9)));\n }));\n }\n case 2: {\n const patternInput_14 = accLiterals.Value;\n const ctx_10 = patternInput_14[1];\n return append(patternInput_14[0], delay(() => {\n const key = isNullOrEmpty(link_4) ? (Array.from(body_4).join('')) : link_4;\n return append(singleton_1(new MarkdownSpan(6, [ofSeq(parseChars(empty(), body_4, ctx_10)), original, key, ctx_10.CurrentRange])), delay(() => parseChars(empty(), rest_17, ctx_10)));\n }));\n }\n case 3: {\n const patternInput_15 = accLiterals.Value;\n const ctx_11 = patternInput_15[1];\n return append(patternInput_15[0], delay(() => append(singleton_1(new MarkdownSpan(5, [singleton(new MarkdownSpan(0, [link_5, ctx_11.CurrentRange])), link_5, undefined, ctx_11.CurrentRange])), delay(() => parseChars(empty(), rest_18, ctx_11)))));\n }\n case 4: {\n const patternInput_16 = accLiterals.Value;\n const ctx_12 = patternInput_16[1];\n return append(patternInput_16[0], delay(() => {\n const patternInput_17 = getLinkAndTitle(toArray(link_6).join(''), MarkdownRangeModule_zero);\n return append(singleton_1(new MarkdownSpan(7, [toArray(body_5).join(''), patternInput_17[0], patternInput_17[1], ctx_12.CurrentRange])), delay(() => parseChars(empty(), rest_19, ctx_12)));\n }));\n }\n case 5: {\n const patternInput_18 = accLiterals.Value;\n const ctx_13 = patternInput_18[1];\n return append(patternInput_18[0], delay(() => {\n const key_1 = isNullOrEmpty(link_8) ? (Array.from(body_6).join('')) : link_8;\n return append(singleton_1(new MarkdownSpan(8, [toArray(body_6).join(''), original_1, key_1, ctx_13.CurrentRange])), delay(() => parseChars(empty(), rest_20, ctx_13)));\n }));\n }\n case 6: {\n const patternInput_19 = accLiterals.Value;\n const ctx_14 = patternInput_19[1];\n return append(patternInput_19[0], delay(() => append(singleton_1(f([ofSeq(parseChars(empty(), body_7, ctx_14)), ctx_14.CurrentRange])), delay(() => parseChars(empty(), rest_21, ctx_14)))));\n }\n case 7:\n return parseChars(ofArrayWithTail([\";\", \"t\", \"l\", \"&\"], acc), rest_22, ctx);\n case 8:\n return parseChars(ofArrayWithTail([\";\", \"t\", \"g\", \"&\"], acc), rest_23, ctx);\n case 9:\n return parseChars(cons(x_15, acc), xs_15, ctx);\n default:\n return accLiterals.Value[0];\n }\n }\n }\n }\n }\n });\n}\n\n/**\n * Parse body of a paragraph into a list of Markdown inline spans\n */\nexport function parseSpans(_arg1_, _arg1__1, ctx) {\n const _arg = [_arg1_, _arg1__1];\n const activePatternResult = StringPosition_$007CTrimBoth$007C(_arg[0], _arg[1]);\n const ctx_1 = new ParsingContext(ctx.Links, ctx.Newline, ctx.IsFirst, activePatternResult[1], ctx.ParseOptions);\n return ofSeq(parseChars(empty(), ofArray(activePatternResult[0].split(\"\")), ctx_1));\n}\n\nexport function trimSpaces(numSpaces_mut, s_mut) {\n trimSpaces:\n while (true) {\n const numSpaces = numSpaces_mut, s = s_mut;\n if (numSpaces <= 0) {\n return s;\n }\n else if (s.startsWith(\" \")) {\n numSpaces_mut = (numSpaces - 1);\n s_mut = substring(s, 1);\n continue trimSpaces;\n }\n else if (s.startsWith(\"\\t\")) {\n numSpaces_mut = (numSpaces - 4);\n s_mut = substring(s, 1);\n continue trimSpaces;\n }\n else {\n return s;\n }\n break;\n }\n}\n\n/**\n * Recognizes heading, either prefixed with #s or followed by === or --- line\n */\nexport function $007CHeading$007C_$007C(lines) {\n let noHash, tupledArg_5, tupledArg_2;\n let matchResult, header, line1, line2, rest;\n if (!isEmpty(lines)) {\n let activePatternResult;\n const tupledArg = head(lines);\n activePatternResult = StringPosition_$007CTrimBoth$007C(tupledArg[0], tupledArg[1]);\n if (!isEmpty(tail(lines))) {\n let activePatternResult_1;\n const tupledArg_1 = head(tail(lines));\n activePatternResult_1 = StringPosition_$007CTrimEnd$007C(tupledArg_1[0], tupledArg_1[1]);\n if (((tupledArg_2 = [\"=\", MarkdownRangeModule_zero], StringPosition_$007CEqualsRepeated$007C_$007C(tupledArg_2[0], tupledArg_2[1], activePatternResult_1[0], activePatternResult_1[1]))) != null) {\n matchResult = 0;\n header = activePatternResult;\n line1 = head(lines);\n line2 = head(tail(lines));\n rest = tail(tail(lines));\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return [1, header, ofArray([line1, line2]), rest];\n default: {\n let matchResult_1, header_1, line1_1, line2_1, rest_1;\n if (!isEmpty(lines)) {\n let activePatternResult_3;\n const tupledArg_3 = head(lines);\n activePatternResult_3 = StringPosition_$007CTrimBoth$007C(tupledArg_3[0], tupledArg_3[1]);\n if (!isEmpty(tail(lines))) {\n let activePatternResult_4;\n const tupledArg_4 = head(tail(lines));\n activePatternResult_4 = StringPosition_$007CTrimEnd$007C(tupledArg_4[0], tupledArg_4[1]);\n if (((tupledArg_5 = [\"-\", MarkdownRangeModule_zero], StringPosition_$007CEqualsRepeated$007C_$007C(tupledArg_5[0], tupledArg_5[1], activePatternResult_4[0], activePatternResult_4[1]))) != null) {\n matchResult_1 = 0;\n header_1 = activePatternResult_3;\n line1_1 = head(lines);\n line2_1 = head(tail(lines));\n rest_1 = tail(tail(lines));\n }\n else {\n matchResult_1 = 1;\n }\n }\n else {\n matchResult_1 = 1;\n }\n }\n else {\n matchResult_1 = 1;\n }\n switch (matchResult_1) {\n case 0:\n return [2, header_1, ofArray([line1_1, line2_1]), rest_1];\n default: {\n let matchResult_2, header_2, line1_2, ln_1, n_5, rest_2;\n if (!isEmpty(lines)) {\n let activePatternResult_6;\n const tupledArg_6 = head(lines);\n activePatternResult_6 = StringPosition_$007CStartsWithRepeated$007C_$007C(\"#\", tupledArg_6[0], tupledArg_6[1]);\n if (activePatternResult_6 != null) {\n let activePatternResult_7;\n const tupledArg_7 = activePatternResult_6[1];\n activePatternResult_7 = StringPosition_$007CTrimBoth$007C(tupledArg_7[0], tupledArg_7[1]);\n matchResult_2 = 0;\n header_2 = activePatternResult_7[0];\n line1_2 = head(lines);\n ln_1 = activePatternResult_7[1];\n n_5 = activePatternResult_6[0];\n rest_2 = tail(lines);\n }\n else {\n matchResult_2 = 1;\n }\n }\n else {\n matchResult_2 = 1;\n }\n switch (matchResult_2) {\n case 0:\n return [n_5, [header_2.endsWith(\"#\") ? ((noHash = trimEnd(header_2, \"#\"), ((noHash.length > 0) && isWhiteSpace(getCharAtIndex(noHash, noHash.length - 1))) ? noHash : header_2)) : header_2, ln_1], singleton(line1_2), rest_2];\n default:\n return undefined;\n }\n }\n }\n }\n }\n}\n\nexport function $007CYamlFrontmatter$007C_$007C(lines) {\n let matchResult, p, rest;\n if (!isEmpty(lines)) {\n if (head(lines)[0] === \"---\") {\n matchResult = 0;\n p = head(lines)[1];\n rest = tail(lines);\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n const yaml = takeWhile((tupledArg) => (tupledArg[0] !== \"---\"), rest);\n const yamlTextLines = map((tuple) => tuple[0], yaml);\n let rest_1;\n const _arg_2 = skipWhile((tupledArg_1) => (tupledArg_1[0] !== \"---\"), rest);\n let matchResult_1, t, l_2;\n if (!isEmpty(_arg_2)) {\n if (head(_arg_2)[0] === \"---\") {\n matchResult_1 = 0;\n t = tail(_arg_2);\n }\n else {\n matchResult_1 = 1;\n l_2 = _arg_2;\n }\n }\n else {\n matchResult_1 = 1;\n l_2 = _arg_2;\n }\n switch (matchResult_1) {\n case 0: {\n rest_1 = t;\n break;\n }\n default:\n rest_1 = l_2;\n }\n return [yamlTextLines, MarkdownRangeModule_mergeRanges(cons(p, map((tuple_1) => tuple_1[1], yaml))), rest_1];\n }\n default:\n return undefined;\n }\n}\n\n/**\n * Recognizes a horizontal rule written using *, _ or -\n */\nexport function $007CHorizontalRule$007C_$007C(line, _n) {\n const loop = (arg_mut, i_mut) => {\n loop:\n while (true) {\n const arg = arg_mut, i = i_mut;\n const arg_1 = arg;\n const u = arg_1[2] | 0;\n const h = arg_1[0] | 0;\n const a = arg_1[1] | 0;\n if ((((h >= 3) ? true : (a >= 3)) ? true : (u >= 3)) && (i === line.length)) {\n return line[0];\n }\n else if (i === line.length) {\n return undefined;\n }\n else if (isWhiteSpace(line[i])) {\n arg_mut = arg_1;\n i_mut = (i + 1);\n continue loop;\n }\n else if (((line[i] === \"-\") && (a === 0)) && (u === 0)) {\n arg_mut = [h + 1, a, u];\n i_mut = (i + 1);\n continue loop;\n }\n else if (((line[i] === \"*\") && (h === 0)) && (u === 0)) {\n arg_mut = [h, a + 1, u];\n i_mut = (i + 1);\n continue loop;\n }\n else if (((line[i] === \"_\") && (a === 0)) && (h === 0)) {\n arg_mut = [h, a, u + 1];\n i_mut = (i + 1);\n continue loop;\n }\n else {\n return undefined;\n }\n break;\n }\n };\n return loop([0, 0, 0], 0);\n}\n\n/**\n * Recognizes a code block - lines starting with four spaces (including blank)\n */\nexport function $007CNestedCodeBlock$007C_$007C(lines) {\n let takenLines, rest, _numspaces;\n let matchResult, _numspaces_1, lines_2, rest_1, takenLines_1;\n const activePatternResult = Lines_$007CTakeCodeBlock$007C_$007C(lines);\n if (activePatternResult != null) {\n const activePatternResult_1 = Lines_$007CTrimBlank$007C(activePatternResult[1]);\n if ((takenLines = activePatternResult[1], (rest = activePatternResult[2], (_numspaces = (activePatternResult[0] | 0), !equals(activePatternResult_1, empty()))))) {\n matchResult = 0;\n _numspaces_1 = activePatternResult[0];\n lines_2 = activePatternResult_1;\n rest_1 = activePatternResult[2];\n takenLines_1 = activePatternResult[1];\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return [append_1(toList(delay(() => collect((matchValue) => {\n const l = matchValue[0];\n return singleton_1(isNullOrEmpty(l) ? \"\" : trimSpaces(4, l));\n }, lines_2))), singleton(\"\")), takenLines_1, rest_1, \"\", \"\"];\n default:\n return undefined;\n }\n}\n\n/**\n * Recognizes a fenced code block - starting and ending with at least ``` or ~~~\n */\nexport function $007CFencedCodeBlock$007C_$007C(lines) {\n let indent, header, indent_1, header_1, indent_2, header_2;\n let matchResult, header_3, indent_3, lines_4, num_3, start_6, takenLine_3;\n if (!isEmpty(lines)) {\n let activePatternResult;\n const tupledArg = head(lines);\n activePatternResult = StringPosition_$007CStartsWithNTimesTrimIgnoreStartWhitespace$007C_$007C(\"~\", tupledArg[0], tupledArg[1]);\n if (activePatternResult != null) {\n const activePatternResult_1 = $007CLet$007C(\"~\", activePatternResult[0]);\n if ((indent = (activePatternResult[1] | 0), (header = activePatternResult[2], activePatternResult_1[1] > 2))) {\n matchResult = 0;\n header_3 = activePatternResult[2];\n indent_3 = activePatternResult[1];\n lines_4 = tail(lines);\n num_3 = activePatternResult_1[1];\n start_6 = activePatternResult_1[0];\n takenLine_3 = head(lines);\n }\n else {\n let activePatternResult_2;\n const tupledArg_1 = head(lines);\n activePatternResult_2 = StringPosition_$007CStartsWithNTimesTrimIgnoreStartWhitespace$007C_$007C(\"`\", tupledArg_1[0], tupledArg_1[1]);\n if (activePatternResult_2 != null) {\n const activePatternResult_3 = $007CLet$007C(\"`\", activePatternResult_2[0]);\n if ((indent_1 = (activePatternResult_2[1] | 0), (header_1 = activePatternResult_2[2], activePatternResult_3[1] > 2))) {\n matchResult = 0;\n header_3 = activePatternResult_2[2];\n indent_3 = activePatternResult_2[1];\n lines_4 = tail(lines);\n num_3 = activePatternResult_3[1];\n start_6 = activePatternResult_3[0];\n takenLine_3 = head(lines);\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n }\n else {\n let activePatternResult_4;\n const tupledArg_2 = head(lines);\n activePatternResult_4 = StringPosition_$007CStartsWithNTimesTrimIgnoreStartWhitespace$007C_$007C(\"`\", tupledArg_2[0], tupledArg_2[1]);\n if (activePatternResult_4 != null) {\n const activePatternResult_5 = $007CLet$007C(\"`\", activePatternResult_4[0]);\n if ((indent_2 = (activePatternResult_4[1] | 0), (header_2 = activePatternResult_4[2], activePatternResult_5[1] > 2))) {\n matchResult = 0;\n header_3 = activePatternResult_4[2];\n indent_3 = activePatternResult_4[1];\n lines_4 = tail(lines);\n num_3 = activePatternResult_5[1];\n start_6 = activePatternResult_5[0];\n takenLine_3 = head(lines);\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n let endStr = replicate(num_3, start_6);\n if (header_3.indexOf(start_6) >= 0) {\n return undefined;\n }\n else {\n const patternInput = List_partitionUntil((line) => {\n const matchValue = singleton(line);\n let matchResult_1, h_1, i_1, n_1;\n if (!isEmpty(matchValue)) {\n let activePatternResult_6;\n const tupledArg_3 = head(matchValue);\n activePatternResult_6 = StringPosition_$007CStartsWithNTimesTrimIgnoreStartWhitespace$007C_$007C(start_6, tupledArg_3[0], tupledArg_3[1]);\n if (activePatternResult_6 != null) {\n if (((activePatternResult_6[0] >= num_3) && (activePatternResult_6[1] < 4)) && isNullOrWhiteSpace(activePatternResult_6[2])) {\n matchResult_1 = 0;\n h_1 = activePatternResult_6[2];\n i_1 = activePatternResult_6[1];\n n_1 = activePatternResult_6[0];\n }\n else {\n matchResult_1 = 1;\n }\n }\n else {\n matchResult_1 = 1;\n }\n }\n else {\n matchResult_1 = 1;\n }\n switch (matchResult_1) {\n case 0: {\n endStr = replicate(n_1, start_6);\n return true;\n }\n default:\n return false;\n }\n }, lines_4);\n const rest = patternInput[1];\n const codeLines = patternInput[0];\n const codeWithoutIndent = toList(delay(() => collect((matchValue_1) => {\n let l;\n return singleton_1((l = matchValue_1[0], ((l.length <= indent_3) && isNullOrWhiteSpace(l)) ? \"\" : (((l.length > indent_3) && isNullOrWhiteSpace(substring(l, 0, indent_3))) ? substring(l, indent_3, l.length - indent_3) : l.trimStart())));\n }, codeLines)));\n let patternInput_1;\n if (isNullOrWhiteSpace(header_3)) {\n patternInput_1 = [\"\", \"\"];\n }\n else {\n const matchValue_2 = tryFind((_arg) => true, split(header_3, [\" \"], undefined, 1));\n if (matchValue_2 != null) {\n const langString = matchValue_2;\n const ignoredString = substring(header_3, header_3.indexOf(langString) + langString.length);\n patternInput_1 = [langString, isNullOrWhiteSpace(ignoredString) ? \"\" : ignoredString];\n }\n else {\n patternInput_1 = [\"\", \"\"];\n }\n }\n let patternInput_2;\n if (!isEmpty(rest)) {\n const tl = tail(rest);\n const takenLine2 = head(rest);\n const hd = head(rest)[0];\n const idx = hd.indexOf(endStr) | 0;\n if ((idx > -1) && ((idx + endStr.length) <= hd.length)) {\n const _pre = substring(hd, 0, idx);\n const after = substring(hd, idx + endStr.length);\n patternInput_2 = [singleton(takenLine2), append_1(codeWithoutIndent, singleton(\"\")), isNullOrWhiteSpace(after) ? tl : cons([after, head(rest)[1]], tl)];\n }\n else {\n patternInput_2 = [singleton(takenLine2), append_1(codeWithoutIndent, singleton(\"\")), tl];\n }\n }\n else {\n patternInput_2 = [empty(), codeWithoutIndent, rest];\n }\n return [patternInput_2[1], append_1(cons(takenLine_3, codeLines), patternInput_2[0]), patternInput_2[2], patternInput_1[0], patternInput_1[1]];\n }\n }\n default:\n return undefined;\n }\n}\n\n/**\n * Matches when the input starts with a number. Returns the\n * rest of the input, following the last number.\n */\nexport function $007CSkipSomeNumbers$007C_$007C(input, _n) {\n const matchValue = ofSeq(input.split(\"\"));\n let matchResult, x_1, xs_1;\n if (!isEmpty(matchValue)) {\n if (isDigit(head(matchValue))) {\n matchResult = 0;\n x_1 = head(matchValue);\n xs_1 = tail(matchValue);\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n const rest = List_partitionUntil((arg) => !isDigit(arg), xs_1)[1];\n return [input.length - length(rest), rest];\n }\n default:\n return undefined;\n }\n}\n\n/**\n * Recognizes a staring of a list (either 1. or +, *, -).\n * Returns the rest of the line, together with the indent.\n */\nexport function $007CListStart$007C_$007C(_arg1_, _arg1__1) {\n let tupledArg, inputRecord;\n const _arg = [_arg1_, _arg1__1];\n const activePatternResult = StringPosition_$007CTrimStartAndCount$007C(_arg[0], _arg[1]);\n if (((tupledArg = activePatternResult[2], StringPosition_$007CStartsWithAny$007C_$007C([\"+ \", \"* \", \"- \"], tupledArg[0], tupledArg[1]))) != null) {\n const range = activePatternResult[2][1];\n const li = [substring(activePatternResult[2][0], 2), (inputRecord = range, new MarkdownRange(inputRecord.StartLine, range.StartColumn + 2, inputRecord.EndLine, inputRecord.EndColumn))];\n const startIndent2 = StringPosition_$007CTrimStartAndCount$007C(li[0], li[1])[0] | 0;\n return [new MarkdownListKind(1, []), activePatternResult[0], (activePatternResult[0] + 2) + ((startIndent2 >= 5) ? 1 : startIndent2), li];\n }\n else {\n let matchResult, _spaces_1, item_1, skipNumCount, startIndent_1;\n const activePatternResult_3 = StringPosition_$007CTrimStartAndCount$007C(_arg[0], _arg[1]);\n let activePatternResult_4;\n const tupledArg_1 = activePatternResult_3[2];\n activePatternResult_4 = $007CSkipSomeNumbers$007C_$007C(tupledArg_1[0], tupledArg_1[1]);\n if (activePatternResult_4 != null) {\n if (!isEmpty(activePatternResult_4[1])) {\n if (head(activePatternResult_4[1]) === \".\") {\n if (!isEmpty(tail(activePatternResult_4[1]))) {\n if (head(tail(activePatternResult_4[1])) === \" \") {\n const activePatternResult_5 = List_$007CAsString$007C(tail(tail(activePatternResult_4[1])));\n matchResult = 0;\n _spaces_1 = activePatternResult_3[1];\n item_1 = activePatternResult_5;\n skipNumCount = activePatternResult_4[0];\n startIndent_1 = activePatternResult_3[0];\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n const startIndent2_1 = StringPosition_$007CTrimStartAndCount$007C(item_1, MarkdownRangeModule_zero)[0] | 0;\n return [new MarkdownListKind(0, []), startIndent_1, ((startIndent_1 + 2) + skipNumCount) + ((startIndent2_1 >= 5) ? 1 : startIndent2_1), [item_1, MarkdownRangeModule_zero]];\n }\n default:\n return undefined;\n }\n }\n}\n\n/**\n * Splits input into lines until whitespace or starting of a list and the rest.\n */\nexport function $007CLinesUntilListOrWhite$007C(lines) {\n return List_partitionUntil((_arg) => {\n let matchResult;\n if ($007CListStart$007C_$007C(_arg[0], _arg[1]) != null) {\n matchResult = 0;\n }\n else if (StringPosition_$007CWhiteSpace$007C_$007C(_arg[0], _arg[1]) != null) {\n matchResult = 0;\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return true;\n default:\n return false;\n }\n }, lines);\n}\n\n/**\n * Splits input into lines until not-indented line or starting of a list and the rest.\n */\nexport function $007CLinesUntilListOrUnindented$007C(lines) {\n return List_partitionUntilLookahead((_arg) => {\n let tupledArg, tupledArg_1, tupledArg_2, tupledArg_3;\n let matchResult;\n if (!isEmpty(_arg)) {\n if (((tupledArg = head(_arg), $007CListStart$007C_$007C(tupledArg[0], tupledArg[1]))) != null) {\n matchResult = 0;\n }\n else if (((tupledArg_1 = head(_arg), StringPosition_$007CUnindented$007C_$007C(tupledArg_1[0], tupledArg_1[1]))) != null) {\n matchResult = 0;\n }\n else if (((tupledArg_2 = head(_arg), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_2[0], tupledArg_2[1]))) != null) {\n if (!isEmpty(tail(_arg))) {\n if (((tupledArg_3 = head(tail(_arg)), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_3[0], tupledArg_3[1]))) != null) {\n matchResult = 0;\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return true;\n default:\n return false;\n }\n }, lines);\n}\n\n/**\n * Recognizes a list item until the next list item (possibly nested) or end of a list.\n * The parameter specifies whether the previous line was simple (single-line not\n * separated by a white line - simple items are not wrapped in )\n */\nexport function $007CListItem$007C_$007C(prevSimple, lines) {\n let activePatternResult_3, tupledArg_1, tupledArg_2, tupledArg_3, tupledArg_4, tupledArg_5, tupledArg_6, tupledArg_7;\n let matchResult, continued, endIndent, item, kind, more, next, rest, startIndent, takenLine;\n if (!isEmpty(lines)) {\n let activePatternResult;\n const tupledArg = head(lines);\n activePatternResult = $007CListStart$007C_$007C(tupledArg[0], tupledArg[1]);\n if (activePatternResult != null) {\n const activePatternResult_1 = $007CLinesUntilListOrWhite$007C(tail(lines));\n const activePatternResult_2 = $007CLinesUntilListOrUnindented$007C(activePatternResult_1[1]);\n matchResult = 0;\n continued = activePatternResult_1[0];\n endIndent = activePatternResult[2];\n item = activePatternResult[3];\n kind = activePatternResult[0];\n more = activePatternResult_2[0];\n next = activePatternResult_1[1];\n rest = activePatternResult_2[1];\n startIndent = activePatternResult[1];\n takenLine = head(lines);\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return [startIndent, [(activePatternResult_3 = StringPosition_$007CTrimStartAndCount$007C(item[0], item[1]), (activePatternResult_3[1] >= 4) ? false : (!isEmpty(next) ? ((((tupledArg_1 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_1[0], tupledArg_1[1]))) != null) ? (!isEmpty(rest) ? ((((tupledArg_2 = head(rest), $007CListStart$007C_$007C(tupledArg_2[0], tupledArg_2[1]))) != null) ? false : (isEmpty(next) ? true : ((((tupledArg_3 = head(next), $007CListStart$007C_$007C(tupledArg_3[0], tupledArg_3[1]))) != null) ? true : ((((tupledArg_4 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_4[0], tupledArg_4[1]))) != null) ? (isEmpty(tail(next)) ? true : (!isEmpty(next) ? ((((tupledArg_5 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_5[0], tupledArg_5[1]))) != null) ? (!isEmpty(tail(next)) ? ((((tupledArg_6 = head(tail(next)), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_6[0], tupledArg_6[1]))) != null) ? true : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple)))) : (!isEmpty(next) ? ((((tupledArg_5 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_5[0], tupledArg_5[1]))) != null) ? (!isEmpty(tail(next)) ? ((((tupledArg_6 = head(tail(next)), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_6[0], tupledArg_6[1]))) != null) ? true : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))))))) : (isEmpty(next) ? true : ((((tupledArg_3 = head(next), $007CListStart$007C_$007C(tupledArg_3[0], tupledArg_3[1]))) != null) ? true : ((((tupledArg_4 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_4[0], tupledArg_4[1]))) != null) ? (isEmpty(tail(next)) ? true : (!isEmpty(next) ? ((((tupledArg_5 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_5[0], tupledArg_5[1]))) != null) ? (!isEmpty(tail(next)) ? ((((tupledArg_6 = head(tail(next)), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_6[0], tupledArg_6[1]))) != null) ? true : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple)))) : (!isEmpty(next) ? ((((tupledArg_5 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_5[0], tupledArg_5[1]))) != null) ? (!isEmpty(tail(next)) ? ((((tupledArg_6 = head(tail(next)), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_6[0], tupledArg_6[1]))) != null) ? true : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))))))) : (isEmpty(next) ? true : ((((tupledArg_3 = head(next), $007CListStart$007C_$007C(tupledArg_3[0], tupledArg_3[1]))) != null) ? true : ((((tupledArg_4 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_4[0], tupledArg_4[1]))) != null) ? (isEmpty(tail(next)) ? true : (!isEmpty(next) ? ((((tupledArg_5 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_5[0], tupledArg_5[1]))) != null) ? (!isEmpty(tail(next)) ? ((((tupledArg_6 = head(tail(next)), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_6[0], tupledArg_6[1]))) != null) ? true : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple)))) : (!isEmpty(next) ? ((((tupledArg_5 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_5[0], tupledArg_5[1]))) != null) ? (!isEmpty(tail(next)) ? ((((tupledArg_6 = head(tail(next)), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_6[0], tupledArg_6[1]))) != null) ? true : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))))))) : (isEmpty(next) ? true : ((((tupledArg_3 = head(next), $007CListStart$007C_$007C(tupledArg_3[0], tupledArg_3[1]))) != null) ? true : ((((tupledArg_4 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_4[0], tupledArg_4[1]))) != null) ? (isEmpty(tail(next)) ? true : (!isEmpty(next) ? ((((tupledArg_5 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_5[0], tupledArg_5[1]))) != null) ? (!isEmpty(tail(next)) ? ((((tupledArg_6 = head(tail(next)), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_6[0], tupledArg_6[1]))) != null) ? true : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple)))) : (!isEmpty(next) ? ((((tupledArg_5 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_5[0], tupledArg_5[1]))) != null) ? (!isEmpty(tail(next)) ? ((((tupledArg_6 = head(tail(next)), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_6[0], tupledArg_6[1]))) != null) ? true : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple))) : (!isEmpty(rest) && ((((tupledArg_7 = head(rest), StringPosition_$007CUnindented$007C_$007C(tupledArg_7[0], tupledArg_7[1]))) != null) && prevSimple)))))))), kind, toList(delay(() => append(singleton_1(item), delay(() => append(collect((matchValue_1) => singleton_1([matchValue_1[0].trim(), matchValue_1[1]]), continued), delay(() => collect((matchValue_2) => {\n let inputRecord;\n const n_2 = matchValue_2[1];\n const line_1 = matchValue_2[0];\n const trimmed = trimSpaces(endIndent, line_1);\n return singleton_1([trimmed, (inputRecord = n_2, new MarkdownRange(inputRecord.StartLine, (n_2.StartColumn + line_1.length) - trimmed.length, inputRecord.EndLine, inputRecord.EndColumn))]);\n }, more)))))))], append_1(cons(takenLine, continued), more), rest];\n default:\n return undefined;\n }\n}\n\n/**\n * Recognizes a list - returns list items with information about\n * their indents - these need to be turned into a tree structure later.\n */\nexport function $007CListItems$007C_$007C(prevSimple, lines) {\n let tupledArg;\n const activePatternResult = $007CListItem$007C_$007C(prevSimple, lines);\n if (activePatternResult != null) {\n const indent = activePatternResult[0] | 0;\n const info = activePatternResult[1];\n const nextSimple = activePatternResult[1][0];\n const rest = activePatternResult[3];\n const takenLines = activePatternResult[2];\n let matchResult, takenLine2, items, rest_1, takenLines2;\n if (!isEmpty(rest)) {\n if (((tupledArg = head(rest), $007CHorizontalRule$007C_$007C(tupledArg[0], tupledArg[1]))) != null) {\n matchResult = 0;\n takenLine2 = head(rest);\n }\n else {\n const activePatternResult_2 = $007CListItems$007C_$007C(nextSimple, rest);\n if (activePatternResult_2 != null) {\n matchResult = 1;\n items = activePatternResult_2[0];\n rest_1 = activePatternResult_2[2];\n takenLines2 = activePatternResult_2[1];\n }\n else {\n matchResult = 2;\n }\n }\n }\n else {\n const activePatternResult_3 = $007CListItems$007C_$007C(nextSimple, rest);\n if (activePatternResult_3 != null) {\n matchResult = 1;\n items = activePatternResult_3[0];\n rest_1 = activePatternResult_3[2];\n takenLines2 = activePatternResult_3[1];\n }\n else {\n matchResult = 2;\n }\n }\n switch (matchResult) {\n case 0:\n return [singleton([indent, info]), append_1(takenLines, singleton(takenLine2)), rest];\n case 1:\n return [cons([indent, info], items), append_1(takenLines, takenLines2), rest_1];\n default:\n return [singleton([indent, info]), takenLines, rest];\n }\n }\n else {\n return undefined;\n }\n}\n\nexport function pipeTableFindSplits(delim, line) {\n let _x;\n const cLstToStr = (x) => join(\"\", toArray(x));\n const ptfs = (delim_1_mut, line_1_mut) => {\n let loop, str_1;\n ptfs:\n while (true) {\n const delim_1 = delim_1_mut, line_1 = line_1_mut;\n let matchResult, _body, rest_1, _body_1, rest_2, _body_2, _e, _s, rest_3, _body_3, _e_1, _s_1, rest_4, rest_5, x_5, rest_6;\n const activePatternResult = $007CDelimitedLatexDisplayMath$007C_$007C(ofArray([\"$\", \"$\"]), line_1);\n if (activePatternResult != null) {\n matchResult = 0;\n _body = activePatternResult[0];\n rest_1 = activePatternResult[1];\n }\n else {\n const activePatternResult_1 = $007CDelimitedLatexInlineMath$007C_$007C(singleton(\"$\"), line_1);\n if (activePatternResult_1 != null) {\n matchResult = 1;\n _body_1 = activePatternResult_1[0];\n rest_2 = activePatternResult_1[1];\n }\n else {\n let activePatternResult_2;\n const startl = ofArray([\"`\", \" \"]);\n const endl = ofArray([\" \", \"`\"]);\n const input = line_1;\n if ((loop = ((start_1_mut, list_1_1_mut) => {\n loop:\n while (true) {\n const start_1 = start_1_mut, list_1_1 = list_1_1_mut;\n let matchResult_1, x_1, xs_1, y_1, ys_1;\n if (isEmpty(start_1)) {\n matchResult_1 = 1;\n }\n else if (!isEmpty(list_1_1)) {\n if (head(start_1) === head(list_1_1)) {\n matchResult_1 = 0;\n x_1 = head(start_1);\n xs_1 = tail(start_1);\n y_1 = head(list_1_1);\n ys_1 = tail(list_1_1);\n }\n else {\n matchResult_1 = 2;\n }\n }\n else {\n matchResult_1 = 2;\n }\n switch (matchResult_1) {\n case 0: {\n start_1_mut = xs_1;\n list_1_1_mut = ys_1;\n continue loop;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop(startl, input))) {\n const matchValue_1 = List_partitionUntilEquals(endl, skip(length(startl), input));\n if (matchValue_1 == null) {\n activePatternResult_2 = undefined;\n }\n else {\n const post = matchValue_1[1];\n activePatternResult_2 = [matchValue_1[0], skip(length(endl), post), length(startl), length(endl)];\n }\n }\n else {\n activePatternResult_2 = undefined;\n }\n if (activePatternResult_2 != null) {\n matchResult = 2;\n _body_2 = activePatternResult_2[0];\n _e = activePatternResult_2[3];\n _s = activePatternResult_2[2];\n rest_3 = activePatternResult_2[1];\n }\n else {\n let activePatternResult_3;\n const input_1 = line_1;\n const strs = List_partitionWhile((i) => (i === \"`\"), input_1)[0];\n activePatternResult_3 = (!isEmpty(strs) ? ((str_1 = initialize(length(strs), (_arg) => \"`\"), (input_2) => {\n let loop_1;\n const startl_1 = str_1;\n const endl_1 = str_1;\n const input_3 = input_2;\n if ((loop_1 = ((start_1_1_mut, list_1_2_mut) => {\n loop_1:\n while (true) {\n const start_1_1 = start_1_1_mut, list_1_2 = list_1_2_mut;\n let matchResult_2, x_1_1, xs_1_1, y_1_1, ys_1_1;\n if (isEmpty(start_1_1)) {\n matchResult_2 = 1;\n }\n else if (!isEmpty(list_1_2)) {\n if (head(start_1_1) === head(list_1_2)) {\n matchResult_2 = 0;\n x_1_1 = head(start_1_1);\n xs_1_1 = tail(start_1_1);\n y_1_1 = head(list_1_2);\n ys_1_1 = tail(list_1_2);\n }\n else {\n matchResult_2 = 2;\n }\n }\n else {\n matchResult_2 = 2;\n }\n switch (matchResult_2) {\n case 0: {\n start_1_1_mut = xs_1_1;\n list_1_2_mut = ys_1_1;\n continue loop_1;\n }\n case 1:\n return true;\n default:\n return false;\n }\n break;\n }\n }), loop_1(startl_1, input_3))) {\n const matchValue_3 = List_partitionUntilEquals(endl_1, skip(length(startl_1), input_3));\n if (matchValue_3 == null) {\n return undefined;\n }\n else {\n const post_1 = matchValue_3[1];\n return [matchValue_3[0], skip(length(endl_1), post_1), length(startl_1), length(endl_1)];\n }\n }\n else {\n return undefined;\n }\n }))(input_1) : undefined);\n if (activePatternResult_3 != null) {\n matchResult = 3;\n _body_3 = activePatternResult_3[0];\n _e_1 = activePatternResult_3[3];\n _s_1 = activePatternResult_3[2];\n rest_4 = activePatternResult_3[1];\n }\n else if (isEmpty(line_1)) {\n matchResult = 6;\n }\n else if (delim_1.some((y_3) => (head(line_1) === y_3))) {\n matchResult = 4;\n rest_5 = tail(line_1);\n x_5 = head(line_1);\n }\n else if (head(line_1) === \"\\\\\") {\n if (!isEmpty(tail(line_1))) {\n matchResult = 5;\n rest_6 = tail(tail(line_1));\n }\n else {\n matchResult = 5;\n rest_6 = tail(line_1);\n }\n }\n else {\n matchResult = 5;\n rest_6 = tail(line_1);\n }\n }\n }\n }\n switch (matchResult) {\n case 0: {\n delim_1_mut = delim_1;\n line_1_mut = rest_1;\n continue ptfs;\n }\n case 1: {\n delim_1_mut = delim_1;\n line_1_mut = rest_2;\n continue ptfs;\n }\n case 2: {\n delim_1_mut = delim_1;\n line_1_mut = rest_3;\n continue ptfs;\n }\n case 3: {\n delim_1_mut = delim_1;\n line_1_mut = rest_4;\n continue ptfs;\n }\n case 4:\n return rest_5;\n case 5: {\n delim_1_mut = delim_1;\n line_1_mut = rest_6;\n continue ptfs;\n }\n default:\n return undefined;\n }\n break;\n }\n };\n const rest_7 = ptfs(delim, line);\n if (rest_7 != null) {\n if ((_x = rest_7, equals(line, empty()))) {\n const _x_1 = rest_7;\n return singleton(\"\");\n }\n else {\n const x_6 = rest_7;\n return cons(cLstToStr(toList(take((length(line) - length(x_6)) - 1, line))), pipeTableFindSplits(delim, x_6));\n }\n }\n else {\n return singleton(cLstToStr(line));\n }\n}\n\n/**\n * Recognizes alignment specified in the passed separator line.\n */\nexport function $007CTableCellSeparator$007C_$007C(_arg1_, _arg1__1) {\n let tupledArg_8, tupledArg_6, tupledArg_7, tupledArg_3, tupledArg_4, tupledArg_1, tupledArg_2;\n const _arg = [_arg1_, _arg1__1];\n let matchResult;\n let activePatternResult;\n const tupledArg = [\":\", \":\"];\n activePatternResult = StringPosition_$007CStartsAndEndsWith$007C_$007C(tupledArg[0], tupledArg[1], _arg[0], _arg[1]);\n if (activePatternResult != null) {\n if (((tupledArg_1 = [\"-\", MarkdownRangeModule_zero], (tupledArg_2 = activePatternResult, StringPosition_$007CEqualsRepeated$007C_$007C(tupledArg_1[0], tupledArg_1[1], tupledArg_2[0], tupledArg_2[1])))) != null) {\n matchResult = 0;\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return new MarkdownColumnAlignment(2, []);\n default: {\n let matchResult_1;\n const activePatternResult_2 = StringPosition_$007CStartsWith$007C_$007C(\":\", _arg[0], _arg[1]);\n if (activePatternResult_2 != null) {\n if (((tupledArg_3 = [\"-\", MarkdownRangeModule_zero], (tupledArg_4 = activePatternResult_2, StringPosition_$007CEqualsRepeated$007C_$007C(tupledArg_3[0], tupledArg_3[1], tupledArg_4[0], tupledArg_4[1])))) != null) {\n matchResult_1 = 0;\n }\n else {\n matchResult_1 = 1;\n }\n }\n else {\n matchResult_1 = 1;\n }\n switch (matchResult_1) {\n case 0:\n return new MarkdownColumnAlignment(0, []);\n default: {\n let matchResult_2;\n let activePatternResult_4;\n const tupledArg_5 = [\"\", \":\"];\n activePatternResult_4 = StringPosition_$007CStartsAndEndsWith$007C_$007C(tupledArg_5[0], tupledArg_5[1], _arg[0], _arg[1]);\n if (activePatternResult_4 != null) {\n if (((tupledArg_6 = [\"-\", MarkdownRangeModule_zero], (tupledArg_7 = activePatternResult_4, StringPosition_$007CEqualsRepeated$007C_$007C(tupledArg_6[0], tupledArg_6[1], tupledArg_7[0], tupledArg_7[1])))) != null) {\n matchResult_2 = 0;\n }\n else {\n matchResult_2 = 1;\n }\n }\n else {\n matchResult_2 = 1;\n }\n switch (matchResult_2) {\n case 0:\n return new MarkdownColumnAlignment(1, []);\n default:\n if (((tupledArg_8 = [\"-\", MarkdownRangeModule_zero], StringPosition_$007CEqualsRepeated$007C_$007C(tupledArg_8[0], tupledArg_8[1], _arg[0], _arg[1]))) != null) {\n return new MarkdownColumnAlignment(3, []);\n }\n else {\n return undefined;\n }\n }\n }\n }\n }\n }\n}\n\n/**\n * Recognizes row of pipe table.\n * The function takes number of expected columns and array of delimiters.\n * Returns list of strings between delimiters.\n */\nexport function $007CPipeTableRow$007C_$007C(size, delimiters, line, n) {\n const parts = map_1((s) => [s.trim(), n], toArray(pipeTableFindSplits(delimiters, ofArray(line.split(\"\")))));\n const n_1 = parts.length | 0;\n const m = ((size == null) ? 1 : value_14(size)) | 0;\n const x = ((isNullOrEmpty(item_2(0, parts)[0]) && (n_1 > m)) ? 1 : 0) | 0;\n const y = ((isNullOrEmpty(item_2(n_1 - 1, parts)[0]) && ((n_1 - x) > m)) ? (n_1 - 2) : (n_1 - 1)) | 0;\n if ((n_1 === 1) ? true : ((size != null) && (((y - x) + 1) !== m))) {\n return undefined;\n }\n else {\n return ofArray(parts.slice(x, y + 1));\n }\n}\n\n/**\n * Recognizes separator row of pipe table.\n * Returns list of alignments.\n */\nexport function $007CPipeSeparatorRow$007C_$007C(size, _arg1_, _arg1__1) {\n const _arg = [_arg1_, _arg1__1];\n const activePatternResult = $007CPipeTableRow$007C_$007C(size, [\"|\", \"+\"], _arg[0], _arg[1]);\n if (activePatternResult != null) {\n const parts = activePatternResult;\n const alignments = choose((tupledArg) => $007CTableCellSeparator$007C_$007C(tupledArg[0], tupledArg[1]), parts);\n if (length(parts) !== length(alignments)) {\n return undefined;\n }\n else {\n return alignments;\n }\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Recognizes pipe table\n */\nexport function $007CPipeTableBlock$007C_$007C(input) {\n const getTableRows = (size_mut, acc_mut, takenLinesAcc_mut, lines_mut) => {\n getTableRows:\n while (true) {\n const size = size_mut, acc = acc_mut, takenLinesAcc = takenLinesAcc_mut, lines = lines_mut;\n let matchResult, columns, rest, takenLine, rest_1;\n if (!isEmpty(lines)) {\n let activePatternResult;\n const tupledArg = head(lines);\n activePatternResult = $007CPipeTableRow$007C_$007C(size, [\"|\"], tupledArg[0], tupledArg[1]);\n if (activePatternResult != null) {\n matchResult = 0;\n columns = activePatternResult;\n rest = tail(lines);\n takenLine = head(lines);\n }\n else {\n matchResult = 1;\n rest_1 = lines;\n }\n }\n else {\n matchResult = 1;\n rest_1 = lines;\n }\n switch (matchResult) {\n case 0: {\n size_mut = size;\n acc_mut = cons(map(singleton, columns), acc);\n takenLinesAcc_mut = cons(takenLine, takenLinesAcc);\n lines_mut = rest;\n continue getTableRows;\n }\n default:\n return [reverse(acc), reverse(takenLinesAcc), rest_1];\n }\n break;\n }\n };\n let matchResult_1, alignments, rest_2, takenLine_1, headers, rest_3, takenLine_2;\n if (!isEmpty(input)) {\n let activePatternResult_1;\n const tupledArg_1 = head(input);\n activePatternResult_1 = $007CPipeSeparatorRow$007C_$007C(undefined, tupledArg_1[0], tupledArg_1[1]);\n if (activePatternResult_1 != null) {\n matchResult_1 = 0;\n alignments = activePatternResult_1;\n rest_2 = tail(input);\n takenLine_1 = head(input);\n }\n else {\n let activePatternResult_2;\n const tupledArg_2 = head(input);\n activePatternResult_2 = $007CPipeTableRow$007C_$007C(undefined, [\"|\"], tupledArg_2[0], tupledArg_2[1]);\n if (activePatternResult_2 != null) {\n matchResult_1 = 1;\n headers = activePatternResult_2;\n rest_3 = tail(input);\n takenLine_2 = head(input);\n }\n else {\n matchResult_1 = 2;\n }\n }\n }\n else {\n matchResult_1 = 2;\n }\n switch (matchResult_1) {\n case 0: {\n const patternInput = getTableRows(length(alignments), empty(), empty(), rest_2);\n return [[undefined, alignments, patternInput[0]], cons(takenLine_1, patternInput[1]), patternInput[2]];\n }\n case 1: {\n let matchResult_2, alignments_1, rest_4, takenLine2;\n if (!isEmpty(rest_3)) {\n let activePatternResult_3;\n const tupledArg_3 = head(rest_3);\n activePatternResult_3 = $007CPipeSeparatorRow$007C_$007C(length(headers), tupledArg_3[0], tupledArg_3[1]);\n if (activePatternResult_3 != null) {\n matchResult_2 = 0;\n alignments_1 = activePatternResult_3;\n rest_4 = tail(rest_3);\n takenLine2 = head(rest_3);\n }\n else {\n matchResult_2 = 1;\n }\n }\n else {\n matchResult_2 = 1;\n }\n switch (matchResult_2) {\n case 0: {\n const patternInput_1 = getTableRows(length(headers), empty(), empty(), rest_4);\n return [[map(singleton, headers), alignments_1, patternInput_1[0]], ofArrayWithTail([takenLine_2, takenLine2], patternInput_1[1]), patternInput_1[2]];\n }\n default:\n return undefined;\n }\n }\n default:\n return undefined;\n }\n}\n\n/**\n * Recognizes one line of emacs table. It can be line with content or separator line.\n * The function takes positions of grid columns (if known) and expected grid separator.\n * Passed function is used to check whether all parts within grid are valid.\n * Retuns tuple (position of grid columns, text between grid columns).\n */\nexport function $007CEmacsTableLine$007C_$007C(grid, c, check, line, _n) {\n let p;\n if (grid != null) {\n p = value_14(grid);\n }\n else {\n const array = toArray_1(rangeDouble(0, 1, line.length - 1));\n p = array.filter((i) => (line[i] === c));\n }\n const n = (p.length - 1) | 0;\n if (((n < 2) ? true : (line.length <= item_2(n, p))) ? true : p.some((i_1) => (line[i_1] !== c))) {\n return undefined;\n }\n else {\n const parts = map((i_2) => {\n const rng = new MarkdownRange(n, 0, n, (item_2(i_2, p) - item_2(i_2 - 1, p)) - 1);\n return [substring(line, item_2(i_2 - 1, p) + 1, (item_2(i_2, p) - item_2(i_2 - 1, p)) - 1), rng];\n }, toList(rangeDouble(1, 1, n)));\n if (forAll_1(check, parts)) {\n return [p, parts];\n }\n else {\n return undefined;\n }\n }\n}\n\n/**\n * Recognizes emacs table\n */\nexport function $007CEmacsTableBlock$007C_$007C(lines) {\n let matchResult, grid_1, parts, rest, takenLine;\n if (!isEmpty(lines)) {\n let activePatternResult;\n const tupledArg_4 = head(lines);\n activePatternResult = $007CEmacsTableLine$007C_$007C(undefined, \"+\", (arg_1) => {\n let tupledArg_1;\n return ((tupledArg_1 = arg_1, $007CTableCellSeparator$007C_$007C(tupledArg_1[0], tupledArg_1[1]))) != null;\n }, tupledArg_4[0], tupledArg_4[1]);\n if (activePatternResult != null) {\n matchResult = 0;\n grid_1 = activePatternResult[0];\n parts = activePatternResult[1];\n rest = tail(lines);\n takenLine = head(lines);\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n const alignments = choose((tupledArg_5) => $007CTableCellSeparator$007C_$007C(tupledArg_5[0], tupledArg_5[1]), parts);\n const emptyCur = replicate_1(grid_1.length - 1, empty());\n const loop = (flag_mut, takenLines2_mut, headers_mut, prevRows_mut, cur_mut, lines_1_mut) => {\n let tupledArg_7, tupledArg_8;\n loop:\n while (true) {\n const flag = flag_mut, takenLines2 = takenLines2_mut, headers = headers_mut, prevRows = prevRows_mut, cur = cur_mut, lines_1 = lines_1_mut;\n let matchResult_1, others_1, parts_1, takenLine2_1, others_2, takenLine2_2, others_3, takenLine2_3;\n if (!isEmpty(lines_1)) {\n let activePatternResult_1;\n const tupledArg_6 = head(lines_1);\n activePatternResult_1 = $007CEmacsTableLine$007C_$007C(grid_1, \"|\", (tupledArg_3) => true, tupledArg_6[0], tupledArg_6[1]);\n if (activePatternResult_1 != null) {\n matchResult_1 = 0;\n others_1 = tail(lines_1);\n parts_1 = activePatternResult_1[1];\n takenLine2_1 = head(lines_1);\n }\n else if (((tupledArg_7 = head(lines_1), $007CEmacsTableLine$007C_$007C(grid_1, \"+\", (arg) => {\n let tupledArg;\n return ((tupledArg = arg, StringPosition_$007CEqualsRepeated$007C_$007C(\"-\", MarkdownRangeModule_zero, tupledArg[0], tupledArg[1]))) != null;\n }, tupledArg_7[0], tupledArg_7[1]))) != null) {\n matchResult_1 = 1;\n others_2 = tail(lines_1);\n takenLine2_2 = head(lines_1);\n }\n else if (((tupledArg_8 = head(lines_1), $007CEmacsTableLine$007C_$007C(grid_1, \"+\", (arg_2) => {\n let tupledArg_2;\n return ((tupledArg_2 = arg_2, StringPosition_$007CEqualsRepeated$007C_$007C(\"=\", MarkdownRangeModule_zero, tupledArg_2[0], tupledArg_2[1]))) != null;\n }, tupledArg_8[0], tupledArg_8[1]))) != null) {\n if (headers == null) {\n matchResult_1 = 2;\n others_3 = tail(lines_1);\n takenLine2_3 = head(lines_1);\n }\n else {\n matchResult_1 = 3;\n }\n }\n else {\n matchResult_1 = 3;\n }\n }\n else {\n matchResult_1 = 3;\n }\n switch (matchResult_1) {\n case 0: {\n flag_mut = false;\n takenLines2_mut = cons(takenLine2_1, takenLines2);\n headers_mut = headers;\n prevRows_mut = prevRows;\n cur_mut = map((tupledArg_9) => {\n const _arg = tupledArg_9[0];\n return cons([_arg[0].trimEnd(), _arg[1]], tupledArg_9[1]);\n }, zip(parts_1, cur));\n lines_1_mut = others_1;\n continue loop;\n }\n case 1: {\n flag_mut = true;\n takenLines2_mut = cons(takenLine2_2, takenLines2);\n headers_mut = headers;\n prevRows_mut = cons(map(reverse, cur), prevRows);\n cur_mut = emptyCur;\n lines_1_mut = others_2;\n continue loop;\n }\n case 2: {\n flag_mut = true;\n takenLines2_mut = cons(takenLine2_3, takenLines2);\n headers_mut = map(reverse, cur);\n prevRows_mut = prevRows;\n cur_mut = emptyCur;\n lines_1_mut = others_3;\n continue loop;\n }\n default:\n if (flag) {\n return [[headers, alignments, reverse(prevRows)], cons(takenLine, reverse(takenLines2)), lines_1];\n }\n else {\n return undefined;\n }\n }\n break;\n }\n };\n return loop(true, empty(), undefined, empty(), emptyCur, rest);\n }\n default:\n return undefined;\n }\n}\n\n/**\n * Recognizes a start of a blockquote\n */\nexport function $007CBlockquoteStart$007C_$007C(line, n) {\n let inputRecord;\n const match$0027 = match(create(\"(^ {0,3})>(\\\\s?)(.*)\"), line);\n if (match$0027 != null) {\n const group = match$0027[3];\n const index = (match$0027[1].length + match$0027[2].length) | 0;\n return [group || \"\", (inputRecord = n, new MarkdownRange(inputRecord.StartLine, n.StartColumn + index, inputRecord.EndLine, (n.StartColumn + index) + group.length))];\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Takes lines that belong to a continuing paragraph until\n * a white line or start of other paragraph-item is found\n */\nexport function $007CTakeParagraphLines$007C_$007C(input) {\n const matchValue = List_partitionWhileLookahead((_arg) => {\n let tupledArg, tupledArg_1;\n return ($007CHeading$007C_$007C(_arg) != null) ? false : (($007CFencedCodeBlock$007C_$007C(_arg) != null) ? false : (!isEmpty(_arg) ? ((((tupledArg = head(_arg), $007CBlockquoteStart$007C_$007C(tupledArg[0], tupledArg[1]))) != null) ? false : (!(((tupledArg_1 = head(_arg), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_1[0], tupledArg_1[1]))) != null))) : true));\n }, input);\n if (!equals(matchValue[0], empty())) {\n return [matchValue[0], matchValue[1]];\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Recognize nested HTML block\n * TODO: This is too simple - takes paragraph that starts with <\n */\nexport function $007CHtmlBlock$007C_$007C(lines) {\n let rest, html;\n let matchResult, _n_1, first_1, html_1, rest_1, takenLine_1;\n if (!isEmpty(lines)) {\n const activePatternResult = $007CTakeParagraphLines$007C_$007C(lines);\n if (activePatternResult != null) {\n if ((rest = activePatternResult[1], (html = activePatternResult[0], head(lines)[0].startsWith(\"<\")))) {\n matchResult = 0;\n _n_1 = head(lines)[1];\n first_1 = head(lines)[0];\n html_1 = activePatternResult[0];\n rest_1 = activePatternResult[1];\n takenLine_1 = head(lines);\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return [html_1, cons(takenLine_1, html_1), rest_1];\n default:\n return undefined;\n }\n}\n\n/**\n * \"Markdown allows you to be lazy and only put the > before the first line of a hard-wrapped paragraph\"\n */\nexport function $007CLinesUntilBlockquoteEnds$007C(input) {\n return List_partitionUntilLookahead((next) => {\n let tupledArg, tupledArg_1;\n let matchResult;\n if (!isEmpty(next)) {\n if (((tupledArg = head(next), $007CBlockquoteStart$007C_$007C(tupledArg[0], tupledArg[1]))) != null) {\n matchResult = 0;\n }\n else if ($007CHeading$007C_$007C(next) != null) {\n matchResult = 1;\n }\n else if (((tupledArg_1 = head(next), StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_1[0], tupledArg_1[1]))) != null) {\n matchResult = 2;\n }\n else {\n matchResult = 3;\n }\n }\n else if ($007CHeading$007C_$007C(next) != null) {\n matchResult = 1;\n }\n else {\n matchResult = 3;\n }\n switch (matchResult) {\n case 0:\n return true;\n case 1:\n return true;\n case 2:\n return true;\n default:\n return false;\n }\n }, input);\n}\n\n/**\n * Recognizes blockquote - continues taking paragraphs\n * starting with '>' until there is something else\n */\nexport function $007CBlockquote$007C_$007C(lines) {\n let activePatternResult_5, lines_1, rest_2, takenLines_1;\n const activePatternResult = $007CEmptyBlockquote$007C_$007C(lines);\n if (activePatternResult != null) {\n const activePatternResult_1 = Lines_$007CTrimBlankStart$007C(activePatternResult[1]);\n const takenLines = activePatternResult[0];\n return [singleton([\"\", MarkdownRangeModule_zero]), append_1(takenLines, activePatternResult_1[0]), activePatternResult_1[1]];\n }\n else {\n let matchResult, continued, quoteLine, rest_1, takenLine, takenLines2_1;\n if (!isEmpty(lines)) {\n let activePatternResult_2;\n const tupledArg = head(lines);\n activePatternResult_2 = $007CBlockquoteStart$007C_$007C(tupledArg[0], tupledArg[1]);\n if (activePatternResult_2 != null) {\n const activePatternResult_3 = $007CLinesUntilBlockquoteEnds$007C(tail(lines));\n const activePatternResult_4 = Lines_$007CTrimBlankStart$007C(activePatternResult_3[1]);\n matchResult = 0;\n continued = activePatternResult_3[0];\n quoteLine = activePatternResult_2;\n rest_1 = activePatternResult_4[1];\n takenLine = head(lines);\n takenLines2_1 = activePatternResult_4[0];\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n const patternInput = (activePatternResult_5 = $007CBlockquote$007C_$007C(rest_1), (activePatternResult_5 != null) ? ((lines_1 = activePatternResult_5[0], (rest_2 = activePatternResult_5[2], (takenLines_1 = activePatternResult_5[1], [lines_1, takenLines_1, rest_2])))) : [empty(), empty(), rest_1]);\n return [append_1(cons(quoteLine, continued), patternInput[0]), append_1(cons(takenLine, continued), append_1(takenLines2_1, patternInput[1])), patternInput[2]];\n }\n default:\n return undefined;\n }\n }\n}\n\n/**\n * Recognizes a special case: an empty blockquote line should terminate\n * the blockquote if the next line is not a blockquote\n */\nexport function $007CEmptyBlockquote$007C_$007C(lines) {\n let tupledArg_3, tupledArg_1;\n let matchResult;\n if (!isEmpty(lines)) {\n let activePatternResult;\n const tupledArg = head(lines);\n activePatternResult = $007CBlockquoteStart$007C_$007C(tupledArg[0], tupledArg[1]);\n if (activePatternResult != null) {\n if (((tupledArg_1 = activePatternResult, StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_1[0], tupledArg_1[1]))) != null) {\n if ($007CBlockquote$007C_$007C(tail(lines)) != null) {\n matchResult = 0;\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return undefined;\n default: {\n let matchResult_1, rest, takenLine;\n if (!isEmpty(lines)) {\n let activePatternResult_3;\n const tupledArg_2 = head(lines);\n activePatternResult_3 = $007CBlockquoteStart$007C_$007C(tupledArg_2[0], tupledArg_2[1]);\n if (activePatternResult_3 != null) {\n if (((tupledArg_3 = activePatternResult_3, StringPosition_$007CWhiteSpace$007C_$007C(tupledArg_3[0], tupledArg_3[1]))) != null) {\n matchResult_1 = 0;\n rest = tail(lines);\n takenLine = head(lines);\n }\n else {\n matchResult_1 = 1;\n }\n }\n else {\n matchResult_1 = 1;\n }\n }\n else {\n matchResult_1 = 1;\n }\n switch (matchResult_1) {\n case 0:\n return [singleton(takenLine), rest];\n default:\n return undefined;\n }\n }\n }\n}\n\n/**\n * Recognizes Latex block\n * 1. indented paragraph starting with \"$$$\". This is F#-literate-specific, not part of the usual\n * ipynb way of putting latex in markdown. The \"raw markdown\" version of this (takenLines) has\n * a \\begin{equation} \\end{equation} wrapping instead of \"$$$\"\n * \n * 2. Single line latex starting with `$$`.\n * \n * 3. Block delimited by \\begin{equation} \\end{equation}.\n * \n * 4. Block delimited by \\begin{align} \\end{align}.\n * \n * See formats accepted at https://stackoverflow.com/questions/13208286/how-to-write-latex-in-ipython-notebook\n */\nexport function $007CLatexBlock$007C_$007C(lines) {\n let first_1;\n let matchResult, _takenLine1_1, first_4, n_2, rest_4, first_5, n_3, rest_6, takenLine_3, _n_2, first_6, rest_7, takenLine_4, _n_3, first_7, rest_9, takenLine_5;\n if (!isEmpty(lines)) {\n if (head(lines)[0].trimEnd() === \"$$$\") {\n matchResult = 0;\n _takenLine1_1 = head(lines);\n first_4 = head(lines)[0];\n n_2 = head(lines)[1];\n rest_4 = tail(lines);\n }\n else if ((first_1 = head(lines)[0], (first_1.trimEnd().startsWith(\"$$\") && first_1.trimEnd().endsWith(\"$$\")) && (first_1.trimEnd().length >= 4))) {\n matchResult = 1;\n first_5 = head(lines)[0];\n n_3 = head(lines)[1];\n rest_6 = tail(lines);\n takenLine_3 = head(lines);\n }\n else if (head(lines)[0].trimEnd() === \"\\\\begin{equation}\") {\n matchResult = 2;\n _n_2 = head(lines)[1];\n first_6 = head(lines)[0];\n rest_7 = tail(lines);\n takenLine_4 = head(lines);\n }\n else if (head(lines)[0].trimEnd() === \"\\\\begin{align}\") {\n matchResult = 3;\n _n_3 = head(lines)[1];\n first_7 = head(lines)[0];\n rest_9 = tail(lines);\n takenLine_5 = head(lines);\n }\n else {\n matchResult = 4;\n }\n }\n else {\n matchResult = 4;\n }\n switch (matchResult) {\n case 0: {\n const activePatternResult = $007CTakeParagraphLines$007C_$007C(rest_4);\n if (activePatternResult != null) {\n const body = activePatternResult[0];\n const rest_5 = activePatternResult[1];\n return [\"equation\", body, append_1(cons([\"\\\\begin{equation}\", n_2], body), singleton([\"\\\\end{equation}\", n_2])), rest_5];\n }\n else {\n return undefined;\n }\n }\n case 1: {\n const text = first_5.trimEnd();\n return [\"equation\", singleton([text.slice(2, (text.length - 3) + 1), n_3]), singleton(takenLine_3), rest_6];\n }\n case 2: {\n const body_1 = takeWhile((s) => (s[0] !== \"\\\\end{equation}\"), rest_7);\n const res = skipWhile((s_1) => (s_1[0] !== \"\\\\end{equation}\"), rest_7);\n if (isEmpty(res)) {\n return undefined;\n }\n else {\n return [\"equation\", body_1, cons(takenLine_4, body_1), tail(res)];\n }\n }\n case 3: {\n const body_2 = takeWhile((s_2) => (s_2[0] !== \"\\\\end{align}\"), rest_9);\n const res_1 = skipWhile((s_3) => (s_3[0] !== \"\\\\end{align}\"), rest_9);\n if (isEmpty(res_1)) {\n return undefined;\n }\n else {\n return [\"align\", body_2, cons(takenLine_5, body_2), tail(res_1)];\n }\n }\n default:\n return undefined;\n }\n}\n\n/**\n * Recognize a definition of a link as in `[key]: http://url ...`\n */\nexport function $007CLinkDefinition$007C_$007C(s) {\n let matchResult, line, link, rest, wrapped;\n if (!isEmpty(s)) {\n let activePatternResult;\n const tupledArg = [\"[\", \"]:\"];\n const tupledArg_1 = head(s);\n activePatternResult = StringPosition_$007CStartsWithWrapped$007C_$007C(tupledArg[0], tupledArg[1], tupledArg_1[0], tupledArg_1[1]);\n if (activePatternResult != null) {\n let activePatternResult_1;\n const tupledArg_2 = activePatternResult[1];\n activePatternResult_1 = StringPosition_$007CTrimBoth$007C(tupledArg_2[0], tupledArg_2[1]);\n matchResult = 0;\n line = head(s);\n link = activePatternResult_1;\n rest = tail(s);\n wrapped = activePatternResult[0];\n }\n else {\n let activePatternResult_2;\n const tupledArg_3 = [\" [\", \"]:\"];\n const tupledArg_4 = head(s);\n activePatternResult_2 = StringPosition_$007CStartsWithWrapped$007C_$007C(tupledArg_3[0], tupledArg_3[1], tupledArg_4[0], tupledArg_4[1]);\n if (activePatternResult_2 != null) {\n let activePatternResult_3;\n const tupledArg_5 = activePatternResult_2[1];\n activePatternResult_3 = StringPosition_$007CTrimBoth$007C(tupledArg_5[0], tupledArg_5[1]);\n matchResult = 0;\n line = head(s);\n link = activePatternResult_3;\n rest = tail(s);\n wrapped = activePatternResult_2[0];\n }\n else {\n let activePatternResult_4;\n const tupledArg_6 = [\" [\", \"]:\"];\n const tupledArg_7 = head(s);\n activePatternResult_4 = StringPosition_$007CStartsWithWrapped$007C_$007C(tupledArg_6[0], tupledArg_6[1], tupledArg_7[0], tupledArg_7[1]);\n if (activePatternResult_4 != null) {\n let activePatternResult_5;\n const tupledArg_8 = activePatternResult_4[1];\n activePatternResult_5 = StringPosition_$007CTrimBoth$007C(tupledArg_8[0], tupledArg_8[1]);\n matchResult = 0;\n line = head(s);\n link = activePatternResult_5;\n rest = tail(s);\n wrapped = activePatternResult_4[0];\n }\n else {\n let activePatternResult_6;\n const tupledArg_9 = [\" [\", \"]:\"];\n const tupledArg_10 = head(s);\n activePatternResult_6 = StringPosition_$007CStartsWithWrapped$007C_$007C(tupledArg_9[0], tupledArg_9[1], tupledArg_10[0], tupledArg_10[1]);\n if (activePatternResult_6 != null) {\n let activePatternResult_7;\n const tupledArg_11 = activePatternResult_6[1];\n activePatternResult_7 = StringPosition_$007CTrimBoth$007C(tupledArg_11[0], tupledArg_11[1]);\n matchResult = 0;\n line = head(s);\n link = activePatternResult_7;\n rest = tail(s);\n wrapped = activePatternResult_6[0];\n }\n else {\n matchResult = 1;\n }\n }\n }\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return [[wrapped, link], singleton(line), rest];\n default:\n return undefined;\n }\n}\n\nexport function updateCurrentRange(lines) {\n if (!isEmpty(lines)) {\n return some(head(lines)[1]);\n }\n else {\n return undefined;\n }\n}\n\n/**\n * Parse a list of lines into a sequence of markdown paragraphs\n */\nexport function parseParagraphs(ctx, lines) {\n return delay(() => {\n let activePatternResult, loc, rest, yaml, matchValue;\n const ctx_1 = new ParsingContext(ctx.Links, ctx.Newline, ctx.IsFirst, updateCurrentRange(lines), ctx.ParseOptions);\n const patternInput = (ctx_1.IsFirst && ParsingContext__get_AllowYamlFrontMatter(ctx_1)) ? ((activePatternResult = $007CYamlFrontmatter$007C_$007C(lines), (activePatternResult != null) ? ((loc = activePatternResult[1], (rest = activePatternResult[2], (yaml = activePatternResult[0], [new MarkdownParagraph(12, [yaml, loc]), rest])))) : [undefined, lines])) : [undefined, lines];\n const moreLines = Lines_$007CTrimBlankStart$007C(patternInput[1])[1];\n return append((matchValue = patternInput[0], (matchValue != null) ? singleton_1(matchValue) : (empty_1())), delay(() => {\n let tree, nestUnmatchingItems, formatTree, unifySimpleProperty, takenLines_7, all;\n const ctx_2 = new ParsingContext(ctx_1.Links, ctx_1.Newline, ctx_1.IsFirst, updateCurrentRange(moreLines), ctx_1.ParseOptions);\n const ctx_3 = new ParsingContext(ctx_2.Links, ctx_2.Newline, false, ctx_2.CurrentRange, ctx_2.ParseOptions);\n const matchValue_1 = moreLines;\n const activePatternResult_2 = $007CLinkDefinition$007C_$007C(matchValue_1);\n if (activePatternResult_2 != null) {\n const activePatternResult_3 = Lines_$007CTrimBlankStart$007C(activePatternResult_2[2]);\n const key = activePatternResult_2[0][0];\n const link = activePatternResult_2[0][1];\n const takenLines = activePatternResult_2[1];\n return append(ParsingContext__get_ParseNonCodeAsOther(ctx_3) ? singleton_1(new MarkdownParagraph(10, [append_1(takenLines, activePatternResult_3[0]), ctx_3.CurrentRange])) : append(ctx_3.Links.has(key) ? ((toFail(printf(\"Cannot define a link to the reference %s twice.\"))(key), empty_1())) : empty_1(), delay(() => {\n addToDict(ctx_3.Links, key, getLinkAndTitle(link[0], link[1]));\n return empty_1();\n })), delay(() => parseParagraphs(ctx_3, activePatternResult_3[1])));\n }\n else {\n let matchResult, code, ignoredLine, langString, lines_2, takenLines_1, takenLines2_1;\n const activePatternResult_4 = $007CNestedCodeBlock$007C_$007C(matchValue_1);\n if (activePatternResult_4 != null) {\n const activePatternResult_5 = Lines_$007CTrimBlankStart$007C(activePatternResult_4[2]);\n matchResult = 0;\n code = activePatternResult_4[0];\n ignoredLine = activePatternResult_4[4];\n langString = activePatternResult_4[3];\n lines_2 = activePatternResult_5[1];\n takenLines_1 = activePatternResult_4[1];\n takenLines2_1 = activePatternResult_5[0];\n }\n else {\n const activePatternResult_6 = $007CFencedCodeBlock$007C_$007C(matchValue_1);\n if (activePatternResult_6 != null) {\n const activePatternResult_7 = Lines_$007CTrimBlankStart$007C(activePatternResult_6[2]);\n matchResult = 0;\n code = activePatternResult_6[0];\n ignoredLine = activePatternResult_6[4];\n langString = activePatternResult_6[3];\n lines_2 = activePatternResult_7[1];\n takenLines_1 = activePatternResult_6[1];\n takenLines2_1 = activePatternResult_7[0];\n }\n else {\n matchResult = 1;\n }\n }\n switch (matchResult) {\n case 0:\n return append(ParsingContext__get_ParseCodeAsOther(ctx_3) ? singleton_1(new MarkdownParagraph(10, [append_1(takenLines_1, takenLines2_1), ctx_3.CurrentRange])) : singleton_1(new MarkdownParagraph(2, [join(ctx_3.Newline, code), undefined, langString, ignoredLine, ctx_3.CurrentRange])), delay(() => parseParagraphs(ctx_3, lines_2)));\n default: {\n const activePatternResult_8 = $007CBlockquote$007C_$007C(matchValue_1);\n if (activePatternResult_8 != null) {\n const activePatternResult_9 = Lines_$007CTrimBlankStart$007C(activePatternResult_8[2]);\n const body = activePatternResult_8[0];\n const takenLines_2 = activePatternResult_8[1];\n return append(ParsingContext__get_ParseNonCodeAsOther(ctx_3) ? singleton_1(new MarkdownParagraph(10, [append_1(takenLines_2, activePatternResult_9[0]), ctx_3.CurrentRange])) : singleton_1(new MarkdownParagraph(5, [ofSeq(parseParagraphs(ctx_3, append_1(body, singleton([\"\", MarkdownRangeModule_zero])))), ctx_3.CurrentRange])), delay(() => parseParagraphs(ctx_3, activePatternResult_9[1])));\n }\n else {\n let matchResult_1, alignments, headers, rest_2, rows, takenLines_3, takenLines2_3;\n const activePatternResult_10 = $007CEmacsTableBlock$007C_$007C(matchValue_1);\n if (activePatternResult_10 != null) {\n const activePatternResult_11 = Lines_$007CTrimBlankStart$007C(activePatternResult_10[2]);\n matchResult_1 = 0;\n alignments = activePatternResult_10[0][1];\n headers = activePatternResult_10[0][0];\n rest_2 = activePatternResult_11[1];\n rows = activePatternResult_10[0][2];\n takenLines_3 = activePatternResult_10[1];\n takenLines2_3 = activePatternResult_11[0];\n }\n else {\n const activePatternResult_12 = $007CPipeTableBlock$007C_$007C(matchValue_1);\n if (activePatternResult_12 != null) {\n const activePatternResult_13 = Lines_$007CTrimBlankStart$007C(activePatternResult_12[2]);\n matchResult_1 = 0;\n alignments = activePatternResult_12[0][1];\n headers = activePatternResult_12[0][0];\n rest_2 = activePatternResult_13[1];\n rows = activePatternResult_12[0][2];\n takenLines_3 = activePatternResult_12[1];\n takenLines2_3 = activePatternResult_13[0];\n }\n else {\n matchResult_1 = 1;\n }\n }\n switch (matchResult_1) {\n case 0:\n return append(ParsingContext__get_ParseNonCodeAsOther(ctx_3) ? singleton_1(new MarkdownParagraph(10, [append_1(takenLines_3, takenLines2_3), ctx_3.CurrentRange])) : singleton_1(new MarkdownParagraph(9, [(headers == null) ? undefined : map((i) => ofSeq(parseParagraphs(ctx_3, i)), value_14(headers)), alignments, map((list_1) => map((i_1) => ofSeq(parseParagraphs(ctx_3, i_1)), list_1), rows), ctx_3.CurrentRange])), delay(() => parseParagraphs(ctx_3, rest_2)));\n default: {\n let matchResult_2, c, lines_3, takenLine, takenLines2_4;\n if (!isEmpty(matchValue_1)) {\n let activePatternResult_14;\n const tupledArg = head(matchValue_1);\n activePatternResult_14 = $007CHorizontalRule$007C_$007C(tupledArg[0], tupledArg[1]);\n if (activePatternResult_14 != null) {\n const activePatternResult_15 = Lines_$007CTrimBlankStart$007C(tail(matchValue_1));\n matchResult_2 = 0;\n c = activePatternResult_14;\n lines_3 = activePatternResult_15[1];\n takenLine = head(matchValue_1);\n takenLines2_4 = activePatternResult_15[0];\n }\n else {\n matchResult_2 = 1;\n }\n }\n else {\n matchResult_2 = 1;\n }\n switch (matchResult_2) {\n case 0:\n return append(ParsingContext__get_ParseNonCodeAsOther(ctx_3) ? singleton_1(new MarkdownParagraph(10, [cons(takenLine, takenLines2_4), ctx_3.CurrentRange])) : singleton_1(new MarkdownParagraph(8, [c, ctx_3.CurrentRange])), delay(() => parseParagraphs(ctx_3, lines_3)));\n default: {\n const activePatternResult_16 = $007CLatexBlock$007C_$007C(matchValue_1);\n if (activePatternResult_16 != null) {\n const activePatternResult_17 = Lines_$007CTrimBlankStart$007C(activePatternResult_16[3]);\n const body_1 = activePatternResult_16[1];\n const env = activePatternResult_16[0];\n const takenLines_4 = activePatternResult_16[2];\n return append(ParsingContext__get_ParseNonCodeAsOther(ctx_3) ? singleton_1(new MarkdownParagraph(10, [append_1(takenLines_4, activePatternResult_17[0]), ctx_3.CurrentRange])) : singleton_1(new MarkdownParagraph(7, [env, map((tuple) => tuple[0], body_1), ctx_3.CurrentRange])), delay(() => parseParagraphs(ctx_3, activePatternResult_17[1])));\n }\n else {\n const activePatternResult_18 = $007CListItems$007C_$007C(true, matchValue_1);\n if (activePatternResult_18 != null) {\n const activePatternResult_19 = Lines_$007CTrimBlankStart$007C(activePatternResult_18[2]);\n const items = activePatternResult_18[0];\n const takenLines_5 = activePatternResult_18[1];\n return append(ParsingContext__get_ParseNonCodeAsOther(ctx_3) ? singleton_1(new MarkdownParagraph(10, [append_1(takenLines_5, activePatternResult_19[0]), ctx_3.CurrentRange])) : ((tree = Tree_ofIndentedList(items), (nestUnmatchingItems = ((items_1) => {\n if (isEmpty(items_1)) {\n return empty();\n }\n else {\n return map((tupledArg_1) => {\n const _arg_1 = tupledArg_1[0];\n return new Tree$1(_arg_1.fields[0], append_1(nestUnmatchingItems(_arg_1.fields[1]), tupledArg_1[1]));\n }, List_nestUnderLastMatching((_arg) => equals(_arg.fields[0][1], head(items_1).fields[0][1]), items_1));\n }\n }), (formatTree = ((nodes) => (new MarkdownParagraph(4, [!isEmpty(nodes) ? head(nodes).fields[0][1] : (new MarkdownListKind(1, [])), toList(delay(() => collect((matchValue_2) => {\n const nested_1 = matchValue_2.fields[1];\n const body_2 = matchValue_2.fields[0][2];\n return singleton_1(toList(delay(() => {\n const rng = MarkdownRangeModule_mergeRanges(map((tuple_1) => tuple_1[1], body_2));\n return append(!matchValue_2.fields[0][0] ? parseParagraphs(ctx_3, body_2) : singleton_1(new MarkdownParagraph(6, [parseSpans(join(ctx_3.Newline, map((tuple_2) => tuple_2[0], body_2)), rng, ctx_3), ctx_3.CurrentRange])), delay(() => (!equals(nested_1, empty()) ? singleton_1(formatTree(nested_1)) : empty_1())));\n })));\n }, nodes))), ctx_3.CurrentRange]))), (unifySimpleProperty = ((nodes_1) => {\n if (exists((_arg_2) => {\n if (_arg_2.fields[0][0]) {\n return false;\n }\n else {\n return true;\n }\n }, tree)) {\n return map((_arg_3) => (new Tree$1([false, _arg_3.fields[0][1], _arg_3.fields[0][2]], unifySimpleProperty(_arg_3.fields[1]))), nodes_1);\n }\n else {\n return nodes_1;\n }\n }), singleton_1(formatTree(unifySimpleProperty(tree)))))))), delay(() => parseParagraphs(ctx_3, activePatternResult_19[1])));\n }\n else {\n const activePatternResult_20 = $007CHeading$007C_$007C(matchValue_1);\n if (activePatternResult_20 != null) {\n const activePatternResult_21 = Lines_$007CTrimBlankStart$007C(activePatternResult_20[3]);\n const body_3 = activePatternResult_20[1];\n const n = activePatternResult_20[0] | 0;\n const takenLines_6 = activePatternResult_20[2];\n return append(ParsingContext__get_ParseNonCodeAsOther(ctx_3) ? singleton_1(new MarkdownParagraph(10, [append_1(takenLines_6, activePatternResult_21[0]), ctx_3.CurrentRange])) : singleton_1(new MarkdownParagraph(0, [n, parseSpans(body_3[0], body_3[1], ctx_3), ctx_3.CurrentRange])), delay(() => parseParagraphs(ctx_3, activePatternResult_21[1])));\n }\n else {\n let matchResult_3, code_3, lines_6, takenLines_8, takenLines2_9;\n const activePatternResult_22 = $007CHtmlBlock$007C_$007C(matchValue_1);\n if (activePatternResult_22 != null) {\n const activePatternResult_23 = Lines_$007CTrimBlankStart$007C(activePatternResult_22[2]);\n if ((takenLines_7 = activePatternResult_22[1], (all = join(ctx_3.Newline, map((tuple_3) => tuple_3[0], activePatternResult_22[0])), (!all.startsWith(\"= 0)))) {\n matchResult_3 = 0;\n code_3 = activePatternResult_22[0];\n lines_6 = activePatternResult_23[1];\n takenLines_8 = activePatternResult_22[1];\n takenLines2_9 = activePatternResult_23[0];\n }\n else {\n matchResult_3 = 1;\n }\n }\n else {\n matchResult_3 = 1;\n }\n switch (matchResult_3) {\n case 0:\n return append(ParsingContext__get_ParseNonCodeAsOther(ctx_3) ? singleton_1(new MarkdownParagraph(10, [append_1(takenLines_8, takenLines2_9), ctx_3.CurrentRange])) : singleton_1(new MarkdownParagraph(3, [join(ctx_3.Newline, map((tuple_4) => tuple_4[0], code_3)), undefined, ctx_3.CurrentRange])), delay(() => parseParagraphs(ctx_3, lines_6)));\n default: {\n const activePatternResult_24 = $007CTakeParagraphLines$007C_$007C(matchValue_1);\n if (activePatternResult_24 != null) {\n const activePatternResult_25 = Lines_$007CTrimParagraphLines$007C(activePatternResult_24[0]);\n const activePatternResult_26 = Lines_$007CTrimBlankStart$007C(activePatternResult_24[1]);\n const takenLines_9 = activePatternResult_24[0];\n return append(ParsingContext__get_ParseNonCodeAsOther(ctx_3) ? singleton_1(new MarkdownParagraph(10, [append_1(takenLines_9, activePatternResult_26[0]), ctx_3.CurrentRange])) : singleton_1(new MarkdownParagraph(1, [parseSpans(join(ctx_3.Newline, map((tuple_5) => tuple_5[0], activePatternResult_25)), MarkdownRangeModule_mergeRanges(map((tuple_6) => tuple_6[1], activePatternResult_25)), ctx_3), ctx_3.CurrentRange])), delay(() => parseParagraphs(ctx_3, activePatternResult_26[1])));\n }\n else {\n const activePatternResult_27 = Lines_$007CTrimBlankStart$007C(matchValue_1);\n if (isEmpty(activePatternResult_27[1])) {\n return empty_1();\n }\n else {\n toFail(printf(\"Unexpectedly stopped!\\n%A\"))(moreLines);\n return empty_1();\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }));\n });\n}\n\n","import { record_type, lambda_type, list_type, tuple_type, option_type, union_type, string_type, class_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { FSharpRef, Record, Union } from \"../fable-library-js.4.24.0/Types.js\";\nimport { singleton as singleton_1, ofArray, filter, collect, skipWhile, takeWhile, map, getSlice, item, tryFindIndex } from \"../fable-library-js.4.24.0/List.js\";\nimport { FSharpChoice$2 } from \"../fable-library-js.4.24.0/Choice.js\";\nimport { choose, collect as collect_1, empty, map as map_1, singleton, append, delay, toList, tryPick } from \"../fable-library-js.4.24.0/Seq.js\";\nimport { curry2, defaultOf } from \"../fable-library-js.4.24.0/Util.js\";\nimport { tryGetValue } from \"../fable-library-js.4.24.0/MapUtil.js\";\nimport { map as map_2, some } from \"../fable-library-js.4.24.0/Option.js\";\nimport { split, replicate, join, printf, toText, replace } from \"../fable-library-js.4.24.0/String.js\";\nimport { MarkdownParagraph, MarkdownSpan } from \"./MarkdownModel.fs.js\";\n\nexport class FableTextWriter {\n constructor() {\n this.buffer = \"\";\n }\n toString() {\n const _ = this;\n return _.buffer;\n }\n Dispose() {\n }\n}\n\nexport function FableTextWriter_$reflection() {\n return class_type(\"Fable.Formatting.Markdown.FableTextWriter\", undefined, FableTextWriter);\n}\n\nexport function FableTextWriter_$ctor() {\n return new FableTextWriter();\n}\n\nexport class ParamKey extends Union {\n constructor(Item) {\n super();\n this.tag = 0;\n this.fields = [Item];\n }\n cases() {\n return [\"ParamKey\"];\n }\n toString() {\n const x = this;\n return x.fields[0];\n }\n}\n\nexport function ParamKey_$reflection() {\n return union_type(\"Fable.Formatting.Markdown.ParamKey\", [], ParamKey, () => [[[\"Item\", string_type]]]);\n}\n\nexport function FableTextWriter__Write_Z721C83C5(_, s) {\n _.buffer = (_.buffer + s);\n}\n\nexport class MarkdownUtils_FormattingContext extends Record {\n constructor(Links, Newline, Substitutions, ResolveApiDocReference, DefineSymbol) {\n super();\n this.Links = Links;\n this.Newline = Newline;\n this.Substitutions = Substitutions;\n this.ResolveApiDocReference = ResolveApiDocReference;\n this.DefineSymbol = DefineSymbol;\n }\n}\n\nexport function MarkdownUtils_FormattingContext_$reflection() {\n return record_type(\"Fable.Formatting.Markdown.MarkdownUtils.FormattingContext\", [], MarkdownUtils_FormattingContext, () => [[\"Links\", class_type(\"System.Collections.Generic.IDictionary`2\", [string_type, tuple_type(string_type, option_type(string_type))])], [\"Newline\", string_type], [\"Substitutions\", list_type(tuple_type(ParamKey_$reflection(), string_type))], [\"ResolveApiDocReference\", lambda_type(string_type, option_type(tuple_type(string_type, string_type)))], [\"DefineSymbol\", string_type]]);\n}\n\nexport function MarkdownUtils_isCode(_arg) {\n switch (_arg.tag) {\n case 2:\n case 3:\n return true;\n default:\n return false;\n }\n}\n\nexport function MarkdownUtils_isCodeOutput(_arg) {\n if (_arg.tag === 13) {\n return true;\n }\n else {\n return false;\n }\n}\n\nexport function MarkdownUtils_getExecutionCount(_arg) {\n let matchResult, executionCount;\n switch (_arg.tag) {\n case 2: {\n matchResult = 0;\n executionCount = _arg.fields[1];\n break;\n }\n case 3: {\n matchResult = 0;\n executionCount = _arg.fields[1];\n break;\n }\n default:\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return executionCount;\n default:\n return undefined;\n }\n}\n\nexport function MarkdownUtils_getCode(_arg) {\n switch (_arg.tag) {\n case 2:\n return _arg.fields[0];\n case 3:\n return _arg.fields[0];\n default:\n throw new Error(\"unreachable\");\n }\n}\n\nexport function MarkdownUtils_getCodeOutput(_arg) {\n if (_arg.tag === 13) {\n return [_arg.fields[0], _arg.fields[1]];\n }\n else {\n throw new Error(\"unreachable\");\n }\n}\n\nexport function MarkdownUtils_splitParagraphs(paragraphs) {\n const firstCode = tryFindIndex(MarkdownUtils_isCode, paragraphs);\n let matchResult;\n if (firstCode == null) {\n matchResult = 1;\n }\n else if (firstCode === 0) {\n matchResult = 0;\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n const code = item(0, paragraphs);\n const codeLines = MarkdownUtils_getCode(code);\n const otherParagraphs = getSlice(1, undefined, paragraphs);\n const codeOutput = map(MarkdownUtils_getCodeOutput, takeWhile(MarkdownUtils_isCodeOutput, otherParagraphs));\n const otherParagraphs_1 = skipWhile(MarkdownUtils_isCodeOutput, otherParagraphs);\n return [new FSharpChoice$2(0, [[codeLines, codeOutput, MarkdownUtils_getExecutionCount(code)]]), otherParagraphs_1];\n }\n default:\n return [new FSharpChoice$2(1, [takeWhile((arg) => !MarkdownUtils_isCode(arg), paragraphs)]), skipWhile((arg_1) => !MarkdownUtils_isCode(arg_1), paragraphs)];\n }\n}\n\n/**\n * Lookup a specified key in a dictionary, possibly\n * ignoring newlines or spaces in the key.\n */\nexport function MarkdownUtils_$007CLookupKey$007C_$007C(dict, key) {\n return tryPick((key_1) => {\n let matchValue;\n let outArg = defaultOf();\n matchValue = [tryGetValue(dict, key_1, new FSharpRef(() => outArg, (v) => {\n outArg = v;\n })), outArg];\n if (matchValue[0]) {\n return some(matchValue[1]);\n }\n else {\n return undefined;\n }\n }, [key, replace(key, \"\\r\\n\", \"\"), replace(key, \"\\r\\n\", \" \"), replace(key, \"\\n\", \"\"), replace(key, \"\\n\", \" \")]);\n}\n\n/**\n * Format a MarkdownSpan\n */\nexport function MarkdownUtils_formatSpan(ctx, span) {\n let matchResult, body, body_1, cmd, str, body_2, link;\n switch (span.tag) {\n case 10: {\n matchResult = 0;\n body = span.fields[0];\n break;\n }\n case 11: {\n matchResult = 1;\n body_1 = span.fields[0];\n break;\n }\n case 12: {\n matchResult = 2;\n cmd = span.fields[0];\n break;\n }\n case 0: {\n matchResult = 3;\n str = span.fields[0];\n break;\n }\n case 9: {\n matchResult = 4;\n break;\n }\n case 4: {\n matchResult = 5;\n break;\n }\n case 6: {\n const activePatternResult = MarkdownUtils_$007CLookupKey$007C_$007C(ctx.Links, span.fields[2]);\n if (activePatternResult != null) {\n matchResult = 6;\n body_2 = span.fields[0];\n link = activePatternResult[0];\n }\n else {\n matchResult = 6;\n body_2 = span.fields[0];\n link = span.fields[1];\n }\n break;\n }\n case 5: {\n matchResult = 6;\n body_2 = span.fields[0];\n link = span.fields[1];\n break;\n }\n default:\n matchResult = 7;\n }\n switch (matchResult) {\n case 0:\n return toText(printf(\"$%s$\"))(body);\n case 1:\n return toText(printf(\"$$%s$$\"))(body_1);\n case 2:\n return MarkdownUtils_formatSpans(ctx, cmd.Render());\n case 3:\n return str;\n case 4:\n return \"\\n\";\n case 5:\n return \"\";\n case 6:\n return (((\"[\" + MarkdownUtils_formatSpans(ctx, body_2)) + \"](\") + link) + \")\";\n default: {\n let matchResult_1, _body, _link;\n if (span.tag === 8) {\n const activePatternResult_1 = MarkdownUtils_$007CLookupKey$007C_$007C(ctx.Links, span.fields[2]);\n if (activePatternResult_1 != null) {\n matchResult_1 = 0;\n _body = span.fields[0];\n _link = activePatternResult_1[0];\n }\n else {\n matchResult_1 = 0;\n _body = span.fields[0];\n _link = span.fields[1];\n }\n }\n else {\n matchResult_1 = 1;\n }\n switch (matchResult_1) {\n case 0:\n throw new Error(\"tbd - IndirectImage\");\n default:\n switch (span.tag) {\n case 7:\n return toText(printf(\"\"))(span.fields[0])(span.fields[1]);\n case 2:\n return (\"**\" + MarkdownUtils_formatSpans(ctx, span.fields[0])) + \"**\";\n case 1:\n return (\"`\" + span.fields[0]) + \"`\";\n case 3:\n return (\"**\" + MarkdownUtils_formatSpans(ctx, span.fields[0])) + \"**\";\n default:\n throw new Error(\"Match failure: Fable.Formatting.Markdown.MarkdownSpan\");\n }\n }\n }\n }\n}\n\n/**\n * Format a list of MarkdownSpan\n */\nexport function MarkdownUtils_formatSpans(ctx, spans) {\n return join(\"\", map((span) => MarkdownUtils_formatSpan(ctx, span), spans));\n}\n\n/**\n * Format a MarkdownParagraph\n */\nexport function MarkdownUtils_formatParagraph(ctx, paragraph) {\n return toList(delay(() => {\n let matchValue;\n return (paragraph.tag === 7) ? append(singleton(toText(printf(\"\\\\begin{%s}\"))(paragraph.fields[0])), delay(() => append(map_1((line) => line, paragraph.fields[1]), delay(() => append(singleton(toText(printf(\"\\\\end{%s}\"))(paragraph.fields[0])), delay(() => singleton(\"\"))))))) : ((paragraph.tag === 0) ? append(singleton((replicate(paragraph.fields[0], \"#\") + \" \") + MarkdownUtils_formatSpans(ctx, paragraph.fields[1])), delay(() => singleton(\"\"))) : ((paragraph.tag === 1) ? append(singleton(join(\"\", toList(delay(() => map_1((span) => MarkdownUtils_formatSpan(ctx, span), paragraph.fields[0]))))), delay(() => singleton(\"\"))) : ((paragraph.tag === 8) ? append(singleton(\"-----------------------\"), delay(() => singleton(\"\"))) : ((paragraph.tag === 2) ? append(singleton(paragraph.fields[0]), delay(() => singleton(\"\"))) : ((paragraph.tag === 4) ? ((paragraph.fields[0].tag === 1) ? singleton(join(\"\\n\", collect((ps) => toList(delay(() => map_1((p) => join(\"\", MarkdownUtils_formatParagraph(ctx, p)), ps))), paragraph.fields[1]))) : append(singleton(toText(printf(\"// can\\'t yet format %0A to pynb markdown\"))(paragraph)), delay(() => singleton(\"\")))) : ((paragraph.tag === 9) ? append((matchValue = paragraph.fields[0], (matchValue == null) ? (empty()) : singleton(join(\" | \", collect((hs) => toList(delay(() => map_1((h) => join(\"\", MarkdownUtils_formatParagraph(ctx, h)), hs))), matchValue)))), delay(() => append(singleton(join(\" | \", toList(delay(() => map_1((a) => ((a.tag === 2) ? \":---:\" : ((a.tag === 1) ? \"---:\" : ((a.tag === 3) ? \"---\" : \":---\"))), paragraph.fields[1]))))), delay(() => {\n const replaceEmptyWith = (x, s) => {\n let matchResult;\n if (s === \"\") {\n matchResult = 0;\n }\n else if (s === defaultOf()) {\n matchResult = 0;\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return x;\n default:\n return s;\n }\n };\n return append(singleton(join(\"\\n\", toList(delay(() => map_1((r) => {\n let source_2;\n return join(\" | \", (source_2 = toList(delay(() => collect_1((ps_1) => {\n const x_1 = toList(delay(() => map_1((p_1) => {\n let source;\n return join(\"\", (source = MarkdownUtils_formatParagraph(ctx, p_1), choose(curry2(replaceEmptyWith)(\"\"), source)));\n }, ps_1)));\n return singleton(join(\" \", choose(curry2(replaceEmptyWith)(\"\"), x_1)));\n }, r))), choose(curry2(replaceEmptyWith)(\" \"), source_2)));\n }, paragraph.fields[2]))))), delay(() => singleton(\"\\n\")));\n })))) : ((paragraph.tag === 13) ? ((paragraph.fields[1] === \"text/html\") ? append(singleton(paragraph.fields[0].trim()), delay(() => singleton(\"\"))) : append(singleton(\"```\"), delay(() => append(singleton(paragraph.fields[0]), delay(() => append(singleton(\"```\"), delay(() => singleton(\"\")))))))) : ((paragraph.tag === 10) ? map((tuple) => tuple[0], paragraph.fields[0]) : append(singleton(toText(printf(\"// can\\'t yet format %0A to pynb markdown\"))(paragraph)), delay(() => singleton(\"\")))))))))));\n }));\n}\n\nexport function MarkdownUtils_formatFsxCode(ctx, code) {\n const sym = ctx.DefineSymbol;\n const sym1 = toText(printf(\"#if %s\"))(sym);\n const sym2 = toText(printf(\"#endif // %s\"))(sym);\n return join(ctx.Newline, filter((line) => {\n if (line.trim() !== sym1) {\n return line.trim() !== sym2;\n }\n else {\n return false;\n }\n }, ofArray(split(replace(code, \"\\r\\n\", \"\\n\"), [\"\\n\"], undefined, 0))));\n}\n\nexport function MarkdownUtils_applySubstitutionsInText(ctx, text) {\n return text;\n}\n\nexport function MarkdownUtils_applyCodeReferenceResolver(ctx, code, range) {\n const matchValue = ctx.ResolveApiDocReference(code);\n if (matchValue != null) {\n return new MarkdownSpan(5, [singleton_1(new MarkdownSpan(0, [matchValue[0], range])), matchValue[1], undefined, range]);\n }\n else {\n return new MarkdownSpan(1, [code, range]);\n }\n}\n\nexport function MarkdownUtils_mapText(f, _arg, text) {\n return f(text);\n}\n\nexport function MarkdownUtils_mapInlineCode(_arg, f, code, range) {\n return f([code, range]);\n}\n\nexport function MarkdownUtils_mapSpans(f_, f__1, md) {\n const f = [f_, f__1];\n return map((_arg) => {\n switch (_arg.tag) {\n case 2:\n return new MarkdownSpan(2, [MarkdownUtils_mapSpans(f[0], f[1], _arg.fields[0]), _arg.fields[1]]);\n case 3:\n return new MarkdownSpan(3, [MarkdownUtils_mapSpans(f[0], f[1], _arg.fields[0]), _arg.fields[1]]);\n case 4:\n return new MarkdownSpan(4, [MarkdownUtils_mapText(f[0], f[1], _arg.fields[0]), _arg.fields[1]]);\n case 5:\n return new MarkdownSpan(5, [MarkdownUtils_mapSpans(f[0], f[1], _arg.fields[0]), MarkdownUtils_mapText(f[0], f[1], _arg.fields[1]), map_2((text_1) => MarkdownUtils_mapText(f[0], f[1], text_1), _arg.fields[2]), _arg.fields[3]]);\n case 6:\n return new MarkdownSpan(6, [MarkdownUtils_mapSpans(f[0], f[1], _arg.fields[0]), _arg.fields[1], _arg.fields[2], _arg.fields[3]]);\n case 7:\n return new MarkdownSpan(7, [MarkdownUtils_mapText(f[0], f[1], _arg.fields[0]), MarkdownUtils_mapText(f[0], f[1], _arg.fields[1]), map_2((text_2) => MarkdownUtils_mapText(f[0], f[1], text_2), _arg.fields[2]), _arg.fields[3]]);\n case 8:\n return new MarkdownSpan(8, [MarkdownUtils_mapText(f[0], f[1], _arg.fields[0]), _arg.fields[1], _arg.fields[2], _arg.fields[3]]);\n case 9:\n return new MarkdownSpan(9, [_arg.fields[0]]);\n case 1:\n return MarkdownUtils_mapInlineCode(f[0], f[1], _arg.fields[0], _arg.fields[1]);\n case 10:\n return new MarkdownSpan(10, [_arg.fields[0], _arg.fields[1]]);\n case 11:\n return new MarkdownSpan(11, [_arg.fields[0], _arg.fields[1]]);\n case 12:\n return new MarkdownSpan(12, [_arg.fields[0], _arg.fields[1]]);\n default:\n return new MarkdownSpan(0, [MarkdownUtils_mapText(f[0], f[1], _arg.fields[0]), _arg.fields[1]]);\n }\n }, md);\n}\n\nexport function MarkdownUtils_mapParagraphs(f_, f__1, md) {\n const f = [f_, f__1];\n return map((_arg) => {\n switch (_arg.tag) {\n case 1:\n return new MarkdownParagraph(1, [MarkdownUtils_mapSpans(f[0], f[1], _arg.fields[0]), _arg.fields[1]]);\n case 2:\n return new MarkdownParagraph(2, [MarkdownUtils_mapText(f[0], f[1], _arg.fields[0]), _arg.fields[1], _arg.fields[2], _arg.fields[3], _arg.fields[4]]);\n case 13:\n return new MarkdownParagraph(13, [_arg.fields[0], _arg.fields[1], _arg.fields[2]]);\n case 4:\n return new MarkdownParagraph(4, [_arg.fields[0], map((md_1) => MarkdownUtils_mapParagraphs(f[0], f[1], md_1), _arg.fields[1]), _arg.fields[2]]);\n case 5:\n return new MarkdownParagraph(5, [MarkdownUtils_mapParagraphs(f[0], f[1], _arg.fields[0]), _arg.fields[1]]);\n case 6:\n return new MarkdownParagraph(6, [MarkdownUtils_mapSpans(f[0], f[1], _arg.fields[0]), _arg.fields[1]]);\n case 7:\n return new MarkdownParagraph(7, [_arg.fields[0], map((text) => MarkdownUtils_mapText(f[0], f[1], text), _arg.fields[1]), _arg.fields[2]]);\n case 8:\n return new MarkdownParagraph(8, [_arg.fields[0], _arg.fields[1]]);\n case 12:\n return new MarkdownParagraph(12, [map((text_1) => MarkdownUtils_mapText(f[0], f[1], text_1), _arg.fields[0]), _arg.fields[1]]);\n case 9:\n return new MarkdownParagraph(9, [map_2((list) => map((md_2) => MarkdownUtils_mapParagraphs(f[0], f[1], md_2), list), _arg.fields[0]), _arg.fields[1], map((list_1) => map((md_3) => MarkdownUtils_mapParagraphs(f[0], f[1], md_3), list_1), _arg.fields[2]), _arg.fields[3]]);\n case 10:\n return new MarkdownParagraph(10, [map((tupledArg) => [MarkdownUtils_mapText(f[0], f[1], tupledArg[0]), tupledArg[1]], _arg.fields[0]), _arg.fields[1]]);\n case 3:\n return new MarkdownParagraph(3, [MarkdownUtils_mapText(f[0], f[1], _arg.fields[0]), _arg.fields[1], _arg.fields[2]]);\n case 11:\n return new MarkdownParagraph(11, [_arg.fields[0], _arg.fields[1]]);\n default:\n return new MarkdownParagraph(0, [_arg.fields[0], MarkdownUtils_mapSpans(f[0], f[1], _arg.fields[1]), _arg.fields[2]]);\n }\n }, md);\n}\n\nexport function MarkdownUtils_applySubstitutionsInMarkdown(ctx, md) {\n return MarkdownUtils_mapParagraphs((text) => MarkdownUtils_applySubstitutionsInText(ctx, text), (tupledArg) => MarkdownUtils_applyCodeReferenceResolver(ctx, tupledArg[0], tupledArg[1]), md);\n}\n\n","import { isNullOrWhiteSpace, join, printf, toText, replace } from \"../fable-library-js.4.24.0/String.js\";\nimport { mapIndexed as mapIndexed_1, zip, collect, empty, map, delay, tryPick } from \"../fable-library-js.4.24.0/Seq.js\";\nimport { equals, getEnumerator, int32ToString, disposeSafe, defaultOf } from \"../fable-library-js.4.24.0/Util.js\";\nimport { tryGetValue } from \"../fable-library-js.4.24.0/MapUtil.js\";\nimport { toString, Record, FSharpRef } from \"../fable-library-js.4.24.0/Types.js\";\nimport { value as value_2, some } from \"../fable-library-js.4.24.0/Option.js\";\nimport { record_type, bool_type, tuple_type, option_type, string_type, lambda_type, unit_type, class_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { MarkdownUtils_FormattingContext, MarkdownUtils_applySubstitutionsInMarkdown, FableTextWriter_$ctor, FableTextWriter__Write_Z721C83C5, FableTextWriter_$reflection } from \"./MarkdownUtils.fs.js\";\nimport { length as length_1, tail, head, isEmpty, mapIndexed, map as map_1, iterate } from \"../fable-library-js.4.24.0/List.js\";\nimport { matches } from \"../fable-library-js.4.24.0/RegExp.js\";\nimport { MarkdownListKind } from \"./MarkdownModel.fs.js\";\nimport { List_iterInterleaved } from \"./Collections.fs.js\";\n\n/**\n * Basic escaping as done by Markdown\n */\nexport function htmlEncode(code) {\n return replace(replace(replace(code, \"&\", \"&\"), \"<\", \"<\"), \">\", \">\");\n}\n\n/**\n * Basic escaping as done by Markdown including quotes\n */\nexport function htmlEncodeQuotes(code) {\n return replace(htmlEncode(code), \"\\\"\", \""\");\n}\n\n/**\n * Lookup a specified key in a dictionary, possibly\n * ignoring newlines or spaces in the key.\n */\nexport function $007CLookupKey$007C_$007C(dict, key) {\n return tryPick((key_1) => {\n let matchValue;\n let outArg = defaultOf();\n matchValue = [tryGetValue(dict, key_1, new FSharpRef(() => outArg, (v) => {\n outArg = v;\n })), outArg];\n if (matchValue[0]) {\n return some(matchValue[1]);\n }\n else {\n return undefined;\n }\n }, [key, replace(key, \"\\r\\n\", \"\"), replace(key, \"\\r\\n\", \" \"), replace(key, \"\\n\", \"\"), replace(key, \"\\n\", \" \")]);\n}\n\nexport class UniqueNameGenerator {\n constructor() {\n this.generated = (new Map([]));\n }\n}\n\nexport function UniqueNameGenerator_$reflection() {\n return class_type(\"Fable.Formatting.Markdown.HtmlFormatting.UniqueNameGenerator\", undefined, UniqueNameGenerator);\n}\n\nexport function UniqueNameGenerator_$ctor() {\n return new UniqueNameGenerator();\n}\n\nexport function UniqueNameGenerator__GetName_Z721C83C5(__, name) {\n let patternInput;\n let outArg = 0;\n patternInput = [tryGetValue(__.generated, name, new FSharpRef(() => outArg, (v) => {\n outArg = (v | 0);\n })), outArg];\n const i = patternInput[1] | 0;\n if (patternInput[0]) {\n __.generated.set(name, i + 1);\n return toText(printf(\"%s-%d\"))(name)(i);\n }\n else {\n __.generated.set(name, 1);\n return name;\n }\n}\n\nexport class FormattingContext extends Record {\n constructor(LineBreak, Newline, Writer, Links, WrapCodeSnippets, GenerateHeaderAnchors, UniqueNameGenerator, ParagraphIndent) {\n super();\n this.LineBreak = LineBreak;\n this.Newline = Newline;\n this.Writer = Writer;\n this.Links = Links;\n this.WrapCodeSnippets = WrapCodeSnippets;\n this.GenerateHeaderAnchors = GenerateHeaderAnchors;\n this.UniqueNameGenerator = UniqueNameGenerator;\n this.ParagraphIndent = ParagraphIndent;\n }\n}\n\nexport function FormattingContext_$reflection() {\n return record_type(\"Fable.Formatting.Markdown.HtmlFormatting.FormattingContext\", [], FormattingContext, () => [[\"LineBreak\", lambda_type(unit_type, unit_type)], [\"Newline\", string_type], [\"Writer\", FableTextWriter_$reflection()], [\"Links\", class_type(\"System.Collections.Generic.IDictionary`2\", [string_type, tuple_type(string_type, option_type(string_type))])], [\"WrapCodeSnippets\", bool_type], [\"GenerateHeaderAnchors\", bool_type], [\"UniqueNameGenerator\", UniqueNameGenerator_$reflection()], [\"ParagraphIndent\", lambda_type(unit_type, unit_type)]]);\n}\n\nexport function bigBreak(ctx, unitVar) {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, ctx.Newline);\n}\n\nexport function smallBreak(ctx, unitVar) {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, ctx.Newline);\n}\n\nexport function noBreak(_ctx, unitVar) {\n}\n\n/**\n * Write MarkdownSpan value to a TextWriter\n */\nexport function formatSpan(ctx, span) {\n let matchResult, body, body_1, id, cmd, str, body_2, link, title;\n switch (span.tag) {\n case 11: {\n matchResult = 0;\n body = span.fields[0];\n break;\n }\n case 10: {\n matchResult = 1;\n body_1 = span.fields[0];\n break;\n }\n case 4: {\n matchResult = 2;\n id = span.fields[0];\n break;\n }\n case 12: {\n matchResult = 3;\n cmd = span.fields[0];\n break;\n }\n case 0: {\n matchResult = 4;\n str = span.fields[0];\n break;\n }\n case 9: {\n matchResult = 5;\n break;\n }\n case 6: {\n const activePatternResult = $007CLookupKey$007C_$007C(ctx.Links, span.fields[2]);\n if (activePatternResult != null) {\n matchResult = 6;\n body_2 = span.fields[0];\n link = activePatternResult[0];\n title = activePatternResult[1];\n }\n else {\n matchResult = 7;\n }\n break;\n }\n case 5: {\n matchResult = 6;\n body_2 = span.fields[0];\n link = span.fields[1];\n title = span.fields[2];\n break;\n }\n default:\n matchResult = 7;\n }\n switch (matchResult) {\n case 0: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, (\"\\\\[\" + htmlEncode(body)) + \"\\\\] \");\n break;\n }\n case 1: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, (\"\\\\(\" + htmlEncode(body_1)) + \"\\\\) \");\n break;\n }\n case 2: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, (\" \");\n break;\n }\n case 3: {\n formatSpans(ctx)(cmd.Render());\n break;\n }\n case 4: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, str);\n break;\n }\n case 5: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \" \" + ctx.Newline);\n break;\n }\n case 6: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"\");\n formatSpans(ctx)(body_2);\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \" \");\n break;\n }\n case 7: {\n let matchResult_1, body_3, original, body_4, link_1, title_2;\n switch (span.tag) {\n case 6: {\n matchResult_1 = 0;\n body_3 = span.fields[0];\n original = span.fields[1];\n break;\n }\n case 8: {\n const activePatternResult_1 = $007CLookupKey$007C_$007C(ctx.Links, span.fields[2]);\n if (activePatternResult_1 != null) {\n matchResult_1 = 1;\n body_4 = span.fields[0];\n link_1 = activePatternResult_1[0];\n title_2 = activePatternResult_1[1];\n }\n else {\n matchResult_1 = 2;\n }\n break;\n }\n case 7: {\n matchResult_1 = 1;\n body_4 = span.fields[0];\n link_1 = span.fields[1];\n title_2 = span.fields[2];\n break;\n }\n default:\n matchResult_1 = 2;\n }\n switch (matchResult_1) {\n case 0: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"[\");\n formatSpans(ctx)(body_3);\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"]\");\n FableTextWriter__Write_Z721C83C5(ctx.Writer, original);\n break;\n }\n case 1: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \" \");\n break;\n }\n case 2: {\n switch (span.tag) {\n case 8: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"[\");\n FableTextWriter__Write_Z721C83C5(ctx.Writer, span.fields[0]);\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"]\");\n FableTextWriter__Write_Z721C83C5(ctx.Writer, span.fields[1]);\n break;\n }\n case 2: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"\");\n formatSpans(ctx)(span.fields[0]);\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \" \");\n break;\n }\n case 1: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"\");\n FableTextWriter__Write_Z721C83C5(ctx.Writer, htmlEncode(span.fields[0]));\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"
\");\n break;\n }\n case 3: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"\");\n formatSpans(ctx)(span.fields[0]);\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \" \");\n break;\n }\n default:\n throw new Error(\"Match failure: Fable.Formatting.Markdown.MarkdownSpan\");\n }\n break;\n }\n }\n break;\n }\n }\n}\n\n/**\n * Write list of MarkdownSpan values to a TextWriter\n */\nexport function formatSpans(ctx) {\n return (list) => {\n iterate((span) => {\n formatSpan(ctx, span);\n }, list);\n };\n}\n\n/**\n * generate anchor name from Markdown text\n */\nexport function formatAnchor(ctx, spans) {\n let name;\n const gather = (span) => delay(() => {\n switch (span.tag) {\n case 0:\n return map((m) => m[0], matches(/\\w+/gu, span.fields[0]));\n case 2:\n return gathers(span.fields[0]);\n case 3:\n return gathers(span.fields[0]);\n case 5:\n return gathers(span.fields[0]);\n default: {\n return empty();\n }\n }\n });\n const gathers = (spans_1) => collect(gather, spans_1);\n return UniqueNameGenerator__GetName_Z721C83C5(ctx.UniqueNameGenerator, (name = join(\"-\", gathers(spans)), isNullOrWhiteSpace(name) ? \"header\" : name));\n}\n\nexport function withInner(ctx, f) {\n const sb = FableTextWriter_$ctor();\n try {\n f(new FormattingContext(ctx.LineBreak, ctx.Newline, sb, ctx.Links, ctx.WrapCodeSnippets, ctx.GenerateHeaderAnchors, ctx.UniqueNameGenerator, ctx.ParagraphIndent));\n return toString(sb);\n }\n finally {\n disposeSafe(sb);\n }\n}\n\n/**\n * Write a MarkdownParagraph value to a TextWriter as HTML\n */\nexport function formatParagraph(ctx, paragraph) {\n switch (paragraph.tag) {\n case 11: {\n formatParagraphs(ctx, paragraph.fields[0].Render());\n break;\n }\n case 0: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, (\"\");\n if (ctx.GenerateHeaderAnchors) {\n const anchorName = formatAnchor(ctx, paragraph.fields[1]);\n FableTextWriter__Write_Z721C83C5(ctx.Writer, toText(printf(\"\"))(anchorName)(anchorName));\n formatSpans(ctx)(paragraph.fields[1]);\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \" \");\n }\n else {\n formatSpans(ctx)(paragraph.fields[1]);\n }\n FableTextWriter__Write_Z721C83C5(ctx.Writer, (\" \");\n break;\n }\n case 1: {\n ctx.ParagraphIndent();\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"\");\n const enumerator = getEnumerator(paragraph.fields[0]);\n try {\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\n formatSpan(ctx, enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\n }\n }\n finally {\n disposeSafe(enumerator);\n }\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"
\");\n break;\n }\n case 8: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \" \");\n break;\n }\n case 2: {\n if (ctx.WrapCodeSnippets) {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"\");\n }\n if (isNullOrWhiteSpace(paragraph.fields[2])) {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, toText(printf(\"\")));\n }\n else {\n const langCode = toText(printf(\"language-%s\"))(paragraph.fields[2]);\n FableTextWriter__Write_Z721C83C5(ctx.Writer, toText(printf(\"\"))(langCode));\n }\n FableTextWriter__Write_Z721C83C5(ctx.Writer, htmlEncode(paragraph.fields[0]));\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"
\");\n if (ctx.WrapCodeSnippets) {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"
\");\n }\n break;\n }\n case 13: {\n if (paragraph.fields[1] === \"text/html\") {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, paragraph.fields[0]);\n }\n else {\n if (ctx.WrapCodeSnippets) {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"\");\n }\n FableTextWriter__Write_Z721C83C5(ctx.Writer, toText(printf(\"\")));\n FableTextWriter__Write_Z721C83C5(ctx.Writer, htmlEncode(paragraph.fields[0]));\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"
\");\n if (ctx.WrapCodeSnippets) {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"
\");\n }\n }\n break;\n }\n case 9: {\n const aligns = map_1((_arg) => {\n switch (_arg.tag) {\n case 1:\n return \" align=\\\"right\\\"\";\n case 2:\n return \" align=\\\"center\\\"\";\n case 3:\n return \"\";\n default:\n return \" align=\\\"left\\\"\";\n }\n }, paragraph.fields[1]);\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"\");\n FableTextWriter__Write_Z721C83C5(ctx.Writer, ctx.Newline);\n if (paragraph.fields[0] != null) {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, ((\"\" + ctx.Newline) + \"\" + ctx.Newline) + \" \") + ctx.Newline);\n }\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"\" + ctx.Newline);\n const enumerator_3 = getEnumerator(mapIndexed((i, r) => [i + 1, r], paragraph.fields[2]));\n try {\n while (enumerator_3[\"System.Collections.IEnumerator.MoveNext\"]()) {\n const forLoopVar_1 = enumerator_3[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\n FableTextWriter__Write_Z721C83C5(ctx.Writer, ((\"\") + ctx.Newline);\n const enumerator_4 = getEnumerator(zip(forLoopVar_1[1], aligns));\n try {\n while (enumerator_4[\"System.Collections.IEnumerator.MoveNext\"]()) {\n const forLoopVar_2 = enumerator_4[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\n FableTextWriter__Write_Z721C83C5(ctx.Writer, (\"\");\n const enumerator_5 = getEnumerator(forLoopVar_2[0]);\n try {\n while (enumerator_5[\"System.Collections.IEnumerator.MoveNext\"]()) {\n formatParagraph(new FormattingContext(() => {\n noBreak(ctx, undefined);\n }, ctx.Newline, ctx.Writer, ctx.Links, ctx.WrapCodeSnippets, ctx.GenerateHeaderAnchors, ctx.UniqueNameGenerator, ctx.ParagraphIndent), enumerator_5[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\n }\n }\n finally {\n disposeSafe(enumerator_5);\n }\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \" \" + ctx.Newline);\n }\n }\n finally {\n disposeSafe(enumerator_4);\n }\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \" \" + ctx.Newline);\n }\n }\n finally {\n disposeSafe(enumerator_3);\n }\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \" \" + ctx.Newline);\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"
\");\n FableTextWriter__Write_Z721C83C5(ctx.Writer, ctx.Newline);\n break;\n }\n case 4: {\n const tag = equals(paragraph.fields[0], new MarkdownListKind(0, [])) ? \"ol\" : \"ul\";\n FableTextWriter__Write_Z721C83C5(ctx.Writer, ((\"<\" + tag) + \">\") + ctx.Newline);\n const enumerator_6 = getEnumerator(paragraph.fields[1]);\n try {\n while (enumerator_6[\"System.Collections.IEnumerator.MoveNext\"]()) {\n const body_1 = enumerator_6[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"\");\n let matchResult, s_1;\n if (!isEmpty(body_1)) {\n if (head(body_1).tag === 1) {\n if (!isEmpty(head(body_1).fields[0])) {\n if (head(head(body_1).fields[0]).tag === 0) {\n if (isEmpty(tail(head(body_1).fields[0]))) {\n if (isEmpty(tail(body_1))) {\n if (!(head(head(body_1).fields[0]).fields[0].indexOf(ctx.Newline) >= 0)) {\n matchResult = 0;\n s_1 = head(head(body_1).fields[0]).fields[0];\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, s_1);\n break;\n }\n case 1: {\n const inner = withInner(ctx, (ctx_1) => {\n let ctx_2;\n List_iterInterleaved((ctx_2 = (new FormattingContext(() => {\n noBreak(ctx_1, undefined);\n }, ctx_1.Newline, ctx_1.Writer, ctx_1.Links, ctx_1.WrapCodeSnippets, ctx_1.GenerateHeaderAnchors, ctx_1.UniqueNameGenerator, ctx_1.ParagraphIndent)), (paragraph_3) => {\n formatParagraph(ctx_2, paragraph_3);\n }), () => {\n FableTextWriter__Write_Z721C83C5(ctx_1.Writer, ctx_1.Newline);\n }, body_1);\n });\n FableTextWriter__Write_Z721C83C5(ctx.Writer, (inner.indexOf(ctx.Newline) >= 0) ? ((ctx.Newline + inner) + ctx.Newline) : inner);\n break;\n }\n }\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \" \" + ctx.Newline);\n }\n }\n finally {\n disposeSafe(enumerator_6);\n }\n FableTextWriter__Write_Z721C83C5(ctx.Writer, (\"\" + tag) + \">\");\n break;\n }\n case 5: {\n ctx.ParagraphIndent();\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"\" + ctx.Newline);\n formatParagraphs(new FormattingContext(ctx.LineBreak, ctx.Newline, ctx.Writer, ctx.Links, ctx.WrapCodeSnippets, ctx.GenerateHeaderAnchors, ctx.UniqueNameGenerator, () => {\n ctx.ParagraphIndent();\n }), paragraph.fields[0]);\n ctx.ParagraphIndent();\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \" \");\n break;\n }\n case 6: {\n formatSpans(ctx)(paragraph.fields[0]);\n break;\n }\n case 3: {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, paragraph.fields[0]);\n break;\n }\n case 10: {\n if (ctx.WrapCodeSnippets) {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"\");\n }\n FableTextWriter__Write_Z721C83C5(ctx.Writer, toText(printf(\"\")));\n const enumerator_7 = getEnumerator(paragraph.fields[0]);\n try {\n while (enumerator_7[\"System.Collections.IEnumerator.MoveNext\"]()) {\n FableTextWriter__Write_Z721C83C5(ctx.Writer, htmlEncode(enumerator_7[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()[0]));\n }\n }\n finally {\n disposeSafe(enumerator_7);\n }\n FableTextWriter__Write_Z721C83C5(ctx.Writer, \"
\");\n break;\n }\n case 12: {\n break;\n }\n default:\n FableTextWriter__Write_Z721C83C5(ctx.Writer, (\"\\\\[\" + htmlEncode(join(ctx.Newline, paragraph.fields[1]))) + \"\\\\]
\");\n }\n ctx.LineBreak();\n}\n\n/**\n * Write a list of MarkdownParagraph values to a TextWriter\n */\nexport function formatParagraphs(ctx, paragraphs) {\n const length = length_1(paragraphs) | 0;\n const smallCtx = new FormattingContext(() => {\n smallBreak(ctx, undefined);\n }, ctx.Newline, ctx.Writer, ctx.Links, ctx.WrapCodeSnippets, ctx.GenerateHeaderAnchors, ctx.UniqueNameGenerator, ctx.ParagraphIndent);\n const bigCtx = new FormattingContext(() => {\n bigBreak(ctx, undefined);\n }, ctx.Newline, ctx.Writer, ctx.Links, ctx.WrapCodeSnippets, ctx.GenerateHeaderAnchors, ctx.UniqueNameGenerator, ctx.ParagraphIndent);\n const enumerator = getEnumerator(mapIndexed_1((i, v) => [i === (length - 1), v], paragraphs));\n try {\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\n const forLoopVar = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\n formatParagraph(forLoopVar[0] ? smallCtx : bigCtx, forLoopVar[1]);\n }\n }\n finally {\n disposeSafe(enumerator);\n }\n}\n\n/**\n * Format Markdown document and write the result to\n * a specified TextWriter. Parameters specify newline character\n * and a dictionary with link keys defined in the document.\n */\nexport function formatMarkdown(writer, generateAnchors, wrap, links, substitutions, newline, crefResolver, paragraphs) {\n const paragraphs_1 = MarkdownUtils_applySubstitutionsInMarkdown(new MarkdownUtils_FormattingContext(links, newline, substitutions, crefResolver, \"HTML\"), paragraphs);\n formatParagraphs(new FormattingContext(() => {\n }, newline, writer, links, wrap, generateAnchors, UniqueNameGenerator_$ctor(), () => {\n }), paragraphs_1);\n}\n\n","import { class_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { unwrap, defaultArg } from \"../fable-library-js.4.24.0/Option.js\";\nimport { toList } from \"../fable-library-js.4.24.0/Seq.js\";\nimport { mapIndexed } from \"../fable-library-js.4.24.0/Array.js\";\nimport { MarkdownRangeModule_zero, MarkdownRange } from \"./Range.fs.js\";\nimport { isNullOrWhiteSpace, replace, split } from \"../fable-library-js.4.24.0/String.js\";\nimport { empty, skipWhile, ofSeq } from \"../fable-library-js.4.24.0/List.js\";\nimport { ParsingContext, parseParagraphs } from \"./MarkdownParser.fs.js\";\nimport { formatMarkdown } from \"./HtmlFormatting.fs.js\";\nimport { FableTextWriter_$ctor } from \"./MarkdownUtils.fs.js\";\nimport { disposeSafe } from \"../fable-library-js.4.24.0/Util.js\";\nimport { toString } from \"../fable-library-js.4.24.0/Types.js\";\nimport { formatAsMd } from \"./MarkdownFormatting.fs.js\";\n\nexport class MarkdownDocument {\n constructor(paragraphs, links) {\n this.paragraphs = paragraphs;\n this.links = links;\n }\n}\n\nexport function MarkdownDocument_$reflection() {\n return class_type(\"Fable.Formatting.Markdown.MarkdownDocument\", undefined, MarkdownDocument);\n}\n\nexport function MarkdownDocument_$ctor_Z7AE59E28(paragraphs, links) {\n return new MarkdownDocument(paragraphs, links);\n}\n\n/**\n * Returns a list of paragraphs in the document\n */\nexport function MarkdownDocument__get_Paragraphs(x) {\n return x.paragraphs;\n}\n\n/**\n * Returns a dictionary containing explicitly defined links\n */\nexport function MarkdownDocument__get_DefinedLinks(x) {\n return x.links;\n}\n\nexport class Markdown {\n constructor() {\n }\n}\n\nexport function Markdown_$reflection() {\n return class_type(\"Fable.Formatting.Markdown.Markdown\", undefined, Markdown);\n}\n\nexport function Markdown_$ctor() {\n return new Markdown();\n}\n\n/**\n * Parse the specified text into a MarkdownDocument. Line breaks in the\n * inline HTML (etc.) will be stored using the specified string.\n */\nexport function Markdown_Parse_7B74E5F5(text, newline, parseOptions) {\n const newline_1 = defaultArg(newline, \"\\n\");\n const parseOptions_1 = defaultArg(parseOptions, 0) | 0;\n const lines = toList(mapIndexed((i, s) => [s, new MarkdownRange(i + 1, 0, i + 1, s.length)], split(replace(text, \"\\r\\n\", \"\\n\"), [\"\\n\", \"\\r\"])));\n const links = new Map([]);\n return MarkdownDocument_$ctor_Z7AE59E28(ofSeq(parseParagraphs(new ParsingContext(links, newline_1, true, MarkdownRangeModule_zero, parseOptions_1), skipWhile((tupledArg) => isNullOrWhiteSpace(tupledArg[0]), lines))), links);\n}\n\n/**\n * Transform the provided MarkdownDocument into HTML\n * format and write the result to a given writer.\n */\nexport function Markdown_WriteHtml_27D81AD6(doc, writer, newline, substitutions, crefResolver) {\n const newline_1 = defaultArg(newline, \"\\n\");\n const substitutions_1 = defaultArg(substitutions, empty());\n const crefResolver_1 = defaultArg(crefResolver, (_arg) => undefined);\n formatMarkdown(writer, false, false, MarkdownDocument__get_DefinedLinks(doc), substitutions_1, newline_1, crefResolver_1, MarkdownDocument__get_Paragraphs(doc));\n}\n\n/**\n * Transform Markdown text into HTML format. The result\n * will be written to the provided TextWriter.\n */\nexport function Markdown_WriteHtml_Z7FF308E(markdownText, writer, newline, substitutions, crefResolver) {\n Markdown_WriteHtml_27D81AD6(Markdown_Parse_7B74E5F5(markdownText, unwrap(newline)), writer, unwrap(newline), unwrap(substitutions), unwrap(crefResolver));\n}\n\n/**\n * Transform the provided MarkdownDocument into HTML\n * format and return the result as a string.\n */\nexport function Markdown_ToHtml_1A9D76FF(doc, newline, substitutions, crefResolver) {\n const wr = FableTextWriter_$ctor();\n try {\n Markdown_WriteHtml_27D81AD6(doc, wr, unwrap(newline), unwrap(substitutions), unwrap(crefResolver));\n return toString(wr);\n }\n finally {\n disposeSafe(wr);\n }\n}\n\n/**\n * Transform Markdown document into HTML format.\n * The result will be returned as a string.\n */\nexport function Markdown_ToHtml_1BFEAEDB(markdownText, newline, substitutions, crefResolver) {\n return Markdown_ToHtml_1A9D76FF(Markdown_Parse_7B74E5F5(markdownText, unwrap(newline)), unwrap(newline), unwrap(substitutions), unwrap(crefResolver));\n}\n\n/**\n * Transform the provided MarkdownDocument into Md and return the result as a string.\n */\nexport function Markdown_ToMd_1A9D76FF(doc, newline, substitutions, crefResolver) {\n const newline_1 = defaultArg(newline, \"\\n\");\n const substitutions_1 = defaultArg(substitutions, empty());\n const crefResolver_1 = defaultArg(crefResolver, (_arg) => undefined);\n return formatAsMd(MarkdownDocument__get_DefinedLinks(doc), substitutions_1, newline_1, crefResolver_1, MarkdownDocument__get_Paragraphs(doc));\n}\n\n","import { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { union_type, string_type, list_type, class_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\nimport { Common_parseOptions, Common_GenericOptions__AddCaseName_1505, Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection } from \"../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\n\nexport class Level_Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Props\", \"is-mobile\", \"CustomClass\", \"Modifiers\"];\n }\n}\n\nexport function Level_Option_$reflection() {\n return union_type(\"Fulma.Level.Level.Option\", [], Level_Option, () => [[[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [], [[\"Item\", string_type]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\nexport class Item_Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Props\", \"has-text-centered\", \"CustomClass\", \"Modifiers\"];\n }\n}\n\nexport function Item_Option_$reflection() {\n return union_type(\"Fulma.Level.Item.Option\", [], Item_Option, () => [[[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [], [[\"Item\", string_type]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate \n */\nexport function level(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 0:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 2:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 3:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n }, \"level\"), (props_1, children_1) => react.createElement(\"nav\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n/**\n * Generate
\n */\nexport function left(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"level-left\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate
\n */\nexport function right(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"level-right\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate
\n */\nexport function item(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 0:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 2:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 3:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n }, \"level-item\"), (props_1, children_1) => react.createElement(\"div\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n/**\n * Generate
\n */\nexport function heading(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"heading\"), (props, children_1) => react.createElement(\"p\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate
\n */\nexport function title(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"title\"), (props, children_1) => react.createElement(\"p\", keyValueList(props, 1), ...children_1), children);\n}\n\n","import { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { Common_parseOptions, Color_ofColor, Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection, Size_ISize_$reflection, Color_IColor_$reflection } from \"../Common.fs.js\";\nimport { union_type, string_type, list_type, class_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\nimport { Reflection_getCaseName } from \"../Common.fs.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Color\", \"Size\", \"Props\", \"CustomClass\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Message.Option\", [], Option, () => [[[\"Item\", Color_IColor_$reflection()]], [[\"Item\", Size_ISize_$reflection()]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", string_type]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate \n */\nexport function message(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 1:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Reflection_getCaseName(option.fields[0]));\n case 2:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 3:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 4:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Color_ofColor(option.fields[0]));\n }\n }, \"message\"), (props_1, children_1) => react.createElement(\"article\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function header(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"message-header\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate
\n */\nexport function body(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"message-body\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\n","import { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { list_type, class_type, string_type, union_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\nimport { Common_GenericOptions__AddCaseName_1505, Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddProps_Z4E55E0BD, Screen_ToString_2D2414B4, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection, Screen_$reflection, Reflection_getCaseName } from \"../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\nimport { contains } from \"../../fable-library-js.4.24.0/List.js\";\nimport { stringHash } from \"../../fable-library-js.4.24.0/Util.js\";\nimport { printf, toText } from \"../../fable-library-js.4.24.0/String.js\";\nimport { some } from \"../../fable-library-js.4.24.0/Option.js\";\n\nexport class ISize extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"is-1\", \"is-2\", \"is-3\", \"is-4\", \"is-5\", \"is-6\", \"is-7\", \"is-8\"];\n }\n}\n\nexport function ISize_$reflection() {\n return union_type(\"Fulma.Columns.ISize\", [], ISize, () => [[], [], [], [], [], [], [], []]);\n}\n\nexport function ISize_ToString_2283FB3F(x) {\n return Reflection_getCaseName(x);\n}\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"is-centered\", \"is-vcentered\", \"is-multiline\", \"is-gapless\", \"is-mobile\", \"is-desktop\", \"IsGap\", \"IsGapOnly\", \"CustomClass\", \"Props\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Columns.Option\", [], Option, () => [[], [], [], [], [], [], [[\"Item1\", Screen_$reflection()], [\"Item2\", ISize_$reflection()]], [[\"Item1\", Screen_$reflection()], [\"Item2\", ISize_$reflection()]], [[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate
\n */\nexport function columns(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n let screen_4, size_4, x_2, msg, arg, arg_1, arg_2, screen_5, size_5, x_3, msg_1, arg_3, arg_1_1, arg_2_1;\n switch (option.tag) {\n case 6: {\n const size = option.fields[1];\n const screen = option.fields[0];\n if (!contains(\"is-variable\", result.Classes, {\n Equals: (x, y) => (x === y),\n GetHashCode: stringHash,\n })) {\n return Common_GenericOptions__AddClass_Z721C83C5(Common_GenericOptions__AddClass_Z721C83C5(result, \"is-variable\"), ISize_ToString_2283FB3F(size) + Screen_ToString_2D2414B4(screen));\n }\n else {\n return Common_GenericOptions__AddClass_Z721C83C5(result, ISize_ToString_2283FB3F(size) + Screen_ToString_2D2414B4(screen));\n }\n }\n case 7: {\n const size_3 = option.fields[1];\n const screen_3 = option.fields[0];\n if (!contains(\"is-variable\", result.Classes, {\n Equals: (x_1, y_1) => (x_1 === y_1),\n GetHashCode: stringHash,\n })) {\n return Common_GenericOptions__AddClass_Z721C83C5(Common_GenericOptions__AddClass_Z721C83C5(result, \"is-variable\"), (screen_4 = screen_3, (size_4 = size_3, (screen_4.tag === 2) ? ((ISize_ToString_2283FB3F(size_4) + Screen_ToString_2D2414B4(screen_4)) + \"-only\") : ((screen_4.tag === 1) ? ((ISize_ToString_2283FB3F(size_4) + Screen_ToString_2D2414B4(screen_4)) + \"-only\") : ((screen_4.tag === 4) ? ((ISize_ToString_2283FB3F(size_4) + Screen_ToString_2D2414B4(screen_4)) + \"-only\") : ((x_2 = screen_4, (msg = ((arg = Screen_ToString_2D2414B4(x_2), (arg_1 = ISize_ToString_2283FB3F(size_4), (arg_2 = Screen_ToString_2D2414B4(x_2), toText(printf(\"Screen `%s` does not support `is-%s-%s-only`.\"))(arg)(arg_1)(arg_2))))), (console.warn(some(msg)), \"\")))))))));\n }\n else {\n return Common_GenericOptions__AddClass_Z721C83C5(result, (screen_5 = screen_3, (size_5 = size_3, (screen_5.tag === 2) ? ((ISize_ToString_2283FB3F(size_5) + Screen_ToString_2D2414B4(screen_5)) + \"-only\") : ((screen_5.tag === 1) ? ((ISize_ToString_2283FB3F(size_5) + Screen_ToString_2D2414B4(screen_5)) + \"-only\") : ((screen_5.tag === 4) ? ((ISize_ToString_2283FB3F(size_5) + Screen_ToString_2D2414B4(screen_5)) + \"-only\") : ((x_3 = screen_5, (msg_1 = ((arg_3 = Screen_ToString_2D2414B4(x_3), (arg_1_1 = ISize_ToString_2283FB3F(size_5), (arg_2_1 = Screen_ToString_2D2414B4(x_3), toText(printf(\"Screen `%s` does not support `is-%s-%s-only`.\"))(arg_3)(arg_1_1)(arg_2_1))))), (console.warn(some(msg_1)), \"\")))))))));\n }\n }\n case 9:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 8:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 10:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n }, \"columns\"), (props_1, children_1) => react.createElement(\"div\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n","import { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { list_type, class_type, string_type, union_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\nimport { Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Reflection_getCaseName, Modifier_IModifier_$reflection, Screen_$reflection } from \"../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\n\nexport class ISize extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"is-one-quarter\", \"is-one-third\", \"is-half\", \"is-two-thirds\", \"is-three-quarters\", \"is-1\", \"is-2\", \"is-3\", \"is-4\", \"is-5\", \"is-6\", \"is-7\", \"is-8\", \"is-9\", \"is-10\", \"is-11\", \"is-12\", \"is-narrow\", \"is-full\", \"is-one-fifth\", \"is-two-fifths\", \"is-three-fifths\", \"is-four-fifths\"];\n }\n}\n\nexport function ISize_$reflection() {\n return union_type(\"Fulma.Column.ISize\", [], ISize, () => [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]);\n}\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Width\", \"Offset\", \"CustomClass\", \"Props\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Column.Option\", [], Option, () => [[[\"Item1\", Screen_$reflection()], [\"Item2\", ISize_$reflection()]], [[\"Item1\", Screen_$reflection()], [\"Item2\", ISize_$reflection()]], [[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\nfunction suffix(_arg) {\n switch (_arg.tag) {\n case 1:\n return \"-desktop\";\n case 2:\n return \"-tablet\";\n case 3:\n return \"-mobile\";\n case 4:\n return \"-widescreen\";\n case 6:\n return \"-fullhd\";\n case 5:\n return \"-touch\";\n default:\n return \"\";\n }\n}\n\nexport function ofWidth(screen, size) {\n return Reflection_getCaseName(size) + suffix(screen);\n}\n\nexport function ofOffset(screen, offset) {\n const className = Reflection_getCaseName(offset);\n return (\"is-offset-\" + className.slice(3, className.length)) + suffix(screen);\n}\n\n/**\n * Generate
\n */\nexport function column(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 1:\n return Common_GenericOptions__AddClass_Z721C83C5(result, ofOffset(option.fields[0], option.fields[1]));\n case 2:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 3:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 4:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddClass_Z721C83C5(result, ofWidth(option.fields[0], option.fields[1]));\n }\n }, \"column\"), (props_1, children_1) => react.createElement(\"div\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n","import { DiaryClientModule_$ctor } from \"./DiaryClientModule.js\";\nimport { toString, Record } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { enum_type, int32_type, getEnumName, record_type, bool_type, list_type, class_type, string_type, lambda_type, int64_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { Router_modifyLocation, Route, Route_$reflection } from \"../../Omnicv.Client.Common/Router.js\";\nimport { dateToStrForDiary, secondsToHuman, countWordsEx } from \"../../Omnicv.Client.Common/Utils.js\";\nimport { value as value_2, defaultArg } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { Fa_ISize, Fa_IconOption, Fa_i } from \"../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { length, last as last_1, head, singleton as singleton_1, isEmpty, empty, map, ofArray } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { empty as empty_1, map as map_1, singleton, append, delay, toList } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { list as list_1, label, menu, Item_a, Item_li, Item_Option } from \"../../fable_modules/Fulma.3.0.0/Components/Menu.fs.js\";\nimport { contains } from \"../../fable_modules/fable-library-js.4.24.0/Set.js\";\nimport { toClientListView, TagTreeNode__get_IsLeaf } from \"../../Omnicv.Shared.Common/TagUtils.js\";\nimport { createElement } from \"react\";\nimport * as react from \"react\";\nimport { reactApi } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { Option, tag as tag_5 } from \"../../fable_modules/Fulma.3.0.0/Elements/Tag.fs.js\";\nimport { Common_GenericOption, Modifier_IModifier, TextSize_Option, Screen, Text_span, Size_ISize, Color_IColor } from \"../../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { createObj } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { Router_href } from \"../../Omnicv.Client.Common/Router.js\";\nimport { RatingStarsProps, ratingStars as ratingStars_1 } from \"../../Omnicv.Client.Common/Components/RatingStars.js\";\nimport { EventInfo__BestLocation, EventInfo__GetLocationTz, EventInfo__DisplayTimeZone } from \"../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport * as common from \"../../../src/javascript/common.js\";\nimport { isNullOrWhiteSpace } from \"../../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { Footer_p, Footer_div, footer, content as content_1, Header_icon, Header_Title_Option, Header_title, header, card } from \"../../fable_modules/Fulma.3.0.0/Components/Card.fs.js\";\nimport { Option as Option_1, button } from \"../../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { Option as Option_2, icon } from \"../../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport { Fa_i as Fa_i_1 } from \"../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { Icons__ToIcon } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { Icons } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { content as content_2 } from \"../../fable_modules/Fulma.3.0.0/Elements/Content.fs.js\";\nimport { Markdown_ToHtml_1BFEAEDB } from \"../../fable_modules/Fable.Formatting.Markdown.1.0.1/Markdown.fs.js\";\nimport { title as title_1, heading, Item_Option as Item_Option_1, item, level } from \"../../fable_modules/Fulma.3.0.0/Layouts/Level.fs.js\";\nimport { body, header as header_1, Option as Option_3, message } from \"../../fable_modules/Fulma.3.0.0/Components/Message.fs.js\";\nimport { Option as Option_4, columns } from \"../../fable_modules/Fulma.3.0.0/Layouts/Columns.fs.js\";\nimport { Option as Option_5, column } from \"../../fable_modules/Fulma.3.0.0/Layouts/Column.fs.js\";\nimport { defaultOf } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { days } from \"../../fable_modules/fable-library-js.4.24.0/TimeSpan.js\";\nimport { compare, date as date_1, op_Subtraction } from \"../../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport { Class, closeable } from \"../../Omnicv.Client.Common/Components/Notification.js\";\nimport { formatDistance } from \"date-fns\";\nimport { box$0027 } from \"../../fable_modules/Fulma.3.0.0/Elements/Box.fs.js\";\nimport { Option as Option_6, h4, h3 } from \"../../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\n\nexport const diaryModule = DiaryClientModule_$ctor();\n\nexport class DisplayRecordData$1 extends Record {\n constructor(EditFun, TaglineFun, TagsFun, DisplayFun, AddDayLink) {\n super();\n this.EditFun = EditFun;\n this.TaglineFun = TaglineFun;\n this.TagsFun = TagsFun;\n this.DisplayFun = DisplayFun;\n this.AddDayLink = AddDayLink;\n }\n}\n\nexport function DisplayRecordData$1_$reflection(gen0) {\n return record_type(\"Omnicv.Client.Diary.ClientUtils.DisplayRecordData`1\", [gen0], DisplayRecordData$1, () => [[\"EditFun\", lambda_type(int64_type, Route_$reflection())], [\"TaglineFun\", lambda_type(gen0, string_type)], [\"TagsFun\", lambda_type(gen0, string_type)], [\"DisplayFun\", lambda_type(gen0, list_type(class_type(\"Fable.React.ReactElement\", undefined)))], [\"AddDayLink\", bool_type]]);\n}\n\nfunction countDiaryWords(record) {\n return countWordsEx([record.Tagline, record.Notes]);\n}\n\nfunction countReviewWords(record) {\n return countWordsEx([record.Tagline, record.Notes]);\n}\n\nfunction countInteractionWords(record) {\n return countWordsEx([record.Tagline, record.Notes, record.Participants, defaultArg(record.FollowupNotes, \"\")]);\n}\n\nexport function countWordsInRecord(record) {\n switch (record.tag) {\n case 1:\n return countReviewWords(record.fields[0]) | 0;\n case 2:\n return countInteractionWords(record.fields[0]) | 0;\n default:\n return countDiaryWords(record.fields[0]) | 0;\n }\n}\n\nexport function renderTagTree(onClick, input, currentTags) {\n const leafIcon = Fa_i(ofArray([new Fa_IconOption(11, [\"fas fa-tag\"]), new Fa_IconOption(0, [new Fa_ISize(0, [])])]), []);\n const parentIcon = Fa_i(ofArray([new Fa_IconOption(11, [\"fas fa-tags\"]), new Fa_IconOption(0, [new Fa_ISize(0, [])])]), []);\n const options = (tag, isActive) => toList(delay(() => append(singleton(new Item_Option(0, [isActive])), delay(() => (contains(tag, currentTags) ? singleton(new Item_Option(2, [\"tag-menu-chosen\"])) : singleton(new Item_Option(3, [(_arg) => {\n onClick(tag);\n }])))))));\n const treeToMenu = (tree) => {\n if (TagTreeNode__get_IsLeaf(tree)) {\n return Item_li(options(tree.Tag, false), ofArray([createElement(\"span\", {\n children: reactApi.Children.toArray([leafIcon]),\n }), \" \" + tree.Caption]));\n }\n else {\n const arg_3 = map(treeToMenu, tree.Children);\n return ((caption_1) => ((isActive_2) => ((children_2) => {\n const children_7 = [Item_a(options(tree.Tag, isActive_2), ofArray([createElement(\"span\", {\n children: reactApi.Children.toArray([parentIcon]),\n }), \" \", caption_1])), react.createElement(\"ul\", {}, ...children_2)];\n return react.createElement(\"li\", {}, ...children_7);\n })))(tree.Caption)(false)(arg_3);\n }\n };\n return menu(empty(), ofArray([label(empty(), singleton_1(isEmpty(input) ? \"No frequent tags yet\" : \"Frequently used tags\")), list_1(empty(), toList(delay(() => map_1(treeToMenu, input))))]));\n}\n\nexport function renderTag(tag) {\n return tag_5(ofArray([new Option(1, [new Color_IColor(6, [])]), new Option(3, []), new Option(0, [new Size_ISize(2, [])])]), singleton_1(createElement(\"a\", createObj(ofArray([[\"children\", tag], Router_href(new Route(16, [tag]))])))));\n}\n\nexport function ratingStars(value, callback) {\n return ratingStars_1(ofArray([new RatingStarsProps(1, [5]), new RatingStarsProps(4, [24]), new RatingStarsProps(5, [value / 2]), new RatingStarsProps(3, [true]), new RatingStarsProps(2, [callback != null]), new RatingStarsProps(6, [(newValue) => {\n if (callback == null) {\n }\n else {\n callback(~~(newValue * 2));\n }\n }])]));\n}\n\nexport function displayEntry(editFun, deleteFun, eventInfo, record, tagline, tags, displayContent, wordCount) {\n let arg_1;\n let timestamp;\n const temp = `${eventInfo.EventTimestamp} | ${EventInfo__DisplayTimeZone(eventInfo)}`;\n const currentTz = common.getTimezoneName();\n const locationTz = EventInfo__GetLocationTz(eventInfo);\n timestamp = (((locationTz != null) && (value_2(locationTz) !== currentTz)) ? (temp + (` | ${((arg_1 = value_2(locationTz), common.dateToLuxonTz(eventInfo.EventTimestamp, arg_1))).toRFC2822()}`)) : temp);\n let patternInput;\n const wordCountInfo = `Words: ${wordCount}`;\n patternInput = (isNullOrWhiteSpace(tagline) ? [timestamp, wordCountInfo] : [tagline, (wordCountInfo + \" | \") + timestamp]);\n return card(empty(), toList(delay(() => append(singleton(header(empty(), singleton_1(Header_title(singleton_1(new Header_Title_Option(0, [])), singleton_1(patternInput[0]))))), delay(() => {\n const location = EventInfo__BestLocation(eventInfo);\n return append((location !== \"\") ? singleton(header(empty(), ofArray([Header_icon(empty(), singleton_1(Fa_i(singleton_1(new Fa_IconOption(11, [\"fas fa-map-marker-alt\"])), []))), Header_title(empty(), singleton_1(location))]))) : empty_1(), delay(() => append(singleton(content_1(empty(), displayContent(record))), delay(() => append(singleton(footer(empty(), singleton_1(Footer_div(empty(), singleton_1(Text_span(singleton_1(new Common_GenericOption(2, [singleton_1(new Modifier_IModifier(3, [new Screen(0, []), new TextSize_Option(6, [])]))])), singleton_1(patternInput[1]))))))), delay(() => singleton(footer(empty(), toList(delay(() => {\n let children;\n return append(singleton(Footer_p(empty(), singleton_1((children = map(renderTag, toClientListView(tags)), react.createElement(\"div\", {\n className: \"tags\",\n }, ...children))))), delay(() => singleton(Footer_div(empty(), ofArray([button(ofArray([new Option_1(0, [new Color_IColor(4, [])]), new Option_1(5, []), new Option_1(18, [(_arg) => {\n Router_modifyLocation(editFun(eventInfo.Id));\n }])]), singleton_1(icon(singleton_1(new Option_2(0, [new Size_ISize(0, [])])), singleton_1(Fa_i_1(singleton_1(Icons__ToIcon(new Icons(4, []))), []))))), button(ofArray([new Option_1(0, [new Color_IColor(8, [])]), new Option_1(5, []), new Option_1(18, [(_arg_1) => {\n if (window.confirm(`${\"Confirm deletion\"}:\n${\"Are you sure you want to delete this diary entry\"}`)) {\n (() => {\n deleteFun(eventInfo.Id);\n })();\n }\n }])]), singleton_1(icon(singleton_1(new Option_2(0, [new Size_ISize(0, [])])), singleton_1(Fa_i_1(singleton_1(Icons__ToIcon(new Icons(2, []))), [])))))])))));\n }))))))))));\n })))));\n}\n\nexport function displayDiaryContent(record) {\n return singleton_1(content_2(empty(), singleton_1(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(record.Notes),\n },\n }))));\n}\n\nexport function displayReviewContent(record) {\n return ofArray([content_2(empty(), singleton_1(ratingStars(~~record.Rating, undefined))), content_2(empty(), singleton_1(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(record.Notes),\n },\n })))]);\n}\n\nexport function displayInteractionContent(record) {\n return toList(delay(() => {\n let children, children_2;\n return append(singleton(content_2(empty(), ofArray([level(empty(), ofArray([item(singleton_1(new Item_Option_1(1, [])), singleton_1((children = ofArray([heading(empty(), singleton_1(\"Type\")), title_1(empty(), singleton_1(getEnumName(enum_type(\"Omnicv.Diary.Shared.Data.InteractionType\", int32_type, [[\"Other\", 0], [\"Physical\", 1], [\"Call\", 2], [\"VideoCall\", 3], [\"TextMessage\", 4], [\"Email\", 5], [\"Postal\", 6]]), record.InteractionType)))]), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n })))), item(singleton_1(new Item_Option_1(1, [])), singleton_1((children_2 = ofArray([heading(empty(), singleton_1(\"Duration\")), title_1(empty(), singleton_1(secondsToHuman(record.DurationSec)))]), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_2)),\n }))))])), message(ofArray([new Option_3(0, [new Color_IColor(5, [])]), new Option_3(1, [new Size_ISize(0, [])])]), ofArray([header_1(empty(), singleton_1(\"Participants\")), body(empty(), singleton_1(record.Participants))])), message(empty(), singleton_1(body(empty(), singleton_1(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(record.Notes),\n },\n })))))]))), delay(() => ((record.FollowupTime != null) ? singleton(content_2(empty(), toList(delay(() => append(singleton(columns(empty(), ofArray([column(empty(), singleton_1(\"Follow up:\")), column(empty(), toList(delay(() => {\n let copyOfStruct;\n return append(singleton((copyOfStruct = value_2(record.FollowupTime), toString(copyOfStruct))), delay(() => {\n const matchValue = record.FollowupDismissed;\n let matchResult;\n if (matchValue != null) {\n if (matchValue) {\n matchResult = 0;\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return append(singleton(icon(ofArray([new Option_2(0, [new Size_ISize(0, [])]), new Option_2(2, [])]), singleton_1(Fa_i_1(singleton_1(Icons__ToIcon(new Icons(11, []))), [])))), delay(() => singleton(\" [Done]\")));\n default:\n return singleton(defaultOf());\n }\n }));\n })))]))), delay(() => ((record.FollowupNotes != null) ? singleton(columns(empty(), singleton_1(column(empty(), singleton_1(value_2(record.FollowupNotes)))))) : empty_1()))))))) : empty_1())));\n }));\n}\n\nexport function displayDiaryEntry(deleteFun, eventInfo, record, wordCount) {\n return displayEntry((Item) => (new Route(11, [Item])), deleteFun, eventInfo, record, record.Tagline, record.Tags, displayDiaryContent, wordCount);\n}\n\nexport function displayReviewEntry(deleteFun, eventInfo, record, wordCount) {\n return displayEntry((Item) => (new Route(13, [Item])), deleteFun, eventInfo, record, record.Tagline, record.Tags, displayReviewContent, wordCount);\n}\n\nexport function displayInteractionEntry(deleteFun, eventInfo, record, wordCount) {\n return displayEntry((Item) => (new Route(15, [Item])), deleteFun, eventInfo, record, record.Tagline, record.Tags, displayInteractionContent, wordCount);\n}\n\nconst diaryRecordData = new DisplayRecordData$1((Item) => (new Route(11, [Item])), (record) => record.Tagline, (record_1) => record_1.Tags, displayDiaryContent, false);\n\nconst reviewRecordData = new DisplayRecordData$1((Item) => (new Route(11, [Item])), (record) => record.Tagline, (record_1) => record_1.Tags, displayReviewContent, false);\n\nconst interactionRecordData = new DisplayRecordData$1((Item) => (new Route(11, [Item])), (record) => record.Tagline, (record_1) => record_1.Tags, displayInteractionContent, false);\n\nexport function displayUnifiedEntries(entries, disabled, deleteFun) {\n let isMultiDayList;\n if (isEmpty(entries)) {\n isMultiDayList = false;\n }\n else {\n const first = head(entries)[0];\n isMultiDayList = (days(op_Subtraction(date_1(last_1(entries)[0].EventTimestamp), first.EventTimestamp)) > 1);\n }\n return toList(delay(() => {\n let children;\n return append(singleton((children = toList(delay(() => ((isEmpty(entries) && !disabled) ? singleton(closeable(\"No entries found\", new Class(1, []))) : empty_1()))), react.createElement(\"div\", {}, ...children))), delay(() => {\n let children_2;\n return !isEmpty(entries) ? singleton((children_2 = map((entry) => {\n const wordCount = countWordsInRecord(entry[1]) | 0;\n switch (entry[1].tag) {\n case 0:\n return displayDiaryEntry(deleteFun, entry[0], entry[1].fields[0], wordCount);\n case 2:\n return displayInteractionEntry(deleteFun, entry[0], entry[1].fields[0], wordCount);\n default:\n return displayReviewEntry(deleteFun, entry[0], entry[1].fields[0], wordCount);\n }\n }, entries), react.createElement(\"div\", {\n disabled: disabled,\n }, ...children_2))) : singleton(defaultOf());\n }));\n }));\n}\n\nfunction displayReminder(markDismissedFun, reminder) {\n return columns(singleton_1(new Option_4(3, [])), toList(delay(() => {\n const now = common.getNow();\n let patternInput;\n const followupDate = value_2(reminder.FollowupTime);\n const time = formatDistance(followupDate, now, {});\n patternInput = ((compare(followupDate, now) >= 0) ? [time + \" in the future\", \"\"] : [time + \" overdue\", \"overdue-reminder\"]);\n return append(singleton(column(singleton_1(new Option_5(2, [patternInput[1]])), ofArray([reminder.Tagline, \": \", patternInput[0]]))), delay(() => append(singleton(column(singleton_1(new Option_5(4, [singleton_1(new Modifier_IModifier(3, [new Screen(0, []), new TextSize_Option(6, [])]))])), singleton_1(value_2(reminder.FollowupNotes)))), delay(() => singleton(column(empty(), ofArray([button(ofArray([new Option_1(0, [new Color_IColor(4, [])]), new Option_1(5, []), new Option_1(18, [(_arg) => {\n Router_modifyLocation(new Route(9, [dateToStrForDiary(reminder.EventTimestamp)]));\n }])]), singleton_1(icon(singleton_1(new Option_2(0, [new Size_ISize(0, [])])), singleton_1(Fa_i_1(singleton_1(Icons__ToIcon(new Icons(12, []))), []))))), button(ofArray([new Option_1(0, [new Color_IColor(5, [])]), new Option_1(5, []), new Option_1(18, [(_arg_1) => {\n if (window.confirm(`${\"Confirm dismissal\"}:\n${\"Dismiss this reminder?\"}`)) {\n (() => {\n markDismissedFun(reminder.Id);\n })();\n }\n }])]), singleton_1(icon(singleton_1(new Option_2(0, [new Size_ISize(0, [])])), singleton_1(Fa_i_1(singleton_1(Icons__ToIcon(new Icons(11, []))), [])))))])))))));\n })));\n}\n\nexport function displayReminders(entries, disabled, markDismissedFun) {\n return toList(delay(() => {\n let children;\n return !isEmpty(entries) ? singleton(box$0027(empty(), ofArray([h3(empty())(singleton_1(\"Reminders\")), h4(singleton_1(new Option_6(6, [])))(singleton_1(`Total ${length(entries)} reminders`)), (children = map((reminder) => displayReminder(markDismissedFun, reminder), entries), react.createElement(\"div\", {\n disabled: disabled,\n }, ...children))]))) : singleton(defaultOf());\n }));\n}\n\n","import { Union, Record } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { ReminderRecord_$reflection } from \"../modules/Omnicv.Diary.Shared/Data.js\";\nimport { union_type, unit_type, int64_type, class_type, record_type, bool_type, option_type, string_type, list_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { map, ofArray, singleton, empty } from \"../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { Cmd_none } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { exnToDisplayString } from \"../Omnicv.Client.Common/Utils.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { createObj, curry3, curry2 } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { reminderService } from \"../modules/Omnicv.Diary.Client/Server.js\";\nimport { Session__GetCurrentProfileId } from \"../Omnicv.Client.Common/SharedView.js\";\nimport { addDays } from \"../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport * as common from \"../../src/javascript/common.js\";\nimport { Config_variable, Config_getUserTimeZone } from \"../Omnicv.Client.Common/Extensions.js\";\nimport { Registry$1__get_Modules } from \"../Omnicv.Shared/ModulesRegistration.js\";\nimport { clientModuleRegistry } from \"../ClientRegistration.js\";\nimport { body, hero } from \"../fable_modules/Fulma.3.0.0/Layouts/Hero.fs.js\";\nimport { collect, empty as empty_1, singleton as singleton_1, append, delay, toList } from \"../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { box$0027 } from \"../fable_modules/Fulma.3.0.0/Elements/Box.fs.js\";\nimport { Option, h2, h1 } from \"../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { Class, closeable } from \"../Omnicv.Client.Common/Components/Notification.js\";\nimport { defaultOf } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { container } from \"../fable_modules/Fulma.3.0.0/Layouts/Container.fs.js\";\nimport { displayReminders } from \"../modules/Omnicv.Diary.Client/DiaryClientUtils.js\";\nimport { createElement } from \"react\";\nimport * as react from \"react\";\nimport { isNullOrWhiteSpace } from \"../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { content as content_2, Header_title, Header_icon, header, card } from \"../fable_modules/Fulma.3.0.0/Components/Card.fs.js\";\nimport { Fa_IconOption, Fa_i } from \"../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { content as content_3 } from \"../fable_modules/Fulma.3.0.0/Elements/Content.fs.js\";\nimport { getModuleNewNowButtons, IconType__ToIcon } from \"../Omnicv.Client.Common/ClientModule.js\";\nimport { Router_href } from \"../Omnicv.Client.Common/Router.js\";\nimport { value as value_5 } from \"../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { Markdown_ToHtml_1BFEAEDB } from \"../fable_modules/Fable.Formatting.Markdown.1.0.1/Markdown.fs.js\";\n\nexport class Model extends Record {\n constructor(Reminders, Error$, InProgress) {\n super();\n this.Reminders = Reminders;\n this.Error = Error$;\n this.InProgress = InProgress;\n }\n}\n\nexport function Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Index.Component.Model\", [], Model, () => [[\"Reminders\", list_type(ReminderRecord_$reflection())], [\"Error\", option_type(string_type)], [\"InProgress\", bool_type]]);\n}\n\nexport function Model_Default() {\n return new Model(empty(), undefined, false);\n}\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RequestFetch\", \"RemindersFetchSucceeded\", \"FetchFailed\", \"MarkDismissed\", \"MarkDismissedSucceeded\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Index.Component.Msg\", [], Msg, () => [[], [[\"Item\", list_type(ReminderRecord_$reflection())]], [[\"Item\", class_type(\"System.Exception\")]], [[\"Item\", int64_type]], [[\"Item\", unit_type]]]);\n}\n\nexport function init(session) {\n const model = Model_Default();\n if (session.LoggedIn) {\n return [model, singleton((dispatch) => {\n dispatch(new Msg(0, []));\n })];\n }\n else {\n return [model, Cmd_none()];\n }\n}\n\nfunction demoText(user, password) {\n return `\nWelcome to OmniCV demo site! To access most of the functionality, please log in. You have two options:\n\n\nLog in with your Google account here . Then you can use all the features of the demo \n\nLog in as a demo user. The account is read only. It is populated with entries from the diary of the 17th century\nEnglish civil servant Samuel Pepys. He rubbed shoulders with most of the important people of Britain of his time and\nwrote about the events in his journal for ten years. Feel free to browse his notes, that luckily survived to this day.\nUse these credentials to log in:\n\n \n User name: ${user} \n Password: ${password} \n \n \n \n\nAs always, feel free to get in touch if you have any problems, questions, suggestions or general thoughts.\n`;\n}\n\nexport function update(session, msg, model) {\n switch (msg.tag) {\n case 1:\n return [new Model(msg.fields[0], model.Error, false), Cmd_none()];\n case 2:\n return [new Model(model.Reminders, exnToDisplayString(msg.fields[0]), false), Cmd_none()];\n case 3:\n return [new Model(model.Reminders, model.Error, true), Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, curry2(reminderService.MarkReminderDismissed)(Session__GetCurrentProfileId(session)), msg.fields[0], () => (new Msg(4, [undefined])), (Item_3) => (new Msg(2, [Item_3])))];\n case 4:\n return [new Model(model.Reminders, model.Error, false), singleton((dispatch) => {\n dispatch(new Msg(0, []));\n })];\n default: {\n const profileId = Session__GetCurrentProfileId(session) | 0;\n const targetDate = addDays(common.getNow(), 2);\n const timezone = Config_getUserTimeZone(session);\n return [new Model(model.Reminders, model.Error, true), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry3(reminderService.GetReminders)(profileId)(targetDate), timezone, (Item) => (new Msg(1, [Item])), (Item_1) => (new Msg(2, [Item_1])))];\n }\n }\n}\n\nexport function view(session, model, dispatch) {\n const modules = Registry$1__get_Modules(clientModuleRegistry);\n return hero(empty(), singleton(body(empty(), toList(delay(() => append(singleton_1(box$0027(empty(), ofArray([h1(empty())(singleton(\"OmniCV\")), h2(singleton(new Option(6, [])))(singleton(\"Nulla dies sine linea\"))]))), delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't fetch information: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => singleton_1(container(empty(), toList(delay(() => {\n let children;\n return append(singleton_1((children = displayReminders(model.Reminders, model.InProgress, (arg) => {\n dispatch(new Msg(3, [arg]));\n }), react.createElement(\"div\", {}, ...children))), delay(() => {\n let demoPassword, text;\n const demoUser = Config_variable(\"DEMO_USER\");\n return append(!isNullOrWhiteSpace(demoUser) ? ((demoPassword = Config_variable(\"DEMO_USER_PASSWORD\"), (text = demoText(demoUser, demoPassword).trim(), singleton_1(card(empty(), ofArray([header(empty(), ofArray([Header_icon(empty(), singleton(Fa_i(singleton(new Fa_IconOption(11, [\"fas fa-film\"])), []))), Header_title(empty(), singleton(\"Welcome to the demo site!\"))])), content_2(empty(), singleton(content_3(empty(), singleton(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: text,\n },\n })))))])))))) : empty_1(), delay(() => collect((clientModule) => {\n const descriptor = clientModule.Descriptor();\n return singleton_1(card(empty(), ofArray([header(empty(), ofArray([Header_icon(empty(), singleton(IconType__ToIcon(descriptor.Icon))), Header_title(empty(), toList(delay(() => ((session.LoggedIn && (descriptor.View != null)) ? singleton_1(createElement(\"a\", createObj(ofArray([[\"children\", clientModule.Details.Title], Router_href(value_5(descriptor.View)(session))])))) : singleton_1(clientModule.Details.Title)))))])), header(empty(), singleton(Header_title(empty(), singleton(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(clientModule.Details.Description),\n },\n }))))), content_2(empty(), session.LoggedIn ? singleton(getModuleNewNowButtons(clientModule, value_5(session.UserInfo).ReadOnly)) : map((des) => container(empty(), singleton(des.Caption)), clientModule.EntryDescriptors()))])));\n }, modules)));\n }));\n }))))));\n })))))));\n}\n\n","import { Remoting_buildProxy_64DC51C } from \"../fable_modules/Fable.Remoting.Client.7.32.0/Remoting.fs.js\";\nimport { RemotingModule_createApi, RemotingModule_withRouteBuilder } from \"../fable_modules/Fable.Remoting.Client.7.32.0/Remoting.fs.js\";\nimport { CommonAuthService_$reflection, CommonAuthService_RouteBuilder, AnonymousService_$reflection, AnonymousService_RouteBuilder } from \"../Omnicv.Shared/API.js\";\nimport { ProxyRequestException__get_Response, ProxyRequestException__get_StatusCode, ProxyRequestException } from \"../fable_modules/Fable.Remoting.Client.7.32.0/Types.fs.js\";\nimport { ServerError_$reflection, ServerError } from \"../Omnicv.Shared.Common/Errors.js\";\nimport { SimpleJson_tryParse } from \"../fable_modules/Fable.SimpleJson.3.24.0/SimpleJson.fs.js\";\nimport { Convert_fromJson } from \"../fable_modules/Fable.SimpleJson.3.24.0/Json.Converter.fs.js\";\nimport { createTypeInfo } from \"../fable_modules/Fable.SimpleJson.3.24.0/TypeInfo.Converter.fs.js\";\nimport { anonRecord_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\n\nexport const anonService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder(AnonymousService_RouteBuilder, RemotingModule_createApi()), AnonymousService_$reflection());\n\nexport const commonAuthService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder(CommonAuthService_RouteBuilder, RemotingModule_createApi()), CommonAuthService_$reflection());\n\nexport function exnToError(e) {\n let matchValue;\n if (e instanceof ProxyRequestException) {\n const ex = e;\n try {\n return ((matchValue = SimpleJson_tryParse(ProxyRequestException__get_Response(ex).ResponseBody), (matchValue != null) ? Convert_fromJson(matchValue, createTypeInfo(anonRecord_type([\"error\", ServerError_$reflection()]))) : (() => {\n throw new Error(\"Couldn\\'t parse the input JSON string because it seems to be invalid\");\n })())).error;\n }\n catch (matchValue_1) {\n return (ProxyRequestException__get_StatusCode(ex) === 401) ? (new ServerError(1, [ProxyRequestException__get_Response(ex).ResponseBody])) : (new ServerError(0, [e.message]));\n }\n }\n else {\n return new ServerError(0, [e.message]);\n }\n}\n\n","import { Union, Record } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { union_type, class_type, record_type, bool_type, list_type, option_type, string_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { SummaryEntry_$reflection } from \"../Omnicv.Shared/API.js\";\nimport { map, isEmpty, ofArray, cons, singleton, empty } from \"../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { Cmd_none, Cmd_batch } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { commonAuthService, anonService } from \"../Omnicv.Client.Common/CommonServer.js\";\nimport { int32ToString, curry2 } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { Session__GetCurrentProfileId } from \"../Omnicv.Client.Common/SharedView.js\";\nimport { exnToDisplayString } from \"../Omnicv.Client.Common/Utils.js\";\nimport { Option, columns } from \"../fable_modules/Fulma.3.0.0/Layouts/Columns.fs.js\";\nimport { column } from \"../fable_modules/Fulma.3.0.0/Layouts/Column.fs.js\";\nimport { empty as empty_1, singleton as singleton_1, append, delay, toList } from \"../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { h3, h1 } from \"../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { Config_releaseVersion } from \"../Omnicv.Client.Common/Extensions.js\";\nimport * as common from \"../../src/javascript/common.js\";\nimport { Class, closeable } from \"../Omnicv.Client.Common/Components/Notification.js\";\nimport { defaultOf } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { content as content_1, card } from \"../fable_modules/Fulma.3.0.0/Components/Card.fs.js\";\nimport { content as content_2 } from \"../fable_modules/Fulma.3.0.0/Elements/Content.fs.js\";\nimport { createElement } from \"react\";\nimport { Markdown_ToHtml_1BFEAEDB } from \"../fable_modules/Fable.Formatting.Markdown.1.0.1/Markdown.fs.js\";\nimport { reactApi } from \"../fable_modules/Feliz.2.9.0/Interop.fs.js\";\n\nexport class Model extends Record {\n constructor(Information, Summaries, Error$, InProgress) {\n super();\n this.Information = Information;\n this.Summaries = Summaries;\n this.Error = Error$;\n this.InProgress = InProgress;\n }\n}\n\nexport function Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.About.Component.Model\", [], Model, () => [[\"Information\", option_type(string_type)], [\"Summaries\", list_type(SummaryEntry_$reflection())], [\"Error\", option_type(string_type)], [\"InProgress\", bool_type]]);\n}\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Succeeded\", \"SucceededSummaries\", \"Failed\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.About.Component.Msg\", [], Msg, () => [[[\"Item\", string_type]], [[\"Item\", list_type(SummaryEntry_$reflection())]], [[\"Item\", class_type(\"System.Exception\")]]]);\n}\n\nexport function init(session) {\n return [new Model(undefined, empty(), undefined, false), Cmd_batch(cons(Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, anonService.About, undefined, (Item) => (new Msg(0, [Item])), (Item_1) => (new Msg(2, [Item_1]))), session.LoggedIn ? singleton(Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, curry2(commonAuthService.GetContentSummary)(Session__GetCurrentProfileId(session)), 1, (Item_2) => (new Msg(1, [Item_2])), (Item_3) => (new Msg(2, [Item_3])))) : empty()))];\n}\n\nexport function update(msg, model) {\n switch (msg.tag) {\n case 1:\n return [new Model(model.Information, msg.fields[0], model.Error, false), Cmd_none()];\n case 2:\n return [new Model(undefined, model.Summaries, exnToDisplayString(msg.fields[0]), false), Cmd_none()];\n default:\n return [new Model(msg.fields[0], model.Summaries, model.Error, false), Cmd_none()];\n }\n}\n\nfunction displaySummary(summary) {\n return columns(singleton(new Option(4, [])), ofArray([column(empty(), singleton(summary.Caption)), column(empty(), singleton(summary.ContentType)), column(empty(), singleton(int32ToString(summary.Count)))]));\n}\n\nexport function view(model, dispatch) {\n const children_4 = toList(delay(() => append(singleton_1(h1(empty())(singleton(\"About\"))), delay(() => append(singleton_1(columns(empty(), ofArray([column(empty(), singleton(\"Client version\")), column(empty(), singleton(Config_releaseVersion()))]))), delay(() => append(singleton_1(columns(empty(), ofArray([column(empty(), singleton(\"React version\")), column(empty(), singleton(common.getReactVersion()))]))), delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't fetch information: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => {\n let children_2;\n const matchValue_1 = model.Information;\n if (matchValue_1 != null) {\n const value = matchValue_1;\n return singleton_1((children_2 = toList(delay(() => append(singleton_1(card(empty(), singleton(content_1(empty(), singleton(content_2(empty(), singleton(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(value),\n },\n })))))))), delay(() => (!isEmpty(model.Summaries) ? append(singleton_1(h3(empty())(singleton(\"Summaries\"))), delay(() => {\n let children;\n return singleton_1((children = map(displaySummary, model.Summaries), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n })));\n })) : empty_1()))))), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_2)),\n })));\n }\n else {\n return singleton_1(createElement(\"i\", {\n children: [\"Not loaded\"],\n }));\n }\n }));\n }))))))));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_4)),\n });\n}\n\n","export function objectFieldGetter(name, obj) {\n return obj[name];\n}\n\nexport function objectFieldSetter(name, obj, newValue) {\n var cloneObj = {...obj};\n cloneObj[name] = newValue;\n return cloneObj;\n}\n\nfunction resolveProperty(obj, name) {\n if (obj.hasOwnProperty(name)) {\n return obj[name];\n }\n else if (obj.hasOwnProperty(\"fields\")) {\n return resolveProperty(obj[\"fields\"], name);\n }\n else if (Array.isArray(obj)) {\n return resolveProperty(obj[0], name);\n }\n else {\n return null;\n }\n}\n\nexport function getId(obj) {\n return obj.Id;\n}\n\nexport function getExerciseId(obj) {\n return resolveProperty(obj, \"ExerciseId\");\n}\n\nexport function getName(obj) {\n return resolveProperty(obj, \"Name\");\n}\n\nexport function getProperties(obj) {\n if (obj.hasOwnProperty(\"fields\")) {\n return getProperties(obj[\"fields\"]);\n }\n else if (Array.isArray(obj)) {\n return getProperties(obj[0]);\n }\n\n var names = Array();\n var values = Array();\n for (var name in obj) {\n if (obj.hasOwnProperty(name)) {\n var value = obj[name];\n names.push(name);\n if (value != null)\n values.push(value.toString());\n else\n values.push(null)\n }\n }\n var result = {\n \"Names\": names,\n \"Values\": values\n };\n return result;\n}","import { Union } from \"../../../fable-library-js.4.24.0/Types.js\";\nimport { union_type, list_type, class_type, string_type } from \"../../../fable-library-js.4.24.0/Reflection.js\";\nimport { Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions__AddCaseName_1505, Common_parseOptions, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Size_ISize_$reflection, Modifier_IModifier_$reflection } from \"../../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../../fable-library-js.4.24.0/MapUtil.js\";\nimport { Reflection_getCaseName } from \"../../Common.fs.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"has-addons\", \"has-addons-centered\", \"has-addons-right\", \"has-addons-fullwidth\", \"is-grouped\", \"is-grouped-centered\", \"is-grouped-right\", \"is-grouped-multiline\", \"is-horizontal\", \"is-expanded\", \"CustomClass\", \"Props\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Field.Option\", [], Option, () => [[], [], [], [], [], [], [], [], [], [], [[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\nexport class Label_Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Size\", \"is-normal\", \"CustomClass\", \"Props\", \"Modifiers\"];\n }\n}\n\nexport function Label_Option_$reflection() {\n return union_type(\"Fulma.Field.Label.Option\", [], Label_Option, () => [[[\"Item\", Size_ISize_$reflection()]], [], [[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate
\n */\nexport function body(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"field-body\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate
\n */\nexport function label(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 1:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n case 3:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 2:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 4:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Reflection_getCaseName(option.fields[0]));\n }\n }, \"field-label\"), (props_1, children_1) => react.createElement(\"div\", keyValueList(props_1, 1), ...children_1), children);\n}\n\nexport function fieldView(element, options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 2:\n return Common_GenericOptions__AddCaseName_1505(Common_GenericOptions__AddClass_Z721C83C5(result, \"has-addons\"), option);\n case 3:\n return Common_GenericOptions__AddCaseName_1505(Common_GenericOptions__AddClass_Z721C83C5(result, \"has-addons\"), option);\n case 5:\n return Common_GenericOptions__AddCaseName_1505(Common_GenericOptions__AddClass_Z721C83C5(result, \"is-grouped\"), option);\n case 6:\n return Common_GenericOptions__AddCaseName_1505(Common_GenericOptions__AddClass_Z721C83C5(result, \"is-grouped\"), option);\n case 7:\n return Common_GenericOptions__AddCaseName_1505(Common_GenericOptions__AddClass_Z721C83C5(result, \"is-grouped\"), option);\n case 0:\n case 4:\n case 8:\n case 9:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n case 11:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 10:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 12:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddCaseName_1505(Common_GenericOptions__AddClass_Z721C83C5(result, \"has-addons\"), option);\n }\n }, \"field\"), element, children);\n}\n\n/**\n * Generate
\n */\nexport function div(x, y) {\n return fieldView((props, children) => react.createElement(\"div\", keyValueList(props, 1), ...children), x, y);\n}\n\n/**\n * Generate
\n */\nexport function p(x, y) {\n return fieldView((props, children) => react.createElement(\"p\", keyValueList(props, 1), ...children), x, y);\n}\n\n","import { Union } from \"../../../fable-library-js.4.24.0/Types.js\";\nimport { Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions__AddProp_ZCC5A61F, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection, Size_ISize_$reflection } from \"../../Common.fs.js\";\nimport { union_type, list_type, class_type, string_type } from \"../../../fable-library-js.4.24.0/Reflection.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../../fable-library-js.4.24.0/MapUtil.js\";\nimport { HTMLAttr } from \"../../../Fable.React.9.4.0/Fable.React.Props.fs.js\";\nimport { Reflection_getCaseName } from \"../../Common.fs.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Size\", \"For\", \"CustomClass\", \"Props\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Label.Option\", [], Option, () => [[[\"Item\", Size_ISize_$reflection()]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate \n */\nexport function label(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 1:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(96, [option.fields[0]]));\n case 3:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 2:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 4:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Reflection_getCaseName(option.fields[0]));\n }\n }, \"label\"), (props_1, children_1) => react.createElement(\"label\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n","import { Union } from \"../../../fable-library-js.4.24.0/Types.js\";\nimport { union_type, list_type, class_type, string_type, bool_type } from \"../../../fable-library-js.4.24.0/Reflection.js\";\nimport { Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions__AddCaseName_1505, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection } from \"../../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../../fable-library-js.4.24.0/MapUtil.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"has-icons-right\", \"has-icons-left\", \"is-loading\", \"is-expanded\", \"CustomClass\", \"Props\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Control.Option\", [], Option, () => [[], [], [[\"Item\", bool_type]], [], [[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\nexport function controlView(element, options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 2:\n if (option.fields[0]) {\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n else {\n return result;\n }\n case 5:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 4:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 6:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n }, \"control\"), element, children);\n}\n\n/**\n * Generate
\n */\nexport function div(x, y) {\n return controlView((props, children) => react.createElement(\"div\", keyValueList(props, 1), ...children), x, y);\n}\n\n/**\n * Generate
\n */\nexport function p(x, y) {\n return controlView((props, children) => react.createElement(\"p\", keyValueList(props, 1), ...children), x, y);\n}\n\n","import { Union } from \"../../../fable-library-js.4.24.0/Types.js\";\nimport { union_type, list_type, class_type, string_type } from \"../../../fable-library-js.4.24.0/Reflection.js\";\nimport { Color_ofColor, Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection, Color_IColor_$reflection } from \"../../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../../fable-library-js.4.24.0/MapUtil.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"CustomClass\", \"Props\", \"Color\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Help.Option\", [], Option, () => [[[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", Color_IColor_$reflection()]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate
\n */\nexport function help(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 1:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 0:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 3:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Color_ofColor(option.fields[0]));\n }\n }, \"help\"), (props_1, children_1) => react.createElement(\"p\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n","import { Union } from \"../../../fable-library-js.4.24.0/Types.js\";\nimport { Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions__AddProp_ZCC5A61F, Common_GenericOptions__AddCaseName_1505, Color_ofColor, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection, Color_IColor_$reflection, Size_ISize_$reflection } from \"../../Common.fs.js\";\nimport { union_type, lambda_type, unit_type, list_type, class_type, string_type, bool_type } from \"../../../fable-library-js.4.24.0/Reflection.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../../fable-library-js.4.24.0/MapUtil.js\";\nimport { Reflection_getCaseName } from \"../../Common.fs.js\";\nimport { DOMAttr, Prop, HTMLAttr } from \"../../../Fable.React.9.4.0/Fable.React.Props.fs.js\";\nimport { equals } from \"../../../fable-library-js.4.24.0/Util.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Size\", \"is-fullwidth\", \"is-inline\", \"is-loading\", \"is-focused\", \"is-active\", \"IsReadOnly\", \"Color\", \"Id\", \"Disabled\", \"Value\", \"DefaultValue\", \"ValueOrDefault\", \"Placeholder\", \"Props\", \"OnChange\", \"Ref\", \"CustomClass\", \"has-fixed-size\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Textarea.Option\", [], Option, () => [[[\"Item\", Size_ISize_$reflection()]], [], [], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [[\"Item\", Color_IColor_$reflection()]], [[\"Item\", string_type]], [[\"Item\", bool_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", lambda_type(class_type(\"Browser.Types.Event\", undefined), unit_type)]], [[\"Item\", lambda_type(class_type(\"Browser.Types.Element\", undefined), unit_type)]], [[\"Item\", string_type]], [], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate \n */\nexport function textarea(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n let matchResult, state;\n switch (option.tag) {\n case 7: {\n matchResult = 1;\n break;\n }\n case 1:\n case 18:\n case 2: {\n matchResult = 2;\n break;\n }\n case 8: {\n matchResult = 4;\n break;\n }\n case 9: {\n matchResult = 5;\n break;\n }\n case 6: {\n matchResult = 6;\n break;\n }\n case 10: {\n matchResult = 7;\n break;\n }\n case 11: {\n matchResult = 8;\n break;\n }\n case 12: {\n matchResult = 9;\n break;\n }\n case 13: {\n matchResult = 10;\n break;\n }\n case 15: {\n matchResult = 11;\n break;\n }\n case 16: {\n matchResult = 12;\n break;\n }\n case 14: {\n matchResult = 13;\n break;\n }\n case 17: {\n matchResult = 14;\n break;\n }\n case 19: {\n matchResult = 15;\n break;\n }\n case 3: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n case 4: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n case 5: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n default:\n matchResult = 0;\n }\n switch (matchResult) {\n case 0:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Reflection_getCaseName(option.fields[0]));\n case 1:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Color_ofColor(option.fields[0]));\n case 2:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n case 3:\n if (state) {\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n else {\n return result;\n }\n case 4:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(99, [option.fields[0]]));\n case 5:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(79, [option.fields[0]]));\n case 6:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(132, [option.fields[0]]));\n case 7:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(161, [option.fields[0]]));\n case 8:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(1, [option.fields[0]]));\n case 9: {\n const valueOrDefault = option.fields[0];\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new Prop(1, [(e) => {\n if (!(e == null) && !equals(e.value, valueOrDefault)) {\n e.value = valueOrDefault;\n }\n }]));\n }\n case 10:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(128, [option.fields[0]]));\n case 11:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new DOMAttr(9, [option.fields[0]]));\n case 12:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new Prop(1, [option.fields[0]]));\n case 13:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 14:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n }\n }, \"textarea\"), (props_1, children_1) => react.createElement(\"textarea\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n","import { Union } from \"../../../fable-library-js.4.24.0/Types.js\";\nimport { list_type, lambda_type, unit_type, class_type, bool_type, string_type, union_type } from \"../../../fable-library-js.4.24.0/Reflection.js\";\nimport { Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions__AddProp_ZCC5A61F, Color_ofColor, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions__AddCaseName_1505, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_Z2B8EEFE, Modifier_IModifier_$reflection, Color_IColor_$reflection, Size_ISize_$reflection } from \"../../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../../fable-library-js.4.24.0/MapUtil.js\";\nimport { Reflection_getCaseName } from \"../../Common.fs.js\";\nimport { DOMAttr, Prop, HTMLAttr } from \"../../../Fable.React.9.4.0/Fable.React.Props.fs.js\";\nimport { equals } from \"../../../fable-library-js.4.24.0/Util.js\";\n\nexport class IInputType extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Text\", \"Password\", \"DatetimeLocal\", \"Date\", \"Month\", \"Time\", \"Week\", \"Number\", \"Email\", \"Url\", \"Search\", \"Tel\", \"ColorType\"];\n }\n}\n\nexport function IInputType_$reflection() {\n return union_type(\"Fulma.Input.IInputType\", [], IInputType, () => [[], [], [], [], [], [], [], [], [], [], [], [], []]);\n}\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Size\", \"Type\", \"Color\", \"Id\", \"Disabled\", \"IsReadOnly\", \"is-static\", \"is-rounded\", \"Value\", \"Key\", \"DefaultValue\", \"ValueOrDefault\", \"Placeholder\", \"OnChange\", \"Ref\", \"Props\", \"CustomClass\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Input.Option\", [], Option, () => [[[\"Item\", Size_ISize_$reflection()]], [[\"Item\", IInputType_$reflection()]], [[\"Item\", Color_IColor_$reflection()]], [[\"Item\", string_type]], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", lambda_type(class_type(\"Browser.Types.Event\", undefined), unit_type)]], [[\"Item\", lambda_type(class_type(\"Browser.Types.Element\", undefined), unit_type)]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", string_type]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\nfunction ofType(typ) {\n switch (typ.tag) {\n case 1:\n return \"password\";\n case 2:\n return \"datetime-local\";\n case 3:\n return \"date\";\n case 4:\n return \"month\";\n case 5:\n return \"time\";\n case 6:\n return \"week\";\n case 7:\n return \"number\";\n case 8:\n return \"email\";\n case 9:\n return \"url\";\n case 10:\n return \"search\";\n case 11:\n return \"tel\";\n case 12:\n return \"color\";\n default:\n return \"text\";\n }\n}\n\n/**\n * Generate \n */\nexport function input(options) {\n return Common_GenericOptions__ToReactElement_Z2B8EEFE(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 7:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n case 0:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Reflection_getCaseName(option.fields[0]));\n case 2:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Color_ofColor(option.fields[0]));\n case 1:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(159, [ofType(option.fields[0])]));\n case 3:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(99, [option.fields[0]]));\n case 4:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(79, [option.fields[0]]));\n case 5:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(132, [option.fields[0]]));\n case 8:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(161, [option.fields[0]]));\n case 10:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(1, [option.fields[0]]));\n case 11: {\n const valueOrDefault = option.fields[0];\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new Prop(1, [(e) => {\n if (!(e == null) && !equals(e.value, valueOrDefault)) {\n e.value = valueOrDefault;\n }\n }]));\n }\n case 12:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(128, [option.fields[0]]));\n case 13:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new DOMAttr(9, [option.fields[0]]));\n case 14:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new Prop(1, [option.fields[0]]));\n case 15:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 16:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 17:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n case 9:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new Prop(0, [option.fields[0]]));\n default:\n if (option.fields[0]) {\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n else {\n return result;\n }\n }\n }, \"input\"), (props_1) => react.createElement(\"input\", keyValueList(props_1, 1)));\n}\n\n","import { Union } from \"../../../fable-library-js.4.24.0/Types.js\";\nimport { Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions__AddCaseName_1505, Color_ofColor, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection, Color_IColor_$reflection, Size_ISize_$reflection } from \"../../Common.fs.js\";\nimport { union_type, string_type, list_type, class_type, bool_type } from \"../../../fable-library-js.4.24.0/Reflection.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../../fable-library-js.4.24.0/MapUtil.js\";\nimport { Reflection_getCaseName } from \"../../Common.fs.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Size\", \"is-fullwidth\", \"is-inline\", \"is-loading\", \"is-focused\", \"is-active\", \"Disabled\", \"Color\", \"is-rounded\", \"is-multiple\", \"Props\", \"CustomClass\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Select.Option\", [], Option, () => [[[\"Item\", Size_ISize_$reflection()]], [], [], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [[\"Item\", Color_IColor_$reflection()]], [], [], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", string_type]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate
\n */\nexport function select(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n let matchResult, state;\n switch (option.tag) {\n case 7: {\n matchResult = 1;\n break;\n }\n case 1:\n case 2:\n case 9:\n case 8: {\n matchResult = 2;\n break;\n }\n case 10: {\n matchResult = 4;\n break;\n }\n case 11: {\n matchResult = 5;\n break;\n }\n case 12: {\n matchResult = 6;\n break;\n }\n case 3: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n case 4: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n case 5: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n case 6: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n default:\n matchResult = 0;\n }\n switch (matchResult) {\n case 0:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Reflection_getCaseName(option.fields[0]));\n case 1:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Color_ofColor(option.fields[0]));\n case 2:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n case 3:\n if (state) {\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n else {\n return result;\n }\n case 4:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 5:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n }\n }, \"select\"), (props_1, children_1) => react.createElement(\"div\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n","import { Union } from \"../fable-library-js.4.24.0/Types.js\";\nimport { Common_GenericOption, TextWeight_Option, Modifier_IModifier, Color_IColor, Text_span, Common_GenericOptions__ToReactElement_4509C2D7, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_Z2B8EEFE, Color_ofColor, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions__AddProp_ZCC5A61F, Common_GenericOptions__AddCaseName_1505, Common_GenericOptions__AddClass_Z721C83C5, Size_ISize_$reflection, Color_IColor_$reflection } from \"../Fulma.3.0.0/Common.fs.js\";\nimport { union_type, string_type, lambda_type, unit_type, list_type, class_type, bool_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { Reflection_getCaseName } from \"../Fulma.3.0.0/Common.fs.js\";\nimport { DOMAttr, HTMLAttr } from \"../Fable.React.9.4.0/Fable.React.Props.fs.js\";\nimport { empty, ofArray, singleton, tryPick } from \"../fable-library-js.4.24.0/List.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../fable-library-js.4.24.0/MapUtil.js\";\nimport { div } from \"../Fulma.3.0.0/Elements/Form/Field.fs.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Color\", \"Size\", \"is-rtl\", \"has-no-border\", \"has-background-color\", \"is-circle\", \"Checked\", \"Disabled\", \"is-block\", \"LabelProps\", \"InputProps\", \"OnChange\", \"CustomClass\", \"Id\", \"Name\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Extensions.Wikiki.Checkradio.Option\", [], Option, () => [[[\"Item\", Color_IColor_$reflection()]], [[\"Item\", Size_ISize_$reflection()]], [], [], [], [], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", lambda_type(class_type(\"Browser.Types.Event\", undefined), unit_type)]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]]]);\n}\n\nfunction parseOptionsForInput(result, option) {\n switch (option.tag) {\n case 1:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Reflection_getCaseName(option.fields[0]));\n case 5:\n case 2:\n case 3:\n case 4:\n case 8:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n case 6:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(62, [option.fields[0]]));\n case 7:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(79, [option.fields[0]]));\n case 14:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(123, [option.fields[0]]));\n case 10:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 11:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new DOMAttr(9, [option.fields[0]]));\n case 13:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(99, [option.fields[0]]));\n case 12:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 9:\n return result;\n default:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Color_ofColor(option.fields[0]));\n }\n}\n\nfunction parseOptionsForLabel(result, option) {\n switch (option.tag) {\n case 13:\n return Common_GenericOptions__AddProp_ZCC5A61F(result, new HTMLAttr(96, [option.fields[0]]));\n case 9:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n default:\n return result;\n }\n}\n\nfunction hasId(options) {\n return tryPick((option) => {\n if (option.tag === 13) {\n return true;\n }\n else {\n return undefined;\n }\n }, options) != null;\n}\n\nfunction genericElement(inputType, baseClass, options, children) {\n if (hasId(options)) {\n const inputElement = Common_GenericOptions__ToReactElement_Z2B8EEFE(Common_GenericOptions_Parse_Z4D1A7726(options, parseOptionsForInput, baseClass, singleton(new HTMLAttr(159, [inputType]))), (props) => react.createElement(\"input\", keyValueList(props, 1)));\n const labelElement = Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, parseOptionsForLabel), (props_3, children_1) => react.createElement(\"label\", keyValueList(props_3, 1), ...children_1), children);\n return react.createElement(react.Fragment, {}, inputElement, labelElement);\n }\n else {\n return Text_span(singleton(new Common_GenericOption(2, [ofArray([new Modifier_IModifier(1, [new Color_IColor(8, [])]), new Modifier_IModifier(2, [new TextWeight_Option(3, [])])])])), singleton(\"You need to set an Id value for your Checkradio \"));\n }\n}\n\n/**\n * Generate\n * \n * \n * One \n * \n */\nexport function checkboxInline(options, children) {\n return genericElement(\"checkbox\", \"is-checkradio\", options, children);\n}\n\n/**\n * Generate\n * \n * \n * \n * One \n * \n *
\n */\nexport function checkbox(options, children) {\n return div(empty(), singleton(checkboxInline(options, children)));\n}\n\n/**\n * Generate\n * \n * \n * One \n * \n */\nexport function radioInline(options, children) {\n return genericElement(\"radio\", \"is-checkradio\", options, children);\n}\n\n/**\n * Generate\n * \n * \n * \n * One \n * \n *
\n */\nexport function radio(options, children) {\n return div(empty(), singleton(radioInline(options, children)));\n}\n\n","import { Common_GenericOptions__ToReactElement_Z2B8EEFE, Common_parseOptions, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7 } from \"../../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../../fable-library-js.4.24.0/MapUtil.js\";\nimport { HTMLAttr } from \"../../../Fable.React.9.4.0/Fable.React.Props.fs.js\";\nimport { singleton } from \"../../../fable-library-js.4.24.0/List.js\";\n\n/**\n * Generate \n */\nexport function checkbox(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"checkbox\"), (props, children_1) => react.createElement(\"label\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function input(options) {\n return Common_GenericOptions__ToReactElement_Z2B8EEFE(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"checkbox\", singleton(new HTMLAttr(159, [\"checkbox\"]))), (props) => react.createElement(\"input\", keyValueList(props, 1)));\n}\n\n","import { Union, Record } from \"../fable-library-js.4.24.0/Types.js\";\nimport { class_type, union_type, list_type, record_type, bool_type, string_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { isNullOrWhiteSpace } from \"../fable-library-js.4.24.0/String.js\";\nimport { map } from \"../fable-library-js.4.24.0/Array.js\";\nimport { map as map_1, delay, toArray } from \"../fable-library-js.4.24.0/Seq.js\";\nimport \"./SelectSearch.css\";\n\nexport class SelectItem extends Record {\n constructor(value, name, disabled) {\n super();\n this.value = value;\n this.name = name;\n this.disabled = disabled;\n }\n}\n\nexport function SelectItem_$reflection() {\n return record_type(\"Feliz.SelectSearch.SelectItem\", [], SelectItem, () => [[\"value\", string_type], [\"name\", string_type], [\"disabled\", bool_type]]);\n}\n\nexport class SelectGroup extends Record {\n constructor(name, items) {\n super();\n this.name = name;\n this.items = items;\n }\n}\n\nexport function SelectGroup_$reflection() {\n return record_type(\"Feliz.SelectSearch.SelectGroup\", [], SelectGroup, () => [[\"name\", string_type], [\"items\", list_type(SelectItem_$reflection())]]);\n}\n\nexport class SelectOption extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Item\", \"Group\"];\n }\n}\n\nexport function SelectOption_$reflection() {\n return union_type(\"Feliz.SelectSearch.SelectOption\", [], SelectOption, () => [[[\"Item\", SelectItem_$reflection()]], [[\"Item\", SelectGroup_$reflection()]]]);\n}\n\nexport function Interop_createDefaultFilter(predicate) {\n return (selectItems) => ((searchQuery) => (isNullOrWhiteSpace(searchQuery) ? selectItems : map((jsItem_1) => {\n if (jsItem_1.type === \"group\") {\n let filteredItems;\n const array_1 = jsItem_1.items;\n filteredItems = array_1.filter((groupItem) => {\n let name_1;\n return predicate((name_1 = groupItem.name, new SelectItem(groupItem.value, name_1, groupItem.disabled)), searchQuery);\n });\n return Object.assign({}, jsItem_1, {\n items: filteredItems,\n });\n }\n else {\n return jsItem_1;\n }\n }, selectItems.filter((jsItem) => {\n let name;\n if (jsItem.type === \"group\") {\n return true;\n }\n else {\n return predicate((name = jsItem.name, new SelectItem(jsItem.value, name, jsItem.disabled)), searchQuery);\n }\n }))));\n}\n\nexport const Interop_defaultProps = {\n filterOptions: Interop_createDefaultFilter((item, query) => (item.name.toLocaleLowerCase().indexOf(query.trim().toLocaleLowerCase()) >= 0)),\n};\n\nexport class OptionRendererProps extends Record {\n constructor(attributes, className, option, selected, highlighted) {\n super();\n this.attributes = attributes;\n this.className = className;\n this.option = option;\n this.selected = selected;\n this.highlighted = highlighted;\n }\n}\n\nexport function OptionRendererProps_$reflection() {\n return record_type(\"Feliz.SelectSearch.OptionRendererProps\", [], OptionRendererProps, () => [[\"attributes\", class_type(\"System.Collections.Generic.IEnumerable`1\", [class_type(\"Feliz.IReactProperty\")])], [\"className\", string_type], [\"option\", SelectItem_$reflection()], [\"selected\", bool_type], [\"highlighted\", bool_type]]);\n}\n\nexport class ValueRendererProps extends Record {\n constructor(attributes, focus, disabled, fetching, search, displayValue, values) {\n super();\n this.attributes = attributes;\n this.focus = focus;\n this.disabled = disabled;\n this.fetching = fetching;\n this.search = search;\n this.displayValue = displayValue;\n this.values = values;\n }\n}\n\nexport function ValueRendererProps_$reflection() {\n return record_type(\"Feliz.SelectSearch.ValueRendererProps\", [], ValueRendererProps, () => [[\"attributes\", class_type(\"System.Collections.Generic.IEnumerable`1\", [class_type(\"Feliz.IReactProperty\")])], [\"focus\", bool_type], [\"disabled\", bool_type], [\"fetching\", bool_type], [\"search\", string_type], [\"displayValue\", string_type], [\"values\", list_type(string_type)]]);\n}\n\nexport class selectSearch {\n constructor() {\n }\n}\n\nexport function selectSearch_$reflection() {\n return class_type(\"Feliz.SelectSearch.selectSearch\", undefined, selectSearch);\n}\n\n/**\n * Sets the options of the select control\n */\nexport function selectSearch_options_3A40D30D(items) {\n return [\"options\", toArray(delay(() => map_1((item) => ({\n value: item.value,\n name: item.name,\n disabled: item.disabled,\n }), items)))];\n}\n\n/**\n * Sets the options of the select control\n */\nexport function selectSearch_options_626B3067(groups) {\n return [\"options\", toArray(delay(() => map_1((group) => ({\n type: \"group\",\n name: group.name,\n items: toArray(delay(() => map_1((item) => ({\n value: item.value,\n name: item.name,\n }), group.items))),\n }), groups)))];\n}\n\n/**\n * Sets the options of the select control\n */\nexport function selectSearch_options_113CE11B(mixedOptions) {\n return [\"options\", toArray(delay(() => map_1((option) => {\n if (option.tag === 1) {\n const group = option.fields[0];\n return {\n type: \"group\",\n name: group.name,\n items: toArray(delay(() => map_1((item_1) => ({\n value: item_1.value,\n name: item_1.name,\n disabled: item_1.disabled,\n }), group.items))),\n };\n }\n else {\n const item = option.fields[0];\n return {\n value: item.value,\n name: item.name,\n disabled: item.disabled,\n };\n }\n }, mixedOptions)))];\n}\n\n/**\n * When search is enabled, this function allows to define how items are filtered.\n * By default, the built-in filtering checks whether the name of the select item contains input query (case-insensitive)\n */\nexport function selectSearch_filterOptions_Z7A2530AD(predicate) {\n return [\"filterOptions\", Interop_createDefaultFilter(predicate)];\n}\n\n\nexport class selectSearchModule_printOptions {\n constructor() {\n }\n}\n\nexport function selectSearchModule_printOptions_$reflection() {\n return class_type(\"Feliz.SelectSearch.selectSearchModule.printOptions\", undefined, selectSearchModule_printOptions);\n}\n\nexport class selectSearchModule_autoComplete {\n constructor() {\n }\n}\n\nexport function selectSearchModule_autoComplete_$reflection() {\n return class_type(\"Feliz.SelectSearch.selectSearchModule.autoComplete\", undefined, selectSearchModule_autoComplete);\n}\n\n","import * as common from \"../../src/javascript/common.js\";\nimport { value } from \"../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { Record } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { record_type, int32_type, option_type, float64_type, class_type, string_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\n\nexport function createLatLng(lat, lng) {\n return {\n lat: lat,\n lng: lng,\n };\n}\n\nexport function createLatLngBounds(north, east, south, west) {\n return {\n north: north,\n east: east,\n south: south,\n west: west,\n };\n}\n\nexport function createCircleLiteral(center, radius) {\n return {\n center: center,\n radius: radius,\n };\n}\n\nexport function createCircle(center, radius) {\n const circle = common.createCircle();\n circle.setRadius(radius);\n circle.setCenter(center);\n return circle;\n}\n\nexport function createCoords(lat, lng) {\n return {\n accuracy: 10,\n heading: 0,\n latitude: lat,\n longitude: lng,\n speed: 0,\n };\n}\n\nexport function createPosition(lat, lng) {\n return {\n coords: createCoords(lat, lng),\n timestamp: 0,\n };\n}\n\nexport function toPosition(lat, lng) {\n let matchResult, latValue, lngValue;\n if (lat != null) {\n if (lng != null) {\n matchResult = 0;\n latValue = value(lat);\n lngValue = value(lng);\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return createPosition(latValue, lngValue);\n default:\n return undefined;\n }\n}\n\nexport class LocationDescriptor extends Record {\n constructor(PlaceId, Name, Position, DistanceFromCurrent, UtcOffsetMin) {\n super();\n this.PlaceId = PlaceId;\n this.Name = Name;\n this.Position = Position;\n this.DistanceFromCurrent = DistanceFromCurrent;\n this.UtcOffsetMin = UtcOffsetMin;\n }\n}\n\nexport function LocationDescriptor_$reflection() {\n return record_type(\"Omnicv.Client.MapLiteral.LocationDescriptor\", [], LocationDescriptor, () => [[\"PlaceId\", string_type], [\"Name\", string_type], [\"Position\", class_type(\"Browser.Types.Position\")], [\"DistanceFromCurrent\", option_type(float64_type)], [\"UtcOffsetMin\", option_type(int32_type)]]);\n}\n\nconst earthRadius = 6371071;\n\nexport function distanceInMeters(lat1, long1, lat2, long2) {\n const rLat1 = lat1 * (3.141592653589793 / 180);\n const rLat2 = lat2 * (3.141592653589793 / 180);\n const diffLat = rLat2 - rLat1;\n const diffLon = (long2 - long1) * (3.141592653589793 / 180);\n return (2 * earthRadius) * Math.asin(Math.sqrt((Math.sin(diffLat / 2) * Math.sin(diffLat / 2)) + (((Math.cos(rLat1) * Math.cos(rLat2)) * Math.sin(diffLon / 2)) * Math.sin(diffLon / 2))));\n}\n\nexport function distanceInMetersBetweenPositions(pos1, pos2) {\n return distanceInMeters(pos1.coords.latitude, pos1.coords.longitude, pos2.coords.latitude, pos2.coords.longitude);\n}\n\n","import { Result_MapError, Result_Map, FSharpResult$2 } from \"../fable-library-js.4.24.0/Result.js\";\nimport { class_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { disposeSafe, getEnumerator } from \"../fable-library-js.4.24.0/Util.js\";\n\n/**\n * This is an identity function, it calls the given function and return the promise value untouched.\n * \n * \n * fetchUser ()\n * |> Promise.tap (fun user ->\n * // Do something\n * console.log \"The user has been received\"\n * )\n * |> Promise.map (fun user ->\n * // user value is available here untouched\n * )\n *
\n * \n */\nexport function tap(fn, a) {\n return a.then((x) => {\n fn(x);\n return x;\n });\n}\n\n/**\n * Map the Promise result into a Result type.\n * \n * \n * Success example\n * Promise.lift 42\n * |> Promise.result\n * |> Promise.map (fun value ->\n * // value = Ok 42\n * )\n * \n * // Fail example\n * Promise.reject \"Invalid value\"\n * |> Promise.result\n * |> Promise.map (fun value ->\n * // value = Error \"Invalid value\"\n * )\n *
\n * \n */\nexport function result(a) {\n return a.then((ResultValue) => (new FSharpResult$2(0, [ResultValue]))).catch((ErrorValue) => (new FSharpResult$2(1, [ErrorValue])));\n}\n\n/**\n * Evaluates to `myPromise |> Promise.map (Result.map fn)`\n * \n * \n * Promise.lift 42\n * |> Promise.result\n * |> Promise.mapResult (fun value ->\n * value + 10\n * )\n * |> Promise.map (fun value ->\n * // value = Ok 52\n * )\n *
\n * \n */\nexport function mapResult(fn, a) {\n return a.then((result_1) => Result_Map(fn, result_1));\n}\n\n/**\n * Transform the success part of a result promise into another promise.\n * \n * \n * let multiplyBy2 (value : int) =\n * Promise.create (fun resolve reject ->\n * resolve (value * 2)\n * )\n * \n * Promise.lift 42\n * |> Promise.result\n * |> Promise.bindResult (fun value ->\n * multiplyBy2 value\n * )\n * |> Promise.map (fun value ->\n * // value = Ok 84\n * )\n *
\n * \n */\nexport function bindResult(fn, a) {\n return a.then((a_1) => {\n if (a_1.tag === 1) {\n return Promise.resolve(new FSharpResult$2(1, [a_1.fields[0]]));\n }\n else {\n const pr = fn(a_1.fields[0]);\n return pr.then((ResultValue) => (new FSharpResult$2(0, [ResultValue])));\n }\n });\n}\n\n/**\n * Evaluates to myPromise |> Promise.map (Result.map fn) \n * \n * \n * Promise.reject -1\n * |> Promise.result\n * |> Promise.mapResultError (fun value ->\n * $\"%s{value} is not a valid value\"\n * )\n * |> Promise.map (fun value ->\n * // value = Error \"-1 is not a valid value\"\n * )\n *
\n * \n */\nexport function mapResultError(fn, a) {\n return a.then((result_1) => Result_MapError(fn, result_1));\n}\n\nexport class PromiseBuilder {\n constructor() {\n }\n}\n\nexport function PromiseBuilder_$reflection() {\n return class_type(\"Promise.PromiseBuilder\", undefined, PromiseBuilder);\n}\n\nexport function PromiseBuilder_$ctor() {\n return new PromiseBuilder();\n}\n\nexport function PromiseBuilder__For_1565554B(_, seq, body) {\n let pr;\n let p = Promise.resolve(undefined);\n const enumerator = getEnumerator(seq);\n try {\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\n const a = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\n p = ((pr = p, pr.then(() => body(a))));\n }\n }\n finally {\n disposeSafe(enumerator);\n }\n return p;\n}\n\nexport function PromiseBuilder__While_2044D34(this$, guard, p) {\n if (guard()) {\n return p.then(() => PromiseBuilder__While_2044D34(this$, guard, p));\n }\n else {\n return Promise.resolve(undefined);\n }\n}\n\nexport function PromiseBuilder__TryFinally_7D49A2FD(_, p, compensation) {\n return p.then((x) => {\n compensation();\n return x;\n }).catch((er) => {\n compensation();\n throw er;\n });\n}\n\nexport function PromiseBuilder__Delay_62FBFDE1(_, generator) {\n return {\n then: (onSuccess, onError) => {\n try {\n return generator().then(onSuccess, onError);\n }\n catch (er) {\n if (onError == null) {\n return Promise.reject(er);\n }\n else {\n try {\n const a = onError(er);\n return Promise.resolve(a);\n }\n catch (er_1) {\n return Promise.reject(er_1);\n }\n }\n }\n },\n catch: (onError_1) => {\n try {\n return generator().catch(onError_1);\n }\n catch (er_2) {\n try {\n const a_1 = onError_1(er_2);\n return Promise.resolve(a_1);\n }\n catch (er_3) {\n return Promise.reject(er_3);\n }\n }\n },\n };\n}\n\nexport function PromiseBuilder__Run_212F1D4B(_, p) {\n return p.then((x) => x);\n}\n\nexport function PromiseBuilder__Using_74F7E79D(this$, resource, binder) {\n return PromiseBuilder__TryFinally_7D49A2FD(this$, binder(resource), () => {\n let copyOfStruct = resource;\n disposeSafe(copyOfStruct);\n });\n}\n\n","import { toPosition, createLatLng, createCircle, LocationDescriptor, LocationDescriptor_$reflection, createPosition } from \"../MapLiteral.js\";\nimport { some, map, defaultArg, value as value_2 } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { Union, Record } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { EventInfo_Default_7F9DDECF, EventInfo, EventInfo_$reflection } from \"../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { union_type, record_type, bool_type, option_type, class_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport * as common from \"../../../src/javascript/common.js\";\nimport { Session__GetCurrentProfileId } from \"../SharedView.js\";\nimport { toUniversalTime } from \"../../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport { Event as Event$ } from \"../../fable_modules/fable-library-js.4.24.0/Event.js\";\nimport { compare, defaultOf, equals } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { Config_variable, Config_placeLookupId } from \"../Extensions.js\";\nimport { item } from \"../../fable_modules/fable-library-js.4.24.0/Array.js\";\nimport { max, min } from \"../../fable_modules/fable-library-js.4.24.0/Double.js\";\nimport { PromiseBuilder__Delay_62FBFDE1, PromiseBuilder__Run_212F1D4B } from \"../../fable_modules/Fable.Promise.3.2.0/Promise.fs.js\";\nimport { promise } from \"../../fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js\";\nimport { Cmd_none, Cmd_batch, Cmd_OfPromise_attempt } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { head, length, sortBy, singleton } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { exnToDisplayString, dateStrToDateTime } from \"../Utils.js\";\nimport { add } from \"../../fable_modules/fable-library-js.4.24.0/Observable.js\";\n\nconst zeroPosition = createPosition(0, 0);\n\nexport function getOrElse(opt, elseValue) {\n if (opt == null) {\n return elseValue;\n }\n else {\n return value_2(opt);\n }\n}\n\nexport class Model extends Record {\n constructor(EventInfo, AutocompleteService, Position, StrictBounds) {\n super();\n this.EventInfo = EventInfo;\n this.AutocompleteService = AutocompleteService;\n this.Position = Position;\n this.StrictBounds = StrictBounds;\n }\n}\n\nexport function Model_$reflection() {\n return record_type(\"Omnicv.Client.Components.EventInfoManager.Model\", [], Model, () => [[\"EventInfo\", EventInfo_$reflection()], [\"AutocompleteService\", option_type(class_type(\"GoogleMapsApi.Google.Maps.Places.Autocomplete\"))], [\"Position\", option_type(class_type(\"Browser.Types.Position\"))], [\"StrictBounds\", bool_type]]);\n}\n\nexport function Model__UpdateEventInfo_Z45EFA9A8(this$, newEventInfo) {\n return new Model(newEventInfo, this$.AutocompleteService, this$.Position, this$.StrictBounds);\n}\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Loaded\", \"UpdateLocation\", \"UpdatePosition\", \"GeoLocationUpdated\", \"UpdateAutocomplete\", \"AutocompleteFailure\", \"SetStrictBounds\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.Components.EventInfoManager.Msg\", [], Msg, () => [[[\"Item\", EventInfo_$reflection()]], [[\"Item\", option_type(LocationDescriptor_$reflection())]], [[\"Item\", class_type(\"Browser.Types.Position\")]], [], [[\"Item\", class_type(\"GoogleMapsApi.Google.Maps.Places.Autocomplete\")]], [[\"Item\", class_type(\"System.Exception\")]], [[\"Item\", bool_type]]]);\n}\n\nexport function prepareEventInfoForSubmit(session, model) {\n const source = model.EventInfo;\n const clientTz = defaultArg(source.ClientTz, common.getTimezoneName());\n const clientTzOffsetMin = defaultArg(source.ClientTzOffsetMin, common.getTimezoneOffset()) | 0;\n return new EventInfo(source.Id, source.ContentTypeId, Session__GetCurrentProfileId(session), toUniversalTime(source.EventTimestamp), source.CreatedAt, source.UpdatedAt, source.PlaceId, source.PlaceName, source.Latitude, source.Longitude, source.LocationTz, source.LocationTzOffsetMin, clientTz, clientTzOffsetMin);\n}\n\nconst eventPublisher = new Event$();\n\nexport function triggerUpdateLocation(result) {\n eventPublisher.Trigger(new Msg(1, [result]));\n}\n\nfunction updateLocation(place) {\n const placeId = place.place_id;\n let newPosition;\n if ((place.geometry != null) && (value_2(place.geometry).location != null)) {\n const location = value_2(value_2(place.geometry).location);\n newPosition = createPosition(location.lat(), location.lng());\n }\n else {\n newPosition = zeroPosition;\n }\n let placeName;\n const name = getOrElse(place.name, \"\");\n const address = getOrElse(place.formatted_address, \"\");\n placeName = (address.startsWith(name) ? address : ((name + \", \") + address));\n triggerUpdateLocation((placeId != null) ? (new LocationDescriptor(value_2(placeId), placeName, newPosition, undefined, map((value) => ~~value, place.utc_offset_minutes))) : undefined);\n}\n\nconst registerPlacesAutoCompleteImpDelays = new Int32Array([1, 2, 4, 8, 16, 32]);\n\nfunction registerPlacesAutoComplete() {\n const waitForElementPromise = (iteration, totalDelay, next) => {\n if (equals(document.getElementById(Config_placeLookupId), defaultOf())) {\n const delay = item(min(iteration, registerPlacesAutoCompleteImpDelays.length - 1), registerPlacesAutoCompleteImpDelays) | 0;\n const delayMs = (delay * 1000) | 0;\n console.log(some(`Will be waiting ${delay}sec after ${iteration} iterations and ${totalDelay}sec to get the Google map entry element`));\n const pr = new Promise(resolve => setTimeout(resolve, delayMs));\n return pr.then(() => waitForElementPromise(iteration + 1, totalDelay + delay, next));\n }\n else {\n console.log(some(`Went through ${iteration} iterations and waited ${totalDelay}sec to get the Google map entry element`));\n return next();\n }\n };\n console.log(some(\"Loading Google map library\"));\n let pr_2;\n const pr_1 = common.loadGoogleMapsApi(Config_variable(\"GOOGLE_MAPS_API_KEY\"));\n pr_2 = (pr_1.then((google_2) => {\n console.log(some(`Google map library loaded: ${google_2.maps.version}`));\n return waitForElementPromise(0, 0, () => PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => {\n let placesAutoComplete;\n return Promise.resolve((console.log(some(\"Google map library loaded, attaching element\")), (placesAutoComplete = common.registerPlacesAutoComplete(google_2, Config_placeLookupId, (place) => {\n updateLocation(place);\n }), eventPublisher.Trigger(new Msg(4, [placesAutoComplete])))));\n })));\n }));\n return pr_2.catch((ex) => {\n console.error(some(`Failed to load Google map library: ${ex.message}`));\n });\n}\n\nconst commonInitCmds = singleton(Cmd_OfPromise_attempt(registerPlacesAutoComplete, undefined, (Item) => (new Msg(5, [Item]))));\n\nexport function initCommon(eventInfo) {\n if (navigator.geolocation != null) {\n const geoLocation = value_2(navigator.geolocation);\n geoLocation.getCurrentPosition((arg_1) => {\n eventPublisher.Trigger(new Msg(2, [arg_1]));\n }, (error) => {\n console.error(some(`Failed to get position: ${error.code} ${error.message}`));\n });\n }\n return [new Model(eventInfo, undefined, undefined, true), Cmd_batch(commonInitCmds)];\n}\n\nexport function initCommonNoRegistration(eventInfo) {\n return [new Model(eventInfo, undefined, undefined, true), Cmd_none()];\n}\n\nexport function initNew(dateStr) {\n return initCommon(EventInfo_Default_7F9DDECF(dateStrToDateTime(dateStr)));\n}\n\nexport function initEdit(id) {\n let bind$0040;\n return initCommon((bind$0040 = EventInfo_Default_7F9DDECF(common.getNow()), new EventInfo(id, bind$0040.ContentTypeId, bind$0040.ProfileId, bind$0040.EventTimestamp, bind$0040.CreatedAt, bind$0040.UpdatedAt, bind$0040.PlaceId, bind$0040.PlaceName, bind$0040.Latitude, bind$0040.Longitude, bind$0040.LocationTz, bind$0040.LocationTzOffsetMin, bind$0040.ClientTz, bind$0040.ClientTzOffsetMin)));\n}\n\nfunction updateAutocompleteService(model) {\n const matchValue = model.AutocompleteService;\n const matchValue_1 = model.EventInfo.Latitude;\n const matchValue_2 = model.EventInfo.Longitude;\n let matchResult, lat, lng, service;\n if (matchValue != null) {\n if (matchValue_1 != null) {\n if (matchValue_2 != null) {\n matchResult = 0;\n lat = matchValue_1;\n lng = matchValue_2;\n service = matchValue;\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n const circle = createCircle(createLatLng(lat, lng), 21000);\n const bounds = value_2(circle.getBounds());\n const options_1 = {\n bounds: bounds,\n strictBounds: model.StrictBounds,\n };\n service.setOptions(options_1);\n break;\n }\n case 1: {\n break;\n }\n }\n}\n\nexport function eventInfoCoordinatesToPosition(eventInfo) {\n return toPosition(eventInfo.Latitude, eventInfo.Longitude);\n}\n\nexport function eventInfoCoordinatesToPositionOrDefault(eventInfo) {\n const matchValue = eventInfoCoordinatesToPosition(eventInfo);\n if (matchValue != null) {\n return matchValue;\n }\n else {\n return zeroPosition;\n }\n}\n\nexport function tryUpdateLocationFromSuggestions(suggestionsFunc, model) {\n const eventInfo = model.EventInfo;\n const matchValue = model.Position;\n let matchResult, currentPosition;\n if (matchValue != null) {\n if (eventInfo.PlaceId == null) {\n if (eventInfo.PlaceName == null) {\n matchResult = 0;\n currentPosition = matchValue;\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n const candidates = sortBy((value) => value.DistanceFromCurrent, suggestionsFunc(), {\n Compare: compare,\n });\n if (length(candidates) > 0) {\n const best = head(candidates);\n const accuracy = max(100, min(currentPosition.coords.accuracy, 500));\n if ((best.DistanceFromCurrent != null) && (value_2(best.DistanceFromCurrent) <= accuracy)) {\n console.log(some(`Setting location to ${best}`));\n triggerUpdateLocation(best);\n }\n }\n break;\n }\n case 1: {\n break;\n }\n }\n}\n\nexport function update(msg, model) {\n let bind$0040_1, bind$0040, bind$0040_2, position, msg_1;\n switch (msg.tag) {\n case 1:\n if (msg.fields[0] == null) {\n return [new Model((bind$0040_1 = model.EventInfo, new EventInfo(bind$0040_1.Id, bind$0040_1.ContentTypeId, bind$0040_1.ProfileId, bind$0040_1.EventTimestamp, bind$0040_1.CreatedAt, bind$0040_1.UpdatedAt, undefined, undefined, undefined, undefined, bind$0040_1.LocationTz, bind$0040_1.LocationTzOffsetMin, bind$0040_1.ClientTz, bind$0040_1.ClientTzOffsetMin)), model.AutocompleteService, model.Position, model.StrictBounds), Cmd_none()];\n }\n else {\n const descriptor = msg.fields[0];\n return [new Model((bind$0040 = model.EventInfo, new EventInfo(bind$0040.Id, bind$0040.ContentTypeId, bind$0040.ProfileId, bind$0040.EventTimestamp, bind$0040.CreatedAt, bind$0040.UpdatedAt, descriptor.PlaceId, descriptor.Name.trim(), descriptor.Position.coords.latitude, descriptor.Position.coords.longitude, bind$0040.LocationTz, descriptor.UtcOffsetMin, bind$0040.ClientTz, bind$0040.ClientTzOffsetMin)), model.AutocompleteService, model.Position, model.StrictBounds), Cmd_none()];\n }\n case 2: {\n console.log(some(`New coordinates: ${msg.fields[0].coords.latitude} / ${msg.fields[0].coords.longitude}; accuracy=${msg.fields[0].coords.accuracy}`));\n const newModel = new Model((bind$0040_2 = model.EventInfo, new EventInfo(bind$0040_2.Id, bind$0040_2.ContentTypeId, bind$0040_2.ProfileId, bind$0040_2.EventTimestamp, bind$0040_2.CreatedAt, bind$0040_2.UpdatedAt, bind$0040_2.PlaceId, bind$0040_2.PlaceName, msg.fields[0].coords.latitude, msg.fields[0].coords.longitude, bind$0040_2.LocationTz, bind$0040_2.LocationTzOffsetMin, bind$0040_2.ClientTz, bind$0040_2.ClientTzOffsetMin)), model.AutocompleteService, msg.fields[0], model.StrictBounds);\n updateAutocompleteService(newModel);\n return [newModel, singleton((dispatch_1) => {\n dispatch_1(new Msg(3, []));\n })];\n }\n case 3:\n return [model, Cmd_none()];\n case 4: {\n const newModel_1 = new Model(model.EventInfo, msg.fields[0], model.Position, model.StrictBounds);\n updateAutocompleteService(newModel_1);\n return [newModel_1, Cmd_none()];\n }\n case 5: {\n console.log(some(exnToDisplayString(msg.fields[0])));\n return [model, Cmd_none()];\n }\n case 6: {\n const newModel_2 = new Model(model.EventInfo, model.AutocompleteService, model.Position, msg.fields[0]);\n updateAutocompleteService(newModel_2);\n return [newModel_2, Cmd_none()];\n }\n default:\n return [new Model(msg.fields[0], model.AutocompleteService, model.Position, model.StrictBounds), (position = eventInfoCoordinatesToPosition(msg.fields[0]), (position != null) ? ((msg_1 = (new Msg(2, [value_2(position)])), singleton((dispatch) => {\n dispatch(msg_1);\n }))) : Cmd_none())];\n }\n}\n\nexport function subscribeLocation(dispatch) {\n add((msg) => {\n dispatch(msg);\n }, eventPublisher.Publish);\n}\n\n","import * as flex_form from \"../../../src/javascript/flex-form.js\";\nimport { format, substring, isNullOrWhiteSpace, replace } from \"../../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { Record, toString, FSharpRef, Union } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { record_type, lambda_type, tuple_type, uint8_type, bool_type, decimal_type, float64_type, int32_type, option_type, class_type, union_type, string_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { FlexWrap_Option, TextTransform_Option, TextWeight_Option, TextSize_Option, Text_span, Spacing_Amount, Spacing_TypeAndDirection, Common_GenericOption, Modifier_IModifier, Size_ISize, Screen, Color_IColor } from \"../../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { safeHash, stringHash, createObj, compare, comparePrimitives, int32ToString, curry2, uncurry2, defaultOf as defaultOf_1, equals } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { collect, map as map_2, head, empty as empty_1, singleton, append, delay, toList, fold } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { some, map, defaultArg, value as value_15, unwrap } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { filter, sortBy, ofSeq as ofSeq_1, tryFind, exists as exists_1, map as map_1, isEmpty, ofArray, append as append_1, cons, singleton as singleton_1, empty } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { body, label as label_2, Option as Option_10, div } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Field.fs.js\";\nimport { Option, label as label_1 } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Label.fs.js\";\nimport { Option as Option_1, div as div_1 } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Control.fs.js\";\nimport { Option as Option_2, help as help_2 } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Help.fs.js\";\nimport { defaultOf } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { Option as Option_3, textarea } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Textarea.fs.js\";\nimport { input as input_1 } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Input.fs.js\";\nimport { Option as Option_4, IInputType } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Input.fs.js\";\nimport { column, Option as Option_5, ISize } from \"../../fable_modules/Fulma.3.0.0/Layouts/Column.fs.js\";\nimport { list as list_5, Option as Option_6, button } from \"../../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { Option as Option_7, icon as icon_1 } from \"../../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport { Fa_IconOption, Fa_i } from \"../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { Option as Option_8, columns } from \"../../fable_modules/Fulma.3.0.0/Layouts/Columns.fs.js\";\nimport { ofSeq, empty as empty_2, contains, FSharpSet__get_Count } from \"../../fable_modules/fable-library-js.4.24.0/Set.js\";\nimport { tryParse } from \"../../fable_modules/fable-library-js.4.24.0/Int32.js\";\nimport { Result_Map, FSharpResult$2 } from \"../../fable_modules/fable-library-js.4.24.0/Result.js\";\nimport { tryParse as tryParse_1 } from \"../../fable_modules/fable-library-js.4.24.0/Double.js\";\nimport { compare as compare_1, toString as toString_1 } from \"../../fable_modules/fable-library-js.4.24.0/Decimal.js\";\nimport Decimal from \"../../fable_modules/fable-library-js.4.24.0/Decimal.js\";\nimport { second, minute, hour, parse, day, month, year, create, now as now_1, toUniversalTime, tryParse as tryParse_2, minValue, toLocalTime, toString as toString_2 } from \"../../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport { stringToEnum, valuesToSelectOptions, splitSeconds } from \"../Utils.js\";\nimport { DOMAttr, HTMLAttr } from \"../../fable_modules/Fable.React.9.4.0/Fable.React.Props.fs.js\";\nimport { Config_placeLookupId } from \"../Extensions.js\";\nimport { createElement } from \"react\";\nimport * as react from \"react\";\nimport { reactApi } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { Option as Option_9, select } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Select.fs.js\";\nimport { keyValueList } from \"../../fable_modules/fable-library-js.4.24.0/MapUtil.js\";\nimport { Option as Option_11, radioInline } from \"../../fable_modules/Fulma.Extensions.Wikiki.Checkradio.3.0.0/Checkradio.fs.js\";\nimport { input as input_2, checkbox } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Checkbox.fs.js\";\nimport { concatToServer, toClientListView } from \"../../Omnicv.Shared.Common/TagUtils.js\";\nimport { selectSearch_filterOptions_Z7A2530AD, SelectOption, SelectItem, selectSearch_options_113CE11B } from \"../../fable_modules/Feliz.SelectSearch.3.1.0/SelectSearch.fs.js\";\nimport { List_distinct, List_except } from \"../../fable_modules/fable-library-js.4.24.0/Seq2.js\";\nimport { reactApi as reactApi_1 } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport react_select_search from \"react-select-search\";\nimport { Interop_defaultProps } from \"../../fable_modules/Feliz.SelectSearch.3.1.0/SelectSearch.fs.js\";\nimport { Helpers_combineClasses } from \"../../fable_modules/Feliz.Bulma.3.0.0/ElementBuilders.fs.js\";\nimport { RatingStarsProps, ratingStars } from \"./RatingStars.js\";\nimport { FSharpChoice$2 } from \"../../fable_modules/fable-library-js.4.24.0/Choice.js\";\nimport { Option as Option_12, container } from \"../../fable_modules/Fulma.3.0.0/Layouts/Container.fs.js\";\nimport { EventInfo__GetLocationTz, EventInfo__GetClientTz, EventInfo__DisplayTimeZone } from \"../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport * as common from \"../../../src/javascript/common.js\";\nimport { StringBuilder__get_Length, StringBuilder__Append_Z721C83C5, StringBuilder_$ctor } from \"../../fable_modules/fable-library-js.4.24.0/System.Text.js\";\nimport { eventInfoCoordinatesToPositionOrDefault, triggerUpdateLocation } from \"./EventInfoManager.js\";\nimport { LocationDescriptor, distanceInMetersBetweenPositions } from \"../MapLiteral.js\";\n\nfunction convert(object) {\n return object;\n}\n\nfunction objectFieldGetter(fieldName, object) {\n return convert(flex_form.objectFieldGetter(fieldName, object));\n}\n\nfunction objectFieldSetter(fieldName, object, newValue) {\n return convert(flex_form.objectFieldSetter(fieldName, object, newValue));\n}\n\nexport function setWorkoutRecordId(record, newId) {\n return objectFieldSetter(\"WorkoutRecordId\", record, newId);\n}\n\nexport function setId(record, newId) {\n return objectFieldSetter(\"Id\", record, newId);\n}\n\nexport function setProfileId(record, profileId) {\n return objectFieldSetter(\"ProfileId\", record, profileId);\n}\n\nexport function clearId(record) {\n return setId(record, 0n);\n}\n\nfunction slugify(name) {\n return replace(name, \" \", \"-\");\n}\n\nexport class FieldValidationResult extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Ok\", \"Warning\", \"Error\"];\n }\n}\n\nexport function FieldValidationResult_$reflection() {\n return union_type(\"Omnicv.Client.Common.Components.FlexForm.FieldValidationResult\", [], FieldValidationResult, () => [[], [[\"Item\", string_type]], [[\"Item\", string_type]]]);\n}\n\nexport function FieldValidationResult__ToColour_Z5463E381(this$, defaultColour) {\n switch (this$.tag) {\n case 1:\n return new Color_IColor(7, []);\n case 2:\n return new Color_IColor(8, []);\n default:\n return defaultColour;\n }\n}\n\nexport function FieldValidationResult__IsValid(this$) {\n return equals(this$, new FieldValidationResult(0, []));\n}\n\nexport function FieldValidationResult__IsErrorResult(this$) {\n if (this$.tag === 2) {\n return true;\n }\n else {\n return false;\n }\n}\n\nexport function FieldValidationResult__Merge_30561432(this$, other) {\n let matchResult, right, left, msg1, msg2, msg1_1, msg2_1, msg1_2, msg2_2, msg1_3, msg2_3;\n switch (this$.tag) {\n case 2: {\n switch (other.tag) {\n case 2: {\n matchResult = 2;\n msg1 = this$.fields[0];\n msg2 = other.fields[0];\n break;\n }\n case 1: {\n matchResult = 3;\n msg1_1 = this$.fields[0];\n msg2_1 = other.fields[0];\n break;\n }\n default: {\n matchResult = 1;\n left = this$;\n }\n }\n break;\n }\n case 1: {\n switch (other.tag) {\n case 2: {\n matchResult = 4;\n msg1_2 = this$.fields[0];\n msg2_2 = other.fields[0];\n break;\n }\n case 1: {\n matchResult = 5;\n msg1_3 = this$.fields[0];\n msg2_3 = other.fields[0];\n break;\n }\n default: {\n matchResult = 1;\n left = this$;\n }\n }\n break;\n }\n default: {\n matchResult = 0;\n right = other;\n }\n }\n switch (matchResult) {\n case 0:\n return right;\n case 1:\n return left;\n case 2:\n return new FieldValidationResult(2, [(msg1 + \"; \") + msg2]);\n case 3:\n return new FieldValidationResult(2, [(msg1_1 + \"; \") + msg2_1]);\n case 4:\n return new FieldValidationResult(2, [(msg1_2 + \"; \") + msg2_2]);\n default:\n return new FieldValidationResult(1, [(msg1_3 + \"; \") + msg2_3]);\n }\n}\n\nfunction mergeResults(results) {\n return fold((state, result) => FieldValidationResult__Merge_30561432(result, state), new FieldValidationResult(0, []), results);\n}\n\nexport class CustomField$1 {\n constructor(name, customRender) {\n this.name = name;\n this.customRender = customRender;\n this[\"Details@\"] = undefined;\n this[\"Help@\"] = undefined;\n this[\"IsRequired@\"] = true;\n }\n get Details() {\n const __ = this;\n return unwrap(__[\"Details@\"]);\n }\n set Details(v) {\n const __ = this;\n __[\"Details@\"] = v;\n }\n get Help() {\n const __ = this;\n return unwrap(__[\"Help@\"]);\n }\n set Help(v) {\n const __ = this;\n __[\"Help@\"] = v;\n }\n get IsRequired() {\n const __ = this;\n return __[\"IsRequired@\"];\n }\n set IsRequired(v) {\n const __ = this;\n __[\"IsRequired@\"] = v;\n }\n get Name() {\n const this$ = this;\n return this$.name;\n }\n Render(isDisabled, value) {\n const this$ = this;\n return this$.customRender(isDisabled, value);\n }\n OnChange(value) {\n }\n Validate(_value) {\n return new FieldValidationResult(0, []);\n }\n}\n\nexport function CustomField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.CustomField`1\", [gen0], CustomField$1);\n}\n\nexport function CustomField$1_$ctor_693A43B3(name, customRender) {\n return new CustomField$1(name, customRender);\n}\n\nexport class BaseField$1 {\n constructor(name) {\n this.name = name;\n this[\"Details@\"] = undefined;\n this[\"Help@\"] = undefined;\n this[\"IsRequired@\"] = true;\n }\n get Details() {\n const __ = this;\n return unwrap(__[\"Details@\"]);\n }\n set Details(v) {\n const __ = this;\n __[\"Details@\"] = v;\n }\n get Help() {\n const __ = this;\n return unwrap(__[\"Help@\"]);\n }\n set Help(v) {\n const __ = this;\n __[\"Help@\"] = v;\n }\n get IsRequired() {\n const __ = this;\n return __[\"IsRequired@\"];\n }\n set IsRequired(v) {\n const __ = this;\n __[\"IsRequired@\"] = v;\n }\n get Name() {\n const this$ = this;\n return this$.name;\n }\n Render(isDisabled, value) {\n const this$ = this;\n return this$[\"Omnicv.Client.Common.Components.FlexForm.BaseField`1.Render\"](isDisabled, value);\n }\n OnChange(value) {\n const this$ = this;\n this$[\"Omnicv.Client.Common.Components.FlexForm.BaseField`1.OnChange2B595\"](value);\n }\n Validate(value) {\n const this$ = this;\n return this$[\"Omnicv.Client.Common.Components.FlexForm.BaseField`1.Validate2B595\"](value);\n }\n}\n\nexport function BaseField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.BaseField`1\", [gen0], BaseField$1);\n}\n\nexport function BaseField$1_$ctor_Z721C83C5(name) {\n return new BaseField$1(name);\n}\n\nexport class GetterSetterBaseField$2 extends BaseField$1 {\n constructor(name, getter, setter, validate, onChange) {\n super(name);\n this.name_1 = name;\n this.getter = getter;\n this.setter = setter;\n this.validate = validate;\n this.onChange = onChange;\n }\n \"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.ControlModifiers\"() {\n return empty();\n }\n \"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.ControlExtras2B595\"(_arg) {\n return empty();\n }\n \"Omnicv.Client.Common.Components.FlexForm.BaseField`1.Render\"(isDisabled, object) {\n const this$ = this;\n const value = this$.getter(object);\n const error = GetterSetterBaseField$2__get_Field(this$).Validate(object);\n return div(empty(), toList(delay(() => append(singleton(label_1(singleton_1(new Option(2, [\"is-normal\"])), singleton_1(GetterSetterBaseField$2__get_Field(this$).Name))), delay(() => {\n let temp;\n return append(singleton(div_1((temp = this$[\"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.ControlModifiers\"](), isDisabled ? cons(new Option_1(2, [true]), temp) : temp), append_1(singleton_1(this$[\"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.RenderValue\"](isDisabled, error, object, value)), this$[\"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.ControlExtras2B595\"](object)))), delay(() => append((GetterSetterBaseField$2__get_Field(this$).Help != null) ? singleton(help_2(singleton_1(new Option_2(2, [new Color_IColor(6, [])])), singleton_1(value_15(GetterSetterBaseField$2__get_Field(this$).Help)))) : empty_1(), delay(() => {\n const matchValue = error;\n return (matchValue.tag === 1) ? singleton(help_2(singleton_1(new Option_2(2, [new Color_IColor(7, [])])), singleton_1(matchValue.fields[0]))) : ((matchValue.tag === 0) ? singleton(defaultOf()) : singleton(help_2(singleton_1(new Option_2(2, [new Color_IColor(8, [])])), singleton_1(matchValue.fields[0]))));\n }))));\n })))));\n }\n \"Omnicv.Client.Common.Components.FlexForm.BaseField`1.OnChange2B595\"(object) {\n const this$ = this;\n this$.onChange(object);\n }\n \"Omnicv.Client.Common.Components.FlexForm.BaseField`1.Validate2B595\"(object) {\n const this$ = this;\n const result = this$.validate(GetterSetterBaseField$2__GetValue_2B595(this$, object));\n return (result == null) ? (new FieldValidationResult(0, [])) : (new FieldValidationResult(2, [value_15(result)]));\n }\n}\n\nexport function GetterSetterBaseField$2_$reflection(gen0, gen1) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2\", [gen0, gen1], GetterSetterBaseField$2, BaseField$1_$reflection(gen0));\n}\n\nexport function GetterSetterBaseField$2_$ctor_4CAD41BD(name, getter, setter, validate, onChange) {\n return new GetterSetterBaseField$2(name, getter, setter, validate, onChange);\n}\n\nexport function GetterSetterBaseField$2__CallOnChange(this$, object, newValue) {\n const newObject = this$.setter(object, newValue);\n this$[\"Omnicv.Client.Common.Components.FlexForm.BaseField`1.OnChange2B595\"](newObject);\n}\n\nexport function GetterSetterBaseField$2__get_Field(this$) {\n return this$;\n}\n\nexport function GetterSetterBaseField$2__get_Placeholder(this$) {\n return defaultArg(GetterSetterBaseField$2__get_Field(this$).Details, this$.name_1);\n}\n\nexport function GetterSetterBaseField$2__GetValue_2B595(this$, object) {\n return this$.getter(object);\n}\n\nexport class JsGetterSetterBaseField$2 extends GetterSetterBaseField$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, (object) => objectFieldGetter(fieldName, object), (object_1, newValue) => objectFieldSetter(fieldName, object_1, newValue), validate, onChange);\n }\n}\n\nexport function JsGetterSetterBaseField$2_$reflection(gen0, gen1) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.JsGetterSetterBaseField`2\", [gen0, gen1], JsGetterSetterBaseField$2, GetterSetterBaseField$2_$reflection(gen0, gen1));\n}\n\nexport function JsGetterSetterBaseField$2_$ctor_3195DDE5(name, fieldName, validate, onChange) {\n return new JsGetterSetterBaseField$2(name, fieldName, validate, onChange);\n}\n\nexport class TextFieldBase$2 extends JsGetterSetterBaseField$2 {\n constructor(isTextArea, name, fieldName, fromValue, toValue, validate, onChange) {\n super(name, fieldName, validate, onChange);\n this.isTextArea = isTextArea;\n this.fromValue = fromValue;\n this.toValue = toValue;\n }\n \"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.RenderValue\"(isDisabled, error, object, value) {\n const this$ = this;\n return this$.isTextArea ? textarea(ofArray([new Option_3(7, [FieldValidationResult__ToColour_Z5463E381(error, new Color_IColor(4, []))]), new Option_3(13, [GetterSetterBaseField$2__get_Placeholder(this$)]), new Option_3(10, [this$.fromValue(value)]), new Option_3(15, [(event) => {\n TextFieldBase$2__ProcessOnChange(this$, object, event);\n }]), new Option_3(9, [isDisabled])]), empty()) : input_1(ofArray([new Option_4(1, [new IInputType(0, [])]), new Option_4(2, [FieldValidationResult__ToColour_Z5463E381(error, new Color_IColor(4, []))]), new Option_4(12, [GetterSetterBaseField$2__get_Placeholder(this$)]), new Option_4(8, [this$.fromValue(value)]), new Option_4(13, [(event_1) => {\n TextFieldBase$2__ProcessOnChange(this$, object, event_1);\n }]), new Option_4(4, [isDisabled])]));\n }\n}\n\nexport function TextFieldBase$2_$reflection(gen0, gen1) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.TextFieldBase`2\", [gen0, gen1], TextFieldBase$2, JsGetterSetterBaseField$2_$reflection(gen0, gen1));\n}\n\nexport function TextFieldBase$2_$ctor_Z52490B1(isTextArea, name, fieldName, fromValue, toValue, validate, onChange) {\n return new TextFieldBase$2(isTextArea, name, fieldName, fromValue, toValue, validate, onChange);\n}\n\nfunction TextFieldBase$2__ProcessOnChange(this$, object, event) {\n let elem, elem_1;\n GetterSetterBaseField$2__CallOnChange(this$, object, this$.toValue(this$.isTextArea ? ((elem = event.target, elem.value)) : ((elem_1 = event.target, elem_1.value))));\n}\n\nexport class TextField$1 extends TextFieldBase$2 {\n constructor(name, fieldName, validate, onChange) {\n super(false, name, fieldName, (x) => x, (x_1) => x_1, validate, onChange);\n }\n}\n\nexport function TextField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.TextField`1\", [gen0], TextField$1, TextFieldBase$2_$reflection(gen0, string_type));\n}\n\nexport function TextField$1_$ctor_7EE3C92A(name, fieldName, validate, onChange) {\n return new TextField$1(name, fieldName, validate, onChange);\n}\n\nexport class TextAreaField$1 extends TextFieldBase$2 {\n constructor(name, fieldName, validate, onChange) {\n super(true, name, fieldName, (x) => x, (x_1) => x_1, validate, onChange);\n }\n}\n\nexport function TextAreaField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.TextAreaField`1\", [gen0], TextAreaField$1, TextFieldBase$2_$reflection(gen0, string_type));\n}\n\nexport function TextAreaField$1_$ctor_7EE3C92A(name, fieldName, validate, onChange) {\n return new TextAreaField$1(name, fieldName, validate, onChange);\n}\n\nfunction stringToOpt(s) {\n if (isNullOrWhiteSpace(s)) {\n return undefined;\n }\n else {\n return s;\n }\n}\n\nexport class TextFieldOpt$1 extends TextFieldBase$2 {\n constructor(name, fieldName, validate, onChange) {\n super(false, name, fieldName, (option) => defaultArg(option, \"\"), stringToOpt, validate, onChange);\n const this$ = new FSharpRef(defaultOf_1());\n this$.contents = this;\n this[\"init@275\"] = 1;\n GetterSetterBaseField$2__get_Field(this$.contents).IsRequired = false;\n }\n}\n\nexport function TextFieldOpt$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.TextFieldOpt`1\", [gen0], TextFieldOpt$1, TextFieldBase$2_$reflection(gen0, option_type(string_type)));\n}\n\nexport function TextFieldOpt$1_$ctor_773DF4C9(name, fieldName, validate, onChange) {\n return new TextFieldOpt$1(name, fieldName, validate, onChange);\n}\n\nexport class TextAreaFieldOpt$1 extends TextFieldBase$2 {\n constructor(name, fieldName, validate, onChange) {\n super(true, name, fieldName, (option) => defaultArg(option, \"\"), stringToOpt, validate, onChange);\n const this$ = new FSharpRef(defaultOf_1());\n this$.contents = this;\n this[\"init@283-1\"] = 1;\n GetterSetterBaseField$2__get_Field(this$.contents).IsRequired = false;\n }\n}\n\nexport function TextAreaFieldOpt$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.TextAreaFieldOpt`1\", [gen0], TextAreaFieldOpt$1, TextFieldBase$2_$reflection(gen0, option_type(string_type)));\n}\n\nexport function TextAreaFieldOpt$1_$ctor_773DF4C9(name, fieldName, validate, onChange) {\n return new TextAreaFieldOpt$1(name, fieldName, validate, onChange);\n}\n\nexport class PasswordField$1 extends JsGetterSetterBaseField$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, validate, onChange);\n }\n \"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.RenderValue\"(isDisabled, error, object, value) {\n const this$ = this;\n return input_1(ofArray([new Option_4(1, [new IInputType(1, [])]), new Option_4(2, [FieldValidationResult__ToColour_Z5463E381(error, new Color_IColor(4, []))]), new Option_4(12, [GetterSetterBaseField$2__get_Placeholder(this$)]), new Option_4(8, [value]), new Option_4(13, [(event) => {\n PasswordField$1__ProcessOnChange(this$, object, event);\n }]), new Option_4(4, [isDisabled])]));\n }\n}\n\nexport function PasswordField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.PasswordField`1\", [gen0], PasswordField$1, JsGetterSetterBaseField$2_$reflection(gen0, string_type));\n}\n\nexport function PasswordField$1_$ctor_7EE3C92A(name, fieldName, validate, onChange) {\n return new PasswordField$1(name, fieldName, validate, onChange);\n}\n\nfunction PasswordField$1__ProcessOnChange(this$, object, event) {\n let elem;\n GetterSetterBaseField$2__CallOnChange(this$, object, (elem = event.target, elem.value));\n}\n\nfunction inputWithButtons(isDisabled, incrementFunc, isValueEmpty, callOnChange, input, object, value) {\n const controlColumnDetails = singleton_1(new Option_5(0, [new Screen(0, []), new ISize(5, [])]));\n const getButton = (increment, icon) => button(ofArray([new Option_6(16, [isDisabled ? true : isValueEmpty(value)]), new Option_6(5, []), new Option_6(1, [new Size_ISize(0, [])]), new Option_6(18, [(event) => {\n event.preventDefault();\n const newValue = incrementFunc(increment, value);\n if (!isValueEmpty(newValue)) {\n callOnChange(object, newValue);\n }\n }])]), singleton_1(icon_1(singleton_1(new Option_7(0, [new Size_ISize(0, [])])), singleton_1(Fa_i(singleton_1(icon), [])))));\n return columns(singleton_1(new Option_8(4, [])), ofArray([column(controlColumnDetails, singleton_1(getButton(-1, new Fa_IconOption(11, [\"fas fa-minus\"])))), column(empty(), singleton_1(input)), column(controlColumnDetails, singleton_1(getButton(1, new Fa_IconOption(11, [\"fas fa-plus\"]))))]));\n}\n\nexport class NumericFieldBase$2 extends JsGetterSetterBaseField$2 {\n constructor(name, fieldName, fromValue, toValue, validate, onChange, emptyValues, incrementFunc) {\n super(name, fieldName, validate, onChange);\n this.fromValue = fromValue;\n this.toValue = toValue;\n this.emptyValues = emptyValues;\n this.incrementFunc = incrementFunc;\n this.withButtons = (this.incrementFunc != null);\n }\n \"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.RenderValue\"(isDisabled, error, object, value) {\n const this$ = this;\n const strValue = NumericFieldBase$2__IsValueEmpty_2B594(this$, value) ? \"\" : this$.fromValue(value);\n const input = input_1(ofArray([new Option_4(1, [new IInputType(7, [])]), new Option_4(2, [FieldValidationResult__ToColour_Z5463E381(error, new Color_IColor(4, []))]), new Option_4(12, [GetterSetterBaseField$2__get_Placeholder(this$)]), new Option_4(8, [strValue]), new Option_4(13, [(event) => {\n NumericFieldBase$2__ProcessOnChange(this$, object, value, event);\n }]), new Option_4(4, [isDisabled])]));\n return this$.withButtons ? inputWithButtons(isDisabled, uncurry2(value_15(map(curry2, this$.incrementFunc))), (value_1) => NumericFieldBase$2__IsValueEmpty_2B594(this$, value_1), (object_2, newValue) => {\n GetterSetterBaseField$2__CallOnChange(this$, object_2, newValue);\n }, input, object, value) : input;\n }\n}\n\nexport function NumericFieldBase$2_$reflection(gen0, gen1) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.NumericFieldBase`2\", [gen0, gen1], NumericFieldBase$2, JsGetterSetterBaseField$2_$reflection(gen0, gen1));\n}\n\nexport function NumericFieldBase$2_$ctor_73961A4A(name, fieldName, fromValue, toValue, validate, onChange, emptyValues, incrementFunc) {\n return new NumericFieldBase$2(name, fieldName, fromValue, toValue, validate, onChange, emptyValues, incrementFunc);\n}\n\nfunction NumericFieldBase$2__ProcessOnChangeEx(this$, object, currentValue, event, valueModifier) {\n const elem = event.target;\n if (isNullOrWhiteSpace(elem.value) && (FSharpSet__get_Count(this$.emptyValues) === 1)) {\n GetterSetterBaseField$2__CallOnChange(this$, object, head(this$.emptyValues));\n }\n else {\n const matchValue = this$.toValue(elem.value);\n if (matchValue.tag === 1) {\n }\n else {\n const finalValue = valueModifier(matchValue.fields[0]);\n if (!equals(finalValue, currentValue)) {\n GetterSetterBaseField$2__CallOnChange(this$, object, finalValue);\n }\n }\n }\n}\n\nfunction NumericFieldBase$2__ProcessOnChange(this$, object, currentValue, event) {\n event.preventDefault();\n NumericFieldBase$2__ProcessOnChangeEx(this$, object, currentValue, event, (x) => x);\n}\n\nfunction NumericFieldBase$2__IsValueEmpty_2B594(this$, value) {\n return contains(value, this$.emptyValues);\n}\n\nconst tryParseInt = (arg_1) => {\n let _arg;\n let outArg = 0;\n _arg = [tryParse(arg_1, 511, false, 32, new FSharpRef(() => outArg, (v) => {\n outArg = (v | 0);\n })), outArg];\n return _arg[0] ? (new FSharpResult$2(0, [_arg[1]])) : (new FSharpResult$2(1, [\"Can\\'t parse int\"]));\n};\n\nconst tryParseIntOpt = (arg_1) => {\n let _arg;\n let outArg = 0;\n _arg = [tryParse(arg_1, 511, false, 32, new FSharpRef(() => outArg, (v) => {\n outArg = (v | 0);\n })), outArg];\n return _arg[0] ? (new FSharpResult$2(0, [_arg[1]])) : (new FSharpResult$2(1, [\"Can\\'t parse int\"]));\n};\n\nconst tryParseDouble = (arg_1) => {\n let _arg;\n let outArg = 0;\n _arg = [tryParse_1(arg_1, new FSharpRef(() => outArg, (v) => {\n outArg = v;\n })), outArg];\n return _arg[0] ? (new FSharpResult$2(0, [_arg[1]])) : (new FSharpResult$2(1, [\"Can\\'t parse double\"]));\n};\n\nconst tryParseDecimal = (arg_1) => {\n let _arg;\n let outArg = 0;\n _arg = [tryParse_1(arg_1, new FSharpRef(() => outArg, (v) => {\n outArg = v;\n })), outArg];\n return _arg[0] ? (new FSharpResult$2(0, [new Decimal(_arg[1])])) : (new FSharpResult$2(1, [\"Can\\'t parse decimal\"]));\n};\n\nexport class IntField$1 extends NumericFieldBase$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, int32ToString, tryParseInt, validate, onChange, empty_2({\n Compare: comparePrimitives,\n }), undefined);\n }\n}\n\nexport function IntField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.IntField`1\", [gen0], IntField$1, NumericFieldBase$2_$reflection(gen0, int32_type));\n}\n\nexport function IntField$1_$ctor_1CFD88AD(name, fieldName, validate, onChange) {\n return new IntField$1(name, fieldName, validate, onChange);\n}\n\nexport class PositiveIntField$1 extends NumericFieldBase$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, int32ToString, tryParseInt, validate, onChange, ofSeq([0], {\n Compare: comparePrimitives,\n }), (step, value_1) => (value_1 + step));\n }\n}\n\nexport function PositiveIntField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.PositiveIntField`1\", [gen0], PositiveIntField$1, NumericFieldBase$2_$reflection(gen0, int32_type));\n}\n\nexport function PositiveIntField$1_$ctor_1CFD88AD(name, fieldName, validate, onChange) {\n return new PositiveIntField$1(name, fieldName, validate, onChange);\n}\n\nexport class PositiveIntOptField$1 extends NumericFieldBase$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, toString, tryParseIntOpt, validate, onChange, ofSeq([0], {\n Compare: compare,\n }), (step, option) => map((x_1) => (x_1 + step), option));\n }\n}\n\nexport function PositiveIntOptField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.PositiveIntOptField`1\", [gen0], PositiveIntOptField$1, NumericFieldBase$2_$reflection(gen0, option_type(int32_type)));\n}\n\nexport function PositiveIntOptField$1_$ctor_Z7DEF6452(name, fieldName, validate, onChange) {\n return new PositiveIntOptField$1(name, fieldName, validate, onChange);\n}\n\nfunction optToString(value) {\n if (value == null) {\n return \"\";\n }\n else {\n let copyOfStruct = value_15(value);\n return toString(copyOfStruct);\n }\n}\n\nfunction stringToOptInt(s) {\n if (isNullOrWhiteSpace(s)) {\n return new FSharpResult$2(0, [undefined]);\n }\n else {\n return Result_Map((Value) => Value, tryParseInt(s));\n }\n}\n\nexport class IntFieldOpt$1 extends NumericFieldBase$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, optToString, stringToOptInt, validate, onChange, empty_2({\n Compare: compare,\n }), undefined);\n const this$ = new FSharpRef(defaultOf_1());\n this$.contents = this;\n this[\"init@468-2\"] = 1;\n GetterSetterBaseField$2__get_Field(this$.contents).IsRequired = false;\n }\n}\n\nexport function IntFieldOpt$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.IntFieldOpt`1\", [gen0], IntFieldOpt$1, NumericFieldBase$2_$reflection(gen0, option_type(int32_type)));\n}\n\nexport function IntFieldOpt$1_$ctor_Z7DEF6452(name, fieldName, validate, onChange) {\n return new IntFieldOpt$1(name, fieldName, validate, onChange);\n}\n\nexport class FloatField$1 extends NumericFieldBase$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, (value) => value.toString(), tryParseDouble, validate, onChange, empty_2({\n Compare: comparePrimitives,\n }), undefined);\n }\n}\n\nexport function FloatField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.FloatField`1\", [gen0], FloatField$1, NumericFieldBase$2_$reflection(gen0, float64_type));\n}\n\nexport function FloatField$1_$ctor_Z618923D6(name, fieldName, validate, onChange) {\n return new FloatField$1(name, fieldName, validate, onChange);\n}\n\nexport class PositiveFloatField$1 extends NumericFieldBase$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, (value) => value.toString(), tryParseDouble, validate, onChange, ofSeq([0], {\n Compare: comparePrimitives,\n }), (step, value_1) => (value_1 + (step * 1)));\n }\n}\n\nexport function PositiveFloatField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.PositiveFloatField`1\", [gen0], PositiveFloatField$1, NumericFieldBase$2_$reflection(gen0, float64_type));\n}\n\nexport function PositiveFloatField$1_$ctor_Z618923D6(name, fieldName, validate, onChange) {\n return new PositiveFloatField$1(name, fieldName, validate, onChange);\n}\n\nfunction stringToOptDecimal(s) {\n if (isNullOrWhiteSpace(s)) {\n return new FSharpResult$2(0, [undefined]);\n }\n else {\n return Result_Map((Value) => Value, tryParseDecimal(s));\n }\n}\n\nexport class DecimalField$1 extends NumericFieldBase$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, toString_1, tryParseDecimal, validate, onChange, empty_2({\n Compare: compare_1,\n }), undefined);\n }\n}\n\nexport function DecimalField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.DecimalField`1\", [gen0], DecimalField$1, NumericFieldBase$2_$reflection(gen0, decimal_type));\n}\n\nexport function DecimalField$1_$ctor_Z1A3DC0EC(name, fieldName, validate, onChange) {\n return new DecimalField$1(name, fieldName, validate, onChange);\n}\n\nexport class DecimalFieldOpt$1 extends NumericFieldBase$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, toString, stringToOptDecimal, validate, onChange, empty_2({\n Compare: compare,\n }), undefined);\n }\n}\n\nexport function DecimalFieldOpt$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.DecimalFieldOpt`1\", [gen0], DecimalFieldOpt$1, NumericFieldBase$2_$reflection(gen0, option_type(decimal_type)));\n}\n\nexport function DecimalFieldOpt$1_$ctor_6EECF8B7(name, fieldName, validate, onChange) {\n return new DecimalFieldOpt$1(name, fieldName, validate, onChange);\n}\n\nexport class BaseDateTimeField$2 extends JsGetterSetterBaseField$2 {\n constructor(name, fieldName, convertToDate, convertFromDate, isSet, validate, onChange, formatString, inputFunc) {\n super(name, fieldName, validate, onChange);\n this.convertToDate = convertToDate;\n this.convertFromDate = convertFromDate;\n this.isSet = isSet;\n this.formatString = formatString;\n this.inputFunc = inputFunc;\n }\n \"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.RenderValue\"(isDisabled, error, object, date) {\n const this$ = this;\n const value = this$.isSet(date) ? singleton_1(new Option_4(8, [toString_2(toLocalTime(this$.convertToDate(date)), this$.formatString)])) : empty();\n return this$.inputFunc(append_1(ofArray([new Option_4(2, [FieldValidationResult__ToColour_Z5463E381(error, new Color_IColor(4, []))]), new Option_4(12, [GetterSetterBaseField$2__get_Placeholder(this$)]), new Option_4(13, [(event) => {\n BaseDateTimeField$2__ProcessOnChange(this$, object, event);\n }]), new Option_4(4, [isDisabled])]), value));\n }\n}\n\nexport function BaseDateTimeField$2_$reflection(gen0, gen1) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.BaseDateTimeField`2\", [gen0, gen1], BaseDateTimeField$2, JsGetterSetterBaseField$2_$reflection(gen0, gen1));\n}\n\nexport function BaseDateTimeField$2_$ctor_Z3AB08EEA(name, fieldName, convertToDate, convertFromDate, isSet, validate, onChange, formatString, inputFunc) {\n return new BaseDateTimeField$2(name, fieldName, convertToDate, convertFromDate, isSet, validate, onChange, formatString, inputFunc);\n}\n\nfunction BaseDateTimeField$2__ProcessOnChange(this$, object, event) {\n const elem = event.target;\n let parsed = minValue();\n if (!isNullOrWhiteSpace(elem.value) && tryParse_2(elem.value, new FSharpRef(() => parsed, (v) => {\n parsed = v;\n }))) {\n GetterSetterBaseField$2__CallOnChange(this$, object, this$.convertFromDate(toUniversalTime(parsed)));\n }\n else {\n console.log(some(`DATE change ignored: ${elem.value}; ${elem.valueAsDate}`));\n }\n}\n\nconst dateTimeFormatString = \"yyyy-MM-ddTHH:mm\";\n\nexport class DateTimeField$1 extends BaseDateTimeField$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, (x) => x, (x_1) => x_1, (_arg) => true, validate, onChange, dateTimeFormatString, (options) => input_1(cons(new Option_4(1, [new IInputType(2, [])]), options)));\n }\n}\n\nexport function DateTimeField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.DateTimeField`1\", [gen0], DateTimeField$1, BaseDateTimeField$2_$reflection(gen0, class_type(\"System.DateTime\")));\n}\n\nexport function DateTimeField$1_$ctor_4797505E(name, fieldName, validate, onChange) {\n return new DateTimeField$1(name, fieldName, validate, onChange);\n}\n\nexport class DateTimeOptField$1 extends BaseDateTimeField$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, value_15, (Value) => Value, (option_1) => (option_1 != null), validate, onChange, dateTimeFormatString, (options) => input_1(cons(new Option_4(1, [new IInputType(2, [])]), options)));\n }\n}\n\nexport function DateTimeOptField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.DateTimeOptField`1\", [gen0], DateTimeOptField$1, BaseDateTimeField$2_$reflection(gen0, option_type(class_type(\"System.DateTime\"))));\n}\n\nexport function DateTimeOptField$1_$ctor_86BCFBD(name, fieldName, validate, onChange) {\n return new DateTimeOptField$1(name, fieldName, validate, onChange);\n}\n\nexport class DateField$1 extends BaseDateTimeField$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, (x) => x, (x_1) => x_1, (_arg) => true, validate, onChange, \"yyyy-MM-dd\", (options) => input_1(cons(new Option_4(1, [new IInputType(3, [])]), options)));\n }\n}\n\nexport function DateField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.DateField`1\", [gen0], DateField$1, BaseDateTimeField$2_$reflection(gen0, class_type(\"System.DateTime\")));\n}\n\nexport function DateField$1_$ctor_4797505E(name, fieldName, validate, onChange) {\n return new DateField$1(name, fieldName, validate, onChange);\n}\n\nexport class DurationSecsFieldBase$1 extends JsGetterSetterBaseField$2 {\n constructor(name, fieldName, validate, onChange, withSeconds) {\n super(name, fieldName, validate, onChange);\n this.withSeconds = withSeconds;\n }\n \"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.RenderValue\"(isDisabled, error, object, durationSecs) {\n const this$ = this;\n const patternInput = splitSeconds(durationSecs);\n const now = toLocalTime(now_1());\n const dateStr = toString_2(toLocalTime(create(year(now), month(now), day(now), patternInput[0], patternInput[1], patternInput[2], 0, 2)), \"HH:mm:ss\");\n return inputWithButtons(isDisabled, (increment, oldValue) => DurationSecsFieldBase$1__incrementFunc(this$, increment, oldValue), (value) => DurationSecsFieldBase$1__isValueEmpty_Z524259A4(this$, value), (object_2, newValue) => {\n GetterSetterBaseField$2__CallOnChange(this$, object_2, newValue);\n }, input_1(cons(new Option_4(1, [new IInputType(5, [])]), toList(delay(() => append(singleton(new Option_4(2, [FieldValidationResult__ToColour_Z5463E381(error, new Color_IColor(4, []))])), delay(() => append(singleton(new Option_4(12, [GetterSetterBaseField$2__get_Placeholder(this$)])), delay(() => append(singleton(new Option_4(8, [dateStr])), delay(() => append(singleton(new Option_4(13, [(event) => {\n DurationSecsFieldBase$1__ProcessOnChange(this$, object, event);\n }])), delay(() => append(singleton(new Option_4(4, [isDisabled])), delay(() => (this$.withSeconds ? singleton(new Option_4(15, [singleton_1(new HTMLAttr(154, [1]))])) : empty_1()))))))))))))))), object, durationSecs);\n }\n}\n\nexport function DurationSecsFieldBase$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.DurationSecsFieldBase`1\", [gen0], DurationSecsFieldBase$1, JsGetterSetterBaseField$2_$reflection(gen0, int32_type));\n}\n\nexport function DurationSecsFieldBase$1_$ctor_5CEDACA7(name, fieldName, validate, onChange, withSeconds) {\n return new DurationSecsFieldBase$1(name, fieldName, validate, onChange, withSeconds);\n}\n\nfunction DurationSecsFieldBase$1__ProcessOnChange(this$, object, event) {\n const elem = event.target;\n if (!isNullOrWhiteSpace(elem.value) && !(elem.valueAsDate == null)) {\n const newDate = parse(elem.value);\n GetterSetterBaseField$2__CallOnChange(this$, object, (((hour(newDate) * 60) + minute(newDate)) * 60) + second(newDate));\n }\n}\n\nexport function DurationSecsFieldBase$1__incrementFunc(this$, increment, oldValue) {\n return oldValue + ((this$.withSeconds ? 15 : 60) * increment);\n}\n\nexport function DurationSecsFieldBase$1__isValueEmpty_Z524259A4(this$, value) {\n return value < 0;\n}\n\nexport class DurationSecsField$1 extends DurationSecsFieldBase$1 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, validate, onChange, false);\n }\n}\n\nexport function DurationSecsField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.DurationSecsField`1\", [gen0], DurationSecsField$1, DurationSecsFieldBase$1_$reflection(gen0));\n}\n\nexport function DurationSecsField$1_$ctor_1CFD88AD(name, fieldName, validate, onChange) {\n return new DurationSecsField$1(name, fieldName, validate, onChange);\n}\n\nexport class DurationSecsFieldWithSeconds$1 extends DurationSecsFieldBase$1 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, validate, onChange, true);\n }\n}\n\nexport function DurationSecsFieldWithSeconds$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.DurationSecsFieldWithSeconds`1\", [gen0], DurationSecsFieldWithSeconds$1, DurationSecsFieldBase$1_$reflection(gen0));\n}\n\nexport function DurationSecsFieldWithSeconds$1_$ctor_1CFD88AD(name, fieldName, validate, onChange) {\n return new DurationSecsFieldWithSeconds$1(name, fieldName, validate, onChange);\n}\n\nexport class LocationField$1 extends JsGetterSetterBaseField$2 {\n constructor(name, fieldName, suggestions, onSuggestionChosen, validate, onChange) {\n super(name, fieldName, validate, onChange);\n this.suggestions = suggestions;\n this.onSuggestionChosen = onSuggestionChosen;\n this.maxNameLength = 20;\n }\n \"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.RenderValue\"(isDisabled, error, object, location) {\n const this$ = this;\n const currentLocation = defaultArg(location, \"\");\n const children = toList(delay(() => append(singleton(input_1(ofArray([new Option_4(1, [new IInputType(0, [])]), new Option_4(3, [Config_placeLookupId]), new Option_4(2, [FieldValidationResult__ToColour_Z5463E381(error, new Color_IColor(4, []))]), new Option_4(12, [GetterSetterBaseField$2__get_Placeholder(this$)]), new Option_4(8, [currentLocation]), new Option_4(13, [(event) => {\n LocationField$1__ProcessOnChange(this$, object, event);\n }]), new Option_4(4, [isDisabled])]))), delay(() => (!isEmpty(this$.suggestions) ? singleton(list_5(empty(), map_1((suggestion) => LocationField$1__RenderSuggestion(this$, isDisabled, currentLocation, suggestion), this$.suggestions))) : empty_1())))));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n });\n }\n \"Omnicv.Client.Common.Components.FlexForm.BaseField`1.Validate2B595\"(object) {\n const this$ = this;\n return FieldValidationResult__Merge_30561432((GetterSetterBaseField$2__GetValue_2B595(this$, object) == null) ? (new FieldValidationResult(1, [\"Location value is not set\"])) : (new FieldValidationResult(0, [])), super[\"Omnicv.Client.Common.Components.FlexForm.BaseField`1.Validate2B595\"](object));\n }\n}\n\nexport function LocationField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.LocationField`1\", [gen0], LocationField$1, JsGetterSetterBaseField$2_$reflection(gen0, option_type(string_type)));\n}\n\nexport function LocationField$1_$ctor_455E8BE1(name, fieldName, suggestions, onSuggestionChosen, validate, onChange) {\n return new LocationField$1(name, fieldName, suggestions, onSuggestionChosen, validate, onChange);\n}\n\nfunction LocationField$1__ProcessOnChange(this$, object, event) {\n let value;\n const elem = event.target;\n GetterSetterBaseField$2__CallOnChange(this$, object, (value = elem.value, isNullOrWhiteSpace(value) ? undefined : value));\n}\n\nfunction LocationField$1__RenderSuggestion(this$, isDisabled, currentLocation, suggestion) {\n const name = suggestion.Name;\n if (currentLocation !== name) {\n let distance;\n if (suggestion.DistanceFromCurrent != null) {\n const dist = ~~value_15(suggestion.DistanceFromCurrent) | 0;\n distance = ((dist > 1000) ? \": >1km\" : (`: ${dist}m`));\n }\n else {\n distance = \"\";\n }\n return button(ofArray([new Option_6(0, [isDisabled ? (new Color_IColor(14, [])) : (new Color_IColor(4, []))]), new Option_6(1, [new Size_ISize(0, [])]), new Option_6(16, [isDisabled]), new Option_6(18, [(event) => {\n event.preventDefault();\n this$.onSuggestionChosen(suggestion);\n }])]), singleton_1(`${(name.length > this$.maxNameLength) ? (substring(name, 0, 20) + \"…\") : name}${distance}`));\n }\n else {\n return defaultOf();\n }\n}\n\nfunction validateChoice(choices, nextValidate, value) {\n if (!exists_1((pair) => equals(value, pair[0]), choices)) {\n return `Value ${value} is not a valid choice`;\n }\n else {\n return nextValidate(value);\n }\n}\n\nexport class SelectField$2 extends JsGetterSetterBaseField$2 {\n constructor(name, fieldName, choices, convert_1, validate, onChange) {\n super(name, fieldName, (value) => validateChoice(choices, validate, value), onChange);\n this.name_2 = name;\n this.choices = choices;\n this.convert = convert_1;\n }\n \"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.RenderValue\"(isDisabled, error, object, value) {\n let props, copyOfStruct;\n const this$ = this;\n const options = valuesToSelectOptions(this$.choices, this$.name_2);\n return select(ofArray([new Option_9(7, [FieldValidationResult__ToColour_Z5463E381(error, new Color_IColor(4, []))]), new Option_9(6, [isDisabled])]), singleton_1((props = [new DOMAttr(9, [(event) => {\n SelectField$2__ProcessOnChange(this$, object, event);\n }]), new HTMLAttr(161, [(copyOfStruct = value, toString(copyOfStruct))])], react.createElement(\"select\", keyValueList(props, 1), ...options))));\n }\n}\n\nexport function SelectField$2_$reflection(gen0, gen1) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.SelectField`2\", [gen0, gen1], SelectField$2, JsGetterSetterBaseField$2_$reflection(gen0, gen1));\n}\n\nexport function SelectField$2_$ctor_Z7732D262(name, fieldName, choices, convert_1, validate, onChange) {\n return new SelectField$2(name, fieldName, choices, convert_1, validate, onChange);\n}\n\nfunction SelectField$2__ProcessOnChange(this$, object, event) {\n const elem = event.target;\n GetterSetterBaseField$2__CallOnChange(this$, object, this$.convert(elem.value));\n}\n\nexport class RadioField$2 extends JsGetterSetterBaseField$2 {\n constructor(name, fieldName, choices, validate, onChange) {\n super(name, fieldName, (value) => validateChoice(choices, validate, value), onChange);\n this.choices = choices;\n }\n \"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.RenderValue\"(isDisabled, error, object, value) {\n const this$ = this;\n const y = map_1((tupledArg) => RadioField$2__RenderChoice(this$, isDisabled, object, value, tupledArg[0], tupledArg[1]), this$.choices);\n return div(singleton_1(new Option_10(12, [singleton_1(new Modifier_IModifier(1, [FieldValidationResult__ToColour_Z5463E381(error, new Color_IColor(0, []))]))])), y);\n }\n}\n\nexport function RadioField$2_$reflection(gen0, gen1) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.RadioField`2\", [gen0, gen1], RadioField$2, JsGetterSetterBaseField$2_$reflection(gen0, gen1));\n}\n\nexport function RadioField$2_$ctor_14949C87(name, fieldName, choices, validate, onChange) {\n return new RadioField$2(name, fieldName, choices, validate, onChange);\n}\n\nfunction RadioField$2__ProcessOnChange(this$, object, newValue, _event) {\n GetterSetterBaseField$2__CallOnChange(this$, object, newValue);\n}\n\nfunction RadioField$2__RenderChoice(this$, isDisabled, object, currentValue, optionValue, caption) {\n let copyOfStruct;\n return radioInline(ofArray([new Option_11(6, [equals(currentValue, optionValue)]), new Option_11(14, [(copyOfStruct = optionValue, toString(copyOfStruct))]), new Option_11(13, [`radio-${optionValue}`]), new Option_11(11, [(_event) => {\n RadioField$2__ProcessOnChange(this$, object, optionValue, _event);\n }]), new Option_11(7, [isDisabled])]), singleton_1(` ${caption} `));\n}\n\nexport class CheckboxField$1 extends JsGetterSetterBaseField$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, validate, onChange);\n }\n \"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.RenderValue\"(isDisabled, _error, object, value) {\n const this$ = this;\n return checkbox(empty(), ofArray([input_2(singleton_1(new Common_GenericOption(1, [ofArray([new HTMLAttr(62, [value]), new DOMAttr(9, [(event) => {\n CheckboxField$1__ProcessOnChange(this$, object, event);\n }]), new HTMLAttr(79, [isDisabled])])]))), \"\"]));\n }\n}\n\nexport function CheckboxField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.CheckboxField`1\", [gen0], CheckboxField$1, JsGetterSetterBaseField$2_$reflection(gen0, bool_type));\n}\n\nexport function CheckboxField$1_$ctor_Z387AD5E5(name, fieldName, validate, onChange) {\n return new CheckboxField$1(name, fieldName, validate, onChange);\n}\n\nfunction CheckboxField$1__ProcessOnChange(this$, object, event) {\n const elem = event.target;\n GetterSetterBaseField$2__CallOnChange(this$, object, elem.checked);\n}\n\nexport class TagsField$1 extends JsGetterSetterBaseField$2 {\n constructor(name, fieldName, tagsPredictionValues, validate, onChange) {\n super(name, fieldName, validate, onChange);\n this.tagsPredictionValues = tagsPredictionValues;\n }\n \"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.RenderValue\"(_isDisabled, _error, object, rawValue) {\n let elems_1;\n const this$ = this;\n const tags = toClientListView(rawValue);\n const onNewValue = (newTag) => {\n const matchValue = tryFind((x_2) => (x_2 === newTag), tags);\n if (matchValue == null) {\n GetterSetterBaseField$2__CallOnChange(this$, object, concatToServer(append_1(tags, singleton_1(newTag))));\n }\n };\n let autocompleteInput;\n const inputProperties = createObj(ofArray([[\"placeholder\", \"Search for a tag\"], [\"onChange\", onNewValue], selectSearch_options_113CE11B(map_1((x_1) => (new SelectOption(0, [new SelectItem(x_1, x_1, false)])), List_except(tags, this$.tagsPredictionValues, {\n Equals: (x, y) => (x === y),\n GetHashCode: stringHash,\n }))), [\"search\", true], selectSearch_filterOptions_Z7A2530AD((item, input) => {\n if (!(item.value.toLocaleLowerCase().indexOf(input.toLocaleLowerCase()) >= 0)) {\n if (input.endsWith(\",\")) {\n onNewValue(substring(input, 0, input.length - 1));\n return false;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n })]));\n autocompleteInput = reactApi_1.createElement(react_select_search, Object.assign({}, Interop_defaultProps, inputProperties));\n const headerTag = div_1(empty(), singleton_1(createElement(\"div\", createObj(Helpers_combineClasses(\"tags\", singleton_1((elems_1 = [createElement(\"span\", createObj(Helpers_combineClasses(\"tag\", ofArray([[\"className\", \"is-warning\"], [\"children\", \"Tags\"]]))))], [\"children\", reactApi.Children.toArray(Array.from(elems_1))])))))));\n const children = toList(delay(() => append(singleton(autocompleteInput), delay(() => (!isEmpty(tags) ? singleton(div(ofArray([new Option_10(4, []), new Option_10(7, []), new Option_10(12, [singleton_1(new Modifier_IModifier(29, [new Spacing_TypeAndDirection(1, []), new Spacing_Amount(3, [])]))])]), cons(headerTag, map_1((tag) => {\n let elems;\n return div_1(empty(), singleton_1(createElement(\"div\", createObj(Helpers_combineClasses(\"tags\", ofArray([[\"className\", \"has-addons\"], (elems = [createElement(\"span\", createObj(Helpers_combineClasses(\"tag\", ofArray([[\"className\", \"is-info\"], [\"children\", tag]])))), createElement(\"span\", createObj(Helpers_combineClasses(\"tag\", ofArray([[\"className\", \"is-delete\"], [\"onClick\", (event) => {\n event.preventDefault();\n GetterSetterBaseField$2__CallOnChange(this$, object, concatToServer(List_except([tag], tags, {\n Equals: (x_3, y_1) => (x_3 === y_1),\n GetHashCode: stringHash,\n })));\n }]]))))], [\"children\", reactApi.Children.toArray(Array.from(elems))])]))))));\n }, tags)))) : empty_1())))));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n });\n }\n}\n\nexport function TagsField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.TagsField`1\", [gen0], TagsField$1, JsGetterSetterBaseField$2_$reflection(gen0, string_type));\n}\n\nexport function TagsField$1_$ctor_32D33D73(name, fieldName, tagsPredictionValues, validate, onChange) {\n return new TagsField$1(name, fieldName, tagsPredictionValues, validate, onChange);\n}\n\nexport class RatingField$1 extends JsGetterSetterBaseField$2 {\n constructor(name, fieldName, validate, onChange) {\n super(name, fieldName, validate, onChange);\n }\n \"Omnicv.Client.Common.Components.FlexForm.GetterSetterBaseField`2.RenderValue\"(isDisabled, _error, object, rawValue) {\n const this$ = this;\n const converted = rawValue / 2;\n return ratingStars(append_1(ofArray([new RatingStarsProps(1, [5]), new RatingStarsProps(4, [24]), new RatingStarsProps(3, [true]), new RatingStarsProps(2, [!isDisabled]), new RatingStarsProps(6, [(newValue) => {\n GetterSetterBaseField$2__CallOnChange(this$, object, (newValue * 2) & 0xFF);\n }])]), (converted > 0) ? singleton_1(new RatingStarsProps(5, [converted])) : empty()));\n }\n}\n\nexport function RatingField$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.RatingField`1\", [gen0], RatingField$1, JsGetterSetterBaseField$2_$reflection(gen0, uint8_type));\n}\n\nexport function RatingField$1_$ctor_B10D3B5(name, fieldName, validate, onChange) {\n return new RatingField$1(name, fieldName, validate, onChange);\n}\n\nexport class FlexFormFields$1 {\n constructor(onChange, callbackOnFieldAdd) {\n this.onChange = onChange;\n this.callbackOnFieldAdd = callbackOnFieldAdd;\n this.fields = [];\n }\n}\n\nexport function FlexFormFields$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.FlexFormFields`1\", [gen0], FlexFormFields$1);\n}\n\nexport function FlexFormFields$1_$ctor_Z63A200CD(onChange, callbackOnFieldAdd) {\n return new FlexFormFields$1(onChange, callbackOnFieldAdd);\n}\n\nexport class FlexFormFieldsGroup$1 extends FlexFormFields$1 {\n constructor(onChange, label) {\n super(onChange);\n this.label = label;\n }\n Render(isDisabled, object) {\n const this$ = this;\n return div(singleton_1(new Option_10(8, [])), toList(delay(() => append((this$.label != null) ? singleton(label_2(empty(), singleton_1(value_15(this$.label)))) : empty_1(), delay(() => singleton(body(empty(), FlexFormFields$1__Render(this$, isDisabled, object))))))));\n }\n Validate(object) {\n const this$ = this;\n return FlexFormFields$1__ValidateAll_2B595(this$, object);\n }\n}\n\nexport function FlexFormFieldsGroup$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.FlexFormFieldsGroup`1\", [gen0], FlexFormFieldsGroup$1, FlexFormFields$1_$reflection(gen0));\n}\n\nexport function FlexFormFieldsGroup$1_$ctor_38CD3B67(onChange, label) {\n return new FlexFormFieldsGroup$1(onChange, label);\n}\n\nfunction FlexFormFields$1__AddField_6235DF45(this$, field) {\n if (this$.callbackOnFieldAdd != null) {\n value_15(this$.callbackOnFieldAdd)(field);\n }\n void (this$.fields.push(field));\n}\n\nexport function FlexFormFields$1__ValidateAll_2B595(this$, value) {\n return mergeResults(map_2((field) => field.Validate(value), this$.fields));\n}\n\nexport function FlexFormFields$1__CanSubmit_2B595(this$, value) {\n return mergeResults(map_2((field) => field.Validate(value), this$.fields));\n}\n\nfunction FlexFormFields$1__BuildAddField(this$, fieldBuilder, fieldName, validate, caption0, onChange0, help, required) {\n const field = fieldBuilder(defaultArg(caption0, fieldName), fieldName, validate, defaultArg(onChange0, this$.onChange));\n if (help != null) {\n field.Help = help;\n }\n if (required != null) {\n field.IsRequired = value_15(required);\n }\n FlexFormFields$1__AddField_6235DF45(this$, field);\n return this$;\n}\n\nexport function FlexFormFields$1__AddCustom_693A43B3(this$, fieldName, customRender) {\n FlexFormFields$1__AddField_6235DF45(this$, CustomField$1_$ctor_693A43B3(fieldName, customRender));\n return this$;\n}\n\nexport function FlexFormFields$1__AddText_Z44011C05(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, TextField$1_$ctor_7EE3C92A, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddTextOpt_Z44636648(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, TextFieldOpt$1_$ctor_773DF4C9, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddTextArea_Z44011C05(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, TextAreaField$1_$ctor_7EE3C92A, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddTextAreaOpt_Z44636648(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, TextAreaFieldOpt$1_$ctor_773DF4C9, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddPassword_Z44011C05(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, PasswordField$1_$ctor_7EE3C92A, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddInt_ZAAC24(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, IntField$1_$ctor_1CFD88AD, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddPositiveInt_ZAAC24(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, PositiveIntField$1_$ctor_1CFD88AD, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddPositiveIntOpt_414042FF(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, PositiveIntOptField$1_$ctor_Z7DEF6452, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddIntOpt_414042FF(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, IntFieldOpt$1_$ctor_Z7DEF6452, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddFloat_1D6F52FB(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, FloatField$1_$ctor_Z618923D6, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddDecimal_7B82A45(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, DecimalField$1_$ctor_Z1A3DC0EC, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddDecimalOpt_Z2D27E1FA(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, DecimalFieldOpt$1_$ctor_6EECF8B7, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddPositiveFloat_1D6F52FB(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, PositiveFloatField$1_$ctor_Z618923D6, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddDateTime_2636DDCF(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, DateTimeField$1_$ctor_4797505E, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddDateTimeOpt_C9F34CC(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, DateTimeOptField$1_$ctor_86BCFBD, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddDate_2636DDCF(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, DateField$1_$ctor_4797505E, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddRating_Z716E223C(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, RatingField$1_$ctor_B10D3B5, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddDurationSecs_ZAAC24(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, DurationSecsField$1_$ctor_1CFD88AD, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddDurationSecsWithSeconds_ZAAC24(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, DurationSecsFieldWithSeconds$1_$ctor_1CFD88AD, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddTags_Z63D88B1E(this$, fieldName, validate, tagsPredictionValues, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, (caption, fieldName_1, validate_1, onChange) => TagsField$1_$ctor_32D33D73(caption, fieldName_1, tagsPredictionValues, validate_1, onChange), fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddLocation_Z52938230(this$, fieldName, validate, suggestions, onSuggestionChosen, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, (caption, fieldName_1, validate_1, onChange) => LocationField$1_$ctor_455E8BE1(caption, fieldName_1, suggestions, onSuggestionChosen, validate_1, onChange), fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddSelection_158231B6(this$, fieldName, choices, convert_1, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, (caption, fieldName_1, validate_1, onChange) => SelectField$2_$ctor_Z7732D262(caption, fieldName_1, choices, convert_1, validate_1, onChange), fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddSelection_Z70244BEA(this$, fieldName, choices, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, (caption, fieldName_1, validate_1, onChange) => SelectField$2_$ctor_Z7732D262(caption, fieldName_1, choices, (value) => stringToEnum(choices, value), validate_1, onChange), fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddRadiosInline_Z70244BEA(this$, fieldName, choices, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, (caption, fieldName_1, validate_1, onChange) => RadioField$2_$ctor_14949C87(caption, fieldName_1, choices, validate_1, onChange), fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddCheckbox_264AA22A(this$, fieldName, validate, caption0, onChange0, help, required) {\n return FlexFormFields$1__BuildAddField(this$, CheckboxField$1_$ctor_Z387AD5E5, fieldName, validate, caption0, onChange0, help, required);\n}\n\nexport function FlexFormFields$1__AddGroup_6DFDD678(this$, label) {\n const group = FlexFormFieldsGroup$1_$ctor_38CD3B67(this$.onChange, label);\n FlexFormFields$1__AddField_6235DF45(this$, group);\n return group;\n}\n\nexport function FlexFormFields$1__Render(this$, isDisabled, value) {\n return ofSeq_1(map_2((field) => field.Render(isDisabled, value), this$.fields));\n}\n\nexport class FlexFormState extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Idle\", \"Loading\", \"Error\", \"Success\"];\n }\n}\n\nexport function FlexFormState_$reflection() {\n return union_type(\"Omnicv.Client.Common.Components.FlexForm.FlexFormState\", [], FlexFormState, () => [[], [], [[\"Item\", string_type]], [[\"Item\", string_type]]]);\n}\n\nexport function FlexFormState__CanSubmit(this$) {\n switch (this$.tag) {\n case 0:\n case 2:\n return true;\n default:\n return false;\n }\n}\n\nexport function FlexFormState__IsInProgress(this$) {\n if (this$.tag === 1) {\n return true;\n }\n else {\n return false;\n }\n}\n\nexport class FlexFormBase$1 {\n constructor(submit, cancel) {\n this.submit = submit;\n this.cancel = cancel;\n this[\"State@\"] = (new FlexFormState(0, []));\n this[\"SubmitCaption@\"] = \"Submit\";\n this[\"CancelCaption@\"] = \"Cancel\";\n }\n}\n\nexport function FlexFormBase$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.FlexFormBase`1\", [gen0], FlexFormBase$1);\n}\n\nexport function FlexFormBase$1_$ctor_Z285F6596(submit, cancel) {\n return new FlexFormBase$1(submit, cancel);\n}\n\nexport function FlexFormBase$1__get_State(__) {\n return __[\"State@\"];\n}\n\nexport function FlexFormBase$1__set_State_Z3615493C(__, v) {\n __[\"State@\"] = v;\n}\n\nexport function FlexFormBase$1__get_SubmitCaption(__) {\n return __[\"SubmitCaption@\"];\n}\n\nexport function FlexFormBase$1__set_SubmitCaption_Z721C83C5(__, v) {\n __[\"SubmitCaption@\"] = v;\n}\n\nexport function FlexFormBase$1__get_CancelCaption(__) {\n return __[\"CancelCaption@\"];\n}\n\nexport function FlexFormBase$1__set_CancelCaption_Z721C83C5(__, v) {\n __[\"CancelCaption@\"] = v;\n}\n\nexport function FlexFormBase$1__TriggerSubmit_2B595(this$, value) {\n const matchValue = this$[\"Omnicv.Client.Common.Components.FlexForm.FlexFormBase`1.CanSubmit2B595\"](value);\n switch (matchValue.tag) {\n case 2: {\n break;\n }\n case 1: {\n if (window.confirm(`Are you sure you want to submit? Warnings:\n${matchValue.fields[0]}`)) {\n this$.submit(value);\n }\n break;\n }\n default:\n this$.submit(value);\n }\n}\n\nexport function FlexFormBase$1__SetState(this$, isLoading, errorOpt) {\n if (isLoading) {\n FlexFormBase$1__set_State_Z3615493C(this$, new FlexFormState(1, []));\n }\n else {\n FlexFormBase$1__SetErrorOpt_6DFDD678(this$, errorOpt);\n }\n}\n\nexport function FlexFormBase$1__SetErrorOpt_6DFDD678(this$, value) {\n if (value == null) {\n }\n else {\n FlexFormBase$1__set_State_Z3615493C(this$, new FlexFormState(2, [value]));\n }\n}\n\nexport function FlexFormBase$1__Render_2B595(this$, value) {\n const isInProgress = FlexFormState__IsInProgress(FlexFormBase$1__get_State(this$));\n const buttons = toList(delay(() => {\n const cannotSubmit = FieldValidationResult__IsErrorResult(this$[\"Omnicv.Client.Common.Components.FlexForm.FlexFormBase`1.CanSubmit2B595\"](value));\n return singleton(div(singleton_1(new Option_10(4, [])), toList(delay(() => append(singleton(div_1(empty(), singleton_1(button(ofArray([new Option_6(0, [new Color_IColor(4, [])]), new Option_6(16, [cannotSubmit ? true : isInProgress]), new Option_6(18, [(arg_1) => {\n ((event) => {\n event.preventDefault();\n FlexFormBase$1__TriggerSubmit_2B595(this$, value);\n })(arg_1);\n }])]), singleton_1(FlexFormBase$1__get_SubmitCaption(this$)))))), delay(() => ((this$.cancel != null) ? singleton(div_1(empty(), singleton_1(button(ofArray([new Option_6(0, [new Color_IColor(9, [])]), new Option_6(16, [isInProgress]), new Option_6(18, [(arg_2) => {\n arg_2.preventDefault();\n value_15(this$.cancel)();\n }])]), singleton_1(FlexFormBase$1__get_CancelCaption(this$)))))) : empty_1())))))));\n }));\n const children = append_1(this$[\"Omnicv.Client.Common.Components.FlexForm.FlexFormBase`1.RenderFields\"](isInProgress, value), buttons);\n return react.createElement(\"form\", {}, ...children);\n}\n\nexport class FlexForm$1 extends FlexFormBase$1 {\n constructor(onChange, submit, cancel) {\n super(submit, cancel);\n this[\"Fields@\"] = FlexFormFields$1_$ctor_Z63A200CD(onChange);\n }\n \"Omnicv.Client.Common.Components.FlexForm.FlexFormBase`1.RenderFields\"(isDisabled, value) {\n const this$ = this;\n return FlexFormFields$1__Render(FlexForm$1__get_Fields(this$), isDisabled, value);\n }\n \"Omnicv.Client.Common.Components.FlexForm.FlexFormBase`1.CanSubmit2B595\"(value) {\n const this$ = this;\n return !FlexFormState__CanSubmit(FlexFormBase$1__get_State(this$)) ? (new FieldValidationResult(2, [`State ${FlexFormBase$1__get_State(this$)} does not allow submit`])) : FlexFormFields$1__CanSubmit_2B595(FlexForm$1__get_Fields(this$), value);\n }\n}\n\nexport function FlexForm$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.FlexForm`1\", [gen0], FlexForm$1, FlexFormBase$1_$reflection(gen0));\n}\n\nexport function FlexForm$1_$ctor_2ABDDB55(onChange, submit, cancel) {\n return new FlexForm$1(onChange, submit, cancel);\n}\n\nexport function FlexForm$1__get_Fields(__) {\n return __[\"Fields@\"];\n}\n\nexport class FlexFormTuple$2 extends FlexFormBase$1 {\n constructor(onChangeFst, onChangeSnd, submit, cancel) {\n super(submit, cancel);\n let f2, objectArg, f2_1, objectArg_1;\n this.allFields = [];\n this[\"FieldsFst@\"] = FlexFormFields$1_$ctor_Z63A200CD(onChangeFst, (f2 = ((objectArg = this.allFields, (item) => {\n void (objectArg.push(item));\n })), (arg) => {\n f2(new FSharpChoice$2(0, [arg]));\n }));\n this[\"FieldsSnd@\"] = FlexFormFields$1_$ctor_Z63A200CD(onChangeSnd, (f2_1 = ((objectArg_1 = this.allFields, (item_1) => {\n void (objectArg_1.push(item_1));\n })), (arg_1) => {\n f2_1(new FSharpChoice$2(1, [arg_1]));\n }));\n }\n \"Omnicv.Client.Common.Components.FlexForm.FlexFormBase`1.RenderFields\"(isDisabled, value) {\n const this$ = this;\n return ofSeq_1(map_2((field) => {\n if (field.tag === 1) {\n return field.fields[0].Render(isDisabled, value[1]);\n }\n else {\n return field.fields[0].Render(isDisabled, value[0]);\n }\n }, this$.allFields));\n }\n \"Omnicv.Client.Common.Components.FlexForm.FlexFormBase`1.CanSubmit2B595\"(value) {\n const this$ = this;\n return !FlexFormState__CanSubmit(FlexFormBase$1__get_State(this$)) ? (new FieldValidationResult(2, [`State ${FlexFormBase$1__get_State(this$)} does not allow submit`])) : FieldValidationResult__Merge_30561432(FlexFormFields$1__CanSubmit_2B595(FlexFormTuple$2__get_FieldsFst(this$), value[0]), FlexFormFields$1__CanSubmit_2B595(FlexFormTuple$2__get_FieldsSnd(this$), value[1]));\n }\n}\n\nexport function FlexFormTuple$2_$reflection(gen0, gen1) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.FlexFormTuple`2\", [gen0, gen1], FlexFormTuple$2, FlexFormBase$1_$reflection(tuple_type(gen0, gen1)));\n}\n\nexport function FlexFormTuple$2_$ctor_5AE4FFF0(onChangeFst, onChangeSnd, submit, cancel) {\n return new FlexFormTuple$2(onChangeFst, onChangeSnd, submit, cancel);\n}\n\nexport function FlexFormTuple$2__get_FieldsFst(__) {\n return __[\"FieldsFst@\"];\n}\n\nexport function FlexFormTuple$2__get_FieldsSnd(__) {\n return __[\"FieldsSnd@\"];\n}\n\nexport function noValidation(_arg) {\n return undefined;\n}\n\nfunction renderCurrentEventInfoDetails(_arg, eventInfo) {\n const smallText = (isBold, text) => Text_span(singleton_1(new Common_GenericOption(2, [toList(delay(() => append(singleton(new Modifier_IModifier(3, [new Screen(0, []), new TextSize_Option(6, [])])), delay(() => (isBold ? singleton(new Modifier_IModifier(2, [new TextWeight_Option(3, [])])) : singleton(new Modifier_IModifier(7, [new TextTransform_Option(3, [])])))))))])), singleton_1(text));\n const space = () => Text_span(empty(), singleton_1(\" \"));\n return container(singleton_1(new Option_12(5, [singleton_1(new Modifier_IModifier(31, [new FlexWrap_Option(1, [])]))])), toList(delay(() => append(singleton(smallText(true, \"TZ\")), delay(() => append(singleton(space()), delay(() => append(singleton(smallText(false, EventInfo__DisplayTimeZone(eventInfo))), delay(() => append(singleton(space()), delay(() => {\n let clientDate;\n const currentTz = common.getTimezoneName();\n const clientTz = EventInfo__GetClientTz(eventInfo);\n let result;\n if ((clientTz != null) && (currentTz !== value_15(clientTz))) {\n const arg_1 = value_15(clientTz);\n result = common.dateToLuxonTz(eventInfo.EventTimestamp, arg_1);\n }\n else {\n result = common.dateToLuxonTz(eventInfo.EventTimestamp, currentTz);\n }\n clientDate = result.toRFC2822();\n let locationDate;\n const locationTz = EventInfo__GetLocationTz(eventInfo);\n if (locationTz != null) {\n let result_1;\n const arg_5 = value_15(locationTz);\n result_1 = common.dateToLuxonTz(eventInfo.EventTimestamp, arg_5);\n locationDate = result_1.toRFC2822();\n }\n else {\n locationDate = undefined;\n }\n return append((clientDate != null) ? append(singleton(smallText(false, value_15(clientDate))), delay(() => singleton(space()))) : empty_1(), delay(() => append((!equals(locationDate, clientDate) && (locationDate != null)) ? append((clientDate != null) ? append(singleton(smallText(false, \"/\")), delay(() => singleton(space()))) : empty_1(), delay(() => append(singleton(smallText(false, value_15(locationDate))), delay(() => singleton(space()))))) : empty_1(), delay(() => append(singleton(smallText(true, \"Loc\")), delay(() => append(singleton(space()), delay(() => {\n const location = StringBuilder_$ctor();\n return append((eventInfo.PlaceName != null) ? ((void StringBuilder__Append_Z721C83C5(location, value_15(eventInfo.PlaceName)), empty_1())) : empty_1(), delay(() => append(((eventInfo.Latitude != null) && (eventInfo.Longitude != null)) ? append((StringBuilder__get_Length(location) > 0) ? ((void StringBuilder__Append_Z721C83C5(location, \" | \"), empty_1())) : empty_1(), delay(() => {\n StringBuilder__Append_Z721C83C5(StringBuilder__Append_Z721C83C5(location, format(\"Lat: {0:0.######}\", value_15(eventInfo.Latitude))), format(\", long: {0:0.######}\", value_15(eventInfo.Longitude)));\n return empty_1();\n })) : empty_1(), delay(() => singleton(smallText(false, toString(location)))))));\n }))))))));\n })))))))))));\n}\n\nfunction renderSetStrictBounds(isDisabled, current, onChange) {\n const children_2 = toList(delay(() => append(singleton(createElement(\"strong\", {\n children: reactApi.Children.toArray([\"Strict bounds: \"]),\n })), delay(() => collect((b) => singleton(radioInline(ofArray([new Option_11(6, [current === b]), new Option_11(14, [`StrictBoundsLocation${b}`]), new Option_11(13, [`radio-StrictBoundsLocation${b}`]), new Option_11(11, [(_arg) => {\n onChange(!current);\n }]), new Option_11(7, [isDisabled])]), singleton_1(` ${b} `))), [true, false])))));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_2)),\n });\n}\n\nexport function addEventInfoToFlexForm(form, eventInfo, suggestions) {\n FlexFormFields$1__AddLocation_Z52938230(FlexFormFields$1__AddDateTime_2636DDCF(FlexFormFields$1__AddGroup_6DFDD678(FlexFormTuple$2__get_FieldsFst(form)), \"EventTimestamp\", noValidation, \"Timestamp\"), \"PlaceName\", noValidation, suggestions, (suggestion) => {\n triggerUpdateLocation(suggestion);\n }, \"Location\");\n FlexFormFields$1__AddCustom_693A43B3(FlexFormTuple$2__get_FieldsFst(form), \"Details\", renderCurrentEventInfoDetails);\n}\n\nexport function addEventInfoToFlexFormEim(form, eimModel, onStrictBoundsChange, suggestions) {\n addEventInfoToFlexForm(form, eimModel.EventInfo, suggestions);\n FlexFormFields$1__AddCustom_693A43B3(FlexFormTuple$2__get_FieldsFst(form), \"Strict boundaries\", (isDisabled, _arg) => renderSetStrictBounds(isDisabled, eimModel.StrictBounds, onStrictBoundsChange));\n}\n\nexport function getSuggestions(current, data) {\n return sortBy((value_1) => value_1.DistanceFromCurrent, List_distinct(filter((value) => {\n if (value.Name !== \"\") {\n return value.PlaceId !== \"\";\n }\n else {\n return false;\n }\n }, map_1((eventInfo) => {\n const position = eventInfoCoordinatesToPositionOrDefault(eventInfo);\n const distance = map((pos) => distanceInMetersBetweenPositions(position, pos), current);\n return new LocationDescriptor(defaultArg(eventInfo.PlaceId, \"\"), defaultArg(eventInfo.PlaceName, \"\"), position, distance, eventInfo.LocationTzOffsetMin);\n }, map_1((tuple) => tuple[0], data))), {\n Equals: equals,\n GetHashCode: safeHash,\n }), {\n Compare: compare,\n });\n}\n\nexport function addEventInfoWithSuggestionsToFlexForm(form, eventInfo, current, data) {\n addEventInfoToFlexForm(form, eventInfo, getSuggestions(current, data));\n}\n\nexport function addEventInfoWithOptSuggestionsToFlexForm(form, eventInfo, current, data) {\n addEventInfoWithSuggestionsToFlexForm(form, eventInfo, current, defaultArg(data, empty()));\n}\n\nexport class Formlet$1 extends Record {\n constructor(Render, CanSubmit) {\n super();\n this.Render = Render;\n this.CanSubmit = CanSubmit;\n }\n}\n\nexport function Formlet$1_$reflection(gen0) {\n return record_type(\"Omnicv.Client.Common.Components.FlexForm.Formlet`1\", [gen0], Formlet$1, () => [[\"Render\", lambda_type(bool_type, lambda_type(gen0, class_type(\"Fable.React.ReactElement\", undefined)))], [\"CanSubmit\", lambda_type(gen0, FieldValidationResult_$reflection())]]);\n}\n\nexport class FlexFormWithFormlets$1 extends FlexFormBase$1 {\n constructor(formlets, submit, cancel) {\n super(submit, cancel);\n this.formlets = formlets;\n }\n \"Omnicv.Client.Common.Components.FlexForm.FlexFormBase`1.RenderFields\"(isDisabled, value) {\n const this$ = this;\n return map_1((formlet) => formlet.Render(isDisabled, value), this$.formlets);\n }\n \"Omnicv.Client.Common.Components.FlexForm.FlexFormBase`1.CanSubmit2B595\"(value) {\n const this$ = this;\n return !FlexFormState__CanSubmit(FlexFormBase$1__get_State(this$)) ? (new FieldValidationResult(2, [`State ${FlexFormBase$1__get_State(this$)} does not allow submit`])) : mergeResults(map_1((formlet) => formlet.CanSubmit(value), this$.formlets));\n }\n}\n\nexport function FlexFormWithFormlets$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Common.Components.FlexForm.FlexFormWithFormlets`1\", [gen0], FlexFormWithFormlets$1, FlexFormBase$1_$reflection(gen0));\n}\n\nexport function FlexFormWithFormlets$1_$ctor_Z7DF2018A(formlets, submit, cancel) {\n return new FlexFormWithFormlets$1(formlets, submit, cancel);\n}\n\n","import { Union, Record } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { ContactData as ContactData_1, ContactData_$reflection } from \"../Omnicv.Shared/API.js\";\nimport { union_type, class_type, unit_type, record_type, bool_type, option_type, string_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { value as value_3 } from \"../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { Cmd_OfPromise_either, Cmd_none } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { curry2 } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { anonService } from \"../Omnicv.Client.Common/CommonServer.js\";\nimport { Config_variable } from \"../Omnicv.Client.Common/Extensions.js\";\nimport { exnToDisplayString } from \"../Omnicv.Client.Common/Utils.js\";\nimport { isNullOrWhiteSpace } from \"../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { FlexFormBase$1__Render_2B595, FlexFormBase$1__SetState, FlexFormFields$1__AddTextArea_Z44011C05, FlexForm$1__get_Fields, FlexFormFields$1__AddText_Z44011C05, FlexForm$1_$ctor_2ABDDB55 } from \"../Omnicv.Client.Common/Components/FlexForm.js\";\nimport { createElement } from \"react\";\nimport { ofArray } from \"../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { reactApi } from \"../fable_modules/Feliz.2.9.0/Interop.fs.js\";\n\nexport class Model extends Record {\n constructor(ContactData, RecaptchaToken, IsRecaptchaReady, LoggedIn, Error$, ContactSent, IsLoading) {\n super();\n this.ContactData = ContactData;\n this.RecaptchaToken = RecaptchaToken;\n this.IsRecaptchaReady = IsRecaptchaReady;\n this.LoggedIn = LoggedIn;\n this.Error = Error$;\n this.ContactSent = ContactSent;\n this.IsLoading = IsLoading;\n }\n}\n\nexport function Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.ContactForm.Component.Model\", [], Model, () => [[\"ContactData\", ContactData_$reflection()], [\"RecaptchaToken\", option_type(string_type)], [\"IsRecaptchaReady\", bool_type], [\"LoggedIn\", bool_type], [\"Error\", option_type(string_type)], [\"ContactSent\", bool_type], [\"IsLoading\", bool_type]]);\n}\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RecordUpdated\", \"RecaptchaReady\", \"Submitted\", \"RecaptchaSucceeded\", \"Succeeded\", \"Failed\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.ContactForm.Component.Msg\", [], Msg, () => [[[\"Item\", ContactData_$reflection()]], [], [], [[\"Item\", string_type]], [[\"Item\", unit_type]], [[\"Item\", class_type(\"System.Exception\")]]]);\n}\n\nexport function init(session) {\n return [new Model(new ContactData_1(\"\", (session.UserInfo != null) ? value_3(session.UserInfo).Email : \"\", \"\", undefined, \"\"), undefined, false, session.LoggedIn, undefined, false, false), Cmd_none()];\n}\n\nexport function update(session, msg, model) {\n const cmdSubmit = (model_1) => Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry2(anonService.Contact)(model_1.ContactData), model_1.RecaptchaToken, () => (new Msg(4, [undefined])), (Item_1) => (new Msg(5, [Item_1])));\n switch (msg.tag) {\n case 2:\n return [new Model(model.ContactData, model.RecaptchaToken, model.IsRecaptchaReady, model.LoggedIn, model.Error, model.ContactSent, true), session.LoggedIn ? cmdSubmit(model) : Cmd_OfPromise_either(() => {\n const action = {\n action: \"submit\",\n };\n const key = Config_variable(\"GOOGLE_RECAPTCHA_SITE_KEY\");\n return grecaptcha.execute(key, action);\n }, undefined, (Item_2) => (new Msg(3, [Item_2])), (Item_3) => (new Msg(5, [Item_3])))];\n case 1:\n return [new Model(model.ContactData, model.RecaptchaToken, true, model.LoggedIn, model.Error, model.ContactSent, model.IsLoading), Cmd_none()];\n case 3: {\n const newModel = new Model(model.ContactData, msg.fields[0], model.IsRecaptchaReady, model.LoggedIn, model.Error, model.ContactSent, model.IsLoading);\n return [newModel, cmdSubmit(newModel)];\n }\n case 4:\n return [new Model(model.ContactData, model.RecaptchaToken, model.IsRecaptchaReady, model.LoggedIn, undefined, true, model.IsLoading), Cmd_none()];\n case 5:\n return [new Model(model.ContactData, model.RecaptchaToken, model.IsRecaptchaReady, model.LoggedIn, exnToDisplayString(msg.fields[0]), false, false), Cmd_none()];\n default:\n return [new Model(msg.fields[0], model.RecaptchaToken, model.IsRecaptchaReady, model.LoggedIn, model.Error, model.ContactSent, model.IsLoading), Cmd_none()];\n }\n}\n\nfunction _nonEmpty(query) {\n if (isNullOrWhiteSpace(query) ? true : (query.trim().length < 3)) {\n return \"Search query too short\";\n }\n else {\n return undefined;\n }\n}\n\nfunction viewForm(model, dispatch) {\n const form = FlexForm$1_$ctor_2ABDDB55((arg) => {\n dispatch(new Msg(0, [arg]));\n }, (_arg) => {\n dispatch(new Msg(2, []));\n }, undefined);\n FlexFormFields$1__AddText_Z44011C05(FlexForm$1__get_Fields(form), \"Name\", _nonEmpty, \"User name\");\n if (!model.LoggedIn) {\n FlexFormFields$1__AddText_Z44011C05(FlexForm$1__get_Fields(form), \"Email\", _nonEmpty, \"Password\");\n }\n FlexFormFields$1__AddTextArea_Z44011C05(FlexFormFields$1__AddText_Z44011C05(FlexForm$1__get_Fields(form), \"Subject\", _nonEmpty, \"Remember me?\"), \"Message\", _nonEmpty, \"Remember me?\");\n FlexFormBase$1__SetState(form, model.IsLoading ? true : !model.IsRecaptchaReady, model.Error);\n return FlexFormBase$1__Render_2B595(form, model.ContactData);\n}\n\nexport function view(model, dispatch) {\n if (!model.IsRecaptchaReady) {\n grecaptcha.ready(() => {\n dispatch(new Msg(1, []));\n });\n }\n if (model.ContactSent) {\n return \"Thank you for contacting us!\";\n }\n else {\n const children = ofArray([createElement(\"p\", {\n children: \"Use this form to send us any questions, comments, bug reports or suggestions you might have\",\n }), viewForm(model, dispatch)]);\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n });\n }\n}\n\n","import { toString, Union, Record } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { AnonymousService_RouteBuilder, Request_ExternalAuthScheme, Request_Login, Response_UserInfo_$reflection, Request_Login_$reflection } from \"../Omnicv.Shared/API.js\";\nimport { union_type, class_type, record_type, string_type, bool_type, option_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { Cmd_none } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { anonService } from \"../Omnicv.Client.Common/CommonServer.js\";\nimport { RouteModule_toHash, Route, Router_newUrl } from \"../Omnicv.Client.Common/Router.js\";\nimport { exnToDisplayString } from \"../Omnicv.Client.Common/Utils.js\";\nimport { isNullOrWhiteSpace } from \"../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { FlexFormBase$1__Render_2B595, FlexFormBase$1__SetErrorOpt_6DFDD678, FlexForm$1__get_Fields, FlexFormFields$1__AddText_Z44011C05, FlexFormFields$1__AddPassword_Z44011C05, noValidation, FlexFormFields$1__AddCheckbox_264AA22A, FlexForm$1_$ctor_2ABDDB55 } from \"../Omnicv.Client.Common/Components/FlexForm.js\";\nimport { empty as empty_1, singleton, append, delay, toList } from \"../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Config_variable } from \"../Omnicv.Client.Common/Extensions.js\";\nimport { Option, button } from \"../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { Size_ISize, Color_IColor } from \"../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { singleton as singleton_1, empty, ofArray } from \"../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { icon } from \"../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport { Fa_IconOption, Fa_i } from \"../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { createElement } from \"react\";\nimport { reactApi } from \"../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { h2 } from \"../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\n\nexport class Model extends Record {\n constructor(Request, Response, IsLoading, Error$) {\n super();\n this.Request = Request;\n this.Response = Response;\n this.IsLoading = IsLoading;\n this.Error = Error$;\n }\n}\n\nexport function Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Login.Component.Model\", [], Model, () => [[\"Request\", Request_Login_$reflection()], [\"Response\", option_type(Response_UserInfo_$reflection())], [\"IsLoading\", bool_type], [\"Error\", option_type(string_type)]]);\n}\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RecordUpdated\", \"LogInSubmitted\", \"LogInSucceeded\", \"LogInFailed\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Login.Component.Msg\", [], Msg, () => [[[\"Item\", Request_Login_$reflection()]], [], [[\"Item\", Response_UserInfo_$reflection()]], [[\"Item\", class_type(\"System.Exception\")]]]);\n}\n\nexport function init() {\n return [new Model(new Request_Login(\"\", \"\", false), undefined, false, undefined), Cmd_none()];\n}\n\nexport function update(msg, model) {\n switch (msg.tag) {\n case 1:\n return [new Model(model.Request, model.Response, true, model.Error), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, anonService.Login, model.Request, (Item) => (new Msg(2, [Item])), (Item_1) => (new Msg(3, [Item_1])))];\n case 2:\n return [new Model(model.Request, msg.fields[0], false, model.Error), Router_newUrl(new Route(0, []))];\n case 3:\n return [new Model(model.Request, undefined, false, exnToDisplayString(msg.fields[0])), Cmd_none()];\n default:\n return [new Model(msg.fields[0], model.Response, model.IsLoading, model.Error), Cmd_none()];\n }\n}\n\nfunction _nonEmpty(query) {\n if (isNullOrWhiteSpace(query) ? true : (query.trim().length < 3)) {\n return \"Search query too short\";\n }\n else {\n return undefined;\n }\n}\n\nfunction viewForm(model, dispatch) {\n const form = FlexForm$1_$ctor_2ABDDB55((arg) => {\n dispatch(new Msg(0, [arg]));\n }, (_arg) => {\n dispatch(new Msg(1, []));\n }, undefined);\n FlexFormFields$1__AddCheckbox_264AA22A(FlexFormFields$1__AddPassword_Z44011C05(FlexFormFields$1__AddText_Z44011C05(FlexForm$1__get_Fields(form), \"Username\", _nonEmpty, \"User name\"), \"Password\", _nonEmpty, \"Password\"), \"IsPersistent\", noValidation, \"Remember me?\");\n FlexFormBase$1__SetErrorOpt_6DFDD678(form, model.Error);\n return FlexFormBase$1__Render_2B595(form, model.Request);\n}\n\nexport function view(model, dispatch) {\n if (model.Response != null) {\n return \"Already logged in\";\n }\n else {\n const children_2 = toList(delay(() => append(!(Config_variable(\"NO_GOOGLE_AUTH\") === \"true\") ? append(singleton(button(ofArray([new Option(0, [new Color_IColor(3, [])]), new Option(16, [false]), new Option(18, [(_arg) => {\n const scheme = toString(new Request_ExternalAuthScheme());\n const location = window.location;\n const baseUrl = `${location.protocol}//${location.hostname}:${location.port}`;\n const path_2 = AnonymousService_RouteBuilder(\"\", `LoginExt?scheme=${scheme}&next=${encodeURIComponent(`${baseUrl}${AnonymousService_RouteBuilder(\"\", `OnLoginExt?final=${`${baseUrl}${RouteModule_toHash(new Route(4, []))}`}`)}`)}`);\n location.href = (`${baseUrl}${path_2}`);\n }]), new Option(1, [new Size_ISize(2, [])])]), ofArray([icon(empty(), singleton_1(Fa_i(singleton_1(new Fa_IconOption(11, [\"fab fa-google\"])), []))), createElement(\"span\", {\n children: reactApi.Children.toArray([\"Login with Google\"]),\n })]))), delay(() => append(singleton(createElement(\"hr\", {})), delay(() => singleton(h2(empty())(singleton_1(\"Login with password\"))))))) : empty_1(), delay(() => singleton(viewForm(model, dispatch))))));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_2)),\n });\n }\n}\n\n","import { Union, Record } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { StaticPage_$reflection } from \"../Omnicv.Shared/API.js\";\nimport { union_type, class_type, record_type, bool_type, string_type, option_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { anonService } from \"../Omnicv.Client.Common/CommonServer.js\";\nimport { exnToDisplayString } from \"../Omnicv.Client.Common/Utils.js\";\nimport { Cmd_none } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { singleton, append, delay, toList } from \"../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Class, closeable } from \"../Omnicv.Client.Common/Components/Notification.js\";\nimport { defaultOf } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { h1 } from \"../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { singleton as singleton_1, empty } from \"../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { content as content_1, card } from \"../fable_modules/Fulma.3.0.0/Components/Card.fs.js\";\nimport { content as content_2 } from \"../fable_modules/Fulma.3.0.0/Elements/Content.fs.js\";\nimport { createElement } from \"react\";\nimport { Markdown_ToHtml_1BFEAEDB } from \"../fable_modules/Fable.Formatting.Markdown.1.0.1/Markdown.fs.js\";\nimport { reactApi } from \"../fable_modules/Feliz.2.9.0/Interop.fs.js\";\n\nexport class Model extends Record {\n constructor(Page, Error$, InProgress) {\n super();\n this.Page = Page;\n this.Error = Error$;\n this.InProgress = InProgress;\n }\n}\n\nexport function Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.StaticPage.Component.Model\", [], Model, () => [[\"Page\", option_type(StaticPage_$reflection())], [\"Error\", option_type(string_type)], [\"InProgress\", bool_type]]);\n}\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Succeeded\", \"Failed\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.StaticPage.Component.Msg\", [], Msg, () => [[[\"Item\", StaticPage_$reflection()]], [[\"Item\", class_type(\"System.Exception\")]]]);\n}\n\nexport function init(path) {\n return [new Model(undefined, undefined, false), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, anonService.GetStaticPage, path, (Item) => (new Msg(0, [Item])), (Item_1) => (new Msg(1, [Item_1])))];\n}\n\nexport function update(msg, model) {\n if (msg.tag === 1) {\n return [new Model(undefined, exnToDisplayString(msg.fields[0]), false), Cmd_none()];\n }\n else {\n return [new Model(msg.fields[0], model.Error, false), Cmd_none()];\n }\n}\n\nexport function view(model, dispatch) {\n const children = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton(closeable(`Can't fetch information: ${matchValue}`, new Class(4, []))) : singleton(defaultOf())), delay(() => {\n const matchValue_1 = model.Page;\n if (matchValue_1 != null) {\n const value = matchValue_1;\n return append(singleton(h1(empty())(singleton_1(value.Title))), delay(() => singleton(card(empty(), singleton_1(content_1(empty(), singleton_1(content_2(empty(), singleton_1(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(value.Body),\n },\n }))))))))));\n }\n else {\n return singleton(createElement(\"i\", {\n children: [\"Loading...\"],\n }));\n }\n }));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n });\n}\n\n","import { toString, Union, Record } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { Response_validateFullName, Response_validateDateOfBirth, Response_ProfileInfo_Default, Response_ProfileInfo_$reflection, Response_UserInfo_$reflection } from \"../Omnicv.Shared/API.js\";\nimport { union_type, unit_type, int32_type, class_type, record_type, bool_type, string_type, option_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { Cmd_none } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { commonAuthService } from \"../Omnicv.Client.Common/CommonServer.js\";\nimport { ofArray, empty, singleton } from \"../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { stringToEnum, exnToDisplayString } from \"../Omnicv.Client.Common/Utils.js\";\nimport { empty as empty_1, map, singleton as singleton_1, append, delay, toList } from \"../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Class, closeable } from \"../Omnicv.Client.Common/Components/Notification.js\";\nimport { defaultOf } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { Icons, Session__GetCurrentProfileId } from \"../Omnicv.Client.Common/SharedView.js\";\nimport { Option, h2, h1 } from \"../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { Footer_div, footer, content, Header_icon, Header_Title_Option, Header_title, header, card } from \"../fable_modules/Fulma.3.0.0/Components/Card.fs.js\";\nimport { Fa_IconOption, Fa_i } from \"../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { content as content_1 } from \"../fable_modules/Fulma.3.0.0/Elements/Content.fs.js\";\nimport { columns } from \"../fable_modules/Fulma.3.0.0/Layouts/Columns.fs.js\";\nimport { column } from \"../fable_modules/Fulma.3.0.0/Layouts/Column.fs.js\";\nimport { int32ToString } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { toString as toString_1, fromDateTime } from \"../fable_modules/fable-library-js.4.24.0/DateOnly.js\";\nimport { Option as Option_1, button, list } from \"../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { Size_ISize, Color_IColor } from \"../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { Option as Option_2, icon } from \"../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport { Fa_i as Fa_i_1 } from \"../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { Icons__ToIcon } from \"../Omnicv.Client.Common/SharedView.js\";\nimport { Router_newUrl, Route, Router_modifyLocation } from \"../Omnicv.Client.Common/Router.js\";\nimport { createElement } from \"react\";\nimport { reactApi } from \"../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { value as value_2 } from \"../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { FlexFormBase$1__Render_2B595, FlexForm$1__get_Fields, FlexFormFields$1__AddDate_2636DDCF, FlexFormFields$1__AddSelection_158231B6, FlexFormFields$1__AddCheckbox_264AA22A, FlexFormFields$1__AddText_Z44011C05, FlexForm$1_$ctor_2ABDDB55 } from \"../Omnicv.Client.Common/Components/FlexForm.js\";\n\nexport class ViewProfile_Model extends Record {\n constructor(UserInfo, Error$, InProgress) {\n super();\n this.UserInfo = UserInfo;\n this.Error = Error$;\n this.InProgress = InProgress;\n }\n}\n\nexport function ViewProfile_Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.MyProfile.Component.ViewProfile.Model\", [], ViewProfile_Model, () => [[\"UserInfo\", option_type(Response_UserInfo_$reflection())], [\"Error\", option_type(string_type)], [\"InProgress\", bool_type]]);\n}\n\nexport class ViewProfile_Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"ReloadClicked\", \"Succeeded\", \"Failed\", \"Delete\", \"DeleteSucceeded\", \"SetCurrentProfile\"];\n }\n}\n\nexport function ViewProfile_Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.MyProfile.Component.ViewProfile.Msg\", [], ViewProfile_Msg, () => [[], [[\"Item\", Response_UserInfo_$reflection()]], [[\"Item\", class_type(\"System.Exception\")]], [[\"Item\", int32_type]], [[\"Item\", unit_type]], [[\"Item\", int32_type]]]);\n}\n\nexport function ViewProfile_init(session) {\n return [new ViewProfile_Model(session.UserInfo, undefined, false), Cmd_none()];\n}\n\nexport function ViewProfile_update(msg, model) {\n switch (msg.tag) {\n case 1:\n return [new ViewProfile_Model(msg.fields[0], model.Error, false), Cmd_none()];\n case 3:\n return [new ViewProfile_Model(model.UserInfo, model.Error, true), Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, commonAuthService.DeleteProfile, msg.fields[0], () => (new ViewProfile_Msg(4, [undefined])), (Item_3) => (new ViewProfile_Msg(2, [Item_3])))];\n case 4:\n return [new ViewProfile_Model(model.UserInfo, model.Error, true), singleton((dispatch) => {\n dispatch(new ViewProfile_Msg(0, []));\n })];\n case 5:\n return [model, Cmd_none()];\n case 2:\n return [new ViewProfile_Model(undefined, exnToDisplayString(msg.fields[0]), false), Cmd_none()];\n default:\n return [new ViewProfile_Model(model.UserInfo, model.Error, true), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, commonAuthService.GetUserInfo, undefined, (Item) => (new ViewProfile_Msg(1, [Item])), (Item_1) => (new ViewProfile_Msg(2, [Item_1])))];\n }\n}\n\nexport function ViewProfile_view(session, model, dispatch) {\n const children_8 = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't fetch profile ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => {\n let matchValue_1, userInfo, currentProfileId;\n return append((matchValue_1 = model.UserInfo, (matchValue_1 != null) ? ((userInfo = matchValue_1, (currentProfileId = (Session__GetCurrentProfileId(session) | 0), append(singleton_1(h1(empty())(singleton(\"Your profile\"))), delay(() => append(singleton_1(h2(singleton(new Option(6, [])))(singleton(userInfo.Name))), delay(() => append(singleton_1(card(empty(), ofArray([header(empty(), singleton(Header_title(singleton(new Header_Title_Option(0, [])), singleton(\"Main user info\")))), header(empty(), ofArray([Header_icon(empty(), singleton(Fa_i(singleton(new Fa_IconOption(11, [\"fas fa-user-alt\"])), []))), Header_title(empty(), singleton(userInfo.Name))])), content(empty(), singleton(content_1(empty(), ofArray([columns(empty(), ofArray([column(empty(), singleton(\"Id:\")), column(empty(), singleton(int32ToString(userInfo.Id)))])), columns(empty(), ofArray([column(empty(), singleton(\"Email:\")), column(empty(), singleton(userInfo.Email))]))]))))]))), delay(() => map((profile) => {\n let copyOfStruct;\n return card(empty(), ofArray([header(empty(), ofArray([Header_icon(empty(), singleton(Fa_i(singleton(new Fa_IconOption(11, [\"fas fa-user-friends\"])), []))), Header_title(singleton(new Header_Title_Option(0, [])), singleton(`Profile ${profile.FullName}`))])), content(empty(), singleton(content_1(empty(), ofArray([columns(empty(), ofArray([column(empty(), singleton(\"Id:\")), column(empty(), singleton(int32ToString(profile.Id)))])), columns(empty(), ofArray([column(empty(), singleton(\"Primary:\")), column(empty(), singleton(toString(profile.IsPrimary)))])), columns(empty(), ofArray([column(empty(), singleton(\"Date of birth:\")), column(empty(), singleton((copyOfStruct = fromDateTime(profile.DateOfBirth), toString_1(copyOfStruct))))]))])))), footer(empty(), singleton(Footer_div(empty(), singleton(list(empty(), toList(delay(() => append((currentProfileId !== profile.Id) ? singleton_1(button(ofArray([new Option_1(0, [new Color_IColor(5, [])]), new Option_1(16, [model.InProgress]), new Option_1(5, []), new Option_1(18, [(_arg) => {\n dispatch(new ViewProfile_Msg(5, [profile.Id]));\n }])]), singleton(icon(singleton(new Option_2(0, [new Size_ISize(0, [])])), singleton(Fa_i_1(singleton(Icons__ToIcon(new Icons(11, []))), [])))))) : empty_1(), delay(() => append(singleton_1(button(ofArray([new Option_1(0, [new Color_IColor(4, [])]), new Option_1(16, [model.InProgress]), new Option_1(5, []), new Option_1(18, [(_arg_1) => {\n Router_modifyLocation(new Route(6, [profile.Id]));\n }])]), singleton(icon(singleton(new Option_2(0, [new Size_ISize(0, [])])), singleton(Fa_i_1(singleton(Icons__ToIcon(new Icons(4, []))), [])))))), delay(() => singleton_1(button(ofArray([new Option_1(0, [new Color_IColor(8, [])]), new Option_1(16, [model.InProgress]), new Option_1(5, []), new Option_1(18, [(_arg_2) => {\n if (window.confirm(`${\"Confirm deletion\"}:\n${\"Are you sure you want to delete this profile?\"}`)) {\n (() => {\n dispatch(new ViewProfile_Msg(3, [profile.Id]));\n })();\n }\n }])]), singleton(icon(singleton(new Option_2(0, [new Size_ISize(0, [])])), singleton(Fa_i_1(singleton(Icons__ToIcon(new Icons(2, []))), [])))))))))))))))))]));\n }, userInfo.Profiles)))))))))) : singleton_1(createElement(\"i\", {\n children: [\"Not loaded\"],\n }))), delay(() => singleton_1(list(empty(), ofArray([button(ofArray([new Option_1(0, [new Color_IColor(6, [])]), new Option_1(16, [model.InProgress]), new Option_1(18, [(_arg_3) => {\n dispatch(new ViewProfile_Msg(0, []));\n }])]), toList(delay(() => (model.InProgress ? singleton_1(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Loading...\"]),\n })) : singleton_1(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Reload\"]),\n })))))), button(ofArray([new Option_1(0, [new Color_IColor(9, [])]), new Option_1(16, [model.InProgress]), new Option_1(18, [(_arg_4) => {\n Router_modifyLocation(new Route(5, []));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"New profile\"]),\n }))), button(ofArray([new Option_1(0, [new Color_IColor(9, [])]), new Option_1(16, [model.InProgress])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Edit user information\"]),\n })))])))));\n }));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_8)),\n });\n}\n\nexport class AddEditProfile_Model extends Record {\n constructor(ProfileInfo, Error$, InProgress) {\n super();\n this.ProfileInfo = ProfileInfo;\n this.Error = Error$;\n this.InProgress = InProgress;\n }\n}\n\nexport function AddEditProfile_Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.MyProfile.Component.AddEditProfile.Model\", [], AddEditProfile_Model, () => [[\"ProfileInfo\", option_type(Response_ProfileInfo_$reflection())], [\"Error\", option_type(string_type)], [\"InProgress\", bool_type]]);\n}\n\nexport class AddEditProfile_Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Request\", \"RequestSucceeded\", \"RecordUpdated\", \"AddSucceeded\", \"EditSucceeded\", \"Submit\", \"Failure\"];\n }\n}\n\nexport function AddEditProfile_Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.MyProfile.Component.AddEditProfile.Msg\", [], AddEditProfile_Msg, () => [[[\"Item\", int32_type]], [[\"Item\", Response_ProfileInfo_$reflection()]], [[\"Item\", Response_ProfileInfo_$reflection()]], [[\"Item\", int32_type]], [[\"Item\", unit_type]], [], [[\"Item\", class_type(\"System.Exception\")]]]);\n}\n\nexport function AddEditProfile_initNew() {\n return [new AddEditProfile_Model(Response_ProfileInfo_Default(), undefined, false), Cmd_none()];\n}\n\nexport function AddEditProfile_initEdit(id) {\n return [new AddEditProfile_Model(undefined, undefined, false), singleton((dispatch) => {\n dispatch(new AddEditProfile_Msg(0, [id]));\n })];\n}\n\nexport function AddEditProfile_update(msg, model) {\n switch (msg.tag) {\n case 0:\n return [new AddEditProfile_Model(model.ProfileInfo, model.Error, true), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, commonAuthService.GetProfile, msg.fields[0], (Item) => (new AddEditProfile_Msg(1, [Item])), (Item_1) => (new AddEditProfile_Msg(6, [Item_1])))];\n case 1:\n return [new AddEditProfile_Model(msg.fields[0], model.Error, false), Cmd_none()];\n case 5: {\n const profile = value_2(model.ProfileInfo);\n return [new AddEditProfile_Model(model.ProfileInfo, model.Error, true), (profile.Id > 0) ? Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, commonAuthService.EditProfile, profile, () => (new AddEditProfile_Msg(4, [undefined])), (Item_3) => (new AddEditProfile_Msg(6, [Item_3]))) : Cmd_OfAsyncWith_either((x_2) => {\n Cmd_OfAsync_start(x_2);\n }, commonAuthService.AddProfile, profile, (Item_4) => (new AddEditProfile_Msg(3, [Item_4])), (Item_5) => (new AddEditProfile_Msg(6, [Item_5])))];\n }\n case 3:\n return [new AddEditProfile_Model(model.ProfileInfo, model.Error, false), Router_newUrl(new Route(4, []))];\n case 4:\n return [new AddEditProfile_Model(model.ProfileInfo, model.Error, false), Router_newUrl(new Route(4, []))];\n case 6:\n return [new AddEditProfile_Model(model.ProfileInfo, exnToDisplayString(msg.fields[0]), false), Cmd_none()];\n default:\n return [new AddEditProfile_Model(msg.fields[0], model.Error, model.InProgress), Cmd_none()];\n }\n}\n\nfunction AddEditProfile_noValidation(_arg) {\n return undefined;\n}\n\nconst AddEditProfile_genders = ofArray([[0, \"Male\"], [1, \"Female\"], [2, \"Other\"]]);\n\nconst AddEditProfile_stringToGender = (value) => stringToEnum(AddEditProfile_genders, value);\n\nexport function AddEditProfile_view(model, dispatch) {\n const children = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't manage profile ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => {\n if (model.ProfileInfo != null) {\n const profile = value_2(model.ProfileInfo);\n const form = FlexForm$1_$ctor_2ABDDB55((arg) => {\n dispatch(new AddEditProfile_Msg(2, [arg]));\n }, (_arg_1) => {\n dispatch(new AddEditProfile_Msg(5, []));\n }, () => {\n Router_modifyLocation(new Route(4, []));\n });\n FlexFormFields$1__AddText_Z44011C05(FlexFormFields$1__AddCheckbox_264AA22A(FlexFormFields$1__AddSelection_158231B6(FlexFormFields$1__AddDate_2636DDCF(FlexFormFields$1__AddText_Z44011C05(FlexForm$1__get_Fields(form), \"FullName\", Response_validateFullName, \"Full name\"), \"DateOfBirth\", Response_validateDateOfBirth, \"DOB\"), \"Gender\", AddEditProfile_genders, AddEditProfile_stringToGender, AddEditProfile_noValidation), \"IsPrimary\", AddEditProfile_noValidation, \"Primary?\"), \"Country_IsoCode\", AddEditProfile_noValidation, \"Country\");\n return singleton_1(FlexFormBase$1__Render_2B595(form, profile));\n }\n else {\n return singleton_1(\"Loading...\");\n }\n }));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n });\n}\n\n","import { Union, Record } from \"../../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { union_type, unit_type, int64_type, record_type, int32_type, option_type, string_type, list_type, tuple_type, class_type } from \"../../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { EventInfo_$reflection } from \"../../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { UnifiedRecord_$reflection } from \"../../Omnicv.Diary.Shared/DiaryAPI.js\";\nimport { ReminderRecord_$reflection } from \"../../Omnicv.Diary.Shared/Data.js\";\nimport { length, ofArray, singleton, empty, map, sum } from \"../../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { displayUnifiedEntries, displayReminders, diaryModule, countWordsInRecord } from \"../DiaryClientUtils.js\";\nimport { dateToStrForDiary, dateStrToDate, exnToDisplayString } from \"../../../Omnicv.Client.Common/Utils.js\";\nimport { Route, Router_newUrl, Route_$reflection } from \"../../../Omnicv.Client.Common/Router.js\";\nimport * as common from \"../../../../src/javascript/common.js\";\nimport { addDays, op_Subtraction, date as date_3, toLongDateString, compare } from \"../../../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport { FSharpResult$2 } from \"../../../fable_modules/fable-library-js.4.24.0/Result.js\";\nimport { Cmd_batch, Cmd_none } from \"../../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { Icons, Session__GetCurrentProfileId } from \"../../../Omnicv.Client.Common/SharedView.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { curry3, curry2 } from \"../../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { commonAuthService } from \"../../../Omnicv.Client.Common/CommonServer.js\";\nimport { unifiedService, reminderService } from \"../Server.js\";\nimport { Config_getUserTimeZone } from \"../../../Omnicv.Client.Common/Extensions.js\";\nimport { days } from \"../../../fable_modules/fable-library-js.4.24.0/TimeSpan.js\";\nimport { formatDistance } from \"date-fns\";\nimport { empty as empty_1, singleton as singleton_1, append, delay, toList } from \"../../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Class, closeable } from \"../../../Omnicv.Client.Common/Components/Notification.js\";\nimport { defaultOf } from \"../../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { getModuleNewDateButtons } from \"../../../Omnicv.Client.Common/ClientModule.js\";\nimport { value as value_1 } from \"../../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { Option, button } from \"../../../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { Screen, Size_ISize, Color_IColor } from \"../../../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { Option as Option_3, icon } from \"../../../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport { Fa_i } from \"../../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { Icons__ToIcon } from \"../../../Omnicv.Client.Common/SharedView.js\";\nimport { Fa_i as Fa_i_1, Fa_IconOption } from \"../../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { createElement } from \"react\";\nimport * as react from \"react\";\nimport { reactApi } from \"../../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { Option as Option_1, div } from \"../../../fable_modules/Fulma.3.0.0/Elements/Form/Control.fs.js\";\nimport { input } from \"../../../fable_modules/Fulma.3.0.0/Elements/Form/Input.fs.js\";\nimport { Option as Option_2, IInputType } from \"../../../fable_modules/Fulma.3.0.0/Elements/Form/Input.fs.js\";\nimport { Option as Option_4, columns } from \"../../../fable_modules/Fulma.3.0.0/Layouts/Columns.fs.js\";\nimport { Option as Option_5, ISize, column } from \"../../../fable_modules/Fulma.3.0.0/Layouts/Column.fs.js\";\nimport { Option as Option_6, h3, h4 } from \"../../../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\n\nexport class Model extends Record {\n constructor(Date$, Records, Reminders, Error$, PendingRequests) {\n super();\n this.Date = Date$;\n this.Records = Records;\n this.Reminders = Reminders;\n this.Error = Error$;\n this.PendingRequests = (PendingRequests | 0);\n }\n}\n\nexport function Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Diary.MainDiaryView.Component.Model\", [], Model, () => [[\"Date\", class_type(\"System.DateTime\")], [\"Records\", list_type(tuple_type(EventInfo_$reflection(), UnifiedRecord_$reflection()))], [\"Reminders\", list_type(ReminderRecord_$reflection())], [\"Error\", option_type(string_type)], [\"PendingRequests\", int32_type]]);\n}\n\nexport function Model__IsLoading(this$) {\n return this$.PendingRequests > 0;\n}\n\nexport function Model__get_WordCount(this$) {\n return sum(map((tupledArg) => countWordsInRecord(tupledArg[1]), this$.Records), {\n GetZero: () => 0,\n Add: (x, y) => (x + y),\n });\n}\n\nfunction addPendingRequest(model, requestsOpt) {\n return new Model(model.Date, model.Records, model.Reminders, model.Error, model.PendingRequests + ((requestsOpt == null) ? 1 : requestsOpt));\n}\n\nfunction pendingRequestDone(model, result) {\n return new Model(model.Date, model.Records, model.Reminders, (result.tag === 1) ? exnToDisplayString(result.fields[0]) : undefined, model.PendingRequests - 1);\n}\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RequestFetch\", \"FetchSucceeded\", \"RemindersFetchSucceeded\", \"FetchFailed\", \"Delete\", \"DeleteSucceeded\", \"MarkDismissed\", \"MarkDismissedSucceeded\", \"NavigateTo\", \"MoveToDate\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Diary.MainDiaryView.Component.Msg\", [], Msg, () => [[], [[\"Item\", list_type(tuple_type(EventInfo_$reflection(), UnifiedRecord_$reflection()))]], [[\"Item\", list_type(ReminderRecord_$reflection())]], [[\"Item\", class_type(\"System.Exception\")]], [[\"Item\", int64_type]], [[\"Item\", string_type]], [[\"Item\", int64_type]], [[\"Item\", unit_type]], [[\"Item\", Route_$reflection()]], [[\"Item\", string_type]]]);\n}\n\nexport function init(date) {\n let converted;\n const now = common.getNow();\n return [new Model((date == null) ? now : ((converted = dateStrToDate(now, date), (compare(converted, now) > 0) ? now : converted)), empty(), empty(), undefined, 0), singleton((dispatch) => {\n dispatch(new Msg(0, []));\n })];\n}\n\nexport function update(session, msg, model) {\n switch (msg.tag) {\n case 1:\n return [pendingRequestDone(new Model(model.Date, msg.fields[0], model.Reminders, model.Error, model.PendingRequests), new FSharpResult$2(0, [undefined])), Cmd_none()];\n case 2:\n return [pendingRequestDone(new Model(model.Date, model.Records, msg.fields[0], model.Error, model.PendingRequests), new FSharpResult$2(0, [undefined])), Cmd_none()];\n case 4: {\n const profileId_1 = Session__GetCurrentProfileId(session) | 0;\n return [addPendingRequest(model, undefined), Cmd_OfAsyncWith_either((x_2) => {\n Cmd_OfAsync_start(x_2);\n }, curry2(commonAuthService.DeleteRecord)(profileId_1), msg.fields[0], (Item_4) => (new Msg(5, [Item_4])), (Item_5) => (new Msg(3, [Item_5])))];\n }\n case 6: {\n const profileId_2 = Session__GetCurrentProfileId(session) | 0;\n return [addPendingRequest(model, undefined), Cmd_OfAsyncWith_either((x_3) => {\n Cmd_OfAsync_start(x_3);\n }, curry2(reminderService.MarkReminderDismissed)(profileId_2), msg.fields[0], () => (new Msg(7, [undefined])), (Item_7) => (new Msg(3, [Item_7])))];\n }\n case 5:\n case 7:\n return [pendingRequestDone(model, new FSharpResult$2(0, [undefined])), singleton((dispatch) => {\n dispatch(new Msg(0, []));\n })];\n case 3:\n return [pendingRequestDone(model, new FSharpResult$2(1, [msg.fields[0]])), Cmd_none()];\n case 8:\n return [model, Router_newUrl(msg.fields[0])];\n case 9:\n return [model, Router_newUrl(new Route(9, [msg.fields[0]]))];\n default: {\n const profileId = Session__GetCurrentProfileId(session) | 0;\n const timezone = Config_getUserTimeZone(session);\n return [addPendingRequest(model, 2), Cmd_batch(ofArray([Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry3(unifiedService.GetRecords)(profileId)(model.Date), timezone, (Item) => (new Msg(1, [Item])), (Item_1) => (new Msg(3, [Item_1]))), Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, curry3(reminderService.GetReminders)(profileId)(model.Date), timezone, (Item_2) => (new Msg(2, [Item_2])), (Item_3) => (new Msg(3, [Item_3])))]))];\n }\n }\n}\n\nexport function view(session, model, dispatch) {\n const now = common.getNow();\n const dateStr = toLongDateString(date_3(model.Date));\n const diff = days(op_Subtraction(date_3(now), date_3(model.Date))) | 0;\n const isLoading = Model__IsLoading(model);\n let countStr;\n if (isLoading) {\n countStr = \"\";\n }\n else {\n const wordCount = Model__get_WordCount(model) | 0;\n countStr = (` | ${length(model.Records)} entry(ies) | ${wordCount} words`);\n }\n const patternInput = (diff === 0) ? [\"Today\", dateStr, false] : ((diff === 1) ? [\"Yesterday\", dateStr, true] : ((diff < 0) ? [dateStr, \"Future\", false] : [dateStr, formatDistance(date_3(now), model.Date, {}), true]));\n const hasNext = patternInput[2];\n const prevDate = dateToStrForDiary(addDays(model.Date, -1));\n const nextDate = dateToStrForDiary(addDays(model.Date, 1));\n const children_10 = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't fetch diary data ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => {\n let children_4;\n const date_1 = dateToStrForDiary(model.Date);\n return append(singleton_1((children_4 = toList(delay(() => append(singleton_1(getModuleNewDateButtons(diaryModule, isLoading ? true : value_1(session.UserInfo).ReadOnly, date_1)), delay(() => append(singleton_1(button(ofArray([new Option(0, [new Color_IColor(7, [])]), new Option(16, [isLoading]), new Option(18, [(_arg) => {\n dispatch(new Msg(8, [new Route(17, [])]));\n }])]), singleton(icon(empty(), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(7, []))), [])))))), delay(() => {\n let children;\n return append(singleton_1(button(ofArray([new Option(0, [new Color_IColor(5, [])]), new Option(16, [isLoading]), new Option(18, [(_arg_1) => {\n dispatch(new Msg(0, []));\n }])]), ofArray([icon(empty(), toList(delay(() => (isLoading ? singleton_1(Fa_i(ofArray([Icons__ToIcon(new Icons(6, [])), new Fa_IconOption(12, [])]), [])) : singleton_1(Fa_i(singleton(Icons__ToIcon(new Icons(5, []))), [])))))), (children = toList(delay(() => (isLoading ? singleton_1(\"Loading...\") : singleton_1(\"Reload\")))), createElement(\"span\", {\n children: reactApi.Children.toArray(Array.from(children)),\n }))]))), delay(() => append(hasNext ? singleton_1(button(ofArray([new Option(0, [new Color_IColor(6, [])]), new Option(16, [isLoading]), new Option(18, [(_arg_2) => {\n dispatch(new Msg(9, [\"today\"]));\n }])]), ofArray([icon(empty(), singleton(Fa_i_1(singleton(new Fa_IconOption(11, [\"fas fa-calendar-check\"])), []))), createElement(\"span\", {\n children: reactApi.Children.toArray([\"Today\"]),\n })]))) : empty_1(), delay(() => singleton_1(div(ofArray([new Option_1(1, []), new Option_1(4, [\"archive-calendar\"])]), ofArray([input(ofArray([new Option_2(1, [new IInputType(3, [])]), new Option_2(12, [\"Go to date\"]), new Option_2(8, [dateToStrForDiary(model.Date)]), new Option_2(4, [isLoading]), new Option_2(13, [(event) => {\n const elem = event.target;\n const date_2 = elem.valueAsDate;\n if (!(date_2 == null) && (compare(date_3(now), date_3(date_2)) >= 0)) {\n dispatch(new Msg(9, [elem.value]));\n }\n }])])), icon(ofArray([new Option_3(0, [new Size_ISize(0, [])]), new Option_3(1, [])]), singleton(Fa_i_1(singleton(new Fa_IconOption(11, [\"fas fa-archive\"])), [])))])))))));\n })))))), react.createElement(\"div\", {\n className: \"block\",\n disabled: isLoading,\n }, ...children_4))), delay(() => append(singleton_1(columns(ofArray([new Option_4(4, []), new Option_4(1, [])]), ofArray([column(empty(), singleton(button(ofArray([new Option(0, [new Color_IColor(6, [])]), new Option(16, [isLoading]), new Option(18, [(_arg_3) => {\n dispatch(new Msg(9, [prevDate]));\n }])]), singleton(icon(empty(), singleton(Fa_i_1(singleton(new Fa_IconOption(11, [\"fas fa-angle-double-left\"])), []))))))), column(singleton(new Option_5(0, [new Screen(0, []), new ISize(21, [])])), singleton(h4(empty())(singleton(patternInput[0])))), column(empty(), singleton(button(ofArray([new Option(0, [new Color_IColor(6, [])]), new Option(16, [isLoading ? true : !hasNext]), new Option(18, [(_arg_4) => {\n dispatch(new Msg(9, [nextDate]));\n }])]), singleton(icon(empty(), singleton(Fa_i_1(singleton(new Fa_IconOption(11, [\"fas fa-angle-double-right\"])), [])))))))]))), delay(() => append(singleton_1(h3(singleton(new Option_6(6, [])))(singleton(patternInput[1] + countStr))), delay(() => {\n let children_6;\n return append(singleton_1((children_6 = displayReminders(model.Reminders, isLoading, (arg_1) => {\n dispatch(new Msg(6, [arg_1]));\n }), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_6)),\n }))), delay(() => {\n let children_8;\n return singleton_1((children_8 = displayUnifiedEntries(model.Records, isLoading, (arg) => {\n dispatch(new Msg(4, [arg]));\n }), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_8)),\n })));\n }));\n }))))));\n }));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_10)),\n });\n}\n\n","import { PageBoundary, PagingOptions_$reflection, EventInfo_$reflection, PagingOptions } from \"../../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { Record, Union } from \"../../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { class_type, option_type, int32_type, bool_type, list_type, tuple_type, record_type, union_type, string_type } from \"../../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { UnifiedRecord_$reflection } from \"../../Omnicv.Diary.Shared/DiaryAPI.js\";\nimport { curry3 } from \"../../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { unifiedService } from \"../Server.js\";\nimport { isEmpty, ofArray, singleton as singleton_1, last as last_1, empty, length } from \"../../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { Cmd_none } from \"../../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { Icons, Session__GetCurrentProfileId } from \"../../../Omnicv.Client.Common/SharedView.js\";\nimport { exnToDisplayString } from \"../../../Omnicv.Client.Common/Utils.js\";\nimport { isNullOrWhiteSpace } from \"../../../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { FlexFormBase$1__Render_2B595, FlexFormBase$1__SetState, FlexForm$1__get_Fields, FlexFormFields$1__AddText_Z44011C05, FlexForm$1_$ctor_2ABDDB55 } from \"../../../Omnicv.Client.Common/Components/FlexForm.js\";\nimport { empty as empty_1, singleton, append, delay, toList } from \"../../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Option, h3, h1 } from \"../../../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { Option as Option_1, button, list } from \"../../../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { Color_IColor } from \"../../../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { icon } from \"../../../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport { Fa_i } from \"../../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { Icons__ToIcon } from \"../../../Omnicv.Client.Common/SharedView.js\";\nimport { createElement } from \"react\";\nimport { reactApi } from \"../../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { defaultOf } from \"../../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { displayUnifiedEntries } from \"../DiaryClientUtils.js\";\n\nconst pageSize = 30;\n\nconst initPagingOptions = new PagingOptions(undefined, pageSize, false, undefined, undefined);\n\nexport class SearchType extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"ByTags\", \"General\"];\n }\n}\n\nexport function SearchType_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Diary.SearchDiaryView.Component.SearchType\", [], SearchType, () => [[[\"Item\", string_type]], []]);\n}\n\nexport class SearchQuery extends Record {\n constructor(Query) {\n super();\n this.Query = Query;\n }\n}\n\nexport function SearchQuery_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Diary.SearchDiaryView.Component.SearchQuery\", [], SearchQuery, () => [[\"Query\", string_type]]);\n}\n\nexport class Model extends Record {\n constructor(SearchType, SearchQuery, SearchResults, IsLoading, PagingOptions, TotalCount, Error$) {\n super();\n this.SearchType = SearchType;\n this.SearchQuery = SearchQuery;\n this.SearchResults = SearchResults;\n this.IsLoading = IsLoading;\n this.PagingOptions = PagingOptions;\n this.TotalCount = (TotalCount | 0);\n this.Error = Error$;\n }\n}\n\nexport function Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Diary.SearchDiaryView.Component.Model\", [], Model, () => [[\"SearchType\", SearchType_$reflection()], [\"SearchQuery\", SearchQuery_$reflection()], [\"SearchResults\", list_type(tuple_type(EventInfo_$reflection(), UnifiedRecord_$reflection()))], [\"IsLoading\", bool_type], [\"PagingOptions\", PagingOptions_$reflection()], [\"TotalCount\", int32_type], [\"Error\", option_type(string_type)]]);\n}\n\nexport function Model__FetchFunc_Z524259A4(this$, profileId) {\n const matchValue = this$.SearchType;\n if (matchValue.tag === 0) {\n return curry3(unifiedService.SearchByTags)(profileId)(matchValue.fields[0]);\n }\n else {\n return curry3(unifiedService.SearchGeneral)(profileId)(this$.SearchQuery.Query);\n }\n}\n\nexport function Model__CanLoadMore(this$) {\n if (length(this$.SearchResults) > 0) {\n return length(this$.SearchResults) === this$.PagingOptions.PageSize;\n }\n else {\n return false;\n }\n}\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RecordUpdated\", \"Submit\", \"Reload\", \"LoadMore\", \"Success\", \"SuccessMore\", \"Failure\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Diary.SearchDiaryView.Component.Msg\", [], Msg, () => [[[\"Item\", SearchQuery_$reflection()]], [], [], [], [[\"Item\", list_type(tuple_type(EventInfo_$reflection(), UnifiedRecord_$reflection()))]], [[\"Item\", list_type(tuple_type(EventInfo_$reflection(), UnifiedRecord_$reflection()))]], [[\"Item\", class_type(\"System.Exception\")]]]);\n}\n\nexport function init(session, searchType) {\n if (searchType.tag === 1) {\n return [new Model(searchType, new SearchQuery(\"\"), empty(), false, initPagingOptions, 0, undefined), Cmd_none()];\n }\n else {\n const model = new Model(searchType, new SearchQuery(\"\"), empty(), true, initPagingOptions, 0, undefined);\n return [model, Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, Model__FetchFunc_Z524259A4(model, Session__GetCurrentProfileId(session)), model.PagingOptions, (Item) => (new Msg(4, [Item])), (Item_1) => (new Msg(6, [Item_1])))];\n }\n}\n\nexport function update(session, msg, model) {\n const processSuccess = (finalRecords) => [new Model(model.SearchType, model.SearchQuery, finalRecords, false, model.PagingOptions, model.TotalCount + length(finalRecords), undefined), Cmd_none()];\n switch (msg.tag) {\n case 1: {\n const updatedModel = new Model(model.SearchType, model.SearchQuery, model.SearchResults, true, initPagingOptions, 0, model.Error);\n return [updatedModel, Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, Model__FetchFunc_Z524259A4(updatedModel, Session__GetCurrentProfileId(session)), updatedModel.PagingOptions, (Item) => (new Msg(4, [Item])), (Item_1) => (new Msg(6, [Item_1])))];\n }\n case 3: {\n const profileId_1 = Session__GetCurrentProfileId(session) | 0;\n const last = last_1(model.SearchResults)[0];\n let pagingOptions;\n const bind$0040 = model.PagingOptions;\n pagingOptions = (new PagingOptions(new PageBoundary(last.Id, last.EventTimestamp), bind$0040.PageSize, bind$0040.Ascending, bind$0040.From, bind$0040.To));\n return [new Model(model.SearchType, model.SearchQuery, model.SearchResults, true, pagingOptions, model.TotalCount, model.Error), Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, Model__FetchFunc_Z524259A4(model, profileId_1), pagingOptions, (Item_2) => (new Msg(5, [Item_2])), (Item_3) => (new Msg(6, [Item_3])))];\n }\n case 2:\n return [new Model(model.SearchType, model.SearchQuery, model.SearchResults, true, initPagingOptions, 0, undefined), Cmd_OfAsyncWith_either((x_2) => {\n Cmd_OfAsync_start(x_2);\n }, Model__FetchFunc_Z524259A4(model, Session__GetCurrentProfileId(session)), initPagingOptions, (Item_4) => (new Msg(4, [Item_4])), (Item_5) => (new Msg(6, [Item_5])))];\n case 4:\n return processSuccess(msg.fields[0]);\n case 5:\n return processSuccess(msg.fields[0]);\n case 6:\n return [new Model(model.SearchType, model.SearchQuery, model.SearchResults, false, model.PagingOptions, model.TotalCount, exnToDisplayString(msg.fields[0])), Cmd_none()];\n default:\n return [new Model(model.SearchType, msg.fields[0], model.SearchResults, model.IsLoading, model.PagingOptions, model.TotalCount, model.Error), Cmd_none()];\n }\n}\n\nfunction _validateSearchQuery(query) {\n if (isNullOrWhiteSpace(query) ? true : (query.trim().length < 3)) {\n return \"Search query too short\";\n }\n else {\n return undefined;\n }\n}\n\nfunction viewForm(model, dispatch) {\n const form = FlexForm$1_$ctor_2ABDDB55((arg) => {\n dispatch(new Msg(0, [arg]));\n }, (_arg) => {\n dispatch(new Msg(1, []));\n }, undefined);\n FlexFormFields$1__AddText_Z44011C05(FlexForm$1__get_Fields(form), \"Query\", _validateSearchQuery, \"Search query\");\n FlexFormBase$1__SetState(form, model.IsLoading, model.Error);\n return FlexFormBase$1__Render_2B595(form, model.SearchQuery);\n}\n\nexport function view(model, dispatch) {\n const elms = toList(delay(() => append((model.TotalCount > 0) ? append(singleton(h1(empty())(singleton_1(\"Search results\"))), delay(() => append(singleton(h3(singleton_1(new Option(6, [])))(singleton_1(`${length(model.SearchResults)} of ${model.TotalCount} records loaded`))), delay(() => singleton(list(empty(), toList(delay(() => append(Model__CanLoadMore(model) ? singleton(button(ofArray([new Option_1(0, [new Color_IColor(5, [])]), new Option_1(16, [model.IsLoading]), new Option_1(18, [(_arg) => {\n dispatch(new Msg(3, []));\n }])]), ofArray([icon(empty(), singleton_1(Fa_i(singleton_1(Icons__ToIcon(new Icons(7, []))), []))), createElement(\"span\", {\n children: reactApi.Children.toArray([\"Load more\"]),\n })]))) : empty_1(), delay(() => (!isEmpty(model.SearchResults) ? singleton(button(ofArray([new Option_1(0, [new Color_IColor(4, [])]), new Option_1(16, [model.IsLoading]), new Option_1(18, [(_arg_1) => {\n dispatch(new Msg(2, []));\n }])]), ofArray([icon(empty(), singleton_1(Fa_i(singleton_1(Icons__ToIcon(new Icons(5, []))), []))), createElement(\"span\", {\n children: reactApi.Children.toArray([\"Reload\"]),\n })]))) : empty_1()))))))))))) : empty_1(), delay(() => append((model.SearchType.tag === 1) ? singleton(viewForm(model, dispatch)) : singleton(defaultOf()), delay(() => {\n let children_4;\n return singleton((children_4 = displayUnifiedEntries(model.SearchResults, model.IsLoading, (value) => {\n }), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_4)),\n })));\n }))))));\n return createElement(\"div\", {\n className: \"container\",\n children: reactApi.Children.toArray(Array.from(elms)),\n });\n}\n\n","import { Record, Union } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { class_type, record_type, list_type, string_type, bool_type, option_type, union_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { update as update_1, prepareEventInfoForSubmit, Model__UpdateEventInfo_Z45EFA9A8, initCommon as initCommon_1, Msg_$reflection, Model_$reflection } from \"./EventInfoManager.js\";\nimport { empty, cons, ofArray, singleton, forAll } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { fromInt32, toInt64, compare } from \"../../fable_modules/fable-library-js.4.24.0/BigInt.js\";\nimport { EventInfo_Default_7F9DDECF, EventInfo_$reflection } from \"../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { utcNow } from \"../../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport { Cmd_none, Cmd_batch, Cmd_map } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { some } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { curry2 } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { exnToDisplayString } from \"../Utils.js\";\nimport { FlexFormBase$1__Render_2B595, FlexFormBase$1__SetState } from \"./FlexForm.js\";\nimport { div } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Control.fs.js\";\nimport { singleton as singleton_1, append, delay, toList } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Class, closeable } from \"./Notification.js\";\nimport { defaultOf } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { container } from \"../../fable_modules/Fulma.3.0.0/Layouts/Container.fs.js\";\nimport { h1 } from \"../../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { createElement } from \"react\";\n\nexport class DataExpected extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Record\", \"EditHelper\"];\n }\n}\n\nexport function DataExpected_$reflection() {\n return union_type(\"Omnicv.Client.Components.AddEditRecordFlexForm.DataExpected\", [], DataExpected, () => [[], []]);\n}\n\nexport class Model$2 extends Record {\n constructor(EIMModel, Record, EditHelperData, InProgress, Error$, DataExpected) {\n super();\n this.EIMModel = EIMModel;\n this.Record = Record;\n this.EditHelperData = EditHelperData;\n this.InProgress = InProgress;\n this.Error = Error$;\n this.DataExpected = DataExpected;\n }\n}\n\nexport function Model$2_$reflection(gen0, gen1) {\n return record_type(\"Omnicv.Client.Components.AddEditRecordFlexForm.Model`2\", [gen0, gen1], Model$2, () => [[\"EIMModel\", Model_$reflection()], [\"Record\", gen0], [\"EditHelperData\", option_type(gen1)], [\"InProgress\", bool_type], [\"Error\", option_type(string_type)], [\"DataExpected\", list_type(DataExpected_$reflection())]]);\n}\n\nfunction Model$2__IsItemReady_149A13CF(this$, dataExpectedItem) {\n if (dataExpectedItem.tag === 1) {\n return this$.EditHelperData != null;\n }\n else {\n return Model$2__IsEditing(this$);\n }\n}\n\nexport function Model$2__IsReady(this$) {\n return forAll((dataExpectedItem) => Model$2__IsItemReady_149A13CF(this$, dataExpectedItem), this$.DataExpected);\n}\n\nexport function Model$2__IsEditing(this$) {\n return compare(this$.EIMModel.EventInfo.Id, toInt64(fromInt32(0))) > 0;\n}\n\nexport class Msg$2 extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RecordAUpdated\", \"RecordBUpdated\", \"FetchSuccess\", \"FetchEditHelperDataSuccess\", \"Failure\", \"Submit\", \"SubmitSuccess\", \"EIMMsg\"];\n }\n}\n\nexport function Msg$2_$reflection(gen0, gen1) {\n return union_type(\"Omnicv.Client.Components.AddEditRecordFlexForm.Msg`2\", [gen0, gen1], Msg$2, () => [[[\"Item\", EventInfo_$reflection()]], [[\"Item\", gen0]], [[\"Item1\", EventInfo_$reflection()], [\"Item2\", gen0]], [[\"Item\", gen1]], [[\"Item\", class_type(\"System.Exception\")]], [], [[\"Item\", EventInfo_$reflection()]], [[\"Item\", Msg_$reflection()]]]);\n}\n\nfunction initCommon(id, defaultValue, dataExpected) {\n const patternInput = initCommon_1(EventInfo_Default_7F9DDECF(utcNow()));\n return [new Model$2(patternInput[0], defaultValue, undefined, id != null, undefined, dataExpected), Cmd_map((Item) => (new Msg$2(7, [Item])), patternInput[1])];\n}\n\nexport function initNew(defaultValue, fetchAction) {\n const patternInput = initCommon(undefined, defaultValue, singleton(new DataExpected(1, [])));\n const newModel = patternInput[0];\n return [new Model$2(newModel.EIMModel, newModel.Record, newModel.EditHelperData, true, newModel.Error, newModel.DataExpected), Cmd_batch(ofArray([patternInput[1], Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, fetchAction, undefined, (Item) => (new Msg$2(3, [Item])), (Item_1) => (new Msg$2(4, [Item_1])))]))];\n}\n\nexport function initEdit(recordId, defaultValue, fetchAction) {\n const patternInput = initCommon(recordId, defaultValue, singleton(new DataExpected(0, [])));\n const newModel = patternInput[0];\n return [new Model$2(newModel.EIMModel, newModel.Record, newModel.EditHelperData, true, newModel.Error, newModel.DataExpected), Cmd_batch(ofArray([patternInput[1], Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, fetchAction, recordId, (tupledArg) => (new Msg$2(2, [tupledArg[0], tupledArg[1]])), (Item_2) => (new Msg$2(4, [Item_2])))]))];\n}\n\nexport function initEditWithHelperData(recordId, defaultValue, fetchAction, fetchHelperDataAction) {\n const patternInput = initEdit(recordId, defaultValue, fetchAction);\n const newModel = patternInput[0];\n return [new Model$2(newModel.EIMModel, newModel.Record, newModel.EditHelperData, true, newModel.Error, cons(new DataExpected(1, []), newModel.DataExpected)), Cmd_batch(ofArray([patternInput[1], Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, fetchHelperDataAction, undefined, (Item) => (new Msg$2(3, [Item])), (Item_1) => (new Msg$2(4, [Item_1])))]))];\n}\n\nexport function update(session, submitAction, successAction, msg, model) {\n switch (msg.tag) {\n case 0:\n return [new Model$2(Model__UpdateEventInfo_Z45EFA9A8(model.EIMModel, msg.fields[0]), model.Record, model.EditHelperData, model.InProgress, model.Error, model.DataExpected), Cmd_none()];\n case 1:\n return [new Model$2(model.EIMModel, msg.fields[0], model.EditHelperData, model.InProgress, model.Error, model.DataExpected), Cmd_none()];\n case 2:\n return [new Model$2(Model__UpdateEventInfo_Z45EFA9A8(model.EIMModel, msg.fields[0]), msg.fields[1], model.EditHelperData, false, model.Error, model.DataExpected), Cmd_none()];\n case 3:\n return [new Model$2(model.EIMModel, model.Record, some(msg.fields[0]), false, model.Error, model.DataExpected), Cmd_none()];\n case 5:\n return [new Model$2(model.EIMModel, model.Record, model.EditHelperData, true, model.Error, model.DataExpected), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry2(submitAction)(prepareEventInfoForSubmit(session, model.EIMModel)), model.Record, (Item_1) => (new Msg$2(6, [Item_1])), (Item_2) => (new Msg$2(4, [Item_2])))];\n case 6:\n return [new Model$2(model.EIMModel, model.Record, model.EditHelperData, false, model.Error, model.DataExpected), successAction()];\n case 4:\n return [new Model$2(model.EIMModel, model.Record, model.EditHelperData, false, exnToDisplayString(msg.fields[0]), model.DataExpected), Cmd_none()];\n default: {\n const patternInput = update_1(msg.fields[0], model.EIMModel);\n return [new Model$2(patternInput[0], model.Record, model.EditHelperData, model.InProgress, model.Error, model.DataExpected), Cmd_map((Item) => (new Msg$2(7, [Item])), patternInput[1])];\n }\n }\n}\n\nexport function view(buildForm, title, model, dispatch) {\n let form_1;\n const form = buildForm(model, dispatch);\n FlexFormBase$1__SetState(form, model.InProgress, model.Error);\n form_1 = form;\n return div(empty(), toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Error: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => append(singleton_1(container(empty(), singleton(h1(empty())(singleton(title))))), delay(() => (!Model$2__IsReady(model) ? singleton_1(createElement(\"p\", {\n children: \"Loading...\",\n })) : singleton_1(FlexFormBase$1__Render_2B595(form_1, [model.EIMModel.EventInfo, model.Record])))))));\n })));\n}\n\n","import { Union, Record } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { union_type, int64_type, string_type, option_type, bool_type, record_type, lambda_type, class_type, list_type, tuple_type, int32_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { PagingOptionsModule_optionsForNextPage, PagingOptions, PagingOptionsModule_defaultPagingOptions, PagingOptionsModule_basicPagingOptions, EventInfo_$reflection, PagingOptions_$reflection } from \"../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { Router_newUrl, Route_$reflection } from \"../Router.js\";\nimport { length, append, singleton, empty } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { Cmd_none } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { curry2 } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { commonAuthService } from \"../CommonServer.js\";\nimport { Session__GetCurrentProfileId } from \"../SharedView.js\";\nimport { exnToDisplayString } from \"../Utils.js\";\n\nexport class Actions$1 extends Record {\n constructor(GetRecords) {\n super();\n this.GetRecords = GetRecords;\n }\n}\n\nexport function Actions$1_$reflection(gen0) {\n return record_type(\"Omnicv.Client.Components.ViewRecords.Actions`1\", [gen0], Actions$1, () => [[\"GetRecords\", lambda_type(int32_type, lambda_type(PagingOptions_$reflection(), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [list_type(tuple_type(EventInfo_$reflection(), gen0))])))]]);\n}\n\nexport class Model$1 extends Record {\n constructor(PageSize, Ascending, DateRange, LastFetchSize, Records, Actions, Error$, InProgress, LastPagingOptions) {\n super();\n this.PageSize = (PageSize | 0);\n this.Ascending = Ascending;\n this.DateRange = DateRange;\n this.LastFetchSize = LastFetchSize;\n this.Records = Records;\n this.Actions = Actions;\n this.Error = Error$;\n this.InProgress = InProgress;\n this.LastPagingOptions = LastPagingOptions;\n }\n}\n\nexport function Model$1_$reflection(gen0) {\n return record_type(\"Omnicv.Client.Components.ViewRecords.Model`1\", [gen0], Model$1, () => [[\"PageSize\", int32_type], [\"Ascending\", bool_type], [\"DateRange\", option_type(tuple_type(class_type(\"System.DateTime\"), class_type(\"System.DateTime\")))], [\"LastFetchSize\", option_type(int32_type)], [\"Records\", list_type(tuple_type(EventInfo_$reflection(), gen0))], [\"Actions\", Actions$1_$reflection(gen0)], [\"Error\", option_type(string_type)], [\"InProgress\", bool_type], [\"LastPagingOptions\", option_type(PagingOptions_$reflection())]]);\n}\n\nexport function Model$1__CanFetchMore(this$) {\n const matchValue = this$.LastFetchSize;\n if (matchValue != null) {\n return this$.PageSize <= matchValue;\n }\n else {\n return true;\n }\n}\n\nexport class Msg$1 extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RequestFetch\", \"RequestReload\", \"UpdateDateRange\", \"FetchSucceeded\", \"FetchFailed\", \"Delete\", \"DeleteSucceeded\", \"NavigateTo\"];\n }\n}\n\nexport function Msg$1_$reflection(gen0) {\n return union_type(\"Omnicv.Client.Components.ViewRecords.Msg`1\", [gen0], Msg$1, () => [[], [], [[\"Item1\", class_type(\"System.DateTime\")], [\"Item2\", class_type(\"System.DateTime\")]], [[\"Item\", list_type(tuple_type(EventInfo_$reflection(), gen0))]], [[\"Item\", class_type(\"System.Exception\")]], [[\"Item\", int64_type]], [[\"Item\", string_type]], [[\"Item\", Route_$reflection()]]]);\n}\n\nfunction initCommon(actions, pageSize, ascending, dateRange) {\n return [new Model$1(pageSize, ascending, dateRange, undefined, empty(), actions, undefined, false, undefined), singleton((dispatch) => {\n dispatch(new Msg$1(0, []));\n })];\n}\n\nexport function init(actions, pageSize, ascending) {\n return initCommon(actions, pageSize, ascending, undefined);\n}\n\nexport function initDateRange(actions, ascending, dateRange_, dateRange__1) {\n return initCommon(actions, 150, ascending, [dateRange_, dateRange__1]);\n}\n\nexport function update(session, msg, model) {\n switch (msg.tag) {\n case 3: {\n const result = msg.fields[0];\n let newModel;\n const Records = append(model.Records, result);\n newModel = (new Model$1(model.PageSize, model.Ascending, model.DateRange, length(result), Records, model.Actions, model.Error, false, model.LastPagingOptions));\n if ((model.DateRange != null) && Model$1__CanFetchMore(newModel)) {\n return [new Model$1(newModel.PageSize, newModel.Ascending, newModel.DateRange, newModel.LastFetchSize, newModel.Records, newModel.Actions, newModel.Error, true, newModel.LastPagingOptions), singleton((dispatch) => {\n dispatch(new Msg$1(0, []));\n })];\n }\n else {\n return [newModel, Cmd_none()];\n }\n }\n case 1:\n return [new Model$1(model.PageSize, model.Ascending, model.DateRange, undefined, empty(), model.Actions, model.Error, true, undefined), singleton((dispatch_1) => {\n dispatch_1(new Msg$1(0, []));\n })];\n case 2:\n return [new Model$1(model.PageSize, model.Ascending, [msg.fields[0], msg.fields[1]], undefined, empty(), model.Actions, model.Error, true, undefined), singleton((dispatch_2) => {\n dispatch_2(new Msg$1(0, []));\n })];\n case 5:\n return [model, Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, curry2(commonAuthService.DeleteRecord)(Session__GetCurrentProfileId(session)), msg.fields[0], (Item_2) => (new Msg$1(6, [Item_2])), (Item_3) => (new Msg$1(4, [Item_3])))];\n case 6:\n return [new Model$1(model.PageSize, model.Ascending, model.DateRange, model.LastFetchSize, empty(), model.Actions, model.Error, model.InProgress, model.LastPagingOptions), singleton((dispatch_3) => {\n dispatch_3(new Msg$1(0, []));\n })];\n case 4:\n return [new Model$1(model.PageSize, model.Ascending, model.DateRange, model.LastFetchSize, model.Records, model.Actions, exnToDisplayString(msg.fields[0]), false, model.LastPagingOptions), Cmd_none()];\n case 7:\n return [model, Router_newUrl(msg.fields[0])];\n default: {\n let pagingOptions;\n const matchValue = model.LastPagingOptions;\n if (matchValue == null) {\n let basePagingOptions;\n const matchValue_1 = model.DateRange;\n basePagingOptions = ((matchValue_1 != null) ? PagingOptionsModule_basicPagingOptions(matchValue_1[0], matchValue_1[1]) : PagingOptionsModule_defaultPagingOptions);\n pagingOptions = (new PagingOptions(basePagingOptions.LastBoundary, model.PageSize, model.Ascending, basePagingOptions.From, basePagingOptions.To));\n }\n else {\n pagingOptions = PagingOptionsModule_optionsForNextPage(model.Records, matchValue);\n }\n return [new Model$1(model.PageSize, model.Ascending, model.DateRange, model.LastFetchSize, model.Records, model.Actions, model.Error, true, pagingOptions), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry2(model.Actions.GetRecords)(Session__GetCurrentProfileId(session)), pagingOptions, (Item) => (new Msg$1(3, [Item])), (Item_1) => (new Msg$1(4, [Item_1])))];\n }\n }\n}\n\n","import { Record } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { class_type, record_type, int32_type, string_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { Convert_fromJson } from \"../fable_modules/Fable.SimpleJson.3.24.0/Json.Converter.fs.js\";\nimport { SimpleJson_parse, SimpleJson_mapKeys } from \"../fable_modules/Fable.SimpleJson.3.24.0/SimpleJson.fs.js\";\nimport { createTypeInfo } from \"../fable_modules/Fable.SimpleJson.3.24.0/TypeInfo.Converter.fs.js\";\nimport { singleton, append, map as map_1, ofArray, ofSeq, sort } from \"../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { map } from \"../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { comparePrimitives, compareArrays } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { ofSeq as ofSeq_1 } from \"../fable_modules/fable-library-js.4.24.0/Set.js\";\nimport { getItemFromDict } from \"../fable_modules/fable-library-js.4.24.0/MapUtil.js\";\nimport { valuesToSelectOptions } from \"./Utils.js\";\n\nexport class CurrencyDetails extends Record {\n constructor(Code, Symbol$, Name, SymbolNative, DecimalDigits) {\n super();\n this.Code = Code;\n this.Symbol = Symbol$;\n this.Name = Name;\n this.SymbolNative = SymbolNative;\n this.DecimalDigits = (DecimalDigits | 0);\n }\n}\n\nexport function CurrencyDetails_$reflection() {\n return record_type(\"Omnicv.Client.Common.CurrencyUtils.CurrencyDetails\", [], CurrencyDetails, () => [[\"Code\", string_type], [\"Symbol\", string_type], [\"Name\", string_type], [\"SymbolNative\", string_type], [\"DecimalDigits\", int32_type]]);\n}\n\nexport const currencyDetails = Convert_fromJson(SimpleJson_mapKeys((_arg) => {\n switch (_arg) {\n case \"symbol_native\":\n return \"SymbolNative\";\n case \"decimal_digits\":\n return \"DecimalDigits\";\n case \"name\":\n return \"Name\";\n case \"code\":\n return \"Code\";\n case \"symbol\":\n return \"Symbol\";\n default:\n return _arg;\n }\n}, (() => {\n const input = \"\\n{\\n\\t\\\"USD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"$\\\",\\n\\t\\t\\\"name\\\": \\\"US Dollar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"USD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"US dollars\\\"\\n\\t},\\n\\t\\\"CAD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"CA$\\\",\\n\\t\\t\\\"name\\\": \\\"Canadian Dollar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"CAD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Canadian dollars\\\"\\n\\t},\\n\\t\\\"EUR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"€\\\",\\n\\t\\t\\\"name\\\": \\\"Euro\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"€\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"EUR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"euros\\\"\\n\\t},\\n\\t\\\"AED\\\": {\\n\\t\\t\\\"symbol\\\": \\\"AED\\\",\\n\\t\\t\\\"name\\\": \\\"United Arab Emirates Dirham\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"د.إ.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"AED\\\",\\n\\t\\t\\\"name_plural\\\": \\\"UAE dirhams\\\"\\n\\t},\\n\\t\\\"AFN\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Af\\\",\\n\\t\\t\\\"name\\\": \\\"Afghan Afghani\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"؋\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"AFN\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Afghan Afghanis\\\"\\n\\t},\\n\\t\\\"ALL\\\": {\\n\\t\\t\\\"symbol\\\": \\\"ALL\\\",\\n\\t\\t\\\"name\\\": \\\"Albanian Lek\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Lek\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"ALL\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Albanian lekë\\\"\\n\\t},\\n\\t\\\"AMD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"AMD\\\",\\n\\t\\t\\\"name\\\": \\\"Armenian Dram\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"դր.\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"AMD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Armenian drams\\\"\\n\\t},\\n\\t\\\"ARS\\\": {\\n\\t\\t\\\"symbol\\\": \\\"AR$\\\",\\n\\t\\t\\\"name\\\": \\\"Argentine Peso\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"ARS\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Argentine pesos\\\"\\n\\t},\\n\\t\\\"AUD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"AU$\\\",\\n\\t\\t\\\"name\\\": \\\"Australian Dollar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"AUD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Australian dollars\\\"\\n\\t},\\n\\t\\\"AZN\\\": {\\n\\t\\t\\\"symbol\\\": \\\"man.\\\",\\n\\t\\t\\\"name\\\": \\\"Azerbaijani Manat\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"ман.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"AZN\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Azerbaijani manats\\\"\\n\\t},\\n\\t\\\"BAM\\\": {\\n\\t\\t\\\"symbol\\\": \\\"KM\\\",\\n\\t\\t\\\"name\\\": \\\"Bosnia-Herzegovina Convertible Mark\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"KM\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"BAM\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Bosnia-Herzegovina convertible marks\\\"\\n\\t},\\n\\t\\\"BDT\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Tk\\\",\\n\\t\\t\\\"name\\\": \\\"Bangladeshi Taka\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"৳\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"BDT\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Bangladeshi takas\\\"\\n\\t},\\n\\t\\\"BGN\\\": {\\n\\t\\t\\\"symbol\\\": \\\"BGN\\\",\\n\\t\\t\\\"name\\\": \\\"Bulgarian Lev\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"лв.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"BGN\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Bulgarian leva\\\"\\n\\t},\\n\\t\\\"BHD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"BD\\\",\\n\\t\\t\\\"name\\\": \\\"Bahraini Dinar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"د.ب.\\\",\\n\\t\\t\\\"decimal_digits\\\": 3,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"BHD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Bahraini dinars\\\"\\n\\t},\\n\\t\\\"BIF\\\": {\\n\\t\\t\\\"symbol\\\": \\\"FBu\\\",\\n\\t\\t\\\"name\\\": \\\"Burundian Franc\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"FBu\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"BIF\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Burundian francs\\\"\\n\\t},\\n\\t\\\"BND\\\": {\\n\\t\\t\\\"symbol\\\": \\\"BN$\\\",\\n\\t\\t\\\"name\\\": \\\"Brunei Dollar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"BND\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Brunei dollars\\\"\\n\\t},\\n\\t\\\"BOB\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Bs\\\",\\n\\t\\t\\\"name\\\": \\\"Bolivian Boliviano\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Bs\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"BOB\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Bolivian bolivianos\\\"\\n\\t},\\n\\t\\\"BRL\\\": {\\n\\t\\t\\\"symbol\\\": \\\"R$\\\",\\n\\t\\t\\\"name\\\": \\\"Brazilian Real\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"R$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"BRL\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Brazilian reals\\\"\\n\\t},\\n\\t\\\"BWP\\\": {\\n\\t\\t\\\"symbol\\\": \\\"BWP\\\",\\n\\t\\t\\\"name\\\": \\\"Botswanan Pula\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"P\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"BWP\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Botswanan pulas\\\"\\n\\t},\\n\\t\\\"BYN\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Br\\\",\\n\\t\\t\\\"name\\\": \\\"Belarusian Ruble\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"руб.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"BYN\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Belarusian rubles\\\"\\n\\t},\\n\\t\\\"BZD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"BZ$\\\",\\n\\t\\t\\\"name\\\": \\\"Belize Dollar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"BZD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Belize dollars\\\"\\n\\t},\\n\\t\\\"CDF\\\": {\\n\\t\\t\\\"symbol\\\": \\\"CDF\\\",\\n\\t\\t\\\"name\\\": \\\"Congolese Franc\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"FrCD\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"CDF\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Congolese francs\\\"\\n\\t},\\n\\t\\\"CHF\\\": {\\n\\t\\t\\\"symbol\\\": \\\"CHF\\\",\\n\\t\\t\\\"name\\\": \\\"Swiss Franc\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"CHF\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0.05,\\n\\t\\t\\\"code\\\": \\\"CHF\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Swiss francs\\\"\\n\\t},\\n\\t\\\"CLP\\\": {\\n\\t\\t\\\"symbol\\\": \\\"CL$\\\",\\n\\t\\t\\\"name\\\": \\\"Chilean Peso\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"CLP\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Chilean pesos\\\"\\n\\t},\\n\\t\\\"CNY\\\": {\\n\\t\\t\\\"symbol\\\": \\\"CN¥\\\",\\n\\t\\t\\\"name\\\": \\\"Chinese Yuan\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"CN¥\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"CNY\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Chinese yuan\\\"\\n\\t},\\n\\t\\\"COP\\\": {\\n\\t\\t\\\"symbol\\\": \\\"CO$\\\",\\n\\t\\t\\\"name\\\": \\\"Colombian Peso\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"COP\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Colombian pesos\\\"\\n\\t},\\n\\t\\\"CRC\\\": {\\n\\t\\t\\\"symbol\\\": \\\"₡\\\",\\n\\t\\t\\\"name\\\": \\\"Costa Rican Colón\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"₡\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"CRC\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Costa Rican colóns\\\"\\n\\t},\\n\\t\\\"CVE\\\": {\\n\\t\\t\\\"symbol\\\": \\\"CV$\\\",\\n\\t\\t\\\"name\\\": \\\"Cape Verdean Escudo\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"CV$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"CVE\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Cape Verdean escudos\\\"\\n\\t},\\n\\t\\\"CZK\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Kč\\\",\\n\\t\\t\\\"name\\\": \\\"Czech Republic Koruna\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Kč\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"CZK\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Czech Republic korunas\\\"\\n\\t},\\n\\t\\\"DJF\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Fdj\\\",\\n\\t\\t\\\"name\\\": \\\"Djiboutian Franc\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Fdj\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"DJF\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Djiboutian francs\\\"\\n\\t},\\n\\t\\\"DKK\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Dkr\\\",\\n\\t\\t\\\"name\\\": \\\"Danish Krone\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"kr\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"DKK\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Danish kroner\\\"\\n\\t},\\n\\t\\\"DOP\\\": {\\n\\t\\t\\\"symbol\\\": \\\"RD$\\\",\\n\\t\\t\\\"name\\\": \\\"Dominican Peso\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"RD$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"DOP\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Dominican pesos\\\"\\n\\t},\\n\\t\\\"DZD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"DA\\\",\\n\\t\\t\\\"name\\\": \\\"Algerian Dinar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"د.ج.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"DZD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Algerian dinars\\\"\\n\\t},\\n\\t\\\"EEK\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Ekr\\\",\\n\\t\\t\\\"name\\\": \\\"Estonian Kroon\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"kr\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"EEK\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Estonian kroons\\\"\\n\\t},\\n\\t\\\"EGP\\\": {\\n\\t\\t\\\"symbol\\\": \\\"EGP\\\",\\n\\t\\t\\\"name\\\": \\\"Egyptian Pound\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"ج.م.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"EGP\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Egyptian pounds\\\"\\n\\t},\\n\\t\\\"ERN\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Nfk\\\",\\n\\t\\t\\\"name\\\": \\\"Eritrean Nakfa\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Nfk\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"ERN\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Eritrean nakfas\\\"\\n\\t},\\n\\t\\\"ETB\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Br\\\",\\n\\t\\t\\\"name\\\": \\\"Ethiopian Birr\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Br\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"ETB\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Ethiopian birrs\\\"\\n\\t},\\n\\t\\\"GBP\\\": {\\n\\t\\t\\\"symbol\\\": \\\"£\\\",\\n\\t\\t\\\"name\\\": \\\"British Pound Sterling\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"£\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"GBP\\\",\\n\\t\\t\\\"name_plural\\\": \\\"British pounds sterling\\\"\\n\\t},\\n\\t\\\"GEL\\\": {\\n\\t\\t\\\"symbol\\\": \\\"GEL\\\",\\n\\t\\t\\\"name\\\": \\\"Georgian Lari\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"GEL\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"GEL\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Georgian laris\\\"\\n\\t},\\n\\t\\\"GHS\\\": {\\n\\t\\t\\\"symbol\\\": \\\"GH₵\\\",\\n\\t\\t\\\"name\\\": \\\"Ghanaian Cedi\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"GH₵\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"GHS\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Ghanaian cedis\\\"\\n\\t},\\n\\t\\\"GNF\\\": {\\n\\t\\t\\\"symbol\\\": \\\"FG\\\",\\n\\t\\t\\\"name\\\": \\\"Guinean Franc\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"FG\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"GNF\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Guinean francs\\\"\\n\\t},\\n\\t\\\"GTQ\\\": {\\n\\t\\t\\\"symbol\\\": \\\"GTQ\\\",\\n\\t\\t\\\"name\\\": \\\"Guatemalan Quetzal\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Q\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"GTQ\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Guatemalan quetzals\\\"\\n\\t},\\n\\t\\\"HKD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"HK$\\\",\\n\\t\\t\\\"name\\\": \\\"Hong Kong Dollar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"HKD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Hong Kong dollars\\\"\\n\\t},\\n\\t\\\"HNL\\\": {\\n\\t\\t\\\"symbol\\\": \\\"HNL\\\",\\n\\t\\t\\\"name\\\": \\\"Honduran Lempira\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"L\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"HNL\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Honduran lempiras\\\"\\n\\t},\\n\\t\\\"HRK\\\": {\\n\\t\\t\\\"symbol\\\": \\\"kn\\\",\\n\\t\\t\\\"name\\\": \\\"Croatian Kuna\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"kn\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"HRK\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Croatian kunas\\\"\\n\\t},\\n\\t\\\"HUF\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Ft\\\",\\n\\t\\t\\\"name\\\": \\\"Hungarian Forint\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Ft\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"HUF\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Hungarian forints\\\"\\n\\t},\\n\\t\\\"IDR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Rp\\\",\\n\\t\\t\\\"name\\\": \\\"Indonesian Rupiah\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Rp\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"IDR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Indonesian rupiahs\\\"\\n\\t},\\n\\t\\\"ILS\\\": {\\n\\t\\t\\\"symbol\\\": \\\"₪\\\",\\n\\t\\t\\\"name\\\": \\\"Israeli New Sheqel\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"₪\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"ILS\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Israeli new sheqels\\\"\\n\\t},\\n\\t\\\"INR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Rs\\\",\\n\\t\\t\\\"name\\\": \\\"Indian Rupee\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"টকা\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"INR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Indian rupees\\\"\\n\\t},\\n\\t\\\"IQD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"IQD\\\",\\n\\t\\t\\\"name\\\": \\\"Iraqi Dinar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"د.ع.\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"IQD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Iraqi dinars\\\"\\n\\t},\\n\\t\\\"IRR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"IRR\\\",\\n\\t\\t\\\"name\\\": \\\"Iranian Rial\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"﷼\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"IRR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Iranian rials\\\"\\n\\t},\\n\\t\\\"ISK\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Ikr\\\",\\n\\t\\t\\\"name\\\": \\\"Icelandic Króna\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"kr\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"ISK\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Icelandic krónur\\\"\\n\\t},\\n\\t\\\"JMD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"J$\\\",\\n\\t\\t\\\"name\\\": \\\"Jamaican Dollar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"JMD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Jamaican dollars\\\"\\n\\t},\\n\\t\\\"JOD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"JD\\\",\\n\\t\\t\\\"name\\\": \\\"Jordanian Dinar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"د.أ.\\\",\\n\\t\\t\\\"decimal_digits\\\": 3,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"JOD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Jordanian dinars\\\"\\n\\t},\\n\\t\\\"JPY\\\": {\\n\\t\\t\\\"symbol\\\": \\\"¥\\\",\\n\\t\\t\\\"name\\\": \\\"Japanese Yen\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"¥\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"JPY\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Japanese yen\\\"\\n\\t},\\n\\t\\\"KES\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Ksh\\\",\\n\\t\\t\\\"name\\\": \\\"Kenyan Shilling\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Ksh\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"KES\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Kenyan shillings\\\"\\n\\t},\\n\\t\\\"KHR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"KHR\\\",\\n\\t\\t\\\"name\\\": \\\"Cambodian Riel\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"៛\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"KHR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Cambodian riels\\\"\\n\\t},\\n\\t\\\"KMF\\\": {\\n\\t\\t\\\"symbol\\\": \\\"CF\\\",\\n\\t\\t\\\"name\\\": \\\"Comorian Franc\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"FC\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"KMF\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Comorian francs\\\"\\n\\t},\\n\\t\\\"KRW\\\": {\\n\\t\\t\\\"symbol\\\": \\\"₩\\\",\\n\\t\\t\\\"name\\\": \\\"South Korean Won\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"₩\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"KRW\\\",\\n\\t\\t\\\"name_plural\\\": \\\"South Korean won\\\"\\n\\t},\\n\\t\\\"KWD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"KD\\\",\\n\\t\\t\\\"name\\\": \\\"Kuwaiti Dinar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"د.ك.\\\",\\n\\t\\t\\\"decimal_digits\\\": 3,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"KWD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Kuwaiti dinars\\\"\\n\\t},\\n\\t\\\"KZT\\\": {\\n\\t\\t\\\"symbol\\\": \\\"KZT\\\",\\n\\t\\t\\\"name\\\": \\\"Kazakhstani Tenge\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"тңг.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"KZT\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Kazakhstani tenges\\\"\\n\\t},\\n\\t\\\"LBP\\\": {\\n\\t\\t\\\"symbol\\\": \\\"LB£\\\",\\n\\t\\t\\\"name\\\": \\\"Lebanese Pound\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"ل.ل.\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"LBP\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Lebanese pounds\\\"\\n\\t},\\n\\t\\\"LKR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"SLRs\\\",\\n\\t\\t\\\"name\\\": \\\"Sri Lankan Rupee\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"SL Re\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"LKR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Sri Lankan rupees\\\"\\n\\t},\\n\\t\\\"LTL\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Lt\\\",\\n\\t\\t\\\"name\\\": \\\"Lithuanian Litas\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Lt\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"LTL\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Lithuanian litai\\\"\\n\\t},\\n\\t\\\"LVL\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Ls\\\",\\n\\t\\t\\\"name\\\": \\\"Latvian Lats\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Ls\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"LVL\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Latvian lati\\\"\\n\\t},\\n\\t\\\"LYD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"LD\\\",\\n\\t\\t\\\"name\\\": \\\"Libyan Dinar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"د.ل.\\\",\\n\\t\\t\\\"decimal_digits\\\": 3,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"LYD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Libyan dinars\\\"\\n\\t},\\n\\t\\\"MAD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"MAD\\\",\\n\\t\\t\\\"name\\\": \\\"Moroccan Dirham\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"د.م.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"MAD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Moroccan dirhams\\\"\\n\\t},\\n\\t\\\"MDL\\\": {\\n\\t\\t\\\"symbol\\\": \\\"MDL\\\",\\n\\t\\t\\\"name\\\": \\\"Moldovan Leu\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"MDL\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"MDL\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Moldovan lei\\\"\\n\\t},\\n\\t\\\"MGA\\\": {\\n\\t\\t\\\"symbol\\\": \\\"MGA\\\",\\n\\t\\t\\\"name\\\": \\\"Malagasy Ariary\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"MGA\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"MGA\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Malagasy Ariaries\\\"\\n\\t},\\n\\t\\\"MKD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"MKD\\\",\\n\\t\\t\\\"name\\\": \\\"Macedonian Denar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"MKD\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"MKD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Macedonian denari\\\"\\n\\t},\\n\\t\\\"MMK\\\": {\\n\\t\\t\\\"symbol\\\": \\\"MMK\\\",\\n\\t\\t\\\"name\\\": \\\"Myanma Kyat\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"K\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"MMK\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Myanma kyats\\\"\\n\\t},\\n\\t\\\"MOP\\\": {\\n\\t\\t\\\"symbol\\\": \\\"MOP$\\\",\\n\\t\\t\\\"name\\\": \\\"Macanese Pataca\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"MOP$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"MOP\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Macanese patacas\\\"\\n\\t},\\n\\t\\\"MUR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"MURs\\\",\\n\\t\\t\\\"name\\\": \\\"Mauritian Rupee\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"MURs\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"MUR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Mauritian rupees\\\"\\n\\t},\\n\\t\\\"MXN\\\": {\\n\\t\\t\\\"symbol\\\": \\\"MX$\\\",\\n\\t\\t\\\"name\\\": \\\"Mexican Peso\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"MXN\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Mexican pesos\\\"\\n\\t},\\n\\t\\\"MYR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"RM\\\",\\n\\t\\t\\\"name\\\": \\\"Malaysian Ringgit\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"RM\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"MYR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Malaysian ringgits\\\"\\n\\t},\\n\\t\\\"MZN\\\": {\\n\\t\\t\\\"symbol\\\": \\\"MTn\\\",\\n\\t\\t\\\"name\\\": \\\"Mozambican Metical\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"MTn\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"MZN\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Mozambican meticals\\\"\\n\\t},\\n\\t\\\"NAD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"N$\\\",\\n\\t\\t\\\"name\\\": \\\"Namibian Dollar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"N$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"NAD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Namibian dollars\\\"\\n\\t},\\n\\t\\\"NGN\\\": {\\n\\t\\t\\\"symbol\\\": \\\"₦\\\",\\n\\t\\t\\\"name\\\": \\\"Nigerian Naira\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"₦\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"NGN\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Nigerian nairas\\\"\\n\\t},\\n\\t\\\"NIO\\\": {\\n\\t\\t\\\"symbol\\\": \\\"C$\\\",\\n\\t\\t\\\"name\\\": \\\"Nicaraguan Córdoba\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"C$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"NIO\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Nicaraguan córdobas\\\"\\n\\t},\\n\\t\\\"NOK\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Nkr\\\",\\n\\t\\t\\\"name\\\": \\\"Norwegian Krone\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"kr\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"NOK\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Norwegian kroner\\\"\\n\\t},\\n\\t\\\"NPR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"NPRs\\\",\\n\\t\\t\\\"name\\\": \\\"Nepalese Rupee\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"नेरू\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"NPR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Nepalese rupees\\\"\\n\\t},\\n\\t\\\"NZD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"NZ$\\\",\\n\\t\\t\\\"name\\\": \\\"New Zealand Dollar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"NZD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"New Zealand dollars\\\"\\n\\t},\\n\\t\\\"OMR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"OMR\\\",\\n\\t\\t\\\"name\\\": \\\"Omani Rial\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"ر.ع.\\\",\\n\\t\\t\\\"decimal_digits\\\": 3,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"OMR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Omani rials\\\"\\n\\t},\\n\\t\\\"PAB\\\": {\\n\\t\\t\\\"symbol\\\": \\\"B/.\\\",\\n\\t\\t\\\"name\\\": \\\"Panamanian Balboa\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"B/.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"PAB\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Panamanian balboas\\\"\\n\\t},\\n\\t\\\"PEN\\\": {\\n\\t\\t\\\"symbol\\\": \\\"S/.\\\",\\n\\t\\t\\\"name\\\": \\\"Peruvian Nuevo Sol\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"S/.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"PEN\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Peruvian nuevos soles\\\"\\n\\t},\\n\\t\\\"PHP\\\": {\\n\\t\\t\\\"symbol\\\": \\\"₱\\\",\\n\\t\\t\\\"name\\\": \\\"Philippine Peso\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"₱\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"PHP\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Philippine pesos\\\"\\n\\t},\\n\\t\\\"PKR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"PKRs\\\",\\n\\t\\t\\\"name\\\": \\\"Pakistani Rupee\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"₨\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"PKR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Pakistani rupees\\\"\\n\\t},\\n\\t\\\"PLN\\\": {\\n\\t\\t\\\"symbol\\\": \\\"zł\\\",\\n\\t\\t\\\"name\\\": \\\"Polish Zloty\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"zł\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"PLN\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Polish zlotys\\\"\\n\\t},\\n\\t\\\"PYG\\\": {\\n\\t\\t\\\"symbol\\\": \\\"₲\\\",\\n\\t\\t\\\"name\\\": \\\"Paraguayan Guarani\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"₲\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"PYG\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Paraguayan guaranis\\\"\\n\\t},\\n\\t\\\"QAR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"QR\\\",\\n\\t\\t\\\"name\\\": \\\"Qatari Rial\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"ر.ق.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"QAR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Qatari rials\\\"\\n\\t},\\n\\t\\\"RON\\\": {\\n\\t\\t\\\"symbol\\\": \\\"RON\\\",\\n\\t\\t\\\"name\\\": \\\"Romanian Leu\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"RON\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"RON\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Romanian lei\\\"\\n\\t},\\n\\t\\\"RSD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"din.\\\",\\n\\t\\t\\\"name\\\": \\\"Serbian Dinar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"дин.\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"RSD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Serbian dinars\\\"\\n\\t},\\n\\t\\\"RUB\\\": {\\n\\t\\t\\\"symbol\\\": \\\"RUB\\\",\\n\\t\\t\\\"name\\\": \\\"Russian Ruble\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"₽.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"RUB\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Russian rubles\\\"\\n\\t},\\n\\t\\\"RWF\\\": {\\n\\t\\t\\\"symbol\\\": \\\"RWF\\\",\\n\\t\\t\\\"name\\\": \\\"Rwandan Franc\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"FR\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"RWF\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Rwandan francs\\\"\\n\\t},\\n\\t\\\"SAR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"SR\\\",\\n\\t\\t\\\"name\\\": \\\"Saudi Riyal\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"ر.س.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"SAR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Saudi riyals\\\"\\n\\t},\\n\\t\\\"SDG\\\": {\\n\\t\\t\\\"symbol\\\": \\\"SDG\\\",\\n\\t\\t\\\"name\\\": \\\"Sudanese Pound\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"SDG\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"SDG\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Sudanese pounds\\\"\\n\\t},\\n\\t\\\"SEK\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Skr\\\",\\n\\t\\t\\\"name\\\": \\\"Swedish Krona\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"kr\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"SEK\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Swedish kronor\\\"\\n\\t},\\n\\t\\\"SGD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"S$\\\",\\n\\t\\t\\\"name\\\": \\\"Singapore Dollar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"SGD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Singapore dollars\\\"\\n\\t},\\n\\t\\\"SOS\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Ssh\\\",\\n\\t\\t\\\"name\\\": \\\"Somali Shilling\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Ssh\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"SOS\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Somali shillings\\\"\\n\\t},\\n\\t\\\"SYP\\\": {\\n\\t\\t\\\"symbol\\\": \\\"SY£\\\",\\n\\t\\t\\\"name\\\": \\\"Syrian Pound\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"ل.س.\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"SYP\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Syrian pounds\\\"\\n\\t},\\n\\t\\\"THB\\\": {\\n\\t\\t\\\"symbol\\\": \\\"฿\\\",\\n\\t\\t\\\"name\\\": \\\"Thai Baht\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"฿\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"THB\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Thai baht\\\"\\n\\t},\\n\\t\\\"TND\\\": {\\n\\t\\t\\\"symbol\\\": \\\"DT\\\",\\n\\t\\t\\\"name\\\": \\\"Tunisian Dinar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"د.ت.\\\",\\n\\t\\t\\\"decimal_digits\\\": 3,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"TND\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Tunisian dinars\\\"\\n\\t},\\n\\t\\\"TOP\\\": {\\n\\t\\t\\\"symbol\\\": \\\"T$\\\",\\n\\t\\t\\\"name\\\": \\\"Tongan Paʻanga\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"T$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"TOP\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Tongan paʻanga\\\"\\n\\t},\\n\\t\\\"TRY\\\": {\\n\\t\\t\\\"symbol\\\": \\\"TL\\\",\\n\\t\\t\\\"name\\\": \\\"Turkish Lira\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"TL\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"TRY\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Turkish Lira\\\"\\n\\t},\\n\\t\\\"TTD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"TT$\\\",\\n\\t\\t\\\"name\\\": \\\"Trinidad and Tobago Dollar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"TTD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Trinidad and Tobago dollars\\\"\\n\\t},\\n\\t\\\"TWD\\\": {\\n\\t\\t\\\"symbol\\\": \\\"NT$\\\",\\n\\t\\t\\\"name\\\": \\\"New Taiwan Dollar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"NT$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"TWD\\\",\\n\\t\\t\\\"name_plural\\\": \\\"New Taiwan dollars\\\"\\n\\t},\\n\\t\\\"TZS\\\": {\\n\\t\\t\\\"symbol\\\": \\\"TSh\\\",\\n\\t\\t\\\"name\\\": \\\"Tanzanian Shilling\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"TSh\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"TZS\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Tanzanian shillings\\\"\\n\\t},\\n\\t\\\"UAH\\\": {\\n\\t\\t\\\"symbol\\\": \\\"₴\\\",\\n\\t\\t\\\"name\\\": \\\"Ukrainian Hryvnia\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"₴\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"UAH\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Ukrainian hryvnias\\\"\\n\\t},\\n\\t\\\"UGX\\\": {\\n\\t\\t\\\"symbol\\\": \\\"USh\\\",\\n\\t\\t\\\"name\\\": \\\"Ugandan Shilling\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"USh\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"UGX\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Ugandan shillings\\\"\\n\\t},\\n\\t\\\"UYU\\\": {\\n\\t\\t\\\"symbol\\\": \\\"$U\\\",\\n\\t\\t\\\"name\\\": \\\"Uruguayan Peso\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"$\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"UYU\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Uruguayan pesos\\\"\\n\\t},\\n\\t\\\"UZS\\\": {\\n\\t\\t\\\"symbol\\\": \\\"UZS\\\",\\n\\t\\t\\\"name\\\": \\\"Uzbekistan Som\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"UZS\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"UZS\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Uzbekistan som\\\"\\n\\t},\\n\\t\\\"VEF\\\": {\\n\\t\\t\\\"symbol\\\": \\\"Bs.F.\\\",\\n\\t\\t\\\"name\\\": \\\"Venezuelan Bolívar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"Bs.F.\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"VEF\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Venezuelan bolívars\\\"\\n\\t},\\n\\t\\\"VND\\\": {\\n\\t\\t\\\"symbol\\\": \\\"₫\\\",\\n\\t\\t\\\"name\\\": \\\"Vietnamese Dong\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"₫\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"VND\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Vietnamese dong\\\"\\n\\t},\\n\\t\\\"XAF\\\": {\\n\\t\\t\\\"symbol\\\": \\\"FCFA\\\",\\n\\t\\t\\\"name\\\": \\\"CFA Franc BEAC\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"FCFA\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"XAF\\\",\\n\\t\\t\\\"name_plural\\\": \\\"CFA francs BEAC\\\"\\n\\t},\\n\\t\\\"XOF\\\": {\\n\\t\\t\\\"symbol\\\": \\\"CFA\\\",\\n\\t\\t\\\"name\\\": \\\"CFA Franc BCEAO\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"CFA\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"XOF\\\",\\n\\t\\t\\\"name_plural\\\": \\\"CFA francs BCEAO\\\"\\n\\t},\\n\\t\\\"YER\\\": {\\n\\t\\t\\\"symbol\\\": \\\"YR\\\",\\n\\t\\t\\\"name\\\": \\\"Yemeni Rial\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"ر.ي.\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"YER\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Yemeni rials\\\"\\n\\t},\\n\\t\\\"ZAR\\\": {\\n\\t\\t\\\"symbol\\\": \\\"R\\\",\\n\\t\\t\\\"name\\\": \\\"South African Rand\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"R\\\",\\n\\t\\t\\\"decimal_digits\\\": 2,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"ZAR\\\",\\n\\t\\t\\\"name_plural\\\": \\\"South African rand\\\"\\n\\t},\\n\\t\\\"ZMK\\\": {\\n\\t\\t\\\"symbol\\\": \\\"ZK\\\",\\n\\t\\t\\\"name\\\": \\\"Zambian Kwacha\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"ZK\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"ZMK\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Zambian kwachas\\\"\\n\\t},\\n\\t\\\"ZWL\\\": {\\n\\t\\t\\\"symbol\\\": \\\"ZWL$\\\",\\n\\t\\t\\\"name\\\": \\\"Zimbabwean Dollar\\\",\\n\\t\\t\\\"symbol_native\\\": \\\"ZWL$\\\",\\n\\t\\t\\\"decimal_digits\\\": 0,\\n\\t\\t\\\"rounding\\\": 0,\\n\\t\\t\\\"code\\\": \\\"ZWL\\\",\\n\\t\\t\\\"name_plural\\\": \\\"Zimbabwean Dollar\\\"\\n\\t}\\n}\\n\";\n return SimpleJson_parse(input);\n})()), createTypeInfo(class_type(\"System.Collections.Generic.Dictionary`2\", [string_type, CurrencyDetails_$reflection()])));\n\nfunction getCurrencyCaption(ccy) {\n return [ccy.Code, `${ccy.Symbol} - ${ccy.Name}`];\n}\n\nexport const currenciesOptions = sort(ofSeq(map(getCurrencyCaption, currencyDetails.values())), {\n Compare: compareArrays,\n});\n\nexport const allCurrencies = ofSeq_1(currencyDetails.keys(), {\n Compare: comparePrimitives,\n});\n\nexport const popularCurrencies = ofArray([\"USD\", \"EUR\", \"CAD\", \"HKD\", \"AUD\", \"JPY\", \"GBP\"]);\n\nexport const popularCurrenciesOptions = map_1((ccy) => getCurrencyCaption(getItemFromDict(currencyDetails, ccy)), popularCurrencies);\n\nexport const supportedCurrenciesForEditing = append(singleton([\"---\", \"--- Popular currencies ---\"]), append(popularCurrenciesOptions, append(singleton([\"---\", \"--- All currencies ---\"]), currenciesOptions)));\n\nexport function supportedCurrenciesForEditingOptions(name) {\n return valuesToSelectOptions(supportedCurrenciesForEditing, name);\n}\n\n","import { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { union_type, list_type, class_type, string_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\nimport { Common_GenericOptions__AddCaseName_1505, Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection } from \"../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\n\nexport class TableOption extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"is-bordered\", \"is-striped\", \"is-fullwidth\", \"is-narrow\", \"is-hoverable\", \"CustomClass\", \"Props\", \"Modifiers\"];\n }\n}\n\nexport function TableOption_$reflection() {\n return union_type(\"Fulma.Table.TableOption\", [], TableOption, () => [[], [], [], [], [], [[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate \n */\nexport function table(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 6:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 5:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 7:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n }, \"table\"), (props_1, children_1) => react.createElement(\"table\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n","import { FinancialClientModule_$ctor } from \"../../FinancialClientModule.js\";\nimport { Remoting_buildProxy_64DC51C } from \"../../fable_modules/Fable.Remoting.Client.7.32.0/Remoting.fs.js\";\nimport { RemotingModule_createApi, RemotingModule_withRouteBuilder } from \"../../fable_modules/Fable.Remoting.Client.7.32.0/Remoting.fs.js\";\nimport { printf, toText } from \"../../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { FinancialService_$reflection, AssetValueService_$reflection } from \"../../Omnicv.Shared/FinancialAPI.js\";\nimport { reverse, singleton as singleton_1, ofArray, map } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { empty, singleton, append, delay, toList } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { formatDistanceToNow } from \"date-fns\";\nimport { timeFormatOptions } from \"../../Omnicv.Client.Common/Utils.js\";\nimport * as react from \"react\";\nimport * as common from \"../../../src/javascript/common.js\";\nimport { Option, button } from \"../../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { Size_ISize, Color_IColor } from \"../../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { value as value_1 } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { Option as Option_1, icon } from \"../../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport { Fa_i } from \"../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { Icons__ToIcon } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { Icons } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { TableOption, table } from \"../../fable_modules/Fulma.3.0.0/Elements/Table.fs.js\";\n\nexport const financialModule = FinancialClientModule_$ctor();\n\nexport const assetValueService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder((arg, m) => toText(printf(\"/api/auth/mod/fin-val/%s\"))(m), RemotingModule_createApi()), AssetValueService_$reflection());\n\nexport const financialService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder((arg, m) => toText(printf(\"/api/auth/mod/fin-hi/%s\"))(m), RemotingModule_createApi()), FinancialService_$reflection());\n\nexport function valuesToTable(targetCurrency, data, deleteEntry) {\n let children_14, children_12;\n const rows = map((value) => {\n const children_6 = toList(delay(() => {\n let children;\n return append(singleton((children = [formatDistanceToNow(value.Timestamp, timeFormatOptions)], react.createElement(\"td\", {}, ...children))), delay(() => {\n let children_2;\n return append(singleton((children_2 = [common.formatCurrencyValue(targetCurrency, value.Value)], react.createElement(\"td\", {}, ...children_2))), delay(() => {\n let children_4;\n return (deleteEntry != null) ? singleton((children_4 = [button(ofArray([new Option(0, [new Color_IColor(8, [])]), new Option(5, []), new Option(18, [(_arg) => {\n if (window.confirm(`${\"Confirm delete\"}:\n${\"Are you sure you want to delete this entry?\"}`)) {\n (() => {\n value_1(deleteEntry)(value.Id);\n })();\n }\n }])]), singleton_1(icon(singleton_1(new Option_1(0, [new Size_ISize(0, [])])), singleton_1(Fa_i(singleton_1(Icons__ToIcon(new Icons(2, []))), [])))))], react.createElement(\"td\", {}, ...children_4))) : empty();\n }));\n }));\n }));\n return react.createElement(\"tr\", {}, ...children_6);\n }, reverse(data));\n return table(ofArray([new TableOption(2, []), new TableOption(1, [])]), ofArray([(children_14 = [(children_12 = [react.createElement(\"th\", {}, \"Date\"), react.createElement(\"th\", {}, \"Value\")], react.createElement(\"tr\", {}, ...children_12))], react.createElement(\"thead\", {}, ...children_14)), react.createElement(\"tbody\", {}, ...rows)]));\n}\n\n","import { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { Common_GenericOptions__AddCaseName_1505, Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddProps_Z4E55E0BD, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection, Size_ISize_$reflection } from \"../Common.fs.js\";\nimport { bool_type, union_type, list_type, class_type, string_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\nimport { singleton } from \"../../fable-library-js.4.24.0/List.js\";\nimport { Reflection_getCaseName } from \"../Common.fs.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Size\", \"is-centered\", \"is-right\", \"is-boxed\", \"is-toggle\", \"is-toggle-rounded\", \"is-fullwidth\", \"CustomClass\", \"Props\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Tabs.Option\", [], Option, () => [[[\"Item\", Size_ISize_$reflection()]], [], [], [], [], [], [], [[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\nexport class Tab_Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"is-active\", \"CustomClass\", \"Props\", \"Modifiers\"];\n }\n}\n\nexport function Tab_Option_$reflection() {\n return union_type(\"Fulma.Tabs.Tab.Option\", [], Tab_Option, () => [[[\"Item\", bool_type]], [[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate \n */\nexport function tabs(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 0:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Reflection_getCaseName(option.fields[0]));\n case 8:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 7:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 9:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n }, \"tabs\"), (props_1, children_1) => react.createElement(\"div\", keyValueList(props_1, 1), ...children_1), singleton(react.createElement(\"ul\", {}, ...children)));\n}\n\n/**\n * Generate \n */\nexport function tab(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 2:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 1:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 3:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n if (option.fields[0]) {\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n else {\n return result;\n }\n }\n }), (props_1, children_1) => react.createElement(\"li\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n","import { Union } from \"../../../fable-library-js.4.24.0/Types.js\";\nimport { union_type, bool_type, list_type, class_type, string_type } from \"../../../fable-library-js.4.24.0/Reflection.js\";\nimport { Common_parseOptions, Common_GenericOptions__ToReactElement_Z2B8EEFE, Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddProps_Z4E55E0BD, Color_ofColor, Common_GenericOptions__AddCaseName_1505, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection, Color_IColor_$reflection, Size_ISize_$reflection } from \"../../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../../fable-library-js.4.24.0/MapUtil.js\";\nimport { Reflection_getCaseName } from \"../../Common.fs.js\";\nimport { HTMLAttr } from \"../../../Fable.React.9.4.0/Fable.React.Props.fs.js\";\nimport { singleton } from \"../../../fable-library-js.4.24.0/List.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"CustomClass\", \"Props\", \"Size\", \"is-focused\", \"is-active\", \"is-hovered\", \"is-fullwidth\", \"is-centered\", \"is-right\", \"is-boxed\", \"has-name\", \"is-empty\", \"Color\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.File.Option\", [], Option, () => [[[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", Size_ISize_$reflection()]], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [[\"Item\", bool_type]], [], [], [], [], [], [[\"Item\", bool_type]], [[\"Item\", Color_IColor_$reflection()]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate
\n */\nexport function file(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n let matchResult, state;\n switch (option.tag) {\n case 6:\n case 7:\n case 8:\n case 9:\n case 10: {\n matchResult = 1;\n break;\n }\n case 12: {\n matchResult = 2;\n break;\n }\n case 1: {\n matchResult = 4;\n break;\n }\n case 0: {\n matchResult = 5;\n break;\n }\n case 13: {\n matchResult = 6;\n break;\n }\n case 3: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n case 4: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n case 5: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n case 11: {\n matchResult = 3;\n state = option.fields[0];\n break;\n }\n default:\n matchResult = 0;\n }\n switch (matchResult) {\n case 0:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Reflection_getCaseName(option.fields[0]));\n case 1:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n case 2:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Color_ofColor(option.fields[0]));\n case 3:\n if (state) {\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n else {\n return result;\n }\n case 4:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 5:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n }\n }, \"file\"), (props_1, children_1) => react.createElement(\"div\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function input(options) {\n return Common_GenericOptions__ToReactElement_Z2B8EEFE(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"file-input\", singleton(new HTMLAttr(159, [\"file\"]))), (props) => react.createElement(\"input\", keyValueList(props, 1)));\n}\n\n/**\n * Generate \n */\nexport function cta(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"file-cta\"), (props, children_1) => react.createElement(\"span\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function name(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"file-name\"), (props, children_1) => react.createElement(\"span\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function icon(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"file-icon\"), (props, children_1) => react.createElement(\"span\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function Label_span(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"file-label\"), (props, children_1) => react.createElement(\"span\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function Label_label(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"file-label\"), (props, children_1) => react.createElement(\"label\", keyValueList(props, 1), ...children_1), children);\n}\n\n","import * as common from \"../../../src/javascript/common.js\";\nimport { Union, Record } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { unit_type, list_type, tuple_type, enum_type, int32_type, union_type, int64_type, bool_type, array_type, uint8_type, record_type, class_type, option_type, string_type, decimal_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { FinancialHierarchy__BuildMapTree_Z59A20369, EntryFilter, CashflowInfo__IsActive_7F9DDECF, AutomaticCashflow__IsActive_7F9DDECF, CashflowInfo, CashflowInfo_Default_7F9DDECF, AssetInfo, AssetInfo_Default_7F9DDECF, Group, Group_Default_7F9DDECF, AssetValueRecord, AssetValueRecord_Default, validateInstrument, validateIdentifier, validateInterestRate, validateCurrency, validateUnitPrice, needsUnitPrice, validateQuantity, validateName, validateDisplayCurrency, validateNotes, EntryFilter_get_Empty, CurrencyValue_$reflection, GroupNode_$reflection, FinancialHierarchy_$reflection, CashflowInfo_$reflection, AssetInfo_$reflection, Group_$reflection, EntryFilter_$reflection } from \"../../Omnicv.Shared/FinancialAPI.js\";\nimport { length, tryFind, isEmpty, cons, collect, append as append_1, singleton as singleton_1, empty, map, ofArray } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { empty as empty_2, tryFind as tryFind_1, FSharpMap__get_Item, ofList } from \"../../fable_modules/fable-library-js.4.24.0/Map.js\";\nimport { curry2, createObj, int32ToString, equals, comparePrimitives } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { supportedCurrenciesForEditingOptions, supportedCurrenciesForEditing } from \"../../Omnicv.Client.Common/CurrencyUtils.js\";\nimport { defaultArg, map as map_1, value as value_6, defaultArgWith } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { Icons, Session__GetCurrentProfileId, Session__GetDisplayCurrency } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { fromInt32, toInt64, compare } from \"../../fable_modules/fable-library-js.4.24.0/BigInt.js\";\nimport { FlexFormFields$1__AddTextOpt_Z44636648, FlexFormFields$1__AddDecimalOpt_Z2D27E1FA, noValidation, FlexFormFields$1__AddDateTime_2636DDCF, FlexFormFields$1__AddDecimal_7B82A45, FlexFormBase$1__Render_2B595, FlexFormBase$1__SetState, FlexForm$1__get_Fields, FlexFormFields$1__AddText_Z44011C05, FlexFormFields$1__AddSelection_Z70244BEA, FlexFormFields$1__AddTextAreaOpt_Z44636648, FlexForm$1_$ctor_2ABDDB55 } from \"../../Omnicv.Client.Common/Components/FlexForm.js\";\nimport { Option as Option_4, div } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Control.fs.js\";\nimport { container } from \"../../fable_modules/Fulma.3.0.0/Layouts/Container.fs.js\";\nimport { h6, h5, h4, h3, Option, h2, h1 } from \"../../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { empty as empty_1, append, singleton, delay, toList } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { assetValueService, financialService } from \"./FinancialCommon.js\";\nimport { Cmd_map, Cmd_none } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { handleFileEvent, busyModal, valuesToSelectOptions, exnToDisplayString } from \"../../Omnicv.Client.Common/Utils.js\";\nimport { EventInfo, EventInfo_Default_7F9DDECF } from \"../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { singleton as singleton_2 } from \"../../fable_modules/fable-library-js.4.24.0/AsyncBuilder.js\";\nimport { get_Zero, get_One } from \"../../fable_modules/fable-library-js.4.24.0/Decimal.js\";\nimport { utcNow } from \"../../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport { List_Option, list as list_3, Option as Option_1, button } from \"../../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { Size_ISize, Common_GenericOption, TextTransform_Option, Modifier_IModifier, Screen, Color_IColor } from \"../../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { FSharpChoice$2 } from \"../../fable_modules/fable-library-js.4.24.0/Choice.js\";\nimport { Option as Option_6, icon } from \"../../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport { Fa_i } from \"../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { Icons__ToIcon } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { createElement } from \"react\";\nimport * as react from \"react\";\nimport { box$0027 } from \"../../fable_modules/Fulma.3.0.0/Elements/Box.fs.js\";\nimport { Fa_IconOption, Fa_i as Fa_i_1 } from \"../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { reactApi } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { isNullOrWhiteSpace, replicate } from \"../../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { Option as Option_2, columns } from \"../../fable_modules/Fulma.3.0.0/Layouts/Columns.fs.js\";\nimport { Option as Option_3, ISize, column } from \"../../fable_modules/Fulma.3.0.0/Layouts/Column.fs.js\";\nimport { Route, Router_modifyLocation } from \"../../Omnicv.Client.Common/Router.js\";\nimport { defaultOf } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { content } from \"../../fable_modules/Fulma.3.0.0/Elements/Content.fs.js\";\nimport { HTMLAttr, DOMAttr } from \"../../fable_modules/Fable.React.9.4.0/Fable.React.Props.fs.js\";\nimport { tab, Option as Option_7, tabs, Tab_Option } from \"../../fable_modules/Fulma.3.0.0/Components/Tabs.fs.js\";\nimport { input } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Input.fs.js\";\nimport { Option as Option_5, IInputType } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Input.fs.js\";\nimport { select } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Select.fs.js\";\nimport { keyValueList } from \"../../fable_modules/fable-library-js.4.24.0/MapUtil.js\";\nimport { Option as Option_8, div as div_1 } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Field.fs.js\";\nimport { name as name_12, icon as icon_1, cta, input as input_1, Label_label, Option as Option_9, file as file_1 } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/File.fs.js\";\nimport { Class, closeable } from \"../../Omnicv.Client.Common/Components/Notification.js\";\n\nexport function Omnicv_Shared_FinancialAPI_CurrencyValue__CurrencyValue_ToDisplayString(this$) {\n return common.formatCurrencyValue(this$.Currency, this$.Value);\n}\n\nexport class AssetValueData extends Record {\n constructor(Quantity, UnitPrice, Notes, EventTimestamp) {\n super();\n this.Quantity = Quantity;\n this.UnitPrice = UnitPrice;\n this.Notes = Notes;\n this.EventTimestamp = EventTimestamp;\n }\n}\n\nexport function AssetValueData_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Financial.MainFinancialView.Component.AssetValueData\", [], AssetValueData, () => [[\"Quantity\", decimal_type], [\"UnitPrice\", decimal_type], [\"Notes\", option_type(string_type)], [\"EventTimestamp\", class_type(\"System.DateTime\")]]);\n}\n\nexport class FileUploadData extends Record {\n constructor(CurrentFileName, Data, InProgress, Error$) {\n super();\n this.CurrentFileName = CurrentFileName;\n this.Data = Data;\n this.InProgress = InProgress;\n this.Error = Error$;\n }\n}\n\nexport function FileUploadData_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Financial.MainFinancialView.Component.FileUploadData\", [], FileUploadData, () => [[\"CurrentFileName\", option_type(string_type)], [\"Data\", option_type(array_type(uint8_type))], [\"InProgress\", bool_type], [\"Error\", option_type(string_type)]]);\n}\n\nexport function FileUploadData_Default() {\n return new FileUploadData(undefined, undefined, false, undefined);\n}\n\nexport function FileUploadData__CanSubmit(this$) {\n if (this$.Data != null) {\n return !this$.InProgress;\n }\n else {\n return false;\n }\n}\n\nexport class EditModel$1 extends Record {\n constructor(Data, IsLoading, Error$) {\n super();\n this.Data = Data;\n this.IsLoading = IsLoading;\n this.Error = Error$;\n }\n}\n\nexport function EditModel$1_$reflection(gen0) {\n return record_type(\"Omnicv.Client.Pages.Financial.MainFinancialView.Component.EditModel`1\", [gen0], EditModel$1, () => [[\"Data\", gen0], [\"IsLoading\", bool_type], [\"Error\", option_type(string_type)]]);\n}\n\nfunction createEditModel(data) {\n return new EditModel$1(data, false, undefined);\n}\n\nexport class EditMsg$1 extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RecordUpdated\", \"Submit\", \"SuccessAdd\", \"SuccessEdit\", \"Failure\"];\n }\n}\n\nexport function EditMsg$1_$reflection(gen0) {\n return union_type(\"Omnicv.Client.Pages.Financial.MainFinancialView.Component.EditMsg`1\", [gen0], EditMsg$1, () => [[[\"Item\", gen0]], [], [[\"Item\", int64_type]], [[\"Item\", gen0]], [[\"Item\", class_type(\"System.Exception\")]]]);\n}\n\nexport class State extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"DisplayAssets\", \"DisplayCashflows\", \"AddEditGroup\", \"AddEditAsset\", \"AddEditCashflow\", \"AddValue\", \"ChooseAdd\", \"ImportData\"];\n }\n}\n\nexport function State_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Financial.MainFinancialView.Component.State\", [], State, () => [[[\"Item\", EntryFilter_$reflection()]], [[\"Item\", EntryFilter_$reflection()]], [[\"Item\", EditModel$1_$reflection(Group_$reflection())]], [[\"Item\", EditModel$1_$reflection(AssetInfo_$reflection())]], [[\"Item\", EditModel$1_$reflection(CashflowInfo_$reflection())]], [[\"Item1\", AssetInfo_$reflection()], [\"Item2\", EditModel$1_$reflection(AssetValueData_$reflection())]], [[\"Item\", Group_$reflection()]], [[\"Item\", FileUploadData_$reflection()]]]);\n}\n\nexport class Model extends Record {\n constructor(FinancialHierarchy, FinancialTree, State, InProgress, Error$, DisplayCurrency) {\n super();\n this.FinancialHierarchy = FinancialHierarchy;\n this.FinancialTree = FinancialTree;\n this.State = State;\n this.InProgress = InProgress;\n this.Error = Error$;\n this.DisplayCurrency = DisplayCurrency;\n }\n}\n\nexport function Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Financial.MainFinancialView.Component.Model\", [], Model, () => [[\"FinancialHierarchy\", option_type(FinancialHierarchy_$reflection())], [\"FinancialTree\", class_type(\"Microsoft.FSharp.Collections.FSharpMap`2\", [enum_type(\"Omnicv.Shared.FinancialAPI.GroupType\", int32_type, [[\"Assets\", 1], [\"Cashflows\", 2]]), tuple_type(list_type(tuple_type(GroupNode_$reflection(), CurrencyValue_$reflection())), CurrencyValue_$reflection())])], [\"State\", State_$reflection()], [\"InProgress\", bool_type], [\"Error\", option_type(string_type)], [\"DisplayCurrency\", option_type(string_type)]]);\n}\n\nexport function Model__GetCurrentFilters(this$) {\n const matchValue = this$.State;\n switch (matchValue.tag) {\n case 0:\n return matchValue.fields[0];\n case 1:\n return matchValue.fields[0];\n default:\n return EntryFilter_get_Empty();\n }\n}\n\nexport class FileUploadMsg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"StartLoadFile\", \"LoadSuccess\", \"UploadFile\", \"UploadSuccess\", \"Failure\"];\n }\n}\n\nexport function FileUploadMsg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Financial.MainFinancialView.Component.FileUploadMsg\", [], FileUploadMsg, () => [[[\"Item\", class_type(\"Browser.Types.Event\", undefined)]], [[\"Item1\", array_type(uint8_type)], [\"Item2\", string_type]], [[\"Item\", array_type(uint8_type)]], [[\"Item\", unit_type]], [[\"Item\", class_type(\"System.Exception\")]]]);\n}\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RequestHierarchy\", \"HierarchySuccess\", \"SetState\", \"AddSuccess\", \"Failure\", \"GroupMsg\", \"AssetMsg\", \"AssetValueMsg\", \"CashflowMsg\", \"FileUploadMsg\", \"UpdateDisplayCurrency\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Financial.MainFinancialView.Component.Msg\", [], Msg, () => [[], [[\"Item\", FinancialHierarchy_$reflection()]], [[\"Item\", State_$reflection()]], [[\"Item\", unit_type]], [[\"Item\", class_type(\"System.Exception\")]], [[\"Item\", EditMsg$1_$reflection(Group_$reflection())]], [[\"Item\", EditMsg$1_$reflection(AssetInfo_$reflection())]], [[\"Item\", EditMsg$1_$reflection(AssetValueData_$reflection())]], [[\"Item\", EditMsg$1_$reflection(CashflowInfo_$reflection())]], [[\"Item\", FileUploadMsg_$reflection()]], [[\"Item\", option_type(string_type)]]]);\n}\n\nconst assetTypes = ofArray([[0, \"Physical cash\"], [1, \"Account\"], [2, \"Financial instrument\"], [7, \"Real estate\"], [9, \"Loan\"], [100, \"Other debt\"]]);\n\nconst assetTypesLookup = ofList(assetTypes, {\n Compare: comparePrimitives,\n});\n\nconst cashflowTypes = ofArray([[1, \"Income\"], [2, \"Expense\"]]);\n\nconst cashflowTypesLookup = ofList(cashflowTypes, {\n Compare: comparePrimitives,\n});\n\nconst frequencies = ofArray([[1, \"Daily\"], [2, \"Weekly\"], [3, \"Monthly\"], [4, \"Quarterly\"], [5, \"Yearly\"]]);\n\nconst optionalCurrencyChoices = map((x) => [x[0], x[1]], supportedCurrenciesForEditing);\n\nfunction getDisplayCurrency(session, model) {\n return defaultArgWith(model.DisplayCurrency, () => Session__GetDisplayCurrency(session));\n}\n\nfunction _commonOnCancel(dispatch) {\n return (_arg_1) => {\n dispatch(new Msg(2, [new State(0, [EntryFilter_get_Empty()])]));\n };\n}\n\nfunction _commonOnCancelCF(dispatch) {\n return (_arg_1) => {\n dispatch(new Msg(2, [new State(1, [EntryFilter_get_Empty()])]));\n };\n}\n\nexport function Groups_viewForAddEdit(model, dispatch) {\n const editing = compare(model.Data.Id, toInt64(fromInt32(0))) > 0;\n const form = FlexForm$1_$ctor_2ABDDB55((arg_1) => {\n dispatch(new Msg(5, [new EditMsg$1(0, [arg_1])]));\n }, (_arg) => {\n dispatch(new Msg(5, [new EditMsg$1(1, [])]));\n }, _commonOnCancel(dispatch));\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddSelection_Z70244BEA(FlexFormFields$1__AddText_Z44011C05(FlexForm$1__get_Fields(form), \"Name\", validateName, \"Group name\"), \"DisplayCurrency\", optionalCurrencyChoices, validateDisplayCurrency, \"Display currency\"), \"Notes\", validateNotes, \"Notes\");\n FlexFormBase$1__SetState(form, model.IsLoading, model.Error);\n return div(empty(), ofArray([container(empty(), singleton_1(h1(empty())(toList(delay(() => (editing ? singleton(\"Edit group\") : singleton(\"Add group\"))))))), FlexFormBase$1__Render_2B595(form, model.Data)]));\n}\n\nexport function Groups_update(session, msg, model) {\n switch (msg.tag) {\n case 1:\n return [new EditModel$1(model.Data, true, model.Error), (compare(model.Data.Id, toInt64(fromInt32(0))) > 0) ? Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, financialService.EditGroup, model.Data, (Item) => (new EditMsg$1(3, [Item])), (Item_1) => (new EditMsg$1(4, [Item_1]))) : Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, financialService.AddGroup, model.Data, (Item_2) => (new EditMsg$1(2, [Item_2])), (Item_3) => (new EditMsg$1(4, [Item_3])))];\n case 2:\n case 3:\n return [new EditModel$1(model.Data, false, undefined), Cmd_none()];\n case 4:\n return [new EditModel$1(model.Data, false, exnToDisplayString(msg.fields[0])), Cmd_none()];\n default:\n return [new EditModel$1(msg.fields[0], model.IsLoading, model.Error), Cmd_none()];\n }\n}\n\nexport function Assets_viewAddValue(asset, model, dispatch) {\n const form = FlexForm$1_$ctor_2ABDDB55((arg_1) => {\n dispatch(new Msg(7, [new EditMsg$1(0, [arg_1])]));\n }, (_arg) => {\n dispatch(new Msg(7, [new EditMsg$1(1, [])]));\n }, _commonOnCancel(dispatch));\n FlexFormFields$1__AddDecimal_7B82A45(FlexForm$1__get_Fields(form), \"Quantity\", validateQuantity, \"Quantity\");\n if (needsUnitPrice(asset.AssetType)) {\n FlexFormFields$1__AddDecimal_7B82A45(FlexForm$1__get_Fields(form), \"UnitPrice\", validateUnitPrice, \"Unit price\");\n }\n FlexFormFields$1__AddDateTime_2636DDCF(FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexForm$1__get_Fields(form), \"Notes\", validateNotes, \"Notes\"), \"EventTimestamp\", noValidation, \"Timestamp\");\n FlexFormBase$1__SetState(form, model.IsLoading, model.Error);\n return div(empty(), ofArray([container(empty(), ofArray([h1(empty())(singleton_1(\"Add value to asset\")), h2(singleton_1(new Option(6, [])))(singleton_1(asset.Name))])), FlexFormBase$1__Render_2B595(form, model.Data)]));\n}\n\nexport function Assets_viewForAddEdit(model, dispatch) {\n const editing = compare(model.Data.Id, toInt64(fromInt32(0))) > 0;\n const form = FlexForm$1_$ctor_2ABDDB55((arg_1) => {\n dispatch(new Msg(6, [new EditMsg$1(0, [arg_1])]));\n }, (_arg) => {\n dispatch(new Msg(6, [new EditMsg$1(1, [])]));\n }, _commonOnCancel(dispatch));\n FlexFormFields$1__AddSelection_Z70244BEA(FlexFormFields$1__AddText_Z44011C05(FlexForm$1__get_Fields(form), \"Name\", validateName, \"Name\"), \"Currency\", supportedCurrenciesForEditing, validateCurrency, \"Currency\");\n FlexFormBase$1__SetState(form, model.IsLoading, model.Error);\n const matchValue = model.Data.AssetType | 0;\n switch (matchValue) {\n case 0:\n case 7: {\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexForm$1__get_Fields(form), \"Notes\", validateNotes, \"Notes\");\n break;\n }\n case 1:\n case 9:\n case 100: {\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddDecimalOpt_Z2D27E1FA(FlexFormFields$1__AddTextOpt_Z44636648(FlexForm$1__get_Fields(form), \"Identifier\", validateIdentifier, \"Identifier\"), \"InterestRate\", validateInterestRate, \"Interest rate\"), \"Notes\", validateNotes, \"Notes\");\n break;\n }\n case 2: {\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddTextOpt_Z44636648(FlexFormFields$1__AddTextOpt_Z44636648(FlexForm$1__get_Fields(form), \"Identifier\", validateIdentifier, \"Identifier\"), \"Instrument\", validateInstrument, \"Instrument\"), \"Notes\", validateNotes, \"Notes\");\n break;\n }\n default:\n throw new Error(\"Asset type not supported\");\n }\n return div(empty(), ofArray([container(empty(), singleton_1(h1(empty())(toList(delay(() => (editing ? singleton(\"Edit asset\") : singleton(\"Add asset\"))))))), FlexFormBase$1__Render_2B595(form, model.Data)]));\n}\n\nexport function Assets_update(session, msg, model) {\n switch (msg.tag) {\n case 1:\n return [new EditModel$1(model.Data, true, model.Error), (compare(model.Data.Id, toInt64(fromInt32(0))) > 0) ? Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, financialService.EditAsset, model.Data, (Item) => (new EditMsg$1(3, [Item])), (Item_1) => (new EditMsg$1(4, [Item_1]))) : Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, financialService.AddAsset, model.Data, (Item_2) => (new EditMsg$1(2, [Item_2])), (Item_3) => (new EditMsg$1(4, [Item_3])))];\n case 2:\n case 3:\n return [new EditModel$1(model.Data, false, undefined), Cmd_none()];\n case 4:\n return [new EditModel$1(model.Data, false, exnToDisplayString(msg.fields[0])), Cmd_none()];\n default:\n return [new EditModel$1(msg.fields[0], model.IsLoading, model.Error), Cmd_none()];\n }\n}\n\nexport function Assets_updateValue(session, msg, asset, model) {\n switch (msg.tag) {\n case 1: {\n let eventInfo;\n const bind$0040 = EventInfo_Default_7F9DDECF(model.Data.EventTimestamp);\n eventInfo = (new EventInfo(bind$0040.Id, bind$0040.ContentTypeId, Session__GetCurrentProfileId(session), bind$0040.EventTimestamp, bind$0040.CreatedAt, bind$0040.UpdatedAt, bind$0040.PlaceId, bind$0040.PlaceName, bind$0040.Latitude, bind$0040.Longitude, bind$0040.LocationTz, bind$0040.LocationTzOffsetMin, bind$0040.ClientTz, bind$0040.ClientTzOffsetMin));\n return [new EditModel$1(model.Data, true, model.Error), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, (isLatest) => singleton_2.Delay(() => {\n const unitPrice = needsUnitPrice(asset.AssetType) ? model.Data.UnitPrice : get_One;\n const assetValueRecord = new AssetValueRecord(AssetValueRecord_Default().Id, asset.Id, model.Data.Quantity, unitPrice, model.Data.Notes);\n return singleton_2.Bind(assetValueService.Add(eventInfo, assetValueRecord, isLatest), (_arg) => singleton_2.Return(_arg.Id));\n }), true, (Item) => (new EditMsg$1(2, [Item])), (Item_1) => (new EditMsg$1(4, [Item_1])))];\n }\n case 2:\n case 3:\n return [new EditModel$1(model.Data, false, undefined), Cmd_none()];\n case 4:\n return [new EditModel$1(model.Data, false, exnToDisplayString(msg.fields[0])), Cmd_none()];\n default:\n return [new EditModel$1(msg.fields[0], model.IsLoading, model.Error), Cmd_none()];\n }\n}\n\nexport function Cashflows_viewForAddEdit(model, dispatch) {\n const form = FlexForm$1_$ctor_2ABDDB55((arg_1) => {\n dispatch(new Msg(8, [new EditMsg$1(0, [arg_1])]));\n }, (_arg) => {\n dispatch(new Msg(8, [new EditMsg$1(1, [])]));\n }, _commonOnCancelCF(dispatch));\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddDecimal_7B82A45(FlexFormFields$1__AddSelection_Z70244BEA(FlexFormFields$1__AddSelection_Z70244BEA(FlexFormFields$1__AddSelection_Z70244BEA(FlexFormFields$1__AddText_Z44011C05(FlexForm$1__get_Fields(form), \"Name\", validateName, \"Cashflow name\"), \"CashflowType\", cashflowTypes, noValidation, \"Cashflow type\"), \"Frequency\", frequencies, noValidation, \"Frequency\"), \"Currency\", supportedCurrenciesForEditing, validateCurrency, \"Currency\"), \"Quantity\", validateQuantity, \"Quantity\"), \"Notes\", validateNotes, \"Notes\");\n FlexFormBase$1__SetState(form, model.IsLoading, model.Error);\n return div(empty(), ofArray([container(empty(), singleton_1(h1(empty())(singleton_1(\"Add cashflow\")))), FlexFormBase$1__Render_2B595(form, model.Data)]));\n}\n\nexport function Cashflows_update(_session, msg, model) {\n switch (msg.tag) {\n case 1:\n return [new EditModel$1(model.Data, true, model.Error), (compare(model.Data.Id, toInt64(fromInt32(0))) > 0) ? Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, financialService.EditCashflow, model.Data, (Item) => (new EditMsg$1(3, [Item])), (Item_1) => (new EditMsg$1(4, [Item_1]))) : Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, financialService.AddCashflow, model.Data, (Item_2) => (new EditMsg$1(2, [Item_2])), (Item_3) => (new EditMsg$1(4, [Item_3])))];\n case 2:\n case 3:\n return [new EditModel$1(model.Data, false, undefined), Cmd_none()];\n case 4:\n return [new EditModel$1(model.Data, false, exnToDisplayString(msg.fields[0])), Cmd_none()];\n default:\n return [new EditModel$1(msg.fields[0], model.IsLoading, model.Error), Cmd_none()];\n }\n}\n\nfunction DisplayHierarchy_addGroup(session, dispatch, parentOrType, _arg) {\n let newGroup;\n const start = Group_Default_7F9DDECF(utcNow());\n if (parentOrType.tag === 1) {\n newGroup = (new Group(start.Id, parentOrType.fields[0], start.ProfileId, start.ParentId, start.CreatedAt, start.UpdatedAt, start.Name, start.Notes, start.Weight, start.DisplayCurrency));\n }\n else {\n const parent = parentOrType.fields[0];\n newGroup = (new Group(start.Id, parent.GroupType, start.ProfileId, parent.Id, start.CreatedAt, start.UpdatedAt, start.Name, start.Notes, start.Weight, start.DisplayCurrency));\n }\n dispatch(new Msg(2, [new State(2, [createEditModel(new Group(newGroup.Id, newGroup.GroupType, Session__GetCurrentProfileId(session), newGroup.ParentId, newGroup.CreatedAt, newGroup.UpdatedAt, newGroup.Name, newGroup.Notes, newGroup.Weight, newGroup.DisplayCurrency))])]));\n}\n\nexport function DisplayHierarchy_groupTypeToState(groupType, filter) {\n switch (groupType) {\n case 1:\n return new State(0, [filter]);\n case 2:\n return new State(1, [filter]);\n default:\n throw new Error(`Bad group type ${groupType}`);\n }\n}\n\nfunction DisplayHierarchy_viewByGroupType(targetGroupType, dispatch) {\n dispatch(new Msg(2, [DisplayHierarchy_groupTypeToState(targetGroupType, EntryFilter_get_Empty())]));\n}\n\nexport function DisplayHierarchy_viewSelectAdd(session, group, dispatch) {\n let states;\n const matchValue = group.GroupType | 0;\n switch (matchValue) {\n case 1: {\n states = map((t) => {\n let patternInput;\n const tupledArg = t;\n const model = AssetInfo_Default_7F9DDECF(utcNow());\n patternInput = [createEditModel(new AssetInfo(model.Id, group.ProfileId, group.Id, tupledArg[0], model.CreatedAt, model.UpdatedAt, model.Name, model.Notes, model.Weight, model.Identifier, model.LatestAssetValueId, (group.DisplayCurrency == null) ? \"\" : value_6(group.DisplayCurrency), model.Instrument, model.InterestRate, model.ActiveFrom, model.ActiveTo)), tupledArg[1]];\n return [new State(3, [patternInput[0]]), patternInput[1]];\n }, assetTypes);\n break;\n }\n case 2: {\n states = map((t_1) => {\n let patternInput_1;\n const tupledArg_1 = t_1;\n const model_1 = CashflowInfo_Default_7F9DDECF(utcNow());\n patternInput_1 = [createEditModel(new CashflowInfo(model_1.Id, group.ProfileId, tupledArg_1[0], group.Id, model_1.CreatedAt, model_1.UpdatedAt, model_1.Name, model_1.Notes, model_1.Weight, (group.DisplayCurrency == null) ? \"\" : value_6(group.DisplayCurrency), model_1.Quantity, model_1.Frequency, model_1.AssetId, model_1.ActiveFrom, model_1.ActiveTo)), tupledArg_1[1]];\n return [new State(4, [patternInput_1[0]]), patternInput_1[1]];\n }, cashflowTypes);\n break;\n }\n default:\n throw new Error(\"Unsupported group type\");\n }\n const children = toList(delay(() => {\n const coreButtons = singleton_1(button(ofArray([new Option_1(0, [new Color_IColor(5, [])]), new Option_1(18, [(arg30$0040) => {\n DisplayHierarchy_addGroup(session, dispatch, new FSharpChoice$2(0, [group]), arg30$0040);\n }])]), ofArray([icon(empty(), singleton_1(Fa_i(singleton_1(Icons__ToIcon(new Icons(0, []))), []))), createElement(\"span\", {\n children: \"Add group\",\n })])));\n const extraButtons = map((tupledArg_2) => button(ofArray([new Option_1(0, [new Color_IColor(4, [])]), new Option_1(5, []), new Option_1(18, [(_arg) => {\n dispatch(new Msg(2, [tupledArg_2[0]]));\n }])]), ofArray([icon(empty(), singleton_1(Fa_i(singleton_1(Icons__ToIcon(new Icons(0, []))), []))), createElement(\"span\", {\n children: `Add ${tupledArg_2[1]}`,\n })])), states);\n return append(singleton(box$0027(empty(), ofArray([h3(empty())(singleton_1(\"Choose what to add to group\")), h4(singleton_1(new Option(6, [])))(singleton_1(group.Name))]))), delay(() => append(singleton(box$0027(empty(), singleton_1(list_3(singleton_1(new List_Option(1, [])), append_1(coreButtons, extraButtons))))), delay(() => singleton(button(ofArray([new Option_1(0, [new Color_IColor(7, [])]), new Option_1(18, [(_arg_1) => {\n DisplayHierarchy_viewByGroupType(group.GroupType, dispatch);\n }])]), ofArray([icon(empty(), singleton_1(Fa_i_1(singleton_1(new Fa_IconOption(11, [\"fas fa-undo-alt\"])), []))), createElement(\"span\", {\n children: \"Cancel\",\n })])))))));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n });\n}\n\nfunction DisplayHierarchy_getTotalsItem(totals, isActive) {\n return box$0027(empty(), singleton_1(h5(empty())(singleton_1(`Total: ${Omnicv_Shared_FinancialAPI_CurrencyValue__CurrencyValue_ToDisplayString(totals)}`))));\n}\n\nfunction DisplayHierarchy_depthToPrefix(depth) {\n if (depth > 0) {\n return replicate(depth, \"-\") + \" \";\n }\n else {\n return \"\";\n }\n}\n\nfunction DisplayHierarchy_processAsset(depth, asset, value, dispatch) {\n return box$0027(empty(), ofArray([h6(empty())(singleton_1(`${DisplayHierarchy_depthToPrefix(depth)}${asset.Name}: ${Omnicv_Shared_FinancialAPI_CurrencyValue__CurrencyValue_ToDisplayString(value)}`)), columns(ofArray([new Option_2(3, []), new Option_2(4, []), new Option_2(1, [])]), ofArray([column(singleton_1(new Option_3(0, [new Screen(0, []), new ISize(21, [])])), toList(delay(() => {\n let children;\n return append((asset.Notes != null) ? singleton((children = singleton_1(value_6(asset.Notes)), createElement(\"p\", {\n children: reactApi.Children.toArray(Array.from(children)),\n }))) : empty_1(), delay(() => {\n let children_2;\n return append(singleton((children_2 = singleton_1(FSharpMap__get_Item(assetTypesLookup, asset.AssetType)), createElement(\"span\", {\n children: reactApi.Children.toArray(Array.from(children_2)),\n }))), delay(() => append(singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\" | Currency: \"]),\n })), delay(() => singleton(asset.Currency)))));\n }));\n }))), column(empty(), singleton_1(list_3(singleton_1(new List_Option(2, [])), ofArray([button(ofArray([new Option_1(0, [new Color_IColor(4, [])]), new Option_1(5, []), new Option_1(18, [(_arg) => {\n dispatch(new Msg(2, [new State(5, [asset, createEditModel(new AssetValueData(get_Zero, get_Zero, undefined, common.getNow()))])]));\n }])]), singleton_1(icon(empty(), singleton_1(Fa_i(singleton_1(Icons__ToIcon(new Icons(0, []))), []))))), button(ofArray([new Option_1(0, [new Color_IColor(5, [])]), new Option_1(5, []), new Option_1(18, [(_arg_1) => {\n Router_modifyLocation(new Route(30, [asset.Id]));\n }])]), singleton_1(icon(empty(), singleton_1(Fa_i(singleton_1(Icons__ToIcon(new Icons(13, []))), []))))), button(ofArray([new Option_1(0, [new Color_IColor(5, [])]), new Option_1(5, []), new Option_1(18, [(_arg_2) => {\n dispatch(new Msg(2, [new State(3, [createEditModel(asset)])]));\n }])]), singleton_1(icon(empty(), singleton_1(Fa_i(singleton_1(Icons__ToIcon(new Icons(4, []))), [])))))]))))]))]));\n}\n\nfunction DisplayHierarchy_processCashflow(depth, cashflow, value, dispatch) {\n const now = utcNow();\n let patternInput;\n if (cashflow.tag === 1) {\n const auto = cashflow.fields[0];\n patternInput = [auto.Name, undefined, AutomaticCashflow__IsActive_7F9DDECF(auto, now), auto.CashflowType, auto.Frequency];\n }\n else {\n const cashflowInfo = cashflow.fields[0];\n patternInput = [cashflowInfo.Name, cashflowInfo.Notes, CashflowInfo__IsActive_7F9DDECF(cashflowInfo, now), cashflowInfo.CashflowType, cashflowInfo.Frequency];\n }\n const notes = patternInput[1];\n const cashflowType = patternInput[3] | 0;\n const modifiers = !patternInput[2] ? ofArray([new Modifier_IModifier(0, [new Color_IColor(14, [])]), new Modifier_IModifier(7, [new TextTransform_Option(3, [])])]) : ((cashflowType === 2) ? singleton_1(new Modifier_IModifier(1, [new Color_IColor(8, [])])) : empty());\n return box$0027(singleton_1(new Common_GenericOption(2, [modifiers])), ofArray([h6(singleton_1(new Option(10, [modifiers])))(singleton_1(`${DisplayHierarchy_depthToPrefix(depth)}${patternInput[0]}: ${Omnicv_Shared_FinancialAPI_CurrencyValue__CurrencyValue_ToDisplayString(value)}`)), columns(ofArray([new Option_2(3, []), new Option_2(4, []), new Option_2(1, [])]), ofArray([column(singleton_1(new Option_3(0, [new Screen(0, []), new ISize(21, [])])), toList(delay(() => {\n let children;\n return append((notes != null) ? singleton((children = singleton_1(value_6(notes)), createElement(\"p\", {\n children: reactApi.Children.toArray(Array.from(children)),\n }))) : empty_1(), delay(() => {\n let children_2;\n return append(singleton((children_2 = singleton_1(FSharpMap__get_Item(cashflowTypesLookup, cashflowType)), createElement(\"span\", {\n children: reactApi.Children.toArray(Array.from(children_2)),\n }))), delay(() => append(singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\" | Currency: \"]),\n })), delay(() => singleton(value.Currency)))));\n }));\n }))), column(empty(), toList(delay(() => ((cashflow.tag === 0) ? singleton(button(ofArray([new Option_1(0, [new Color_IColor(5, [])]), new Option_1(5, []), new Option_1(18, [(_arg) => {\n dispatch(new Msg(2, [new State(4, [createEditModel(cashflow.fields[0])])]));\n }])]), singleton_1(icon(empty(), singleton_1(Fa_i(singleton_1(Icons__ToIcon(new Icons(4, []))), [])))))) : singleton(defaultOf())))))]))]));\n}\n\nfunction DisplayHierarchy_processGroupNode(depth, inProgress, node, value, dispatch) {\n let depth_1;\n return cons(box$0027(singleton_1(new Common_GenericOption(2, [singleton_1(new Modifier_IModifier(0, [new Color_IColor(6, [])]))])), ofArray([h6(empty())(singleton_1(`${DisplayHierarchy_depthToPrefix(depth)}${node.Data.Name}: ${Omnicv_Shared_FinancialAPI_CurrencyValue__CurrencyValue_ToDisplayString(value)}`)), columns(ofArray([new Option_2(3, []), new Option_2(4, []), new Option_2(1, [])]), ofArray([column(empty(), toList(delay(() => append((node.Data.Notes != null) ? singleton(content(empty(), singleton_1(value_6(node.Data.Notes)))) : empty_1(), delay(() => ((node.Data.DisplayCurrency != null) ? singleton(content(empty(), ofArray([createElement(\"span\", {\n children: reactApi.Children.toArray([\"Currency: \"]),\n }), value_6(node.Data.DisplayCurrency)]))) : empty_1())))))), column(empty(), singleton_1(list_3(singleton_1(new List_Option(2, [])), ofArray([button(ofArray([new Option_1(0, [new Color_IColor(4, [])]), new Option_1(5, []), new Option_1(16, [inProgress]), new Option_1(18, [(_arg) => {\n dispatch(new Msg(2, [new State(6, [node.Data])]));\n }])]), singleton_1(icon(empty(), singleton_1(Fa_i(singleton_1(Icons__ToIcon(new Icons(0, []))), []))))), button(ofArray([new Option_1(0, [new Color_IColor(5, [])]), new Option_1(5, []), new Option_1(18, [(_arg_1) => {\n dispatch(new Msg(2, [new State(2, [createEditModel(node.Data)])]));\n }])]), singleton_1(icon(empty(), singleton_1(Fa_i(singleton_1(Icons__ToIcon(new Icons(4, []))), [])))))]))))]))])), collect((depth_1 = ((depth + 1) | 0), (node_1) => DisplayHierarchy_processChildNode(dispatch, depth_1, inProgress, node_1)), node.Children));\n}\n\nexport function DisplayHierarchy_processChildNode(dispatch, depth, inProgress, node) {\n switch (node.tag) {\n case 1:\n return singleton_1(DisplayHierarchy_processAsset(depth, node.fields[0], node.fields[1], dispatch));\n case 2:\n return singleton_1(DisplayHierarchy_processCashflow(depth, node.fields[0], node.fields[1], dispatch));\n default:\n return DisplayHierarchy_processGroupNode(depth, inProgress, node.fields[0], node.fields[1], dispatch);\n }\n}\n\nexport function DisplayHierarchy_buildTree(inProgress, tree_, tree__1, dispatch) {\n const tree = [tree_, tree__1];\n const totalItem = DisplayHierarchy_getTotalsItem(tree[1], false);\n return append_1(cons(totalItem, collect((tupledArg) => DisplayHierarchy_processGroupNode(0, inProgress, tupledArg[0], tupledArg[1], dispatch), tree[0])), singleton_1(totalItem));\n}\n\nexport function DisplayHierarchy_treeToList(inProgress, _arg, tree, dispatch) {\n let matchResult, value;\n if (tree != null) {\n if (!isEmpty(tree[0])) {\n matchResult = 0;\n value = tree;\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0:\n return DisplayHierarchy_buildTree(inProgress, value[0], value[1], dispatch);\n default:\n return singleton_1(createElement(\"div\", {\n children: reactApi.Children.toArray([\"No data yet\"]),\n }));\n }\n}\n\nexport function DisplayHierarchy_view(filter, groupType, session, model, dispatch) {\n let children_12, children_10, elems;\n const updateFilter = (newFilter) => {\n if (!equals(newFilter, filter)) {\n dispatch(new Msg(2, [DisplayHierarchy_groupTypeToState(groupType, newFilter)]));\n }\n };\n const preamble = toList(delay(() => {\n let children_4;\n const switchTabTrigger = (targetGroup) => (new Tab_Option(2, [singleton_1(new DOMAttr(40, [(_arg_2) => {\n DisplayHierarchy_viewByGroupType(targetGroup, dispatch);\n }]))]));\n let patternInput;\n const matchValue_1 = model.State;\n patternInput = ((matchValue_1.tag === 0) ? [valuesToSelectOptions(assetTypes, \"asset type\"), map_1((a) => {\n let copyOfStruct = a;\n return int32ToString(copyOfStruct);\n }, matchValue_1.fields[0].AssetType)] : ((matchValue_1.tag === 1) ? [valuesToSelectOptions(cashflowTypes, \"cashflow type\"), map_1((a_1) => {\n let copyOfStruct_1 = a_1;\n return int32ToString(copyOfStruct_1);\n }, matchValue_1.fields[0].CashflowType)] : [empty(), undefined]));\n const typeOptions = patternInput[0];\n const currentValue = patternInput[1];\n return append(singleton((children_4 = toList(delay(() => append(singleton(div(singleton_1(new Option_4(1, [])), ofArray([input(ofArray([new Option_5(1, [new IInputType(0, [])]), new Option_5(0, [new Size_ISize(0, [])]), new Option_5(12, [\"Search\"]), new Option_5(8, [defaultArg(filter.Content, \"\")]), new Option_5(13, [(event) => {\n const elem = event.target;\n updateFilter(new EntryFilter(filter.Currency, isNullOrWhiteSpace(elem.value) ? undefined : elem.value, filter.AssetType, filter.CashflowType));\n }])])), icon(ofArray([new Option_6(0, [new Size_ISize(0, [])]), new Option_6(1, [])]), singleton_1(Fa_i_1(singleton_1(new Fa_IconOption(11, [\"fas fa-search\"])), [])))]))), delay(() => {\n let props, children;\n return append(singleton(div(singleton_1(new Option_4(1, [])), ofArray([select(empty(), singleton_1((props = [new DOMAttr(9, [(event_2) => {\n const elem_2 = event_2.target;\n dispatch(new Msg(10, [isNullOrWhiteSpace(elem_2.value) ? undefined : elem_2.value]));\n }]), new HTMLAttr(161, [getDisplayCurrency(session, model)])], (children = supportedCurrenciesForEditingOptions(\"display currency\"), react.createElement(\"select\", keyValueList(props, 1), ...children))))), icon(ofArray([new Option_6(0, [new Size_ISize(0, [])]), new Option_6(1, [])]), singleton_1(Fa_i_1(singleton_1(new Fa_IconOption(11, [\"fas fa-money-bill-alt\"])), [])))]))), delay(() => {\n let props_2;\n return !isEmpty(typeOptions) ? singleton(div(singleton_1(new Option_4(1, [])), ofArray([select(empty(), singleton_1((props_2 = toList(delay(() => append(singleton(new DOMAttr(9, [(event_1) => {\n let matchValue;\n const elem_1 = event_1.target;\n if (!isNullOrWhiteSpace(elem_1.value)) {\n updateFilter((matchValue = model.State, (matchValue.tag === 0) ? (new EntryFilter(filter.Currency, filter.Content, map_1((tuple) => tuple[0], tryFind((tupledArg) => (int32ToString(tupledArg[0]) === elem_1.value), assetTypes)), filter.CashflowType)) : ((matchValue.tag === 1) ? (new EntryFilter(filter.Currency, filter.Content, filter.AssetType, map_1((tuple_1) => tuple_1[0], tryFind((tupledArg_1) => (int32ToString(tupledArg_1[0]) === elem_1.value), cashflowTypes)))) : filter)));\n }\n }])), delay(() => ((currentValue != null) ? singleton(new HTMLAttr(161, [value_6(currentValue)])) : empty_1()))))), react.createElement(\"select\", keyValueList(props_2, 1), ...typeOptions)))), icon(ofArray([new Option_6(0, [new Size_ISize(0, [])]), new Option_6(1, [])]), singleton_1(Fa_i_1(singleton_1(new Fa_IconOption(11, [\"fas fa-list-ol\"])), [])))]))) : empty_1();\n }));\n })))), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_4)),\n }))), delay(() => singleton(tabs(singleton_1(new Option_7(1, [])), [tab(ofArray([new Tab_Option(0, [groupType === 1]), switchTabTrigger(1)]), singleton_1(createElement(\"a\", {\n children: reactApi.Children.toArray([\"Assets\"]),\n }))), tab(ofArray([new Tab_Option(0, [groupType === 2]), switchTabTrigger(2)]), singleton_1(createElement(\"a\", {\n children: reactApi.Children.toArray([\"Cashflows\"]),\n })))]))));\n }));\n const inProgress = model.InProgress;\n const mainControlButtons = singleton_1((children_12 = singleton_1(list_3(empty(), ofArray([button(ofArray([new Option_1(0, [new Color_IColor(5, [])]), new Option_1(16, [inProgress]), new Option_1(18, [(_arg_3) => {\n dispatch(new Msg(0, []));\n }])]), ofArray([icon(empty(), toList(delay(() => (inProgress ? singleton(Fa_i(ofArray([Icons__ToIcon(new Icons(6, [])), new Fa_IconOption(12, [])]), [])) : singleton(Fa_i(singleton_1(Icons__ToIcon(new Icons(5, []))), [])))))), (children_10 = toList(delay(() => (inProgress ? singleton(\"Loading...\") : singleton(\"Reload\")))), createElement(\"span\", {\n children: reactApi.Children.toArray(Array.from(children_10)),\n }))])), button(ofArray([new Option_1(0, [new Color_IColor(4, [])]), new Option_1(16, [inProgress]), new Option_1(4, []), new Option_1(18, [(arg30$0040) => {\n DisplayHierarchy_addGroup(session, dispatch, new FSharpChoice$2(1, [groupType]), arg30$0040);\n }])]), singleton_1(\"Add group\")), button(ofArray([new Option_1(0, [new Color_IColor(4, [])]), new Option_1(16, [inProgress]), new Option_1(4, []), new Option_1(18, [(_arg_4) => {\n dispatch(new Msg(2, [new State(7, [FileUploadData_Default()])]));\n }])]), singleton_1(\"Import\")), button(ofArray([new Option_1(0, [new Color_IColor(4, [])]), new Option_1(16, [inProgress]), new Option_1(4, [])]), singleton_1(\"Export\")), button(ofArray([new Option_1(0, [new Color_IColor(6, [])]), new Option_1(16, [inProgress]), new Option_1(18, [(_arg_5) => {\n Router_modifyLocation(new Route(31, []));\n }])]), singleton_1(\"Asset values\"))]))), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_12)),\n })));\n const progressModal = inProgress ? singleton_1(busyModal(inProgress, \"Please wait\")) : empty();\n const mainViewElements = DisplayHierarchy_treeToList(inProgress, groupType, tryFind_1(groupType, model.FinancialTree), dispatch);\n return createElement(\"div\", createObj(singleton_1((elems = append_1(progressModal, append_1((length(mainControlButtons) < 2) ? preamble : append_1(preamble, mainControlButtons), append_1(mainViewElements, mainControlButtons))), [\"children\", reactApi.Children.toArray(Array.from(elems))]))));\n}\n\nexport function DisplayHierarchy_updateImport(session, msg, data) {\n switch (msg.tag) {\n case 1:\n return [new FileUploadData(msg.fields[1], msg.fields[0], false, undefined), Cmd_none()];\n case 2: {\n const bytes_1 = msg.fields[0];\n return [new FileUploadData(data.CurrentFileName, bytes_1, true, undefined), Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, curry2(financialService.ImportHierarchyData)(Session__GetCurrentProfileId(session)), bytes_1, () => (new FileUploadMsg(3, [undefined])), (Item_4) => (new FileUploadMsg(4, [Item_4])))];\n }\n case 3:\n return [new FileUploadData(undefined, undefined, false, undefined), Cmd_none()];\n case 4:\n return [new FileUploadData(undefined, undefined, false, exnToDisplayString(msg.fields[0])), Cmd_none()];\n default:\n return [new FileUploadData(undefined, undefined, true, undefined), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, handleFileEvent, msg.fields[0], (tupledArg) => (new FileUploadMsg(1, [tupledArg[0], tupledArg[1]])), (Item_2) => (new FileUploadMsg(4, [Item_2])))];\n }\n}\n\nexport function DisplayHierarchy_viewImport(inProgress, data, dispatch) {\n const caption = defaultArg(data.CurrentFileName, \"Choose a file\");\n return content(empty(), ofArray([h2(empty())(singleton_1(\"Import file\")), div_1(singleton_1(new Option_8(0, [])), ofArray([file_1(singleton_1(new Option_9(10, [])), singleton_1(Label_label(empty(), ofArray([input_1(singleton_1(new Common_GenericOption(1, [singleton_1(new DOMAttr(9, [(arg_1) => {\n dispatch(new Msg(9, [new FileUploadMsg(0, [arg_1])]));\n }]))]))), cta(empty(), ofArray([icon_1(empty(), singleton_1(icon(empty(), singleton_1(Fa_i_1(singleton_1(new Fa_IconOption(11, [\"fas fa-upload\"])), []))))), Label_label(empty(), singleton_1(\"Import: \"))])), name_12(empty(), singleton_1(caption))])))), div(empty(), singleton_1(button(ofArray([new Option_1(18, [(_arg) => {\n const matchValue = data.Data;\n if (matchValue == null) {\n }\n else {\n dispatch(new Msg(9, [new FileUploadMsg(2, [matchValue])]));\n }\n }]), new Option_1(0, [new Color_IColor(5, [])]), new Option_1(16, [inProgress ? true : !FileUploadData__CanSubmit(data)])]), singleton_1(\"Import\"))))]))]));\n}\n\nconst Main_service = financialService;\n\nexport function Main_init() {\n return [new Model(undefined, empty_2({\n Compare: comparePrimitives,\n }), new State(0, [EntryFilter_get_Empty()]), false, undefined, undefined), singleton_1((dispatch) => {\n dispatch(new Msg(0, []));\n })];\n}\n\nexport function Main_update(session, msg, model) {\n let matchResult, newCurrency, result, state, record, subMsg, subMsg_1, subMsg_2, subMsg_3, subMsg_4, ex;\n switch (msg.tag) {\n case 10: {\n matchResult = 1;\n newCurrency = msg.fields[0];\n break;\n }\n case 1: {\n matchResult = 2;\n result = msg.fields[0];\n break;\n }\n case 2: {\n matchResult = 3;\n state = msg.fields[0];\n break;\n }\n case 3: {\n matchResult = 4;\n break;\n }\n case 5: {\n switch (msg.fields[0].tag) {\n case 2: {\n matchResult = 5;\n break;\n }\n case 3: {\n matchResult = 6;\n record = msg.fields[0].fields[0];\n break;\n }\n default: {\n matchResult = 7;\n subMsg = msg.fields[0];\n }\n }\n break;\n }\n case 6: {\n switch (msg.fields[0].tag) {\n case 2:\n case 3: {\n matchResult = 8;\n break;\n }\n default: {\n matchResult = 9;\n subMsg_1 = msg.fields[0];\n }\n }\n break;\n }\n case 7: {\n if (msg.fields[0].tag === 2) {\n matchResult = 10;\n }\n else {\n matchResult = 11;\n subMsg_2 = msg.fields[0];\n }\n break;\n }\n case 8: {\n switch (msg.fields[0].tag) {\n case 2:\n case 3: {\n matchResult = 12;\n break;\n }\n default: {\n matchResult = 13;\n subMsg_3 = msg.fields[0];\n }\n }\n break;\n }\n case 9: {\n if (msg.fields[0].tag === 3) {\n matchResult = 14;\n }\n else {\n matchResult = 15;\n subMsg_4 = msg.fields[0];\n }\n break;\n }\n case 4: {\n matchResult = 16;\n ex = msg.fields[0];\n break;\n }\n default:\n matchResult = 0;\n }\n switch (matchResult) {\n case 0:\n return [new Model(model.FinancialHierarchy, model.FinancialTree, model.State, true, model.Error, model.DisplayCurrency), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry2(Main_service.GetHierarchy)(Session__GetCurrentProfileId(session)), getDisplayCurrency(session, model), (Item) => (new Msg(1, [Item])), (Item_1) => (new Msg(4, [Item_1])))];\n case 1:\n return [new Model(model.FinancialHierarchy, model.FinancialTree, model.State, model.InProgress, model.Error, newCurrency), singleton_1((dispatch) => {\n dispatch(new Msg(0, []));\n })];\n case 2:\n return [new Model(result, FinancialHierarchy__BuildMapTree_Z59A20369(result, Model__GetCurrentFilters(model)), model.State, false, undefined, model.DisplayCurrency), Cmd_none()];\n case 3:\n return [new Model(model.FinancialHierarchy, model.FinancialTree, state, model.InProgress, model.Error, model.DisplayCurrency), singleton_1((dispatch_1) => {\n dispatch_1(new Msg(0, []));\n })];\n case 4:\n return [model, singleton_1((dispatch_2) => {\n dispatch_2(new Msg(0, []));\n })];\n case 5: {\n const matchValue = model.State;\n if (matchValue.tag === 2) {\n return [new Model(model.FinancialHierarchy, model.FinancialTree, DisplayHierarchy_groupTypeToState(matchValue.fields[0].Data.GroupType, EntryFilter_get_Empty()), model.InProgress, model.Error, model.DisplayCurrency), singleton_1((dispatch_3) => {\n dispatch_3(new Msg(0, []));\n })];\n }\n else {\n return [model, Cmd_none()];\n }\n }\n case 6:\n return [new Model(model.FinancialHierarchy, model.FinancialTree, DisplayHierarchy_groupTypeToState(record.GroupType, EntryFilter_get_Empty()), model.InProgress, model.Error, model.DisplayCurrency), singleton_1((dispatch_4) => {\n dispatch_4(new Msg(0, []));\n })];\n case 7: {\n const matchValue_1 = model.State;\n if (matchValue_1.tag === 2) {\n const patternInput = Groups_update(session, subMsg, matchValue_1.fields[0]);\n return [new Model(model.FinancialHierarchy, model.FinancialTree, new State(2, [patternInput[0]]), model.InProgress, model.Error, model.DisplayCurrency), Cmd_map((Item_2) => (new Msg(5, [Item_2])), patternInput[1])];\n }\n else {\n return [model, Cmd_none()];\n }\n }\n case 8:\n return [new Model(model.FinancialHierarchy, model.FinancialTree, new State(0, [EntryFilter_get_Empty()]), model.InProgress, model.Error, model.DisplayCurrency), singleton_1((dispatch_5) => {\n dispatch_5(new Msg(0, []));\n })];\n case 9: {\n const matchValue_2 = model.State;\n if (matchValue_2.tag === 3) {\n const patternInput_1 = Assets_update(session, subMsg_1, matchValue_2.fields[0]);\n return [new Model(model.FinancialHierarchy, model.FinancialTree, new State(3, [patternInput_1[0]]), model.InProgress, model.Error, model.DisplayCurrency), Cmd_map((Item_3) => (new Msg(6, [Item_3])), patternInput_1[1])];\n }\n else {\n return [model, Cmd_none()];\n }\n }\n case 10:\n return [new Model(model.FinancialHierarchy, model.FinancialTree, new State(0, [EntryFilter_get_Empty()]), model.InProgress, model.Error, model.DisplayCurrency), singleton_1((dispatch_6) => {\n dispatch_6(new Msg(0, []));\n })];\n case 11: {\n const matchValue_3 = model.State;\n if (matchValue_3.tag === 5) {\n const asset = matchValue_3.fields[0];\n const patternInput_2 = Assets_updateValue(session, subMsg_2, asset, matchValue_3.fields[1]);\n return [new Model(model.FinancialHierarchy, model.FinancialTree, new State(5, [asset, patternInput_2[0]]), model.InProgress, model.Error, model.DisplayCurrency), Cmd_map((Item_4) => (new Msg(7, [Item_4])), patternInput_2[1])];\n }\n else {\n return [model, Cmd_none()];\n }\n }\n case 12:\n return [new Model(model.FinancialHierarchy, model.FinancialTree, new State(1, [EntryFilter_get_Empty()]), model.InProgress, model.Error, model.DisplayCurrency), singleton_1((dispatch_7) => {\n dispatch_7(new Msg(0, []));\n })];\n case 13: {\n const matchValue_4 = model.State;\n if (matchValue_4.tag === 4) {\n const patternInput_3 = Cashflows_update(session, subMsg_3, matchValue_4.fields[0]);\n return [new Model(model.FinancialHierarchy, model.FinancialTree, new State(4, [patternInput_3[0]]), model.InProgress, model.Error, model.DisplayCurrency), Cmd_map((Item_5) => (new Msg(8, [Item_5])), patternInput_3[1])];\n }\n else {\n return [model, Cmd_none()];\n }\n }\n case 14:\n return [new Model(model.FinancialHierarchy, model.FinancialTree, new State(0, [EntryFilter_get_Empty()]), false, undefined, model.DisplayCurrency), singleton_1((dispatch_8) => {\n dispatch_8(new Msg(0, []));\n })];\n case 15: {\n const matchValue_5 = model.State;\n if (matchValue_5.tag === 7) {\n const patternInput_4 = DisplayHierarchy_updateImport(session, subMsg_4, matchValue_5.fields[0]);\n const resultModel = patternInput_4[0];\n return [new Model(model.FinancialHierarchy, model.FinancialTree, new State(7, [resultModel]), resultModel.InProgress, resultModel.Error, model.DisplayCurrency), Cmd_map((Item_6) => (new Msg(9, [Item_6])), patternInput_4[1])];\n }\n else {\n return [model, Cmd_none()];\n }\n }\n default:\n return [new Model(model.FinancialHierarchy, model.FinancialTree, model.State, false, exnToDisplayString(ex), model.DisplayCurrency), Cmd_none()];\n }\n}\n\nexport function Main_view(session, model, dispatch) {\n const viewHierarchy = (groupType, filter) => DisplayHierarchy_view(filter, groupType, session, model, dispatch);\n const children = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton(closeable(`Financial error: ${matchValue}`, new Class(4, []))) : singleton(defaultOf())), delay(() => {\n const matchValue_1 = model.State;\n return (matchValue_1.tag === 1) ? singleton(viewHierarchy(2, matchValue_1.fields[0])) : ((matchValue_1.tag === 2) ? singleton(Groups_viewForAddEdit(matchValue_1.fields[0], dispatch)) : ((matchValue_1.tag === 6) ? singleton(DisplayHierarchy_viewSelectAdd(session, matchValue_1.fields[0], dispatch)) : ((matchValue_1.tag === 3) ? singleton(Assets_viewForAddEdit(matchValue_1.fields[0], dispatch)) : ((matchValue_1.tag === 4) ? singleton(Cashflows_viewForAddEdit(matchValue_1.fields[0], dispatch)) : ((matchValue_1.tag === 5) ? singleton(Assets_viewAddValue(matchValue_1.fields[0], matchValue_1.fields[1], dispatch)) : ((matchValue_1.tag === 7) ? singleton(DisplayHierarchy_viewImport(model.InProgress, matchValue_1.fields[0], dispatch)) : singleton(viewHierarchy(1, matchValue_1.fields[0]))))))));\n }));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n });\n}\n\n","import { Union, Record } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { union_type, unit_type, class_type, record_type, string_type, bool_type, list_type, option_type, int64_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { AssetInfo_$reflection } from \"../../Omnicv.Shared/FinancialAPI.js\";\nimport { DataPoint_$reflection } from \"../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { ofArray, length, isEmpty, singleton, empty } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { createObj, equals, curry2 } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { valuesToTable, assetValueService, financialService } from \"./FinancialCommon.js\";\nimport { Session__GetCurrentProfileId } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { Cmd_none } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { responsiveChart, exnToDisplayString } from \"../../Omnicv.Client.Common/Utils.js\";\nimport { empty as empty_1, singleton as singleton_1, append, delay, toList } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Class, closeable } from \"../../Omnicv.Client.Common/Components/Notification.js\";\nimport { defaultOf } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { value as value_10 } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { h4, Option, h2, h1 } from \"../../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { reactApi } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { ResponsiveContainer } from \"recharts\";\nimport { createElement } from \"react\";\nimport { reactApi as reactApi_1 } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\n\nexport class Model extends Record {\n constructor(Id, Asset, Data, InProgress, Error$) {\n super();\n this.Id = Id;\n this.Asset = Asset;\n this.Data = Data;\n this.InProgress = InProgress;\n this.Error = Error$;\n }\n}\n\nexport function Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Financial.ViewAsset.Component.Model\", [], Model, () => [[\"Id\", int64_type], [\"Asset\", option_type(AssetInfo_$reflection())], [\"Data\", list_type(DataPoint_$reflection())], [\"InProgress\", bool_type], [\"Error\", option_type(string_type)]]);\n}\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RequestData\", \"RequestAsset\", \"SuccessData\", \"SuccessAsset\", \"Failure\", \"DeleteValue\", \"DeleteSucceeded\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Financial.ViewAsset.Component.Msg\", [], Msg, () => [[], [], [[\"Item\", list_type(DataPoint_$reflection())]], [[\"Item\", AssetInfo_$reflection()]], [[\"Item\", class_type(\"System.Exception\")]], [[\"Item\", int64_type]], [[\"Item\", unit_type]]]);\n}\n\nexport function init(id) {\n return [new Model(id, undefined, empty(), false, undefined), singleton((dispatch) => {\n dispatch(new Msg(0, []));\n })];\n}\n\nexport function update(session, msg, model) {\n switch (msg.tag) {\n case 1:\n return [new Model(model.Id, model.Asset, model.Data, true, model.Error), Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, curry2(financialService.GetAsset)(Session__GetCurrentProfileId(session)), model.Id, (Item_2) => (new Msg(3, [Item_2])), (Item_3) => (new Msg(4, [Item_3])))];\n case 2:\n return [new Model(model.Id, model.Asset, msg.fields[0], false, undefined), singleton((dispatch) => {\n dispatch(new Msg(1, []));\n })];\n case 3:\n return [new Model(model.Id, msg.fields[0], model.Data, false, undefined), Cmd_none()];\n case 4:\n return [new Model(model.Id, undefined, empty(), false, exnToDisplayString(msg.fields[0])), Cmd_none()];\n case 5:\n return [new Model(model.Id, model.Asset, model.Data, true, model.Error), Cmd_OfAsyncWith_either((x_2) => {\n Cmd_OfAsync_start(x_2);\n }, curry2(assetValueService.DeleteRecord)(Session__GetCurrentProfileId(session)), msg.fields[0], () => (new Msg(6, [undefined])), (Item_5) => (new Msg(4, [Item_5])))];\n case 6:\n return [new Model(model.Id, model.Asset, model.Data, false, model.Error), singleton((dispatch_1) => {\n dispatch_1(new Msg(0, []));\n })];\n default:\n return [new Model(model.Id, model.Asset, model.Data, true, model.Error), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry2(assetValueService.GetRecordsForChart)(Session__GetCurrentProfileId(session)), model.Id, (Item) => (new Msg(2, [Item])), (Item_1) => (new Msg(4, [Item_1])))];\n }\n}\n\nexport function view(model, dispatch) {\n const children_2 = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Financial error: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => {\n let children;\n if (isEmpty(model.Data) ? true : (model.Asset == null)) {\n return singleton_1(\"No data\");\n }\n else {\n const asset = value_10(model.Asset);\n return singleton_1((children = toList(delay(() => append(singleton_1(h1(empty())(singleton(\"Asset values\"))), delay(() => append(singleton_1(h2(singleton(new Option(6, [])))(singleton(asset.Name))), delay(() => append(singleton_1(h4(singleton(new Option(6, [])))(singleton(`Currency: ${asset.Currency}`))), delay(() => {\n let properties, value_1;\n return append((length(model.Data) > 1) ? singleton_1((properties = ofArray([(value_1 = (100 + \"%\"), (equals(value_1, 100 + \"%\") ? true : equals(value_1, 100 + \"%\")) ? [\"width\", 99 + \"%\"] : [\"width\", value_1]), [\"height\", 300], [\"children\", responsiveChart(\"Value change over time\", model.Data)]]), reactApi.createElement(ResponsiveContainer, createObj(properties)))) : empty_1(), delay(() => append(singleton_1(h4(empty())(singleton(\"Values\"))), delay(() => singleton_1(valuesToTable(asset.Currency, model.Data, (id) => {\n dispatch(new Msg(5, [id]));\n }))))));\n })))))))), createElement(\"div\", {\n children: reactApi_1.Children.toArray(Array.from(children)),\n })));\n }\n }));\n }));\n return createElement(\"div\", {\n children: reactApi_1.Children.toArray(Array.from(children_2)),\n });\n}\n\n","import { Union, Record } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { DataPoint_$reflection } from \"../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { union_type, class_type, record_type, option_type, string_type, bool_type, list_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { ofArray, length, isEmpty, singleton, empty } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { Cmd_none } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { responsiveChart, exnToDisplayString } from \"../../Omnicv.Client.Common/Utils.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { createObj, equals, curry2 } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { valuesToTable, financialService } from \"./FinancialCommon.js\";\nimport { Session__GetCurrentProfileId } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { empty as empty_1, singleton as singleton_1, append, delay, toList } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Class, closeable } from \"../../Omnicv.Client.Common/Components/Notification.js\";\nimport { defaultOf } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { Option, h4, h1 } from \"../../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { reactApi } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { ResponsiveContainer } from \"recharts\";\nimport { createElement } from \"react\";\nimport { reactApi as reactApi_1 } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\n\nexport const targetCurrency = \"USD\";\n\nexport class Model extends Record {\n constructor(Data, InProgress, Error$) {\n super();\n this.Data = Data;\n this.InProgress = InProgress;\n this.Error = Error$;\n }\n}\n\nexport function Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Financial.ViewAssetsSummary.Component.Model\", [], Model, () => [[\"Data\", list_type(DataPoint_$reflection())], [\"InProgress\", bool_type], [\"Error\", option_type(string_type)]]);\n}\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RequestData\", \"SuccessData\", \"Failure\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Financial.ViewAssetsSummary.Component.Msg\", [], Msg, () => [[], [[\"Item\", list_type(DataPoint_$reflection())]], [[\"Item\", class_type(\"System.Exception\")]]]);\n}\n\nexport function init() {\n return [new Model(empty(), false, undefined), singleton((dispatch) => {\n dispatch(new Msg(0, []));\n })];\n}\n\nexport function update(session, msg, model) {\n switch (msg.tag) {\n case 1:\n return [new Model(msg.fields[0], false, undefined), Cmd_none()];\n case 2:\n return [new Model(empty(), false, exnToDisplayString(msg.fields[0])), Cmd_none()];\n default:\n return [new Model(model.Data, true, model.Error), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry2(financialService.GetAssetValuesForChart)(Session__GetCurrentProfileId(session)), targetCurrency, (Item) => (new Msg(1, [Item])), (Item_1) => (new Msg(2, [Item_1])))];\n }\n}\n\nexport function view(model, dispatch) {\n const children_2 = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Financial error: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => {\n let children;\n return isEmpty(model.Data) ? singleton_1(\"No data\") : singleton_1((children = toList(delay(() => append(singleton_1(h1(empty())(singleton(\"All asset values\"))), delay(() => append(singleton_1(h4(singleton(new Option(6, [])))(singleton(`Currency: ${targetCurrency}`))), delay(() => {\n let properties, value_1;\n return append((length(model.Data) > 1) ? singleton_1((properties = ofArray([(value_1 = (100 + \"%\"), (equals(value_1, 100 + \"%\") ? true : equals(value_1, 100 + \"%\")) ? [\"width\", 99 + \"%\"] : [\"width\", value_1]), [\"height\", 300], [\"children\", responsiveChart(\"Value change over time\", model.Data)]]), reactApi.createElement(ResponsiveContainer, createObj(properties)))) : empty_1(), delay(() => append(singleton_1(h4(empty())(singleton(\"Values\"))), delay(() => singleton_1(valuesToTable(targetCurrency, model.Data, undefined))))));\n })))))), createElement(\"div\", {\n children: reactApi_1.Children.toArray(Array.from(children)),\n })));\n }));\n }));\n return createElement(\"div\", {\n children: reactApi_1.Children.toArray(Array.from(children_2)),\n });\n}\n\n","import { FitnessClientModule_$ctor } from \"../../FitnessClientModule.js\";\nimport { Remoting_buildProxy_64DC51C } from \"../../fable_modules/Fable.Remoting.Client.7.32.0/Remoting.fs.js\";\nimport { RemotingModule_createApi, RemotingModule_withRouteBuilder } from \"../../fable_modules/Fable.Remoting.Client.7.32.0/Remoting.fs.js\";\nimport { isNullOrWhiteSpace, replace, format, printf, toText } from \"../../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { getWorkoutId, WorkoutRecord__IsActive, getExerciseId, RepsWithWeightRecord__E1RMDisplay, FitnessService_$reflection, IntervalsRepsRecord_$reflection, IntervalsDurationRecord_$reflection, EnduranceRecord_$reflection, RepsWithBodyWeightRecord_$reflection, RecordService$1_$reflection, RepsWithWeightRecord_$reflection } from \"../../Omnicv.Shared/FitnessAPI.js\";\nimport { Record, toString, Union } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { record_type, int32_type, string_type, class_type, name as name_4, lambda_type, unit_type, tuple_type, int64_type, union_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { ofSeq, cons, sum, max, head as head_1, filter, map, append, find, empty, isEmpty, collect, singleton, ofArray, item, insertAt, removeAt, length, findIndex } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { compare as compare_1, equals } from \"../../fable_modules/fable-library-js.4.24.0/BigInt.js\";\nimport * as flex_form from \"../../../src/javascript/flex-form.js\";\nimport { Route, Router_modifyLocation, Route_$reflection } from \"../../Omnicv.Client.Common/Router.js\";\nimport { Option, button } from \"../../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { Modifier_IModifier, TextAlignment_Option, Screen, Size_ISize, Color_IColor } from \"../../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { Option as Option_1, icon } from \"../../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport { Fa_i } from \"../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { Icons__ToIcon } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { Session__SiteSettings, Icons } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { Option as Option_2, columns } from \"../../fable_modules/Fulma.3.0.0/Layouts/Columns.fs.js\";\nimport { Option as Option_3, column } from \"../../fable_modules/Fulma.3.0.0/Layouts/Column.fs.js\";\nimport { createElement } from \"react\";\nimport { Markdown_ToHtml_1BFEAEDB } from \"../../fable_modules/Fable.Formatting.Markdown.1.0.1/Markdown.fs.js\";\nimport { DOMAttr } from \"../../fable_modules/Fable.React.9.4.0/Fable.React.Props.fs.js\";\nimport { reactApi } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { getBasicEventInfoData, splitSeconds } from \"../../Omnicv.Client.Common/Utils.js\";\nimport { map as map_1, value as value_6 } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { FSharpMap__get_Keys, tryFind, empty as empty_2, ofList, FSharpMap__ContainsKey, FSharpMap__TryFind, FSharpMap__get_Item } from \"../../fable_modules/fable-library-js.4.24.0/Map.js\";\nimport { distinct, List_groupBy, List_distinct } from \"../../fable_modules/fable-library-js.4.24.0/Seq2.js\";\nimport { curry2, compare, structuralHash, equals as equals_2, dateHash, stringHash, int64ToString, int32ToString, comparePrimitives, numberHash } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { compare as compare_2, equals as equals_1, utcNow } from \"../../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport { toDateTime, toString as toString_1, fromDateTime } from \"../../fable_modules/fable-library-js.4.24.0/DateOnly.js\";\nimport { sortDescending, empty as empty_1, singleton as singleton_1, append as append_1, delay, toList } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport * as common from \"../../../src/javascript/common.js\";\nimport { StringBuilder__Append_Z721C83C5, StringBuilder__Append_Z524259A4, StringBuilder_$ctor_Z721C83C5 } from \"../../fable_modules/fable-library-js.4.24.0/System.Text.js\";\nimport { defaultOf } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\n\nexport const fitnessModule = FitnessClientModule_$ctor();\n\nexport const repsWithWeightRecordService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder((arg, m) => toText(printf(\"/api/auth/mod/fit/%s/%s\"))(\"RepsWithWeightRecord\")(m), RemotingModule_createApi()), RecordService$1_$reflection(RepsWithWeightRecord_$reflection()));\n\nexport const repsWithBodyWeightRecordService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder((arg, m) => toText(printf(\"/api/auth/mod/fit/%s/%s\"))(\"RepsWithBodyWeightRecord\")(m), RemotingModule_createApi()), RecordService$1_$reflection(RepsWithBodyWeightRecord_$reflection()));\n\nexport const enduranceRecordService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder((arg, m) => toText(printf(\"/api/auth/mod/fit/%s/%s\"))(\"EnduranceRecord\")(m), RemotingModule_createApi()), RecordService$1_$reflection(EnduranceRecord_$reflection()));\n\nexport const intervalsDurationRecordService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder((arg, m) => toText(printf(\"/api/auth/mod/fit/%s/%s\"))(\"IntervalsDurationRecord\")(m), RemotingModule_createApi()), RecordService$1_$reflection(IntervalsDurationRecord_$reflection()));\n\nexport const intervalsRepsRecordService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder((arg, m) => toText(printf(\"/api/auth/mod/fit/%s/%s\"))(\"IntervalsRepsRecord\")(m), RemotingModule_createApi()), RecordService$1_$reflection(IntervalsRepsRecord_$reflection()));\n\nexport const fitnessService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder((arg, m) => toText(printf(\"/api/auth/mod/fit-main/%s\"))(m), RemotingModule_createApi()), FitnessService_$reflection());\n\nexport class RemoveType extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Delete\", \"Unlink\"];\n }\n}\n\nexport function RemoveType_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Fitness.Common.RemoveType\", [], RemoveType, () => [[], []]);\n}\n\nexport class MoveAction extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Up\", \"Down\", \"Top\", \"Bottom\"];\n }\n}\n\nexport function MoveAction_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Fitness.Common.MoveAction\", [], MoveAction, () => [[], [], [], []]);\n}\n\nexport function moveEntryInList(entries, entryId, moveAction) {\n const index = findIndex((entry) => equals(flex_form.getId(entry), entryId), entries) | 0;\n const isLast = index === (length(entries) - 1);\n const targetIndex = (moveAction.tag === 2) ? ((index === 0) ? undefined : 0) : ((moveAction.tag === 1) ? (isLast ? undefined : (index + 1)) : ((moveAction.tag === 3) ? (isLast ? undefined : (length(entries) - 1)) : ((index === 0) ? undefined : (index - 1))));\n if (targetIndex == null) {\n return entries;\n }\n else {\n const targetIndex_1 = targetIndex | 0;\n const source_1 = removeAt(index, entries);\n return insertAt(targetIndex_1, item(index, entries), source_1);\n }\n}\n\nexport class FitnessAction extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Reorder\", \"Delete\", \"Unlink\", \"Edit\", \"View\", \"CloneData\", \"MarkFavourite\"];\n }\n}\n\nexport function FitnessAction_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Fitness.Common.FitnessAction\", [], FitnessAction, () => [[[\"Item\", lambda_type(tuple_type(int64_type, MoveAction_$reflection()), unit_type)]], [[\"Item\", lambda_type(int64_type, unit_type)]], [[\"Item\", lambda_type(int64_type, unit_type)]], [[\"Item\", lambda_type(int64_type, Route_$reflection())]], [[\"Item\", lambda_type(int64_type, Route_$reflection())]], [[\"Item\", lambda_type(int64_type, unit_type)]], [[\"Item\", lambda_type(int64_type, unit_type)]]]);\n}\n\nfunction createFitnessListAction(id, action) {\n switch (action.tag) {\n case 1:\n return singleton(button(ofArray([new Option(0, [new Color_IColor(8, [])]), new Option(5, []), new Option(18, [(_arg_4) => {\n if (window.confirm(`${\"Confirm delete\"}:\n${\"Are you sure you want to delete this entry?\"}`)) {\n (() => {\n action.fields[0](id);\n })();\n }\n }])]), singleton(icon(singleton(new Option_1(0, [new Size_ISize(0, [])])), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(2, []))), []))))));\n case 2:\n return singleton(button(ofArray([new Option(0, [new Color_IColor(12, [])]), new Option(5, []), new Option(18, [(_arg_5) => {\n if (window.confirm(`${\"Confirm unlink\"}:\n${\"Are you sure you want to unlink this entry?\"}`)) {\n (() => {\n action.fields[0](id);\n })();\n }\n }])]), singleton(icon(singleton(new Option_1(0, [new Size_ISize(0, [])])), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(3, []))), []))))));\n case 5:\n return singleton(button(ofArray([new Option(0, [new Color_IColor(6, [])]), new Option(5, []), new Option(18, [(_arg_6) => {\n action.fields[0](id);\n }])]), singleton(icon(singleton(new Option_1(0, [new Size_ISize(0, [])])), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(1, []))), []))))));\n case 6:\n return singleton(button(ofArray([new Option(0, [new Color_IColor(12, [])]), new Option(5, []), new Option(18, [(_arg_7) => {\n action.fields[0](id);\n }])]), singleton(icon(singleton(new Option_1(0, [new Size_ISize(0, [])])), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(18, []))), []))))));\n case 3:\n return singleton(button(ofArray([new Option(0, [new Color_IColor(4, [])]), new Option(5, []), new Option(18, [(_arg_8) => {\n Router_modifyLocation(action.fields[0](id));\n }])]), singleton(icon(singleton(new Option_1(0, [new Size_ISize(0, [])])), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(4, []))), []))))));\n case 4:\n return singleton(button(ofArray([new Option(0, [new Color_IColor(5, [])]), new Option(5, []), new Option(18, [(_arg_9) => {\n Router_modifyLocation(action.fields[0](id));\n }])]), singleton(icon(singleton(new Option_1(0, [new Size_ISize(0, [])])), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(13, []))), []))))));\n default: {\n const moveFunc = action.fields[0];\n return ofArray([button(ofArray([new Option(0, [new Color_IColor(4, [])]), new Option(5, []), new Option(18, [(_arg) => {\n moveFunc([id, new MoveAction(0, [])]);\n }])]), singleton(icon(singleton(new Option_1(0, [new Size_ISize(0, [])])), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(14, []))), []))))), button(ofArray([new Option(0, [new Color_IColor(4, [])]), new Option(5, []), new Option(18, [(_arg_1) => {\n moveFunc([id, new MoveAction(1, [])]);\n }])]), singleton(icon(singleton(new Option_1(0, [new Size_ISize(0, [])])), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(15, []))), []))))), button(ofArray([new Option(0, [new Color_IColor(4, [])]), new Option(5, []), new Option(18, [(_arg_2) => {\n moveFunc([id, new MoveAction(2, [])]);\n }])]), singleton(icon(singleton(new Option_1(0, [new Size_ISize(0, [])])), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(16, []))), []))))), button(ofArray([new Option(0, [new Color_IColor(4, [])]), new Option(5, []), new Option(18, [(_arg_3) => {\n moveFunc([id, new MoveAction(3, [])]);\n }])]), singleton(icon(singleton(new Option_1(0, [new Size_ISize(0, [])])), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(17, []))), [])))))]);\n }\n }\n}\n\nexport function createFitnessListActions(actions, id) {\n return collect((action) => createFitnessListAction(id, action), actions);\n}\n\nconst defaultDisplayWorkoutActions = singleton(new FitnessAction(4, [(Item) => (new Route(38, [Item]))]));\n\nexport function displayWorkout(actions, workout) {\n const finalActions = isEmpty(actions) ? defaultDisplayWorkoutActions : actions;\n return columns(ofArray([new Option_2(4, []), new Option_2(1, [])]), ofArray([column(empty(), singleton(workout.Name)), column(empty(), singleton(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(workout.Description),\n },\n }))), column(empty(), createFitnessListActions(finalActions, workout.Id))]));\n}\n\nconst defaultDisplayExerciseForRecordingActions = singleton(new FitnessAction(4, [(Item) => (new Route(42, [Item]))]));\n\nexport function displayClickableColumn(onClick, caption) {\n return column(singleton(new Option_3(3, [ofArray([new DOMAttr(40, [onClick]), [\"style\", {\n cursor: \"pointer\",\n }]])])), singleton(caption));\n}\n\nexport function displayExerciseForRecording(actions, workoutId, exercise) {\n const finalActions = isEmpty(actions) ? defaultDisplayExerciseForRecordingActions : actions;\n const children = singleton(columns(ofArray([new Option_2(4, []), new Option_2(1, [])]), ofArray([displayClickableColumn((_arg) => {\n let copyOfStruct;\n Router_modifyLocation(new Route(45, [exercise.ContentTypeId, exercise.Id, (copyOfStruct = workoutId, toString(copyOfStruct))]));\n }, exercise.Name), column(singleton(new Option_3(4, [singleton(new Modifier_IModifier(5, [new Screen(3, []), new TextAlignment_Option(3, [])]))])), createFitnessListActions(finalActions, exercise.Id))])));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n });\n}\n\nfunction formatSeconds(durationSecs) {\n const patternInput = splitSeconds(durationSecs);\n return format(\"{0:D2}:{1:D2}\", patternInput[0], patternInput[1]);\n}\n\nexport function displayRepsWithWeight(record) {\n let copyOfStruct;\n return [`${record.Weight}kg × ${record.Repetitions}, E1RM ${RepsWithWeightRecord__E1RMDisplay(record)}kg`, record.Notes, replace(name_4((copyOfStruct = record, RepsWithWeightRecord_$reflection())), \"Record\", \"\")];\n}\n\nexport function displayRepsWithBodyWeightRecord(record) {\n let copyOfStruct;\n return [`Body weight × ${record.Repetitions}`, record.Notes, replace(name_4((copyOfStruct = record, RepsWithBodyWeightRecord_$reflection())), \"Record\", \"\")];\n}\n\nexport function displayEnduranceRecord(record) {\n let copyOfStruct;\n return [`${record.DistanceKm}km in ${formatSeconds(record.DurationSec)}`, record.Notes, replace(name_4((copyOfStruct = record, EnduranceRecord_$reflection())), \"Record\", \"\")];\n}\n\nexport function displayIntervalsDurationRecord(record) {\n let copyOfStruct;\n return [`${record.NumExercises} exercises; work ${formatSeconds(record.WorkDurationSec)}; rest ${formatSeconds(record.RestDurationSec)}`, record.Notes, replace(name_4((copyOfStruct = record, IntervalsDurationRecord_$reflection())), \"Record\", \"\")];\n}\n\nexport function displayIntervalsRepsRecord(record) {\n let copyOfStruct;\n return [`${record.NumExercises} × ${record.NumExercises}; rest ${formatSeconds(record.RestDurationSec)}`, record.Notes, replace(name_4((copyOfStruct = record, IntervalsRepsRecord_$reflection())), \"Record\", \"\")];\n}\n\nexport function displayExerciseRecordCommon(session, deleteFunc, copyDataFunc, eventInfo, main, notes, recordName) {\n const descriptor = find((t) => (t.Name.indexOf(recordName) >= 0), Session__SiteSettings(session).FitnessContentTypes);\n const actions = append(map(value_6, filter((option_2) => (option_2 != null), ofArray([map_1((Item) => (new FitnessAction(1, [Item])), deleteFunc), map_1((Item_1) => (new FitnessAction(5, [Item_1])), copyDataFunc)]))), ofArray([new FitnessAction(4, [(id) => (new Route(44, [descriptor.Id, id]))]), new FitnessAction(3, [(id_1) => (new Route(46, [descriptor.Id, id_1]))])]));\n const hasNotes = (notes == null) ? \"\" : \" [notes]\";\n return columns(ofArray([new Option_2(4, []), new Option_2(1, [])]), ofArray([column(empty(), singleton(getBasicEventInfoData(eventInfo))), column(empty(), singleton(main + hasNotes)), column(empty(), createFitnessListActions(actions, eventInfo.Id))]));\n}\n\nfunction getExerciseRecordDisplayInfo(record) {\n switch (record.tag) {\n case 1:\n return displayRepsWithBodyWeightRecord(record.fields[0]);\n case 2:\n return displayEnduranceRecord(record.fields[0]);\n case 3:\n return displayIntervalsDurationRecord(record.fields[0]);\n case 4:\n return displayIntervalsRepsRecord(record.fields[0]);\n default:\n return displayRepsWithWeight(record.fields[0]);\n }\n}\n\nexport function displayExerciseRecord(session, deleteFunc, exerciseRecord_, exerciseRecord__1) {\n const exerciseRecord = [exerciseRecord_, exerciseRecord__1];\n const patternInput = getExerciseRecordDisplayInfo(exerciseRecord[1]);\n return displayExerciseRecordCommon(session, deleteFunc, undefined, exerciseRecord[0], patternInput[0], patternInput[1], patternInput[2]);\n}\n\nexport function displayExerciseRecordEx(session, exerciseMap, exerciseRecord_, exerciseRecord__1) {\n const exerciseRecord = [exerciseRecord_, exerciseRecord__1];\n const patternInput = getExerciseRecordDisplayInfo(exerciseRecord[1]);\n return displayExerciseRecordCommon(session, undefined, undefined, exerciseRecord[0], (FSharpMap__get_Item(exerciseMap, getExerciseId(exerciseRecord[0], exerciseRecord[1])).Name + \": \") + patternInput[0], patternInput[1], patternInput[2]);\n}\n\nfunction getRepetitionsFromExerciseRecord(exerciseRecord_, exerciseRecord__1) {\n const record = exerciseRecord__1;\n if (record.tag === 1) {\n return record.fields[0].Repetitions | 0;\n }\n else {\n return 0;\n }\n}\n\nfunction getE1RMFromExerciseRecord(exerciseRecord_, exerciseRecord__1) {\n const record = exerciseRecord__1;\n if (record.tag === 0) {\n return RepsWithWeightRecord__E1RMDisplay(record.fields[0]);\n }\n else {\n return 0;\n }\n}\n\nexport function getSummaryFromExerciseRecords(exerciseRecords) {\n const emptyRes = [\"\", \"\"];\n if (length(List_distinct(map((tupledArg) => tupledArg[0].ContentTypeId, exerciseRecords), {\n Equals: (x, y) => (x === y),\n GetHashCode: numberHash,\n })) !== 1) {\n return emptyRes;\n }\n else {\n const head = head_1(exerciseRecords)[1];\n switch (head.tag) {\n case 0: {\n const best = max(map((tupledArg_1) => getE1RMFromExerciseRecord(tupledArg_1[0], tupledArg_1[1]), exerciseRecords), {\n Compare: comparePrimitives,\n });\n return [\"Best E1RM\", best.toString() + \"kg\"];\n }\n case 1:\n return [\"Total\", int32ToString(sum(map((tupledArg_2) => getRepetitionsFromExerciseRecord(tupledArg_2[0], tupledArg_2[1]), exerciseRecords), {\n GetZero: () => 0,\n Add: (x_2, y_2) => (x_2 + y_2),\n }))];\n default:\n return emptyRes;\n }\n }\n}\n\nclass WorkoutRecordDescriptor extends Record {\n constructor(Date$, Name, Time, Progress, Count) {\n super();\n this.Date = Date$;\n this.Name = Name;\n this.Time = Time;\n this.Progress = Progress;\n this.Count = (Count | 0);\n }\n}\n\nfunction WorkoutRecordDescriptor_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Fitness.Common.WorkoutRecordDescriptor\", [], WorkoutRecordDescriptor, () => [[\"Date\", class_type(\"System.DateOnly\")], [\"Name\", string_type], [\"Time\", string_type], [\"Progress\", string_type], [\"Count\", int32_type]]);\n}\n\nfunction WorkoutRecordDescriptor_FromWorkoutRecord(workoutsMap, workoutRecordData) {\n const record = workoutRecordData[1];\n const eventInfo = workoutRecordData[0];\n const isActive = WorkoutRecord__IsActive(record, eventInfo, utcNow());\n let progress;\n const copyOfStruct = record.Progress * 100;\n progress = format('{0:' + \"F2\" + '}', copyOfStruct);\n let name;\n const matchValue = FSharpMap__TryFind(workoutsMap, record.WorkoutId);\n name = ((matchValue == null) ? int64ToString(record.Id) : matchValue.Name);\n return new WorkoutRecordDescriptor(fromDateTime(eventInfo.EventTimestamp), name, getBasicEventInfoData(eventInfo), (`${progress}% done`) + (isActive ? \" / active\" : \"\"), 1);\n}\n\nfunction WorkoutRecordDescriptor_FromExerciseRecord(exercisesMap, exerciseRecordData) {\n const eventInfo = exerciseRecordData[0];\n let name;\n const matchValue = FSharpMap__TryFind(exercisesMap, getExerciseId(exerciseRecordData[0], exerciseRecordData[1]));\n name = ((matchValue == null) ? int64ToString(eventInfo.Id) : matchValue.Name);\n return new WorkoutRecordDescriptor(fromDateTime(eventInfo.EventTimestamp), name, getBasicEventInfoData(eventInfo), \"100%\", 1);\n}\n\nfunction WorkoutRecordDescriptor_DisplayGroupAsSingle_Z40DA17B4(descriptors) {\n let final;\n if (length(descriptors) === 1) {\n final = head_1(descriptors);\n }\n else {\n const bind$0040 = head_1(descriptors);\n final = (new WorkoutRecordDescriptor(bind$0040.Date, bind$0040.Name, bind$0040.Time, bind$0040.Progress, length(descriptors)));\n }\n return columns(singleton(new Option_2(4, [])), toList(delay(() => append_1(singleton_1(column(empty(), singleton(final.Name))), delay(() => append_1(singleton_1(column(empty(), singleton(final.Time))), delay(() => append_1(singleton_1(column(empty(), singleton(final.Progress))), delay(() => ((final.Count > 1) ? singleton_1(column(empty(), singleton(`${final.Count} times`))) : empty_1()))))))))));\n}\n\nfunction WorkoutRecordDescriptor__get_GroupingKey(this$) {\n return this$.Name + this$.Progress;\n}\n\nfunction displayWorkoutRecord(workoutsMap, workoutRecordData_, workoutRecordData__1) {\n const workoutRecordData = [workoutRecordData_, workoutRecordData__1];\n const record = workoutRecordData[1];\n const eventInfo = workoutRecordData[0];\n return columns(singleton(new Option_2(4, [])), toList(delay(() => append_1(singleton_1(column(empty(), singleton(getBasicEventInfoData(eventInfo)))), delay(() => append_1(FSharpMap__ContainsKey(workoutsMap, record.WorkoutId) ? singleton_1(column(empty(), singleton(FSharpMap__get_Item(workoutsMap, record.WorkoutId).Name))) : singleton_1(column(empty(), singleton(int64ToString(eventInfo.Id)))), delay(() => append_1(singleton_1(column(empty(), toList(delay(() => {\n let copyOfStruct;\n return singleton_1(`${(copyOfStruct = (record.Progress * 100), format('{0:' + \"F2\" + '}', copyOfStruct))}% done`);\n })))), delay(() => singleton_1(column(empty(), createFitnessListActions(singleton(new FitnessAction(3, [(Item) => (new Route(49, [Item]))])), eventInfo.Id))))))))))));\n}\n\nfunction displayDescriptors(date, descriptors) {\n let arg;\n return append(singleton(createElement(\"div\", {\n className: \"divider\",\n children: `${toString_1(date)} (${(arg = toDateTime(date, 0), common.getDayName(arg, \"\"))}): ${length(descriptors)} record(s)`,\n })), map((tupledArg) => WorkoutRecordDescriptor_DisplayGroupAsSingle_Z40DA17B4(tupledArg[1]), List_groupBy(WorkoutRecordDescriptor__get_GroupingKey, descriptors, {\n Equals: (x, y) => (x === y),\n GetHashCode: stringHash,\n })));\n}\n\nfunction displayWorkoutRecordGroup(workoutsMap, workoutRecordLookup, date, workoutRecordData) {\n return displayDescriptors(date, map((workoutRecordData_1) => WorkoutRecordDescriptor_FromWorkoutRecord(workoutsMap, workoutRecordData_1), workoutRecordData));\n}\n\nfunction displayWorkoutRecordGroupPlain(workoutsMap, _workoutRecordLookup, date, workoutRecordData) {\n let arg;\n return append(singleton(createElement(\"div\", {\n className: \"divider\",\n children: `${toString_1(date)} (${(arg = toDateTime(date, 0), common.getDayName(arg, \"\"))}): ${length(workoutRecordData)} record(s)`,\n })), map((tupledArg) => displayWorkoutRecord(workoutsMap, tupledArg[0], tupledArg[1]), workoutRecordData));\n}\n\nfunction groupWorkoutRecords(workoutRecordData) {\n return List_groupBy((tupledArg) => fromDateTime(tupledArg[0].EventTimestamp), workoutRecordData, {\n Equals: equals_1,\n GetHashCode: dateHash,\n });\n}\n\nexport function displayWorkoutRecords(data) {\n const workoutRecordLookup = ofList(List_groupBy((tupledArg) => getWorkoutId(tupledArg[0], tupledArg[1]), data.ExerciseRecords, {\n Equals: equals_2,\n GetHashCode: structuralHash,\n }), {\n Compare: compare,\n });\n return collect((tupledArg_1) => displayWorkoutRecordGroup(empty_2({\n Compare: compare_1,\n }), workoutRecordLookup, tupledArg_1[0], tupledArg_1[1]), groupWorkoutRecords(data.WorkoutRecords));\n}\n\nexport function displayWorkoutRecordsOnly(workoutsMap, workoutRecordData) {\n return collect((tupledArg) => displayWorkoutRecordGroup(workoutsMap, empty_2({\n Compare: compare,\n }), tupledArg[0], tupledArg[1]), groupWorkoutRecords(workoutRecordData));\n}\n\nfunction displayDayWorkoutLog(session, date, workoutsMap, exercisesMap, workouts, exercises) {\n let arg;\n const sb = StringBuilder_$ctor_Z721C83C5(`${toString_1(date)} (${(arg = toDateTime(date, 0), common.getDayName(arg, \"\"))}): `);\n let workoutElements;\n if (workouts != null) {\n StringBuilder__Append_Z524259A4(StringBuilder__Append_Z721C83C5(sb, \"w: \"), length(value_6(workouts)));\n workoutElements = map((tupledArg) => displayWorkoutRecord(workoutsMap, tupledArg[0], tupledArg[1]), value_6(workouts));\n }\n else {\n workoutElements = empty();\n }\n let exercisesElements;\n if (exercises != null) {\n StringBuilder__Append_Z524259A4(StringBuilder__Append_Z721C83C5(sb, \" | e: \"), length(value_6(exercises)));\n exercisesElements = map((tupledArg_1) => displayExerciseRecordEx(session, exercisesMap, tupledArg_1[0], tupledArg_1[1]), value_6(exercises));\n }\n else {\n exercisesElements = empty();\n }\n return cons(createElement(\"div\", {\n className: \"divider\",\n children: toString(sb),\n }), append(workoutElements, exercisesElements));\n}\n\nexport function displayWorkoutLog(session, workoutLog) {\n let source_1;\n const workoutsMap = ofList(map((w) => [w.Id, w], workoutLog.Workouts), {\n Compare: compare_1,\n });\n const exercisesMap = ofList(map((w_1) => [w_1.Id, w_1], workoutLog.Exercises), {\n Compare: compare_1,\n });\n const workoutByDate = ofList(List_groupBy((tupledArg) => fromDateTime(tupledArg[0].EventTimestamp), workoutLog.RecentWorkoutRecords, {\n Equals: equals_1,\n GetHashCode: dateHash,\n }), {\n Compare: compare_2,\n });\n const exercisesByDate = ofList(List_groupBy((tupledArg_1) => fromDateTime(tupledArg_1[0].EventTimestamp), workoutLog.RecentExerciseRecords, {\n Equals: equals_1,\n GetHashCode: dateHash,\n }), {\n Compare: compare_2,\n });\n return collect((date) => displayDayWorkoutLog(session, date, workoutsMap, exercisesMap, tryFind(date, workoutByDate), tryFind(date, exercisesByDate)), ofSeq(sortDescending(distinct((source_1 = FSharpMap__get_Keys(workoutByDate), append_1(FSharpMap__get_Keys(exercisesByDate), source_1)), {\n Equals: equals_1,\n GetHashCode: dateHash,\n }), {\n Compare: compare_2,\n })));\n}\n\nexport function displayWorkoutRecordsOnlyPlain(workoutsMap, workoutRecordData) {\n return collect((tupledArg) => displayWorkoutRecordGroupPlain(workoutsMap, empty_2({\n Compare: compare,\n }), tupledArg[0], tupledArg[1]), groupWorkoutRecords(workoutRecordData));\n}\n\nexport function displayDailySingleExerciseRecords(session, displayRecord, group_, group__1) {\n let arg;\n const group = [group_, group__1];\n const exerciseRecords = group[1];\n const date = group[0];\n return append(singleton(createElement(\"div\", {\n className: \"divider\",\n children: `${toString_1(date)} (${(arg = toDateTime(date, 0), common.getDayName(arg, \"\"))}): ${length(exerciseRecords)} record(s)`,\n })), map(curry2(displayRecord)(session), exerciseRecords));\n}\n\nfunction displayDailyExerciseRecords(session, deleteFunc, group_, group__1) {\n let arg, patternInput, caption;\n const group = [group_, group__1];\n const exerciseRecords = group[1];\n const date = group[0];\n return append(singleton(createElement(\"div\", {\n className: \"divider\",\n children: `${toString_1(date)} (${(arg = toDateTime(date, 0), common.getDayName(arg, \"\"))}): ${length(exerciseRecords)} record(s)`,\n })), append(map((tupledArg) => displayExerciseRecord(session, deleteFunc, tupledArg[0], tupledArg[1]), exerciseRecords), singleton((patternInput = getSummaryFromExerciseRecords(exerciseRecords), (caption = patternInput[0], !isNullOrWhiteSpace(caption) ? columns(ofArray([new Option_2(4, []), new Option_2(1, [])]), ofArray([column(empty(), singleton(createElement(\"b\", {\n children: reactApi.Children.toArray([caption]),\n }))), column(empty(), singleton(patternInput[1]))])) : defaultOf())))));\n}\n\nexport function displayExerciseRecords(session, deleteFunc, exerciseRecords) {\n return collect((tupledArg_1) => displayDailyExerciseRecords(session, deleteFunc, tupledArg_1[0], tupledArg_1[1]), List_groupBy((tupledArg) => fromDateTime(tupledArg[0].EventTimestamp), exerciseRecords, {\n Equals: equals_1,\n GetHashCode: dateHash,\n }));\n}\n\n","import { Record, Union } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { tuple_type, lambda_type, int32_type, unit_type, record_type, string_type, bool_type, class_type, list_type, option_type, int64_type, union_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { ofArray, filter, map, append, isEmpty, singleton, empty } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { FSharpSet__get_IsEmpty, toList, FSharpSet__Add, FSharpSet__Remove, FSharpSet__Contains, empty as empty_1 } from \"../../fable_modules/fable-library-js.4.24.0/Set.js\";\nimport { equals as equals_1, compare } from \"../../fable_modules/fable-library-js.4.24.0/BigInt.js\";\nimport { displayExerciseRecords, displayWorkoutRecordsOnlyPlain, displayExerciseForRecording, displayWorkoutRecordsOnly, displayWorkout, displayWorkoutLog, displayClickableColumn, createFitnessListActions, FitnessAction, fitnessService, moveEntryInList, MoveAction_$reflection } from \"./FitnessCommon.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { Icons, Session__GetActiveWorkoutRecord, CompositeIcons, CompositeIcons__ToElement, Session__GetActiveWorkoutId, Session__GetCurrentProfileId } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { uncurry2, int64ToString, equals, curry3, curry2 } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { map as map_1, some, value as value_3 } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { Cmd_batch, Cmd_none } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport * as flex_form from \"../../../src/javascript/flex-form.js\";\nimport { Router_modifyLocation, Route, Router_newUrl } from \"../../Omnicv.Client.Common/Router.js\";\nimport { exnToDisplayString } from \"../../Omnicv.Client.Common/Utils.js\";\nimport { Option, columns } from \"../../fable_modules/Fulma.3.0.0/Layouts/Columns.fs.js\";\nimport { Option as Option_1, ISize, column } from \"../../fable_modules/Fulma.3.0.0/Layouts/Column.fs.js\";\nimport { Size_ISize, Color_IColor, Common_GenericOption, Screen } from \"../../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { input, checkbox } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Checkbox.fs.js\";\nimport { HTMLAttr, DOMAttr } from \"../../fable_modules/Fable.React.9.4.0/Fable.React.Props.fs.js\";\nimport { empty as empty_2, singleton as singleton_1, append as append_1, delay, toList as toList_1 } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Class, closeable } from \"../../Omnicv.Client.Common/Components/Notification.js\";\nimport { defaultOf } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { h5, h4, Option as Option_4, h3, h2 } from \"../../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { createElement } from \"react\";\nimport { reactApi } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { Option as Option_2, button, list as list_4 } from \"../../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { ExerciseRecord_$reflection, WorkoutLog__IsEmpty, FitnessHierarchy_$reflection } from \"../../Omnicv.Shared/FitnessAPI.js\";\nimport { Markdown_ToHtml_1BFEAEDB } from \"../../fable_modules/Fable.Formatting.Markdown.1.0.1/Markdown.fs.js\";\nimport { Option as Option_3, icon } from \"../../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport { empty as empty_3, ofList } from \"../../fable_modules/fable-library-js.4.24.0/Map.js\";\nimport { Fa_IconOption, Fa_i } from \"../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { Fa_i as Fa_i_1 } from \"../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { Icons__ToIcon } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { singleton as singleton_2 } from \"../../fable_modules/fable-library-js.4.24.0/AsyncBuilder.js\";\nimport { commonAuthService } from \"../../Omnicv.Client.Common/CommonServer.js\";\nimport { EventInfo_$reflection } from \"../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { zip } from \"../../fable_modules/fable-library-js.4.24.0/Array.js\";\n\nexport class ViewState extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Normal\", \"SelectCandidates\", \"Reorder\", \"ShowPlainHistory\"];\n }\n}\n\nexport function ViewState_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Fitness.MainFitnessView.Component.ViewState\", [], ViewState, () => [[], [], [], []]);\n}\n\nexport class Model$2 extends Record {\n constructor(Id, Data, Entries, CandidateEntries, SelectedCandidateEntries, InProgress, ViewState, Error$) {\n super();\n this.Id = Id;\n this.Data = Data;\n this.Entries = Entries;\n this.CandidateEntries = CandidateEntries;\n this.SelectedCandidateEntries = SelectedCandidateEntries;\n this.InProgress = InProgress;\n this.ViewState = ViewState;\n this.Error = Error$;\n }\n}\n\nexport function Model$2_$reflection(gen0, gen1) {\n return record_type(\"Omnicv.Client.Pages.Fitness.MainFitnessView.Component.Model`2\", [gen0, gen1], Model$2, () => [[\"Id\", int64_type], [\"Data\", option_type(gen0)], [\"Entries\", list_type(gen1)], [\"CandidateEntries\", list_type(gen1)], [\"SelectedCandidateEntries\", class_type(\"Microsoft.FSharp.Collections.FSharpSet`1\", [int64_type])], [\"InProgress\", bool_type], [\"ViewState\", ViewState_$reflection()], [\"Error\", option_type(string_type)]]);\n}\n\nexport function Model$2_Default_Z524259C1(id) {\n return new Model$2(id, undefined, empty(), empty(), empty_1({\n Compare: compare,\n }), false, new ViewState(0, []), undefined);\n}\n\nexport class Msg$2 extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RequestData\", \"RequestEntries\", \"SetState\", \"DataSuccess\", \"EntriesSuccess\", \"CandidateEntriesSuccess\", \"SubmitSelectedCandidates\", \"CandidateSetSuccess\", \"CancelCandidateSelection\", \"UpdateCandidate\", \"Failure\", \"DeleteRecord\", \"DeleteRecordSuccess\", \"DeleteEntry\", \"UnlinkEntry\", \"DeleteSuccess\", \"MoveEntry\", \"MoveSuccess\"];\n }\n}\n\nexport function Msg$2_$reflection(gen0, gen1) {\n return union_type(\"Omnicv.Client.Pages.Fitness.MainFitnessView.Component.Msg`2\", [gen0, gen1], Msg$2, () => [[[\"Item\", int64_type]], [], [[\"Item\", ViewState_$reflection()]], [[\"Item\", gen0]], [[\"Item\", list_type(gen1)]], [[\"Item\", list_type(gen1)]], [], [[\"Item\", unit_type]], [], [[\"Item\", int64_type]], [[\"Item\", class_type(\"System.Exception\")]], [], [[\"Item\", unit_type]], [[\"Item\", int64_type]], [[\"Item\", int64_type]], [[\"Item\", unit_type]], [[\"Item1\", int64_type], [\"Item2\", MoveAction_$reflection()]], [[\"Item\", unit_type]]]);\n}\n\nexport class CandidateFunctions$1 extends Record {\n constructor(Get, Set$, GetId) {\n super();\n this.Get = Get;\n this.Set = Set$;\n this.GetId = GetId;\n }\n}\n\nexport function CandidateFunctions$1_$reflection(gen0) {\n return record_type(\"Omnicv.Client.Pages.Fitness.MainFitnessView.Component.CandidateFunctions`1\", [gen0], CandidateFunctions$1, () => [[\"Get\", lambda_type(int32_type, lambda_type(int64_type, class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [list_type(gen0)])))], [\"Set\", lambda_type(int32_type, lambda_type(int64_type, lambda_type(list_type(int64_type), class_type(\"Microsoft.FSharp.Control.FSharpAsync`1\", [unit_type]))))], [\"GetId\", lambda_type(gen0, int64_type)]]);\n}\n\nexport function Common_update(getData, getEntries, updateEntries, candidateFuncs, deleteRecord, deleteEntry, session, msg, model) {\n let profileId_3, finalIds, profileId_7;\n switch (msg.tag) {\n case 1:\n return [new Model$2(model.Id, model.Data, model.Entries, model.CandidateEntries, model.SelectedCandidateEntries, true, model.ViewState, model.Error), Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, getEntries, Session__GetCurrentProfileId(session), (Item_2) => (new Msg$2(4, [Item_2])), (Item_3) => (new Msg$2(10, [Item_3])))];\n case 2: {\n const viewState = msg.fields[0];\n if (viewState.tag === 1) {\n if (candidateFuncs != null) {\n const profileId_2 = Session__GetCurrentProfileId(session) | 0;\n return [new Model$2(model.Id, model.Data, model.Entries, model.CandidateEntries, empty_1({\n Compare: compare,\n }), true, new ViewState(1, []), model.Error), Cmd_OfAsyncWith_either((x_3) => {\n Cmd_OfAsync_start(x_3);\n }, curry2(value_3(candidateFuncs).Get)(profileId_2), model.Id, (Item_4) => (new Msg$2(5, [Item_4])), (Item_5) => (new Msg$2(10, [Item_5])))];\n }\n else {\n return [model, Cmd_none()];\n }\n }\n else {\n return [new Model$2(model.Id, model.Data, model.Entries, model.CandidateEntries, model.SelectedCandidateEntries, model.InProgress, viewState, model.Error), Cmd_none()];\n }\n }\n case 3:\n return [new Model$2(model.Id, some(msg.fields[0]), model.Entries, model.CandidateEntries, model.SelectedCandidateEntries, false, model.ViewState, undefined), Cmd_none()];\n case 4:\n return [new Model$2(model.Id, model.Data, msg.fields[0], model.CandidateEntries, model.SelectedCandidateEntries, false, model.ViewState, undefined), Cmd_none()];\n case 5:\n return [new Model$2(model.Id, model.Data, model.Entries, msg.fields[0], model.SelectedCandidateEntries, false, model.ViewState, undefined), Cmd_none()];\n case 8:\n case 7:\n return [new Model$2(model.Id, model.Data, model.Entries, empty(), empty_1({\n Compare: compare,\n }), false, new ViewState(0, []), model.Error), singleton((dispatch) => {\n dispatch(new Msg$2(1, []));\n })];\n case 9: {\n const candidateId = msg.fields[0];\n return [new Model$2(model.Id, model.Data, model.Entries, model.CandidateEntries, FSharpSet__Contains(model.SelectedCandidateEntries, candidateId) ? FSharpSet__Remove(model.SelectedCandidateEntries, candidateId) : FSharpSet__Add(model.SelectedCandidateEntries, candidateId), model.InProgress, model.ViewState, model.Error), Cmd_none()];\n }\n case 6: {\n const candidateIds = toList(model.SelectedCandidateEntries);\n if (isEmpty(candidateIds)) {\n return [model, singleton((dispatch_1) => {\n dispatch_1(new Msg$2(8, []));\n })];\n }\n else if (candidateFuncs != null) {\n return [new Model$2(model.Id, model.Data, model.Entries, model.CandidateEntries, model.SelectedCandidateEntries, true, model.ViewState, model.Error), (profileId_3 = (Session__GetCurrentProfileId(session) | 0), (finalIds = append(map(value_3(candidateFuncs).GetId, model.Entries), candidateIds), Cmd_OfAsyncWith_either((x_5) => {\n Cmd_OfAsync_start(x_5);\n }, curry3(value_3(candidateFuncs).Set)(profileId_3)(model.Id), finalIds, () => (new Msg$2(7, [undefined])), (Item_7) => (new Msg$2(10, [Item_7])))))];\n }\n else {\n return [model, Cmd_none()];\n }\n }\n case 16: {\n const profileId_4 = Session__GetCurrentProfileId(session) | 0;\n const newEntries = moveEntryInList(model.Entries, msg.fields[0], msg.fields[1]);\n if (!equals(model.Entries, newEntries)) {\n const ids = map((arg_4) => flex_form.getId(arg_4), newEntries);\n return [new Model$2(model.Id, model.Data, newEntries, model.CandidateEntries, model.SelectedCandidateEntries, true, model.ViewState, model.Error), Cmd_OfAsyncWith_either((x_6) => {\n Cmd_OfAsync_start(x_6);\n }, curry2(updateEntries)(profileId_4), ids, () => (new Msg$2(17, [undefined])), (Item_9) => (new Msg$2(10, [Item_9])))];\n }\n else {\n return [model, Cmd_none()];\n }\n }\n case 13:\n return [new Model$2(model.Id, model.Data, model.Entries, model.CandidateEntries, model.SelectedCandidateEntries, true, model.ViewState, model.Error), Cmd_OfAsyncWith_either((x_7) => {\n Cmd_OfAsync_start(x_7);\n }, curry2(deleteEntry)(Session__GetCurrentProfileId(session)), msg.fields[0], () => (new Msg$2(15, [undefined])), (Item_11) => (new Msg$2(10, [Item_11])))];\n case 15:\n case 17:\n return [new Model$2(model.Id, model.Data, model.Entries, model.CandidateEntries, model.SelectedCandidateEntries, false, model.ViewState, model.Error), singleton((dispatch_2) => {\n dispatch_2(new Msg$2(1, []));\n })];\n case 11:\n return [new Model$2(model.Id, model.Data, model.Entries, model.CandidateEntries, model.SelectedCandidateEntries, true, model.ViewState, model.Error), Cmd_OfAsyncWith_either((x_8) => {\n Cmd_OfAsync_start(x_8);\n }, curry2(deleteRecord)(Session__GetCurrentProfileId(session)), model.Id, () => (new Msg$2(12, [undefined])), (Item_13) => (new Msg$2(10, [Item_13])))];\n case 12:\n return [new Model$2(model.Id, model.Data, model.Entries, model.CandidateEntries, model.SelectedCandidateEntries, false, model.ViewState, model.Error), Router_newUrl(new Route(32, []))];\n case 14:\n if (candidateFuncs != null) {\n const finalIds_1 = filter((i) => !equals_1(i, msg.fields[0]), map(value_3(candidateFuncs).GetId, model.Entries));\n return [new Model$2(model.Id, model.Data, model.Entries, model.CandidateEntries, model.SelectedCandidateEntries, true, model.ViewState, model.Error), (profileId_7 = (Session__GetCurrentProfileId(session) | 0), Cmd_OfAsyncWith_either((x_9) => {\n Cmd_OfAsync_start(x_9);\n }, curry3(value_3(candidateFuncs).Set)(profileId_7)(model.Id), finalIds_1, () => (new Msg$2(15, [undefined])), (Item_15) => (new Msg$2(10, [Item_15]))))];\n }\n else {\n return [model, Cmd_none()];\n }\n case 10:\n return [new Model$2(model.Id, model.Data, model.Entries, model.CandidateEntries, model.SelectedCandidateEntries, false, model.ViewState, exnToDisplayString(msg.fields[0])), Cmd_none()];\n default:\n return [new Model$2(model.Id, model.Data, model.Entries, model.CandidateEntries, model.SelectedCandidateEntries, true, model.ViewState, model.Error), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry2(getData)(Session__GetCurrentProfileId(session)), msg.fields[0], (Item) => (new Msg$2(3, [Item])), (Item_1) => (new Msg$2(10, [Item_1])))];\n }\n}\n\nfunction Common_displayCandidate(selectedCandidateEntries, getBasicInfo, dispatch, record) {\n const patternInput = getBasicInfo(record);\n const id = patternInput[1];\n return columns(ofArray([new Option(4, []), new Option(1, [])]), ofArray([column(singleton(new Option_1(0, [new Screen(0, []), new ISize(5, [])])), singleton(checkbox(empty(), singleton(input(singleton(new Common_GenericOption(1, [ofArray([new DOMAttr(9, [(_arg) => {\n dispatch(new Msg$2(9, [id]));\n }]), new HTMLAttr(62, [FSharpSet__Contains(selectedCandidateEntries, id)])])]))))))), column(empty(), singleton(checkbox(empty(), singleton(patternInput[0]))))]));\n}\n\nexport function Common_viewSelectCandidates(getBasicInfo, model, dispatch) {\n const children_6 = toList_1(delay(() => {\n let matchValue;\n return append_1((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't display candidates: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => append_1(singleton_1(h2(empty())(singleton(\"Select entries to be added\"))), delay(() => {\n let children;\n return append_1(isEmpty(model.CandidateEntries) ? singleton_1(\"No candidates available\") : singleton_1((children = map((record) => Common_displayCandidate(model.SelectedCandidateEntries, getBasicInfo, dispatch, record), model.CandidateEntries), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n }))), delay(() => singleton_1(list_4(empty(), ofArray([button(ofArray([new Option_2(0, [new Color_IColor(7, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg) => {\n dispatch(new Msg$2(8, []));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Cancel\"]),\n }))), button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress ? true : FSharpSet__get_IsEmpty(model.SelectedCandidateEntries)]), new Option_2(18, [(_arg_1) => {\n dispatch(new Msg$2(6, []));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Add selected\"]),\n })))])))));\n }))));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_6)),\n });\n}\n\nconst Main_service = fitnessService;\n\nexport class Main_Model extends Record {\n constructor(Data, InProgress, Error$) {\n super();\n this.Data = Data;\n this.InProgress = InProgress;\n this.Error = Error$;\n }\n}\n\nexport function Main_Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Fitness.MainFitnessView.Component.Main.Model\", [], Main_Model, () => [[\"Data\", option_type(FitnessHierarchy_$reflection())], [\"InProgress\", bool_type], [\"Error\", option_type(string_type)]]);\n}\n\nexport class Main_Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RequestData\", \"DataSuccess\", \"Failure\", \"DeleteEntry\", \"DeleteSuccess\", \"MarkFavourite\", \"RemoveFavourite\", \"FavouriteRequestSuccess\"];\n }\n}\n\nexport function Main_Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Fitness.MainFitnessView.Component.Main.Msg\", [], Main_Msg, () => [[], [[\"Item\", FitnessHierarchy_$reflection()]], [[\"Item\", class_type(\"System.Exception\")]], [[\"Item\", int64_type]], [[\"Item\", unit_type]], [[\"Item\", int64_type]], [[\"Item\", int64_type]], [[\"Item\", unit_type]]]);\n}\n\nexport function Main_init() {\n return [new Main_Model(undefined, false, undefined), singleton((dispatch) => {\n dispatch(new Main_Msg(0, []));\n })];\n}\n\nexport function Main_update(session, msg, model) {\n switch (msg.tag) {\n case 1:\n return [new Main_Model(msg.fields[0], false, undefined), Cmd_none()];\n case 3:\n return [new Main_Model(model.Data, true, model.Error), Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, curry2(Main_service.DeleteTrainingPlan)(Session__GetCurrentProfileId(session)), msg.fields[0], () => (new Main_Msg(4, [undefined])), (Item_3) => (new Main_Msg(2, [Item_3])))];\n case 5:\n return [new Main_Model(model.Data, true, model.Error), Cmd_OfAsyncWith_either((x_2) => {\n Cmd_OfAsync_start(x_2);\n }, curry2(Main_service.MarkTrainingPlanFavourite)(Session__GetCurrentProfileId(session)), msg.fields[0], () => (new Main_Msg(7, [undefined])), (Item_5) => (new Main_Msg(2, [Item_5])))];\n case 6:\n return [new Main_Model(model.Data, true, model.Error), Cmd_OfAsyncWith_either((x_3) => {\n Cmd_OfAsync_start(x_3);\n }, curry2(fitnessService.DeleteFavourite)(Session__GetCurrentProfileId(session)), msg.fields[0], () => (new Main_Msg(7, [undefined])), (Item_7) => (new Main_Msg(2, [Item_7])))];\n case 4:\n case 7:\n return [new Main_Model(model.Data, false, model.Error), singleton((dispatch) => {\n dispatch(new Main_Msg(0, []));\n })];\n case 2:\n return [new Main_Model(model.Data, false, exnToDisplayString(msg.fields[0])), Cmd_none()];\n default:\n return [new Main_Model(model.Data, true, model.Error), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, Main_service.GetHierarchy, Session__GetCurrentProfileId(session), (Item) => (new Main_Msg(1, [Item])), (Item_1) => (new Main_Msg(2, [Item_1])))];\n }\n}\n\nfunction Main_trainingPlanActions(dispatch) {\n return ofArray([new FitnessAction(4, [(Item) => (new Route(35, [Item]))]), new FitnessAction(3, [(Item_1) => (new Route(34, [Item_1]))]), new FitnessAction(6, [(arg) => {\n dispatch(new Main_Msg(5, [arg]));\n }]), new FitnessAction(1, [(arg_1) => {\n dispatch(new Main_Msg(3, [arg_1]));\n }])]);\n}\n\nfunction Main_displayTrainingPlan(dispatch, trainingPlan) {\n return columns(ofArray([new Option(4, []), new Option(1, [])]), ofArray([column(empty(), singleton(trainingPlan.TrainingPlan.Name)), column(empty(), singleton(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(trainingPlan.TrainingPlan.Description),\n },\n }))), column(empty(), createFitnessListActions(Main_trainingPlanActions(dispatch), trainingPlan.TrainingPlan.Id))]));\n}\n\nfunction Main_displayFavourite(session, dispatch, data_, data__1) {\n const data = [data_, data__1];\n const favourite = data[1];\n let patternInput;\n switch (favourite.tag) {\n case 1: {\n const workout = favourite.fields[0];\n patternInput = [workout.Name, workout.Description, empty(), undefined, workout.Id];\n break;\n }\n case 2: {\n const trainingPlan = favourite.fields[0];\n patternInput = [trainingPlan.Name, trainingPlan.Description, singleton(new FitnessAction(4, [(Item) => (new Route(35, [Item]))])), undefined, trainingPlan.Id];\n break;\n }\n default: {\n const exercise = favourite.fields[0];\n patternInput = [exercise.Name, exercise.Description, empty(), (_arg) => {\n Router_modifyLocation(new Route(45, [exercise.ContentTypeId, exercise.Id, map_1(int64ToString, Session__GetActiveWorkoutId(session))]));\n }, exercise.Id];\n }\n }\n const onClick_1 = patternInput[3];\n const name = patternInput[0];\n const description = patternInput[1];\n const removeFavourite = button(singleton(new Option_2(18, [(_arg_1) => {\n if (window.confirm(`${\"Confirm unlink\"}:\n${\"Are you sure you want to remove the favourite?\"}`)) {\n (() => {\n dispatch(new Main_Msg(6, [data[0]]));\n })();\n }\n }])), singleton(icon(singleton(new Option_3(0, [new Size_ISize(0, [])])), singleton(CompositeIcons__ToElement(new CompositeIcons())))));\n return columns(ofArray([new Option(4, []), new Option(1, [])]), append((onClick_1 == null) ? ofArray([column(empty(), singleton(name)), column(empty(), toList_1(delay(() => ((description !== name) ? singleton_1(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(description),\n },\n })) : singleton_1(defaultOf())))))]) : ofArray([displayClickableColumn(value_3(onClick_1), name), displayClickableColumn(value_3(onClick_1), (description !== name) ? description : \"\")]), singleton(column(empty(), append(createFitnessListActions(patternInput[2], patternInput[4]), singleton(removeFavourite))))));\n}\n\nfunction Main_displayHierarchy(session, dispatch, hierarchy) {\n const favouritesElems = map((tupledArg) => Main_displayFavourite(session, dispatch, tupledArg[0], tupledArg[1]), hierarchy.Favourites);\n const tradingPlanElems = map((trainingPlan) => Main_displayTrainingPlan(dispatch, trainingPlan), hierarchy.TrainingPlans);\n const workoutLog = WorkoutLog__IsEmpty(hierarchy.WorkoutLog) ? empty() : append(singleton(h2(empty())(singleton(\"Workout log\"))), displayWorkoutLog(session, hierarchy.WorkoutLog));\n if (isEmpty(hierarchy.Favourites)) {\n return append(tradingPlanElems, workoutLog);\n }\n else {\n return append(tradingPlanElems, append(singleton(h2(empty())(singleton(\"Favourites\"))), append(favouritesElems, workoutLog)));\n }\n}\n\nexport function Main_view(session, model, dispatch) {\n const children_12 = toList_1(delay(() => {\n let matchValue;\n return append_1((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't display fitness data: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => append_1(singleton_1(list_4(empty(), ofArray([button(ofArray([new Option_2(0, [new Color_IColor(5, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg) => {\n Router_modifyLocation(new Route(39, []));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"View workouts\"]),\n }))), button(ofArray([new Option_2(0, [new Color_IColor(5, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg_1) => {\n Router_modifyLocation(new Route(43, []));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"View exercises\"]),\n }))), button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg_2) => {\n Router_modifyLocation(new Route(33, []));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Add plan\"]),\n }))), button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg_3) => {\n Router_modifyLocation(new Route(36, []));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Add workout\"]),\n }))), button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg_4) => {\n Router_modifyLocation(new Route(40, []));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Add exercise\"]),\n })))]))), delay(() => {\n let children_10;\n return (model.Data != null) ? singleton_1((children_10 = append(singleton(h2(empty())(singleton(\"Your training plans\"))), Main_displayHierarchy(session, dispatch, value_3(model.Data))), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_10)),\n }))) : empty_2();\n }))));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_12)),\n });\n}\n\nconst TrainingPlan_service = fitnessService;\n\nexport function TrainingPlan_init(id) {\n return [Model$2_Default_Z524259C1(id), Cmd_batch(ofArray([singleton((dispatch) => {\n dispatch(new Msg$2(0, [id]));\n }), singleton((dispatch_1) => {\n dispatch_1(new Msg$2(1, []));\n })]))];\n}\n\nexport function TrainingPlan_update(session, msg, model) {\n return Common_update(uncurry2((profileId) => curry2(TrainingPlan_service.GetTrainingPlanWorkoutRecords)(value_3(profileId))), (profileId_1) => TrainingPlan_service.GetTrainingPlanWorkouts(profileId_1, model.Id), uncurry2((profileId_2) => curry3(TrainingPlan_service.SetWorkoutsForTrainingPlan)(profileId_2)(model.Id)), new CandidateFunctions$1(TrainingPlan_service.GetTrainingPlanWorkoutsCandidates, TrainingPlan_service.SetWorkoutsForTrainingPlan, (entry) => entry.Id), TrainingPlan_service.DeleteTrainingPlan, TrainingPlan_service.DeleteWorkout, session, msg, model);\n}\n\nfunction TrainingPlan_displayWorkouts(dispatch, workouts, forReorder) {\n const actions = forReorder ? ofArray([new FitnessAction(2, [(arg) => {\n dispatch(new Msg$2(14, [arg]));\n }]), new FitnessAction(0, [(arg_1) => {\n let tupledArg;\n dispatch((tupledArg = arg_1, new Msg$2(16, [tupledArg[0], tupledArg[1]])));\n }])]) : empty();\n return map((workout) => displayWorkout(actions, workout), workouts);\n}\n\nfunction TrainingPlan_viewMain(model, dispatch) {\n const children_10 = toList_1(delay(() => {\n let matchValue;\n return append_1((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't display training plan: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => {\n const trainingPlan = value_3(model.Data).TrainingPlan;\n return append_1(singleton_1(h2(empty())(singleton(\"Training plan\"))), delay(() => append_1(singleton_1(h3(singleton(new Option_4(6, [])))(singleton(trainingPlan.Name))), delay(() => append_1(singleton_1(h4(singleton(new Option_4(6, [])))(singleton(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(trainingPlan.Description),\n },\n })))), delay(() => append_1(singleton_1(list_4(empty(), ofArray([button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg) => {\n Router_modifyLocation(new Route(34, [trainingPlan.Id]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Edit plan\"]),\n }))), button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg_1) => {\n dispatch(new Msg$2(2, [new ViewState(1, [])]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Select workouts for plan\"]),\n }))), button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg_2) => {\n dispatch(new Msg$2(2, [new ViewState(2, [])]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Reorder workouts\"]),\n })))]))), delay(() => append_1(singleton_1(h3(empty())(singleton(\"Workouts for the training plan\"))), delay(() => {\n let children_6;\n return append_1(singleton_1((children_6 = TrainingPlan_displayWorkouts(dispatch, model.Entries, false), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_6)),\n }))), delay(() => append_1(singleton_1(h3(empty())(singleton(\"Workout records for the training plan\"))), delay(() => {\n let children_8;\n return singleton_1((children_8 = displayWorkoutRecordsOnly(ofList(map((w) => [w.Id, w], model.Entries), {\n Compare: compare,\n }), value_3(model.Data).WorkoutRecords), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_8)),\n })));\n }))));\n }))))))))));\n }));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_10)),\n });\n}\n\nfunction TrainingPlan_viewReorder(model, dispatch) {\n const children_4 = toList_1(delay(() => {\n let matchValue;\n return append_1((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't display training plan: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => {\n const trainingPlan = value_3(model.Data).TrainingPlan;\n return append_1(singleton_1(h2(empty())(singleton(`Training plan: ${trainingPlan.Name}`))), delay(() => append_1(singleton_1(h3(empty())(singleton(\"Re-order workouts for the training plan\"))), delay(() => {\n let children;\n return append_1(singleton_1((children = TrainingPlan_displayWorkouts(dispatch, model.Entries, true), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n }))), delay(() => singleton_1(list_4(empty(), singleton(button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg) => {\n dispatch(new Msg$2(2, [new ViewState(0, [])]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Done\"]),\n }))))))));\n }))));\n }));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_4)),\n });\n}\n\nexport function TrainingPlan_view(model, dispatch) {\n if (equals(model.ViewState, new ViewState(1, [])) && !model.InProgress) {\n return Common_viewSelectCandidates((entry) => [entry.Name, entry.Id], model, dispatch);\n }\n else if (equals(model.ViewState, new ViewState(2, [])) && !model.InProgress) {\n return TrainingPlan_viewReorder(model, dispatch);\n }\n else if ((model.Data != null) && !model.InProgress) {\n return TrainingPlan_viewMain(model, dispatch);\n }\n else {\n const children = ofArray([h2(empty())(singleton(\"Training plan\")), \"Loading data...\"]);\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n });\n }\n}\n\nconst Workout_service = fitnessService;\n\nexport function Workout_init(id) {\n return [Model$2_Default_Z524259C1(id), Cmd_batch(ofArray([singleton((dispatch) => {\n dispatch(new Msg$2(0, [id]));\n }), singleton((dispatch_1) => {\n dispatch_1(new Msg$2(1, []));\n })]))];\n}\n\nexport function Workout_update(session, msg, model) {\n return Common_update(uncurry2((profileId) => curry2(Workout_service.GetWorkoutRecords)(value_3(profileId))), (profileId_1) => Workout_service.GetWorkoutExercises(profileId_1, model.Id), uncurry2((profileId_2) => curry3(Workout_service.SetExercisesForWorkout)(profileId_2)(model.Id)), new CandidateFunctions$1(Workout_service.GetWorkoutExercisesCandidates, Workout_service.SetExercisesForWorkout, (entry) => entry.Id), Workout_service.DeleteWorkout, Workout_service.DeleteExercise, session, msg, model);\n}\n\nfunction Workout_displayExercises(workoutId, dispatch, exercises, forReorder) {\n const actions = forReorder ? ofArray([new FitnessAction(2, [(arg) => {\n dispatch(new Msg$2(14, [arg]));\n }]), new FitnessAction(0, [(arg_1) => {\n let tupledArg;\n dispatch((tupledArg = arg_1, new Msg$2(16, [tupledArg[0], tupledArg[1]])));\n }])]) : empty();\n return map((exercise) => displayExerciseForRecording(actions, workoutId, exercise), exercises);\n}\n\nfunction Workout_viewMain(session, model, dispatch) {\n const workout = value_3(model.Data).Workout;\n const children_14 = toList_1(delay(() => {\n let matchValue;\n return append_1((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't display workout: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => append_1(singleton_1(h2(empty())(singleton(\"Workout\"))), delay(() => append_1(singleton_1(h3(singleton(new Option_4(6, [])))(toList_1(delay(() => append_1(singleton_1(workout.Name), delay(() => ((workout.WorkoutType === 2) ? append_1(singleton_1(\" \"), delay(() => singleton_1(icon(empty(), singleton(Fa_i(singleton(new Fa_IconOption(11, [\"fas fa-recycle\"])), [])))))) : empty_2()))))))), delay(() => append_1(singleton_1(h4(singleton(new Option_4(6, [])))(singleton(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(workout.Description),\n },\n })))), delay(() => {\n const activeWorkoutRecord = map_1((tuple) => tuple[1], Session__GetActiveWorkoutRecord(session));\n return append_1(((workout.WorkoutType === 2) && (activeWorkoutRecord != null)) ? singleton_1(closeable(\"Cannot add records for all exercises with an active workout\", new Class(3, []))) : empty_2(), delay(() => append_1(singleton_1(list_4(empty(), toList_1(delay(() => append_1(singleton_1(button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg) => {\n Router_modifyLocation(new Route(37, [workout.Id]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Edit workout\"]),\n })))), delay(() => append_1(singleton_1(button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg_1) => {\n dispatch(new Msg$2(2, [new ViewState(1, [])]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Select exercises for workout\"]),\n })))), delay(() => append_1(singleton_1(button(ofArray([new Option_2(0, [new Color_IColor(8, [])]), new Option_2(18, [(_arg_2) => {\n if (window.confirm(`${\"Confirm delete\"}:\n${\"Are you sure you want to delete this entry?\"}`)) {\n (() => {\n dispatch(new Msg$2(11, []));\n })();\n }\n }])]), ofArray([icon(empty(), singleton(Fa_i_1(singleton(Icons__ToIcon(new Icons(2, []))), []))), createElement(\"span\", {\n children: reactApi.Children.toArray([\"Delete workout\"]),\n })]))), delay(() => append_1(singleton_1(button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg_3) => {\n dispatch(new Msg$2(2, [new ViewState(2, [])]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Reorder exercises\"]),\n })))), delay(() => ((activeWorkoutRecord == null) ? append_1((workout.WorkoutType === 2) ? singleton_1(button(ofArray([new Option_2(0, [new Color_IColor(4, [])]), new Option_2(16, [model.InProgress ? true : isEmpty(model.Entries)]), new Option_2(18, [(_arg_4) => {\n Router_modifyLocation(new Route(47, [workout.Id]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Add record for all exercises\"]),\n })))) : empty_2(), delay(() => singleton_1(button(ofArray([new Option_2(0, [new Color_IColor(7, [])]), new Option_2(16, [model.InProgress ? true : isEmpty(model.Entries)]), new Option_2(18, [(_arg_5) => {\n Router_modifyLocation(new Route(48, [workout.Id]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Start workout\"]),\n })))))) : empty_2()))))))))))))), delay(() => append_1(singleton_1(h3(empty())(singleton(\"Exercises for the workout\"))), delay(() => {\n let children_12;\n let history;\n const workoutRecords = value_3(model.Data).WorkoutRecords;\n const showPlainHistory = equals(model.ViewState, new ViewState(3, []));\n history = (!isEmpty(workoutRecords) ? append(ofArray([h4(singleton(new Option_4(6, [])))(singleton(\"History\")), button(ofArray([new Option_2(0, [new Color_IColor(4, [])]), new Option_2(5, []), new Option_2(18, [(_arg_6) => {\n dispatch(new Msg$2(2, [showPlainHistory ? (new ViewState(0, [])) : (new ViewState(3, []))]));\n }])]), singleton(showPlainHistory ? \"Details\" : \"Plain history\")), createElement(\"small\", {\n children: [\"Plain view of the workout history allows you to edit individual records\"],\n })]), showPlainHistory ? displayWorkoutRecordsOnlyPlain(empty_3({\n Compare: compare,\n }), workoutRecords) : displayWorkoutRecordsOnly(empty_3({\n Compare: compare,\n }), workoutRecords)) : empty());\n return singleton_1((children_12 = append(Workout_displayExercises(model.Id, dispatch, model.Entries, false), history), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_12)),\n })));\n }))))));\n }))))))));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_14)),\n });\n}\n\nfunction Workout_viewReorder(_session, model, dispatch) {\n const workout = value_3(model.Data).Workout;\n const children_4 = toList_1(delay(() => {\n let matchValue;\n return append_1((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't display workout: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => append_1(singleton_1(h2(empty())(singleton(`Workout: ${workout.Name}`))), delay(() => append_1(singleton_1(h3(empty())(singleton(\"Re-order exercises for the workout\"))), delay(() => {\n let children;\n return append_1(singleton_1((children = Workout_displayExercises(model.Id, dispatch, model.Entries, true), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n }))), delay(() => singleton_1(list_4(empty(), singleton(button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg) => {\n dispatch(new Msg$2(2, [new ViewState(0, [])]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Done\"]),\n }))))))));\n }))))));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_4)),\n });\n}\n\nexport function Workout_view(session, model, dispatch) {\n if (equals(model.ViewState, new ViewState(1, [])) && !model.InProgress) {\n return Common_viewSelectCandidates((entry) => [entry.Name, entry.Id], model, dispatch);\n }\n else if (equals(model.ViewState, new ViewState(2, [])) && !model.InProgress) {\n return Workout_viewReorder(session, model, dispatch);\n }\n else if ((model.Data != null) && !model.InProgress) {\n return Workout_viewMain(session, model, dispatch);\n }\n else {\n const children = ofArray([h2(empty())(singleton(\"Workout\")), \"Loading data...\"]);\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n });\n }\n}\n\nconst Exercise_service = fitnessService;\n\nexport function Exercise_init(id) {\n return [Model$2_Default_Z524259C1(id), Cmd_batch(ofArray([singleton((dispatch) => {\n dispatch(new Msg$2(0, [id]));\n }), singleton((dispatch_1) => {\n dispatch_1(new Msg$2(1, []));\n })]))];\n}\n\nexport function Exercise_update(session, msg, model) {\n return Common_update(Exercise_service.GetExercise, (profileId) => singleton_2.Delay(() => singleton_2.ReturnFrom(Exercise_service.GetExerciseRecords(profileId, model.Id))), (_arg_1, _arg_2) => {\n throw new Error(\"Not supported\");\n }, undefined, fitnessService.DeleteExercise, (profileId_1, id) => singleton_2.Delay(() => singleton_2.Bind(commonAuthService.DeleteRecord(profileId_1, id), (_arg) => singleton_2.Return(undefined))), session, msg, model);\n}\n\nexport function Exercise_view(session, model, dispatch) {\n if ((model.Data != null) && !model.InProgress) {\n const children_8 = toList_1(delay(() => {\n let matchValue;\n return append_1((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't display exercise: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => {\n const exercise = value_3(model.Data);\n const name = exercise.Name;\n return append_1(singleton_1(h2(empty())(singleton(\"Exercise\"))), delay(() => append_1(singleton_1(h3(singleton(new Option_4(6, [])))(singleton(name))), delay(() => append_1((exercise.Description !== name) ? singleton_1(h4(singleton(new Option_4(6, [])))(singleton(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(exercise.Description),\n },\n })))) : empty_2(), delay(() => append_1((exercise.Instructions !== name) ? singleton_1(h5(singleton(new Option_4(6, [])))(singleton(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(exercise.Instructions),\n },\n })))) : empty_2(), delay(() => append_1(singleton_1(list_4(empty(), ofArray([button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg) => {\n Router_modifyLocation(new Route(41, [exercise.Id]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Edit exercise\"]),\n }))), button(ofArray([new Option_2(0, [new Color_IColor(8, [])]), new Option_2(18, [(_arg_1) => {\n if (window.confirm(`${\"Confirm delete\"}:\n${\"Are you sure you want to delete this entry?\"}`)) {\n (() => {\n dispatch(new Msg$2(11, []));\n })();\n }\n }])]), ofArray([icon(empty(), singleton(Fa_i_1(singleton(Icons__ToIcon(new Icons(2, []))), []))), createElement(\"span\", {\n children: reactApi.Children.toArray([\"Delete exercise\"]),\n })])), button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg_2) => {\n const workoutIdOpt = map_1(int64ToString, Session__GetActiveWorkoutId(session));\n Router_modifyLocation(new Route(45, [value_3(model.Data).ContentTypeId, exercise.Id, workoutIdOpt]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Log exercise\"]),\n })))]))), delay(() => append_1(singleton_1(h3(empty())(singleton(\"Records for the exercise\"))), delay(() => {\n let children_6;\n return singleton_1((children_6 = displayExerciseRecords(session, (arg) => {\n dispatch(new Msg$2(13, [arg]));\n }, model.Entries), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_6)),\n })));\n }))))))))))));\n }));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_8)),\n });\n }\n else {\n const children_10 = ofArray([h2(empty())(singleton(\"Exercise\")), \"Loading data...\"]);\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_10)),\n });\n }\n}\n\nconst ExerciseRecord_service = fitnessService;\n\nexport class ExerciseRecord_Model extends Record {\n constructor(Id, Data, InProgress, Error$) {\n super();\n this.Id = Id;\n this.Data = Data;\n this.InProgress = InProgress;\n this.Error = Error$;\n }\n}\n\nexport function ExerciseRecord_Model_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Fitness.MainFitnessView.Component.ExerciseRecord.Model\", [], ExerciseRecord_Model, () => [[\"Id\", int64_type], [\"Data\", option_type(tuple_type(EventInfo_$reflection(), ExerciseRecord_$reflection()))], [\"InProgress\", bool_type], [\"Error\", option_type(string_type)]]);\n}\n\nexport function ExerciseRecord_Model_Default_Z524259C1(id) {\n return new ExerciseRecord_Model(id, undefined, false, undefined);\n}\n\nexport function ExerciseRecord_Model__GetExerciseId(this$) {\n return flex_form.getExerciseId(value_3(this$.Data)[1]);\n}\n\nexport class ExerciseRecord_Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RequestData\", \"DataSuccess\", \"Failure\", \"DeleteEntry\", \"DeleteSuccess\"];\n }\n}\n\nexport function ExerciseRecord_Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Fitness.MainFitnessView.Component.ExerciseRecord.Msg\", [], ExerciseRecord_Msg, () => [[[\"Item\", int64_type]], [[\"Item1\", EventInfo_$reflection()], [\"Item2\", ExerciseRecord_$reflection()]], [[\"Item\", class_type(\"System.Exception\")]], [[\"Item\", int64_type]], [[\"Item\", unit_type]]]);\n}\n\nexport function ExerciseRecord_init(_contentTypeId, id) {\n return [ExerciseRecord_Model_Default_Z524259C1(id), singleton((dispatch) => {\n dispatch(new ExerciseRecord_Msg(0, [id]));\n })];\n}\n\nexport function ExerciseRecord_update(session, msg, model) {\n let profileId;\n switch (msg.tag) {\n case 1:\n return [new ExerciseRecord_Model(model.Id, [msg.fields[0], msg.fields[1]], false, undefined), Cmd_none()];\n case 3:\n return [new ExerciseRecord_Model(model.Id, model.Data, true, model.Error), Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, (profileId = (Session__GetCurrentProfileId(session) | 0), (id) => singleton_2.Delay(() => singleton_2.Bind(commonAuthService.DeleteRecord(profileId, id), (_arg) => singleton_2.Return(undefined)))), msg.fields[0], () => (new ExerciseRecord_Msg(4, [undefined])), (Item_4) => (new ExerciseRecord_Msg(2, [Item_4])))];\n case 4:\n return [new ExerciseRecord_Model(model.Id, model.Data, false, model.Error), Router_newUrl(new Route(42, [ExerciseRecord_Model__GetExerciseId(model)]))];\n case 2:\n return [new ExerciseRecord_Model(model.Id, model.Data, false, exnToDisplayString(msg.fields[0])), Cmd_none()];\n default:\n return [new ExerciseRecord_Model(model.Id, model.Data, true, model.Error), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry2(ExerciseRecord_service.GetExerciseRecord)(Session__GetCurrentProfileId(session)), msg.fields[0], (tupledArg) => (new ExerciseRecord_Msg(1, [tupledArg[0], tupledArg[1]])), (Item_2) => (new ExerciseRecord_Msg(2, [Item_2])))];\n }\n}\n\nfunction ExerciseRecord_displayProperty(data_, data__1) {\n const data = [data_, data__1];\n return columns(singleton(new Option(4, [])), ofArray([column(empty(), singleton(createElement(\"strong\", {\n children: reactApi.Children.toArray([data[0]]),\n }))), column(empty(), singleton(data[1]))]));\n}\n\nfunction ExerciseRecord_displayProperties(data) {\n const properties = flex_form.getProperties(data);\n return map((tupledArg) => ExerciseRecord_displayProperty(tupledArg[0], tupledArg[1]), ofArray(zip(properties.Names, properties.Values)));\n}\n\nexport function ExerciseRecord_view(session, model, _dispatch) {\n if ((model.Data != null) && !model.InProgress) {\n const patternInput = value_3(model.Data);\n const eventInfo = patternInput[0];\n const exerciseId = ExerciseRecord_Model__GetExerciseId(model);\n const children_8 = toList_1(delay(() => {\n let matchValue;\n return append_1((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't display exercise record: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => append_1(singleton_1(h2(empty())(singleton(\"Exercise record details\"))), delay(() => append_1(singleton_1(list_4(empty(), ofArray([button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg) => {\n Router_modifyLocation(new Route(42, [exerciseId]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"View exercise\"]),\n }))), button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg_1) => {\n Router_modifyLocation(new Route(46, [eventInfo.ContentTypeId, eventInfo.Id]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Edit exercise record\"]),\n }))), button(ofArray([new Option_2(0, [new Color_IColor(6, [])]), new Option_2(16, [model.InProgress]), new Option_2(18, [(_arg_2) => {\n Router_modifyLocation(new Route(45, [eventInfo.ContentTypeId, eventInfo.Id, map_1(int64ToString, Session__GetActiveWorkoutId(session))]));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Add exercise record\"]),\n })))]))), delay(() => {\n let children_6;\n return singleton_1((children_6 = append(ExerciseRecord_displayProperties(eventInfo), ExerciseRecord_displayProperties(patternInput[1])), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_6)),\n })));\n }))))));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_8)),\n });\n }\n else {\n const children_10 = ofArray([h2(empty())(singleton(\"Exercise record\")), \"Loading data...\"]);\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_10)),\n });\n }\n}\n\n","import { Union, Record } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { union_type, unit_type, int64_type, class_type, record_type, option_type, string_type, bool_type, list_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { filter as filter_1, map, ofArray, singleton, empty } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { Cmd_none } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { curry2 } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { Session__GetCurrentProfileId } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { exnToDisplayString } from \"../../Omnicv.Client.Common/Utils.js\";\nimport { createFitnessListActions, displayWorkout, FitnessAction, fitnessService } from \"./FitnessCommon.js\";\nimport { Router_modifyLocation, Route } from \"../../Omnicv.Client.Common/Router.js\";\nimport { singleton as singleton_1, append, delay, toList } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Class, closeable } from \"../../Omnicv.Client.Common/Components/Notification.js\";\nimport { defaultOf } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { h2 } from \"../../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { Option, button, list as list_2 } from \"../../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { Size_ISize, Color_IColor } from \"../../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { createElement } from \"react\";\nimport { reactApi } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { Option as Option_1, columns } from \"../../fable_modules/Fulma.3.0.0/Layouts/Columns.fs.js\";\nimport { column } from \"../../fable_modules/Fulma.3.0.0/Layouts/Column.fs.js\";\nimport { Markdown_ToHtml_1BFEAEDB } from \"../../fable_modules/Fable.Formatting.Markdown.1.0.1/Markdown.fs.js\";\nimport { Option as Option_2, div } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Control.fs.js\";\nimport { input } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Input.fs.js\";\nimport { Option as Option_3, IInputType } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Input.fs.js\";\nimport { isNullOrWhiteSpace } from \"../../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { Option as Option_4, icon } from \"../../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport { Fa_IconOption, Fa_i } from \"../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\n\nexport class Model$1 extends Record {\n constructor(Entries, InProgress, Filter, Error$) {\n super();\n this.Entries = Entries;\n this.InProgress = InProgress;\n this.Filter = Filter;\n this.Error = Error$;\n }\n}\n\nexport function Model$1_$reflection(gen0) {\n return record_type(\"Omnicv.Client.Pages.Fitness.FitnessEntriesView.Component.Model`1\", [gen0], Model$1, () => [[\"Entries\", list_type(gen0)], [\"InProgress\", bool_type], [\"Filter\", string_type], [\"Error\", option_type(string_type)]]);\n}\n\nexport function Model$1_Default() {\n return new Model$1(empty(), false, \"\", undefined);\n}\n\nexport class Msg$1 extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RequestEntries\", \"EntriesSuccess\", \"Failure\", \"DeleteEntry\", \"MarkFavourite\", \"FavouriteSuccess\", \"DeleteSuccess\", \"UpdateFilter\"];\n }\n}\n\nexport function Msg$1_$reflection(gen0) {\n return union_type(\"Omnicv.Client.Pages.Fitness.FitnessEntriesView.Component.Msg`1\", [gen0], Msg$1, () => [[], [[\"Item\", list_type(gen0)]], [[\"Item\", class_type(\"System.Exception\")]], [[\"Item\", int64_type]], [[\"Item\", int64_type]], [[\"Item\", unit_type]], [[\"Item\", unit_type]], [[\"Item\", string_type]]]);\n}\n\nexport function Common_init() {\n return [Model$1_Default(), singleton((dispatch) => {\n dispatch(new Msg$1(0, []));\n })];\n}\n\nexport function Common_update(getEntries, deleteEntry, markEntryFavourite, session, msg, model) {\n switch (msg.tag) {\n case 1:\n return [new Model$1(msg.fields[0], false, model.Filter, undefined), Cmd_none()];\n case 4:\n return [new Model$1(model.Entries, true, model.Filter, model.Error), Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, curry2(markEntryFavourite)(Session__GetCurrentProfileId(session)), msg.fields[0], () => (new Msg$1(5, [undefined])), (Item_3) => (new Msg$1(2, [Item_3])))];\n case 3:\n return [new Model$1(model.Entries, true, model.Filter, model.Error), Cmd_OfAsyncWith_either((x_2) => {\n Cmd_OfAsync_start(x_2);\n }, curry2(deleteEntry)(Session__GetCurrentProfileId(session)), msg.fields[0], () => (new Msg$1(6, [undefined])), (Item_5) => (new Msg$1(2, [Item_5])))];\n case 6:\n case 5:\n return [new Model$1(model.Entries, false, model.Filter, model.Error), singleton((dispatch) => {\n dispatch(new Msg$1(0, []));\n })];\n case 2:\n return [new Model$1(model.Entries, false, model.Filter, exnToDisplayString(msg.fields[0])), Cmd_none()];\n case 7:\n return [new Model$1(model.Entries, model.InProgress, msg.fields[0], model.Error), Cmd_none()];\n default:\n return [new Model$1(model.Entries, true, model.Filter, model.Error), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, getEntries, Session__GetCurrentProfileId(session), (Item) => (new Msg$1(1, [Item])), (Item_1) => (new Msg$1(2, [Item_1])))];\n }\n}\n\nconst Workouts_service = fitnessService;\n\nexport function Workouts_init() {\n return Common_init();\n}\n\nexport function Workouts_update(session, msg, model) {\n return Common_update(Workouts_service.GetWorkouts, Workouts_service.DeleteWorkout, Workouts_service.MarkWorkoutFavourite, session, msg, model);\n}\n\nfunction Workouts_workoutActions(dispatch) {\n return ofArray([new FitnessAction(4, [(Item) => (new Route(38, [Item]))]), new FitnessAction(3, [(Item_1) => (new Route(37, [Item_1]))]), new FitnessAction(6, [(arg) => {\n dispatch(new Msg$1(4, [arg]));\n }]), new FitnessAction(1, [(arg_1) => {\n dispatch(new Msg$1(3, [arg_1]));\n }])]);\n}\n\nfunction Workouts_displayWorkouts(dispatch, workouts) {\n let actions;\n return map((actions = Workouts_workoutActions(dispatch), (workout) => displayWorkout(actions, workout)), workouts);\n}\n\nexport function Workouts_view(model, dispatch) {\n const children_6 = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't display workouts: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => append(singleton_1(h2(empty())(singleton(\"Workouts\"))), delay(() => {\n let children_4, children_2;\n return !model.InProgress ? singleton_1((children_4 = ofArray([list_2(empty(), singleton(button(ofArray([new Option(0, [new Color_IColor(6, [])]), new Option(16, [model.InProgress]), new Option(18, [(_arg) => {\n Router_modifyLocation(new Route(36, []));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Add workout\"]),\n }))))), (children_2 = Workouts_displayWorkouts(dispatch, model.Entries), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_2)),\n }))]), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_4)),\n }))) : singleton_1(\"Loading data...\");\n }))));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_6)),\n });\n}\n\nconst Exercises_service = fitnessService;\n\nexport function Exercises_init() {\n return Common_init();\n}\n\nexport function Exercises_update(session, msg, model) {\n return Common_update(Exercises_service.GetExercises, Exercises_service.DeleteExercise, Exercises_service.MarkExerciseFavourite, session, msg, model);\n}\n\nfunction Exercises_exerciseActions(dispatch) {\n return ofArray([new FitnessAction(4, [(Item) => (new Route(42, [Item]))]), new FitnessAction(3, [(Item_1) => (new Route(41, [Item_1]))]), new FitnessAction(6, [(arg) => {\n dispatch(new Msg$1(4, [arg]));\n }]), new FitnessAction(1, [(arg_1) => {\n dispatch(new Msg$1(3, [arg_1]));\n }])]);\n}\n\nfunction Exercises_displayExercise(dispatch, exercise) {\n return columns(ofArray([new Option_1(4, []), new Option_1(1, [])]), ofArray([column(empty(), singleton(exercise.Name)), column(empty(), singleton(createElement(\"div\", {\n dangerouslySetInnerHTML: {\n __html: Markdown_ToHtml_1BFEAEDB(exercise.Description),\n },\n }))), column(empty(), createFitnessListActions(Exercises_exerciseActions(dispatch), exercise.Id))]));\n}\n\nfunction Exercises_displayExercises(dispatch, model) {\n const lowerFilter = model.Filter.toLocaleLowerCase();\n return map((exercise_1) => Exercises_displayExercise(dispatch, exercise_1), filter_1((exercise) => (exercise.Name.toLocaleLowerCase().indexOf(lowerFilter) >= 0), model.Entries));\n}\n\nexport function Exercises_view(model, dispatch) {\n const children_6 = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't display exercises: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => append(singleton_1(h2(empty())(singleton(\"Exercises\"))), delay(() => {\n let children_4, children_2;\n return !model.InProgress ? singleton_1((children_4 = ofArray([list_2(empty(), singleton(button(ofArray([new Option(0, [new Color_IColor(6, [])]), new Option(16, [model.InProgress]), new Option(18, [(_arg) => {\n Router_modifyLocation(new Route(40, []));\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Add exercise\"]),\n }))))), div(singleton(new Option_2(1, [])), ofArray([input(ofArray([new Option_3(1, [new IInputType(0, [])]), new Option_3(0, [new Size_ISize(0, [])]), new Option_3(12, [\"Search\"]), new Option_3(8, [model.Filter]), new Option_3(13, [(event) => {\n const elem = event.target;\n const newFilter = isNullOrWhiteSpace(elem.value) ? \"\" : elem.value;\n if (newFilter !== model.Filter) {\n dispatch(new Msg$1(7, [newFilter]));\n }\n }])])), icon(ofArray([new Option_4(0, [new Size_ISize(0, [])]), new Option_4(1, [])]), singleton(Fa_i(singleton(new Fa_IconOption(11, [\"fas fa-search\"])), [])))])), (children_2 = Exercises_displayExercises(dispatch, model), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_2)),\n }))]), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_4)),\n }))) : singleton_1(\"Loading data...\");\n }))));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_6)),\n });\n}\n\n","import { Record, Union } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { int64_type, class_type, record_type, list_type, string_type, bool_type, option_type, union_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { empty, cons, ofArray, singleton, forAll } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { fromInt32, toInt64, compare } from \"../../fable_modules/fable-library-js.4.24.0/BigInt.js\";\nimport * as flex_form from \"../../../src/javascript/flex-form.js\";\nimport { Cmd_none, Cmd_batch } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { some } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { singleton as singleton_1 } from \"../../fable_modules/fable-library-js.4.24.0/AsyncBuilder.js\";\nimport { FlexFormBase$1__Render_2B595, FlexFormBase$1__SetState, FlexForm$1_$ctor_2ABDDB55, setProfileId } from \"./FlexForm.js\";\nimport { Session__GetCurrentProfileId } from \"../SharedView.js\";\nimport { exnToDisplayString } from \"../Utils.js\";\nimport { Router_modifyLocation } from \"../Router.js\";\nimport { div } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Control.fs.js\";\nimport { singleton as singleton_2, append, delay, toList } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Class, closeable } from \"./Notification.js\";\nimport { defaultOf } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { container } from \"../../fable_modules/Fulma.3.0.0/Layouts/Container.fs.js\";\nimport { h1 } from \"../../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { createElement } from \"react\";\n\nexport class DataExpected extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Record\", \"EditHelper\"];\n }\n}\n\nexport function DataExpected_$reflection() {\n return union_type(\"Omnicv.Client.Common.Components.AddEditSimpleFlexFormBase.DataExpected\", [], DataExpected, () => [[], []]);\n}\n\nexport class Model$2 extends Record {\n constructor(Record, EditHelperData, InProgress, Error$, DataExpected) {\n super();\n this.Record = Record;\n this.EditHelperData = EditHelperData;\n this.InProgress = InProgress;\n this.Error = Error$;\n this.DataExpected = DataExpected;\n }\n}\n\nexport function Model$2_$reflection(gen0, gen1) {\n return record_type(\"Omnicv.Client.Common.Components.AddEditSimpleFlexFormBase.Model`2\", [gen0, gen1], Model$2, () => [[\"Record\", gen0], [\"EditHelperData\", option_type(gen1)], [\"InProgress\", bool_type], [\"Error\", option_type(string_type)], [\"DataExpected\", list_type(DataExpected_$reflection())]]);\n}\n\nfunction Model$2__IsItemReady_Z4CD6E166(this$, dataExpectedItem) {\n if (dataExpectedItem.tag === 1) {\n return this$.EditHelperData != null;\n }\n else {\n return Model$2__IsEditing(this$);\n }\n}\n\nexport function Model$2__IsReady(this$) {\n return forAll((dataExpectedItem) => Model$2__IsItemReady_Z4CD6E166(this$, dataExpectedItem), this$.DataExpected);\n}\n\nexport function Model$2__IsEditing(this$) {\n return compare(flex_form.getId(this$.Record), toInt64(fromInt32(0))) > 0;\n}\n\nexport class Msg$2 extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RecordUpdated\", \"FetchSuccess\", \"FetchEditHelperDataSuccess\", \"Failure\", \"Submit\", \"SubmitSuccess\"];\n }\n}\n\nexport function Msg$2_$reflection(gen0, gen1) {\n return union_type(\"Omnicv.Client.Common.Components.AddEditSimpleFlexFormBase.Msg`2\", [gen0, gen1], Msg$2, () => [[[\"Item\", gen0]], [[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", class_type(\"System.Exception\")]], [], [[\"Item\", int64_type]]]);\n}\n\nexport class SimpleFormView$2 {\n constructor(buildForm, title, submitNewAction, submitEditAction, successAction, mainView) {\n this.buildForm = buildForm;\n this.title = title;\n this.submitNewAction = submitNewAction;\n this.submitEditAction = submitEditAction;\n this.successAction = successAction;\n this.mainView = mainView;\n }\n}\n\nexport function SimpleFormView$2_$reflection(gen0, gen1) {\n return class_type(\"Omnicv.Client.Common.Components.AddEditSimpleFlexFormBase.SimpleFormView`2\", [gen0, gen1], SimpleFormView$2);\n}\n\nexport function SimpleFormView$2_$ctor_68D4BBB0(buildForm, title, submitNewAction, submitEditAction, successAction, mainView) {\n return new SimpleFormView$2(buildForm, title, submitNewAction, submitEditAction, successAction, mainView);\n}\n\nexport function SimpleFormView$2__InitNewCore_Z292EED19(this$, defaultValue, fetchAction) {\n const patternInput = SimpleFormView$2__initCommon(this$, undefined, defaultValue, singleton(new DataExpected(1, [])));\n const newModel = patternInput[0];\n return [new Model$2(newModel.Record, newModel.EditHelperData, true, newModel.Error, newModel.DataExpected), Cmd_batch(ofArray([patternInput[1], Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, fetchAction, undefined, (Item) => (new Msg$2(2, [Item])), (Item_1) => (new Msg$2(3, [Item_1])))]))];\n}\n\nexport function SimpleFormView$2__InitEditCore_Z466B74A6(this$, recordId, defaultValue, fetchAction) {\n const patternInput = SimpleFormView$2__initCommon(this$, recordId, defaultValue, singleton(new DataExpected(0, [])));\n const newModel = patternInput[0];\n return [new Model$2(newModel.Record, newModel.EditHelperData, true, newModel.Error, newModel.DataExpected), Cmd_batch(ofArray([patternInput[1], Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, fetchAction, recordId, (Item) => (new Msg$2(1, [Item])), (Item_1) => (new Msg$2(3, [Item_1])))]))];\n}\n\nexport function SimpleFormView$2__InitEditWithHelperData_3AAD8C48(this$, recordId, defaultValue, fetchAction, fetchHelperDataAction) {\n const patternInput = SimpleFormView$2__InitEditCore_Z466B74A6(this$, recordId, defaultValue, fetchAction);\n const newModel = patternInput[0];\n return [new Model$2(newModel.Record, newModel.EditHelperData, true, newModel.Error, cons(new DataExpected(1, []), newModel.DataExpected)), Cmd_batch(ofArray([patternInput[1], Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, fetchHelperDataAction, undefined, (Item) => (new Msg$2(2, [Item])), (Item_1) => (new Msg$2(3, [Item_1])))]))];\n}\n\nexport function SimpleFormView$2__Update(this$, session, msg, model) {\n switch (msg.tag) {\n case 1:\n return [new Model$2(msg.fields[0], model.EditHelperData, false, model.Error, model.DataExpected), Cmd_none()];\n case 2:\n return [new Model$2(model.Record, some(msg.fields[0]), false, model.Error, model.DataExpected), Cmd_none()];\n case 4:\n return [new Model$2(model.Record, model.EditHelperData, true, model.Error, model.DataExpected), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, (record_1) => {\n if (Model$2__IsEditing(model)) {\n return singleton_1.Delay(() => singleton_1.Bind(this$.submitEditAction(record_1), () => singleton_1.Return(flex_form.getId(record_1))));\n }\n else {\n return this$.submitNewAction(setProfileId(record_1, Session__GetCurrentProfileId(session)));\n }\n }, model.Record, (Item) => (new Msg$2(5, [Item])), (Item_1) => (new Msg$2(3, [Item_1])))];\n case 5:\n return [new Model$2(model.Record, model.EditHelperData, false, model.Error, model.DataExpected), this$.successAction()];\n case 3:\n return [new Model$2(model.Record, model.EditHelperData, false, exnToDisplayString(msg.fields[0]), model.DataExpected), Cmd_none()];\n default:\n return [new Model$2(msg.fields[0], model.EditHelperData, model.InProgress, model.Error, model.DataExpected), Cmd_none()];\n }\n}\n\nexport function SimpleFormView$2__ViewForm_Z44A2099C(this$, session, model, dispatch) {\n let form_1;\n const form = FlexForm$1_$ctor_2ABDDB55((arg) => {\n dispatch(new Msg$2(0, [arg]));\n }, (_arg) => {\n dispatch(new Msg$2(4, []));\n }, () => {\n Router_modifyLocation(this$.mainView);\n });\n this$.buildForm(form, session, model, dispatch);\n FlexFormBase$1__SetState(form, model.InProgress, model.Error);\n form_1 = form;\n return div(empty(), toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_2(closeable(`Error: ${matchValue}`, new Class(4, []))) : singleton_2(defaultOf())), delay(() => append(singleton_2(container(empty(), singleton(h1(empty())(singleton(this$.title))))), delay(() => (!Model$2__IsReady(model) ? singleton_2(createElement(\"p\", {\n children: \"Loading...\",\n })) : singleton_2(FlexFormBase$1__Render_2B595(form_1, model.Record)))))));\n })));\n}\n\nexport function SimpleFormView$2__initCommon(this$, id, defaultValue, dataExpected) {\n return [new Model$2(defaultValue, undefined, id != null, undefined, dataExpected), Cmd_none()];\n}\n\n","import { Union, Record } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { unit_type, array_type, fullName, union_type, class_type, string_type, list_type, tuple_type, option_type, int64_type, record_type, bool_type, int32_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { printf, toFail, isNullOrWhiteSpace, split } from \"../../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { parse } from \"../../fable_modules/fable-library-js.4.24.0/Int32.js\";\nimport { updateAt, item } from \"../../fable_modules/fable-library-js.4.24.0/Array.js\";\nimport { parse as parse_1 } from \"../../fable_modules/fable-library-js.4.24.0/Boolean.js\";\nimport { WorkoutRecordType, WorkoutCircuitData_$reflection, ExerciseRecord, RepsWithWeightRecord, IntervalsRepsRecord, IntervalsDurationRecord, EnduranceRecord, RepsWithBodyWeightRecord, IntervalsRepsRecord_$reflection, IntervalsDurationRecord_$reflection, EnduranceRecord_$reflection, RepsWithBodyWeightRecord_$reflection, RepsWithWeightRecord_$reflection, IntervalsRepsRecord_Default_Z524259C1, IntervalsDurationRecord_Default_Z524259C1, EnduranceRecord_Default_Z524259C1, RepsWithBodyWeightRecord_Default_Z524259C1, RepsWithWeightRecord_Default_Z524259C1, validateNotes, validateWeight, validateRepetitions, ExerciseRecordAddingInfo$1_$reflection, Exercise_$reflection } from \"../../Omnicv.Shared/FitnessAPI.js\";\nimport { tryUpdateLocationFromSuggestions, update as update_1, prepareEventInfoForSubmit, Model__UpdateEventInfo_Z45EFA9A8, initCommonNoRegistration, initCommon, Msg_$reflection as Msg_$reflection_1, Model_$reflection as Model_$reflection_1 } from \"../../Omnicv.Client.Common/Components/EventInfoManager.js\";\nimport { EventInfo__ClearLocation, PagingOptions, EventInfo, EventInfo_Default_7F9DDECF, EventInfo_$reflection } from \"../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { equals as equals_1, fromInt32, toInt64, compare } from \"../../fable_modules/fable-library-js.4.24.0/BigInt.js\";\nimport { defaultArg, map, value as value_2 } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport * as flex_form from \"../../../src/javascript/flex-form.js\";\nimport { zip, toArray, mapIndexed, append as append_1, map as map_1, find, collect, cons, tryFind, singleton, filter, reverse, length, partition, head, isEmpty, ofArray, empty } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { Cmd_none, Cmd_map, Cmd_batch } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport * as common from \"../../../src/javascript/common.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { uncurry2, dateHash, equals, curry2, curry3 } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { Session__SiteSettings, Session__GetActiveWorkoutRecord, Session__GetCurrentProfileId } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { FlexFormWithFormlets$1_$ctor_Z7DF2018A, Formlet$1, FieldValidationResult__Merge_30561432, FlexFormFields$1__CanSubmit_2B595, FlexFormTuple$2__get_FieldsFst, FlexFormFields$1__Render, FlexFormFields$1__AddDurationSecs_ZAAC24, FlexFormFields$1__AddPositiveIntOpt_414042FF, FlexFormFields$1__AddTextAreaOpt_Z44636648, FlexFormTuple$2__get_FieldsSnd, FlexFormFields$1__AddPositiveFloat_1D6F52FB, FlexFormFields$1__AddPositiveInt_ZAAC24, getSuggestions, addEventInfoWithSuggestionsToFlexForm, FlexFormTuple$2_$ctor_5AE4FFF0, FlexFormBase$1__Render_2B595, FlexForm$1__get_Fields, FlexFormFields$1__AddGroup_6DFDD678, FlexFormFields$1__AddDurationSecsWithSeconds_ZAAC24, noValidation, FlexFormFields$1__AddCheckbox_264AA22A, FlexForm$1_$ctor_2ABDDB55, FlexFormBase$1__SetState, setWorkoutRecordId, clearId } from \"../../Omnicv.Client.Common/Components/FlexForm.js\";\nimport { equals as equals_2, op_Addition, compare as compare_1, day, month, year, create } from \"../../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport { displayWorkoutRecords, displayIntervalsRepsRecord, intervalsRepsRecordService, displayIntervalsDurationRecord, intervalsDurationRecordService, displayEnduranceRecord, enduranceRecordService, displayRepsWithBodyWeightRecord, repsWithBodyWeightRecordService, displayRepsWithWeight, repsWithWeightRecordService, displayExerciseRecordCommon, displayDailySingleExerciseRecords, fitnessService } from \"./FitnessCommon.js\";\nimport { fromSeconds } from \"../../fable_modules/fable-library-js.4.24.0/TimeSpan.js\";\nimport { Router_modifyLocation, Route, Router_newUrl } from \"../../Omnicv.Client.Common/Router.js\";\nimport { exnToDisplayString } from \"../../Omnicv.Client.Common/Utils.js\";\nimport { ofArray as ofArray_1, last, empty as empty_1, singleton as singleton_1, append, delay, toList } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Class, closeable } from \"../../Omnicv.Client.Common/Components/Notification.js\";\nimport { defaultOf } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { Option, div } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Control.fs.js\";\nimport { container } from \"../../fable_modules/Fulma.3.0.0/Layouts/Container.fs.js\";\nimport { h3, h4, Option as Option_1, h2, h1 } from \"../../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { createElement } from \"react\";\nimport { reactApi } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { List_groupBy } from \"../../fable_modules/fable-library-js.4.24.0/Seq2.js\";\nimport { fromDateTime } from \"../../fable_modules/fable-library-js.4.24.0/DateOnly.js\";\nimport { parse as parse_2 } from \"../../fable_modules/fable-library-js.4.24.0/Long.js\";\n\nexport class TimerOptions extends Record {\n constructor(DurationSecs, Start) {\n super();\n this.DurationSecs = (DurationSecs | 0);\n this.Start = Start;\n }\n}\n\nexport function TimerOptions_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Fitness.AddEditExerciseRecord.TimerOptions\", [], TimerOptions, () => [[\"DurationSecs\", int32_type], [\"Start\", bool_type]]);\n}\n\nexport function TimerOptions_Parse_Z721C83C5(value) {\n const parts = split(value, [\";\"], undefined, 0);\n return new TimerOptions(parse(item(0, parts), 511, false, 32), parse_1(item(1, parts)));\n}\n\nexport function TimerOptions__Serialise(this$) {\n return `${this$.DurationSecs};${this$.Start}`;\n}\n\nconst defaultTimer = new TimerOptions(2 * 60, true);\n\nexport class RecordModel$1 extends Record {\n constructor(RecordId, WorkoutId, ExerciseId, Exercise, EIMModel, Record, PreviousEntries, InProgress, Error$, TimerOptions) {\n super();\n this.RecordId = RecordId;\n this.WorkoutId = WorkoutId;\n this.ExerciseId = ExerciseId;\n this.Exercise = Exercise;\n this.EIMModel = EIMModel;\n this.Record = Record;\n this.PreviousEntries = PreviousEntries;\n this.InProgress = InProgress;\n this.Error = Error$;\n this.TimerOptions = TimerOptions;\n }\n}\n\nexport function RecordModel$1_$reflection(gen0) {\n return record_type(\"Omnicv.Client.Pages.Fitness.AddEditExerciseRecord.RecordModel`1\", [gen0], RecordModel$1, () => [[\"RecordId\", int64_type], [\"WorkoutId\", option_type(int64_type)], [\"ExerciseId\", int64_type], [\"Exercise\", option_type(Exercise_$reflection())], [\"EIMModel\", Model_$reflection_1()], [\"Record\", gen0], [\"PreviousEntries\", list_type(tuple_type(EventInfo_$reflection(), gen0))], [\"InProgress\", bool_type], [\"Error\", option_type(string_type)], [\"TimerOptions\", option_type(TimerOptions_$reflection())]]);\n}\n\nexport function RecordModel$1__IsEditing(this$) {\n return compare(this$.RecordId, toInt64(fromInt32(0))) > 0;\n}\n\nexport function RecordModel$1__GetExerciseId(this$) {\n if (compare(this$.ExerciseId, toInt64(fromInt32(0))) > 0) {\n return this$.ExerciseId;\n }\n else if (this$.Exercise != null) {\n return value_2(this$.Exercise).Id;\n }\n else {\n return flex_form.getExerciseId(this$.Record);\n }\n}\n\nexport class RecordMsg$1 extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RecordAUpdated\", \"RecordBUpdated\", \"FetchExercise\", \"FetchExerciseRecordAddingInfoSuccess\", \"FetchExerciseSuccess\", \"FetchSuccess\", \"FetchPreviousSuccess\", \"Failure\", \"Submit\", \"SubmitSuccess\", \"UpdateTimerOptions\", \"SetTimer\", \"EIMMsg\"];\n }\n}\n\nexport function RecordMsg$1_$reflection(gen0) {\n return union_type(\"Omnicv.Client.Pages.Fitness.AddEditExerciseRecord.RecordMsg`1\", [gen0], RecordMsg$1, () => [[[\"Item\", EventInfo_$reflection()]], [[\"Item\", gen0]], [], [[\"Item\", ExerciseRecordAddingInfo$1_$reflection(gen0)]], [[\"Item\", Exercise_$reflection()]], [[\"Item\", tuple_type(EventInfo_$reflection(), gen0)]], [[\"Item\", list_type(tuple_type(EventInfo_$reflection(), gen0))]], [[\"Item\", class_type(\"System.Exception\")]], [], [[\"Item\", EventInfo_$reflection()]], [[\"Item\", TimerOptions_$reflection()]], [[\"Item\", class_type(\"System.DateTime\")]], [[\"Item\", Msg_$reflection_1()]]]);\n}\n\nclass AddEditExerciseRecordHandler$1 {\n constructor(createDefault, service, buildForm, displayRecord) {\n this.createDefault = createDefault;\n this.service = service;\n this.buildForm = buildForm;\n this.displayRecord = displayRecord;\n }\n}\n\nfunction AddEditExerciseRecordHandler$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Pages.Fitness.AddEditExerciseRecord.AddEditExerciseRecordHandler`1\", [gen0], AddEditExerciseRecordHandler$1);\n}\n\nfunction AddEditExerciseRecordHandler$1_$ctor_20729692(createDefault, service, buildForm, displayRecord) {\n return new AddEditExerciseRecordHandler$1(createDefault, service, buildForm, displayRecord);\n}\n\nfunction AddEditExerciseRecordHandler$1__InitCommonWithInfo(this$, withEventInfo, eventInfo, workoutId, exerciseId, cmd) {\n const defaultValue = this$.createDefault(exerciseId);\n const patternInput = withEventInfo ? initCommon(eventInfo) : initCommonNoRegistration(eventInfo);\n return [new RecordModel$1(eventInfo.Id, workoutId, exerciseId, undefined, patternInput[0], defaultValue, empty(), true, undefined, undefined), Cmd_batch(ofArray([Cmd_map((Item) => (new RecordMsg$1(12, [Item])), patternInput[1]), cmd]))];\n}\n\nfunction AddEditExerciseRecordHandler$1__InitCommon(this$, withEventInfo, contentTypeId, recordId, workoutId, exerciseId, cmd) {\n let bind$0040;\n return AddEditExerciseRecordHandler$1__InitCommonWithInfo(this$, withEventInfo, (bind$0040 = EventInfo_Default_7F9DDECF(common.getNow()), new EventInfo(recordId, contentTypeId, bind$0040.ProfileId, bind$0040.EventTimestamp, bind$0040.CreatedAt, bind$0040.UpdatedAt, bind$0040.PlaceId, bind$0040.PlaceName, bind$0040.Latitude, bind$0040.Longitude, bind$0040.LocationTz, bind$0040.LocationTzOffsetMin, bind$0040.ClientTz, bind$0040.ClientTzOffsetMin)), workoutId, exerciseId, cmd);\n}\n\nfunction AddEditExerciseRecordHandler$1__InitNew(this$, withEventInfo, session, contentTypeId, workoutId, exerciseId, noFetch) {\n let pagingOptions;\n const patternInput = AddEditExerciseRecordHandler$1__InitCommon(this$, withEventInfo, contentTypeId, 0n, workoutId, exerciseId, noFetch ? Cmd_none() : ((pagingOptions = (new PagingOptions(undefined, 10, false, undefined, undefined)), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry3(this$.service.GetExerciseRecordAddingInfo)(Session__GetCurrentProfileId(session))(exerciseId), pagingOptions, (Item) => (new RecordMsg$1(3, [Item])), (Item_1) => (new RecordMsg$1(7, [Item_1]))))));\n const model = patternInput[0];\n return [new RecordModel$1(model.RecordId, model.WorkoutId, model.ExerciseId, model.Exercise, model.EIMModel, model.Record, model.PreviousEntries, model.InProgress, model.Error, AddEditExerciseRecordHandler$1__GetTimerOptions_Z524259C1(this$, exerciseId)), patternInput[1]];\n}\n\nfunction AddEditExerciseRecordHandler$1__InitEdit(this$, withEventInfo, session, contentTypeId, id) {\n return AddEditExerciseRecordHandler$1__InitCommon(this$, withEventInfo, contentTypeId, id, undefined, 0n, Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry2(this$.service.GetRecord)(Session__GetCurrentProfileId(session)), id, (Item) => (new RecordMsg$1(5, [Item])), (Item_1) => (new RecordMsg$1(7, [Item_1]))));\n}\n\nfunction AddEditExerciseRecordHandler$1__Update(this$, session, msg, model) {\n let bind$0040, eventInfo, bind$0040_1;\n const withEventInfo = (newModel, eventInfo_1) => (new RecordModel$1(newModel.RecordId, newModel.WorkoutId, newModel.ExerciseId, newModel.Exercise, Model__UpdateEventInfo_Z45EFA9A8(model.EIMModel, eventInfo_1), newModel.Record, newModel.PreviousEntries, newModel.InProgress, newModel.Error, newModel.TimerOptions));\n const handlePreviousEntriesUpdate = (result_1, triggerFetchExercise) => {\n let now, midnight, patternInput, todayRecords, previousRecords, lastDate, midnight_1;\n const newModel_1 = new RecordModel$1(model.RecordId, model.WorkoutId, model.ExerciseId, model.Exercise, model.EIMModel, model.Record, result_1, false, model.Error, model.TimerOptions);\n const activeWorkoutEventInfo = map((tuple_3) => tuple_3[0], Session__GetActiveWorkoutRecord(session));\n if ((isEmpty(result_1) && (activeWorkoutEventInfo == null)) ? true : RecordModel$1__IsEditing(model)) {\n return [newModel_1, Cmd_none()];\n }\n else {\n const sourceEventInfo = (activeWorkoutEventInfo != null) ? value_2(activeWorkoutEventInfo) : EventInfo__ClearLocation(head(result_1)[0]);\n const newRecord = isEmpty(result_1) ? newModel_1.Record : clearId(setWorkoutRecordId((now = common.getNow(), (midnight = create(year(now), month(now), day(now), 0, 0, 0, 0, 2), (patternInput = partition((tupledArg) => (compare_1(tupledArg[0].EventTimestamp, midnight) > 0), result_1), (todayRecords = patternInput[0], (previousRecords = patternInput[1], (length(todayRecords) > 0) ? head(todayRecords)[1] : ((lastDate = head(previousRecords)[0].EventTimestamp, (midnight_1 = create(year(lastDate), month(lastDate), day(lastDate), 0, 0, 0, 0, 2), head(reverse(filter((tupledArg_1) => (compare_1(tupledArg_1[0].EventTimestamp, midnight_1) > 0), previousRecords)))[1])))))))), undefined));\n const now_1 = common.getNow();\n return [withEventInfo(new RecordModel$1(newModel_1.RecordId, newModel_1.WorkoutId, newModel_1.ExerciseId, newModel_1.Exercise, newModel_1.EIMModel, newRecord, newModel_1.PreviousEntries, newModel_1.InProgress, newModel_1.Error, newModel_1.TimerOptions), new EventInfo(0n, sourceEventInfo.ContentTypeId, sourceEventInfo.ProfileId, now_1, now_1, now_1, sourceEventInfo.PlaceId, sourceEventInfo.PlaceName, sourceEventInfo.Latitude, sourceEventInfo.Longitude, sourceEventInfo.LocationTz, sourceEventInfo.LocationTzOffsetMin, sourceEventInfo.ClientTz, sourceEventInfo.ClientTzOffsetMin)), (!triggerFetchExercise ? true : RecordModel$1__IsEditing(model)) ? Cmd_none() : singleton((dispatch) => {\n dispatch(new RecordMsg$1(2, []));\n })];\n }\n };\n switch (msg.tag) {\n case 0:\n return [withEventInfo(model, msg.fields[0]), Cmd_none()];\n case 1:\n return [new RecordModel$1(model.RecordId, model.WorkoutId, model.ExerciseId, model.Exercise, model.EIMModel, msg.fields[0], model.PreviousEntries, model.InProgress, model.Error, model.TimerOptions), Cmd_none()];\n case 2:\n if (compare(model.ExerciseId, toInt64(fromInt32(0))) > 0) {\n return [new RecordModel$1(model.RecordId, model.WorkoutId, model.ExerciseId, model.Exercise, model.EIMModel, model.Record, model.PreviousEntries, true, model.Error, model.TimerOptions), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry2(fitnessService.GetExercise)(Session__GetCurrentProfileId(session)), model.ExerciseId, (Item_2) => (new RecordMsg$1(4, [Item_2])), (Item_3) => (new RecordMsg$1(7, [Item_3])))];\n }\n else {\n return [model, Cmd_none()];\n }\n case 4:\n return [new RecordModel$1(model.RecordId, model.WorkoutId, model.ExerciseId, msg.fields[0], model.EIMModel, model.Record, model.PreviousEntries, false, model.Error, model.TimerOptions), Cmd_none()];\n case 5: {\n const eventInfo_6 = msg.fields[0][0];\n return [(bind$0040 = withEventInfo(model, eventInfo_6), new RecordModel$1(eventInfo_6.Id, bind$0040.WorkoutId, bind$0040.ExerciseId, bind$0040.Exercise, bind$0040.EIMModel, msg.fields[0][1], bind$0040.PreviousEntries, false, bind$0040.Error, bind$0040.TimerOptions)), singleton((dispatch_1) => {\n dispatch_1(new RecordMsg$1(2, []));\n })];\n }\n case 6:\n return handlePreviousEntriesUpdate(msg.fields[0], true);\n case 3: {\n const result_4 = msg.fields[0];\n const patternInput_3 = handlePreviousEntriesUpdate(result_4.ExerciseRecords, false);\n const newModel_2 = patternInput_3[0];\n return [new RecordModel$1(newModel_2.RecordId, newModel_2.WorkoutId, newModel_2.ExerciseId, result_4.Exercise, newModel_2.EIMModel, newModel_2.Record, newModel_2.PreviousEntries, newModel_2.InProgress, newModel_2.Error, newModel_2.TimerOptions), patternInput_3[1]];\n }\n case 8: {\n let timerCmd;\n const matchValue = model.TimerOptions;\n if (matchValue != null) {\n const timerOptions = matchValue;\n if (timerOptions.Start) {\n const timerEnd = op_Addition(common.getNow(), fromSeconds(timerOptions.DurationSecs));\n timerCmd = singleton((dispatch_2) => {\n dispatch_2(new RecordMsg$1(11, [timerEnd]));\n });\n }\n else {\n timerCmd = Cmd_none();\n }\n }\n else {\n timerCmd = Cmd_none();\n }\n return [new RecordModel$1(model.RecordId, model.WorkoutId, model.ExerciseId, model.Exercise, model.EIMModel, model.Record, model.PreviousEntries, true, model.Error, model.TimerOptions), Cmd_batch(ofArray([Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, (eventInfo = prepareEventInfoForSubmit(session, model.EIMModel), (record) => {\n const newEventInfo = new EventInfo(eventInfo.Id, eventInfo.ContentTypeId, Session__GetCurrentProfileId(session), eventInfo.EventTimestamp, eventInfo.CreatedAt, eventInfo.UpdatedAt, eventInfo.PlaceId, eventInfo.PlaceName, eventInfo.Latitude, eventInfo.Longitude, eventInfo.LocationTz, eventInfo.LocationTzOffsetMin, eventInfo.ClientTz, eventInfo.ClientTzOffsetMin);\n const finalRecord = setWorkoutRecordId(record, map((record_1) => record_1.Id, map((tuple) => tuple[1], Session__GetActiveWorkoutRecord(session))));\n return (compare(eventInfo.Id, toInt64(fromInt32(0))) > 0) ? this$.service.Edit(newEventInfo, finalRecord) : this$.service.Add(newEventInfo, finalRecord);\n }), model.Record, (Item_4) => (new RecordMsg$1(9, [Item_4])), (Item_5) => (new RecordMsg$1(7, [Item_5]))), timerCmd]))];\n }\n case 11:\n return [model, Cmd_none()];\n case 9: {\n const eventInfo_8 = msg.fields[0];\n return [(bind$0040_1 = withEventInfo(model, eventInfo_8), new RecordModel$1(eventInfo_8.Id, bind$0040_1.WorkoutId, bind$0040_1.ExerciseId, bind$0040_1.Exercise, bind$0040_1.EIMModel, bind$0040_1.Record, bind$0040_1.PreviousEntries, false, bind$0040_1.Error, bind$0040_1.TimerOptions)), Router_newUrl(new Route(42, [RecordModel$1__GetExerciseId(model)]))];\n }\n case 10: {\n const timerOptions_1 = msg.fields[0];\n if ((model.TimerOptions == null) ? true : !equals(value_2(model.TimerOptions), timerOptions_1)) {\n AddEditExerciseRecordHandler$1__SetTimerOptions(this$, model.ExerciseId, timerOptions_1);\n }\n return [new RecordModel$1(model.RecordId, model.WorkoutId, model.ExerciseId, model.Exercise, model.EIMModel, model.Record, model.PreviousEntries, model.InProgress, model.Error, timerOptions_1), Cmd_none()];\n }\n case 7:\n return [new RecordModel$1(model.RecordId, model.WorkoutId, model.ExerciseId, model.Exercise, model.EIMModel, model.Record, model.PreviousEntries, false, exnToDisplayString(msg.fields[0]), model.TimerOptions), Cmd_none()];\n default: {\n const patternInput_2 = update_1(msg.fields[0], model.EIMModel);\n return [new RecordModel$1(model.RecordId, model.WorkoutId, model.ExerciseId, model.Exercise, patternInput_2[0], model.Record, model.PreviousEntries, model.InProgress, model.Error, model.TimerOptions), Cmd_map((Item_1) => (new RecordMsg$1(12, [Item_1])), patternInput_2[1])];\n }\n }\n}\n\nfunction AddEditExerciseRecordHandler$1__BuildForm(this$, withEventInfo, model, dispatch) {\n const form_1 = this$.buildForm(AddEditExerciseRecordHandler$1__buildFormBase(this$, withEventInfo, model, dispatch), RecordModel$1__IsEditing(model), model, model.Record);\n FlexFormBase$1__SetState(form_1, model.InProgress, model.Error);\n return form_1;\n}\n\nfunction AddEditExerciseRecordHandler$1__GetTimerOptions_Z524259C1(this$, exerciseId) {\n const result = localStorage.getItem(`timer:${exerciseId}`);\n if (isNullOrWhiteSpace(result)) {\n return defaultTimer;\n }\n else {\n return TimerOptions_Parse_Z721C83C5(result);\n }\n}\n\nfunction AddEditExerciseRecordHandler$1__SetTimerOptions(this$, exerciseId, timerOptions) {\n localStorage.setItem(`timer:${exerciseId}`, TimerOptions__Serialise(timerOptions));\n}\n\nfunction AddEditExerciseRecordHandler$1__ViewTimerOptions(this$, timerOptions, dispatch) {\n const form = FlexForm$1_$ctor_2ABDDB55((arg) => {\n dispatch(new RecordMsg$1(10, [arg]));\n }, (value) => {\n }, undefined);\n FlexFormFields$1__AddCheckbox_264AA22A(FlexFormFields$1__AddDurationSecsWithSeconds_ZAAC24(FlexFormFields$1__AddGroup_6DFDD678(FlexForm$1__get_Fields(form)), \"DurationSecs\", noValidation), \"Start\", noValidation);\n return form[\"Omnicv.Client.Common.Components.FlexForm.FlexFormBase`1.RenderFields\"](false, timerOptions);\n}\n\nfunction AddEditExerciseRecordHandler$1__CopyData(this$, model, dispatch, id) {\n const previous = tryFind((tupledArg) => equals_1(tupledArg[0].Id, id), model.PreviousEntries);\n if (previous == null) {\n }\n else {\n dispatch(new RecordMsg$1(1, [previous[1]]));\n }\n}\n\nfunction AddEditExerciseRecordHandler$1__View(this$, caption, session, model, dispatch) {\n const exerciseTitle = defaultArg(map((exercise) => exercise.Name, model.Exercise), \" \");\n const title = RecordModel$1__IsEditing(model) ? (`Update ${caption}`) : (`Add ${caption}`);\n const form = AddEditExerciseRecordHandler$1__BuildForm(this$, true, model, dispatch);\n const children_6 = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Error: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => append(singleton_1(div(singleton(new Option(2, [model.InProgress])), toList(delay(() => append(singleton_1(container(empty(), toList(delay(() => append(singleton_1(h1(empty())(singleton(exerciseTitle))), delay(() => append(singleton_1(h2(singleton(new Option_1(6, [])))(singleton(title))), delay(() => ((model.WorkoutId != null) ? singleton_1(h4(singleton(new Option_1(6, [])))(singleton(`For workout ${value_2(model.WorkoutId)}`))) : empty_1()))))))))), delay(() => {\n const mainFormElement = FlexFormBase$1__Render_2B595(form, [model.EIMModel.EventInfo, model.Record]);\n let timerElements;\n const matchValue_1 = model.TimerOptions;\n timerElements = ((matchValue_1 != null) ? AddEditExerciseRecordHandler$1__ViewTimerOptions(this$, matchValue_1, dispatch) : empty());\n return singleton_1(createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(cons(mainFormElement, timerElements))),\n }));\n })))))), delay(() => {\n let displayRecord, children_4;\n if (!isEmpty(model.PreviousEntries)) {\n let entries;\n const list_1 = List_groupBy((tupledArg) => fromDateTime(tupledArg[0].EventTimestamp), model.PreviousEntries, {\n Equals: equals_2,\n GetHashCode: dateHash,\n });\n entries = collect((displayRecord = curry3(this$.displayRecord)(RecordModel$1__IsEditing(model) ? undefined : ((id) => {\n AddEditExerciseRecordHandler$1__CopyData(this$, model, dispatch, id);\n })), (tupledArg_1) => displayDailySingleExerciseRecords(session, uncurry2(displayRecord), tupledArg_1[0], tupledArg_1[1])), list_1);\n return singleton_1((children_4 = ofArray([h4(empty())(singleton(\"Previous entries\")), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(entries)),\n })]), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_4)),\n })));\n }\n else {\n return empty_1();\n }\n }))));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_6)),\n });\n}\n\nexport function AddEditExerciseRecordHandler$1__buildFormBase(this$, withEventInfo, model, dispatch) {\n const form = FlexFormTuple$2_$ctor_5AE4FFF0((arg) => {\n dispatch(new RecordMsg$1(0, [arg]));\n }, (arg_1) => {\n dispatch(new RecordMsg$1(1, [arg_1]));\n }, (_arg_1) => {\n dispatch(new RecordMsg$1(8, []));\n }, () => {\n if (compare(model.ExerciseId, toInt64(fromInt32(0))) > 0) {\n Router_modifyLocation(new Route(42, [model.ExerciseId]));\n }\n else {\n Router_modifyLocation(new Route(32, []));\n }\n });\n if (withEventInfo) {\n addEventInfoWithSuggestionsToFlexForm(form, model.EIMModel.EventInfo, model.EIMModel.Position, model.PreviousEntries);\n if (!RecordModel$1__IsEditing(model)) {\n tryUpdateLocationFromSuggestions(() => getSuggestions(model.EIMModel.Position, model.PreviousEntries), model.EIMModel);\n }\n }\n return form;\n}\n\nfunction Handlers_noValidation(_arg) {\n return undefined;\n}\n\nfunction Handlers_buildRepsWithWeightRecordForm(form, _editing, _model, record) {\n FlexFormFields$1__AddPositiveInt_ZAAC24(FlexFormFields$1__AddPositiveFloat_1D6F52FB(FlexFormFields$1__AddGroup_6DFDD678(FlexFormTuple$2__get_FieldsSnd(form)), \"Weight\", validateWeight), \"Repetitions\", validateRepetitions);\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormTuple$2__get_FieldsSnd(form), \"Notes\", validateNotes);\n return form;\n}\n\nfunction Handlers_displayRecord(getInfo, copyDataFunc, session, data_, data__1) {\n const data = [data_, data__1];\n const patternInput = getInfo(data[1]);\n return displayExerciseRecordCommon(session, undefined, copyDataFunc, data[0], patternInput[0], patternInput[1], patternInput[2]);\n}\n\nconst Handlers_repsWithWeight = AddEditExerciseRecordHandler$1_$ctor_20729692(RepsWithWeightRecord_Default_Z524259C1, repsWithWeightRecordService, Handlers_buildRepsWithWeightRecordForm, (copyDataFunc, session, tupledArg) => Handlers_displayRecord(displayRepsWithWeight, copyDataFunc, session, tupledArg[0], tupledArg[1]));\n\nfunction Handlers_buildRepsWithBodyWeightRecordForm(form, _editing, _model, record) {\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddPositiveInt_ZAAC24(FlexFormTuple$2__get_FieldsSnd(form), \"Repetitions\", validateRepetitions), \"Notes\", validateNotes);\n return form;\n}\n\nconst Handlers_repsWithBodyWeight = AddEditExerciseRecordHandler$1_$ctor_20729692(RepsWithBodyWeightRecord_Default_Z524259C1, repsWithBodyWeightRecordService, Handlers_buildRepsWithBodyWeightRecordForm, (copyDataFunc, session, tupledArg) => Handlers_displayRecord(displayRepsWithBodyWeightRecord, copyDataFunc, session, tupledArg[0], tupledArg[1]));\n\nfunction Handlers_buildEnduranceRecordForm(form, _editing, _model, record) {\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddPositiveIntOpt_414042FF(FlexFormFields$1__AddDurationSecs_ZAAC24(FlexFormFields$1__AddPositiveFloat_1D6F52FB(FlexFormTuple$2__get_FieldsSnd(form), \"DistanceKm\", Handlers_noValidation), \"DurationSec\", Handlers_noValidation), \"Calories\", Handlers_noValidation), \"Notes\", validateNotes);\n return form;\n}\n\nconst Handlers_endurance = AddEditExerciseRecordHandler$1_$ctor_20729692(EnduranceRecord_Default_Z524259C1, enduranceRecordService, Handlers_buildEnduranceRecordForm, (copyDataFunc, session, tupledArg) => Handlers_displayRecord(displayEnduranceRecord, copyDataFunc, session, tupledArg[0], tupledArg[1]));\n\nfunction Handlers_buildIntervalsDurationRecordForm(form, _editing, _model, record) {\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddDurationSecs_ZAAC24(FlexFormFields$1__AddDurationSecs_ZAAC24(FlexFormFields$1__AddPositiveInt_ZAAC24(FlexFormTuple$2__get_FieldsSnd(form), \"NumExercises\", Handlers_noValidation), \"WorkDurationSec\", Handlers_noValidation), \"RestDurationSec\", Handlers_noValidation), \"Notes\", validateNotes);\n return form;\n}\n\nconst Handlers_intervalsDuration = AddEditExerciseRecordHandler$1_$ctor_20729692(IntervalsDurationRecord_Default_Z524259C1, intervalsDurationRecordService, Handlers_buildIntervalsDurationRecordForm, (copyDataFunc, session, tupledArg) => Handlers_displayRecord(displayIntervalsDurationRecord, copyDataFunc, session, tupledArg[0], tupledArg[1]));\n\nfunction Handlers_buildIntervalsRepsRecordForm(form, _editing, _model, record) {\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddDurationSecs_ZAAC24(FlexFormFields$1__AddPositiveInt_ZAAC24(FlexFormFields$1__AddPositiveInt_ZAAC24(FlexFormTuple$2__get_FieldsSnd(form), \"NumExercises\", Handlers_noValidation), \"WorkRepetitions\", Handlers_noValidation), \"RestDurationSec\", Handlers_noValidation), \"Notes\", validateNotes);\n return form;\n}\n\nconst Handlers_intervalsReps = AddEditExerciseRecordHandler$1_$ctor_20729692(IntervalsRepsRecord_Default_Z524259C1, intervalsRepsRecordService, Handlers_buildIntervalsRepsRecordForm, (copyDataFunc, session, tupledArg) => Handlers_displayRecord(displayIntervalsRepsRecord, copyDataFunc, session, tupledArg[0], tupledArg[1]));\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RepsWithWeightMsg\", \"RepsWithBodyWeightMsg\", \"EnduranceMsg\", \"IntervalsDurationMsg\", \"IntervalsRepsMsg\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Fitness.AddEditExerciseRecord.Msg\", [], Msg, () => [[[\"Item\", RecordMsg$1_$reflection(RepsWithWeightRecord_$reflection())]], [[\"Item\", RecordMsg$1_$reflection(RepsWithBodyWeightRecord_$reflection())]], [[\"Item\", RecordMsg$1_$reflection(EnduranceRecord_$reflection())]], [[\"Item\", RecordMsg$1_$reflection(IntervalsDurationRecord_$reflection())]], [[\"Item\", RecordMsg$1_$reflection(IntervalsRepsRecord_$reflection())]]]);\n}\n\nexport class Model extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"RepsWithWeightModel\", \"RepsWithBodyWeightModel\", \"EnduranceModel\", \"IntervalsDurationModel\", \"IntervalsRepsModel\"];\n }\n}\n\nexport function Model_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Fitness.AddEditExerciseRecord.Model\", [], Model, () => [[[\"Item\", RecordModel$1_$reflection(RepsWithWeightRecord_$reflection())]], [[\"Item\", RecordModel$1_$reflection(RepsWithBodyWeightRecord_$reflection())]], [[\"Item\", RecordModel$1_$reflection(EnduranceRecord_$reflection())]], [[\"Item\", RecordModel$1_$reflection(IntervalsDurationRecord_$reflection())]], [[\"Item\", RecordModel$1_$reflection(IntervalsRepsRecord_$reflection())]]]);\n}\n\nfunction getLastSection(session, contentTypeId) {\n return last(ofArray_1(split(find((t) => (t.Id === contentTypeId), Session__SiteSettings(session).FitnessContentTypes).Name, [\".\"], undefined, 0))) + \"Record\";\n}\n\nfunction applyHandlerInit(withEventInfo, handler, toModel, toMsg, session, contentTypeId, id, isNew, workoutId, noFetch) {\n const patternInput = isNew ? AddEditExerciseRecordHandler$1__InitNew(handler, withEventInfo, session, contentTypeId, workoutId, id, noFetch) : AddEditExerciseRecordHandler$1__InitEdit(handler, withEventInfo, session, contentTypeId, id);\n return [toModel(patternInput[0]), Cmd_map(toMsg, patternInput[1])];\n}\n\nfunction initEither(withEventInfo, session, contentTypeId, id, isNew, workoutId, noFetch) {\n const lastSection = getLastSection(session, contentTypeId);\n switch (lastSection) {\n case \"RepsWithWeightRecord\":\n return applyHandlerInit(withEventInfo, Handlers_repsWithWeight, (Item) => (new Model(0, [Item])), (Item_1) => (new Msg(0, [Item_1])), session, contentTypeId, id, isNew, workoutId, noFetch);\n case \"RepsWithBodyWeightRecord\":\n return applyHandlerInit(withEventInfo, Handlers_repsWithBodyWeight, (Item_2) => (new Model(1, [Item_2])), (Item_3) => (new Msg(1, [Item_3])), session, contentTypeId, id, isNew, workoutId, noFetch);\n case \"EnduranceRecord\":\n return applyHandlerInit(withEventInfo, Handlers_endurance, (Item_4) => (new Model(2, [Item_4])), (Item_5) => (new Msg(2, [Item_5])), session, contentTypeId, id, isNew, workoutId, noFetch);\n case \"IntervalsDurationRecord\":\n return applyHandlerInit(withEventInfo, Handlers_intervalsDuration, (Item_6) => (new Model(3, [Item_6])), (Item_7) => (new Msg(3, [Item_7])), session, contentTypeId, id, isNew, workoutId, noFetch);\n case \"IntervalsRepsRecord\":\n return applyHandlerInit(withEventInfo, Handlers_intervalsReps, (Item_8) => (new Model(4, [Item_8])), (Item_9) => (new Msg(4, [Item_9])), session, contentTypeId, id, isNew, workoutId, noFetch);\n default:\n return toFail(printf(\"Unable to handle content type %s\"))(lastSection);\n }\n}\n\nexport function initNew(session, contentTypeId, id, workout) {\n return initEither(true, session, contentTypeId, id, true, map((s) => toInt64(parse_2(s, 511, false, 64)), workout), false);\n}\n\nexport function initEdit(session, contentTypeId, id) {\n return initEither(true, session, contentTypeId, id, false, undefined, false);\n}\n\nexport function update(session, msg, model) {\n let copyOfStruct_2, copyOfStruct_1_1, copyOfStruct_3, copyOfStruct_1_2, copyOfStruct_4, copyOfStruct_1_3, copyOfStruct_5, copyOfStruct_1_4, copyOfStruct, copyOfStruct_1;\n switch (msg.tag) {\n case 1:\n if (model.tag === 1) {\n const patternInput_1 = AddEditExerciseRecordHandler$1__Update(Handlers_repsWithBodyWeight, session, msg.fields[0], model.fields[0]);\n return [new Model(1, [patternInput_1[0]]), Cmd_map((Item_1) => (new Msg(1, [Item_1])), patternInput_1[1])];\n }\n else {\n const arg_2 = fullName((copyOfStruct_2 = msg, Msg_$reflection()));\n const arg_1_1 = fullName((copyOfStruct_1_1 = model, Model_$reflection()));\n return toFail(printf(\"Unexpected model type \\'%s\\' for message type \\'%s\\'\"))(arg_2)(arg_1_1);\n }\n case 2:\n if (model.tag === 2) {\n const patternInput_2 = AddEditExerciseRecordHandler$1__Update(Handlers_endurance, session, msg.fields[0], model.fields[0]);\n return [new Model(2, [patternInput_2[0]]), Cmd_map((Item_2) => (new Msg(2, [Item_2])), patternInput_2[1])];\n }\n else {\n const arg_3 = fullName((copyOfStruct_3 = msg, Msg_$reflection()));\n const arg_1_2 = fullName((copyOfStruct_1_2 = model, Model_$reflection()));\n return toFail(printf(\"Unexpected model type \\'%s\\' for message type \\'%s\\'\"))(arg_3)(arg_1_2);\n }\n case 3:\n if (model.tag === 3) {\n const patternInput_3 = AddEditExerciseRecordHandler$1__Update(Handlers_intervalsDuration, session, msg.fields[0], model.fields[0]);\n return [new Model(3, [patternInput_3[0]]), Cmd_map((Item_3) => (new Msg(3, [Item_3])), patternInput_3[1])];\n }\n else {\n const arg_4 = fullName((copyOfStruct_4 = msg, Msg_$reflection()));\n const arg_1_3 = fullName((copyOfStruct_1_3 = model, Model_$reflection()));\n return toFail(printf(\"Unexpected model type \\'%s\\' for message type \\'%s\\'\"))(arg_4)(arg_1_3);\n }\n case 4:\n if (model.tag === 4) {\n const patternInput_4 = AddEditExerciseRecordHandler$1__Update(Handlers_intervalsReps, session, msg.fields[0], model.fields[0]);\n return [new Model(4, [patternInput_4[0]]), Cmd_map((Item_4) => (new Msg(4, [Item_4])), patternInput_4[1])];\n }\n else {\n const arg_5 = fullName((copyOfStruct_5 = msg, Msg_$reflection()));\n const arg_1_4 = fullName((copyOfStruct_1_4 = model, Model_$reflection()));\n return toFail(printf(\"Unexpected model type \\'%s\\' for message type \\'%s\\'\"))(arg_5)(arg_1_4);\n }\n default:\n if (model.tag === 0) {\n const patternInput = AddEditExerciseRecordHandler$1__Update(Handlers_repsWithWeight, session, msg.fields[0], model.fields[0]);\n return [new Model(0, [patternInput[0]]), Cmd_map((Item) => (new Msg(0, [Item])), patternInput[1])];\n }\n else {\n const arg = fullName((copyOfStruct = msg, Msg_$reflection()));\n const arg_1 = fullName((copyOfStruct_1 = model, Model_$reflection()));\n return toFail(printf(\"Unexpected model type \\'%s\\' for message type \\'%s\\'\"))(arg)(arg_1);\n }\n }\n}\n\nexport function getSetTimerMsg(msg) {\n let matchResult, dateTime, dateTime_1, dateTime_2, dateTime_3, dateTime_4;\n switch (msg.tag) {\n case 1: {\n if (msg.fields[0].tag === 11) {\n matchResult = 1;\n dateTime_1 = msg.fields[0].fields[0];\n }\n else {\n matchResult = 5;\n }\n break;\n }\n case 2: {\n if (msg.fields[0].tag === 11) {\n matchResult = 2;\n dateTime_2 = msg.fields[0].fields[0];\n }\n else {\n matchResult = 5;\n }\n break;\n }\n case 3: {\n if (msg.fields[0].tag === 11) {\n matchResult = 3;\n dateTime_3 = msg.fields[0].fields[0];\n }\n else {\n matchResult = 5;\n }\n break;\n }\n case 4: {\n if (msg.fields[0].tag === 11) {\n matchResult = 4;\n dateTime_4 = msg.fields[0].fields[0];\n }\n else {\n matchResult = 5;\n }\n break;\n }\n default:\n if (msg.fields[0].tag === 11) {\n matchResult = 0;\n dateTime = msg.fields[0].fields[0];\n }\n else {\n matchResult = 5;\n }\n }\n switch (matchResult) {\n case 0:\n return dateTime;\n case 1:\n return dateTime_1;\n case 2:\n return dateTime_2;\n case 3:\n return dateTime_3;\n case 4:\n return dateTime_4;\n default:\n return undefined;\n }\n}\n\nexport function mapModelToEIMMsg(model, subMsg) {\n switch (model.tag) {\n case 1:\n return new Msg(1, [new RecordMsg$1(12, [subMsg])]);\n case 2:\n return new Msg(2, [new RecordMsg$1(12, [subMsg])]);\n case 3:\n return new Msg(3, [new RecordMsg$1(12, [subMsg])]);\n case 4:\n return new Msg(4, [new RecordMsg$1(12, [subMsg])]);\n default:\n return new Msg(0, [new RecordMsg$1(12, [subMsg])]);\n }\n}\n\nexport function view(session, model, dispatch) {\n switch (model.tag) {\n case 1:\n return AddEditExerciseRecordHandler$1__View(Handlers_repsWithBodyWeight, \"reps with body weight\", session, model.fields[0], (arg_1) => {\n dispatch(new Msg(1, [arg_1]));\n });\n case 2:\n return AddEditExerciseRecordHandler$1__View(Handlers_endurance, \"endurance\", session, model.fields[0], (arg_2) => {\n dispatch(new Msg(2, [arg_2]));\n });\n case 3:\n return AddEditExerciseRecordHandler$1__View(Handlers_intervalsDuration, \"intervals / HIIT\", session, model.fields[0], (arg_3) => {\n dispatch(new Msg(3, [arg_3]));\n });\n case 4:\n return AddEditExerciseRecordHandler$1__View(Handlers_intervalsReps, \"reps in intervals\", session, model.fields[0], (arg_4) => {\n dispatch(new Msg(4, [arg_4]));\n });\n default:\n return AddEditExerciseRecordHandler$1__View(Handlers_repsWithWeight, \"reps with weight\", session, model.fields[0], (arg) => {\n dispatch(new Msg(0, [arg]));\n });\n }\n}\n\nfunction ExerciseRecordsMany_msgFromExerciseRecord(exerciseId, eventInfo, record) {\n switch (record.tag) {\n case 1: {\n const record_2 = record.fields[0];\n return new Msg(1, [new RecordMsg$1(6, [singleton([eventInfo, new RepsWithBodyWeightRecord(record_2.Id, exerciseId, record_2.WorkoutRecordId, record_2.Repetitions, record_2.Notes)])])]);\n }\n case 2: {\n const record_3 = record.fields[0];\n return new Msg(2, [new RecordMsg$1(6, [singleton([eventInfo, new EnduranceRecord(record_3.Id, exerciseId, record_3.WorkoutRecordId, record_3.DurationSec, record_3.DistanceKm, record_3.Calories, record_3.Notes)])])]);\n }\n case 3: {\n const record_4 = record.fields[0];\n return new Msg(3, [new RecordMsg$1(6, [singleton([eventInfo, new IntervalsDurationRecord(record_4.Id, exerciseId, record_4.WorkoutRecordId, record_4.NumExercises, record_4.WorkDurationSec, record_4.RestDurationSec, record_4.Notes)])])]);\n }\n case 4: {\n const record_5 = record.fields[0];\n return new Msg(4, [new RecordMsg$1(6, [singleton([eventInfo, new IntervalsRepsRecord(record_5.Id, exerciseId, record_5.WorkoutRecordId, record_5.NumExercises, record_5.WorkRepetitions, record_5.RestDurationSec, record_5.Notes)])])]);\n }\n default: {\n const record_1 = record.fields[0];\n return new Msg(0, [new RecordMsg$1(6, [singleton([eventInfo, new RepsWithWeightRecord(record_1.Id, exerciseId, record_1.WorkoutRecordId, record_1.Repetitions, record_1.Weight, record_1.Notes)])])]);\n }\n }\n}\n\nfunction ExerciseRecordsMany_modelToExerciseRecord(model) {\n switch (model.tag) {\n case 1:\n return new ExerciseRecord(1, [model.fields[0].Record]);\n case 2:\n return new ExerciseRecord(2, [model.fields[0].Record]);\n case 3:\n return new ExerciseRecord(3, [model.fields[0].Record]);\n case 4:\n return new ExerciseRecord(4, [model.fields[0].Record]);\n default:\n return new ExerciseRecord(0, [model.fields[0].Record]);\n }\n}\n\nfunction ExerciseRecordsMany_modelToEventInfo(model) {\n switch (model.tag) {\n case 1:\n return model.fields[0].EIMModel.EventInfo;\n case 2:\n return model.fields[0].EIMModel.EventInfo;\n case 3:\n return model.fields[0].EIMModel.EventInfo;\n case 4:\n return model.fields[0].EIMModel.EventInfo;\n default:\n return model.fields[0].EIMModel.EventInfo;\n }\n}\n\nexport class ExerciseRecordsMany_ModelMany extends Record {\n constructor(WorkoutId, Data, Models, InProgress, Error$) {\n super();\n this.WorkoutId = WorkoutId;\n this.Data = Data;\n this.Models = Models;\n this.InProgress = InProgress;\n this.Error = Error$;\n }\n}\n\nexport function ExerciseRecordsMany_ModelMany_$reflection() {\n return record_type(\"Omnicv.Client.Pages.Fitness.AddEditExerciseRecord.ExerciseRecordsMany.ModelMany\", [], ExerciseRecordsMany_ModelMany, () => [[\"WorkoutId\", int64_type], [\"Data\", option_type(WorkoutCircuitData_$reflection())], [\"Models\", array_type(Model_$reflection())], [\"InProgress\", bool_type], [\"Error\", option_type(string_type)]]);\n}\n\nexport function ExerciseRecordsMany_ModelMany__GetEventInfo(this$) {\n return ExerciseRecordsMany_modelToEventInfo(item(0, this$.Models));\n}\n\nexport function ExerciseRecordsMany_ModelMany__GetRecords(this$) {\n return map_1(ExerciseRecordsMany_modelToExerciseRecord, ofArray(this$.Models));\n}\n\nexport class ExerciseRecordsMany_MsgMany extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"SingleRecordMsg\", \"FetchSuccess\", \"Failure\", \"Submit\", \"SubmitSuccess\"];\n }\n}\n\nexport function ExerciseRecordsMany_MsgMany_$reflection() {\n return union_type(\"Omnicv.Client.Pages.Fitness.AddEditExerciseRecord.ExerciseRecordsMany.MsgMany\", [], ExerciseRecordsMany_MsgMany, () => [[[\"Item1\", Msg_$reflection()], [\"Item2\", int32_type]], [[\"Item\", WorkoutCircuitData_$reflection()]], [[\"Item\", class_type(\"System.Exception\")]], [], [[\"Item\", unit_type]]]);\n}\n\nexport function ExerciseRecordsMany_mapModelToEIMMsg(model, subMsg) {\n return new ExerciseRecordsMany_MsgMany(0, [mapModelToEIMMsg(item(0, model.Models), subMsg), 0]);\n}\n\nfunction ExerciseRecordsMany_initNewRecordModel(session, records, workout, index, exercise) {\n let matchValue, subMsg;\n const patternInput = initEither(index === 0, session, exercise.ContentTypeId, exercise.Id, true, workout.Id, true);\n const cmd = patternInput[1];\n return [patternInput[0], Cmd_map((msg_1) => (new ExerciseRecordsMany_MsgMany(0, [msg_1, index])), (matchValue = tryFind((tupledArg) => equals_1(flex_form.getExerciseId(tupledArg[1]), exercise.Id), records), (matchValue == null) ? cmd : ((subMsg = ExerciseRecordsMany_msgFromExerciseRecord(exercise.Id, matchValue[0], matchValue[1]), append_1(cmd, singleton((dispatch) => {\n dispatch(subMsg);\n }))))))];\n}\n\nexport function ExerciseRecordsMany_initNewMany(session, workoutId) {\n return [new ExerciseRecordsMany_ModelMany(workoutId, undefined, [], true, undefined), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, curry2(fitnessService.GetWorkoutCircuitData)(Session__GetCurrentProfileId(session)), workoutId, (Item) => (new ExerciseRecordsMany_MsgMany(1, [Item])), (Item_1) => (new ExerciseRecordsMany_MsgMany(2, [Item_1])))];\n}\n\nexport function ExerciseRecordsMany_update(session, msg, model) {\n let eventInfo;\n switch (msg.tag) {\n case 1: {\n const result = msg.fields[0];\n const pairs = mapIndexed((index_1, exercise) => ExerciseRecordsMany_initNewRecordModel(session, result.ExerciseRecords, result.Workout, index_1, exercise), result.Exercises);\n return [new ExerciseRecordsMany_ModelMany(model.WorkoutId, result, toArray(map_1((tuple) => tuple[0], pairs)), false, model.Error), Cmd_batch(map_1((tuple_1) => tuple_1[1], pairs))];\n }\n case 3:\n return [new ExerciseRecordsMany_ModelMany(model.WorkoutId, model.Data, model.Models, true, model.Error), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, (eventInfo = ExerciseRecordsMany_ModelMany__GetEventInfo(model), (records) => {\n const profileId = Session__GetCurrentProfileId(session) | 0;\n return fitnessService.AddExerciseRecords((Session__GetActiveWorkoutRecord(session) != null) ? (new WorkoutRecordType(0, [])) : (new WorkoutRecordType(1, [model.WorkoutId])), new EventInfo(eventInfo.Id, 0, profileId, eventInfo.EventTimestamp, eventInfo.CreatedAt, eventInfo.UpdatedAt, eventInfo.PlaceId, eventInfo.PlaceName, eventInfo.Latitude, eventInfo.Longitude, eventInfo.LocationTz, eventInfo.LocationTzOffsetMin, eventInfo.ClientTz, eventInfo.ClientTzOffsetMin), records);\n }), ExerciseRecordsMany_ModelMany__GetRecords(model), () => (new ExerciseRecordsMany_MsgMany(4, [undefined])), (Item_1) => (new ExerciseRecordsMany_MsgMany(2, [Item_1])))];\n case 4:\n return [new ExerciseRecordsMany_ModelMany(model.WorkoutId, model.Data, model.Models, false, model.Error), Router_newUrl(new Route(38, [model.WorkoutId]))];\n case 2:\n return [new ExerciseRecordsMany_ModelMany(model.WorkoutId, model.Data, model.Models, false, exnToDisplayString(msg.fields[0])), Cmd_none()];\n default: {\n const index = msg.fields[1] | 0;\n const patternInput = update(session, msg.fields[0], item(index, model.Models));\n return [new ExerciseRecordsMany_ModelMany(model.WorkoutId, model.Data, updateAt(index, patternInput[0], model.Models), model.InProgress, model.Error), Cmd_map((msg_1) => (new ExerciseRecordsMany_MsgMany(0, [msg_1, index])), patternInput[1])];\n }\n }\n}\n\nfunction ExerciseRecordsMany_renderModelForm(isDisabled, caption, withEventInfo, model, form) {\n const children_2 = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Error: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => singleton_1(div(empty(), toList(delay(() => {\n const heading = container(empty(), singleton(h3(singleton(new Option_1(6, [])))(singleton(caption))));\n const recordRendering = FlexFormFields$1__Render(FlexFormTuple$2__get_FieldsSnd(form), isDisabled, model.Record);\n const elements = withEventInfo ? append_1(FlexFormFields$1__Render(FlexFormTuple$2__get_FieldsFst(form), isDisabled, model.EIMModel.EventInfo), cons(heading, recordRendering)) : cons(heading, recordRendering);\n return singleton_1(createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(elements)),\n }));\n }))))));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_2)),\n });\n}\n\nfunction ExerciseRecordsMany_canSubmitModelForm(withEventInfo, model, form) {\n const mainResult = FlexFormFields$1__CanSubmit_2B595(FlexFormTuple$2__get_FieldsSnd(form), model.Record);\n if (withEventInfo) {\n return FieldValidationResult__Merge_30561432(mainResult, FlexFormFields$1__CanSubmit_2B595(FlexFormTuple$2__get_FieldsFst(form), model.EIMModel.EventInfo));\n }\n else {\n return mainResult;\n }\n}\n\nfunction ExerciseRecordsMany_getFormletHandle(handler, caption, withEventInfo, model, dispatch) {\n const form = AddEditExerciseRecordHandler$1__BuildForm(handler, withEventInfo, model, dispatch);\n return new Formlet$1((isDisabled, _arg) => ExerciseRecordsMany_renderModelForm(isDisabled, caption, withEventInfo, model, form), () => ExerciseRecordsMany_canSubmitModelForm(withEventInfo, model, form));\n}\n\nfunction ExerciseRecordsMany_getFormlet(exercise, withEventInfo, model, dispatch) {\n const name = exercise.Name;\n switch (model.tag) {\n case 1:\n return ExerciseRecordsMany_getFormletHandle(Handlers_repsWithBodyWeight, `${name}: reps with body weight`, withEventInfo, model.fields[0], (arg_1) => {\n dispatch(new Msg(1, [arg_1]));\n });\n case 2:\n return ExerciseRecordsMany_getFormletHandle(Handlers_endurance, `${name}: endurance`, withEventInfo, model.fields[0], (arg_2) => {\n dispatch(new Msg(2, [arg_2]));\n });\n case 3:\n return ExerciseRecordsMany_getFormletHandle(Handlers_intervalsDuration, `${name}: intervals / HIIT`, withEventInfo, model.fields[0], (arg_3) => {\n dispatch(new Msg(3, [arg_3]));\n });\n case 4:\n return ExerciseRecordsMany_getFormletHandle(Handlers_intervalsReps, `${name}: reps in intervals`, withEventInfo, model.fields[0], (arg_4) => {\n dispatch(new Msg(4, [arg_4]));\n });\n default:\n return ExerciseRecordsMany_getFormletHandle(Handlers_repsWithWeight, `${name}: reps with weight`, withEventInfo, model.fields[0], (arg) => {\n dispatch(new Msg(0, [arg]));\n });\n }\n}\n\nexport function ExerciseRecordsMany_view(model, dispatch) {\n let list_1;\n if (model.Data != null) {\n const form = FlexFormWithFormlets$1_$ctor_Z7DF2018A(mapIndexed((index, tupledArg) => ExerciseRecordsMany_getFormlet(tupledArg[0], index === 0, tupledArg[1], (msg) => {\n dispatch(new ExerciseRecordsMany_MsgMany(0, [msg, index]));\n }), (list_1 = ofArray(model.Models), zip(value_2(model.Data).Exercises, list_1))), () => {\n dispatch(new ExerciseRecordsMany_MsgMany(3, []));\n }, () => {\n Router_modifyLocation(new Route(38, [model.WorkoutId]));\n });\n FlexFormBase$1__SetState(form, model.InProgress, model.Error);\n const children = append_1(toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Error: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => append(singleton_1(h1(empty())(singleton(\"Populate all exercises for workout\"))), delay(() => append(singleton_1(h2(singleton(new Option_1(6, [])))(singleton(value_2(model.Data).Workout.Name))), delay(() => singleton_1(FlexFormBase$1__Render_2B595(form, undefined))))))));\n })), displayWorkoutRecords(value_2(model.Data)));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n });\n }\n else {\n return createElement(\"div\", {\n children: reactApi.Children.toArray([\"Loading data...\"]),\n });\n }\n}\n\n","import { FSharpRef } from \"./Types.js\";\nexport function tryParse(str, defValue) {\n if (str != null && str.match(/^\\s*true\\s*$/i)) {\n defValue.contents = true;\n return true;\n }\n else if (str != null && str.match(/^\\s*false\\s*$/i)) {\n defValue.contents = false;\n return true;\n }\n return false;\n}\nexport function parse(str) {\n const defValue = new FSharpRef(false);\n if (tryParse(str, defValue)) {\n return defValue.contents;\n }\n else {\n throw new Error(`String '${str}' was not recognized as a valid Boolean.`);\n }\n}\n","import * as common from \"../../src/javascript/common.js\";\nimport { collect, filter, empty as empty_2, ofArray, map, singleton } from \"../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { Record, Union } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { tuple_type, unit_type, record_type, class_type, bool_type, option_type, string_type, union_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { Session__GetActiveWorkoutRecord, Icons, Session__GetCurrentName, Session__SetActiveWorkoutRecord_Z2D8A2414, Session__GetCurrentProfileId, Session_$reflection } from \"../Omnicv.Client.Common/SharedView.js\";\nimport { createObj, comparePrimitives, equals } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { EventInfo_$reflection } from \"../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { WorkoutRecord_$reflection } from \"../Omnicv.Shared/FitnessAPI.js\";\nimport { Cmd_none, Cmd_batch, Cmd_OfPromise_either } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { map as map_1, toList as toList_1, FSharpMap__Add, empty } from \"../fable_modules/fable-library-js.4.24.0/Map.js\";\nimport { value as value_47, some } from \"../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { Router_modifyLocation, Route, Router_newUrl } from \"../Omnicv.Client.Common/Router.js\";\nimport { op_Subtraction, compare } from \"../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport { exnToDisplayString } from \"../Omnicv.Client.Common/Utils.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"../fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { fitnessService } from \"../Pages/Fitness/FitnessCommon.js\";\nimport { commonAuthService } from \"../Omnicv.Client.Common/CommonServer.js\";\nimport { createElement } from \"react\";\nimport { Spacing_Amount, Spacing_TypeAndDirection, Modifier_IModifier, Color_IColor } from \"../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { last, item } from \"../fable_modules/fable-library-js.4.24.0/Array.js\";\nimport { empty as empty_1, singleton as singleton_1, append, delay, toList } from \"../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { IconType__ToIcon } from \"../Omnicv.Client.Common/ClientModule.js\";\nimport { reactApi } from \"../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { split, format, join } from \"../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { Registry$1__get_Modules } from \"../Omnicv.Shared/ModulesRegistration.js\";\nimport { clientModuleRegistry } from \"../ClientRegistration.js\";\nimport { Router_href } from \"../Omnicv.Client.Common/Router.js\";\nimport { List_Option, list as list_3, Option, button } from \"../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { icon } from \"../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport { Fa_i } from \"../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { Icons__ToIcon } from \"../Omnicv.Client.Common/SharedView.js\";\nimport { seconds, minutes, hours } from \"../fable_modules/fable-library-js.4.24.0/TimeSpan.js\";\nimport { defaultOf } from \"../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { Class, closeable } from \"../Omnicv.Client.Common/Components/Notification.js\";\nimport { Config_releaseVersion } from \"../Omnicv.Client.Common/Extensions.js\";\n\nconst soundPath = \"/public/sounds/beep-03.mp3\";\n\nconst soundAudioContext = common.createAudio(soundPath);\n\nconst permissionsToCheck = singleton(\"geolocation\");\n\nexport class LogInState extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"LoggedIn\", \"PendingLogOut\", \"LoggedOut\"];\n }\n}\n\nexport function LogInState_$reflection() {\n return union_type(\"Omnicv.Client.Components.Navigation.LogInState\", [], LogInState, () => [[], [], []]);\n}\n\nexport class Model extends Record {\n constructor(LogInState, Message, Session, InProgress, CurrentTimestamp, CurrentTimerExpiry, CheckedPermissions) {\n super();\n this.LogInState = LogInState;\n this.Message = Message;\n this.Session = Session;\n this.InProgress = InProgress;\n this.CurrentTimestamp = CurrentTimestamp;\n this.CurrentTimerExpiry = CurrentTimerExpiry;\n this.CheckedPermissions = CheckedPermissions;\n }\n}\n\nexport function Model_$reflection() {\n return record_type(\"Omnicv.Client.Components.Navigation.Model\", [], Model, () => [[\"LogInState\", LogInState_$reflection()], [\"Message\", option_type(string_type)], [\"Session\", Session_$reflection()], [\"InProgress\", bool_type], [\"CurrentTimestamp\", class_type(\"System.DateTime\")], [\"CurrentTimerExpiry\", option_type(class_type(\"System.DateTime\"))], [\"CheckedPermissions\", class_type(\"Microsoft.FSharp.Collections.FSharpMap`2\", [string_type, class_type(\"Browser.Types.PermissionStatus\")])]]);\n}\n\nexport function Model__IsLoggedIn(this$) {\n return !equals(this$.LogInState, new LogInState(2, []));\n}\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"LogOutClicked\", \"LogOutSucceeded\", \"Failure\", \"Refresh\", \"TimerUpdate\", \"ConcludeActiveWorkoutRecord\", \"DeleteActiveWorkoutRecord\", \"ActiveWorkoutRecordCloseSuccess\", \"UpdateActiveWorkoutRecord\", \"StartTimer\", \"StopTimer\", \"PermissionStatus\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.Components.Navigation.Msg\", [], Msg, () => [[], [[\"Item\", string_type]], [[\"Item\", class_type(\"System.Exception\")]], [[\"Item\", Session_$reflection()]], [[\"Item\", class_type(\"System.DateTime\")]], [], [], [[\"Item\", unit_type]], [[\"Item\", option_type(tuple_type(EventInfo_$reflection(), WorkoutRecord_$reflection()))]], [[\"Item\", class_type(\"System.DateTime\")]], [], [[\"Item1\", string_type], [\"Item2\", class_type(\"Browser.Types.PermissionStatus\")]]]);\n}\n\nfunction queryPermission(permission) {\n const descriptor_1 = {\n name: permission,\n };\n const pr = navigator.permissions.query(descriptor_1);\n return pr.then((status) => [permission, status]);\n}\n\nfunction queryPermissionCmd(permission) {\n return Cmd_OfPromise_either(queryPermission, permission, (tupledArg) => (new Msg(11, [tupledArg[0], tupledArg[1]])), (Item_2) => (new Msg(2, [Item_2])));\n}\n\nexport function init(session) {\n return [new Model(session.LoggedIn ? (new LogInState(0, [])) : (new LogInState(2, [])), undefined, session, false, common.getNow(), undefined, empty({\n Compare: comparePrimitives,\n })), Cmd_batch(map(queryPermissionCmd, permissionsToCheck))];\n}\n\nexport function update(session, msg, model) {\n let matchValue, time;\n switch (msg.tag) {\n case 1: {\n console.log(some(`Updating session logged out, msg: ${msg.fields[0]}`));\n return [new Model(new LogInState(2, []), \"Logged out successfully\", model.Session, model.InProgress, model.CurrentTimestamp, model.CurrentTimerExpiry, model.CheckedPermissions), Router_newUrl(new Route(0, []))];\n }\n case 4:\n return [new Model(model.LogInState, model.Message, model.Session, model.InProgress, msg.fields[0], (matchValue = model.CurrentTimerExpiry, (matchValue != null) ? ((time = matchValue, (compare(common.getNow(), time) >= 0) ? ((soundAudioContext.play(), undefined)) : model.CurrentTimerExpiry)) : undefined), model.CheckedPermissions), Cmd_none()];\n case 9:\n return [new Model(model.LogInState, model.Message, model.Session, model.InProgress, model.CurrentTimestamp, msg.fields[0], model.CheckedPermissions), Cmd_none()];\n case 10:\n return [new Model(model.LogInState, model.Message, model.Session, model.InProgress, model.CurrentTimestamp, undefined, model.CheckedPermissions), Cmd_none()];\n case 2:\n return [new Model(new LogInState(0, []), exnToDisplayString(msg.fields[0]), model.Session, model.InProgress, model.CurrentTimestamp, model.CurrentTimerExpiry, model.CheckedPermissions), Cmd_none()];\n case 3: {\n const session_1 = msg.fields[0];\n return [new Model(session_1.LoggedIn ? (new LogInState(0, [])) : (new LogInState(2, [])), undefined, session_1, model.InProgress, model.CurrentTimestamp, model.CurrentTimerExpiry, model.CheckedPermissions), Cmd_none()];\n }\n case 5:\n return [new Model(model.LogInState, model.Message, model.Session, true, model.CurrentTimestamp, model.CurrentTimerExpiry, model.CheckedPermissions), Cmd_OfAsyncWith_either((x_1) => {\n Cmd_OfAsync_start(x_1);\n }, fitnessService.ConcludeActiveWorkoutRecord, Session__GetCurrentProfileId(session), () => (new Msg(7, [undefined])), (Item_3) => (new Msg(2, [Item_3])))];\n case 6:\n return [new Model(model.LogInState, model.Message, model.Session, true, model.CurrentTimestamp, model.CurrentTimerExpiry, model.CheckedPermissions), Cmd_OfAsyncWith_either((x_2) => {\n Cmd_OfAsync_start(x_2);\n }, fitnessService.DeleteActiveWorkoutRecord, Session__GetCurrentProfileId(session), () => (new Msg(7, [undefined])), (Item_5) => (new Msg(2, [Item_5])))];\n case 7:\n return [new Model(model.LogInState, model.Message, model.Session, false, model.CurrentTimestamp, model.CurrentTimerExpiry, model.CheckedPermissions), singleton((dispatch) => {\n dispatch(new Msg(8, [undefined]));\n })];\n case 8:\n return [new Model(model.LogInState, model.Message, Session__SetActiveWorkoutRecord_Z2D8A2414(model.Session, msg.fields[0]), model.InProgress, model.CurrentTimestamp, model.CurrentTimerExpiry, model.CheckedPermissions), Cmd_none()];\n case 11:\n return [new Model(model.LogInState, model.Message, model.Session, model.InProgress, model.CurrentTimestamp, model.CurrentTimerExpiry, FSharpMap__Add(model.CheckedPermissions, msg.fields[0], msg.fields[1])), Cmd_none()];\n default:\n if (!equals(model.LogInState, new LogInState(0, []))) {\n return [model, Cmd_none()];\n }\n else {\n return [new Model(new LogInState(1, []), model.Message, model.Session, model.InProgress, model.CurrentTimestamp, model.CurrentTimerExpiry, model.CheckedPermissions), Cmd_OfAsyncWith_either((x) => {\n Cmd_OfAsync_start(x);\n }, commonAuthService.Logout, undefined, (Item) => (new Msg(1, [Item])), (Item_1) => (new Msg(2, [Item_1])))];\n }\n }\n}\n\nconst burgerLine = createElement(\"span\", {\n \"aria-hidden\": true,\n});\n\nconst mainNavBarId = \"mainNavBar\";\n\nconst profileColours = [new Color_IColor(5, []), new Color_IColor(6, []), new Color_IColor(7, []), new Color_IColor(4, []), new Color_IColor(16, [])];\n\nfunction getProfileColour(profileId) {\n return item(profileId % profileColours.length, profileColours);\n}\n\nexport function clientModuleDescriptorToMenu(session, clientModule) {\n return createElement(\"a\", createObj(toList(delay(() => append(singleton_1([\"className\", \"navbar-item\"]), delay(() => append((clientModule.Descriptor().View != null) ? singleton_1([\"onClick\", (_arg) => {\n Router_modifyLocation(value_47(clientModule.Descriptor().View)(session));\n }]) : empty_1(), delay(() => {\n let elems;\n return singleton_1((elems = [IconType__ToIcon(clientModule.Descriptor().Icon), createElement(\"span\", {\n children: \" \",\n }), createElement(\"span\", {\n children: clientModule.Details.Title,\n })], [\"children\", reactApi.Children.toArray(Array.from(elems))]));\n }))))))));\n}\n\nexport function descriptorButton(descriptor) {\n return createElement(\"a\", createObj(toList(delay(() => append(singleton_1([\"className\", \"navbar-item\"]), delay(() => append((descriptor.Actions.NewNow != null) ? singleton_1([\"onClick\", (_arg) => {\n Router_modifyLocation(value_47(descriptor.Actions.NewNow));\n }]) : empty_1(), delay(() => {\n let elems;\n return singleton_1((elems = [IconType__ToIcon(descriptor.Icon)], [\"children\", reactApi.Children.toArray(Array.from(elems))]));\n }))))))));\n}\n\nfunction viewMainNavBar(model, dispatch) {\n let elems_7, elems_6, elems_3, elems_4, elems, name_2;\n const isLoggedIn = Model__IsLoggedIn(model);\n const navbarBandChildren = ofArray([createElement(\"a\", {\n className: \"navbar-item\",\n children: \"OmniCV\",\n }), createElement(\"a\", {\n className: \"navbar-burger\",\n \"aria-label\": \"menu\",\n role: join(\" \", [\"button\"]),\n \"aria-expanded\": false,\n \"data-target\": mainNavBarId,\n children: reactApi.Children.toArray([burgerLine, burgerLine, burgerLine]),\n })]);\n return createElement(\"nav\", createObj(ofArray([[\"className\", join(\" \", [\"navbar\", \"is-primary\"])], [\"role\", join(\" \", [\"navigation\"])], [\"aria-label\", \"main navigation\"], (elems_7 = [createElement(\"div\", {\n className: \"navbar-brand\",\n children: reactApi.Children.toArray(Array.from(navbarBandChildren)),\n }), createElement(\"div\", createObj(ofArray([[\"className\", \"navbar-menu\"], [\"id\", mainNavBarId], (elems_6 = [createElement(\"div\", createObj(ofArray([[\"className\", \"navbar-start\"], (elems_3 = (isLoggedIn ? map((clientModule) => clientModuleDescriptorToMenu(model.Session, clientModule), Registry$1__get_Modules(clientModuleRegistry)) : singleton(createElement(\"a\", createObj(ofArray([[\"className\", \"navbar-item\"], Router_href(new Route(0, [])), [\"children\", \"Home\"]]))))), [\"children\", reactApi.Children.toArray(Array.from(elems_3))])]))), createElement(\"div\", createObj(ofArray([[\"className\", \"navbar-end\"], (elems_4 = ofArray([createElement(\"a\", createObj(ofArray([[\"className\", \"navbar-item\"], Router_href(new Route(8, [])), [\"children\", \"Contact\"]]))), createElement(\"a\", createObj(ofArray([[\"className\", \"navbar-item\"], Router_href(new Route(2, [])), [\"children\", \"About\"]]))), createElement(\"div\", createObj(ofArray([[\"className\", \"navbar-item\"], (elems = (isLoggedIn ? ((name_2 = Session__GetCurrentName(model.Session), ofArray([button(ofArray([new Option(0, [getProfileColour(Session__GetCurrentProfileId(model.Session))]), new Option(18, [(_arg) => {\n Router_modifyLocation(new Route(4, []));\n }])]), ofArray([icon(empty_2(), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(8, []))), []))), createElement(\"span\", {\n children: reactApi.Children.toArray([name_2]),\n })])), button(ofArray([new Option(0, [new Color_IColor(4, [])]), new Option(18, [(_arg_1) => {\n dispatch(new Msg(0, []));\n }])]), ofArray([icon(empty_2(), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(10, []))), []))), createElement(\"span\", {\n children: reactApi.Children.toArray([\"Logout\"]),\n })]))]))) : singleton(button(ofArray([new Option(0, [new Color_IColor(4, [])]), new Option(18, [(_arg_2) => {\n Router_modifyLocation(new Route(3, []));\n }])]), ofArray([icon(empty_2(), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(9, []))), []))), createElement(\"span\", {\n children: reactApi.Children.toArray([\"Login\"]),\n })])))), [\"children\", reactApi.Children.toArray(Array.from(elems))])])))]), [\"children\", reactApi.Children.toArray(Array.from(elems_4))])])))], [\"children\", reactApi.Children.toArray(Array.from(elems_6))])])))], [\"children\", reactApi.Children.toArray(Array.from(elems_7))])])));\n}\n\nfunction displayTimer(model, dispatch) {\n if ((model.CurrentTimerExpiry != null) && (compare(value_47(model.CurrentTimerExpiry), model.CurrentTimestamp) > 0)) {\n const now = common.getNow();\n const duration = op_Subtraction(value_47(model.CurrentTimerExpiry), now);\n return list_3(ofArray([new List_Option(8, [ofArray([new Modifier_IModifier(0, [new Color_IColor(11, [])]), new Modifier_IModifier(29, [new Spacing_TypeAndDirection(7, []), new Spacing_Amount(2, [])])])]), new List_Option(1, [])]), ofArray([button(ofArray([new Option(0, [new Color_IColor(17, [])]), new Option(4, []), new Option(16, [model.InProgress])]), toList(delay(() => {\n const durationStr = format(\"{0:D2}:{1:D2}:{2:D2}\", hours(duration), minutes(duration), seconds(duration));\n return singleton_1(createElement(\"span\", {\n children: reactApi.Children.toArray([durationStr]),\n }));\n }))), button(ofArray([new Option(0, [new Color_IColor(7, [])]), new Option(4, []), new Option(16, [model.InProgress]), new Option(18, [(_arg) => {\n dispatch(new Msg(10, []));\n }])]), singleton(icon(empty_2(), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(19, []))), [])))))]));\n }\n else {\n return defaultOf();\n }\n}\n\nfunction displayFavourites(model) {\n if (Model__IsLoggedIn(model)) {\n return list_3(empty_2(), map(descriptorButton, filter((x_1) => x_1.IsFavourite, collect((x) => x.EntryDescriptors(), Registry$1__get_Modules(clientModuleRegistry)))));\n }\n else {\n return defaultOf();\n }\n}\n\nfunction handlePermissionCheckState(dispatch, permission, status) {\n if (status.onchange == null) {\n console.log(some(`Updating onChange event listener for permission: ${permission}`));\n status.onchange = ((_arg) => {\n console.warn(some(`Permission ${permission} state changed to ${status.state}`));\n dispatch(new Msg(11, [permission, status]));\n });\n }\n if (status.state === \"denied\") {\n return closeable(`Denied permission: ${permission}`, new Class(3, []));\n }\n else {\n return defaultOf();\n }\n}\n\nfunction displayPermissionsWarnings(dispatch, model) {\n return map((tuple) => tuple[1], toList_1(map_1((permission, status) => handlePermissionCheckState(dispatch, permission, status), model.CheckedPermissions)));\n}\n\nfunction displayVersionWarning(model) {\n if (model.Session.UserInfo != null) {\n const serverVersion = last(split(value_47(model.Session.UserInfo).ServerVersion, [\"/\"], undefined, 0));\n if ((Config_releaseVersion() !== serverVersion) && (Config_releaseVersion() !== \"development\")) {\n return closeable(`Client version '${Config_releaseVersion()}' not the same as server version '${serverVersion}'. Please refresh`, new Class(4, []));\n }\n else {\n return defaultOf();\n }\n }\n else {\n return defaultOf();\n }\n}\n\nexport function view(model, dispatch) {\n const activeWorkoutRecord = Session__GetActiveWorkoutRecord(model.Session);\n const children_9 = toList(delay(() => append(singleton_1(viewMainNavBar(model, dispatch)), delay(() => append(singleton_1(displayFavourites(model)), delay(() => append(singleton_1(displayTimer(model, dispatch)), delay(() => append(singleton_1(displayVersionWarning(model)), delay(() => {\n let children;\n return append(singleton_1((children = displayPermissionsWarnings(dispatch, model), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n }))), delay(() => {\n if (activeWorkoutRecord != null) {\n const patternInput = value_47(activeWorkoutRecord);\n return singleton_1(list_3(ofArray([new List_Option(8, [ofArray([new Modifier_IModifier(0, [new Color_IColor(8, [])]), new Modifier_IModifier(29, [new Spacing_TypeAndDirection(7, []), new Spacing_Amount(2, [])])])]), new List_Option(1, [])]), ofArray([button(ofArray([new Option(0, [new Color_IColor(0, [])]), new Option(4, []), new Option(16, [model.InProgress]), new Option(18, [(_arg) => {\n Router_modifyLocation(new Route(38, [patternInput[1].WorkoutId]));\n }])]), toList(delay(() => {\n const duration = op_Subtraction(common.getNow(), patternInput[0].EventTimestamp);\n const durationStr = format(\"{0:D2}:{1:D2}:{2:D2}\", hours(duration), minutes(duration), seconds(duration));\n return singleton_1(createElement(\"span\", {\n children: reactApi.Children.toArray([durationStr]),\n }));\n }))), button(ofArray([new Option(0, [new Color_IColor(7, [])]), new Option(16, [model.InProgress]), new Option(18, [(_arg_1) => {\n if (window.confirm(`${\"Confirm abort\"}:\n${\"Are you sure you want to abort the workout?\"}`)) {\n (() => {\n dispatch(new Msg(6, []));\n })();\n }\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Abort\"]),\n }))), button(ofArray([new Option(0, [new Color_IColor(4, [])]), new Option(16, [model.InProgress]), new Option(18, [(_arg_3) => {\n if (window.confirm(`${\"Confirm\"}:\n${\"Are you sure you want to conclude the workout?\"}`)) {\n (() => {\n dispatch(new Msg(5, []));\n })();\n }\n }])]), singleton(createElement(\"span\", {\n children: reactApi.Children.toArray([\"Conclude\"]),\n })))])));\n }\n else {\n return empty_1();\n }\n }));\n }))))))))));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_9)),\n });\n}\n\n","import { map, defaultArg } from \"../../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { EditHelperData$1__GetFrequentTags } from \"../../Omnicv.Diary.Shared/DiaryAPI.js\";\nimport { empty } from \"../../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { class_type } from \"../../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { dateToStrForDiary, dateStrToDateTime } from \"../../../Omnicv.Client.Common/Utils.js\";\nimport { Model$2, Msg$2, view, Model$2__IsEditing, update, initEditWithHelperData, initNew } from \"../../../Omnicv.Client.Common/Components/AddEditRecordFlexFormBase.js\";\nimport { Router_modifyLocation, Route, Router_newUrl } from \"../../../Omnicv.Client.Common/Router.js\";\nimport { div } from \"../../../fable_modules/Fulma.3.0.0/Elements/Form/Control.fs.js\";\nimport { singleton, append, delay, toList } from \"../../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { ofList } from \"../../../fable_modules/fable-library-js.4.24.0/Set.js\";\nimport { toClientTreeView, addTag as addTag_1, toClientListView } from \"../../../Omnicv.Shared.Common/TagUtils.js\";\nimport { comparePrimitives } from \"../../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { renderTagTree } from \"../DiaryClientUtils.js\";\nimport { empty as empty_1 } from \"../../../fable_modules/fable-library-js.4.24.0/Map.js\";\nimport { date } from \"../../../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport { PagingOptionsModule_defaultPagingOptions, EventInfo } from \"../../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { Msg, Model } from \"../../../Omnicv.Client.Common/Components/EventInfoManager.js\";\nimport { Session__GetCurrentProfileId } from \"../../../Omnicv.Client.Common/SharedView.js\";\nimport { FlexFormFields$1__AddSelection_Z70244BEA, FlexFormFields$1__AddDurationSecs_ZAAC24, FlexFormFields$1__AddRating_Z716E223C, FlexFormBase$1__set_SubmitCaption_Z721C83C5, FlexFormTuple$2__get_FieldsSnd, FlexFormFields$1__AddText_Z44011C05, FlexFormFields$1__AddTextArea_Z44011C05, noValidation, FlexFormFields$1__AddDateTimeOpt_C9F34CC, FlexFormFields$1__AddTextAreaOpt_Z44636648, FlexFormFields$1__AddTags_Z63D88B1E, getSuggestions, addEventInfoToFlexFormEim, FlexFormTuple$2_$ctor_5AE4FFF0 } from \"../../../Omnicv.Client.Common/Components/FlexForm.js\";\nimport { interactionService, reviewService, diaryService } from \"../Server.js\";\nimport { interactionTypes, InteractionRecordModule_validateParticipants, InteractionRecord, InteractionRecord_Default, validateRating, ReviewRecord, ReviewRecord_Default, validateTagline, validateNotes, validateFollowupNotes, validateTags, DiaryRecord, DiaryRecord_Default } from \"../../Omnicv.Diary.Shared/Data.js\";\n\nfunction extractFrequentTags(model) {\n return defaultArg(map(EditHelperData$1__GetFrequentTags, model.EditHelperData), empty());\n}\n\nexport class DiaryEditingView$1 {\n constructor(service, getDefault, tagsGetter, tagsSetter, addTitle, editTitle, buildFormMain) {\n this.service = service;\n this.getDefault = getDefault;\n this.tagsGetter = tagsGetter;\n this.tagsSetter = tagsSetter;\n this.addTitle = addTitle;\n this.editTitle = editTitle;\n this.buildFormMain = buildFormMain;\n }\n}\n\nexport function DiaryEditingView$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Pages.Diary.AddEditDiaryView.Component.Diary.DiaryEditingView`1\", [gen0], DiaryEditingView$1);\n}\n\nexport function DiaryEditingView$1_$ctor_6E4FAFB9(service, getDefault, tagsGetter, tagsSetter, addTitle, editTitle, buildFormMain) {\n return new DiaryEditingView$1(service, getDefault, tagsGetter, tagsSetter, addTitle, editTitle, buildFormMain);\n}\n\nexport function DiaryEditingView$1__InitNew(this$, session, dateStr) {\n const dateTime = dateStrToDateTime(dateStr);\n const patternInput = initNew(this$.getDefault(), () => DiaryEditingView$1__fetchAddHelperData(this$, session, undefined));\n return [DiaryEditingView$1__setStartingDate(this$, patternInput[0], dateTime), patternInput[1]];\n}\n\nexport function DiaryEditingView$1__InitEdit(this$, session, id) {\n return initEditWithHelperData(id, this$.getDefault(), (id_1) => DiaryEditingView$1__fetchData(this$, session, id_1), () => DiaryEditingView$1__fetchAddHelperData(this$, session, undefined));\n}\n\nexport function DiaryEditingView$1__Update(this$, session, msg, model) {\n return update(session, (eventInfo, record) => {\n if (Model$2__IsEditing(model)) {\n return this$.service.Edit(eventInfo, record);\n }\n else {\n return this$.service.Add(eventInfo, record);\n }\n }, () => Router_newUrl(DiaryEditingView$1__getViewUrl_Z50E92BB6(this$, model)), msg, model);\n}\n\nexport function DiaryEditingView$1__View(this$, model, dispatch) {\n const editing = Model$2__IsEditing(model);\n const title = editing ? this$.editTitle : this$.addTitle;\n return div(empty(), toList(delay(() => append(singleton(view((model_1, dispatch_1) => DiaryEditingView$1__buildForm(this$, editing, model_1, dispatch_1), title, model, dispatch)), delay(() => {\n let record;\n const currentTags = ofList(toClientListView(this$.tagsGetter(model.Record)), {\n Compare: comparePrimitives,\n });\n return singleton(renderTagTree((record = model.Record, (tag) => {\n dispatch(new Msg$2(1, [this$.tagsSetter(addTag_1(this$.tagsGetter(record), tag), record)]));\n }), toClientTreeView(defaultArg(map((data) => data.FrequentTags, model.EditHelperData), empty_1({\n Compare: comparePrimitives,\n }))), currentTags));\n })))));\n}\n\nexport function DiaryEditingView$1__getRecentEntries_Z50E92BB6(this$, model) {\n return defaultArg(map((data) => data.RecentRecords, model.EditHelperData), empty());\n}\n\nexport function DiaryEditingView$1__getStartingDate_Z50E92BB6(this$, model) {\n return dateToStrForDiary(date(model.EIMModel.EventInfo.EventTimestamp));\n}\n\nexport function DiaryEditingView$1__setStartingDate(this$, model, dateTime) {\n let bind$0040, bind$0040_1;\n return new Model$2((bind$0040 = model.EIMModel, new Model((bind$0040_1 = model.EIMModel.EventInfo, new EventInfo(bind$0040_1.Id, bind$0040_1.ContentTypeId, bind$0040_1.ProfileId, dateTime, bind$0040_1.CreatedAt, bind$0040_1.UpdatedAt, bind$0040_1.PlaceId, bind$0040_1.PlaceName, bind$0040_1.Latitude, bind$0040_1.Longitude, bind$0040_1.LocationTz, bind$0040_1.LocationTzOffsetMin, bind$0040_1.ClientTz, bind$0040_1.ClientTzOffsetMin)), bind$0040.AutocompleteService, bind$0040.Position, bind$0040.StrictBounds)), model.Record, model.EditHelperData, model.InProgress, model.Error, model.DataExpected);\n}\n\nexport function DiaryEditingView$1__getViewUrl_Z50E92BB6(this$, model) {\n return new Route(9, [DiaryEditingView$1__getStartingDate_Z50E92BB6(this$, model)]);\n}\n\nexport function DiaryEditingView$1__fetchData(this$, session, id) {\n return this$.service.GetRecord(Session__GetCurrentProfileId(session), id);\n}\n\nexport function DiaryEditingView$1__fetchAddHelperData(this$, session, _arg) {\n return this$.service.GetEditHelperData(Session__GetCurrentProfileId(session), PagingOptionsModule_defaultPagingOptions);\n}\n\nexport function DiaryEditingView$1__buildForm(this$, editing, model, dispatch) {\n const form = FlexFormTuple$2_$ctor_5AE4FFF0((arg) => {\n dispatch(new Msg$2(0, [arg]));\n }, (arg_1) => {\n dispatch(new Msg$2(1, [arg_1]));\n }, (_arg) => {\n dispatch(new Msg$2(5, []));\n }, () => {\n Router_modifyLocation(DiaryEditingView$1__getViewUrl_Z50E92BB6(this$, model));\n });\n addEventInfoToFlexFormEim(form, model.EIMModel, (arg_3) => {\n dispatch(new Msg$2(7, [new Msg(6, [arg_3])]));\n }, getSuggestions(model.EIMModel.Position, DiaryEditingView$1__getRecentEntries_Z50E92BB6(this$, model)));\n return this$.buildFormMain(form, editing, model);\n}\n\nexport const diaryEditing = DiaryEditingView$1_$ctor_6E4FAFB9(diaryService, DiaryRecord_Default, (record) => record.Tags, (newTags, record_1) => (new DiaryRecord(record_1.Id, record_1.Tagline, record_1.Notes, record_1.FollowupTime, record_1.FollowupNotes, record_1.FollowupDismissed, newTags)), \"Add new diary entry\", \"Edit diary\", (form, editing, model) => {\n FlexFormFields$1__AddTags_Z63D88B1E(FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddDateTimeOpt_C9F34CC(FlexFormFields$1__AddTextArea_Z44011C05(FlexFormFields$1__AddText_Z44011C05(FlexFormTuple$2__get_FieldsSnd(form), \"Tagline\", validateTagline), \"Notes\", validateNotes), \"FollowupTime\", noValidation), \"FollowupNotes\", validateFollowupNotes), \"Tags\", validateTags, extractFrequentTags(model));\n if (editing) {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Update diary\");\n }\n else {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Add diary\");\n }\n return form;\n});\n\nexport const reviewEditing = DiaryEditingView$1_$ctor_6E4FAFB9(reviewService, ReviewRecord_Default, (record) => record.Tags, (newTags, record_1) => (new ReviewRecord(record_1.Id, record_1.Tagline, record_1.Notes, newTags, record_1.Rating)), \"Add review\", \"Edit review\", (form, editing, model) => {\n FlexFormFields$1__AddTags_Z63D88B1E(FlexFormFields$1__AddTextArea_Z44011C05(FlexFormFields$1__AddText_Z44011C05(FlexFormFields$1__AddRating_Z716E223C(FlexFormTuple$2__get_FieldsSnd(form), \"Rating\", validateRating), \"Tagline\", validateTagline), \"Notes\", validateNotes), \"Tags\", validateTags, extractFrequentTags(model));\n if (editing) {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Update review\");\n }\n else {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Add review\");\n }\n return form;\n});\n\nexport const interactionEditing = DiaryEditingView$1_$ctor_6E4FAFB9(interactionService, InteractionRecord_Default, (record) => record.Tags, (newTags, record_1) => (new InteractionRecord(record_1.Id, record_1.Tagline, record_1.Participants, record_1.DurationSec, record_1.InteractionType, record_1.Notes, record_1.FollowupTime, record_1.FollowupNotes, record_1.FollowupDismissed, newTags)), \"Add interaction\", \"Edit interaction\", (form, editing, model) => {\n FlexFormFields$1__AddTags_Z63D88B1E(FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddDateTimeOpt_C9F34CC(FlexFormFields$1__AddTextArea_Z44011C05(FlexFormFields$1__AddDurationSecs_ZAAC24(FlexFormFields$1__AddTextArea_Z44011C05(FlexFormFields$1__AddText_Z44011C05(FlexFormFields$1__AddSelection_Z70244BEA(FlexFormTuple$2__get_FieldsSnd(form), \"InteractionType\", interactionTypes, noValidation), \"Tagline\", validateTagline), \"Participants\", InteractionRecordModule_validateParticipants), \"DurationSec\", noValidation), \"Notes\", validateNotes), \"FollowupTime\", noValidation), \"FollowupNotes\", validateFollowupNotes), \"Tags\", validateTags, extractFrequentTags(model));\n if (editing) {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Update interaction\");\n }\n else {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Add interaction\");\n }\n return form;\n});\n\n","import { PhysicalClientModule_$ctor } from \"../../PhysicalClientModule.js\";\nimport { Remoting_buildProxy_64DC51C } from \"../../fable_modules/Fable.Remoting.Client.7.32.0/Remoting.fs.js\";\nimport { RemotingModule_createApi, RemotingModule_withRouteBuilder } from \"../../fable_modules/Fable.Remoting.Client.7.32.0/Remoting.fs.js\";\nimport { printf, toText } from \"../../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { UnifiedService_$reflection, UnifiedService_RouteBuilder, TemperatureRecord_$reflection, BodilyFunctionsRecord_$reflection, BloodPressureRecord_$reflection, RecordService$1_$reflection, WeightRecord_$reflection } from \"../../Omnicv.Shared/PhysicalAPI.js\";\n\nexport const physicalModule = PhysicalClientModule_$ctor();\n\nexport const weightService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder((arg, m) => toText(printf(\"/api/auth/mod/phys/%s/%s\"))(\"WeightRecord\")(m), RemotingModule_createApi()), RecordService$1_$reflection(WeightRecord_$reflection()));\n\nexport const bloodPressureService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder((arg, m) => toText(printf(\"/api/auth/mod/phys/%s/%s\"))(\"BloodPressureRecord\")(m), RemotingModule_createApi()), RecordService$1_$reflection(BloodPressureRecord_$reflection()));\n\nexport const bodilyFunctionsService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder((arg, m) => toText(printf(\"/api/auth/mod/phys/%s/%s\"))(\"BodilyFunctionsRecord\")(m), RemotingModule_createApi()), RecordService$1_$reflection(BodilyFunctionsRecord_$reflection()));\n\nexport const temperatureService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder((arg, m) => toText(printf(\"/api/auth/mod/phys/%s/%s\"))(\"TemperatureRecord\")(m), RemotingModule_createApi()), RecordService$1_$reflection(TemperatureRecord_$reflection()));\n\nexport const unifiedService = Remoting_buildProxy_64DC51C(RemotingModule_withRouteBuilder(UnifiedService_RouteBuilder, RemotingModule_createApi()), UnifiedService_$reflection());\n\n","import { secondsToHuman, responsiveChart, getBasicEventInfoData, isNight } from \"../../Omnicv.Client.Common/Utils.js\";\nimport { StringBuilder__Append_Z721C83C5, StringBuilder_$ctor } from \"../../fable_modules/fable-library-js.4.24.0/System.Text.js\";\nimport { toString } from \"../../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { list as list_8, Option, button } from \"../../fable_modules/Fulma.3.0.0/Elements/Button.fs.js\";\nimport { Screen, Size_ISize, Color_IColor } from \"../../fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { Route, Router_modifyLocation } from \"../../Omnicv.Client.Common/Router.js\";\nimport { append as append_1, collect, min, max, average as average_1, tryFind, length, isEmpty, map as map_1, sortBy, empty, singleton, ofArray } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { Option as Option_1, icon } from \"../../fable_modules/Fulma.3.0.0/Elements/Icon.fs.js\";\nimport { Fa_i } from \"../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { Icons__ToIcon } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { Icons } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { Option as Option_2, columns } from \"../../fable_modules/Fulma.3.0.0/Layouts/Columns.fs.js\";\nimport { exists, filter, length as length_1, empty as empty_1, map, singleton as singleton_1, append, delay, toList } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { Option as Option_3, ISize, column } from \"../../fable_modules/Fulma.3.0.0/Layouts/Column.fs.js\";\nimport { defaultOf } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { getModuleViewAllButtons, getModuleNewNowButtons } from \"../../Omnicv.Client.Common/ClientModule.js\";\nimport { unifiedService, bodilyFunctionsService, weightService, physicalModule } from \"./PhysicalCommon.js\";\nimport { Fa_i as Fa_i_1, Fa_IconOption } from \"../../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js\";\nimport { createElement } from \"react\";\nimport * as react from \"react\";\nimport { reactApi } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { map as map_2, defaultArg, value as value_10 } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { Class, closeable } from \"../../Omnicv.Client.Common/Components/Notification.js\";\nimport { init, update, initDateRange, Actions$1, Model$1__CanFetchMore, Msg$1 } from \"../../Omnicv.Client.Common/Components/ViewRecords.js\";\nimport { Option as Option_4, h5, h4 } from \"../../fable_modules/Fulma.3.0.0/Elements/Heading.fs.js\";\nimport { uncurry2, numberHash, comparePrimitives, dateHash, createObj, equals, curry2 } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { format } from \"../../fable_modules/fable-library-js.4.24.0/String.js\";\nimport { equals as equals_1, op_Subtraction, compare, utcNow, toUniversalTime } from \"../../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport { addDays } from \"date-fns\";\nimport { op_UnaryNegation_Int32 } from \"../../fable_modules/fable-library-js.4.24.0/Int32.js\";\nimport Decimal from \"../../fable_modules/fable-library-js.4.24.0/Decimal.js\";\nimport { DataPoint } from \"../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { reactApi as reactApi_1 } from \"../../fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { ResponsiveContainer } from \"recharts\";\nimport { bodilyFunctionsEmojis } from \"../../Omnicv.Shared/PhysicalAPI.js\";\nimport { days as days_3 } from \"../../fable_modules/fable-library-js.4.24.0/TimeSpan.js\";\nimport { toString as toString_1, fromDateTime, toDateTime } from \"../../fable_modules/fable-library-js.4.24.0/DateOnly.js\";\nimport { List_groupBy } from \"../../fable_modules/fable-library-js.4.24.0/Seq2.js\";\nimport * as common from \"../../../src/javascript/common.js\";\n\nconst pageSize = 30;\n\nconst standardLookBackDays = 30;\n\nfunction isDuringSleep(eventInfo, record) {\n const matchValue = record.DuringSleep;\n if (matchValue == null) {\n return isNight(eventInfo);\n }\n else {\n return matchValue;\n }\n}\n\nfunction displayEventInfo(eventInfo) {\n const sb = StringBuilder_$ctor();\n StringBuilder__Append_Z721C83C5(sb, getBasicEventInfoData(eventInfo));\n return toString(sb);\n}\n\nfunction displayActions(id, editRoute, deleteFun) {\n return ofArray([button(ofArray([new Option(0, [new Color_IColor(4, [])]), new Option(5, []), new Option(18, [(_arg) => {\n Router_modifyLocation(editRoute(id));\n }])]), singleton(icon(singleton(new Option_1(0, [new Size_ISize(0, [])])), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(4, []))), []))))), button(ofArray([new Option(0, [new Color_IColor(8, [])]), new Option(5, []), new Option(18, [(_arg_1) => {\n if (window.confirm(`${\"Confirm deletion\"}:\n${\"Are you sure you want to delete this physical entry?\"}`)) {\n (() => {\n deleteFun(id);\n })();\n }\n }])]), singleton(icon(singleton(new Option_1(0, [new Size_ISize(0, [])])), singleton(Fa_i(singleton(Icons__ToIcon(new Icons(2, []))), [])))))]);\n}\n\nfunction displaySingleRecord(displayRecordDetails, actions, eventInfo, record) {\n return columns(ofArray([new Option_2(4, []), new Option_2(1, [])]), toList(delay(() => append(singleton_1(column(empty(), singleton(displayEventInfo(eventInfo)))), delay(() => append(singleton_1(column(singleton(new Option_3(0, [new Screen(0, []), new ISize(21, [])])), singleton(displayRecordDetails(eventInfo, record)))), delay(() => {\n const matchValue = actions;\n if (matchValue == null) {\n return singleton_1(defaultOf());\n }\n else {\n const deleteFun = matchValue[1];\n return singleton_1(column(empty(), displayActions(eventInfo.Id, matchValue[0](record), deleteFun)));\n }\n })))))));\n}\n\nfunction displayRecords(records, displayRecordDetails, actions) {\n return map((tupledArg) => displaySingleRecord(displayRecordDetails, actions, tupledArg[0], tupledArg[1]), records);\n}\n\nfunction displayNavigation(isDisabled, inProgress, reloadFun) {\n let children;\n const children_2 = [getModuleNewNowButtons(physicalModule, isDisabled), list_8(empty(), singleton(button(ofArray([new Option(0, [new Color_IColor(5, [])]), new Option(16, [isDisabled]), new Option(18, [reloadFun])]), ofArray([icon(empty(), toList(delay(() => (inProgress ? singleton_1(Fa_i(ofArray([Icons__ToIcon(new Icons(6, [])), new Fa_IconOption(12, [])]), [])) : singleton_1(Fa_i(singleton(Icons__ToIcon(new Icons(5, []))), [])))))), (children = toList(delay(() => (inProgress ? singleton_1(\"Loading...\") : singleton_1(\"Reload\")))), createElement(\"span\", {\n children: reactApi.Children.toArray(Array.from(children)),\n }))])))), getModuleViewAllButtons(physicalModule, isDisabled)];\n return react.createElement(\"div\", {\n className: \"block\",\n disabled: isDisabled,\n }, ...children_2);\n}\n\nfunction viewCommon(title, subTitle, getEditRoute, displayRecordDetails, session, model, dispatch) {\n const readOnly = value_10(session.UserInfo).ReadOnly;\n const isDisabled = model.InProgress ? true : readOnly;\n const children_4 = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't fetch physical data: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => append(singleton_1(displayNavigation(isDisabled, model.InProgress, (_arg) => {\n dispatch(new Msg$1(1, []));\n })), delay(() => append(singleton_1(h4(empty())(singleton(title))), delay(() => append(singleton_1(h5(singleton(new Option_4(6, [])))(singleton(subTitle))), delay(() => {\n let children;\n return append(singleton_1((children = displayRecords(model.Records, displayRecordDetails, readOnly ? undefined : [curry2(getEditRoute), (arg) => {\n dispatch(new Msg$1(5, [arg]));\n }]), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n }))), delay(() => (Model$1__CanFetchMore(model) ? singleton_1(button(ofArray([new Option(0, [new Color_IColor(6, [])]), new Option(16, [model.InProgress]), new Option(18, [(_arg_1) => {\n dispatch(new Msg$1(0, []));\n }])]), ofArray([icon(empty(), singleton(Fa_i_1(singleton(new Fa_IconOption(11, [\"fas fa-download\"])), []))), createElement(\"span\", {\n children: reactApi.Children.toArray([\"Load more\"]),\n })]))) : empty_1())));\n }))))))));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_4)),\n });\n}\n\nexport function WeightView_getEditRoute(_arg, Item) {\n return new Route(22, [Item]);\n}\n\nexport function WeightView_displayRecord(record) {\n return format('{0:' + \"F2\" + '}', record.Weight) + \" kg\";\n}\n\nconst WeightView_service = weightService;\n\nexport const WeightView_actions = new Actions$1(WeightView_service.GetRecords);\n\nexport function WeightView_init() {\n const now = toUniversalTime(utcNow());\n return initDateRange(WeightView_actions, false, addDays(now, op_UnaryNegation_Int32(standardLookBackDays) * 6), now);\n}\n\nexport const WeightView_update = (session) => ((msg) => ((model) => update(session, msg, model)));\n\nexport function WeightView_viewList(_session, model, dispatch) {\n let value_1;\n const data = sortBy((point) => point.Timestamp, map_1((tupledArg) => {\n const record = tupledArg[1];\n return new DataPoint(record.Id, tupledArg[0].EventTimestamp, new Decimal(record.Weight));\n }, model.Records), {\n Compare: compare,\n });\n let graph;\n if (isEmpty(data)) {\n graph = defaultOf();\n }\n else {\n const properties = ofArray([(value_1 = (100 + \"%\"), (equals(value_1, 100 + \"%\") ? true : equals(value_1, 100 + \"%\")) ? [\"width\", 99 + \"%\"] : [\"width\", value_1]), [\"height\", 300], [\"children\", responsiveChart(\"Weight change over time\", data)]]);\n graph = reactApi_1.createElement(ResponsiveContainer, createObj(properties));\n }\n const children = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't fetch data: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => append(singleton_1(displayNavigation(model.InProgress, model.InProgress, (_arg) => {\n dispatch(new Msg$1(1, []));\n })), delay(() => append(singleton_1(h4(empty())(singleton(\"Weight history\"))), delay(() => append(singleton_1(h5(singleton(new Option_4(6, [])))(singleton(`Total records: ${length(model.Records)}`))), delay(() => singleton_1(graph)))))))));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n });\n}\n\nexport function BloodPressureView_getEditRoute(_arg, Item) {\n return new Route(26, [Item]);\n}\n\nexport function BloodPressureView_displayRecord(record) {\n return `${record.Systolic} / ${record.Diastolic} mmHg`;\n}\n\nexport function TemperatureView_getEditRoute(_arg, Item) {\n return new Route(28, [Item]);\n}\n\nexport function TemperatureView_displayRecord(record) {\n return format('{0:' + \"F2\" + '}', record.Temperature) + \"℃\";\n}\n\nexport function BodilyFunctionsView_getEditRoute(_arg, Item) {\n return new Route(24, [Item]);\n}\n\nconst BodilyFunctionsView_service = bodilyFunctionsService;\n\nexport const BodilyFunctionsView_actions = new Actions$1(BodilyFunctionsView_service.GetRecords);\n\nexport function BodilyFunctionsView_init() {\n const now = toUniversalTime(utcNow());\n return initDateRange(BodilyFunctionsView_actions, false, addDays(now, op_UnaryNegation_Int32(standardLookBackDays)), now);\n}\n\nexport const BodilyFunctionsView_update = (session) => ((msg) => ((model) => update(session, msg, model)));\n\nfunction BodilyFunctionsView_getFunctionName(functionType) {\n return defaultArg(map_2((tuple) => tuple[1], tryFind((tupledArg) => (tupledArg[0] === functionType), bodilyFunctionsEmojis)), \"\");\n}\n\nexport function BodilyFunctionsView_displayRecord(eventInfo, record) {\n const functionName = BodilyFunctionsView_getFunctionName(record.FunctionType);\n const duration = secondsToHuman(record.DurationSec);\n return `${isDuringSleep(eventInfo, record) ? \"🌙 \" : \"\"}${functionName} / ${duration} | ${record.Rating}`;\n}\n\nconst BodilyFunctionsView_columnsOptions = singleton(new Option_2(4, []));\n\nconst BodilyFunctionsView_headerColumOptions = singleton(new Option_3(0, [new Screen(0, []), new ISize(17, [])]));\n\nconst BodilyFunctionsView_dataColumOptions = singleton(new Option_3(0, [new Screen(0, []), new ISize(21, [])]));\n\nfunction BodilyFunctionsView_summaryRow(caption, value) {\n return columns(BodilyFunctionsView_columnsOptions, ofArray([column(BodilyFunctionsView_headerColumOptions, singleton(createElement(\"strong\", {\n children: reactApi.Children.toArray([caption]),\n }))), column(BodilyFunctionsView_dataColumOptions, singleton(value))]));\n}\n\nfunction BodilyFunctionsView_getDays(start, finish) {\n return days_3(op_Subtraction(toDateTime(finish, 0), toDateTime(start, 0)));\n}\n\nfunction BodilyFunctionsView_displaySummaryGroup(bodilyFunctionType, records) {\n return toList(delay(() => {\n const groups = List_groupBy((tupledArg) => fromDateTime(tupledArg[0].EventTimestamp), records, {\n Equals: equals_1,\n GetHashCode: dateHash,\n });\n const counts = map_1((tupledArg_1) => length(tupledArg_1[1]), groups);\n const daysWithSleepEliminations = length_1(filter((tupledArg_2) => exists((tupledArg_3) => isDuringSleep(tupledArg_3[0], tupledArg_3[1]), tupledArg_2[1]), groups)) | 0;\n let average;\n const copyOfStruct = average_1(map_1((value) => value, counts), {\n GetZero: () => 0,\n Add: (x_2, y_1) => (x_2 + y_1),\n DivideByInt: (x_1, i) => (x_1 / i),\n });\n average = format('{0:' + \"F2\" + '}', copyOfStruct);\n let maximum;\n const copyOfStruct_1 = max(counts, {\n Compare: comparePrimitives,\n }) | 0;\n maximum = format('{0:' + \"F2\" + '}', copyOfStruct_1);\n const dates = map_1((tuple) => tuple[0], groups);\n const days = BodilyFunctionsView_getDays(min(dates, {\n Compare: compare,\n }), max(dates, {\n Compare: compare,\n })) | 0;\n const func = BodilyFunctionsView_getFunctionName(bodilyFunctionType);\n return append(singleton_1(BodilyFunctionsView_summaryRow(`Average/max ${func}`, `${average} / ${maximum}`)), delay(() => {\n let copyOfStruct_2;\n return ((days > 0) && (daysWithSleepEliminations > 0)) ? singleton_1(BodilyFunctionsView_summaryRow(`During sleep ${func}`, `${(copyOfStruct_2 = ((daysWithSleepEliminations / days) * 100), format('{0:' + \"F2\" + '}', copyOfStruct_2))}% of days`)) : empty_1();\n }));\n }));\n}\n\nfunction BodilyFunctionsView_displaySummary(model) {\n return collect((tupledArg_1) => BodilyFunctionsView_displaySummaryGroup(tupledArg_1[0], tupledArg_1[1]), List_groupBy((tupledArg) => tupledArg[1].FunctionType, model.Records, {\n Equals: (x, y) => (x === y),\n GetHashCode: numberHash,\n }));\n}\n\nfunction BodilyFunctionsView_displayRecordGroup(actions, date, recordData) {\n let arg;\n return append_1(singleton(createElement(\"div\", {\n className: \"divider\",\n children: `${toString_1(date)} (${(arg = toDateTime(date, 0), common.getDayName(arg, \"\"))}): ${length(recordData)} record(s)`,\n })), map_1((tupledArg) => displaySingleRecord(BodilyFunctionsView_displayRecord, actions, tupledArg[0], tupledArg[1]), recordData));\n}\n\nfunction BodilyFunctionsView_displayAllRecords(actions, model) {\n return collect((tupledArg_1) => BodilyFunctionsView_displayRecordGroup(actions, tupledArg_1[0], tupledArg_1[1]), List_groupBy((tupledArg) => fromDateTime(tupledArg[0].EventTimestamp), model.Records, {\n Equals: equals_1,\n GetHashCode: dateHash,\n }));\n}\n\nexport function BodilyFunctionsView_viewList(session, model, dispatch) {\n const readOnly = value_10(session.UserInfo).ReadOnly;\n const isDisabled = model.InProgress;\n const children_6 = toList(delay(() => {\n let matchValue;\n return append((matchValue = model.Error, (matchValue != null) ? singleton_1(closeable(`Can't fetch data: ${matchValue}`, new Class(4, []))) : singleton_1(defaultOf())), delay(() => append(singleton_1(displayNavigation(isDisabled, model.InProgress, (_arg) => {\n dispatch(new Msg$1(1, []));\n })), delay(() => append(singleton_1(h4(empty())(singleton(\"Elimination history\"))), delay(() => append(singleton_1(h5(singleton(new Option_4(6, [])))(singleton(`Total records: ${length(model.Records)}`))), delay(() => {\n let children_2, today, start, finish, days;\n const actions = readOnly ? undefined : [(arg00$0040) => ((Item_1) => BodilyFunctionsView_getEditRoute(arg00$0040, Item_1)), (arg) => {\n dispatch(new Msg$1(5, [arg]));\n }];\n return append(singleton_1((children_2 = append_1(singleton((today = fromDateTime(utcNow()), (start = fromDateTime(value_10(model.DateRange)[0]), (finish = fromDateTime(value_10(model.DateRange)[1]), (days = (BodilyFunctionsView_getDays(start, finish) | 0), columns(BodilyFunctionsView_columnsOptions, toList(delay(() => append(singleton_1(column(BodilyFunctionsView_headerColumOptions, singleton(button(toList(delay(() => {\n const start_1 = value_10(model.DateRange)[0];\n const previous = addDays(start_1, op_UnaryNegation_Int32(standardLookBackDays));\n return append(singleton_1(new Option(0, [new Color_IColor(6, [])])), delay(() => append(singleton_1(new Option(16, [model.InProgress])), delay(() => singleton_1(new Option(18, [(_arg_1) => {\n dispatch(new Msg$1(2, [previous, start_1]));\n }]))))));\n })), singleton(icon(empty(), singleton(Fa_i_1(singleton(new Fa_IconOption(11, [\"fas fa-angle-double-left\"])), [])))))))), delay(() => append(singleton_1(column(BodilyFunctionsView_headerColumOptions, singleton(createElement(\"strong\", {\n children: reactApi.Children.toArray([\"Period\"]),\n })))), delay(() => append(singleton_1(column(BodilyFunctionsView_dataColumOptions, singleton(`${toString_1(start)} - ${toString_1(finish)} / ${days} days`))), delay(() => ((compare(today, finish) > 0) ? singleton_1(column(BodilyFunctionsView_headerColumOptions, singleton(button(toList(delay(() => {\n const finish_1 = value_10(model.DateRange)[1];\n const newFinish_1 = addDays(finish_1, standardLookBackDays);\n return append(singleton_1(new Option(0, [new Color_IColor(6, [])])), delay(() => append(singleton_1(new Option(16, [model.InProgress])), delay(() => singleton_1(new Option(18, [(_arg_2) => {\n dispatch(new Msg$1(2, [finish_1, newFinish_1]));\n }]))))));\n })), singleton(icon(empty(), singleton(Fa_i_1(singleton(new Fa_IconOption(11, [\"fas fa-angle-double-right\"])), [])))))))) : empty_1()))))))))))))))), append_1(BodilyFunctionsView_displaySummary(model), BodilyFunctionsView_displayAllRecords(actions, model))), createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_2)),\n }))), delay(() => (Model$1__CanFetchMore(model) ? singleton_1(button(ofArray([new Option(0, [new Color_IColor(6, [])]), new Option(16, [isDisabled]), new Option(18, [(_arg_3) => {\n dispatch(new Msg$1(0, []));\n }])]), ofArray([icon(empty(), singleton(Fa_i_1(singleton(new Fa_IconOption(11, [\"fas fa-download\"])), []))), createElement(\"span\", {\n children: reactApi.Children.toArray([\"Load more\"]),\n })]))) : empty_1())));\n }))))))));\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_6)),\n });\n}\n\nconst PhysicalView_service = unifiedService;\n\nexport const PhysicalView_actions = new Actions$1(PhysicalView_service.GetRecords);\n\nexport function PhysicalView_init() {\n return init(PhysicalView_actions, pageSize, false);\n}\n\nexport const PhysicalView_update = (session) => ((msg) => ((model) => update(session, msg, model)));\n\nexport function PhysicalView_getEditRoute(record) {\n switch (record.tag) {\n case 1:\n return (Item_1) => BloodPressureView_getEditRoute(record.fields[0], Item_1);\n case 2:\n return (Item_2) => BodilyFunctionsView_getEditRoute(record.fields[0], Item_2);\n case 3:\n return (Item_3) => TemperatureView_getEditRoute(record.fields[0], Item_3);\n default:\n return (Item) => WeightView_getEditRoute(record.fields[0], Item);\n }\n}\n\nexport function PhysicalView_displayRecord(eventInfo, record) {\n switch (record.tag) {\n case 1:\n return BloodPressureView_displayRecord(record.fields[0]);\n case 2:\n return BodilyFunctionsView_displayRecord(eventInfo, record.fields[0]);\n case 3:\n return TemperatureView_displayRecord(record.fields[0]);\n default:\n return WeightView_displayRecord(record.fields[0]);\n }\n}\n\nexport function PhysicalView_view(session, model, dispatch) {\n return viewCommon(\"Physical entries\", `Total records: ${length(model.Records)}`, uncurry2(PhysicalView_getEditRoute), PhysicalView_displayRecord, session, model, dispatch);\n}\n\n","import { class_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { Msg$2, view, update, Model$2__IsEditing, initEdit, initNew } from \"../../Omnicv.Client.Common/Components/AddEditRecordFlexFormBase.js\";\nimport { Msg, tryUpdateLocationFromSuggestions } from \"../../Omnicv.Client.Common/Components/EventInfoManager.js\";\nimport { FlexFormFields$1__AddDurationSecs_ZAAC24, FlexFormFields$1__AddGroup_6DFDD678, FlexFormFields$1__AddRating_Z716E223C, FlexFormFields$1__AddRadiosInline_Z70244BEA, FlexFormBase$1__set_SubmitCaption_Z721C83C5, FlexFormTuple$2__get_FieldsSnd, FlexFormFields$1__AddPositiveFloat_1D6F52FB, FlexFormFields$1__AddTextAreaOpt_Z44636648, addEventInfoToFlexFormEim, FlexFormTuple$2_$ctor_5AE4FFF0, getSuggestions } from \"../../Omnicv.Client.Common/Components/FlexForm.js\";\nimport { defaultArg } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { empty } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { Route, Router_modifyLocation, Router_newUrl } from \"../../Omnicv.Client.Common/Router.js\";\nimport { Session__GetCurrentProfileId } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { PagingOptionsModule_defaultPagingOptions } from \"../../Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { temperatureService, bodilyFunctionsService, bloodPressureService, weightService } from \"./PhysicalCommon.js\";\nimport { validateTemperature, TemperatureRecord_Default, duringSleepOptions, bodilyFunctions, BodilyFunctionsRecord_Default, validateSystolic, validateDiastolic, BloodPressureRecord_Default, validateWeight, validateNotes, WeightRecord_Default } from \"../../Omnicv.Shared/PhysicalAPI.js\";\n\nfunction noValidation(_arg) {\n return undefined;\n}\n\nexport class Physical_PhysicalView$1 {\n constructor(service, getDefault, addTitle, editTitle, viewAll, buildFormMain) {\n this.service = service;\n this.getDefault = getDefault;\n this.addTitle = addTitle;\n this.editTitle = editTitle;\n this.viewAll = viewAll;\n this.buildFormMain = buildFormMain;\n }\n}\n\nexport function Physical_PhysicalView$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Pages.Physical.AddEditPhysicalView.Component.Physical.PhysicalView`1\", [gen0], Physical_PhysicalView$1);\n}\n\nexport function Physical_PhysicalView$1_$ctor_Z7E8B6EC8(service, getDefault, addTitle, editTitle, viewAll, buildFormMain) {\n return new Physical_PhysicalView$1(service, getDefault, addTitle, editTitle, viewAll, buildFormMain);\n}\n\nexport function Physical_PhysicalView$1__InitNew_5D846BF8(this$, session) {\n return initNew(this$.getDefault(), () => Physical_PhysicalView$1__fetchAddHelperData(this$, session, undefined));\n}\n\nexport function Physical_PhysicalView$1__InitEdit(this$, session, id) {\n return initEdit(id, this$.getDefault(), (id_1) => Physical_PhysicalView$1__fetchData(this$, session, id_1));\n}\n\nexport function Physical_PhysicalView$1__Update(this$, session, msg, model) {\n if (!Model$2__IsEditing(model)) {\n tryUpdateLocationFromSuggestions(() => getSuggestions(model.EIMModel.Position, defaultArg(model.EditHelperData, empty())), model.EIMModel);\n }\n return update(session, (eventInfo, record) => {\n if (Model$2__IsEditing(model)) {\n return this$.service.Edit(eventInfo, record);\n }\n else {\n return this$.service.Add(eventInfo, record);\n }\n }, () => Router_newUrl(this$.viewAll), msg, model);\n}\n\nexport function Physical_PhysicalView$1__View(this$, model, dispatch) {\n const editing = Model$2__IsEditing(model);\n return view((model_1, dispatch_1) => Physical_PhysicalView$1__buildForm(this$, editing, model_1, dispatch_1), editing ? this$.editTitle : this$.addTitle, model, dispatch);\n}\n\nexport function Physical_PhysicalView$1__fetchData(this$, session, id) {\n return this$.service.GetRecord(Session__GetCurrentProfileId(session), id);\n}\n\nexport function Physical_PhysicalView$1__fetchAddHelperData(this$, session, _arg) {\n return this$.service.GetRecords(Session__GetCurrentProfileId(session), PagingOptionsModule_defaultPagingOptions);\n}\n\nexport function Physical_PhysicalView$1__buildForm(this$, editing, model, dispatch) {\n const form = FlexFormTuple$2_$ctor_5AE4FFF0((arg) => {\n dispatch(new Msg$2(0, [arg]));\n }, (arg_1) => {\n dispatch(new Msg$2(1, [arg_1]));\n }, (_arg) => {\n dispatch(new Msg$2(5, []));\n }, () => {\n Router_modifyLocation(this$.viewAll);\n });\n addEventInfoToFlexFormEim(form, model.EIMModel, (arg_3) => {\n dispatch(new Msg$2(7, [new Msg(6, [arg_3])]));\n }, getSuggestions(model.EIMModel.Position, defaultArg(model.EditHelperData, empty())));\n return this$.buildFormMain(form, editing, model);\n}\n\nexport const Physical_weightEditing = Physical_PhysicalView$1_$ctor_Z7E8B6EC8(weightService, WeightRecord_Default, \"Add new weight\", \"Edit weight\", new Route(18, []), (form, editing, model) => {\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddPositiveFloat_1D6F52FB(FlexFormTuple$2__get_FieldsSnd(form), \"Weight\", validateWeight), \"Notes\", validateNotes);\n if (editing) {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Update weight\");\n }\n else {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Add weight\");\n }\n return form;\n});\n\nexport const Physical_bloodPressureEditing = Physical_PhysicalView$1_$ctor_Z7E8B6EC8(bloodPressureService, BloodPressureRecord_Default, \"Add blood pressure\", \"Edit blood pressure\", new Route(18, []), (form, editing, model) => {\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddPositiveFloat_1D6F52FB(FlexFormFields$1__AddPositiveFloat_1D6F52FB(FlexFormTuple$2__get_FieldsSnd(form), \"Systolic\", validateSystolic), \"Diastolic\", validateDiastolic), \"Notes\", validateNotes);\n if (editing) {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Update blood pressure\");\n }\n else {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Add blood pressure\");\n }\n return form;\n});\n\nexport const Physical_bodilyFunctionsEditing = Physical_PhysicalView$1_$ctor_Z7E8B6EC8(bodilyFunctionsService, BodilyFunctionsRecord_Default, \"Add elimination\", \"Edit elimination\", new Route(19, []), (form, editing, model) => {\n FlexFormFields$1__AddRadiosInline_Z70244BEA(FlexFormTuple$2__get_FieldsSnd(form), \"FunctionType\", bodilyFunctions, noValidation);\n FlexFormFields$1__AddRadiosInline_Z70244BEA(FlexFormFields$1__AddRating_Z716E223C(FlexFormFields$1__AddGroup_6DFDD678(FlexFormTuple$2__get_FieldsSnd(form)), \"Rating\", noValidation), \"DuringSleep\", duringSleepOptions, noValidation);\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddDurationSecs_ZAAC24(FlexFormTuple$2__get_FieldsSnd(form), \"DurationSec\", noValidation), \"Notes\", validateNotes);\n if (editing) {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Update elimination\");\n }\n else {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Add elimination\");\n }\n return form;\n});\n\nexport const Physical_temperatureEditing = Physical_PhysicalView$1_$ctor_Z7E8B6EC8(temperatureService, TemperatureRecord_Default, \"Add new temperature\", \"Edit temperature\", new Route(18, []), (form, editing, model) => {\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormFields$1__AddPositiveFloat_1D6F52FB(FlexFormTuple$2__get_FieldsSnd(form), \"Temperature\", validateTemperature), \"Notes\", validateNotes);\n if (editing) {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Update temperature\");\n }\n else {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Add temperature\");\n }\n return form;\n});\n\n","import { map as map_1, empty, find, ofArray } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { comparePrimitives, int32ToString } from \"../../fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { map, defaultArg } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { validateInstructions, Exercise, Exercise_Default_7F9DDECF, Workout, Workout_Default_7F9DDECF, validateName, validateDescription, TrainingPlan, TrainingPlan_Default_7F9DDECF, FitnessEditHelperData_$reflection, FitnessEditHelperData__GetFrequentTags } from \"../../Omnicv.Shared/FitnessAPI.js\";\nimport { Msg$2, SimpleFormView$2__ViewForm_Z44A2099C, Model$2__IsEditing, SimpleFormView$2__InitEditWithHelperData_3AAD8C48, SimpleFormView$2__InitNewCore_Z292EED19, SimpleFormView$2_$reflection, SimpleFormView$2 } from \"../../Omnicv.Client.Common/Components/AddEditSimpleFlexFormBase.js\";\nimport { Route, Router_newUrl } from \"../../Omnicv.Client.Common/Router.js\";\nimport { class_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { utcNow } from \"../../fable_modules/fable-library-js.4.24.0/Date.js\";\nimport { div } from \"../../fable_modules/Fulma.3.0.0/Elements/Form/Control.fs.js\";\nimport { singleton, append, delay, toList } from \"../../fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { ofList } from \"../../fable_modules/fable-library-js.4.24.0/Set.js\";\nimport { validateServerTags, toClientTreeView, addTag as addTag_1, toClientListView } from \"../../Omnicv.Shared.Common/TagUtils.js\";\nimport { renderTagTree } from \"../../modules/Omnicv.Diary.Client/DiaryClientUtils.js\";\nimport { empty as empty_1 } from \"../../fable_modules/fable-library-js.4.24.0/Map.js\";\nimport { Session__SiteSettings, Session__GetCurrentProfileId } from \"../../Omnicv.Client.Common/SharedView.js\";\nimport { fitnessService } from \"./FitnessCommon.js\";\nimport { FlexFormFields$1__AddSelection_158231B6, FlexFormBase$1__set_SubmitCaption_Z721C83C5, FlexForm$1__get_Fields, FlexFormFields$1__AddText_Z44011C05, FlexFormFields$1__AddTextArea_Z44011C05, FlexFormFields$1__AddTags_Z63D88B1E } from \"../../Omnicv.Client.Common/Components/FlexForm.js\";\nimport { parse } from \"../../fable_modules/fable-library-js.4.24.0/Int32.js\";\n\nexport const workoutTypes = ofArray([[1, \"Regular\"], [2, \"Circuit\"]]);\n\nexport function stringToWorkoutType(input) {\n return find((pair) => {\n let copyOfStruct;\n return input === ((copyOfStruct = pair[0], int32ToString(copyOfStruct)));\n }, workoutTypes)[0];\n}\n\nfunction extractFrequentTags(model) {\n return defaultArg(map(FitnessEditHelperData__GetFrequentTags, model.EditHelperData), empty());\n}\n\nexport class AddEditFitnessView$1 extends SimpleFormView$2 {\n constructor(getDefault, fetchEntry, fetchEditHelperData, submitNewAction, submitEditAction, mainView, tagsGetter, tagsSetter, addTitle, editTitle, buildForm) {\n super(buildForm, addTitle, submitNewAction, submitEditAction, () => Router_newUrl(mainView), mainView);\n this.getDefault = getDefault;\n this.fetchEntry = fetchEntry;\n this.fetchEditHelperData = fetchEditHelperData;\n this.tagsGetter = tagsGetter;\n this.tagsSetter = tagsSetter;\n this.addTitle = addTitle;\n this.editTitle = editTitle;\n }\n}\n\nexport function AddEditFitnessView$1_$reflection(gen0) {\n return class_type(\"Omnicv.Client.Pages.Fitness.AddEditFitnessView.AddEditFitness.AddEditFitnessView`1\", [gen0], AddEditFitnessView$1, SimpleFormView$2_$reflection(gen0, FitnessEditHelperData_$reflection()));\n}\n\nexport function AddEditFitnessView$1_$ctor_Z7DF71A99(getDefault, fetchEntry, fetchEditHelperData, submitNewAction, submitEditAction, mainView, tagsGetter, tagsSetter, addTitle, editTitle, buildForm) {\n return new AddEditFitnessView$1(getDefault, fetchEntry, fetchEditHelperData, submitNewAction, submitEditAction, mainView, tagsGetter, tagsSetter, addTitle, editTitle, buildForm);\n}\n\nexport function AddEditFitnessView$1__InitNew_5D846BF8(this$, session) {\n return SimpleFormView$2__InitNewCore_Z292EED19(this$, this$.getDefault(utcNow()), () => AddEditFitnessView$1__fetchAddHelperData(this$, session, undefined));\n}\n\nexport function AddEditFitnessView$1__InitEdit(this$, session, id) {\n return SimpleFormView$2__InitEditWithHelperData_3AAD8C48(this$, id, this$.getDefault(utcNow()), (id_1) => AddEditFitnessView$1__fetchData(this$, session, id_1), () => AddEditFitnessView$1__fetchAddHelperData(this$, session, undefined));\n}\n\nexport function AddEditFitnessView$1__View(this$, session, model, dispatch) {\n const title = Model$2__IsEditing(model) ? this$.editTitle : this$.addTitle;\n return div(empty(), toList(delay(() => append(singleton(SimpleFormView$2__ViewForm_Z44A2099C(this$, session, model, dispatch)), delay(() => {\n let record;\n const currentTags = ofList(toClientListView(this$.tagsGetter(model.Record)), {\n Compare: comparePrimitives,\n });\n return singleton(renderTagTree((record = model.Record, (tag) => {\n dispatch(new Msg$2(0, [this$.tagsSetter(addTag_1(this$.tagsGetter(record), tag), record)]));\n }), toClientTreeView(defaultArg(map((data) => data.FrequentTags, model.EditHelperData), empty_1({\n Compare: comparePrimitives,\n }))), currentTags));\n })))));\n}\n\nexport function AddEditFitnessView$1__fetchData(this$, session, id) {\n return this$.fetchEntry(Session__GetCurrentProfileId(session), id);\n}\n\nexport function AddEditFitnessView$1__fetchAddHelperData(this$, session, _arg) {\n return this$.fetchEditHelperData(Session__GetCurrentProfileId(session));\n}\n\nexport const trainingPlanEditing = AddEditFitnessView$1_$ctor_Z7DF71A99(TrainingPlan_Default_7F9DDECF, fitnessService.GetTrainingPlan, fitnessService.GetFitnessEditHelperDataTrainingPlan, fitnessService.AddTrainingPlan, fitnessService.EditTrainingPlan, new Route(32, []), (record) => record.Categories, (newTags, record_1) => (new TrainingPlan(record_1.Id, record_1.ProfileId, record_1.Name, record_1.Description, record_1.CreatedAt, record_1.UpdatedAt, newTags)), \"Add new training plan\", \"Edit training plan\", (form, _session, model, _dispatch) => {\n FlexFormFields$1__AddTags_Z63D88B1E(FlexFormFields$1__AddTextArea_Z44011C05(FlexFormFields$1__AddText_Z44011C05(FlexForm$1__get_Fields(form), \"Name\", validateName), \"Description\", validateDescription), \"Categories\", validateServerTags, extractFrequentTags(model), undefined, undefined, \"Categories for the training plan. To separate, use \\\",\\\".\");\n if (Model$2__IsEditing(model)) {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Update plan\");\n }\n else {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Add plan\");\n }\n return form;\n});\n\nexport const workoutEditing = AddEditFitnessView$1_$ctor_Z7DF71A99(Workout_Default_7F9DDECF, fitnessService.GetWorkout, fitnessService.GetFitnessEditHelperDataWorkout, fitnessService.AddWorkout, fitnessService.EditWorkout, new Route(32, []), (record) => record.Categories, (newTags, record_1) => (new Workout(record_1.Id, record_1.ProfileId, record_1.Name, record_1.WorkoutType, record_1.Description, record_1.Schedule, record_1.CreatedAt, record_1.UpdatedAt, newTags)), \"Add new workout\", \"Edit workout\", (form, _session, model, _dispatch) => {\n FlexFormFields$1__AddTags_Z63D88B1E(FlexFormFields$1__AddTextArea_Z44011C05(FlexFormFields$1__AddText_Z44011C05(FlexFormFields$1__AddSelection_158231B6(FlexForm$1__get_Fields(form), \"WorkoutType\", workoutTypes, stringToWorkoutType, (_arg) => undefined, \"Workout type\", undefined, \"Circuit type implies one repetition of each exercise in a circuit\"), \"Name\", validateName), \"Description\", validateDescription), \"Categories\", validateServerTags, extractFrequentTags(model), undefined, undefined, \"Categories for the workout. To separate, use \\\",\\\".\");\n if (Model$2__IsEditing(model)) {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Update workout\");\n }\n else {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Add workout\");\n }\n return form;\n});\n\nexport const exerciseEditing = AddEditFitnessView$1_$ctor_Z7DF71A99(Exercise_Default_7F9DDECF, fitnessService.GetExercise, fitnessService.GetFitnessEditHelperDataExercise, fitnessService.AddExercise, fitnessService.EditExercise, new Route(32, []), (record) => record.Categories, (newTags, record_1) => (new Exercise(record_1.Id, record_1.ProfileId, record_1.Name, record_1.Description, record_1.Instructions, record_1.ContentTypeId, record_1.CreatedAt, record_1.UpdatedAt, newTags)), \"Add new exercise\", \"Edit exercise\", (form, session, model, _dispatch) => {\n const contentTypes = map_1((t) => [t.Id, t.Name], Session__SiteSettings(session).FitnessContentTypes);\n FlexFormFields$1__AddTags_Z63D88B1E(FlexFormFields$1__AddSelection_158231B6(FlexFormFields$1__AddTextArea_Z44011C05(FlexFormFields$1__AddTextArea_Z44011C05(FlexFormFields$1__AddText_Z44011C05(FlexForm$1__get_Fields(form), \"Name\", validateName), \"Description\", validateDescription), \"Instructions\", validateInstructions), \"ContentTypeId\", contentTypes, (s) => parse(s, 511, false, 32), (_arg) => undefined, \"Exercise type\"), \"Categories\", validateServerTags, extractFrequentTags(model), undefined, undefined, \"Categories for the exercise. To separate, use \\\",\\\".\");\n if (Model$2__IsEditing(model)) {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Update exercise\");\n }\n else {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Add exercise\");\n }\n return form;\n});\n\n","import { map, defaultArg } from \"../../fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { empty } from \"../../fable_modules/fable-library-js.4.24.0/List.js\";\nimport { fitnessService } from \"./FitnessCommon.js\";\nimport { class_type } from \"../../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { Msg$2, view, update, Model$2__IsEditing, initEdit, initNew } from \"../../Omnicv.Client.Common/Components/AddEditRecordFlexFormBase.js\";\nimport { validateNotes, WorkoutRecord_Default_Z524259C1 } from \"../../Omnicv.Shared/FitnessAPI.js\";\nimport { fromInt32, toInt64 } from \"../../fable_modules/fable-library-js.4.24.0/BigInt.js\";\nimport { tryUpdateLocationFromSuggestions } from \"../../Omnicv.Client.Common/Components/EventInfoManager.js\";\nimport { FlexFormBase$1__set_SubmitCaption_Z721C83C5, noValidation, FlexFormFields$1__AddDateTimeOpt_C9F34CC, FlexFormTuple$2__get_FieldsSnd, FlexFormFields$1__AddTextAreaOpt_Z44636648, addEventInfoToFlexForm, FlexFormTuple$2_$ctor_5AE4FFF0, getSuggestions } from \"../../Omnicv.Client.Common/Components/FlexForm.js\";\nimport { singleton } from \"../../fable_modules/fable-library-js.4.24.0/AsyncBuilder.js\";\nimport { Router_modifyLocation, Route, Router_newUrl } from \"../../Omnicv.Client.Common/Router.js\";\nimport { Session__GetCurrentProfileId } from \"../../Omnicv.Client.Common/SharedView.js\";\n\nexport function Workout_getEditInfos(model) {\n return defaultArg(map((x) => x.WorkoutRecords, model.EditHelperData), empty());\n}\n\nexport class Workout_WorkoutEditView {\n constructor() {\n this.service = fitnessService;\n }\n}\n\nexport function Workout_WorkoutEditView_$reflection() {\n return class_type(\"Omnicv.Client.Pages.Fitness.AddEditWorkoutRecord.Workout.WorkoutEditView\", undefined, Workout_WorkoutEditView);\n}\n\nexport function Workout_WorkoutEditView_$ctor() {\n return new Workout_WorkoutEditView();\n}\n\nexport function Workout_WorkoutEditView__InitNew(this$, session, workoutId) {\n return initNew(WorkoutRecord_Default_Z524259C1(workoutId), () => Workout_WorkoutEditView__fetchAddHelperData(this$, workoutId, session, undefined));\n}\n\nexport function Workout_WorkoutEditView__InitEdit(this$, session, id) {\n return initEdit(id, WorkoutRecord_Default_Z524259C1(toInt64(fromInt32(0))), (id_1) => Workout_WorkoutEditView__fetchData(this$, session, id_1));\n}\n\nexport function Workout_WorkoutEditView__Update(this$, session, msg, model) {\n if (!Model$2__IsEditing(model)) {\n tryUpdateLocationFromSuggestions(() => getSuggestions(model.EIMModel.Position, Workout_getEditInfos(model)), model.EIMModel);\n }\n return update(session, (eventInfo, record) => {\n if (Model$2__IsEditing(model)) {\n return this$.service.EditWorkoutRecord(eventInfo, record);\n }\n else {\n return singleton.Delay(() => singleton.Bind(this$.service.StartActiveWorkoutRecord(eventInfo, record), (_arg) => singleton.Return(_arg[0])));\n }\n }, () => Router_newUrl(Workout_WorkoutEditView__getRoute_4B9C34E5(this$, model)), msg, model);\n}\n\nexport function Workout_WorkoutEditView__View(this$, model, dispatch) {\n const editing = Model$2__IsEditing(model);\n return view((model_1, dispatch_1) => Workout_WorkoutEditView__buildForm(this$, editing, model_1, dispatch_1), editing ? \"Update workout record\" : \"Start workout record\", model, dispatch);\n}\n\nexport function Workout_WorkoutEditView__fetchData(this$, session, id) {\n return this$.service.GetWorkoutRecord(Session__GetCurrentProfileId(session), id);\n}\n\nexport function Workout_WorkoutEditView__fetchAddHelperData(this$, workoutId, session, _arg) {\n return fitnessService.GetWorkoutRecords(Session__GetCurrentProfileId(session), workoutId);\n}\n\nexport function Workout_WorkoutEditView__getRoute_4B9C34E5(this$, model) {\n return new Route(38, [model.Record.WorkoutId]);\n}\n\nexport function Workout_WorkoutEditView__buildForm(this$, editing, model, dispatch) {\n const form = FlexFormTuple$2_$ctor_5AE4FFF0((arg) => {\n dispatch(new Msg$2(0, [arg]));\n }, (arg_1) => {\n dispatch(new Msg$2(1, [arg_1]));\n }, (_arg) => {\n dispatch(new Msg$2(5, []));\n }, () => {\n Router_modifyLocation(Workout_WorkoutEditView__getRoute_4B9C34E5(this$, model));\n });\n addEventInfoToFlexForm(form, model.EIMModel.EventInfo, getSuggestions(model.EIMModel.Position, Workout_getEditInfos(model)));\n FlexFormFields$1__AddTextAreaOpt_Z44636648(FlexFormTuple$2__get_FieldsSnd(form), \"Notes\", validateNotes);\n if (editing) {\n FlexFormFields$1__AddDateTimeOpt_C9F34CC(FlexFormTuple$2__get_FieldsSnd(form), \"FinishTime\", noValidation);\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Update workout record\");\n }\n else {\n FlexFormBase$1__set_SubmitCaption_Z721C83C5(form, \"Start workout record\");\n }\n return form;\n}\n\nexport const workoutRecordEditor = Workout_WorkoutEditView_$ctor();\n\n","import { Record } from \"../fable-library-js.4.24.0/Types.js\";\nimport { obj_type, record_type, bool_type, lambda_type, class_type, unit_type } from \"../fable-library-js.4.24.0/Reflection.js\";\nimport { Component } from \"react\";\nimport * as react from \"react\";\nimport { equalArrays, equals } from \"../fable-library-js.4.24.0/Util.js\";\n\nexport function Internal_updateInputValue(value, e) {\n if (!(e == null) && (e.value !== value)) {\n e.value = value;\n }\n}\n\nexport class LazyProps$1 extends Record {\n constructor(model, render, equal) {\n super();\n this.model = model;\n this.render = render;\n this.equal = equal;\n }\n}\n\nexport function LazyProps$1_$reflection(gen0) {\n return record_type(\"Elmish.React.LazyProps`1\", [gen0], LazyProps$1, () => [[\"model\", gen0], [\"render\", lambda_type(unit_type, class_type(\"Fable.React.ReactElement\", undefined))], [\"equal\", lambda_type(gen0, lambda_type(gen0, bool_type))]]);\n}\n\nexport class Components_LazyView$1 extends Component {\n constructor(props) {\n super(props);\n }\n shouldComponentUpdate(nextProps, _nextState) {\n const this$ = this;\n return !(this$.props).equal((this$.props).model, nextProps.model);\n }\n render() {\n const this$ = this;\n return (this$.props).render();\n }\n}\n\nexport function Components_LazyView$1_$reflection(gen0) {\n return class_type(\"Elmish.React.Components.LazyView`1\", [gen0], Components_LazyView$1, class_type(\"Fable.React.Component`2\", [LazyProps$1_$reflection(gen0), obj_type], Component));\n}\n\nexport function Components_LazyView$1_$ctor_Z7829D94B(props) {\n return new Components_LazyView$1(props);\n}\n\n/**\n * Avoid rendering the view unless the model has changed.\n * equal: function to compare the previous and the new states\n * view: function to render the model\n * state: new state to render\n */\nexport function Common_lazyViewWith(equal, view, state) {\n const props = new LazyProps$1(state, () => view(state), equal);\n return react.createElement(Components_LazyView$1, props);\n}\n\n/**\n * Avoid rendering the view unless the model has changed.\n * equal: function to compare the previous and the new states\n * view: function to render the model using the dispatch\n * state: new state to render\n * dispatch: dispatch function\n */\nexport function Common_lazyView2With(equal, view, state, dispatch) {\n const props = new LazyProps$1(state, () => view(state, dispatch), equal);\n return react.createElement(Components_LazyView$1, props);\n}\n\n/**\n * Avoid rendering the view unless the model has changed.\n * equal: function to compare the previous and the new model (a tuple of two states)\n * view: function to render the model using the dispatch\n * state1: new state to render\n * state2: new state to render\n * dispatch: dispatch function\n */\nexport function Common_lazyView3With(equal, view, state1, state2, dispatch) {\n const props = new LazyProps$1([state1, state2], () => view(state1, state2, dispatch), equal);\n return react.createElement(Components_LazyView$1, props);\n}\n\n/**\n * Avoid rendering the view unless the model has changed.\n * view: function of model to render the view\n */\nexport function Common_lazyView(view) {\n return (state) => Common_lazyViewWith(equals, view, state);\n}\n\n/**\n * Avoid rendering the view unless the model has changed.\n * view: function of two arguments to render the model using the dispatch\n */\nexport function Common_lazyView2(view) {\n return (state) => ((dispatch) => Common_lazyView2With(equals, view, state, dispatch));\n}\n\n/**\n * Avoid rendering the view unless the model has changed.\n * view: function of three arguments to render the model using the dispatch\n */\nexport function Common_lazyView3(view) {\n return (state) => ((state_1) => ((dispatch) => Common_lazyView3With(equalArrays, view, state, state_1, dispatch)));\n}\n\n","import { Record } from \"../fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { bool_type, record_type, lambda_type, unit_type, tuple_type, class_type } from \"../fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { Component } from \"react\";\nimport * as react from \"react\";\n\nexport class ErrorBoundaryProps extends Record {\n constructor(Inner, ErrorComponent, OnError) {\n super();\n this.Inner = Inner;\n this.ErrorComponent = ErrorComponent;\n this.OnError = OnError;\n }\n}\n\nexport function ErrorBoundaryProps_$reflection() {\n return record_type(\"ReactErrorBoundary.ErrorBoundaryProps\", [], ErrorBoundaryProps, () => [[\"Inner\", class_type(\"Fable.React.ReactElement\", undefined)], [\"ErrorComponent\", class_type(\"Fable.React.ReactElement\", undefined)], [\"OnError\", lambda_type(tuple_type(class_type(\"System.Exception\"), class_type(\"ReactErrorBoundary.InfoComponentObject\")), unit_type)]]);\n}\n\nexport class ErrorBoundaryState extends Record {\n constructor(HasErrors) {\n super();\n this.HasErrors = HasErrors;\n }\n}\n\nexport function ErrorBoundaryState_$reflection() {\n return record_type(\"ReactErrorBoundary.ErrorBoundaryState\", [], ErrorBoundaryState, () => [[\"HasErrors\", bool_type]]);\n}\n\nexport class ErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = (new ErrorBoundaryState(false));\n }\n componentDidCatch(error, info) {\n const this$ = this;\n const info_1 = info;\n (this$.props).OnError([error, info_1]);\n this$.setState((_arg, _arg_1) => (new ErrorBoundaryState(true)));\n }\n render() {\n const this$ = this;\n return (this$.state).HasErrors ? (this$.props).ErrorComponent : (this$.props).Inner;\n }\n}\n\nexport function ErrorBoundary_$reflection() {\n return class_type(\"ReactErrorBoundary.ErrorBoundary\", undefined, ErrorBoundary, class_type(\"Fable.React.Component`2\", [ErrorBoundaryProps_$reflection(), ErrorBoundaryState_$reflection()], Component));\n}\n\nexport function ErrorBoundary_$ctor_5B6311C4(props) {\n return new ErrorBoundary(props);\n}\n\nexport function renderCatchSimple(errorElement, element) {\n const props = new ErrorBoundaryProps(element, errorElement, (_arg) => {\n });\n return react.createElement(ErrorBoundary, props);\n}\n\nexport function renderCatchFn(onError, errorElement, element) {\n const props = new ErrorBoundaryProps(element, errorElement, onError);\n return react.createElement(ErrorBoundary, props);\n}\n\n","import { parse } from \"../fable-library-js.4.24.0/Int32.js\";\nimport * as react from \"react\";\nimport { ProgramModule_view, ProgramModule_withSetState } from \"../Fable.Elmish.4.2.0/program.fs.js\";\nimport { uncurry2 } from \"../fable-library-js.4.24.0/Util.js\";\nimport * as client from \"react-dom/client\";\nimport * as react_dom from \"react-dom\";\nimport { Common_lazyView2With } from \"./common.fs.js\";\n\nexport const Program_Internal_useRootApi = (() => {\n try {\n return parse(react.version.slice(undefined, 1 + 1), 511, false, 32) >= 18;\n }\n catch (matchValue) {\n return false;\n }\n})();\n\nexport function Program_Internal_withReactBatchedUsing(lazyView2With, placeholderId, program) {\n let lastRequest, root;\n return ProgramModule_withSetState(uncurry2((lastRequest = undefined, Program_Internal_useRootApi ? ((root = client.createRoot(document.getElementById(placeholderId)), (model) => ((dispatch) => {\n if (lastRequest != null) {\n const r = lastRequest;\n window.cancelAnimationFrame(r);\n }\n lastRequest = window.requestAnimationFrame((_arg) => {\n root.render(lazyView2With((x) => ((y) => (x === y)), ProgramModule_view(program), model, dispatch));\n });\n }))) : ((model_1) => ((dispatch_1) => {\n if (lastRequest != null) {\n const r_1 = lastRequest;\n window.cancelAnimationFrame(r_1);\n }\n lastRequest = window.requestAnimationFrame((_arg_1) => {\n react_dom.render(lazyView2With((x_1) => ((y_1) => (x_1 === y_1)), ProgramModule_view(program), model_1, dispatch_1), document.getElementById(placeholderId));\n });\n })))), program);\n}\n\nexport function Program_Internal_withReactSynchronousUsing(lazyView2With, placeholderId, program) {\n let root;\n return ProgramModule_withSetState(uncurry2(Program_Internal_useRootApi ? ((root = client.createRoot(document.getElementById(placeholderId)), (model) => ((dispatch) => {\n root.render(lazyView2With((x) => ((y) => (x === y)), ProgramModule_view(program), model, dispatch));\n }))) : ((model_1) => ((dispatch_1) => {\n react_dom.render(lazyView2With((x_1) => ((y_1) => (x_1 === y_1)), ProgramModule_view(program), model_1, dispatch_1), document.getElementById(placeholderId));\n }))), program);\n}\n\nexport function Program_Internal_withReactHydrateUsing(lazyView2With, placeholderId, program) {\n let root;\n return ProgramModule_withSetState(uncurry2(Program_Internal_useRootApi ? ((root = undefined, (model) => ((dispatch) => {\n if (root != null) {\n const root_1 = root;\n root_1.render(lazyView2With((x_1) => ((y_1) => (x_1 === y_1)), ProgramModule_view(program), model, dispatch));\n }\n else {\n root = client.hydrateRoot(document.getElementById(placeholderId), lazyView2With((x) => ((y) => (x === y)), ProgramModule_view(program), model, dispatch));\n }\n }))) : ((model_1) => ((dispatch_1) => {\n react_dom.hydrate(lazyView2With((x_2) => ((y_2) => (x_2 === y_2)), ProgramModule_view(program), model_1, dispatch_1), document.getElementById(placeholderId));\n }))), program);\n}\n\n/**\n * Renders React root component inside html element identified by placeholderId.\n * Uses `requestAnimationFrame` to batch updates to prevent drops in frame rate.\n * NOTE: This may have unexpected effects in React controlled inputs, see https://github.com/elmish/react/issues/12\n */\nexport function Program_withReactBatched(placeholderId, program) {\n return Program_Internal_withReactBatchedUsing((equal, view, state, dispatch) => Common_lazyView2With(uncurry2(equal), uncurry2(view), state, dispatch), placeholderId, program);\n}\n\n/**\n * Renders React root component inside html element identified by placeholderId.\n * New renders are triggered immediately after an update.\n */\nexport function Program_withReactSynchronous(placeholderId, program) {\n return Program_Internal_withReactSynchronousUsing((equal, view, state, dispatch) => Common_lazyView2With(uncurry2(equal), uncurry2(view), state, dispatch), placeholderId, program);\n}\n\n/**\n * Renders React root component inside html element identified by placeholderId using `React.hydrate`.\n */\nexport function Program_withReactHydrate(placeholderId, program) {\n return Program_Internal_withReactHydrateUsing((equal, view, state, dispatch) => Common_lazyView2With(uncurry2(equal), uncurry2(view), state, dispatch), placeholderId, program);\n}\n\n","import { Record, Union } from \"./fable_modules/fable-library-js.4.24.0/Types.js\";\nimport { view as view_11, Model_Default, update as update_3, init as init_9, Msg_$reflection as Msg_$reflection_3, Model_$reflection as Model_$reflection_1 } from \"./Pages/Index.js\";\nimport { view as view_7, update as update_4, init as init_2, Msg_$reflection as Msg_$reflection_5, Model_$reflection as Model_$reflection_2 } from \"./Pages/About.js\";\nimport { view as view_8, update as update_5, init as init_3, Msg_$reflection as Msg_$reflection_6, Model_$reflection as Model_$reflection_3 } from \"./Pages/ContactForm.js\";\nimport { view as view_10, update as update_2, init as init_1, Msg_$reflection as Msg_$reflection_4, Model_$reflection as Model_$reflection_4 } from \"./Pages/Login.js\";\nimport { view as view_9, update as update_6, init as init_4, Msg_$reflection as Msg_$reflection_7, Model_$reflection as Model_$reflection_5 } from \"./Pages/StaticPage.js\";\nimport { record_type, bool_type, int32_type, class_type, option_type, list_type, tuple_type, union_type } from \"./fable_modules/fable-library-js.4.24.0/Reflection.js\";\nimport { ViewProfile_view, AddEditProfile_view, AddEditProfile_update, ViewProfile_update, AddEditProfile_initEdit, AddEditProfile_initNew, ViewProfile_init, AddEditProfile_Msg_$reflection, ViewProfile_Msg_$reflection, AddEditProfile_Model_$reflection, ViewProfile_Model_$reflection } from \"./Pages/MyProfile.js\";\nimport { view as view_2, update as update_7, init as init_5, Msg_$reflection as Msg_$reflection_8, Model_$reflection as Model_$reflection_6 } from \"./modules/Omnicv.Diary.Client/Pages/MainDiaryView.js\";\nimport { view as view_3, update as update_8, SearchType, init as init_6, Msg_$reflection as Msg_$reflection_9, Model_$reflection as Model_$reflection_7 } from \"./modules/Omnicv.Diary.Client/Pages/SearchDiaryView.js\";\nimport { InteractionRecord_$reflection, ReviewRecord_$reflection, DiaryRecord_$reflection } from \"./modules/Omnicv.Diary.Shared/Data.js\";\nimport { EditHelperData$1_$reflection } from \"./modules/Omnicv.Diary.Shared/DiaryAPI.js\";\nimport { Msg$2, Model$2__IsEditing, Msg$2_$reflection, Model$2_$reflection } from \"./Omnicv.Client.Common/Components/AddEditRecordFlexFormBase.js\";\nimport { TemperatureRecord_$reflection, BloodPressureRecord_$reflection, BodilyFunctionsRecord_$reflection, WeightRecord_$reflection, UnifiedRecord_$reflection } from \"./Omnicv.Shared/PhysicalAPI.js\";\nimport { Msg$1_$reflection, Model$1_$reflection } from \"./Omnicv.Client.Common/Components/ViewRecords.js\";\nimport { EventInfo_$reflection } from \"./Omnicv.Shared.Common/CoreEventInfo.js\";\nimport { Main_view, Main_update, Main_init, Msg_$reflection as Msg_$reflection_10, Model_$reflection as Model_$reflection_8 } from \"./Pages/Financial/MainFinancialView.js\";\nimport { view as view_4, update as update_9, init as init_7, Msg_$reflection as Msg_$reflection_11, Model_$reflection as Model_$reflection_9 } from \"./Pages/Financial/ViewAsset.js\";\nimport { view as view_5, update as update_10, init as init_8, Msg_$reflection as Msg_$reflection_12, Model_$reflection as Model_$reflection_10 } from \"./Pages/Financial/ViewAssetsSummary.js\";\nimport { ExerciseRecord_view, Exercise_view, Workout_view, TrainingPlan_view, Main_view as Main_view_1, ExerciseRecord_update, Exercise_update, Workout_update, TrainingPlan_update, Main_update as Main_update_1, ExerciseRecord_init, Exercise_init, Workout_init, TrainingPlan_init, Main_init as Main_init_1, ExerciseRecord_Msg_$reflection, Msg$2_$reflection as Msg$2_$reflection_1, Main_Msg_$reflection, ExerciseRecord_Model_$reflection, Model$2_$reflection as Model$2_$reflection_1, Main_Model_$reflection } from \"./Pages/Fitness/MainFitnessView.js\";\nimport { WorkoutRecord, WorkoutRecord_$reflection, ExerciseRecord_$reflection, WorkoutRecords_$reflection, FitnessEditHelperData_$reflection, TrainingPlan_$reflection, TrainingPlanWorkoutRecords_$reflection, Exercise_$reflection, Workout_$reflection } from \"./Omnicv.Shared/FitnessAPI.js\";\nimport { Exercises_view, Workouts_view, Exercises_update, Workouts_update, Exercises_init, Workouts_init, Msg$1_$reflection as Msg$1_$reflection_1, Model$1_$reflection as Model$1_$reflection_1 } from \"./Pages/Fitness/FitnessEntriesView.js\";\nimport { SimpleFormView$2__Update, Msg$2_$reflection as Msg$2_$reflection_2, Model$2_$reflection as Model$2_$reflection_2 } from \"./Omnicv.Client.Common/Components/AddEditSimpleFlexFormBase.js\";\nimport { ExerciseRecordsMany_view, view as view_6, ExerciseRecordsMany_mapModelToEIMMsg, mapModelToEIMMsg, ExerciseRecordsMany_update, getSetTimerMsg, update as update_11, ExerciseRecordsMany_initNewMany, initEdit, initNew, ExerciseRecordsMany_MsgMany_$reflection, Msg_$reflection as Msg_$reflection_13, ExerciseRecordsMany_ModelMany_$reflection, Model_$reflection as Model_$reflection_11 } from \"./Pages/Fitness/AddEditExerciseRecord.js\";\nimport { RouteModule_routeParser, Route, Route_$reflection } from \"./Omnicv.Client.Common/Router.js\";\nimport { view as view_12, init as init_10, LogInState, update as update_1, Msg as Msg_1, Model_$reflection as Model_$reflection_12, Msg_$reflection as Msg_$reflection_1 } from \"./Components/Navigation.js\";\nimport { Response_AvailableUserInfo_$reflection } from \"./Omnicv.Shared/API.js\";\nimport { subscribeLocation as subscribeLocation_1, Msg_$reflection as Msg_$reflection_2 } from \"./Omnicv.Client.Common/Components/EventInfoManager.js\";\nimport { Session__GetCurrentProfile, Session_get_Default, Session, Session__SetActiveWorkoutRecord_Z2D8A2414, Session__UpdateCurrentProvile, Session__GetActiveWorkoutRecord, Session_$reflection } from \"./Omnicv.Client.Common/SharedView.js\";\nimport { some, value as value_15, map } from \"./fable_modules/fable-library-js.4.24.0/Option.js\";\nimport { Cmd_batch, Cmd_map, Cmd_none } from \"./fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { DiaryEditingView$1__View, DiaryEditingView$1__Update, interactionEditing, reviewEditing, DiaryEditingView$1__InitEdit, diaryEditing, DiaryEditingView$1__InitNew } from \"./modules/Omnicv.Diary.Client/Pages/AddEditDiaryView.js\";\nimport { WeightView_viewList, BodilyFunctionsView_viewList, PhysicalView_view, WeightView_update, BodilyFunctionsView_update, PhysicalView_update, WeightView_init, BodilyFunctionsView_init, PhysicalView_init } from \"./Pages/Physical/MainPhysicalView.js\";\nimport { Physical_PhysicalView$1__View, Physical_PhysicalView$1__Update, Physical_temperatureEditing, Physical_bodilyFunctionsEditing, Physical_bloodPressureEditing, Physical_PhysicalView$1__InitEdit, Physical_weightEditing, Physical_PhysicalView$1__InitNew_5D846BF8 } from \"./Pages/Physical/AddEditPhysicalView.js\";\nimport { AddEditFitnessView$1__View, exerciseEditing, workoutEditing, AddEditFitnessView$1__InitEdit, trainingPlanEditing, AddEditFitnessView$1__InitNew_5D846BF8 } from \"./Pages/Fitness/AddEditFitnessView.js\";\nimport { Workout_WorkoutEditView__View, Workout_WorkoutEditView__Update, Workout_WorkoutEditView__InitEdit, workoutRecordEditor, Workout_WorkoutEditView__InitNew } from \"./Pages/Fitness/AddEditWorkoutRecord.js\";\nimport { empty, ofArray, singleton } from \"./fable_modules/fable-library-js.4.24.0/List.js\";\nimport { createObj, uncurry2, equals } from \"./fable_modules/fable-library-js.4.24.0/Util.js\";\nimport { Cmd_OfAsync_start, Cmd_OfAsyncWith_either } from \"./fable_modules/Fable.Elmish.4.2.0/cmd.fs.js\";\nimport { anonService } from \"./Omnicv.Client.Common/CommonServer.js\";\nimport * as common from \"../src/javascript/common.js\";\nimport { box$0027 } from \"./fable_modules/Fulma.3.0.0/Elements/Box.fs.js\";\nimport { Common_lazyView2 } from \"./fable_modules/Fable.Elmish.React.4.0.0/common.fs.js\";\nimport { createElement } from \"react\";\nimport { reactApi } from \"./fable_modules/Feliz.2.9.0/Interop.fs.js\";\nimport { Router_href } from \"./Omnicv.Client.Common/Router.js\";\nimport { Helpers_combineClasses } from \"./fable_modules/Feliz.Bulma.3.0.0/ElementBuilders.fs.js\";\nimport { singleton as singleton_1, append, delay, toList } from \"./fable_modules/fable-library-js.4.24.0/Seq.js\";\nimport { renderCatchSimple } from \"./Omnicv.Client.Common/ReactErrorBoundary.js\";\nimport { footer } from \"./fable_modules/Fulma.3.0.0/Layouts/Footer.fs.js\";\nimport { Option, content } from \"./fable_modules/Fulma.3.0.0/Elements/Content.fs.js\";\nimport { Modifier_IModifier, TextAlignment_Option, Screen } from \"./fable_modules/Fulma.3.0.0/Common.fs.js\";\nimport { ProgramModule_mkProgram, ProgramModule_withSubscription, ProgramModule_run } from \"./fable_modules/Fable.Elmish.4.2.0/program.fs.js\";\nimport { Program_withReactSynchronous } from \"./fable_modules/Fable.Elmish.React.4.0.0/react.fs.js\";\nimport { ProgramModule_toNavigable } from \"./fable_modules/Fable.Elmish.Browser.4.0.3/navigation.fs.js\";\nimport { parseHash } from \"./fable_modules/Fable.Elmish.Browser.4.0.3/parser.fs.js\";\n\nexport function Tuple_mapFirst(f, x, y) {\n return [f(x), y];\n}\n\nexport function Tuple_mapSecond(f, x, y) {\n return [x, f(y)];\n}\n\nexport class AnonymousPage extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Index\", \"NotFound\", \"About\", \"ContactForm\", \"Login\", \"StaticPage\"];\n }\n}\n\nexport function AnonymousPage_$reflection() {\n return union_type(\"Omnicv.Client.App.AnonymousPage\", [], AnonymousPage, () => [[[\"Item\", Model_$reflection_1()]], [], [[\"Item\", Model_$reflection_2()]], [[\"Item\", Model_$reflection_3()]], [[\"Item\", Model_$reflection_4()]], [[\"Item\", Model_$reflection_5()]]]);\n}\n\nexport class SessionPage extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"MyProfile\", \"AddEditProfile\", \"ViewDiary\", \"SearchDiary\", \"AddEditDiary\", \"AddEditReview\", \"AddEditInteraction\", \"ViewPhysical\", \"ViewWeight\", \"ViewBodilyFunctions\", \"AddEditWeight\", \"AddEditBloodPressure\", \"AddEditBodilyFunctions\", \"AddEditTemperature\", \"ViewFinancial\", \"ViewAsset\", \"ViewAssetsSummary\", \"ViewFitness\", \"ViewWorkouts\", \"ViewExercises\", \"ViewTrainingPlan\", \"AddEditTrainingPlan\", \"ViewWorkout\", \"AddEditWorkout\", \"ViewExercise\", \"AddEditExercise\", \"ViewExerciseRecord\", \"AddEditExerciseRecord\", \"AddAllWorkoutExerciseRecords\", \"AddEditWorkoutRecord\"];\n }\n}\n\nexport function SessionPage_$reflection() {\n return union_type(\"Omnicv.Client.App.SessionPage\", [], SessionPage, () => [[[\"Item\", ViewProfile_Model_$reflection()]], [[\"Item\", AddEditProfile_Model_$reflection()]], [[\"Item\", Model_$reflection_6()]], [[\"Item\", Model_$reflection_7()]], [[\"Item\", Model$2_$reflection(DiaryRecord_$reflection(), EditHelperData$1_$reflection(DiaryRecord_$reflection()))]], [[\"Item\", Model$2_$reflection(ReviewRecord_$reflection(), EditHelperData$1_$reflection(ReviewRecord_$reflection()))]], [[\"Item\", Model$2_$reflection(InteractionRecord_$reflection(), EditHelperData$1_$reflection(InteractionRecord_$reflection()))]], [[\"Item\", Model$1_$reflection(UnifiedRecord_$reflection())]], [[\"Item\", Model$1_$reflection(WeightRecord_$reflection())]], [[\"Item\", Model$1_$reflection(BodilyFunctionsRecord_$reflection())]], [[\"Item\", Model$2_$reflection(WeightRecord_$reflection(), list_type(tuple_type(EventInfo_$reflection(), WeightRecord_$reflection())))]], [[\"Item\", Model$2_$reflection(BloodPressureRecord_$reflection(), list_type(tuple_type(EventInfo_$reflection(), BloodPressureRecord_$reflection())))]], [[\"Item\", Model$2_$reflection(BodilyFunctionsRecord_$reflection(), list_type(tuple_type(EventInfo_$reflection(), BodilyFunctionsRecord_$reflection())))]], [[\"Item\", Model$2_$reflection(TemperatureRecord_$reflection(), list_type(tuple_type(EventInfo_$reflection(), TemperatureRecord_$reflection())))]], [[\"Item\", Model_$reflection_8()]], [[\"Item\", Model_$reflection_9()]], [[\"Item\", Model_$reflection_10()]], [[\"Item\", Main_Model_$reflection()]], [[\"Item\", Model$1_$reflection_1(Workout_$reflection())]], [[\"Item\", Model$1_$reflection_1(Exercise_$reflection())]], [[\"Item\", Model$2_$reflection_1(TrainingPlanWorkoutRecords_$reflection(), Workout_$reflection())]], [[\"Item\", Model$2_$reflection_2(TrainingPlan_$reflection(), FitnessEditHelperData_$reflection())]], [[\"Item\", Model$2_$reflection_1(WorkoutRecords_$reflection(), Exercise_$reflection())]], [[\"Item\", Model$2_$reflection_2(Workout_$reflection(), FitnessEditHelperData_$reflection())]], [[\"Item\", Model$2_$reflection_1(Exercise_$reflection(), tuple_type(EventInfo_$reflection(), ExerciseRecord_$reflection()))]], [[\"Item\", Model$2_$reflection_2(Exercise_$reflection(), FitnessEditHelperData_$reflection())]], [[\"Item\", ExerciseRecord_Model_$reflection()]], [[\"Item\", Model_$reflection_11()]], [[\"Item\", ExerciseRecordsMany_ModelMany_$reflection()]], [[\"Item\", Model$2_$reflection(WorkoutRecord_$reflection(), WorkoutRecords_$reflection())]]]);\n}\n\nexport class Page extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"Anon\", \"Auth\"];\n }\n}\n\nexport function Page_$reflection() {\n return union_type(\"Omnicv.Client.App.Page\", [], Page, () => [[[\"Item\", AnonymousPage_$reflection()]], [[\"Item\", SessionPage_$reflection()]]]);\n}\n\nexport class Msg extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"SetRoute\", \"SetRouteValue\", \"NavigationMsg\", \"TimeTick\", \"RefreshSession\", \"SessionRefreshed\", \"SetCurrentProfile\", \"SessionRefreshError\", \"AppEIMMsg\", \"IndexMsg\", \"LoginMsg\", \"AboutMsg\", \"ContactFormMsg\", \"StaticPageMsg\", \"MyProfileMsg\", \"AddEditProfileMsg\", \"ViewDiaryMsg\", \"AddEditDiaryMsg\", \"AddEditReviewMsg\", \"AddEditInteractionMsg\", \"SearchDiaryMsg\", \"ViewPhysicalMsg\", \"ViewBodilyFunctionsMsg\", \"ViewWeightMsg\", \"AddEditWeightMsg\", \"AddEditBloodPressureMsg\", \"AddEditBodilyFunctionsMsg\", \"AddEditTemperatureMsg\", \"ViewFinancialMsg\", \"ViewAssetMsg\", \"ViewAssetsSummaryMsg\", \"ViewFitnessMsg\", \"ViewWorkoutsMsg\", \"ViewExercisesMsg\", \"ViewTrainingPlanMsg\", \"AddEditTrainingPlanMsg\", \"ViewWorkoutMsg\", \"AddEditWorkoutMsg\", \"ViewExerciseMsg\", \"AddEditExerciseMsg\", \"ViewExerciseRecordMsg\", \"AddEditExerciseRecordMsg\", \"AddAllWorkoutExerciseRecordsMsg\", \"AddEditWorkoutRecordMsg\"];\n }\n}\n\nexport function Msg_$reflection() {\n return union_type(\"Omnicv.Client.App.Msg\", [], Msg, () => [[[\"Item\", option_type(Route_$reflection())]], [[\"Item\", Route_$reflection()]], [[\"Item\", Msg_$reflection_1()]], [[\"Item\", class_type(\"System.DateTime\")]], [], [[\"Item\", Response_AvailableUserInfo_$reflection()]], [[\"Item\", int32_type]], [[\"Item\", class_type(\"System.Exception\")]], [[\"Item\", Msg_$reflection_2()]], [[\"Item\", Msg_$reflection_3()]], [[\"Item\", Msg_$reflection_4()]], [[\"Item\", Msg_$reflection_5()]], [[\"Item\", Msg_$reflection_6()]], [[\"Item\", Msg_$reflection_7()]], [[\"Item\", ViewProfile_Msg_$reflection()]], [[\"Item\", AddEditProfile_Msg_$reflection()]], [[\"Item\", Msg_$reflection_8()]], [[\"Item\", Msg$2_$reflection(DiaryRecord_$reflection(), EditHelperData$1_$reflection(DiaryRecord_$reflection()))]], [[\"Item\", Msg$2_$reflection(ReviewRecord_$reflection(), EditHelperData$1_$reflection(ReviewRecord_$reflection()))]], [[\"Item\", Msg$2_$reflection(InteractionRecord_$reflection(), EditHelperData$1_$reflection(InteractionRecord_$reflection()))]], [[\"Item\", Msg_$reflection_9()]], [[\"Item\", Msg$1_$reflection(UnifiedRecord_$reflection())]], [[\"Item\", Msg$1_$reflection(BodilyFunctionsRecord_$reflection())]], [[\"Item\", Msg$1_$reflection(WeightRecord_$reflection())]], [[\"Item\", Msg$2_$reflection(WeightRecord_$reflection(), list_type(tuple_type(EventInfo_$reflection(), WeightRecord_$reflection())))]], [[\"Item\", Msg$2_$reflection(BloodPressureRecord_$reflection(), list_type(tuple_type(EventInfo_$reflection(), BloodPressureRecord_$reflection())))]], [[\"Item\", Msg$2_$reflection(BodilyFunctionsRecord_$reflection(), list_type(tuple_type(EventInfo_$reflection(), BodilyFunctionsRecord_$reflection())))]], [[\"Item\", Msg$2_$reflection(TemperatureRecord_$reflection(), list_type(tuple_type(EventInfo_$reflection(), TemperatureRecord_$reflection())))]], [[\"Item\", Msg_$reflection_10()]], [[\"Item\", Msg_$reflection_11()]], [[\"Item\", Msg_$reflection_12()]], [[\"Item\", Main_Msg_$reflection()]], [[\"Item\", Msg$1_$reflection_1(Workout_$reflection())]], [[\"Item\", Msg$1_$reflection_1(Exercise_$reflection())]], [[\"Item\", Msg$2_$reflection_1(TrainingPlanWorkoutRecords_$reflection(), Workout_$reflection())]], [[\"Item\", Msg$2_$reflection_2(TrainingPlan_$reflection(), FitnessEditHelperData_$reflection())]], [[\"Item\", Msg$2_$reflection_1(WorkoutRecords_$reflection(), Exercise_$reflection())]], [[\"Item\", Msg$2_$reflection_2(Workout_$reflection(), FitnessEditHelperData_$reflection())]], [[\"Item\", Msg$2_$reflection_1(Exercise_$reflection(), tuple_type(EventInfo_$reflection(), ExerciseRecord_$reflection()))]], [[\"Item\", Msg$2_$reflection_2(Exercise_$reflection(), FitnessEditHelperData_$reflection())]], [[\"Item\", ExerciseRecord_Msg_$reflection()]], [[\"Item\", Msg_$reflection_13()]], [[\"Item\", ExerciseRecordsMany_MsgMany_$reflection()]], [[\"Item\", Msg$2_$reflection(WorkoutRecord_$reflection(), WorkoutRecords_$reflection())]]]);\n}\n\nexport class Model extends Record {\n constructor(CurrentRoute, ActivePage, NavigationModel, Session, SessionLoading, LastSessionRefresh) {\n super();\n this.CurrentRoute = CurrentRoute;\n this.ActivePage = ActivePage;\n this.NavigationModel = NavigationModel;\n this.Session = Session;\n this.SessionLoading = SessionLoading;\n this.LastSessionRefresh = LastSessionRefresh;\n }\n}\n\nexport function Model_$reflection() {\n return record_type(\"Omnicv.Client.App.Model\", [], Model, () => [[\"CurrentRoute\", option_type(Route_$reflection())], [\"ActivePage\", Page_$reflection()], [\"NavigationModel\", Model_$reflection_12()], [\"Session\", Session_$reflection()], [\"SessionLoading\", bool_type], [\"LastSessionRefresh\", class_type(\"System.DateTime\")]]);\n}\n\nexport function Model__NeedsTimer(this$) {\n const activeWorkout = map((tuple) => tuple[1], Session__GetActiveWorkoutRecord(this$.Session));\n if ((activeWorkout != null) && (value_15(activeWorkout).FinishTime == null)) {\n return true;\n }\n else {\n return this$.NavigationModel.CurrentTimerExpiry != null;\n }\n}\n\nfunction setRouteValue(route, model) {\n switch (route.tag) {\n case 1:\n return [new Model(model.CurrentRoute, new Page(0, [new AnonymousPage(1, [])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_none()];\n case 3: {\n const patternInput_1 = init_1();\n return [new Model(model.CurrentRoute, new Page(0, [new AnonymousPage(4, [patternInput_1[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_1) => (new Msg(10, [Item_1])), patternInput_1[1])];\n }\n case 2: {\n const patternInput_2 = init_2(model.Session);\n return [new Model(model.CurrentRoute, new Page(0, [new AnonymousPage(2, [patternInput_2[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_2) => (new Msg(11, [Item_2])), patternInput_2[1])];\n }\n case 8: {\n const patternInput_3 = init_3(model.Session);\n return [new Model(model.CurrentRoute, new Page(0, [new AnonymousPage(3, [patternInput_3[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_3) => (new Msg(12, [Item_3])), patternInput_3[1])];\n }\n case 7: {\n const patternInput_4 = init_4(route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(0, [new AnonymousPage(5, [patternInput_4[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_4) => (new Msg(13, [Item_4])), patternInput_4[1])];\n }\n case 4: {\n const patternInput_5 = ViewProfile_init(model.Session);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(0, [patternInput_5[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_5) => (new Msg(14, [Item_5])), patternInput_5[1])];\n }\n case 5: {\n const patternInput_6 = AddEditProfile_initNew();\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(1, [patternInput_6[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_6) => (new Msg(15, [Item_6])), patternInput_6[1])];\n }\n case 6: {\n const patternInput_7 = AddEditProfile_initEdit(route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(1, [patternInput_7[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_7) => (new Msg(15, [Item_7])), patternInput_7[1])];\n }\n case 9: {\n const patternInput_8 = init_5(route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(2, [patternInput_8[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_8) => (new Msg(16, [Item_8])), patternInput_8[1])];\n }\n case 10: {\n const patternInput_9 = DiaryEditingView$1__InitNew(diaryEditing, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(4, [patternInput_9[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_9) => (new Msg(17, [Item_9])), patternInput_9[1])];\n }\n case 11: {\n const patternInput_10 = DiaryEditingView$1__InitEdit(diaryEditing, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(4, [patternInput_10[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_10) => (new Msg(17, [Item_10])), patternInput_10[1])];\n }\n case 12: {\n const patternInput_11 = DiaryEditingView$1__InitNew(reviewEditing, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(5, [patternInput_11[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_11) => (new Msg(18, [Item_11])), patternInput_11[1])];\n }\n case 13: {\n const patternInput_12 = DiaryEditingView$1__InitEdit(reviewEditing, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(5, [patternInput_12[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_12) => (new Msg(18, [Item_12])), patternInput_12[1])];\n }\n case 14: {\n const patternInput_13 = DiaryEditingView$1__InitNew(interactionEditing, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(6, [patternInput_13[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_13) => (new Msg(19, [Item_13])), patternInput_13[1])];\n }\n case 15: {\n const patternInput_14 = DiaryEditingView$1__InitEdit(interactionEditing, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(6, [patternInput_14[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_14) => (new Msg(19, [Item_14])), patternInput_14[1])];\n }\n case 16: {\n const patternInput_15 = init_6(model.Session, new SearchType(0, [route.fields[0]]));\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(3, [patternInput_15[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_15) => (new Msg(20, [Item_15])), patternInput_15[1])];\n }\n case 17: {\n const patternInput_16 = init_6(model.Session, new SearchType(1, []));\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(3, [patternInput_16[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_16) => (new Msg(20, [Item_16])), patternInput_16[1])];\n }\n case 18: {\n const patternInput_17 = PhysicalView_init();\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(7, [patternInput_17[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_17) => (new Msg(21, [Item_17])), patternInput_17[1])];\n }\n case 19: {\n const patternInput_18 = BodilyFunctionsView_init();\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(9, [patternInput_18[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_18) => (new Msg(22, [Item_18])), patternInput_18[1])];\n }\n case 20: {\n const patternInput_19 = WeightView_init();\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(8, [patternInput_19[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_19) => (new Msg(23, [Item_19])), patternInput_19[1])];\n }\n case 21: {\n const patternInput_20 = Physical_PhysicalView$1__InitNew_5D846BF8(Physical_weightEditing, model.Session);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(10, [patternInput_20[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_20) => (new Msg(24, [Item_20])), patternInput_20[1])];\n }\n case 22: {\n const patternInput_21 = Physical_PhysicalView$1__InitEdit(Physical_weightEditing, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(10, [patternInput_21[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_21) => (new Msg(24, [Item_21])), patternInput_21[1])];\n }\n case 25: {\n const patternInput_22 = Physical_PhysicalView$1__InitNew_5D846BF8(Physical_bloodPressureEditing, model.Session);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(11, [patternInput_22[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_22) => (new Msg(25, [Item_22])), patternInput_22[1])];\n }\n case 26: {\n const patternInput_23 = Physical_PhysicalView$1__InitEdit(Physical_bloodPressureEditing, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(11, [patternInput_23[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_23) => (new Msg(25, [Item_23])), patternInput_23[1])];\n }\n case 23: {\n const patternInput_24 = Physical_PhysicalView$1__InitNew_5D846BF8(Physical_bodilyFunctionsEditing, model.Session);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(12, [patternInput_24[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_24) => (new Msg(26, [Item_24])), patternInput_24[1])];\n }\n case 24: {\n const patternInput_25 = Physical_PhysicalView$1__InitEdit(Physical_bodilyFunctionsEditing, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(12, [patternInput_25[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_25) => (new Msg(26, [Item_25])), patternInput_25[1])];\n }\n case 27: {\n const patternInput_26 = Physical_PhysicalView$1__InitNew_5D846BF8(Physical_temperatureEditing, model.Session);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(13, [patternInput_26[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_26) => (new Msg(27, [Item_26])), patternInput_26[1])];\n }\n case 28: {\n const patternInput_27 = Physical_PhysicalView$1__InitEdit(Physical_temperatureEditing, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(13, [patternInput_27[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_27) => (new Msg(27, [Item_27])), patternInput_27[1])];\n }\n case 29: {\n const patternInput_28 = Main_init();\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(14, [patternInput_28[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_28) => (new Msg(28, [Item_28])), patternInput_28[1])];\n }\n case 30: {\n const patternInput_29 = init_7(route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(15, [patternInput_29[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_29) => (new Msg(29, [Item_29])), patternInput_29[1])];\n }\n case 31: {\n const patternInput_30 = init_8();\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(16, [patternInput_30[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_30) => (new Msg(30, [Item_30])), patternInput_30[1])];\n }\n case 32: {\n const patternInput_31 = Main_init_1();\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(17, [patternInput_31[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_31) => (new Msg(31, [Item_31])), patternInput_31[1])];\n }\n case 39: {\n const patternInput_32 = Workouts_init();\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(18, [patternInput_32[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_32) => (new Msg(32, [Item_32])), patternInput_32[1])];\n }\n case 43: {\n const patternInput_33 = Exercises_init();\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(19, [patternInput_33[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_33) => (new Msg(33, [Item_33])), patternInput_33[1])];\n }\n case 35: {\n const patternInput_34 = TrainingPlan_init(route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(20, [patternInput_34[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_34) => (new Msg(34, [Item_34])), patternInput_34[1])];\n }\n case 33: {\n const patternInput_35 = AddEditFitnessView$1__InitNew_5D846BF8(trainingPlanEditing, model.Session);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(21, [patternInput_35[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_35) => (new Msg(35, [Item_35])), patternInput_35[1])];\n }\n case 34: {\n const patternInput_36 = AddEditFitnessView$1__InitEdit(trainingPlanEditing, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(21, [patternInput_36[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_36) => (new Msg(35, [Item_36])), patternInput_36[1])];\n }\n case 38: {\n const patternInput_37 = Workout_init(route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(22, [patternInput_37[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_37) => (new Msg(36, [Item_37])), patternInput_37[1])];\n }\n case 36: {\n const patternInput_38 = AddEditFitnessView$1__InitNew_5D846BF8(workoutEditing, model.Session);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(23, [patternInput_38[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_38) => (new Msg(37, [Item_38])), patternInput_38[1])];\n }\n case 37: {\n const patternInput_39 = AddEditFitnessView$1__InitEdit(workoutEditing, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(23, [patternInput_39[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_39) => (new Msg(37, [Item_39])), patternInput_39[1])];\n }\n case 42: {\n const patternInput_40 = Exercise_init(route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(24, [patternInput_40[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_40) => (new Msg(38, [Item_40])), patternInput_40[1])];\n }\n case 40: {\n const patternInput_41 = AddEditFitnessView$1__InitNew_5D846BF8(exerciseEditing, model.Session);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(25, [patternInput_41[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_41) => (new Msg(39, [Item_41])), patternInput_41[1])];\n }\n case 41: {\n const patternInput_42 = AddEditFitnessView$1__InitEdit(exerciseEditing, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(25, [patternInput_42[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_42) => (new Msg(39, [Item_42])), patternInput_42[1])];\n }\n case 44: {\n const patternInput_43 = ExerciseRecord_init(route.fields[0], route.fields[1]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(26, [patternInput_43[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_43) => (new Msg(40, [Item_43])), patternInput_43[1])];\n }\n case 45: {\n const patternInput_44 = initNew(model.Session, route.fields[0], route.fields[1], route.fields[2]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(27, [patternInput_44[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_44) => (new Msg(41, [Item_44])), patternInput_44[1])];\n }\n case 46: {\n const patternInput_45 = initEdit(model.Session, route.fields[0], route.fields[1]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(27, [patternInput_45[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_45) => (new Msg(41, [Item_45])), patternInput_45[1])];\n }\n case 47: {\n const patternInput_46 = ExerciseRecordsMany_initNewMany(model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(28, [patternInput_46[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_46) => (new Msg(42, [Item_46])), patternInput_46[1])];\n }\n case 48: {\n const patternInput_47 = Workout_WorkoutEditView__InitNew(workoutRecordEditor, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(29, [patternInput_47[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_47) => (new Msg(43, [Item_47])), patternInput_47[1])];\n }\n case 49: {\n const patternInput_48 = Workout_WorkoutEditView__InitEdit(workoutRecordEditor, model.Session, route.fields[0]);\n return [new Model(model.CurrentRoute, new Page(1, [new SessionPage(29, [patternInput_48[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item_48) => (new Msg(43, [Item_48])), patternInput_48[1])];\n }\n default: {\n const patternInput = init_9(model.Session);\n return [new Model(model.CurrentRoute, new Page(0, [new AnonymousPage(0, [patternInput[0]])]), model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh), Cmd_batch(ofArray([Cmd_map((Item) => (new Msg(9, [Item])), patternInput[1]), singleton((dispatch) => {\n dispatch(new Msg(2, [new Msg_1(3, [model.Session])]));\n })]))];\n }\n }\n}\n\nfunction setRoute(optRoute, model) {\n const model_1 = new Model(optRoute, model.ActivePage, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh);\n if (optRoute != null) {\n return setRouteValue(optRoute, model_1);\n }\n else {\n return [new Model(model_1.CurrentRoute, new Page(0, [new AnonymousPage(1, [])]), model_1.NavigationModel, model_1.Session, model_1.SessionLoading, model_1.LastSessionRefresh), Cmd_none()];\n }\n}\n\nfunction refreshSession(newSession, model, forceRefresh) {\n let msg_1;\n Session__UpdateCurrentProvile(newSession);\n const newModel = new Model(model.CurrentRoute, model.ActivePage, model.NavigationModel, newSession, false, model.LastSessionRefresh);\n const cmd = singleton((dispatch) => {\n dispatch(new Msg(2, [new Msg_1(3, [newSession])]));\n });\n if (forceRefresh) {\n if (model.CurrentRoute != null) {\n return [newModel, Cmd_batch(ofArray([cmd, (msg_1 = (new Msg(1, [value_15(model.CurrentRoute)])), singleton((dispatch_1) => {\n dispatch_1(msg_1);\n }))]))];\n }\n else {\n return [newModel, cmd];\n }\n }\n else {\n return [newModel, cmd];\n }\n}\n\nfunction update(msg, model) {\n let bind$0040_1, bind$0040_2, userInfo;\n switch (msg.tag) {\n case 1:\n return setRouteValue(msg.fields[0], model);\n case 2: {\n const subMsg = msg.fields[0];\n const patternInput = update_1(model.Session, subMsg, model.NavigationModel);\n const subModel = patternInput[0];\n const updatedSession = (subMsg.tag === 8) ? Session__SetActiveWorkoutRecord_Z2D8A2414(model.Session, subMsg.fields[0]) : model.Session;\n return [new Model(model.CurrentRoute, model.ActivePage, subModel, equals(subModel.LogInState, new LogInState(2, [])) ? (new Session(false, undefined, updatedSession.CurrentProfile)) : updatedSession, model.SessionLoading, model.LastSessionRefresh), Cmd_map((Item) => (new Msg(2, [Item])), patternInput[1])];\n }\n case 3:\n if (model.Session.LoggedIn) {\n return [model, Cmd_map((Item_1) => (new Msg(2, [Item_1])), singleton((dispatch) => {\n dispatch(new Msg_1(4, [msg.fields[0]]));\n }))];\n }\n else {\n return [model, Cmd_none()];\n }\n case 10: {\n const matchValue = model.ActivePage;\n let matchResult, subModel_1;\n if (matchValue.tag === 0) {\n if (matchValue.fields[0].tag === 4) {\n matchResult = 0;\n subModel_1 = matchValue.fields[0].fields[0];\n }\n else {\n matchResult = 1;\n }\n }\n else {\n matchResult = 1;\n }\n switch (matchResult) {\n case 0: {\n const patternInput_1 = update_2(msg.fields[0], subModel_1);\n const subModelRes = patternInput_1[0];\n const newSession_1 = (subModelRes.Response != null) ? (new Session(true, subModelRes.Response, model.Session.CurrentProfile)) : model.Session;\n let tupledArg_2;\n let tupledArg_1;\n const tupledArg = [subModelRes, patternInput_1[1]];\n tupledArg_1 = Tuple_mapFirst((arg) => (new Page(0, [new AnonymousPage(4, [arg])])), tupledArg[0], tupledArg[1]);\n tupledArg_2 = Tuple_mapFirst((page) => (new Model(model.CurrentRoute, page, model.NavigationModel, newSession_1, model.SessionLoading, model.LastSessionRefresh)), tupledArg_1[0], tupledArg_1[1]);\n return Tuple_mapSecond((cmd_4) => Cmd_map((Item_4) => (new Msg(10, [Item_4])), cmd_4), tupledArg_2[0], tupledArg_2[1]);\n }\n default: {\n console.log(some(`Login deciding to do nothing: model=${model}`));\n return [model, Cmd_none()];\n }\n }\n }\n case 9: {\n const matchValue_1 = model.ActivePage;\n let matchResult_1, subModel_2;\n if (matchValue_1.tag === 0) {\n if (matchValue_1.fields[0].tag === 0) {\n matchResult_1 = 0;\n subModel_2 = matchValue_1.fields[0].fields[0];\n }\n else {\n matchResult_1 = 1;\n }\n }\n else {\n matchResult_1 = 1;\n }\n switch (matchResult_1) {\n case 0: {\n let tupledArg_5;\n let tupledArg_4;\n const tupledArg_3 = update_3(model.Session, msg.fields[0], subModel_2);\n tupledArg_4 = Tuple_mapFirst((arg_1) => (new Page(0, [new AnonymousPage(0, [arg_1])])), tupledArg_3[0], tupledArg_3[1]);\n tupledArg_5 = Tuple_mapFirst((page_1) => (new Model(model.CurrentRoute, page_1, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_4[0], tupledArg_4[1]);\n return Tuple_mapSecond((cmd_5) => Cmd_map((Item_7) => (new Msg(9, [Item_7])), cmd_5), tupledArg_5[0], tupledArg_5[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 11: {\n const matchValue_2 = model.ActivePage;\n let matchResult_2, subModel_3;\n if (matchValue_2.tag === 0) {\n if (matchValue_2.fields[0].tag === 2) {\n matchResult_2 = 0;\n subModel_3 = matchValue_2.fields[0].fields[0];\n }\n else {\n matchResult_2 = 1;\n }\n }\n else {\n matchResult_2 = 1;\n }\n switch (matchResult_2) {\n case 0: {\n let tupledArg_8;\n let tupledArg_7;\n const tupledArg_6 = update_4(msg.fields[0], subModel_3);\n tupledArg_7 = Tuple_mapFirst((arg_2) => (new Page(0, [new AnonymousPage(2, [arg_2])])), tupledArg_6[0], tupledArg_6[1]);\n tupledArg_8 = Tuple_mapFirst((page_2) => (new Model(model.CurrentRoute, page_2, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_7[0], tupledArg_7[1]);\n return Tuple_mapSecond((cmd_6) => Cmd_map((Item_10) => (new Msg(11, [Item_10])), cmd_6), tupledArg_8[0], tupledArg_8[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 12: {\n const matchValue_3 = model.ActivePage;\n let matchResult_3, subModel_4;\n if (matchValue_3.tag === 0) {\n if (matchValue_3.fields[0].tag === 3) {\n matchResult_3 = 0;\n subModel_4 = matchValue_3.fields[0].fields[0];\n }\n else {\n matchResult_3 = 1;\n }\n }\n else {\n matchResult_3 = 1;\n }\n switch (matchResult_3) {\n case 0: {\n let tupledArg_11;\n let tupledArg_10;\n const tupledArg_9 = update_5(model.Session, msg.fields[0], subModel_4);\n tupledArg_10 = Tuple_mapFirst((arg_3) => (new Page(0, [new AnonymousPage(3, [arg_3])])), tupledArg_9[0], tupledArg_9[1]);\n tupledArg_11 = Tuple_mapFirst((page_3) => (new Model(model.CurrentRoute, page_3, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_10[0], tupledArg_10[1]);\n return Tuple_mapSecond((cmd_7) => Cmd_map((Item_13) => (new Msg(12, [Item_13])), cmd_7), tupledArg_11[0], tupledArg_11[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 13: {\n const matchValue_4 = model.ActivePage;\n let matchResult_4, subModel_5;\n if (matchValue_4.tag === 0) {\n if (matchValue_4.fields[0].tag === 5) {\n matchResult_4 = 0;\n subModel_5 = matchValue_4.fields[0].fields[0];\n }\n else {\n matchResult_4 = 1;\n }\n }\n else {\n matchResult_4 = 1;\n }\n switch (matchResult_4) {\n case 0: {\n let tupledArg_14;\n let tupledArg_13;\n const tupledArg_12 = update_6(msg.fields[0], subModel_5);\n tupledArg_13 = Tuple_mapFirst((arg_4) => (new Page(0, [new AnonymousPage(5, [arg_4])])), tupledArg_12[0], tupledArg_12[1]);\n tupledArg_14 = Tuple_mapFirst((page_4) => (new Model(model.CurrentRoute, page_4, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_13[0], tupledArg_13[1]);\n return Tuple_mapSecond((cmd_8) => Cmd_map((Item_16) => (new Msg(13, [Item_16])), cmd_8), tupledArg_14[0], tupledArg_14[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 14: {\n const subMsg_6 = msg.fields[0];\n const matchValue_5 = model.ActivePage;\n let matchResult_5, subModel_6;\n if (matchValue_5.tag === 1) {\n if (matchValue_5.fields[0].tag === 0) {\n matchResult_5 = 0;\n subModel_6 = matchValue_5.fields[0].fields[0];\n }\n else {\n matchResult_5 = 1;\n }\n }\n else {\n matchResult_5 = 1;\n }\n switch (matchResult_5) {\n case 0: {\n let patternInput_2;\n let tupledArg_17;\n let tupledArg_16;\n const tupledArg_15 = ViewProfile_update(subMsg_6, subModel_6);\n tupledArg_16 = Tuple_mapFirst((arg_5) => (new Page(1, [new SessionPage(0, [arg_5])])), tupledArg_15[0], tupledArg_15[1]);\n tupledArg_17 = Tuple_mapFirst((page_5) => (new Model(model.CurrentRoute, page_5, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_16[0], tupledArg_16[1]);\n patternInput_2 = Tuple_mapSecond((cmd_9) => Cmd_map((Item_19) => (new Msg(14, [Item_19])), cmd_9), tupledArg_17[0], tupledArg_17[1]);\n const subModel1 = patternInput_2[0];\n const cmd_10 = patternInput_2[1];\n switch (subMsg_6.tag) {\n case 5:\n return [subModel1, Cmd_batch(ofArray([singleton((dispatch_1) => {\n dispatch_1(new Msg(6, [subMsg_6.fields[0]]));\n }), cmd_10]))];\n case 4:\n return [subModel1, Cmd_batch(ofArray([singleton((dispatch_2) => {\n dispatch_2(new Msg(4, []));\n }), cmd_10]))];\n default:\n return [subModel1, cmd_10];\n }\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 15: {\n const subMsg_7 = msg.fields[0];\n const matchValue_6 = model.ActivePage;\n let matchResult_6, subModel_7;\n if (matchValue_6.tag === 1) {\n if (matchValue_6.fields[0].tag === 1) {\n matchResult_6 = 0;\n subModel_7 = matchValue_6.fields[0].fields[0];\n }\n else {\n matchResult_6 = 1;\n }\n }\n else {\n matchResult_6 = 1;\n }\n switch (matchResult_6) {\n case 0: {\n let patternInput_3;\n let tupledArg_20;\n let tupledArg_19;\n const tupledArg_18 = AddEditProfile_update(subMsg_7, subModel_7);\n tupledArg_19 = Tuple_mapFirst((arg_6) => (new Page(1, [new SessionPage(1, [arg_6])])), tupledArg_18[0], tupledArg_18[1]);\n tupledArg_20 = Tuple_mapFirst((page_6) => (new Model(model.CurrentRoute, page_6, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_19[0], tupledArg_19[1]);\n patternInput_3 = Tuple_mapSecond((cmd_11) => Cmd_map((Item_22) => (new Msg(15, [Item_22])), cmd_11), tupledArg_20[0], tupledArg_20[1]);\n const subModel1_1 = patternInput_3[0];\n const cmd_12 = patternInput_3[1];\n switch (subMsg_7.tag) {\n case 3:\n case 4:\n return [subModel1_1, Cmd_batch(ofArray([singleton((dispatch_3) => {\n dispatch_3(new Msg(4, []));\n }), cmd_12]))];\n default:\n return [subModel1_1, cmd_12];\n }\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 16: {\n const matchValue_7 = model.ActivePage;\n let matchResult_7, subModel_8;\n if (matchValue_7.tag === 1) {\n if (matchValue_7.fields[0].tag === 2) {\n matchResult_7 = 0;\n subModel_8 = matchValue_7.fields[0].fields[0];\n }\n else {\n matchResult_7 = 1;\n }\n }\n else {\n matchResult_7 = 1;\n }\n switch (matchResult_7) {\n case 0: {\n let tupledArg_23;\n let tupledArg_22;\n const tupledArg_21 = update_7(model.Session, msg.fields[0], subModel_8);\n tupledArg_22 = Tuple_mapFirst((arg_7) => (new Page(1, [new SessionPage(2, [arg_7])])), tupledArg_21[0], tupledArg_21[1]);\n tupledArg_23 = Tuple_mapFirst((page_7) => (new Model(model.CurrentRoute, page_7, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_22[0], tupledArg_22[1]);\n return Tuple_mapSecond((cmd_13) => Cmd_map((Item_25) => (new Msg(16, [Item_25])), cmd_13), tupledArg_23[0], tupledArg_23[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 17: {\n const matchValue_8 = model.ActivePage;\n let matchResult_8, subModel_9;\n if (matchValue_8.tag === 1) {\n if (matchValue_8.fields[0].tag === 4) {\n matchResult_8 = 0;\n subModel_9 = matchValue_8.fields[0].fields[0];\n }\n else {\n matchResult_8 = 1;\n }\n }\n else {\n matchResult_8 = 1;\n }\n switch (matchResult_8) {\n case 0: {\n let tupledArg_26;\n let tupledArg_25;\n const tupledArg_24 = DiaryEditingView$1__Update(diaryEditing, model.Session, msg.fields[0], subModel_9);\n tupledArg_25 = Tuple_mapFirst((arg_8) => (new Page(1, [new SessionPage(4, [arg_8])])), tupledArg_24[0], tupledArg_24[1]);\n tupledArg_26 = Tuple_mapFirst((page_8) => (new Model(model.CurrentRoute, page_8, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_25[0], tupledArg_25[1]);\n return Tuple_mapSecond((cmd_14) => Cmd_map((Item_28) => (new Msg(17, [Item_28])), cmd_14), tupledArg_26[0], tupledArg_26[1]);\n }\n default: {\n console.warn(some(\"WARN: AddEditDiaryMsg: Not on a AddEditDiary page\"));\n return [model, Cmd_none()];\n }\n }\n }\n case 18: {\n const matchValue_9 = model.ActivePage;\n let matchResult_9, subModel_10;\n if (matchValue_9.tag === 1) {\n if (matchValue_9.fields[0].tag === 5) {\n matchResult_9 = 0;\n subModel_10 = matchValue_9.fields[0].fields[0];\n }\n else {\n matchResult_9 = 1;\n }\n }\n else {\n matchResult_9 = 1;\n }\n switch (matchResult_9) {\n case 0: {\n let tupledArg_29;\n let tupledArg_28;\n const tupledArg_27 = DiaryEditingView$1__Update(reviewEditing, model.Session, msg.fields[0], subModel_10);\n tupledArg_28 = Tuple_mapFirst((arg_9) => (new Page(1, [new SessionPage(5, [arg_9])])), tupledArg_27[0], tupledArg_27[1]);\n tupledArg_29 = Tuple_mapFirst((page_9) => (new Model(model.CurrentRoute, page_9, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_28[0], tupledArg_28[1]);\n return Tuple_mapSecond((cmd_15) => Cmd_map((Item_31) => (new Msg(18, [Item_31])), cmd_15), tupledArg_29[0], tupledArg_29[1]);\n }\n default: {\n console.warn(some(\"WARN: AddEditReviewMsg: Not on a AddEditReview page\"));\n return [model, Cmd_none()];\n }\n }\n }\n case 19: {\n const matchValue_10 = model.ActivePage;\n let matchResult_10, subModel_11;\n if (matchValue_10.tag === 1) {\n if (matchValue_10.fields[0].tag === 6) {\n matchResult_10 = 0;\n subModel_11 = matchValue_10.fields[0].fields[0];\n }\n else {\n matchResult_10 = 1;\n }\n }\n else {\n matchResult_10 = 1;\n }\n switch (matchResult_10) {\n case 0: {\n let tupledArg_32;\n let tupledArg_31;\n const tupledArg_30 = DiaryEditingView$1__Update(interactionEditing, model.Session, msg.fields[0], subModel_11);\n tupledArg_31 = Tuple_mapFirst((arg_10) => (new Page(1, [new SessionPage(6, [arg_10])])), tupledArg_30[0], tupledArg_30[1]);\n tupledArg_32 = Tuple_mapFirst((page_10) => (new Model(model.CurrentRoute, page_10, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_31[0], tupledArg_31[1]);\n return Tuple_mapSecond((cmd_16) => Cmd_map((Item_34) => (new Msg(19, [Item_34])), cmd_16), tupledArg_32[0], tupledArg_32[1]);\n }\n default: {\n console.warn(some(\"WARN: AddEditInteractionMsg: Not on a AddEditInteraction page\"));\n return [model, Cmd_none()];\n }\n }\n }\n case 20: {\n const matchValue_11 = model.ActivePage;\n let matchResult_11, subModel_12;\n if (matchValue_11.tag === 1) {\n if (matchValue_11.fields[0].tag === 3) {\n matchResult_11 = 0;\n subModel_12 = matchValue_11.fields[0].fields[0];\n }\n else {\n matchResult_11 = 1;\n }\n }\n else {\n matchResult_11 = 1;\n }\n switch (matchResult_11) {\n case 0: {\n let tupledArg_35;\n let tupledArg_34;\n const tupledArg_33 = update_8(model.Session, msg.fields[0], subModel_12);\n tupledArg_34 = Tuple_mapFirst((arg_11) => (new Page(1, [new SessionPage(3, [arg_11])])), tupledArg_33[0], tupledArg_33[1]);\n tupledArg_35 = Tuple_mapFirst((page_11) => (new Model(model.CurrentRoute, page_11, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_34[0], tupledArg_34[1]);\n return Tuple_mapSecond((cmd_17) => Cmd_map((Item_37) => (new Msg(20, [Item_37])), cmd_17), tupledArg_35[0], tupledArg_35[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 21: {\n const matchValue_12 = model.ActivePage;\n let matchResult_12, subModel_13;\n if (matchValue_12.tag === 1) {\n if (matchValue_12.fields[0].tag === 7) {\n matchResult_12 = 0;\n subModel_13 = matchValue_12.fields[0].fields[0];\n }\n else {\n matchResult_12 = 1;\n }\n }\n else {\n matchResult_12 = 1;\n }\n switch (matchResult_12) {\n case 0: {\n let tupledArg_38;\n let tupledArg_37;\n const tupledArg_36 = PhysicalView_update(model.Session)(msg.fields[0])(subModel_13);\n tupledArg_37 = Tuple_mapFirst((arg_12) => (new Page(1, [new SessionPage(7, [arg_12])])), tupledArg_36[0], tupledArg_36[1]);\n tupledArg_38 = Tuple_mapFirst((page_12) => (new Model(model.CurrentRoute, page_12, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_37[0], tupledArg_37[1]);\n return Tuple_mapSecond((cmd_18) => Cmd_map((Item_40) => (new Msg(21, [Item_40])), cmd_18), tupledArg_38[0], tupledArg_38[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 22: {\n const matchValue_13 = model.ActivePage;\n let matchResult_13, subModel_14;\n if (matchValue_13.tag === 1) {\n if (matchValue_13.fields[0].tag === 9) {\n matchResult_13 = 0;\n subModel_14 = matchValue_13.fields[0].fields[0];\n }\n else {\n matchResult_13 = 1;\n }\n }\n else {\n matchResult_13 = 1;\n }\n switch (matchResult_13) {\n case 0: {\n let tupledArg_41;\n let tupledArg_40;\n const tupledArg_39 = BodilyFunctionsView_update(model.Session)(msg.fields[0])(subModel_14);\n tupledArg_40 = Tuple_mapFirst((arg_13) => (new Page(1, [new SessionPage(9, [arg_13])])), tupledArg_39[0], tupledArg_39[1]);\n tupledArg_41 = Tuple_mapFirst((page_13) => (new Model(model.CurrentRoute, page_13, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_40[0], tupledArg_40[1]);\n return Tuple_mapSecond((cmd_19) => Cmd_map((Item_43) => (new Msg(22, [Item_43])), cmd_19), tupledArg_41[0], tupledArg_41[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 23: {\n const matchValue_14 = model.ActivePage;\n let matchResult_14, subModel_15;\n if (matchValue_14.tag === 1) {\n if (matchValue_14.fields[0].tag === 8) {\n matchResult_14 = 0;\n subModel_15 = matchValue_14.fields[0].fields[0];\n }\n else {\n matchResult_14 = 1;\n }\n }\n else {\n matchResult_14 = 1;\n }\n switch (matchResult_14) {\n case 0: {\n let tupledArg_44;\n let tupledArg_43;\n const tupledArg_42 = WeightView_update(model.Session)(msg.fields[0])(subModel_15);\n tupledArg_43 = Tuple_mapFirst((arg_14) => (new Page(1, [new SessionPage(8, [arg_14])])), tupledArg_42[0], tupledArg_42[1]);\n tupledArg_44 = Tuple_mapFirst((page_14) => (new Model(model.CurrentRoute, page_14, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_43[0], tupledArg_43[1]);\n return Tuple_mapSecond((cmd_20) => Cmd_map((Item_46) => (new Msg(23, [Item_46])), cmd_20), tupledArg_44[0], tupledArg_44[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 24: {\n const matchValue_15 = model.ActivePage;\n let matchResult_15, subModel_16;\n if (matchValue_15.tag === 1) {\n if (matchValue_15.fields[0].tag === 10) {\n matchResult_15 = 0;\n subModel_16 = matchValue_15.fields[0].fields[0];\n }\n else {\n matchResult_15 = 1;\n }\n }\n else {\n matchResult_15 = 1;\n }\n switch (matchResult_15) {\n case 0: {\n let tupledArg_47;\n let tupledArg_46;\n const tupledArg_45 = Physical_PhysicalView$1__Update(Physical_weightEditing, model.Session, msg.fields[0], subModel_16);\n tupledArg_46 = Tuple_mapFirst((arg_15) => (new Page(1, [new SessionPage(10, [arg_15])])), tupledArg_45[0], tupledArg_45[1]);\n tupledArg_47 = Tuple_mapFirst((page_15) => (new Model(model.CurrentRoute, page_15, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_46[0], tupledArg_46[1]);\n return Tuple_mapSecond((cmd_21) => Cmd_map((Item_49) => (new Msg(24, [Item_49])), cmd_21), tupledArg_47[0], tupledArg_47[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 25: {\n const matchValue_16 = model.ActivePage;\n let matchResult_16, subModel_17;\n if (matchValue_16.tag === 1) {\n if (matchValue_16.fields[0].tag === 11) {\n matchResult_16 = 0;\n subModel_17 = matchValue_16.fields[0].fields[0];\n }\n else {\n matchResult_16 = 1;\n }\n }\n else {\n matchResult_16 = 1;\n }\n switch (matchResult_16) {\n case 0: {\n let tupledArg_50;\n let tupledArg_49;\n const tupledArg_48 = Physical_PhysicalView$1__Update(Physical_bloodPressureEditing, model.Session, msg.fields[0], subModel_17);\n tupledArg_49 = Tuple_mapFirst((arg_16) => (new Page(1, [new SessionPage(11, [arg_16])])), tupledArg_48[0], tupledArg_48[1]);\n tupledArg_50 = Tuple_mapFirst((page_16) => (new Model(model.CurrentRoute, page_16, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_49[0], tupledArg_49[1]);\n return Tuple_mapSecond((cmd_22) => Cmd_map((Item_52) => (new Msg(25, [Item_52])), cmd_22), tupledArg_50[0], tupledArg_50[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 26: {\n const matchValue_17 = model.ActivePage;\n let matchResult_17, subModel_18;\n if (matchValue_17.tag === 1) {\n if (matchValue_17.fields[0].tag === 12) {\n matchResult_17 = 0;\n subModel_18 = matchValue_17.fields[0].fields[0];\n }\n else {\n matchResult_17 = 1;\n }\n }\n else {\n matchResult_17 = 1;\n }\n switch (matchResult_17) {\n case 0: {\n let tupledArg_53;\n let tupledArg_52;\n const tupledArg_51 = Physical_PhysicalView$1__Update(Physical_bodilyFunctionsEditing, model.Session, msg.fields[0], subModel_18);\n tupledArg_52 = Tuple_mapFirst((arg_17) => (new Page(1, [new SessionPage(12, [arg_17])])), tupledArg_51[0], tupledArg_51[1]);\n tupledArg_53 = Tuple_mapFirst((page_17) => (new Model(model.CurrentRoute, page_17, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_52[0], tupledArg_52[1]);\n return Tuple_mapSecond((cmd_23) => Cmd_map((Item_55) => (new Msg(26, [Item_55])), cmd_23), tupledArg_53[0], tupledArg_53[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 27: {\n const matchValue_18 = model.ActivePage;\n let matchResult_18, subModel_19;\n if (matchValue_18.tag === 1) {\n if (matchValue_18.fields[0].tag === 13) {\n matchResult_18 = 0;\n subModel_19 = matchValue_18.fields[0].fields[0];\n }\n else {\n matchResult_18 = 1;\n }\n }\n else {\n matchResult_18 = 1;\n }\n switch (matchResult_18) {\n case 0: {\n let tupledArg_56;\n let tupledArg_55;\n const tupledArg_54 = Physical_PhysicalView$1__Update(Physical_temperatureEditing, model.Session, msg.fields[0], subModel_19);\n tupledArg_55 = Tuple_mapFirst((arg_18) => (new Page(1, [new SessionPage(13, [arg_18])])), tupledArg_54[0], tupledArg_54[1]);\n tupledArg_56 = Tuple_mapFirst((page_18) => (new Model(model.CurrentRoute, page_18, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_55[0], tupledArg_55[1]);\n return Tuple_mapSecond((cmd_24) => Cmd_map((Item_58) => (new Msg(27, [Item_58])), cmd_24), tupledArg_56[0], tupledArg_56[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 28: {\n const matchValue_19 = model.ActivePage;\n let matchResult_19, subModel_20;\n if (matchValue_19.tag === 1) {\n if (matchValue_19.fields[0].tag === 14) {\n matchResult_19 = 0;\n subModel_20 = matchValue_19.fields[0].fields[0];\n }\n else {\n matchResult_19 = 1;\n }\n }\n else {\n matchResult_19 = 1;\n }\n switch (matchResult_19) {\n case 0: {\n let tupledArg_59;\n let tupledArg_58;\n const tupledArg_57 = Main_update(model.Session, msg.fields[0], subModel_20);\n tupledArg_58 = Tuple_mapFirst((arg_19) => (new Page(1, [new SessionPage(14, [arg_19])])), tupledArg_57[0], tupledArg_57[1]);\n tupledArg_59 = Tuple_mapFirst((page_19) => (new Model(model.CurrentRoute, page_19, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_58[0], tupledArg_58[1]);\n return Tuple_mapSecond((cmd_25) => Cmd_map((Item_61) => (new Msg(28, [Item_61])), cmd_25), tupledArg_59[0], tupledArg_59[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 29: {\n const matchValue_20 = model.ActivePage;\n let matchResult_20, subModel_21;\n if (matchValue_20.tag === 1) {\n if (matchValue_20.fields[0].tag === 15) {\n matchResult_20 = 0;\n subModel_21 = matchValue_20.fields[0].fields[0];\n }\n else {\n matchResult_20 = 1;\n }\n }\n else {\n matchResult_20 = 1;\n }\n switch (matchResult_20) {\n case 0: {\n let tupledArg_62;\n let tupledArg_61;\n const tupledArg_60 = update_9(model.Session, msg.fields[0], subModel_21);\n tupledArg_61 = Tuple_mapFirst((arg_20) => (new Page(1, [new SessionPage(15, [arg_20])])), tupledArg_60[0], tupledArg_60[1]);\n tupledArg_62 = Tuple_mapFirst((page_20) => (new Model(model.CurrentRoute, page_20, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_61[0], tupledArg_61[1]);\n return Tuple_mapSecond((cmd_26) => Cmd_map((Item_64) => (new Msg(29, [Item_64])), cmd_26), tupledArg_62[0], tupledArg_62[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 30: {\n const matchValue_21 = model.ActivePage;\n let matchResult_21, subModel_22;\n if (matchValue_21.tag === 1) {\n if (matchValue_21.fields[0].tag === 16) {\n matchResult_21 = 0;\n subModel_22 = matchValue_21.fields[0].fields[0];\n }\n else {\n matchResult_21 = 1;\n }\n }\n else {\n matchResult_21 = 1;\n }\n switch (matchResult_21) {\n case 0: {\n let tupledArg_65;\n let tupledArg_64;\n const tupledArg_63 = update_10(model.Session, msg.fields[0], subModel_22);\n tupledArg_64 = Tuple_mapFirst((arg_21) => (new Page(1, [new SessionPage(16, [arg_21])])), tupledArg_63[0], tupledArg_63[1]);\n tupledArg_65 = Tuple_mapFirst((page_21) => (new Model(model.CurrentRoute, page_21, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_64[0], tupledArg_64[1]);\n return Tuple_mapSecond((cmd_27) => Cmd_map((Item_67) => (new Msg(30, [Item_67])), cmd_27), tupledArg_65[0], tupledArg_65[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 31: {\n const matchValue_22 = model.ActivePage;\n let matchResult_22, subModel_23;\n if (matchValue_22.tag === 1) {\n if (matchValue_22.fields[0].tag === 17) {\n matchResult_22 = 0;\n subModel_23 = matchValue_22.fields[0].fields[0];\n }\n else {\n matchResult_22 = 1;\n }\n }\n else {\n matchResult_22 = 1;\n }\n switch (matchResult_22) {\n case 0: {\n let tupledArg_68;\n let tupledArg_67;\n const tupledArg_66 = Main_update_1(model.Session, msg.fields[0], subModel_23);\n tupledArg_67 = Tuple_mapFirst((arg_22) => (new Page(1, [new SessionPage(17, [arg_22])])), tupledArg_66[0], tupledArg_66[1]);\n tupledArg_68 = Tuple_mapFirst((page_22) => (new Model(model.CurrentRoute, page_22, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_67[0], tupledArg_67[1]);\n return Tuple_mapSecond((cmd_28) => Cmd_map((Item_70) => (new Msg(31, [Item_70])), cmd_28), tupledArg_68[0], tupledArg_68[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 32: {\n const matchValue_23 = model.ActivePage;\n let matchResult_23, subModel_24;\n if (matchValue_23.tag === 1) {\n if (matchValue_23.fields[0].tag === 18) {\n matchResult_23 = 0;\n subModel_24 = matchValue_23.fields[0].fields[0];\n }\n else {\n matchResult_23 = 1;\n }\n }\n else {\n matchResult_23 = 1;\n }\n switch (matchResult_23) {\n case 0: {\n let tupledArg_71;\n let tupledArg_70;\n const tupledArg_69 = Workouts_update(model.Session, msg.fields[0], subModel_24);\n tupledArg_70 = Tuple_mapFirst((arg_23) => (new Page(1, [new SessionPage(18, [arg_23])])), tupledArg_69[0], tupledArg_69[1]);\n tupledArg_71 = Tuple_mapFirst((page_23) => (new Model(model.CurrentRoute, page_23, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_70[0], tupledArg_70[1]);\n return Tuple_mapSecond((cmd_29) => Cmd_map((Item_73) => (new Msg(32, [Item_73])), cmd_29), tupledArg_71[0], tupledArg_71[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 33: {\n const matchValue_24 = model.ActivePage;\n let matchResult_24, subModel_25;\n if (matchValue_24.tag === 1) {\n if (matchValue_24.fields[0].tag === 19) {\n matchResult_24 = 0;\n subModel_25 = matchValue_24.fields[0].fields[0];\n }\n else {\n matchResult_24 = 1;\n }\n }\n else {\n matchResult_24 = 1;\n }\n switch (matchResult_24) {\n case 0: {\n let tupledArg_74;\n let tupledArg_73;\n const tupledArg_72 = Exercises_update(model.Session, msg.fields[0], subModel_25);\n tupledArg_73 = Tuple_mapFirst((arg_24) => (new Page(1, [new SessionPage(19, [arg_24])])), tupledArg_72[0], tupledArg_72[1]);\n tupledArg_74 = Tuple_mapFirst((page_24) => (new Model(model.CurrentRoute, page_24, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_73[0], tupledArg_73[1]);\n return Tuple_mapSecond((cmd_30) => Cmd_map((Item_76) => (new Msg(33, [Item_76])), cmd_30), tupledArg_74[0], tupledArg_74[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 34: {\n const matchValue_25 = model.ActivePage;\n let matchResult_25, subModel_26;\n if (matchValue_25.tag === 1) {\n if (matchValue_25.fields[0].tag === 20) {\n matchResult_25 = 0;\n subModel_26 = matchValue_25.fields[0].fields[0];\n }\n else {\n matchResult_25 = 1;\n }\n }\n else {\n matchResult_25 = 1;\n }\n switch (matchResult_25) {\n case 0: {\n let tupledArg_77;\n let tupledArg_76;\n const tupledArg_75 = TrainingPlan_update(model.Session, msg.fields[0], subModel_26);\n tupledArg_76 = Tuple_mapFirst((arg_25) => (new Page(1, [new SessionPage(20, [arg_25])])), tupledArg_75[0], tupledArg_75[1]);\n tupledArg_77 = Tuple_mapFirst((page_25) => (new Model(model.CurrentRoute, page_25, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_76[0], tupledArg_76[1]);\n return Tuple_mapSecond((cmd_31) => Cmd_map((Item_79) => (new Msg(34, [Item_79])), cmd_31), tupledArg_77[0], tupledArg_77[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 35: {\n const matchValue_26 = model.ActivePage;\n let matchResult_26, subModel_27;\n if (matchValue_26.tag === 1) {\n if (matchValue_26.fields[0].tag === 21) {\n matchResult_26 = 0;\n subModel_27 = matchValue_26.fields[0].fields[0];\n }\n else {\n matchResult_26 = 1;\n }\n }\n else {\n matchResult_26 = 1;\n }\n switch (matchResult_26) {\n case 0: {\n let tupledArg_80;\n let tupledArg_79;\n const tupledArg_78 = SimpleFormView$2__Update(trainingPlanEditing, model.Session, msg.fields[0], subModel_27);\n tupledArg_79 = Tuple_mapFirst((arg_26) => (new Page(1, [new SessionPage(21, [arg_26])])), tupledArg_78[0], tupledArg_78[1]);\n tupledArg_80 = Tuple_mapFirst((page_26) => (new Model(model.CurrentRoute, page_26, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_79[0], tupledArg_79[1]);\n return Tuple_mapSecond((cmd_32) => Cmd_map((Item_82) => (new Msg(35, [Item_82])), cmd_32), tupledArg_80[0], tupledArg_80[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 36: {\n const matchValue_27 = model.ActivePage;\n let matchResult_27, subModel_28;\n if (matchValue_27.tag === 1) {\n if (matchValue_27.fields[0].tag === 22) {\n matchResult_27 = 0;\n subModel_28 = matchValue_27.fields[0].fields[0];\n }\n else {\n matchResult_27 = 1;\n }\n }\n else {\n matchResult_27 = 1;\n }\n switch (matchResult_27) {\n case 0: {\n let tupledArg_83;\n let tupledArg_82;\n const tupledArg_81 = Workout_update(model.Session, msg.fields[0], subModel_28);\n tupledArg_82 = Tuple_mapFirst((arg_27) => (new Page(1, [new SessionPage(22, [arg_27])])), tupledArg_81[0], tupledArg_81[1]);\n tupledArg_83 = Tuple_mapFirst((page_27) => (new Model(model.CurrentRoute, page_27, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_82[0], tupledArg_82[1]);\n return Tuple_mapSecond((cmd_33) => Cmd_map((Item_85) => (new Msg(36, [Item_85])), cmd_33), tupledArg_83[0], tupledArg_83[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 37: {\n const matchValue_28 = model.ActivePage;\n let matchResult_28, subModel_29;\n if (matchValue_28.tag === 1) {\n if (matchValue_28.fields[0].tag === 23) {\n matchResult_28 = 0;\n subModel_29 = matchValue_28.fields[0].fields[0];\n }\n else {\n matchResult_28 = 1;\n }\n }\n else {\n matchResult_28 = 1;\n }\n switch (matchResult_28) {\n case 0: {\n let tupledArg_86;\n let tupledArg_85;\n const tupledArg_84 = SimpleFormView$2__Update(workoutEditing, model.Session, msg.fields[0], subModel_29);\n tupledArg_85 = Tuple_mapFirst((arg_28) => (new Page(1, [new SessionPage(23, [arg_28])])), tupledArg_84[0], tupledArg_84[1]);\n tupledArg_86 = Tuple_mapFirst((page_28) => (new Model(model.CurrentRoute, page_28, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_85[0], tupledArg_85[1]);\n return Tuple_mapSecond((cmd_34) => Cmd_map((Item_88) => (new Msg(37, [Item_88])), cmd_34), tupledArg_86[0], tupledArg_86[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 38: {\n const matchValue_29 = model.ActivePage;\n let matchResult_29, subModel_30;\n if (matchValue_29.tag === 1) {\n if (matchValue_29.fields[0].tag === 24) {\n matchResult_29 = 0;\n subModel_30 = matchValue_29.fields[0].fields[0];\n }\n else {\n matchResult_29 = 1;\n }\n }\n else {\n matchResult_29 = 1;\n }\n switch (matchResult_29) {\n case 0: {\n let tupledArg_89;\n let tupledArg_88;\n const tupledArg_87 = Exercise_update(model.Session, msg.fields[0], subModel_30);\n tupledArg_88 = Tuple_mapFirst((arg_29) => (new Page(1, [new SessionPage(24, [arg_29])])), tupledArg_87[0], tupledArg_87[1]);\n tupledArg_89 = Tuple_mapFirst((page_29) => (new Model(model.CurrentRoute, page_29, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_88[0], tupledArg_88[1]);\n return Tuple_mapSecond((cmd_35) => Cmd_map((Item_91) => (new Msg(38, [Item_91])), cmd_35), tupledArg_89[0], tupledArg_89[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 39: {\n const matchValue_30 = model.ActivePage;\n let matchResult_30, subModel_31;\n if (matchValue_30.tag === 1) {\n if (matchValue_30.fields[0].tag === 25) {\n matchResult_30 = 0;\n subModel_31 = matchValue_30.fields[0].fields[0];\n }\n else {\n matchResult_30 = 1;\n }\n }\n else {\n matchResult_30 = 1;\n }\n switch (matchResult_30) {\n case 0: {\n let tupledArg_92;\n let tupledArg_91;\n const tupledArg_90 = SimpleFormView$2__Update(exerciseEditing, model.Session, msg.fields[0], subModel_31);\n tupledArg_91 = Tuple_mapFirst((arg_30) => (new Page(1, [new SessionPage(25, [arg_30])])), tupledArg_90[0], tupledArg_90[1]);\n tupledArg_92 = Tuple_mapFirst((page_30) => (new Model(model.CurrentRoute, page_30, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_91[0], tupledArg_91[1]);\n return Tuple_mapSecond((cmd_36) => Cmd_map((Item_94) => (new Msg(39, [Item_94])), cmd_36), tupledArg_92[0], tupledArg_92[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 40: {\n const matchValue_31 = model.ActivePage;\n let matchResult_31, subModel_32;\n if (matchValue_31.tag === 1) {\n if (matchValue_31.fields[0].tag === 26) {\n matchResult_31 = 0;\n subModel_32 = matchValue_31.fields[0].fields[0];\n }\n else {\n matchResult_31 = 1;\n }\n }\n else {\n matchResult_31 = 1;\n }\n switch (matchResult_31) {\n case 0: {\n let tupledArg_95;\n let tupledArg_94;\n const tupledArg_93 = ExerciseRecord_update(model.Session, msg.fields[0], subModel_32);\n tupledArg_94 = Tuple_mapFirst((arg_31) => (new Page(1, [new SessionPage(26, [arg_31])])), tupledArg_93[0], tupledArg_93[1]);\n tupledArg_95 = Tuple_mapFirst((page_31) => (new Model(model.CurrentRoute, page_31, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_94[0], tupledArg_94[1]);\n return Tuple_mapSecond((cmd_37) => Cmd_map((Item_97) => (new Msg(40, [Item_97])), cmd_37), tupledArg_95[0], tupledArg_95[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 41: {\n const subMsg_33 = msg.fields[0];\n const matchValue_32 = model.ActivePage;\n let matchResult_32, subModel_33;\n if (matchValue_32.tag === 1) {\n if (matchValue_32.fields[0].tag === 27) {\n matchResult_32 = 0;\n subModel_33 = matchValue_32.fields[0].fields[0];\n }\n else {\n matchResult_32 = 1;\n }\n }\n else {\n matchResult_32 = 1;\n }\n switch (matchResult_32) {\n case 0: {\n let patternInput_4;\n let tupledArg_98;\n let tupledArg_97;\n const tupledArg_96 = update_11(model.Session, subMsg_33, subModel_33);\n tupledArg_97 = Tuple_mapFirst((arg_32) => (new Page(1, [new SessionPage(27, [arg_32])])), tupledArg_96[0], tupledArg_96[1]);\n tupledArg_98 = Tuple_mapFirst((page_32) => (new Model(model.CurrentRoute, page_32, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_97[0], tupledArg_97[1]);\n patternInput_4 = Tuple_mapSecond((cmd_38) => Cmd_map((Item_100) => (new Msg(41, [Item_100])), cmd_38), tupledArg_98[0], tupledArg_98[1]);\n const resultModel = patternInput_4[0];\n const cmd_39 = patternInput_4[1];\n const matchValue_33 = getSetTimerMsg(subMsg_33);\n if (matchValue_33 != null) {\n const dateTime_1 = matchValue_33;\n return [resultModel, Cmd_batch(ofArray([cmd_39, singleton((dispatch_4) => {\n dispatch_4(new Msg(2, [new Msg_1(9, [dateTime_1])]));\n })]))];\n }\n else {\n return [resultModel, cmd_39];\n }\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 42: {\n const matchValue_34 = model.ActivePage;\n let matchResult_33, subModel_34;\n if (matchValue_34.tag === 1) {\n if (matchValue_34.fields[0].tag === 28) {\n matchResult_33 = 0;\n subModel_34 = matchValue_34.fields[0].fields[0];\n }\n else {\n matchResult_33 = 1;\n }\n }\n else {\n matchResult_33 = 1;\n }\n switch (matchResult_33) {\n case 0: {\n let tupledArg_101;\n let tupledArg_100;\n const tupledArg_99 = ExerciseRecordsMany_update(model.Session, msg.fields[0], subModel_34);\n tupledArg_100 = Tuple_mapFirst((arg_33) => (new Page(1, [new SessionPage(28, [arg_33])])), tupledArg_99[0], tupledArg_99[1]);\n tupledArg_101 = Tuple_mapFirst((page_33) => (new Model(model.CurrentRoute, page_33, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_100[0], tupledArg_100[1]);\n return Tuple_mapSecond((cmd_40) => Cmd_map((Item_103) => (new Msg(42, [Item_103])), cmd_40), tupledArg_101[0], tupledArg_101[1]);\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 43: {\n const subMsg_35 = msg.fields[0];\n const matchValue_35 = model.ActivePage;\n let matchResult_34, subModel_35;\n if (matchValue_35.tag === 1) {\n if (matchValue_35.fields[0].tag === 29) {\n matchResult_34 = 0;\n subModel_35 = matchValue_35.fields[0].fields[0];\n }\n else {\n matchResult_34 = 1;\n }\n }\n else {\n matchResult_34 = 1;\n }\n switch (matchResult_34) {\n case 0: {\n let patternInput_5;\n let tupledArg_104;\n let tupledArg_103;\n const tupledArg_102 = Workout_WorkoutEditView__Update(workoutRecordEditor, model.Session, subMsg_35, subModel_35);\n tupledArg_103 = Tuple_mapFirst((arg_34) => (new Page(1, [new SessionPage(29, [arg_34])])), tupledArg_102[0], tupledArg_102[1]);\n tupledArg_104 = Tuple_mapFirst((page_34) => (new Model(model.CurrentRoute, page_34, model.NavigationModel, model.Session, model.SessionLoading, model.LastSessionRefresh)), tupledArg_103[0], tupledArg_103[1]);\n patternInput_5 = Tuple_mapSecond((cmd_41) => Cmd_map((Item_106) => (new Msg(43, [Item_106])), cmd_41), tupledArg_104[0], tupledArg_104[1]);\n const resultModel_1 = patternInput_5[0];\n const cmd_42 = patternInput_5[1];\n if (subMsg_35.tag === 6) {\n const eventInfo = subMsg_35.fields[0];\n if (!Model$2__IsEditing(subModel_35)) {\n const newSession_2 = Session__SetActiveWorkoutRecord_Z2D8A2414(resultModel_1.Session, [eventInfo, (bind$0040_1 = subModel_35.Record, new WorkoutRecord(eventInfo.Id, bind$0040_1.WorkoutId, bind$0040_1.Progress, bind$0040_1.FinishTime, bind$0040_1.Notes))]);\n return [new Model(resultModel_1.CurrentRoute, resultModel_1.ActivePage, resultModel_1.NavigationModel, newSession_2, resultModel_1.SessionLoading, resultModel_1.LastSessionRefresh), Cmd_batch(ofArray([singleton((dispatch_5) => {\n dispatch_5(new Msg(2, [new Msg_1(3, [newSession_2])]));\n }), cmd_42]))];\n }\n else {\n return [resultModel_1, cmd_42];\n }\n }\n else {\n return [resultModel_1, cmd_42];\n }\n }\n default:\n return [model, Cmd_none()];\n }\n }\n case 8: {\n const subMsg_36 = msg.fields[0];\n const matchValue_36 = model.ActivePage;\n let matchResult_35, subModel_36, subModel_37;\n if (matchValue_36.tag === 1) {\n switch (matchValue_36.fields[0].tag) {\n case 4: {\n matchResult_35 = 0;\n break;\n }\n case 5: {\n matchResult_35 = 1;\n break;\n }\n case 6: {\n matchResult_35 = 2;\n break;\n }\n case 10: {\n matchResult_35 = 3;\n break;\n }\n case 11: {\n matchResult_35 = 4;\n break;\n }\n case 12: {\n matchResult_35 = 5;\n break;\n }\n case 13: {\n matchResult_35 = 6;\n break;\n }\n case 27: {\n matchResult_35 = 7;\n subModel_36 = matchValue_36.fields[0].fields[0];\n break;\n }\n case 28: {\n matchResult_35 = 8;\n subModel_37 = matchValue_36.fields[0].fields[0];\n break;\n }\n case 29: {\n matchResult_35 = 9;\n break;\n }\n default:\n matchResult_35 = 10;\n }\n }\n else {\n matchResult_35 = 10;\n }\n switch (matchResult_35) {\n case 0:\n return [model, singleton((dispatch_6) => {\n dispatch_6(new Msg(17, [new Msg$2(7, [subMsg_36])]));\n })];\n case 1:\n return [model, singleton((dispatch_7) => {\n dispatch_7(new Msg(18, [new Msg$2(7, [subMsg_36])]));\n })];\n case 2:\n return [model, singleton((dispatch_8) => {\n dispatch_8(new Msg(19, [new Msg$2(7, [subMsg_36])]));\n })];\n case 3:\n return [model, singleton((dispatch_9) => {\n dispatch_9(new Msg(24, [new Msg$2(7, [subMsg_36])]));\n })];\n case 4:\n return [model, singleton((dispatch_10) => {\n dispatch_10(new Msg(25, [new Msg$2(7, [subMsg_36])]));\n })];\n case 5:\n return [model, singleton((dispatch_11) => {\n dispatch_11(new Msg(26, [new Msg$2(7, [subMsg_36])]));\n })];\n case 6:\n return [model, singleton((dispatch_12) => {\n dispatch_12(new Msg(27, [new Msg$2(7, [subMsg_36])]));\n })];\n case 7: {\n const resMsg = mapModelToEIMMsg(subModel_36, subMsg_36);\n return [model, singleton((dispatch_13) => {\n dispatch_13(new Msg(41, [resMsg]));\n })];\n }\n case 8: {\n const resMsg_1 = ExerciseRecordsMany_mapModelToEIMMsg(subModel_37, subMsg_36);\n return [model, singleton((dispatch_14) => {\n dispatch_14(new Msg(42, [resMsg_1]));\n })];\n }\n case 9:\n return [model, singleton((dispatch_15) => {\n dispatch_15(new Msg(43, [new Msg$2(7, [subMsg_36])]));\n })];\n default: {\n console.warn(some(`WARN: AppEIMMsg on page=${model.ActivePage}: Not on any page that supports location`));\n return [model, Cmd_none()];\n }\n }\n }\n case 4:\n return [new Model(model.CurrentRoute, model.ActivePage, model.NavigationModel, model.Session, true, model.LastSessionRefresh), Cmd_OfAsyncWith_either((x_105) => {\n Cmd_OfAsync_start(x_105);\n }, anonService.GetAvailableUserInfo, undefined, (Item_107) => (new Msg(5, [Item_107])), (Item_108) => (new Msg(7, [Item_108])))];\n case 6:\n return refreshSession((bind$0040_2 = model.Session, new Session(bind$0040_2.LoggedIn, bind$0040_2.UserInfo, msg.fields[0])), model, true);\n case 5: {\n const info = msg.fields[0];\n return refreshSession((info.tag === 1) ? ((userInfo = info.fields[0], (common.updateConfiguration(userInfo.ClientConfigVariables), new Session(true, userInfo, undefined)))) : ((common.updateConfiguration(info.fields[0].ClientConfigVariables), new Session(false, undefined, undefined))), model, model.SessionLoading);\n }\n case 7: {\n console.error(some(msg.fields[0]));\n return [new Model(model.CurrentRoute, model.ActivePage, model.NavigationModel, model.Session, false, model.LastSessionRefresh), Cmd_none()];\n }\n default:\n return setRoute(msg.fields[0], model);\n }\n}\n\nfunction init(location) {\n const session = Session_get_Default();\n const patternInput = init_10(session);\n const patternInput_1 = setRoute(location, new Model(undefined, new Page(0, [new AnonymousPage(0, [Model_Default()])]), patternInput[0], session, true, common.getNow()));\n return [patternInput_1[0], Cmd_batch(ofArray([singleton((dispatch) => {\n dispatch(new Msg(4, []));\n }), patternInput_1[1], Cmd_map((Item) => (new Msg(2, [Item])), patternInput[1])]))];\n}\n\nfunction makeFluid(element) {\n return box$0027(empty(), singleton(element));\n}\n\nfunction lazyView2() {\n return (view_1) => Common_lazyView2(uncurry2(view_1));\n}\n\nfunction contentFromAuthPage(model, authPage, dispatch) {\n switch (authPage.tag) {\n case 1:\n return lazyView2()((model_2) => ((dispatch_2) => AddEditProfile_view(model_2, dispatch_2)))(authPage.fields[0])((arg_1) => {\n dispatch(new Msg(15, [arg_1]));\n });\n case 4:\n return lazyView2()((model_3) => ((dispatch_3) => DiaryEditingView$1__View(diaryEditing, model_3, dispatch_3)))(authPage.fields[0])((arg_2) => {\n dispatch(new Msg(17, [arg_2]));\n });\n case 5:\n return lazyView2()((model_4) => ((dispatch_4) => DiaryEditingView$1__View(reviewEditing, model_4, dispatch_4)))(authPage.fields[0])((arg_3) => {\n dispatch(new Msg(18, [arg_3]));\n });\n case 6:\n return lazyView2()((model_5) => ((dispatch_5) => DiaryEditingView$1__View(interactionEditing, model_5, dispatch_5)))(authPage.fields[0])((arg_4) => {\n dispatch(new Msg(19, [arg_4]));\n });\n case 2:\n return lazyView2()((model_6) => ((dispatch_6) => view_2(model.Session, model_6, dispatch_6)))(authPage.fields[0])((arg_5) => {\n dispatch(new Msg(16, [arg_5]));\n });\n case 3:\n return lazyView2()((model_7) => ((dispatch_7) => view_3(model_7, dispatch_7)))(authPage.fields[0])((arg_6) => {\n dispatch(new Msg(20, [arg_6]));\n });\n case 7:\n return PhysicalView_view(model.Session, authPage.fields[0], (arg_7) => {\n dispatch(new Msg(21, [arg_7]));\n });\n case 9:\n return BodilyFunctionsView_viewList(model.Session, authPage.fields[0], (arg_8) => {\n dispatch(new Msg(22, [arg_8]));\n });\n case 8:\n return WeightView_viewList(model.Session, authPage.fields[0], (arg_9) => {\n dispatch(new Msg(23, [arg_9]));\n });\n case 15:\n return view_4(authPage.fields[0], (arg_10) => {\n dispatch(new Msg(29, [arg_10]));\n });\n case 16:\n return view_5(authPage.fields[0], (arg_11) => {\n dispatch(new Msg(30, [arg_11]));\n });\n case 10:\n return Physical_PhysicalView$1__View(Physical_weightEditing, authPage.fields[0], (arg_12) => {\n dispatch(new Msg(24, [arg_12]));\n });\n case 11:\n return Physical_PhysicalView$1__View(Physical_bloodPressureEditing, authPage.fields[0], (arg_13) => {\n dispatch(new Msg(25, [arg_13]));\n });\n case 12:\n return Physical_PhysicalView$1__View(Physical_bodilyFunctionsEditing, authPage.fields[0], (arg_14) => {\n dispatch(new Msg(26, [arg_14]));\n });\n case 13:\n return Physical_PhysicalView$1__View(Physical_temperatureEditing, authPage.fields[0], (arg_15) => {\n dispatch(new Msg(27, [arg_15]));\n });\n case 14:\n return Main_view(model.Session, authPage.fields[0], (arg_16) => {\n dispatch(new Msg(28, [arg_16]));\n });\n case 17:\n return lazyView2()((model_12) => ((dispatch_12) => Main_view_1(model.Session, model_12, dispatch_12)))(authPage.fields[0])((arg_17) => {\n dispatch(new Msg(31, [arg_17]));\n });\n case 18:\n return lazyView2()((model_13) => ((dispatch_13) => Workouts_view(model_13, dispatch_13)))(authPage.fields[0])((arg_18) => {\n dispatch(new Msg(32, [arg_18]));\n });\n case 19:\n return lazyView2()((model_14) => ((dispatch_14) => Exercises_view(model_14, dispatch_14)))(authPage.fields[0])((arg_19) => {\n dispatch(new Msg(33, [arg_19]));\n });\n case 20:\n return lazyView2()((model_15) => ((dispatch_15) => TrainingPlan_view(model_15, dispatch_15)))(authPage.fields[0])((arg_20) => {\n dispatch(new Msg(34, [arg_20]));\n });\n case 21:\n return lazyView2()((model_16) => ((dispatch_16) => AddEditFitnessView$1__View(trainingPlanEditing, model.Session, model_16, dispatch_16)))(authPage.fields[0])((arg_21) => {\n dispatch(new Msg(35, [arg_21]));\n });\n case 22:\n return lazyView2()((model_17) => ((dispatch_17) => Workout_view(model.Session, model_17, dispatch_17)))(authPage.fields[0])((arg_22) => {\n dispatch(new Msg(36, [arg_22]));\n });\n case 23:\n return lazyView2()((model_18) => ((dispatch_18) => AddEditFitnessView$1__View(workoutEditing, model.Session, model_18, dispatch_18)))(authPage.fields[0])((arg_23) => {\n dispatch(new Msg(37, [arg_23]));\n });\n case 24:\n return lazyView2()((model_19) => ((dispatch_19) => Exercise_view(model.Session, model_19, dispatch_19)))(authPage.fields[0])((arg_24) => {\n dispatch(new Msg(38, [arg_24]));\n });\n case 25:\n return lazyView2()((model_20) => ((dispatch_20) => AddEditFitnessView$1__View(exerciseEditing, model.Session, model_20, dispatch_20)))(authPage.fields[0])((arg_25) => {\n dispatch(new Msg(39, [arg_25]));\n });\n case 26:\n return lazyView2()((model_21) => ((_dispatch) => ExerciseRecord_view(model.Session, model_21, _dispatch)))(authPage.fields[0])((arg_26) => {\n dispatch(new Msg(40, [arg_26]));\n });\n case 27:\n return lazyView2()((model_22) => ((dispatch_21) => view_6(model.Session, model_22, dispatch_21)))(authPage.fields[0])((arg_27) => {\n dispatch(new Msg(41, [arg_27]));\n });\n case 28:\n return lazyView2()((model_23) => ((dispatch_22) => ExerciseRecordsMany_view(model_23, dispatch_22)))(authPage.fields[0])((arg_28) => {\n dispatch(new Msg(42, [arg_28]));\n });\n case 29:\n return lazyView2()((model_24) => ((dispatch_23) => Workout_WorkoutEditView__View(workoutRecordEditor, model_24, dispatch_23)))(authPage.fields[0])((arg_29) => {\n dispatch(new Msg(43, [arg_29]));\n });\n default:\n return lazyView2()((model_1) => ((dispatch_1) => ViewProfile_view(model.Session, model_1, dispatch_1)))(authPage.fields[0])((arg) => {\n dispatch(new Msg(14, [arg]));\n });\n }\n}\n\nfunction contentFromPage(model, page, dispatch) {\n if (page.tag === 1) {\n if (model.Session.LoggedIn) {\n if (Session__GetCurrentProfile(model.Session) != null) {\n return contentFromAuthPage(model, page.fields[0], dispatch);\n }\n else {\n const children = singleton(createElement(\"p\", {\n children: [\"Stale session info, wait for the refresh to finish\"],\n }));\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children)),\n });\n }\n }\n else {\n const children_2 = ofArray([createElement(\"p\", {\n children: [\"Not logged in, cannot display the current page. Log in first please\"],\n }), createElement(\"a\", createObj(ofArray([Router_href(new Route(3, [])), [\"children\", \"Login page\"]])))]);\n return createElement(\"div\", {\n children: reactApi.Children.toArray(Array.from(children_2)),\n });\n }\n }\n else {\n switch (page.fields[0].tag) {\n case 1:\n return \"Page not found\";\n case 2:\n return view_7(page.fields[0].fields[0], (arg_1) => {\n dispatch(new Msg(11, [arg_1]));\n });\n case 3:\n return view_8(page.fields[0].fields[0], (arg_2) => {\n dispatch(new Msg(12, [arg_2]));\n });\n case 5:\n return view_9(page.fields[0].fields[0], (arg_3) => {\n dispatch(new Msg(13, [arg_3]));\n });\n case 4:\n return view_10(page.fields[0].fields[0], (arg_4) => {\n dispatch(new Msg(10, [arg_4]));\n });\n default:\n return view_11(model.Session, page.fields[0].fields[0], (arg) => {\n dispatch(new Msg(9, [arg]));\n });\n }\n }\n}\n\nfunction view(model, dispatch) {\n let elems;\n const elms = singleton(createElement(\"div\", createObj(Helpers_combineClasses(\"column\", ofArray([[\"className\", \"is-8\"], [\"className\", \"is-offset-2\"], (elems = toList(delay(() => append(singleton_1(lazyView2()((model_1) => ((dispatch_1) => view_12(model_1, dispatch_1)))(model.NavigationModel)((arg) => {\n dispatch(new Msg(2, [arg]));\n })), delay(() => append(model.SessionLoading ? singleton_1(\"Loading, please wait\") : singleton_1(renderCatchSimple(\"Error rendering\", makeFluid(contentFromPage(model, model.ActivePage, dispatch)))), delay(() => {\n let children;\n return singleton_1(footer(empty(), singleton(content(singleton(new Option(3, [singleton(new Modifier_IModifier(5, [new Screen(0, []), new TextAlignment_Option(0, [])]))])), singleton((children = ofArray([createElement(\"a\", createObj(ofArray([Router_href(new Route(7, [\"terms\"])), [\"children\", \"Terms & conditions\"]]))), \" | \", createElement(\"a\", createObj(ofArray([Router_href(new Route(7, [\"privacy\"])), [\"children\", \"Privacy\"]]))), \" | \", createElement(\"a\", createObj(ofArray([Router_href(new Route(8, [])), [\"children\", \"Contact\"]])))]), createElement(\"p\", {\n children: reactApi.Children.toArray(Array.from(children)),\n })))))));\n })))))), [\"children\", reactApi.Children.toArray(Array.from(elems))])])))));\n return createElement(\"div\", {\n className: \"columns\",\n children: reactApi.Children.toArray(Array.from(elms)),\n });\n}\n\nexport const timer = (dispatch) => {\n const intervalId = setInterval(() => {\n dispatch(new Msg(3, [common.getNow()]));\n }, 5000) | 0;\n return {\n Dispose() {\n console.debug(`Disposing of timer ${intervalId}`);\n clearInterval(intervalId);\n },\n };\n};\n\nconst subscribeLocation = (dispatch) => {\n subscribeLocation_1((arg) => {\n dispatch(new Msg(8, [arg]));\n });\n return {\n Dispose() {\n },\n };\n};\n\nfunction subscriptions(model) {\n const locationSub = [singleton(\"location\"), subscribeLocation];\n if (Model__NeedsTimer(model)) {\n return ofArray([locationSub, [singleton(\"timer\"), timer]]);\n }\n else {\n return singleton(locationSub);\n }\n}\n\nProgramModule_run(Program_withReactSynchronous(\"app-root\", ProgramModule_toNavigable((location_1) => parseHash(RouteModule_routeParser, location_1), setRoute, ProgramModule_withSubscription(subscriptions, ProgramModule_mkProgram(init, update, view)))));\n\n","import { Union } from \"../../fable-library-js.4.24.0/Types.js\";\nimport { Common_parseOptions, Common_GenericOptions__AddCaseName_1505, Common_GenericOptions__AddModifiers_Z7C3AFA3, Common_GenericOptions__AddProps_Z4E55E0BD, Color_ofColor, Common_GenericOptions__AddClass_Z721C83C5, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7, Modifier_IModifier_$reflection, Color_IColor_$reflection } from \"../Common.fs.js\";\nimport { union_type, list_type, class_type, string_type } from \"../../fable-library-js.4.24.0/Reflection.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\n\nexport class Option extends Union {\n constructor(tag, fields) {\n super();\n this.tag = tag;\n this.fields = fields;\n }\n cases() {\n return [\"is-bold\", \"is-medium\", \"is-large\", \"is-halfheight\", \"is-fullheight-with-navbar\", \"is-fullheight\", \"Color\", \"CustomClass\", \"Props\", \"Modifiers\"];\n }\n}\n\nexport function Option_$reflection() {\n return union_type(\"Fulma.Hero.Option\", [], Option, () => [[], [], [], [], [], [], [[\"Item\", Color_IColor_$reflection()]], [[\"Item\", string_type]], [[\"Item\", list_type(class_type(\"Fable.React.IHTMLProp\"))]], [[\"Item\", list_type(Modifier_IModifier_$reflection())]]]);\n}\n\n/**\n * Generate
\n */\nexport function hero(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, (result, option) => {\n switch (option.tag) {\n case 6:\n return Common_GenericOptions__AddClass_Z721C83C5(result, Color_ofColor(option.fields[0]));\n case 8:\n return Common_GenericOptions__AddProps_Z4E55E0BD(result, option.fields[0]);\n case 7:\n return Common_GenericOptions__AddClass_Z721C83C5(result, option.fields[0]);\n case 9:\n return Common_GenericOptions__AddModifiers_Z7C3AFA3(result, option.fields[0]);\n default:\n return Common_GenericOptions__AddCaseName_1505(result, option);\n }\n }, \"hero\"), (props_1, children_1) => react.createElement(\"div\", keyValueList(props_1, 1), ...children_1), children);\n}\n\n/**\n * Generate
\n */\nexport function head(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"hero-head\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate
\n */\nexport function body(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"hero-body\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate \n */\nexport function foot(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"hero-foot\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate
\n */\nexport function video(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"hero-video\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\n/**\n * Generate
\n */\nexport function buttons(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"hero-buttons\"), (props, children_1) => react.createElement(\"div\", keyValueList(props, 1), ...children_1), children);\n}\n\n","import { parseParams, parse } from \"../Fable.Elmish.UrlParser.1.0.2/parser.fs.js\";\nimport { substring } from \"../fable-library-js.4.24.0/String.js\";\nimport { empty } from \"../fable-library-js.4.24.0/Map.js\";\nimport { comparePrimitives } from \"../fable-library-js.4.24.0/Util.js\";\n\nexport function parsePath(parser, location) {\n return parse(parser, location.pathname, parseParams(location.search));\n}\n\nexport function parseHash(parser, location) {\n let patternInput;\n const hash = (location.hash.length > 1) ? substring(location.hash, 1) : \"\";\n const pos = hash.indexOf(\"?\") | 0;\n patternInput = ((pos >= 0) ? [substring(hash, 0, pos), parseParams(substring(hash, pos + 1))] : [hash, empty({\n Compare: comparePrimitives,\n })]);\n return parse(parser, patternInput[0], patternInput[1]);\n}\n\n","import { Common_parseOptions, Common_GenericOptions_Parse_Z4D1A7726, Common_GenericOptions__ToReactElement_4509C2D7 } from \"../Common.fs.js\";\nimport * as react from \"react\";\nimport { keyValueList } from \"../../fable-library-js.4.24.0/MapUtil.js\";\n\n/**\n * Generate \n */\nexport function footer(options, children) {\n return Common_GenericOptions__ToReactElement_4509C2D7(Common_GenericOptions_Parse_Z4D1A7726(options, Common_parseOptions, \"footer\"), (props, children_1) => react.createElement(\"footer\", keyValueList(props, 1), ...children_1), children);\n}\n\n"],"names":["isArrayLike","x","Array","isArray","ArrayBuffer","isView","isHashable","GetHashCode","disposeSafe","Dispose","isDisposable","sameConstructor","y","Object","getPrototypeOf","constructor","Symbol","iterator","Enumerator","iter","this","current","cur","next","value","done","Error","getEnumerator","e","GetEnumerator","toIterator","en","hasNext","undefined","Lazy","factory","isValueCreated","Value","createdValue","IsValueCreated","padWithZeros","i","length","toString","padStart","dateOffset","date","date1","offset","kind","getTimezoneOffset","int32ToString","radix","int64ToString","ObjectRef","id","o","idMap","has","set","count","get","stringHash","s","h","len","charCodeAt","numberHash","bigintHash","combineHashCodes","hashes","h1","dateHash","getTime","structuralHash","arrayHash","Date","values","map","v","safeHash","physicalHash","identityHash","equalArraysWith","eq","equalArrays","equals","Equals","isEquatable","compareDates","xKeys","keys","yKeys","sort","equalObjects","xtime","ytime","comparePrimitives","compareArrays","comp","j","compareArraysWith","compare","CompareTo","isComparable","key","compareObjects","createObj","fields","obj","kv","round","digits","arguments","m","Math","pow","n","toFixed","floor","f","r","WeakMap","curried","uncurry2","f2","a1","a2","curry2","curry3","a3","callStack","self","str","seqToString","cons","entries","_ref","k","join","name","String","Union","cases","tag","toJSON","concat","fieldStr","withParens","indexOf","unionToString","splice","other","Record","recordToJSON","_ref2","recordToString","recordGetHashCode","thisNames","recordEquals","result","recordCompareTo","FSharpRef","contents","getter","setter","contentsOrGetter","Exception","message","ensureErrorOrException","Promise","isPromise","P","MAX_DP","NAME","INVALID","INVALID_DP","INVALID_RM","DIV_BY_ZERO","UNDEFINED","NUMERIC","parse","nl","test","charAt","slice","replace","search","substring","c","Big","DP","RM","sd","rm","more","xc","isZero","findIndex","xci","idx","unshift","pop","stringify","doExponential","isNonzero","abs","cmp","isneg","yc","l","max","div","a","b","dp","bl","bt","ri","bz","ai","al","rl","q","qc","qi","p","push","shift","gt","gte","lt","lte","minus","sub","t","xlty","plus","xe","ye","reverse","mod","ygtx","times","add","one","prec","sqrt","half","toExponential","mul","NE","PE","toNumber","Number","strict","toPrecision","valueOf","_Big_","normalize","TypeError","prototype","symbol","isNumeric","multiply","BigInt","toHex","asUintN","Decimal","_this","get_Zero","get_One","get_MinusOne","op_Addition","op_Multiply","op_Division","setInt32Bits","hexDigits","bits","fromParts","low","mid","high","isNegative","scale","Uint8Array","bitSize","decDigits","hex","dec","decCount","d","carry","val","hexToDecimal","big","from","fromInt32","fromFloat64","trunc","toInt64","asIntN","toUInt64","toDecimal","shortDays","longDays","shortMonths","longMonths","parseRepeatToken","format","pos","patternChar","tokenLength","internalPos","parseNextChar","parseQuotedString","beginPos","quoteChar","foundQuote","currentChar","dateToStringWithCustomFormat","utc","cursorPos","localizedDate","DateTime","token","day","dayOfWeek","precision","millisecond","padEnd","hour","dateOffsetToString","minute","month","second","getHours","getFullYear","utcOffsetText","toLocalTime","sign","hours","parseInt","minutes","quotedString","quotedStringLenght","nextChar","fromCharCode","nextChar2","isMinus","dateToHalfUTCString","toISOString","_provider","dateWithOffset","dateToISOStringWithOffset","dateToStringWithOffset","toUTCString","toLocaleString","toLocaleDateString","toLocaleTimeString","printOffset","getMonth","getDate","getMinutes","getSeconds","getMilliseconds","dateToISOString","dateToStringWithKind","parseRaw","input","fail","trim","isNaN","exec","baseDate","timeInSeconds","timeParts","split","hourPart","parseFloat","toUpperCase","getUTCFullYear","getUTCMonth","getUTCDate","offsetInMinutes","detectUTC","create","year","ms","UTC","setUTCFullYear","setFullYear","dateValue","utcNow","now","toUniversalTime","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCSeconds","getUTCDay","getDay","ts","newDate","oldTzOffset","newTzOffset","addDays","d1","d2","op_Subtraction","that","pattern","options","flags","RegExp","escape","match","reg","startAt","lastIndex","matches","global","lastMatchIndex","index","fsFormatRegExp","formatRegExp","isLessThan","numericCompare","printf","cont","fsFormat","continuePrint","arg","toText","toFail","formatReplacement","rep","padLength","toLowerCase","dateToString","zeroFlag","minusFlag","ch","pad","createPrinter","_strParts","_matches","_result","padArg","strParts","_len2","args","_key2","_padLength","strIdx","matchIndex","_len3","_key3","str2","_","padLeft","intPart","decimalPart","repInt","repDecimal","rightZeros","padRight","thousandGroups","thousands","substr","isNullOrEmpty","isNullOrWhiteSpace","delimiter","xs","fromBase64String","b64Encoded","binary","atob","notSupported","bytes","isRight","replicate","initialize","getCharAtIndex","splitters","removeEmpty","filter","splits","findSplits","candidate","trimStart","_len6","chars","_key6","trimEnd","_len7","_key7","startIndex","Some","unwrap","opt","some","defaultArg","defaultValue","mapping","SR_indexOutOfBounds","SR_inputWasEmpty","SR_inputMustBeNonNegative","SR_notEnoughElements","Helpers_allocateArrayFromCons","tryParse","defValue","min","indexNotFound","fill","target","targetIndex","start","last","array","item_2","mapIndexed","source","setItem_1","arrays","arrays_1","totalIdx","totalLength","idx_1","arr_2","take","find","predicate","matchValue","value_2","tryFind","zip","array1","array2","differentLengths","equalsWith","length1","length2","head","tryHead","item","setItem","updateAt","FSharpList","tail","super","loop","xs_1_mut","ys_1_mut","xs_1","ys_1","matchValue_1","xt","value_1","yt","i_mut","h_mut","ListEnumerator$1","it","FSharpList_get_Empty","FSharpList_Cons_305B8EAC","FSharpList__get_IsEmpty","FSharpList__get_Length","FSharpList__get_Head","FSharpList__get_Tail","empty","singleton","isEmpty","xs_mut","tryLast","toArray","res","fold","folder","state","acc","iterate","action","unitVar","ofArrayWithTail","tail_1","item_1","ofArray","ofSeq","xs_3","root","node","enumerator","xs_5","t_2","lists","forEach","xs_6","append","ys","collect","zs","acc_mut","foldIndexed","tryPick","tryFindIndex","FSharpList__get_Item_Z524259A4","partition","root2","root1","patternInput_1","tupledArg","lacc","racc","t_4","t_5","choose","contains","xs_2","reduce","forAll","exists","fold2","map2","sortWith","comparer","arr","Compare","sortBy","projection","sum","adder","Add","GetZero","skip","count_mut","skipWhile","predicate_mut","takeWhile","splitAt","FSharpResult$2_Error","ErrorValue","FSharpResult$2","Result_Map","ResultValue","Result_Bind","binder","Enumerator_notStarted","Enumerator_alreadyFinished","Enumerator_Seq","Enumerator_FromFunctions$1","dispose","Enumerator_noReset","Enumerator_FromFunctions$1_$ctor_58C54629","Enumerator_generateWhileSome","openf","compute","closef","curr","started","x_1","finish","mkSeq","Enumerator_Seq_$ctor_673A07F2","argName","Operators_NullArg","checkNonNull","delay","generator","sources","outerOpt","innerOpt","finished","inner","outer","copyOfStruct","outerOpt_1","inner_1","outer_1","Enumerator_concat","ar","singleton_1","toArray_1","toList","ofArray_1","ofSeq_1","generate","generateIndexed","chooser","e_1","found","tryHead_1","tryHead_2","iterateIndexed","length_1","Enumerator_enumerateThenFinally","e1","e2","tupledArg_1","MapTreeLeaf$2","MapTreeLeaf$2_$ctor_5BDDA1","MapTreeLeaf$2__get_Key","MapTreeLeaf$2__get_Value","MapTreeNode$2","left","right","MapTreeNode$2_$ctor_Z39DE9543","MapTreeNode$2__get_Left","MapTreeNode$2__get_Right","MapTreeNode$2__get_Height","MapTreeModule_sizeAux","m_mut","m2","mn","MapTreeModule_size","MapTreeModule_mk","mn_1","hl","hr","m2_1","m_2","MapTreeModule_rebalance","t1","t2","m2_2","mn_2","m_3","m2_3","mn_3","t1h","t2h","t2$0027","t2l","matchValue_2","t1$0027","matchValue_3","t1r","MapTreeModule_add","MapTreeModule_empty","MapTreeModule_tryFind","comparer_mut","k_mut","MapTreeModule_iterOpt","f_mut","MapTreeModule_iter","MapTreeModule_mapiOpt","l2","v2","r2","MapTreeModule_mapi","MapTreeModule_copyToArray","MapTreeModule_toArray","MapTreeModule_ofSeq","forLoopVar","MapTreeModule_ofArray","fold_1","MapTreeModule_ofList","ie","e_mut","patternInput","MapTreeModule_mkFromEnumerator","MapTreeModule_MapIterator$2","stack","MapTreeModule_collapseLHS","stack_mut","isEmpty_1","empty_1","rest","MapTreeModule_mkIterator","MapTreeModule_current","MapTreeModule_alreadyFinished","MapTreeModule_notStarted","MapTreeModule_mkIEnumerator","System.Collections.Generic.IEnumerator`1.get_Current","System.Collections.IEnumerator.get_Current","System.Collections.IEnumerator.MoveNext","MapTreeModule_moveNext","FSharpMap","tree","this$","combineHash","activePatternResult","FSharpMap__ComputeHashCode","that_1","m1","e1c","e2c","map_1","toStringTag","b1","b2","compareWith","kvp1","kvp2","FSharpMap__ContainsKey","FSharpMap__get_Item","FSharpMap__get_Count","size","clear","delete","_arg","thisArg","iterate_1","FSharpMap_$ctor","FSharpMap__Add","MapTreeModule_find","MapTreeModule_mem","FSharpMap__get_Keys","map_2","kvp","FSharpMap__TryFind","table","containsKey","ofList","elements","m_1_mut","MapTreeModule_toList","FSharpMap_Empty","Constraints_applyConstraintsGetErrors","constraints","constr","Constraints_applyConstraints","Constraints_collectConstraintsErrors","errors","option","Constraints_minLengthConstraint","minLength","Constraints_maxLengthConstraint","maxLength","Constraints_minMaxLengthConstraint","Constraints_notEmptyOrWhitespaceConstraint","Constraints_minMaxOptLengthConstraint","Constraints_maxOptLengthConstraint","Constraints_minOptLengthConstraint","Constraints_minConstraint","minValue","Constraints_isValidCurrency","Constraints_minMaxConstraint","maxValue","Constraints_maxConstraint","dashify","separator","keyValueList","definedCaseRule","kvPair","assign","caseRule","changeCase","tryGetValue","addToSet","addToDict","dict","getItemFromDict","HashSet","items","hashMap","Map","HashSet__Add_2B595","HashSet__Clear","HashSet__Contains_2B595","arrayIndex","HashSet__get_Count","HashSet__Remove_2B595","HashSet__TryFindIndex_2B595","outArg","v_1","matchResult","Dictionary","pairs","pair","Dictionary__Add_5BDDA1","Dictionary__Clear","Dictionary__TryFind_2B595","p_1","Dictionary__get_Count","Dictionary__Remove_2B595","Dictionary__ContainsKey_2B595","Dictionary__get_Item_2B595","Dictionary__set_Item_5BDDA1","Dictionary__TryFindIndex_2B595","distinct","hashSet","List_distinct","List_distinctBy","distinctBy","List_except","itemsToExclude","except","List_groupBy","key_1","groupBy","unicodeCategoryFunc","codePointAt","codepoints","Uint32Array","categories","cp","hi","lo","getCategoryFunc","isDigit","getUnicodeCategory2","isDigit2","isWhiteSpace","isWhiteSpace2","splitTagToHierarchicalComponents","splitServerTags","tags","validateTag","isLetterMask","isLetterOrDigit2","isLetterOrDigit","validateServerTags","filter_1","validateTags","toClientListView","toLocaleLowerCase","TagTreeNode","Id","Tag","Caption","Children","toClientTreeView","tagsMap","addToTree","newTag","section","child","newNode","child_1","tree_1","tag_2","y_1","concatToServer","addTag","currentTags","exists_1","CaseInfo","declaringType","TypeInfo","fullname","generics","construct","parent","enumCases","fullName","getHashCode","getGenerics","getRecordElements","k1","v1","k2","class_type","record_type","union_type","caseNames","tuple_type","lambda_type","argType","returnType","option_type","generic","list_type","enum_type","underlyingType","unit_type","string_type","bool_type","uint8_type","int32_type","int64_type","float64_type","decimal_type","info","elemType","getElementType","lastIndexOf","getEnumCase","getUnionCases","getFunctionElements","isFunction","gen","isTuple","startsWith","getUnionFields","case_","getRecordField","field","makeUnion","uci","expectedLength","makeRecord","_ref3","_t","assertUnion","taglineName","taglineConstraints","name_1","name_2","validateTagline","notes","notesConstraints","notesName","validateNotes","getNotesErrors","name_3","tags_1","tags_2","tagsList","distinctCount","getTagsErrors","validateRating","rating","getRatingErrors","followupNotesConstraints","followupNotesName","validateFollowupNotes","followupNotes","getFollowupNotesErrors","InteractionRecordModule_participantsConstraints","InteractionRecordModule_participantsName","InteractionRecordModule_validateParticipants","participants","InteractionRecordModule_getParticipantsErrors","DiaryRecord","Tagline","Notes","FollowupTime","FollowupNotes","FollowupDismissed","Tags","DiaryRecord_$reflection","ReviewRecord","Rating","ReviewRecord_$reflection","interactionTypes","InteractionRecord","Participants","DurationSec","InteractionType","InteractionRecord_$reflection","ReminderRecord","EventTimestamp","OperationCanceledError","setPrototypeOf","Trampoline","maxTrampolineCallCount","callCount","incrementAndCheck","hijack","setTimeout","protectedCont","ctx","cancelToken","isCancelled","onCancel","trampoline","err","onError","Bind","computation","onSuccess","protectedBind","Combine","computation1","computation2","Delay","For","sequence","body","While","Return","protectedReturn","ReturnFrom","TryFinally","compensation","TryWith","catchHandler","ex","Using","resource","guard","Zero","FSharpChoice$2","emptyContinuation","_x","defaultCancellationToken","cancelled","_id","_cancelled","_listeners","cancel","listener","addListener","removeListener","register","$","fromContinuations","startImmediate","cancellationToken","continuation","exceptionContinuation","cancellationContinuation","startWithContinuations","Event$2","delegates","_add","_remove","Publish","addHandler","removeHandler","AddHandler","RemoveHandler","Subscribe","OnNext","Trigger","senderOrValue","valueOrUndefined","sender","Event","interval","_enabled","_isDisposed","_intervalId","_timeoutId","Interval","AutoReset","_elapsed","Elapsed","Enabled","setInterval","clearTimeout","clearInterval","Close","Start","Stop","Observer","onNext","onCompleted","OnError","_e","OnCompleted","callback","Cmd_exec","dispatch","cmd","call","Cmd_none","Cmd_map","g","arg_1","Cmd_batch","cmds","Cmd_OfAsyncWith_either","task","ofSuccess","ofError","work","Choice_makeChoice1Of2","Cmd_OfAsync_start","returnVal","Timer","Timer_delay","Cmd_OfPromise_either","then","arg_3","catch","arg_2","NumberStyles","HttpMethod","RequestBody","HttpRequest","Url","Headers","WithCredentials","HttpResponse","StatusCode","ResponseBody","RemoteBuilderOptions","CustomHeaders","BaseUrl","Authorization","RouteBuilder","CustomResponseSerialization","ProxyRequestException","response","errorMsg","reponseText","ProxyRequestException_$ctor_76BC5104","getRange","unsigned","bitsize","isValid","style","prefix","AllowHexSpecifier","getRadix","invalidDigits","getInvalidDigits","regexMatch","validResponse","umin","umax","op_UnaryNegation_Int32","_configuration","updateConfiguration","configuration","console","getDayName","locale","weekday","getNow","formatCurrencyValue","currency","Intl","NumberFormat","getTimezoneName","DateTimeFormat","resolvedOptions","timeZone","dateToLuxonTz","tz","fromJSDate","setZone","_dateToTz","DisplayNames","type","maximumSignificantDigits","StringBuilder","capacity","buf","StringBuilder_$ctor_Z18115A39","StringBuilder_$ctor","StringBuilder__Append_Z721C83C5","StringBuilder__Append_Z524259A4","signedRound","ceil","fromSeconds","days","seconds","Prop","DOMAttr","HTMLAttr","Reflection_getCaseName","case$","Screen","Screen_ToString_2D2414B4","screen","Color_IColor","Color_ofColor","level","Size_ISize","TextSize_Option","TextSize_Option_ToString_Z2E0B9453","Reflection_getCaseTag","TextAlignment_Option","FlexWrap_Option","TextWeight_Option","TextTransform_Option","Spacing_TypeAndDirection","Spacing_Amount","Modifier_IModifier","Common_GenericOption","Common_GenericOptions","Props","Classes","RemovedClasses","Common_GenericOptions_Parse_Z4D1A7726","parser","baseClass","baseProps","result_1","Common_GenericOptions__AddClass_Z721C83C5","Common_GenericOptions__AddProps_Z4E55E0BD","Common_GenericOptions__AddProp_ZCC5A61F","prop","props","cl","Common_GenericOptions__AddCaseName_1505","Common_GenericOptions__AddModifiers_Z7C3AFA3","modifiers","screen_3","screen_7","Modifier_ofText","warn","display","Display_toDisplayOnlyClass","Modifier_ofInvisible","Modifier_ofInvisibleOnly","Modifier_ofHidden","Modifier_ofHiddenOnly","typ","amount","direction","x_2","option_1","x_3","option_2","x_4","y_2","option_3","x_5","y_3","option_4","x_6","y_4","Modifier_ofBackground","Common_GenericOptions__ToAttributes","cls","Common_GenericOptions__ToReactElement_4509C2D7","el","children","children_1","Common_GenericOptions__ToReactElement_Z2B8EEFE","Common_parseOptions","Text_span","react","Option","background","content","box$0027","title","element","children_3","h2","h3","h4","h5","h6","Helpers_classes","std","booleans","complete_1","complete","Fa_ISize","Fa_IconOption","Fa_ofSize","Fa_IconOptions","Icon","Size","Border","Pull","HaveSpin","HavePulse","Rotation","Flip","IsInverse","FixedWidth","IsLi","StackSize","CustomClass","Fa_i","faOptions","baseElement","opts","Fa_displayIcon","Fa_toIconOptions","Fa_Stack_Options","reactApi","offsetToUtcZone","utcOffsetMins","EventInfo","ContentTypeId","ProfileId","CreatedAt","UpdatedAt","PlaceId","PlaceName","Latitude","Longitude","LocationTz","LocationTzOffsetMin","ClientTz","ClientTzOffsetMin","EventInfo_$reflection","PageBoundary","Timestamp","PagingOptions","LastBoundary","PageSize","Ascending","From","To","PagingOptions_$reflection","DataPoint","DataPoint_$reflection","EventInfo_Default_7F9DDECF","timestamp","EventInfo__GetClientTz","EventInfo__GetLocationTz","EventInfo__DisplayTimeZone","getTz","clientTz","locationTz","clientTz_1","locationTz_1","PagingOptionsModule_basicPagingOptions","fromDate","toDate","PagingOptionsModule_defaultPagingOptions","exnToDisplayString","error","dateStrToDate","parts","part","Int32Array","dateToStrForDiary","timeFormatOptions","temp","getBasicEventInfoData","eventInfo","sb","formatDistanceToNow","toString_1","secondsToHuman","secs","milliseconds","toString_2","handleFileEvent","fileEvent","files","file","instance","reader","FileReader","onload","_arg_2","readyState","readAsArrayBuffer","splitSeconds","durationSecs","stringToEnum","valuesToSelectOptions","optionsFromChoices","nightStart","create_1","nightEnd","isNightOptTz","tzOpt","timestampInTz","common","time","_wordPattern","countWordsEx","strs","matches_1","countWords","_suffixes","responsiveChart","data","properties","properties_2","properties_5","top","bottom","reactApi_1","createElement","CartesianGrid","XAxis","dataKey","point","absValue","_arg_1","suffix_1","formatShortDecimal","YAxis","Tooltip","Line","point_1","stroke","LineChart","RecordField","FieldName","FieldType","PropertyInfo","UnionCase","CaseName","CaseTypes","Info","flattenFuncTypes","typeDef","$007CFuncType$007C_$007C","lazyToDelayed","_createTypeInfo","resolvedType","l_3","l_4","l_5","l_6","l_7","l_8","l_9","l_10","l_11","l_12","l_13","l_14","l_15","l_16","l_17","primType","$007CPrimitiveType$007C_$007C","activePatternResult_1","types","createTypeInfo","activePatternResult_2","isRecord","$007CRecordType$007C_$007C","l_1","activePatternResult_3","isUnion","$007CUnionType$007C_$007C","l_2","activePatternResult_4","isEnum","getEnumUnderlyingType","activePatternResult_5","$007CListType$007C_$007C","elemType_1","activePatternResult_6","$007CResizeArrayType$007C_$007C","elemType_2","activePatternResult_7","$007CHashSetType$007C_$007C","elemType_3","activePatternResult_8","$007CArrayType$007C_$007C","elemType_4","activePatternResult_9","getTupleElements","$007CTupleType$007C_$007C","types_1","activePatternResult_10","$007COptionType$007C_$007C","elemType_5","activePatternResult_11","$007CNullable$007C_$007C","elemType_6","activePatternResult_12","$007CSetType$007C_$007C","elemType_7","activePatternResult_13","genArgs","$007CMapType$007C_$007C","keyType","valueType","activePatternResult_14","$007CDictionaryType$007C_$007C","keyType_1","valueType_1","activePatternResult_15","$007CSeqType$007C_$007C","elemType_8","activePatternResult_16","$007CAsyncType$007C_$007C","elemType_9","activePatternResult_17","$007CPromiseType$007C_$007C","elemType_10","typeInfoCache","ti_1","endsWith","isPrimitive","enumUnion","every","defaultRequestConfig","HttpMethod_1","get$","url","post","withHeaders","headers","req","withCredentials","withCredentials_1","withBody","sendAndRead","preparation","resultMapper","request_1","xhr","XMLHttpRequest","open","cancellationTokenRegistration","abort","setRequestHeader","onreadystatechange","isCancellationRequested","send","Parsimmon","seed","elem","isParser","isBuffer","Buffer","makeSuccess","status","furthest","expected","makeFailure","mergeReplies","hasOwnProperty","union","makeLineColumnIndex","line","column","lines","assertParser","assertNumber","assertFunction","assertString","repeat","string","leftPad","char","rangeFromIndexAndOffsets","before","after","to","formatGot","lineWithErrorIndex","lineRange","lastLineNumberLabelLength","verticalMarkerLength","byteLineWithErrorIndex","columnByteIndex","byteRange","bytesPerLine","bytesAfter","bytesInChunks","chunks","chunkIndex","toChunks","byteLines","byteRow","byteValue","byteRangeToRange","byteLine","inputLines","lineWithErrorCurrentIndex","linesWithLineNumbers","lineSource","lineNumberLabel","isLineWithError","re","seq","parsers","numParsers","accum","seqMap","mapper","apply","results","alt","sepBy1","many","rs","regexp","group","assertRegexp","anchored","anchoredRegexp","fullMatch","groupMatch","succeed","lookahead","eof","msg","formatError","or","alternative","wrap","leftParser","rightParser","middle","thru","wrapper","tieWith","assertArray","tie","prevResult","atMost","atLeast","init","fn","contramap","promap","mark","end","sepBy","notFollowedBy","text","desc","reply","fallback","ap","chain","of","digit","optWhitespace","cr","lf","newline","Parsimmon_many","Parsimmon_ofLazy","Parsimmon_digit","Parsimmon_seperateBy","others","Parsimmon_between","skipped","Parsimmon_map","Parsimmon_choose","ps","Parsimmon_satisfy","Parsimmon_str","Parsimmon_optionalWhitespace","Parsimmon_stringReturn","Parsimmon_seq2","Parsimmon_concat","strings","Parsimmon_seq3","Json","jint","negJint","jfloat","jnumber","Item","jbool","jnull","stringLiteral","Parsimmon_oneOf","anyCharSnippet","otherParser","Parsimmon_orTry","tuple","c_1","withWhitespace","jvalue","comma","json$004080$002D1","jsonParser","InteropUtil_isBigInt","InteropUtil_isObjectLiteral","SimpleJson_parse","Parsimmon_parse","SimpleJson_tryParse","SimpleJson_toString","arg_4","SimpleJson_toPlainObject","value_3","jsObject","enumerator_1","SimpleJson_stringify","JSON","jsonValue","InteropUtil_isDateOffset","SimpleJson_parseNative$0027","$007CNativeString$007C_$007C","$007CNativeNumber$007C_$007C","$007CNativeBool$007C_$007C","$007CNull$007C_$007C","$007CNativeArray$007C_$007C","$007CNativeObject$007C_$007C","object","value_5","toList_1","map_3","SimpleJson_parseNative","ok","Uri","uri","isAbsoluteUri","URL","tryCreateWithKind","original","tryCreateWithBase","baseUri","relativeUri","tryCreateImpl","kindOrUri","tryCreate","out","decodeURIComponent","asUrl","absoluteUri","href","scheme","protocol","host","includes","absolutePath","pathname","query","isDefaultPort","port","pathAndQuery","fragment","hash","originalString","_bitsize","lessOrEqual","getMaxValue","getPrefix","fromString","DateTimeOffset","checkOffsetInRange","offsetMatch","fromUnixMilliseconds","fromDayNumber","dayNumber","ticks","fromDateTime","Date_year","Date_month","Date_day","toDateTime","dd","guidRegex","guidRegexNoHyphen","guidRegexHex","hyphenateGuid","wsTrimAndLowered","_len5","_key5","littleEndian","getBytesInt32","DataView","buffer","byteOffset","byteLength","setInt32","getBigInt64","SetTreeLeaf$1","SetTreeLeaf$1_$ctor_2B595","SetTreeLeaf$1__get_Key","SetTreeNode$1","SetTreeNode$1_$ctor_5F465FC9","SetTreeNode$1__get_Left","SetTreeNode$1__get_Right","SetTreeNode$1__get_Height","SetTreeModule_countAux","t_mut","tn","SetTreeModule_count","SetTreeModule_mk","tn_1","t2_1","SetTreeModule_rebalance","t2_3","tn_2","t_3","t2_4","tn_3","t2_2","SetTreeModule_add","SetTreeModule_empty","SetTreeModule_spliceOutSuccessor","SetTreeModule_remove","SetTreeModule_mem","SetTreeModule_iter","SetTreeModule_SetIterator$1","SetTreeModule_collapseLHS","x2","xn","SetTreeModule_mkIterator","SetTreeModule_current","SetTreeModule_alreadyFinished","SetTreeModule_notStarted","SetTreeModule_mkIEnumerator","SetTreeModule_moveNext","SetTreeModule_compare","l1_mut","l2_mut","SetTreeModule_compareStacks","l1","x1_3","x2_3","x1n_2","x2n_2","t1_6","x1_4","t2_6","x2_4","x1n_3","x2n_3","matchResult_1","t1_7","x1_5","t2_7","x2_5","x1n_4","x2n_4","c_3","x2n_5","c_2","matchResult_2","t1_8","x1_6","t2_8","x2_6","x1n_5","x2n_6","matchResult_3","t1_2","x1","x2_1","x1n","x2n","matchResult_4","t1_4","x1_2","x2_2","x1n_1","x2n_1","SetTreeModule_copyToArray","SetTreeModule_ofArray","folder_1","SetTreeModule_ofSeq","fold_2","SetTreeModule_ofList","SetTreeModule_mkFromEnumerator","FSharpSet","FSharpSet__ComputeHashCode","FSharpSet__get_Comparer","FSharpSet__get_Tree","FSharpSet__get_Count","FSharpSet__Contains","FSharpSet_$ctor","set$","FSharpSet__Add","FSharpSet__Remove","FSharpSet__get_IsEmpty","FSharpSet_Empty","Convert_insideBrowser","window","document","Convert_isDefined","Convert_usingFable3","Convert_InternalMap","Convert_flattenMap","Convert_$007CMapKey$007C_$007C","Convert_generateMap","json","Convert_$007CMapEmpty$007C_$007C","Convert_$007CMapOne$007C_$007C","Convert_$007CMapNode$007C_$007C","leftMap","rightMap","Convert_flatteFable3Map","matchValue_4","Convert_flattenFable3Lists","linkedList","Convert_arrayLike","Convert_unionOfRecords","Convert_isRecord","Convert_optional","Convert_isQuoted","Convert_betweenQuotes","Convert_removeQuotes","Convert_fromJsonAs","input_mut","typeInfo_mut","foundCase","foundCase_1","testExpr","values_8","typeInfo","value_4","value_6","value_7","value_8","value_9","value_10","value_11","value_12","value_13","value_14","value_15","value_16","value_17","value_18","value_19","value_20","value_21","value_22","value_23","value_24","value_25","value_26","getlElemType","value_27","getElemType","value_28","getElemType_1","value_29","genericJson","value_30","value_31","value_32","value_33","value_34","value_35","value_36","value_37","value_38","value_39","value_40","value_41","value_42","getTypes_1","jsonValue_5","optionalTypeDelayed_5","value_49","value_50","caseName_4","getTypes_2","caseName_5","getTypes_3","getFields","serializedRecord","caseValue","getTypes_4","elementTypeDelayed","values_4","elementTypeDelayed_1","values_5","elementTypeDelayed_2","elementTypeDelayed_3","values_6","elementTypeDelayed_4","values_7","array_12","tupleTypesDelayed","dict_1","getTypes_5","getTypes_6","tuples","getTypes_7","tuples_1","dict_2","getTypes_8","getType","getTypes_9","getType_1","NaN","parse_1","parse_2","originalType","outArg_1","tryParse_1","arg_5","WorkerGlobalScope","parse_3","parse_4","parse_5","patternInput_2","unionType","caseName_1","values_1","caseName_2","tryFind_1","foundCase_2","foundCase_3","foundCase_4","arg_13","arg_14","expectedCases","case$_1","arg_10","case$_2","caseInfo","caseName_3","caseType","input_1","typeInfo_1","expectedCases_1","case$_3","arg_19","matchValue_5","caseIndex","fieldValues","foundCase_5","value_48","arg_21","arg_22","foundDiscriminatorKey","tryFind_2","keyword","discriminatorValueJson","discriminatorValue","foundUnionCase","tryFind_3","case$_4","case$_5","arg_24","arg_26","arg_23","unexpectedJson","expectedType","parse_6","toInt64_1","patternInput_3","caseTypes","_arg_3","case$_6","expectedCases_2","case$_7","arg_33","patternInput_4","caseTypes_1","_arg_4","case$_8","expectedCases_3","case$_9","arg_37","patternInput_5","cases_1","matchResult_5","caseName_6","caseName_8","values_3","otherwise_6","_arg_5","case$_10","expectedCases_4","case$_11","arg_41","_arg_6","case$_12","foundCaseName","caseInfo_4","expectedCases_5","_arg_7","unexpectedJson_1","expectedType_1","elementType","value_55","elementType_1","value_57","elementType_2","value_59","elementType_3","ofList_1","value_61","elementType_4","value_63","tupledArg_2","patternInput_6","recordType","_arg_8","list_10","clo_48","fieldType","fieldName","_arg_9","tupledArg_3","dictKeys","arg_50","arg_49","recordFields","arg_53","_arg_10","arg_56","patternInput_7","keyValuePair","patternInput_8","pairs_1","keyValuePair_1","output","patternInput_9","keyType_2","pairs_2","tupledArg_4","output_1","forLoopVar_1","hashset","enumerator_2","patternInput_10","valueType_5","keyType_3","matchValue_7","matchValue_8","matchResult_6","comparer_2","tree_2","comparer_3","tree_3","matchValue_10","inputJson","pairs_3","tupledArg_5","key_6","pairs_4","tupledArg_6","key_7","unknownType","arg_59","arg_60","arg_61","arg_62","Convert_quoteText","inputText","escapable","meta","Convert_serialize","value_mut","toString_3","map_4","element_1","element_2","element_3","element_4","elementType_5","element_5","value_91","usedCase","find_1","serializedFields_1","serializedValues","serializedKey","serializedValue","serializedValues_1","serializedKey_1","serializedValue_1","tupleTypes","index_1","element_6","Proxy_proxyFetch","typeName","func","funcArgs","argumentCount","returnTypeAsync","binaryInput","route","baseUrl","Proxy_combineRouteWithBaseUrl","funcNeedParameters","contentType","inputArgumentTypes","executeRequest","Proxy_isAsyncOfByteArray","onOk","serializer","typ_mut","Proxy_getReturnType","requestBody","responseType","xhr_1","withCredentials_4","statusCode","response_1","responseAsBlob","Blob","blob","readAsText","response_2","returnType_1","requestBody_1","responseText","response_3","parsedJson","arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","matchValue_6","inputArguments","arg_9","RemotingModule_createApi","clo","RemotingModule_withRouteBuilder","builder","Remoting_buildProxy_64DC51C","schemaType","fieldTypes","delegateArg","delegateArg_1","delegateArg_2","delegateArg_3","delegateArg_4","delegateArg_5","delegateArg_6","delegateArg_7","delegateArg_8","delegateArg_9","delegateArg_10","delegateArg_11","delegateArg_12","delegateArg_13","delegateArg_14","delegateArg_15","delegateArg_16","delegateArg_17","delegateArg_18","delegateArg_19","delegateArg_20","delegateArg_21","delegateArg_22","delegateArg_23","delegateArg_24","delegateArg_25","delegateArg_26","delegateArg_27","delegateArg_28","delegateArg_29","delegateArg_30","delegateArg_31","delegateArg_32","delegateArg_33","delegateArg_34","ContactType","Version","Major","Minor","Patch","Build","build","ChangelogEntry","Date$","Details","Changelog","ProductInformation","Name","LastUpdatedAt","Title","Description","Graphics","Authors","Contacts","WebSite","UserGuide","Support","ChangeLog","defaultWeb","defaultAuthors","defaultContacts","UnifiedRecord","UnifiedRecord_$reflection","EditHelperData$1","FrequentTags","RecentRecords","EditHelperData$1_$reflection","gen0","EditHelperData$1__GetFrequentTags","RecordService$1","Edit","GetRecord","GetRecords","SearchGeneral","SearchByTags","GetEditHelperData","RecordService$1_$reflection","DiaryModule","initialTimestamp","latestTimestamp","DiaryModule__get_Changelog","DiaryModule__get_CurrentVersion","RegisteredTypes","diaryService","reviewService","interactionService","unifiedService","GetFrequentTags","reminderService","GetReminders","MarkReminderDismissed","nameConstraints","nameName","validateName","getNameErrors","descriptionConstraints","descriptionName","validateDescription","description","getDescriptionErrors","instructionsConstraints","instructionsName","validateInstructions","instructions","getInstructionsErrors","weightConstraints","weightName","validateWeight","weight","getWeightErrors","repetitionsConstraints","repetitionsName","validateRepetitions","repetitions","getRepetitionsErrors","WorkoutRecord","WorkoutId","Progress","FinishTime","WorkoutRecord_$reflection","WorkoutRecord_Default_Z524259C1","workoutId","RepsWithWeightRecord","ExerciseId","WorkoutRecordId","Repetitions","Weight","RepsWithWeightRecord_$reflection","RepsWithWeightRecord__E1RMDisplay","RepsWithWeightRecord__E1RM","RepsWithBodyWeightRecord","RepsWithBodyWeightRecord_$reflection","EnduranceRecord","DistanceKm","Calories","EnduranceRecord_$reflection","IntervalsDurationRecord","NumExercises","WorkDurationSec","RestDurationSec","IntervalsDurationRecord_$reflection","IntervalsRepsRecord","WorkRepetitions","IntervalsRepsRecord_$reflection","FitnessSearchOptions","DateFrom","DateTo","FitnessEditHelperData","FitnessEditHelperData_$reflection","FitnessEditHelperData__GetFrequentTags","Exercise","Instructions","Categories","Exercise_$reflection","ExerciseRecordAddingInfo$1","ExerciseRecords","ExerciseRecordAddingInfo$1_$reflection","AddMany","GetExerciseRecords","GetExerciseRecordAddingInfo","SearchRecords","Workout","WorkoutType","Schedule","Workout_$reflection","TrainingPlan","TrainingPlan_$reflection","ExerciseRecord","ExerciseRecord_$reflection","WorkoutLog","Workouts","Exercises","RecentWorkoutRecords","RecentExerciseRecords","FitnessHierarchy","Favourites","TrainingPlans","Favourite","TrainingPlanData","WorkoutData","WorkoutCircuitData","WorkoutRecords","TrainingPlanWorkoutRecords","WorkoutRecordType","FitnessModule","FitnessModule__get_Changelog","FitnessModule__get_CurrentVersion","Request_Login","Username","Password","IsPersistent","Request_ExternalAuthScheme","Response_SiteSettings","FitnessContentTypes","Response_ContentTypeDescriptor","Response_fullNameConstraints","Constraints_regexConstraint","regex","Response_fullNameName","Response_validateFullName","Response_getFullNameErrors","Response_dateOfBirthName","Response_getDateOfBirthErrors","dateOfBirth","Response_notInTheFuture","Response_validateDateOfBirth","Response_ProfileInfo","IsPrimary","FullName","DateOfBirth","Gender","Country_IsoCode","ActiveWorkout","Response_ProfileInfo_$reflection","Response_UserInfo","Email","ReadOnly","Profiles","SiteSettings","ServerVersion","ClientConfigVariables","Response_UserInfo_$reflection","Response_AnonymousData","Response_AvailableUserInfo","PageFormat","StaticPage","Format","Body","Language","ContactData","Subject","Message","AnonymousService_RouteBuilder","SummaryEntry","ContentType","Count","Icons","Icons__ToIcon","CompositeIcons","CompositeIcons__ToElement","first","classes","Fa_stack","stack2FaIcons","lastProfileIdKey","Session","LoggedIn","UserInfo","CurrentProfile","Session__GetCurrentName","userInfo","profileId","Session__GetCurrentProfileId","Response_ProfileInfo__DisplayName","pr","Session__GetCurrentProfile","localStorage","getItem","Session__GetActiveWorkoutRecord","Session__GetActiveWorkoutId","record","Session__SetActiveWorkoutRecord_Z2D8A2414","activeRecord","bind$0040","newProfile","profile","newProfiles","profile_1","Session__SiteSettings","Config_placeLookupId","Config_variable","Config_releaseVersion","Config_isDemoUser","session","username","Config_defaultDateForNow","Config_getDefaultDiaryDate","Config_getUserTimeZone","temperatureConstraints","temperatureName","validateTemperature","temperature","getTemperatureErrors","pressureConstraints","systolicName","diastolicName","getPressureErrors","pressure","validateSystolic","validateDiastolic","WeightRecord","WeightRecord_$reflection","TemperatureRecord","Temperature","TemperatureRecord_$reflection","BloodPressureRecord","Systolic","Diastolic","BloodPressureRecord_$reflection","bodilyFunctions","duringSleepOptions","bodilyFunctionsEmojis","BodilyFunctionsRecord","FunctionType","DuringSleep","BodilyFunctionsRecord_$reflection","PhysicalSearchOptions","PhysicalModule","PhysicalModule__get_Changelog","PhysicalModule__get_CurrentVersion","instrumentConstraints","instrumentName","validateInstrument","instrument","getInstrumentErrors","interestRateConstraints","Constraints_maxOptConstraint","Constraints_minOptConstraint","Constraints_minMaxOptConstraint","interestRateName","validateInterestRate","interestRate","getInterestRateErrors","identifierConstraints","identifierName","validateIdentifier","identifier","getIdentifierErrors","quantityConstraints","quantityName","validateQuantity","quantity","getQuantityErrors","unitPriceConstraints","Constraints_greaterThanConstraint","unitPriceName","validateUnitPrice","unitPrice","getUnitPriceErrors","currencyConstraints","currencyName","validateCurrency","getCurrencyErrors","displayCurrencyConstraints","Constraints_isValidCurrencyOpt","displayCurrencyName","validateDisplayCurrency","displayCurrency","getDisplayCurrencyErrors","isActive","activeFrom","activeTo","CurrencyValue","Currency","CurrencyValue_op_UnaryNegation_4EF17D2F","op_UnaryNegation","Group","GroupType","ParentId","DisplayCurrency","Group_$reflection","needsUnitPrice","assetType","frequencyFactors","getConversionFactor","valueToFrequency","CurrencyValue_op_Multiply_1FE6124A","adjustForFrequency","AssetValueRecord","AssetId","Quantity","UnitPrice","AssetValueRecord_$reflection","AssetInfo","GroupId","AssetType","Identifier","LatestAssetValueId","Instrument","InterestRate","ActiveFrom","ActiveTo","AssetInfo_$reflection","AssetInfo__GetValue_Z33CCF5CA","isLiability","CashflowInfo","CashflowType","Frequency","CashflowInfo_$reflection","CashflowInfo__GetValue","CashflowInfo__IsActive_7F9DDECF","GroupNode","Data","ChildNode$","Cashflow","noneOrPred","pred","stringFilter","stringsFilter","EntryFilter","Content","EntryFilter_get_Empty","FinancialHierarchy","Groups","Assets","Cashflows","LatestValues","FxRates","FinancialHierarchy__BuildTree","groupType","hasFilter","groupMapping","group_1","filter_2","cashflow","EntryFilter__Match_4FDF7BFC","compare_1","assetMappings","asset","cashflow_1","EntryFilter__Match_Z6FD9FBA3","equals_1","compare_2","cashflowMappings","cashflow_3","cashflow_2","EntryFilter__Match_13C44C26","sumCurrencyValues","targetCurrency","parentDisplayCurrency","groupNode","group_2","list_12","group_3","asset_1","cashflow_4","group_4","finalTL","list_17","group_5","FinancialModule","FinancialModule__get_Changelog","FinancialModule__get_CurrentVersion","Registry$1","modules","lookup","Registry$1_$ctor_Z1FA48BC9","Registry$1__get_Modules","a_1","b_1","ofFunc","State$1","visited","unvisited","StateModule_mkState","custom","tipe","stringToSomething","i32","str_1","remaining","s_1","subValue","arg10$0040","StateModule_map","toKeyValuePair","segment","Sub_Internal_SubId_toString","subId","Sub_Internal_Fx_tryStop","Sub_Internal_Fx_stop","subs","Sub_Internal_Fx_change","dupes","toStop","toKeep","toStart","Sub_Internal_Fx_warnDupe","Sub_Internal_Fx_tryStart","Sub_Internal_NewSubs_calculate","Sub_Internal_NewSubs_update","newKeys","newSubs","reduceRight","foldBack_1","Sub_Internal_empty","Sub_Internal_diff","activeSubs","integralRangeStep","step","stop","zero","stepFn","stepComparedWithZero","stepGreaterThanZero","comparedWithLast","makeRangeStepFunction","unfold","st_1","Enumerator_unfold","rangeDouble","RingState$1","RingBuffer$1","RingBuffer$1__Pop","__","wix","rix","rix$0027","Program$4","update","subscribe","view","setState","termination","ProgramModule_view","program","Navigable$1","Route","RouteModule_i64","RouteModule_curry2","RouteModule_toHash","param_1","RouteModule_routeParser","parseBefore","parseAfter","parseBefore_4","parseBefore_2","parseAfter_2","parseBefore_6","parseBefore_10","parseBefore_8","parseAfter_8","parseBefore_14","parseBefore_12","parseAfter_12","parseBefore_18","parseBefore_16","parseAfter_16","parseBefore_22","parseBefore_20","parseAfter_20","parseBefore_26","parseBefore_24","parseAfter_24","parseBefore_30","parseBefore_28","parseAfter_28","parseBefore_34","parseBefore_32","parseAfter_32","parseBefore_38","parseBefore_36","parseAfter_36","parseBefore_40","parseAfter_40","parseBefore_42","parseAfter_42","parseBefore_46","parseBefore_44","parseAfter_44","parseAfter_46","parseBefore_50","parseBefore_48","parseAfter_48","parseAfter_50","parseBefore_54","parseBefore_52","parseAfter_52","parseAfter_54","parseBefore_60","parseBefore_58","parseBefore_56","parseAfter_56","parseAfter_58","parseBefore_64","parseBefore_62","parseAfter_62","parseAfter_64","parseBefore_70","parseBefore_68","parseBefore_66","parseAfter_66","parseAfter_68","parseBefore_74","parseBefore_72","parseAfter_72","parseAfter_74","parseBefore_80","parseBefore_78","parseBefore_76","parseAfter_76","parseAfter_78","parseBefore_84","parseBefore_82","parseAfter_82","parseAfter_84","parseBefore_90","parseBefore_88","parseBefore_86","parseAfter_86","parseAfter_88","parseBefore_92","parseAfter_92","parseBefore_96","parseBefore_94","parseAfter_94","parseBefore_98","parseAfter_98","parseBefore_100","parseAfter_100","parseBefore_104","parseBefore_102","parseAfter_102","parseAfter_104","parseBefore_110","parseBefore_108","parseBefore_106","parseAfter_106","parseAfter_108","parseBefore_116","parseBefore_114","parseBefore_112","parseAfter_112","parseAfter_114","parseBefore_120","parseBefore_118","parseAfter_118","parseAfter_120","parseBefore_126","parseBefore_124","parseBefore_122","parseAfter_122","parseAfter_124","parseBefore_132","parseBefore_130","parseBefore_128","parseAfter_128","parseAfter_130","parseBefore_134","parseAfter_134","parseBefore_138","parseBefore_136","parseAfter_136","parseAfter_138","parseBefore_144","parseBefore_142","parseBefore_140","parseAfter_140","parseAfter_142","parseBefore_150","parseBefore_148","parseBefore_146","parseAfter_146","parseAfter_148","parseBefore_152","parseAfter_152","parseBefore_160","parseBefore_158","parseBefore_156","parseBefore_154","parseAfter_154","parseAfter_156","parseBefore_168","parseBefore_166","parseBefore_164","parseBefore_162","parseAfter_162","parseAfter_164","queryParser","parseBefore_176","parseBefore_174","parseBefore_172","parseBefore_170","parseAfter_170","parseAfter_172","parseBefore_182","parseBefore_180","parseBefore_178","parseAfter_178","parseAfter_180","parseBefore_188","parseBefore_186","parseBefore_184","parseAfter_184","parseAfter_186","parseBefore_194","parseBefore_192","parseBefore_190","parseAfter_190","parseAfter_192","state_2","state_5","Item_1","state_8","Item_2","state_10","state_13","Item_3","state_15","state_18","Item_4","state_20","state_23","Item_5","state_25","state_28","Item_6","state_30","state_33","Item_7","state_35","state_38","Item_8","state_40","state_43","Item_9","state_45","state_47","state_49","state_51","state_53","state_55","state_57","state_59","state_61","state_63","Item_10","state_65","state_67","state_70","state_72","state_74","Item_11","state_76","state_78","state_81","state_83","state_85","Item_12","state_87","state_89","state_92","state_94","state_96","Item_13","state_98","state_100","state_103","state_105","Item_14","state_107","state_110","state_112","state_114","state_116","state_118","Item_15","state_120","state_122","state_125","Item_16","state_127","state_129","state_132","state_134","state_136","Item_17","state_138","state_140","state_143","Item_18","state_145","state_147","state_150","state_152","state_154","state_156","Item_19","state_158","state_160","state_163","Item_20","state_165","state_167","state_170","state_172","state_174","state_176","state_179","state_182","z","RouteModule_curry3","state_184","state_186","state_189","state_192","state_194","state_196","state_198","state_201","state_204","Item_28","state_206","state_208","state_211","Item_29","state_213","state_215","state_218","Item_30","state_220","state_222","state_225","state_228","oneOf","Router_href","Router_newUrl","newUrl","history","pushState","ev","CustomEvent","dispatchEvent","Router_modifyLocation","location","button","btnView","List_Option","list","props_1","icon","Actions","NewNow","NewDate","View","ViewAll","IconType","IconType__ToIcon","ModuleDescriptor","EntryDescriptor","IsFavourite","EntryDescriptor__GetButton","colour","isDisabled","onClick","children_4","icon_1","className","getModuleNewNowButtons","clientModule","list_3","des","EntryDescriptor__GetNewNowButton_Z1FBCCD16","EntryDescriptors","getModuleViewAllButtons","DiaryClientModule","Descriptor","DiaryClientModule_$ctor","PhysicalClientModule","PhysicalClientModule_$ctor","FinancialClientModule","FinancialClientModule_$ctor","FitnessClientModule","FitnessClientModule_$ctor","clientModuleRegistry","Helpers_combineClasses","cn","Helpers_extractClasses","Class","closeable","notificationClass","elems","random","newGuid","getElementById","hidden","closeById","container","label","Item_Option","Item_generateAnchor","Item_a","RatingStarsProps","ratingStars","react_rating_stars_component","card","header","footer","Header_Title_Option","Header_icon","Header_title","Footer_itemView","Footer_div","MarkdownRange","StartLine","StartColumn","EndLine","EndColumn","MarkdownRangeModule_zero","MarkdownRangeModule_mergeRanges","ranges","startRange","endRange","maxBy","r_1","List_partitionWhile","_arg_mut","hd_1","tl_1","tail_6","List_partitionWhileLookahead","List_partitionUntil","List_partitionUntilLookahead","List_iterInterleaved","g_mut","List_partitionUntilEquals","endl","loop_1","start_1_mut","list_1_mut","start_1","list_1","Tree$1","Item1","Item2","Tree_takeAtLevel","indent","i_1","tail_2","tail_5","Tree_takeDeeperThan","StringPosition_$007CWhiteSpace$007C_$007C","_n","StringPosition_$007CUnindented$007C_$007C","StringPosition_$007CTrimBoth$007C","inputRecord","trimmedStart","trimmed","StringPosition_$007CTrimEnd$007C","StringPosition_$007CTrimStartAndCount$007C","StringPosition_$007CStartsWithNTimesTrimIgnoreStartWhitespace$007C_$007C","beforeStart","startAndRest","startNum","windowSize","max_1","windowed_1","windowed","StringPosition_$007CStartsAndEndsWith$007C_$007C","starts","ends","StringPosition_$007CStartsWithRepeated$007C_$007C","repeated","ln","StringPosition_$007CStartsWithWrapped$007C_$007C","StringPosition_$007CEqualsRepeated$007C_$007C","_arg1_","_arg1__1","_n_1","List_$007CBracketDelimited$007C_$007C","startc","endc","x_16","xs_16","x_10","xs_10","x_11","xs_11","x_12","xs_12","x_13","xs_13","x_14","xs_14","List_$007CAsString$007C","Lines_$007CTrimBlankStart$007C","takeWhile_1","$007CLet$007C","MarkdownListKind","MarkdownColumnAlignment","MarkdownSpan","MarkdownParagraph","getLinkAndTitle","$007CDelimitedMarkdown$007C_$007C","bracket","loop_2","start_1_1_mut","list_1_1_mut","start_1_1","list_1_1","x_1_1","xs_1_1","y_1_1","ys_1_1","$007CDelimitedLatexDisplayMath$007C_$007C","$007CDelimitedLatexInlineMath$007C_$007C","$007CIndirectLink$007C_$007C","link","body_1","link_1","rest_1","body_2","link_2","rest_2","$007CDirectLink$007C_$007C","$007CEmphasised$007C_$007C","_tail","body_4","$007CHtmlEntity$007C_$007C","match$0027","entity","ParsingContext","Links","Newline","IsFirst","CurrentRange","ParseOptions","ParsingContext__get_ParseNonCodeAsOther","parseChars","matchValue_30","n_3","inputRecord_3","loop_13","loop_12","rest_11","_s","str_3","loop_4","str_5","loop_6","str_7","loop_8","str_9","loop_10","str_11","accLiterals","n_1","inputRecord_1","range","ctx_1","rest_6","rest_7","rest_8","c_6","rest_9","rest_10","activePatternResult_21","activePatternResult_22","input_26","matchResult_20","c_5","rest_5","activePatternResult_23","startl_10","endl_10","input_27","start_1_10_mut","list_1_11_mut","start_1_10","list_1_11","matchResult_21","x_1_10","xs_1_10","y_1_10","ys_1_10","matchValue_24","post_10","activePatternResult_24","input_28","strs_5","i_5","input_29","loop_11","startl_11","endl_11","input_30","start_1_11_mut","list_1_12_mut","start_1_11","list_1_12","matchResult_22","x_1_11","xs_1_11","y_1_11","ys_1_11","matchValue_26","post_11","input_16","matchResult_14","rest_3","startl_6","endl_6","input_17","start_1_6_mut","list_1_7_mut","start_1_6","list_1_7","matchResult_15","x_1_6","xs_1_6","y_1_6","ys_1_6","matchValue_16","post_6","input_18","strs_3","i_3","input_19","loop_7","startl_7","endl_7","input_20","start_1_7_mut","list_1_8_mut","start_1_7","list_1_8","matchResult_16","x_1_7","xs_1_7","y_1_7","ys_1_7","matchValue_18","post_7","input_6","matchResult_8","startl_2","endl_2","input_7","start_1_2_mut","list_1_3_mut","start_1_2","list_1_3","matchResult_9","x_1_2","xs_1_2","y_1_2","ys_1_2","post_2","input_8","strs_1","input_9","loop_3","startl_3","endl_3","input_10","start_1_3_mut","list_1_4_mut","start_1_3","list_1_4","matchResult_10","x_1_3","xs_1_3","y_1_3","ys_1_3","post_3","startl","input_2","input_3","input_4","startl_1","endl_1","input_5","list_1_2_mut","list_1_2","matchResult_7","post_1","input_11","matchResult_11","startl_4","endl_4","input_12","start_1_4_mut","list_1_5_mut","start_1_4","list_1_5","matchResult_12","x_1_4","xs_1_4","y_1_4","ys_1_4","matchValue_12","post_4","input_13","strs_2","i_2","input_14","loop_5","startl_5","endl_5","input_15","start_1_5_mut","list_1_6_mut","start_1_5","list_1_6","matchResult_13","x_1_5","xs_1_5","y_1_5","ys_1_5","matchValue_14","post_5","activePatternResult_18","input_21","matchResult_17","c_4","rest_4","activePatternResult_19","startl_8","endl_8","input_22","start_1_8_mut","list_1_9_mut","start_1_8","list_1_9","matchResult_18","x_1_8","xs_1_8","y_1_8","ys_1_8","matchValue_20","post_8","activePatternResult_20","input_23","strs_4","i_4","input_24","loop_9","startl_9","endl_9","input_25","start_1_9_mut","list_1_10_mut","start_1_9","list_1_10","matchResult_19","x_1_9","xs_1_9","y_1_9","ys_1_9","matchValue_22","post_9","ctx_2","ctx_3","ctx_4","inputRecord_2","rng","matchValue_27","n_2","rest_12","rest_13","_e_1","_s_1","rest_14","activePatternResult_25","activePatternResult_26","activePatternResult_27","startl_12","endl_12","input_31","start_1_12_mut","list_1_13_mut","start_1_12","list_1_13","x_1_12","xs_1_12","y_1_12","ys_1_12","matchValue_29","post_12","activePatternResult_28","ctx_5","ctx_6","ctx_7","matchValue_31","n_4","inputRecord_4","code","patternInput_11","ctx_8","_e_2","_s_2","rest_15","body_3","rest_16","link_4","rest_17","link_5","rest_18","body_5","link_6","rest_19","body_6","link_8","original_1","rest_20","body_7","rest_21","rest_22","rest_23","x_15","xs_15","activePatternResult_29","startl_13","endl_13","input_32","start_1_13_mut","list_1_14_mut","start_1_13","list_1_14","x_1_13","xs_1_13","y_1_13","ys_1_13","matchValue_33","post_13","activePatternResult_30","activePatternResult_31","activePatternResult_32","$007CAutoLink$007C_$007C","activePatternResult_33","activePatternResult_34","activePatternResult_35","activePatternResult_36","activePatternResult_37","activePatternResult_38","activePatternResult_39","append_1","patternInput_12","ctx_9","patternInput_13","patternInput_14","ctx_10","patternInput_15","ctx_11","patternInput_16","ctx_12","patternInput_17","patternInput_18","ctx_13","patternInput_19","ctx_14","parseSpans","trimSpaces","numSpaces_mut","s_mut","numSpaces","$007CHeading$007C_$007C","noHash","line1","line2","header_1","line1_1","line2_1","header_2","line1_2","ln_1","n_5","tupledArg_7","$007CHorizontalRule$007C_$007C","arg_mut","u","$007CFencedCodeBlock$007C_$007C","indent_1","indent_2","header_3","indent_3","lines_4","num_3","start_6","takenLine_3","endStr","h_1","codeLines","codeWithoutIndent","langString","ignoredString","tl","takenLine2","hd","$007CListStart$007C_$007C","li","startIndent2","_spaces_1","skipNumCount","startIndent_1","$007CSkipSomeNumbers$007C_$007C","startIndent2_1","$007CListItems$007C_$007C","prevSimple","continued","endIndent","startIndent","takenLine","$007CLinesUntilListOrWhite$007C","$007CLinesUntilListOrUnindented$007C","line_1","$007CListItem$007C_$007C","nextSimple","takenLines","takenLines2","pipeTableFindSplits","delim","cLstToStr","ptfs","delim_1_mut","line_1_mut","delim_1","_body","_body_1","_body_2","_body_3","$007CTableCellSeparator$007C_$007C","tupledArg_8","StringPosition_$007CStartsWith$007C_$007C","$007CPipeTableRow$007C_$007C","delimiters","$007CPipeSeparatorRow$007C_$007C","alignments","$007CEmacsTableLine$007C_$007C","grid","check","forAll_1","$007CBlockquoteStart$007C_$007C","$007CTakeParagraphLines$007C_$007C","$007CBlockquote$007C_$007C","lines_1","takenLines_1","$007CEmptyBlockquote$007C_$007C","quoteLine","takenLines2_1","$007CLinesUntilBlockquoteEnds$007C","updateCurrentRange","parseParagraphs","loc","yaml","yamlTextLines","tuple_1","$007CYamlFrontmatter$007C_$007C","moreLines","nestUnmatchingItems","formatTree","unifySimpleProperty","takenLines_7","all","wrapped","tupledArg_9","tupledArg_10","tupledArg_11","$007CLinkDefinition$007C_$007C","ignoredLine","lines_2","_numspaces","_numspaces_1","normalized","Lines_$007CTakeCodeBlock$007C_$007C","Lines_$007CTrimBlank$007C","$007CNestedCodeBlock$007C_$007C","takenLines_2","rows","takenLines_3","takenLines2_3","grid_1","emptyCur","flag_mut","takenLines2_mut","headers_mut","prevRows_mut","cur_mut","lines_1_mut","flag","prevRows","others_1","parts_1","takenLine2_1","others_2","takenLine2_2","others_3","takenLine2_3","$007CEmacsTableBlock$007C_$007C","getTableRows","size_mut","takenLinesAcc_mut","lines_mut","takenLinesAcc","columns","takenLine_1","takenLine_2","alignments_1","$007CPipeTableBlock$007C_$007C","lines_3","takenLines2_4","first_1","_takenLine1_1","first_4","first_5","_n_2","first_6","takenLine_4","_n_3","first_7","takenLine_5","s_2","res_1","s_3","$007CLatexBlock$007C_$007C","env","takenLines_4","takenLines_5","Tree_ofIndentedList","items_1","List_nestUnderLastMatching","nodes","nested_1","tuple_2","nodes_1","takenLines_6","code_3","lines_6","takenLines_8","takenLines2_9","html","html_1","$007CHtmlBlock$007C_$007C","tuple_3","tuple_4","endsWithTwoSpaces","StringPosition_$007CTrimStart$007C","Lines_$007CTrimParagraphLines$007C","takenLines_9","tuple_5","tuple_6","FableTextWriter","FableTextWriter_$ctor","FableTextWriter__Write_Z721C83C5","MarkdownUtils_FormattingContext","Substitutions","ResolveApiDocReference","DefineSymbol","MarkdownUtils_mapText","MarkdownUtils_mapSpans","f_","f__1","md","text_1","text_2","MarkdownUtils_mapInlineCode","MarkdownUtils_mapParagraphs","md_1","md_2","md_3","MarkdownUtils_applySubstitutionsInMarkdown","MarkdownUtils_applySubstitutionsInText","MarkdownUtils_applyCodeReferenceResolver","htmlEncode","htmlEncodeQuotes","$007CLookupKey$007C_$007C","UniqueNameGenerator","generated","FormattingContext","LineBreak","Writer","WrapCodeSnippets","GenerateHeaderAnchors","ParagraphIndent","formatSpan","span","formatSpans","Render","title_1","title_2","title_3","withInner","formatParagraph","paragraph","formatParagraphs","anchorName","spans","gather","gathers","spans_1","UniqueNameGenerator__GetName_Z721C83C5","formatAnchor","langCode","aligns","enumerator_3","enumerator_4","forLoopVar_2","enumerator_5","enumerator_6","paragraph_3","enumerator_7","paragraphs","smallCtx","smallBreak","bigCtx","bigBreak","MarkdownDocument","links","Markdown_WriteHtml_27D81AD6","doc","writer","substitutions","crefResolver","newline_1","substitutions_1","crefResolver_1","generateAnchors","paragraphs_1","formatMarkdown","MarkdownDocument__get_Paragraphs","Markdown_ToHtml_1BFEAEDB","markdownText","wr","Markdown_ToHtml_1A9D76FF","parseOptions","parseOptions_1","MarkdownDocument_$ctor_Z7AE59E28","Markdown_Parse_7B74E5F5","heading","ISize_ToString_2283FB3F","screen_4","size_4","screen_5","size_5","msg_1","arg_1_1","arg_2_1","size_3","ISize","suffix","ofOffset","diaryModule","DisplayRecordData$1","EditFun","TaglineFun","TagsFun","DisplayFun","AddDayLink","countWordsInRecord","countDiaryWords","countInteractionWords","renderTagTree","leafIcon","parentIcon","treeToMenu","Item_li","caption_1","isActive_2","children_2","children_7","menu","renderTag","color","customClass","displayEntry","editFun","deleteFun","tagline","displayContent","wordCount","currentTz","toRFC2822","wordCountInfo","placeId","placeName","latitude","longitude","content_1","Option_1","Option_2","Fa_i_1","confirm","displayDiaryContent","content_2","dangerouslySetInnerHTML","__html","displayReviewContent","ratingStars_1","newValue","displayInteractionContent","Item_Option_1","Option_3","displayUnifiedEntries","disabled","isMultiDayList","date_1","last_1","entry","displayDiaryEntry","displayInteractionEntry","displayReviewEntry","displayReminders","markDismissedFun","Option_6","reminder","Option_4","followupDate","formatDistance","Option_5","displayReminder","record_1","Model","Reminders","Error$","InProgress","Model_Default","Msg","anonService","Contact","GetStaticPage","About","Login","GetAvailableUserInfo","commonAuthService","Logout","GetUserInfo","UpdateEventTimestamp","DeleteRecord","GetProfile","AddProfile","EditProfile","DeleteProfile","GetContentSummary","Information","Summaries","displaySummary","summary","resolveProperty","getId","getExerciseId","getProperties","names","help","IInputType","ofType","valueOrDefault","select","parseOptionsForInput","parseOptionsForLabel","radioInline","inputType","hasId","inputElement","labelElement","props_3","genericElement","checkbox","SelectItem","SelectOption","Interop_createDefaultFilter","selectItems","searchQuery","jsItem_1","filteredItems","groupItem","jsItem","Interop_defaultProps","filterOptions","createCoords","lat","lng","accuracy","speed","createPosition","coords","LocationDescriptor","Position","DistanceFromCurrent","UtcOffsetMin","zeroPosition","getOrElse","elseValue","AutocompleteService","StrictBounds","Model__UpdateEventInfo_Z45EFA9A8","newEventInfo","prepareEventInfoForSubmit","model","clientTzOffsetMin","eventPublisher","Event$","triggerUpdateLocation","registerPlacesAutoCompleteImpDelays","commonInitCmds","waitForElementPromise","iteration","totalDelay","delayMs","log","resolve","pr_2","Loader","apiKey","version","libraries","load","google_2","maps","PromiseBuilder__Run_212F1D4B","placesAutoComplete","google","inputId","places","Autocomplete","event","clearInstanceListeners","placesService","PlacesService","place","getPlace","geometry","place_id","utc_offset_minutes","request","PlaceDetailsRequest","getDetails","newPosition","address","formatted_address","updateLocation","er","reject","er_1","onError_1","er_2","er_3","initCommon","navigator","geolocation","getCurrentPosition","updateAutocompleteService","service","circle","center","radius","Circle","setRadius","setCenter","createCircle","createLatLng","options_1","bounds","getBounds","strictBounds","setOptions","eventInfoCoordinatesToPosition","latValue","lngValue","toPosition","tryUpdateLocationFromSuggestions","suggestionsFunc","currentPosition","candidates","best","bind$0040_1","bind$0040_2","position","descriptor","newModel","dispatch_1","newModel_1","newModel_2","objectFieldSetter","cloneObj","flex_form","setWorkoutRecordId","newId","FieldValidationResult","FieldValidationResult__ToColour_Z5463E381","defaultColour","FieldValidationResult__Merge_30561432","msg1","msg2","msg1_1","msg2_1","msg1_2","msg2_2","msg1_3","msg2_3","mergeResults","CustomField$1","customRender","Help","IsRequired","OnChange","Validate","_value","BaseField$1","GetterSetterBaseField$2","validate","onChange","div_1","help_2","GetterSetterBaseField$2__GetValue_2B595","GetterSetterBaseField$2__CallOnChange","newObject","GetterSetterBaseField$2__get_Placeholder","JsGetterSetterBaseField$2","objectFieldGetter","object_1","TextFieldBase$2","isTextArea","fromValue","toValue","TextFieldBase$2__ProcessOnChange","event_1","elem_1","TextField$1","TextField$1_$ctor_7EE3C92A","TextAreaField$1","TextAreaField$1_$ctor_7EE3C92A","stringToOpt","TextFieldOpt$1","TextFieldOpt$1_$ctor_773DF4C9","TextAreaFieldOpt$1","TextAreaFieldOpt$1_$ctor_773DF4C9","PasswordField$1","PasswordField$1__ProcessOnChange","PasswordField$1_$ctor_7EE3C92A","inputWithButtons","incrementFunc","isValueEmpty","callOnChange","controlColumnDetails","getButton","increment","preventDefault","Option_7","Option_8","NumericFieldBase$2","emptyValues","withButtons","strValue","NumericFieldBase$2__IsValueEmpty_2B594","currentValue","SR_inputSequenceEmpty","finalValue","NumericFieldBase$2__ProcessOnChangeEx","NumericFieldBase$2__ProcessOnChange","object_2","tryParseInt","tryParseIntOpt","tryParseDouble","tryParseDecimal","PositiveIntField$1","PositiveIntField$1_$ctor_1CFD88AD","PositiveIntOptField$1","PositiveIntOptField$1_$ctor_Z7DEF6452","PositiveFloatField$1","PositiveFloatField$1_$ctor_Z618923D6","stringToOptDecimal","DecimalField$1","empty_2","DecimalField$1_$ctor_Z1A3DC0EC","DecimalFieldOpt$1","DecimalFieldOpt$1_$ctor_6EECF8B7","BaseDateTimeField$2","convertToDate","convertFromDate","isSet","formatString","inputFunc","parsed","_err","tryParse_2","valueAsDate","BaseDateTimeField$2__ProcessOnChange","dateTimeFormatString","DateTimeField$1","DateTimeField$1_$ctor_4797505E","DateTimeOptField$1","DateTimeOptField$1_$ctor_86BCFBD","DateField$1","DateField$1_$ctor_4797505E","DurationSecsFieldBase$1","withSeconds","dateStr","oldValue","DurationSecsFieldBase$1__incrementFunc","DurationSecsFieldBase$1__isValueEmpty_Z524259A4","DurationSecsFieldBase$1__ProcessOnChange","DurationSecsField$1","DurationSecsField$1_$ctor_1CFD88AD","DurationSecsFieldWithSeconds$1","DurationSecsFieldWithSeconds$1_$ctor_1CFD88AD","LocationField$1","suggestions","onSuggestionChosen","maxNameLength","currentLocation","LocationField$1__ProcessOnChange","list_5","suggestion","distance","dist","LocationField$1__RenderSuggestion","validateChoice","choices","nextValidate","SelectField$2","convert_1","convert","Option_9","SelectField$2__ProcessOnChange","SelectField$2_$ctor_Z7732D262","RadioField$2","optionValue","caption","Option_11","_event","RadioField$2__ProcessOnChange","RadioField$2__RenderChoice","Option_10","CheckboxField$1","_error","checked","CheckboxField$1__ProcessOnChange","CheckboxField$1_$ctor_Z387AD5E5","TagsField$1","tagsPredictionValues","_isDisabled","rawValue","elems_1","onNewValue","autocompleteInput","inputProperties","mixedOptions","react_select_search","headerTag","RatingField$1","converted","RatingField$1_$ctor_B10D3B5","FlexFormFields$1","callbackOnFieldAdd","FlexFormFields$1_$ctor_Z63A200CD","FlexFormFieldsGroup$1","FlexFormFields$1__Render","FlexFormFields$1__AddField_6235DF45","FlexFormFields$1__CanSubmit_2B595","FlexFormFields$1__BuildAddField","fieldBuilder","caption0","onChange0","required","FlexFormFields$1__AddCustom_693A43B3","CustomField$1_$ctor_693A43B3","FlexFormFields$1__AddText_Z44011C05","FlexFormFields$1__AddTextOpt_Z44636648","FlexFormFields$1__AddTextArea_Z44011C05","FlexFormFields$1__AddTextAreaOpt_Z44636648","FlexFormFields$1__AddPositiveInt_ZAAC24","FlexFormFields$1__AddDecimal_7B82A45","FlexFormFields$1__AddPositiveFloat_1D6F52FB","FlexFormFields$1__AddDateTime_2636DDCF","FlexFormFields$1__AddDateTimeOpt_C9F34CC","FlexFormFields$1__AddRating_Z716E223C","FlexFormFields$1__AddDurationSecs_ZAAC24","FlexFormFields$1__AddTags_Z63D88B1E","fieldName_1","validate_1","TagsField$1_$ctor_32D33D73","FlexFormFields$1__AddSelection_158231B6","FlexFormFields$1__AddSelection_Z70244BEA","FlexFormFields$1__AddRadiosInline_Z70244BEA","RadioField$2_$ctor_14949C87","FlexFormFields$1__AddCheckbox_264AA22A","FlexFormFields$1__AddGroup_6DFDD678","FlexFormFieldsGroup$1_$ctor_38CD3B67","FlexFormState","FlexFormState__CanSubmit","FlexFormBase$1","submit","FlexFormBase$1__get_State","FlexFormBase$1__set_State_Z3615493C","FlexFormBase$1__set_SubmitCaption_Z721C83C5","FlexFormBase$1__SetState","isLoading","errorOpt","FlexFormBase$1__SetErrorOpt_6DFDD678","FlexFormBase$1__Render_2B595","isInProgress","FlexFormState__IsInProgress","buttons","cannotSubmit","FieldValidationResult__IsErrorResult","FlexFormBase$1__TriggerSubmit_2B595","FlexForm$1","FlexForm$1__get_Fields","FlexForm$1_$ctor_2ABDDB55","FlexFormTuple$2","onChangeFst","onChangeSnd","objectArg","f2_1","objectArg_1","allFields","FlexFormTuple$2__get_FieldsFst","FlexFormTuple$2__get_FieldsSnd","FlexFormTuple$2_$ctor_5AE4FFF0","noValidation","renderCurrentEventInfoDetails","smallText","isBold","space","Option_12","clientDate","locationDate","StringBuilder__get_Length","addEventInfoToFlexForm","form","LocationField$1_$ctor_455E8BE1","FlexFormFields$1__AddLocation_Z52938230","addEventInfoToFlexFormEim","eimModel","onStrictBoundsChange","renderSetStrictBounds","getSuggestions","eventInfoCoordinatesToPositionOrDefault","distanceInMetersBetweenPositions","pos2","lat1","long1","lat2","long2","rLat1","rLat2","diffLat","diffLon","asin","sin","cos","distanceInMeters","pos1","Formlet$1","CanSubmit","FlexFormWithFormlets$1","formlets","formlet","RecaptchaToken","IsRecaptchaReady","ContactSent","IsLoading","_nonEmpty","viewForm","Request","Response","Page","ViewProfile_Model","ViewProfile_Msg","AddEditProfile_Model","ProfileInfo","AddEditProfile_Msg","AddEditProfile_noValidation","AddEditProfile_genders","AddEditProfile_stringToGender","Records","PendingRequests","addPendingRequest","requestsOpt","pendingRequestDone","date_3","toDateString","diff","countStr","prevDate","nextDate","children_10","param","EntryDescriptor__GetNewDateButton","getModuleNewDateButtons","date_2","children_6","children_8","initPagingOptions","SearchType","SearchQuery","Query","SearchResults","TotalCount","Model__FetchFunc_Z524259A4","searchType","_validateSearchQuery","DataExpected","Model$2","EIMModel","EditHelperData","Model$2__IsEditing","Msg$2","dataExpected","initCommon_1","initNew","fetchAction","initEdit","recordId","submitAction","successAction","update_1","buildForm","form_1","dataExpectedItem","Model$2__IsItemReady_149A13CF","Actions$1","Model$1","DateRange","LastFetchSize","LastPagingOptions","Model$1__CanFetchMore","Msg$1","actions","pageSize","ascending","dateRange","initDateRange","dateRange_","dateRange__1","dispatch_2","dispatch_3","pagingOptions","basePagingOptions","PagingOptionsModule_optionsForNextPage","currencyDetails","SimpleJson_mapKeys","Code","Symbol$","SymbolNative","DecimalDigits","getCurrencyCaption","ccy","currenciesOptions","popularCurrenciesOptions","supportedCurrenciesForEditing","TableOption","assetValueService","GetRecordsForChart","financialService","GetHierarchy","ImportHierarchyData","GetAssetValuesForChart","AddGroup","EditGroup","DeleteGroup","AddAsset","EditAsset","DeleteAsset","GetAsset","AddCashflow","EditCashflow","DeleteCashflow","valuesToTable","deleteEntry","children_14","children_12","Tab_Option","tab","cta","Label_label","Omnicv_Shared_FinancialAPI_CurrencyValue__CurrencyValue_ToDisplayString","AssetValueData","FileUploadData","CurrentFileName","EditModel$1","createEditModel","EditMsg$1","State","FinancialTree","Model__GetCurrentFilters","FileUploadMsg","assetTypes","assetTypesLookup","cashflowTypes","cashflowTypesLookup","frequencies","optionalCurrencyChoices","getDisplayCurrency","_commonOnCancel","DisplayHierarchy_addGroup","parentOrType","newGroup","DisplayHierarchy_groupTypeToState","DisplayHierarchy_viewByGroupType","targetGroupType","DisplayHierarchy_depthToPrefix","depth","DisplayHierarchy_processGroupNode","inProgress","depth_1","node_1","DisplayHierarchy_processAsset","auto","cashflowInfo","cashflowType","DisplayHierarchy_processCashflow","DisplayHierarchy_processChildNode","DisplayHierarchy_buildTree","tree_","tree__1","totalItem","totals","DisplayHierarchy_view","updateFilter","newFilter","preamble","switchTabTrigger","targetGroup","typeOptions","event_2","elem_2","props_2","mainControlButtons","arg30$0040","progressModal","modal","busyModal","mainViewElements","DisplayHierarchy_treeToList","Main_service","Main_update","newCurrency","subMsg","subMsg_1","subMsg_2","subMsg_3","subMsg_4","dispatch_4","Groups_update","dispatch_5","Assets_update","dispatch_6","isLatest","singleton_2","assetValueRecord","Assets_updateValue","dispatch_7","_session","Cashflows_update","dispatch_8","bytes_1","DisplayHierarchy_updateImport","resultModel","Main_view","viewHierarchy","editing","Groups_viewForAddEdit","states","t_1","model_1","coreButtons","extraButtons","DisplayHierarchy_viewSelectAdd","FlexFormFields$1__AddDecimalOpt_Z2D27E1FA","Assets_viewForAddEdit","_commonOnCancelCF","Cashflows_viewForAddEdit","Assets_viewAddValue","file_1","name_12","DisplayHierarchy_viewImport","Asset","repsWithWeightRecordService","repsWithBodyWeightRecordService","enduranceRecordService","intervalsDurationRecordService","intervalsRepsRecordService","fitnessService","GetExercise","GetExercises","AddExercise","EditExercise","DeleteExercise","StartActiveWorkoutRecord","ConcludeActiveWorkoutRecord","DeleteActiveWorkoutRecord","DeleteWorkoutRecord","EditWorkoutRecord","GetWorkoutRecord","AddExerciseRecords","GetExerciseRecord","MarkExerciseFavourite","GetWorkout","GetWorkouts","AddWorkout","EditWorkout","DeleteWorkout","SetExercisesForWorkout","RemoveExerciseFromWorkout","GetWorkoutExercises","GetWorkoutExercisesCandidates","MarkWorkoutFavourite","GetWorkoutCircuitData","GetWorkoutRecords","GetTrainingPlan","GetTrainingPlans","AddTrainingPlan","EditTrainingPlan","DeleteTrainingPlan","SetWorkoutsForTrainingPlan","RemoveWorkoutFromTrainingPlan","GetTrainingPlanWorkouts","GetTrainingPlanWorkoutsCandidates","MarkTrainingPlanFavourite","GetTrainingPlanWorkoutRecords","DeleteFavourite","GetFitnessEditHelperDataTrainingPlan","GetFitnessEditHelperDataWorkout","GetFitnessEditHelperDataExercise","MoveAction","moveEntryInList","entryId","moveAction","isLast","targetIndex_1","source_1","isDone","removeAt","insertAt","FitnessAction","createFitnessListActions","moveFunc","createFitnessListAction","defaultDisplayWorkoutActions","displayWorkout","workout","finalActions","defaultDisplayExerciseForRecordingActions","displayClickableColumn","cursor","formatSeconds","displayRepsWithWeight","name_4","displayRepsWithBodyWeightRecord","displayEnduranceRecord","displayIntervalsDurationRecord","displayIntervalsRepsRecord","displayExerciseRecordCommon","deleteFunc","copyDataFunc","main","recordName","id_1","hasNotes","getExerciseRecordDisplayInfo","WorkoutRecordDescriptor","Time","WorkoutRecordDescriptor__get_GroupingKey","displayWorkoutRecord","workoutsMap","workoutRecordData_","workoutRecordData__1","workoutRecordData","displayWorkoutRecordGroup","workoutRecordLookup","descriptors","final","head_1","WorkoutRecordDescriptor_DisplayGroupAsSingle_Z40DA17B4","displayDescriptors","workoutRecordData_1","WorkoutRecord__IsActive","progress","WorkoutRecordDescriptor_FromWorkoutRecord","groupWorkoutRecords","displayWorkoutRecordsOnly","displayWorkoutLog","workoutLog","w","exercisesMap","w_1","workoutByDate","exercisesByDate","workouts","exercises","workoutElements","exercisesElements","exerciseMap","exerciseRecord_","exerciseRecord__1","exerciseRecord","record_","record__1","displayExerciseRecordEx","displayDayWorkoutLog","displayDailyExerciseRecords","group_","group__1","exerciseRecords","displayExerciseRecord","emptyRes","getE1RMFromExerciseRecord","getRepetitionsFromExerciseRecord","getSummaryFromExerciseRecords","ViewState","Entries","CandidateEntries","SelectedCandidateEntries","Model$2_Default_Z524259C1","CandidateFunctions$1","Get","Set$","GetId","Set","Common_update","getData","getEntries","updateEntries","candidateFuncs","deleteRecord","profileId_3","finalIds","profileId_7","viewState","profileId_2","candidateId","candidateIds","t$0027_mut","SetTreeModule_toList","profileId_4","newEntries","ids","x_7","x_8","finalIds_1","x_9","Common_viewSelectCandidates","getBasicInfo","selectedCandidateEntries","Common_displayCandidate","list_4","Main_Model","Main_Msg","Main_trainingPlanActions","TrainingPlan_service","TrainingPlan_displayWorkouts","forReorder","Workout_service","Workout_displayExercises","exercise","displayExerciseForRecording","Workout_view","Workout_viewReorder","activeWorkoutRecord","workoutRecords","showPlainHistory","empty_3","_workoutRecordLookup","displayWorkoutRecordGroupPlain","Workout_viewMain","Exercise_service","ExerciseRecord_service","ExerciseRecord_Model","ExerciseRecord_Model_Default_Z524259C1","ExerciseRecord_Model__GetExerciseId","ExerciseRecord_Msg","ExerciseRecord_displayProperties","data_","data__1","ExerciseRecord_displayProperty","Names","Values","Filter","Common_init","markEntryFavourite","Workouts_service","Workouts_displayWorkouts","Workouts_workoutActions","Exercises_service","Exercises_exerciseActions","Exercises_displayExercises","lowerFilter","exercise_1","Exercises_displayExercise","SimpleFormView$2","submitNewAction","submitEditAction","mainView","SimpleFormView$2__Update","SimpleFormView$2__initCommon","TimerOptions","DurationSecs","TimerOptions_$reflection","defaultTimer","RecordModel$1","RecordId","PreviousEntries","RecordModel$1_$reflection","RecordModel$1__IsEditing","RecordModel$1__GetExerciseId","RecordMsg$1","RecordMsg$1_$reflection","AddEditExerciseRecordHandler$1","createDefault","displayRecord","AddEditExerciseRecordHandler$1_$ctor_20729692","AddEditExerciseRecordHandler$1__InitCommon","withEventInfo","contentTypeId","exerciseId","initCommonNoRegistration","AddEditExerciseRecordHandler$1__InitCommonWithInfo","AddEditExerciseRecordHandler$1__Update","eventInfo_1","handlePreviousEntriesUpdate","triggerFetchExercise","midnight","todayRecords","previousRecords","lastDate","midnight_1","activeWorkoutEventInfo","sourceEventInfo","EventInfo__ClearLocation","newRecord","setId","now_1","eventInfo_6","result_4","timerCmd","timerOptions","timerEnd","finalRecord","eventInfo_8","timerOptions_1","TimerOptions__Serialise","AddEditExerciseRecordHandler$1__BuildForm","addEventInfoWithSuggestionsToFlexForm","AddEditExerciseRecordHandler$1__buildFormBase","AddEditExerciseRecordHandler$1__GetTimerOptions_Z524259C1","TimerOptions_Parse_Z721C83C5","AddEditExerciseRecordHandler$1__View","exerciseTitle","mainFormElement","timerElements","FlexFormFields$1__AddDurationSecsWithSeconds_ZAAC24","AddEditExerciseRecordHandler$1__ViewTimerOptions","equals_2","previous","AddEditExerciseRecordHandler$1__CopyData","displayDailySingleExerciseRecords","Handlers_noValidation","Handlers_displayRecord","getInfo","Handlers_repsWithWeight","_editing","_model","Handlers_repsWithBodyWeight","Handlers_endurance","FlexFormFields$1__AddPositiveIntOpt_414042FF","Handlers_intervalsDuration","Handlers_intervalsReps","Msg_$reflection","Model_$reflection","applyHandlerInit","handler","toModel","toMsg","isNew","noFetch","AddEditExerciseRecordHandler$1__InitNew","AddEditExerciseRecordHandler$1__InitEdit","initEither","lastSection","getLastSection","copyOfStruct_2","copyOfStruct_1_1","copyOfStruct_3","copyOfStruct_1_2","copyOfStruct_4","copyOfStruct_1_3","copyOfStruct_5","copyOfStruct_1_4","copyOfStruct_1","arg_1_2","arg_1_3","arg_1_4","mapModelToEIMMsg","ExerciseRecordsMany_msgFromExerciseRecord","record_2","record_3","record_4","record_5","ExerciseRecordsMany_modelToExerciseRecord","ExerciseRecordsMany_ModelMany","Models","ExerciseRecordsMany_ModelMany__GetEventInfo","ExerciseRecordsMany_MsgMany","ExerciseRecordsMany_getFormletHandle","recordRendering","ExerciseRecordsMany_renderModelForm","mainResult","ExerciseRecordsMany_canSubmitModelForm","ExerciseRecordsMany_view","ExerciseRecordsMany_getFormlet","getWorkoutId","soundAudioContext","Audio","permissionsToCheck","LogInState","CurrentTimestamp","CurrentTimerExpiry","CheckedPermissions","Model__IsLoggedIn","queryPermission","permission","descriptor_1","permissions","queryPermissionCmd","burgerLine","mainNavBarId","profileColours","descriptorButton","value_47","displayPermissionsWarnings","onchange","handlePermissionCheckState","children_9","elems_7","elems_6","elems_3","elems_4","isLoggedIn","navbarBandChildren","role","clientModuleDescriptorToMenu","viewMainNavBar","displayFavourites","duration","durationStr","displayTimer","serverVersion","displayVersionWarning","extractFrequentTags","DiaryEditingView$1","getDefault","tagsGetter","tagsSetter","addTitle","editTitle","buildFormMain","DiaryEditingView$1_$ctor_6E4FAFB9","DiaryEditingView$1__InitNew","dateTime","dateStrToDateTime","DiaryEditingView$1__fetchAddHelperData","DiaryEditingView$1__setStartingDate","DiaryEditingView$1__InitEdit","DiaryEditingView$1__fetchData","initEditWithHelperData","DiaryEditingView$1__Update","DiaryEditingView$1__getViewUrl_Z50E92BB6","DiaryEditingView$1__View","DiaryEditingView$1__getRecentEntries_Z50E92BB6","DiaryEditingView$1__buildForm","addTag_1","DiaryEditingView$1__getStartingDate_Z50E92BB6","diaryEditing","newTags","reviewEditing","interactionEditing","physicalModule","weightService","bloodPressureService","bodilyFunctionsService","temperatureService","isDuringSleep","isNightOpt","isNight","displaySingleRecord","displayRecordDetails","displayEventInfo","editRoute","displayActions","displayNavigation","reloadFun","list_8","WeightView_actions","BodilyFunctionsView_getEditRoute","BodilyFunctionsView_actions","BodilyFunctionsView_getFunctionName","functionType","BodilyFunctionsView_displayRecord","functionName","BodilyFunctionsView_columnsOptions","BodilyFunctionsView_headerColumOptions","BodilyFunctionsView_dataColumOptions","BodilyFunctionsView_summaryRow","BodilyFunctionsView_getDays","days_3","BodilyFunctionsView_viewList","readOnly","today","arg00$0040","finish_1","newFinish_1","BodilyFunctionsView_displaySummaryGroup","bodilyFunctionType","records","groups","counts","daysWithSleepEliminations","average","maximum","averager","total","DivideByInt","average_1","dates","BodilyFunctionsView_displaySummary","recordData","BodilyFunctionsView_displayRecordGroup","BodilyFunctionsView_displayAllRecords","PhysicalView_actions","PhysicalView_getEditRoute","WeightView_getEditRoute","PhysicalView_displayRecord","BloodPressureView_displayRecord","TemperatureView_displayRecord","WeightView_displayRecord","Physical_PhysicalView$1","viewAll","Physical_PhysicalView$1_$ctor_Z7E8B6EC8","Physical_PhysicalView$1__InitNew_5D846BF8","Physical_PhysicalView$1__fetchAddHelperData","Physical_PhysicalView$1__InitEdit","Physical_PhysicalView$1__fetchData","Physical_PhysicalView$1__Update","Physical_PhysicalView$1__View","Physical_PhysicalView$1__buildForm","Physical_weightEditing","Physical_bloodPressureEditing","Physical_bodilyFunctionsEditing","Physical_temperatureEditing","workoutTypes","stringToWorkoutType","AddEditFitnessView$1","fetchEntry","fetchEditHelperData","AddEditFitnessView$1_$ctor_Z7DF71A99","AddEditFitnessView$1__InitNew_5D846BF8","SimpleFormView$2__InitNewCore_Z292EED19","AddEditFitnessView$1__fetchAddHelperData","AddEditFitnessView$1__InitEdit","fetchHelperDataAction","SimpleFormView$2__InitEditCore_Z466B74A6","SimpleFormView$2__InitEditWithHelperData_3AAD8C48","AddEditFitnessView$1__fetchData","AddEditFitnessView$1__View","Model$2__IsItemReady_Z4CD6E166","Model$2__IsReady","SimpleFormView$2__ViewForm_Z44A2099C","trainingPlanEditing","_dispatch","workoutEditing","exerciseEditing","contentTypes","Workout_getEditInfos","Workout_WorkoutEditView__getRoute_4B9C34E5","workoutRecordEditor","LazyProps$1","render","equal","Components_LazyView$1","Component","shouldComponentUpdate","nextProps","_nextState","Common_lazyView2With","ErrorBoundaryProps","Inner","ErrorComponent","ErrorBoundaryState","HasErrors","ErrorBoundary","componentDidCatch","info_1","Program_Internal_useRootApi","Tuple_mapFirst","Tuple_mapSecond","AnonymousPage","SessionPage","CurrentRoute","ActivePage","NavigationModel","SessionLoading","LastSessionRefresh","setRouteValue","ContactData_1","init_3","path","ViewProfile_init","init_5","init_6","BodilyFunctionsView_init","WeightView_init","patternInput_20","patternInput_21","Item_21","patternInput_22","Item_22","patternInput_23","Item_23","patternInput_24","Item_24","patternInput_25","Item_25","patternInput_26","Item_26","patternInput_27","Item_27","patternInput_28","patternInput_29","init_7","patternInput_30","patternInput_31","Item_31","patternInput_32","Item_32","patternInput_33","Item_33","patternInput_34","TrainingPlan_init","Item_34","patternInput_35","Item_35","patternInput_36","Item_36","patternInput_37","Workout_init","Item_37","patternInput_38","Item_38","patternInput_39","Item_39","patternInput_40","Exercise_init","Item_40","patternInput_41","Item_41","patternInput_42","Item_42","patternInput_43","_contentTypeId","ExerciseRecord_init","Item_43","patternInput_44","Item_44","patternInput_45","Item_45","patternInput_46","ExerciseRecordsMany_initNewMany","Item_46","patternInput_47","Workout_WorkoutEditView__fetchAddHelperData","Workout_WorkoutEditView__InitNew","Item_47","patternInput_48","Workout_WorkoutEditView__fetchData","Workout_WorkoutEditView__InitEdit","Item_48","init_9","Msg_1","setRoute","optRoute","refreshSession","newSession","forceRefresh","lazyView2","view_1","Common_lazyView2","contentFromAuthPage","authPage","model_2","FlexFormFields$1__AddDate_2636DDCF","AddEditProfile_view","model_3","model_4","model_5","model_6","view_2","model_7","elms","view_3","arg_6","subTitle","getEditRoute","displayRecords","viewCommon","PhysicalView_view","arg_7","arg_8","graph","ResponsiveContainer","WeightView_viewList","view_4","view_5","arg_12","arg_15","arg_16","model_12","dispatch_12","hierarchy","favouritesElems","favourite","trainingPlan","onClick_1","removeFavourite","Main_displayFavourite","tradingPlanElems","Main_displayTrainingPlan","Main_displayHierarchy","Main_view_1","arg_17","model_13","dispatch_13","list_2","Workouts_view","arg_18","model_14","dispatch_14","Exercises_view","model_15","dispatch_15","TrainingPlan_viewReorder","TrainingPlan_viewMain","TrainingPlan_view","arg_20","model_16","dispatch_16","model_17","dispatch_17","model_18","dispatch_18","model_19","dispatch_19","workoutIdOpt","displayExerciseRecords","Exercise_view","model_20","dispatch_20","arg_25","model_21","ExerciseRecord_view","model_22","dispatch_21","view_6","arg_27","model_23","dispatch_22","arg_28","model_24","dispatch_23","Workout_WorkoutEditView__buildForm","Workout_WorkoutEditView__View","arg_29","currentProfileId","ViewProfile_view","contentFromPage","page","React","view_7","grecaptcha","ready","view_8","view_9","hostname","path_2","encodeURIComponent","FlexFormFields$1__AddPassword_Z44011C05","view_10","hero","demoPassword","demoUser","user","password","content_3","view_11","timer","intervalId","debug","subscribeLocation","subscribeLocation_1","syncDispatch","rb","reentered","terminated","dispatch$0027","wix_1","wix$0027","ix","RingBuffer$1__Push_2B595","processMsgs","nextMsg","model$0027","sub$0027","ex_1","ex_2","ProgramModule_runWithDispatch","ProgramModule_runWith","ProgramModule_run","urlUpdate","onChangeRef","mapInit","mapUpdate","mapView","mapSetState","mapSubscribe","mapTermination","userInit","unitVar_1","userUpdate","userView","userSetState","userSubscribe","Sub_batch","lastLocation","href_1","addEventListener","removeEventListener","idPrefix","ProgramModule_map","ProgramModule_toNavigable","location_1","querystring","states_mut","parseHelp","segments","segments_1","splitUrl","parseHash","locationSub","activeWorkout","Model__NeedsTimer","ProgramModule_withSubscription","init_10","play","session_1","subModel","updatedSession","subModel_1","update_2","subModelRes","newSession_1","cmd_4","subModel_2","targetDate","timezone","update_3","page_1","cmd_5","subModel_3","update_4","page_2","cmd_6","subModel_4","cmdSubmit","execute","update_5","page_3","cmd_7","subModel_5","tupledArg_14","tupledArg_13","tupledArg_12","update_6","page_4","cmd_8","subMsg_6","subModel_6","tupledArg_17","tupledArg_16","tupledArg_15","ViewProfile_update","page_5","cmd_9","subModel1","cmd_10","subMsg_7","subModel_7","tupledArg_20","tupledArg_19","tupledArg_18","AddEditProfile_update","page_6","cmd_11","subModel1_1","cmd_12","subModel_8","tupledArg_23","tupledArg_22","tupledArg_21","profileId_1","update_7","page_7","cmd_13","subModel_9","tupledArg_26","tupledArg_25","tupledArg_24","page_8","cmd_14","matchValue_9","subModel_10","tupledArg_29","tupledArg_28","tupledArg_27","page_9","cmd_15","subModel_11","tupledArg_32","tupledArg_31","tupledArg_30","page_10","cmd_16","matchValue_11","subModel_12","tupledArg_35","tupledArg_34","tupledArg_33","processSuccess","finalRecords","updatedModel","update_8","arg_11","page_11","cmd_17","subModel_13","tupledArg_38","tupledArg_37","tupledArg_36","PhysicalView_update","page_12","cmd_18","matchValue_13","subModel_14","tupledArg_41","tupledArg_40","tupledArg_39","BodilyFunctionsView_update","page_13","cmd_19","subModel_15","tupledArg_44","tupledArg_43","tupledArg_42","WeightView_update","page_14","cmd_20","matchValue_15","subModel_16","tupledArg_47","tupledArg_46","tupledArg_45","page_15","cmd_21","Item_49","subModel_17","tupledArg_50","tupledArg_49","tupledArg_48","page_16","cmd_22","Item_52","matchValue_17","subModel_18","tupledArg_53","tupledArg_52","tupledArg_51","page_17","cmd_23","Item_55","subModel_19","tupledArg_56","tupledArg_55","tupledArg_54","page_18","cmd_24","Item_58","matchValue_19","subModel_20","tupledArg_59","tupledArg_58","tupledArg_57","page_19","cmd_25","Item_61","subModel_21","tupledArg_62","tupledArg_61","tupledArg_60","update_9","page_20","cmd_26","Item_64","matchValue_21","subModel_22","tupledArg_65","tupledArg_64","tupledArg_63","update_10","page_21","cmd_27","Item_67","subModel_23","tupledArg_68","tupledArg_67","tupledArg_66","Main_update_1","page_22","cmd_28","Item_70","matchValue_23","matchResult_23","subModel_24","tupledArg_71","tupledArg_70","tupledArg_69","Workouts_update","page_23","cmd_29","Item_73","matchResult_24","subModel_25","tupledArg_74","tupledArg_73","tupledArg_72","Exercises_update","page_24","cmd_30","Item_76","matchValue_25","matchResult_25","subModel_26","tupledArg_77","tupledArg_76","tupledArg_75","TrainingPlan_update","page_25","cmd_31","Item_79","matchResult_26","subModel_27","tupledArg_80","tupledArg_79","tupledArg_78","page_26","cmd_32","Item_82","matchResult_27","subModel_28","tupledArg_83","tupledArg_82","tupledArg_81","Workout_update","page_27","cmd_33","Item_85","matchValue_28","matchResult_28","subModel_29","tupledArg_86","tupledArg_85","tupledArg_84","page_28","cmd_34","Item_88","matchResult_29","subModel_30","tupledArg_89","tupledArg_88","tupledArg_87","Exercise_update","page_29","cmd_35","Item_91","matchResult_30","subModel_31","tupledArg_92","tupledArg_91","tupledArg_90","arg_30","page_30","cmd_36","Item_94","matchResult_31","subModel_32","tupledArg_95","tupledArg_94","tupledArg_93","ExerciseRecord_update","arg_31","page_31","cmd_37","Item_97","subMsg_33","matchValue_32","matchResult_32","subModel_33","tupledArg_98","tupledArg_97","tupledArg_96","update_11","arg_32","page_32","cmd_38","Item_100","cmd_39","dateTime_1","dateTime_2","dateTime_3","dateTime_4","getSetTimerMsg","matchValue_34","matchResult_33","subModel_34","tupledArg_101","tupledArg_100","tupledArg_99","ExerciseRecordsMany_initNewRecordModel","ExerciseRecordsMany_update","page_33","cmd_40","Item_103","subMsg_35","matchValue_35","matchResult_34","subModel_35","tupledArg_104","tupledArg_103","tupledArg_102","Workout_WorkoutEditView__Update","arg_34","page_34","cmd_41","Item_106","resultModel_1","cmd_42","newSession_2","subMsg_36","matchValue_36","matchResult_35","subModel_36","subModel_37","dispatch_9","dispatch_10","dispatch_11","resMsg","resMsg_1","ExerciseRecordsMany_mapModelToEIMMsg","x_105","Item_107","Item_108","f1","ProgramModule_mkProgram","view_12","errorElement","renderCatchSimple","lazyView2With","placeholderId","ProgramModule_withSetState","client","react_dom","Program_Internal_withReactSynchronousUsing"],"sourceRoot":""}