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CACSojB,KADTpjB,CACSojB,KADTpjB,CACSojB,KADTpjB,CACSojB,MAZ5B,IAAA/wD,EAAA,CAe8BulC,EAAAC,EAAAsrB,EAAAC,EAAAC,IADTrjB,EACSpI,EADToI,CACSnI,EADTmI,CACSmjB,EADTnjB,CACSojB,EADTpjB,CACSqjB,EADTrjB,CACSqjB,KADTrjB,CACSqjB,KADTrjB,CACSqjB,MAf9B,IAAAhxD,EAAA,CAkBgCulC,EAAAC,EAAAsrB,EAAAC,EAAAC,EAAAC,IADTtjB,EACSpI,EADToI,CACSnI,EADTmI,CACSmjB,EADTnjB,CACSojB,EADTpjB,CACSqjB,EADTrjB,CACSsjB,EADTtjB,CACSsjB,KADTtjB,CACSsjB,MAlBhC,IAAAjxD,EAAA,CAqBkCulC,EAAAC,EAAAsrB,EAAAC,EAAAC,EAAAC,EAAAC,IADTvjB,EACSpI,EADToI,CACSnI,EADTmI,CACSmjB,EADTnjB,CACSojB,EADTpjB,CACSqjB,EADTrjB,CACSsjB,EADTtjB,CACSujB,EADTvjB,CACSujB,MArBlC,IAAAlxD,EAAA,CAwBoCulC,EAAAC,EAAAsrB,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,IADTxjB,EACSpI,EADToI,CACSnI,EADTmI,CACSmjB,EADTnjB,CACSojB,EADTpjB,CACSqjB,EADTrjB,CACSsjB,EADTtjB,CACSujB,EADTvjB,CACSwjB,GAEtC,GAAU,yHAAV,CAA+H96B,EAAM2vB,eAjCjJ,U,OAgDJ3qB,EAAmH,GAAA6kB,G,OAAnH,GAAU,6GAAV,CAAA7kB,IDGJ,ECjF0BnqB,G,eALX8zC,E,OALD,OACE,UACN,OACM,GACE,OACHA,EAAA,GAAS,cAAT3pB,GAAA,EAAAA,K,SACe,IDwDlC,GCnDI,wE,SCZcyyB,EAASsD,G,MACzB,O,SAHgBtD,EAASsD,G,MAAa,IAAMtD,KAAasD,IAG1C,CAActD,EAASsD,ODWpC,iC,uIhE+DoBC,E,GAASrC,E,2CAC1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AS04E,EAAsBxpB,GAC9B,IAAIypB,EAAoBv7E,EAAE0C,EAAKovD,GAAM,CACpC,IAAItqD,EAAI,IAAIzH,MAAM,uBAAyB+xD,EAAM,KAEjD,MADAtqD,EAAE08D,KAAO,mBACH18D,EAEP,OAAO9E,EAAIovD,GAEZupB,EAAej4E,KAAO,WACrB,OAAOhE,OAAOgE,KAAKV,IAEpB24E,EAAeG,QAAUF,EACzBG,EAAO1xE,QAAUsxE,EACjBA,EAAez4E,GAAK,O","sources":["webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Util.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Types.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Int32.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Numeric.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/lib/long.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Long.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Date.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/RegExp.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/String.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Global.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Option.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Array.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/List.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/AsyncBuilder.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Choice.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Async.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Event.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Observable.js","webpack:///./src/Client/output/fable_modules/Fable.Elmish.3.1.0/prelude.fs","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Timer.js","webpack:///./src/Client/output/fable_modules/Fable.Elmish.3.1.0/cmd.fs","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/FSharp.Core.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/FSharp.Collections.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Seq.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Range.js","webpack:///./src/Client/output/fable_modules/Fable.Elmish.3.1.0/ring.fs","webpack:///./src/Client/output/fable_modules/Fable.Elmish.3.1.0/program.fs","webpack:///./src/Client/output/fable_modules/Fable.Elmish.React.3.0.1/common.fs","webpack:///./src/Client/output/fable_modules/Fable.Elmish.Browser.3.0.5/navigation.fs","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Map.js","webpack:///./src/Client/output/fable_modules/Fable.Elmish.Browser.3.0.5/prelude.fs","webpack:///./src/Client/output/fable_modules/Fable.Elmish.Browser.3.0.5/parser.fs","webpack:///./src/Client/Pages.fs","webpack:///./src/Client/output/fable_modules/FSharpPlus.1.3.2/Internals.fs","webpack:///./src/Client/output/fable_modules/FSharpPlus.1.3.2/Control/Functor.fs","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/lib/big.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Decimal.js","webpack:///./src/Client/output/fable_modules/FSharpPlus.1.3.2/Control/Monad.fs","webpack:///../PortalLibs/src/PortalLibs.Shared/Extensions/Option.fs","webpack:///./src/Client/output/fable_modules/Feliz.Bulma.2.19.0/ElementBuilders.fs","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/MapUtil.js","webpack:///./src/Client/output/fable_modules/Fable.FontAwesome.2.0.0/FontAwesome.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Util.fs","webpack:///./src/Client/output/fable_modules/Thoth.Elmish.Debouncer.1.0.0/Debouncer.fs","webpack:///./src/Client/output/fable_modules/Fable.Promise.3.2.0/Promise.fs","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Reflection.js","webpack:///./src/Shared/ApplicationSettings.fs","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Guid.js","webpack:///../PortalLibs/src/PortalLibs.Shared/Extensions/Map.fs","webpack:///./src/Client/output/fable_modules/FSharpPlus.1.3.2/Control/Indexable.fs","webpack:///./src/Client/output/fable_modules/Feliz.1.68.0/ReactInterop.js","webpack:///./src/Client/output/fable_modules/Feliz.1.68.0/React.fs","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/TimeSpan.js","webpack:///./src/Client/output/fable_modules/Feliz.UseElmish.1.6.0/UseElmish.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Components/DebouncedView.fs","webpack:///./src/Client/output/fable_modules/Fable.React.8.0.1/Fable.React.Helpers.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Common.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Elements/Form/Field.fs","webpack:///./src/Client/output/fable_modules/Fulma.Extensions.Wikiki.Checkradio.2.0.1/Checkradio.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Components/Inputs.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Model.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Elements/Icon.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Elements/Button.fs","webpack:///./src/Client/output/fable_modules/Fulma.Extensions.Wikiki.Tooltip.3.0.0/Tooltip.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Components/Dropdown.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Components/ReactTransitionGroup/ReactTransitionGroup.fs","webpack:///./src/Client/output/fable_modules/Fable.ReactTransitionGroup.1.0.0-beta-003/Fable.ReactTransitionGroup.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Elements/Heading.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Components/NewTableNext.fs","webpack:///./src/Client/output/fable_modules/FSharpPlus.1.3.2/Extensions/List.fs","webpack:///./src/Client/output/fable_modules/Feliz.MaterialUI.1.2.6/Mui.fs","webpack:///./src/Client/output/fable_modules/Feliz.MaterialUI.1.2.6/Flatten.fs","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Random.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Double.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Uri.js","webpack:///./src/Client/output/fable_modules/Fable.Parsimmon.4.1.0/Parsimmon.js","webpack:///./src/Client/output/fable_modules/Fable.Parsimmon.4.1.0/Parsimmon.fs","webpack:///./src/Client/output/fable_modules/Fable.SimpleJson.3.24.0/Parser.fs","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/BigInt/n.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/BigInt/z.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/BigInt.js","webpack:///./src/Client/output/fable_modules/Fable.SimpleJson.3.24.0/SimpleJson.fs","webpack:///./src/Client/output/fable_modules/Fable.SimpleJson.3.24.0/TypeCheck.fs","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/DateOffset.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/DateOnly.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/TimeOnly.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/BitConverter.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Set.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/MutableMap.js","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/MutableSet.js","webpack:///./src/Client/output/fable_modules/Fable.SimpleJson.3.24.0/TypeInfo.Converter.fs","webpack:///./src/Client/output/fable_modules/Fable.SimpleJson.3.24.0/isBrowser.js","webpack:///./src/Client/output/fable_modules/Fable.SimpleJson.3.24.0/Json.Converter.fs","webpack:///./src/Client/output/fable_modules/Fable.SimpleJson.3.24.0/quote.js","webpack:///./src/Client/output/fable_modules/Elmish.Bridge.Client.6.0.1/Library.fs","webpack:///./src/Client/ContractPage/ContractPageModel.fs","webpack:///./src/Client/ContractsPage/ContractsPageModel.fs","webpack:///./src/Client/CompanyPage/CompanyPageModel.fs","webpack:///./src/Client/output/fable_modules/Thoth.Json.9.0.0/Types.fs","webpack:///./src/Client/output/fable_modules/Thoth.Json.9.0.0/Decode.fs","webpack:///./src/Client/output/fable_modules/Thoth.Json.9.0.0/Encode.fs","webpack:///./src/Client/output/fable_modules/Fable.Remoting.Client.7.25.0/Types.fs","webpack:///./src/Client/output/fable_modules/Fable.Remoting.Client.7.25.0/Http.fs","webpack:///./src/Client/output/fable_modules/Fable.Remoting.Client.7.25.0/Extensions.fs","webpack:///./src/Client/output/fable_modules/Fable.Remoting.Client.7.25.0/Proxy.fs","webpack:///./src/Client/output/fable_modules/Elmish.Toastr.2.1.0/Elmish.Toastr.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Notifications.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Extensions/Cmd.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Auth.fs","webpack:///./src/Client/output/fable_modules/Fable.Remoting.Client.7.25.0/Remoting.fs","webpack:///../PortalLibs/src/PortalLibs.Shared/Api.fs","webpack:///../PortalLibs/src/PortalLibs.Shared/Formatting.fs","webpack:///./src/Client/DisplayNumber.fs","webpack:///./src/Client/ContractPage/AI.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Layouts/Container.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Elements/Content.fs","webpack:///./src/Shared/Branding.fs","webpack:///./src/Client/Branding.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Components/Navbar.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Components/Tabs.fs","webpack:///./src/Client/ContractPage/CostAndBilling.fs","webpack:///./src/Client/ContractPage/ChangeOrders/Rows.fs","webpack:///./src/Client/Styles.fs","webpack:///./src/Client/ContractPage/ChangeOrders/Items.fs","webpack:///./src/Client/ContractPage/ChangeOrders/Lines.fs","webpack:///./src/Client/output/fable_modules/fable-library.3.7.20/Seq2.js","webpack:///./src/Client/ContractPage/ChangeOrders/Headers.fs","webpack:///./src/Client/ContractPage/ChangeOrders/Main.fs","webpack:///./src/Client/ContractPage/ARAndCashFlow.fs","webpack:///./src/Client/ContractPage/CostOfConstruction/Utils.fs","webpack:///./src/Client/output/fable_modules/FSharpPlus.1.3.2/Control/Foldable.fs","webpack:///./src/Client/ContractPage/CostOfConstruction/Expanded/Config.fs","webpack:///./src/Client/ContractPage/CostOfConstruction/Expanded/CostData.fs","webpack:///../PortalLibs/src/PortalLibs.Shared/Extensions/FileUtil.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Elements/Form/Control.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Components/SearchboxNew.fs","webpack:///./src/Client/ContractPage/CostOfConstruction/Expanded/CostDetailTable.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Elements/Table.fs","webpack:///./src/Client/ContractPage/CostOfConstruction/Expanded/PoSl.fs","webpack:///./src/Client/ContractPage/CostOfConstruction/Expanded/Expanded.fs","webpack:///./src/Client/ContractPage/CostOfConstruction/Collapsed.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Components/Modal.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Elements/Delete.fs","webpack:///./src/Client/ContractPage/ContractPageAttachmentModal.fs","webpack:///./src/Client/ContractPage/CostOfConstruction/CostOfConstruction.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Extensions/Option.fs","webpack:///./src/Client/ContractPage/AverageRate.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Elements/Form/Label.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Components/Progress.fs","webpack:///./src/Client/ContractPage/ContractProfitFade.fs","webpack:///./src/Client/ContractPage/PurchaseOrders/Config.fs","webpack:///./src/Client/ContractPage/PurchaseOrders/OrderItemReport.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Elements/Form/Input.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Components/Multiline.fs","webpack:///./src/Client/output/fable_modules/Fable.React.8.0.1/Fable.React.Extensions.fs","webpack:///./src/Client/ContractPage/PurchaseOrders/PurchaseOrders.fs","webpack:///./src/Client/ContractPage/PurchaseOrders/Basic.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Components/Card.fs","webpack:///./src/Client/ContractPage/PurchaseOrders/RequestModal.fs","webpack:///./src/Client/ContractPage/Scheduling.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Layouts/Columns.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Layouts/Column.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Components/Dropdown.fs","webpack:///../PortalLibs/src/PortalLibs.Shared/Extensions/Result.fs","webpack:///./src/Client/ContractPage/ContractPageView.fs","webpack:///./src/Client/ContractPage/Overview.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Layouts/Level.fs","webpack:///./src/Client/ContractsPage/ContractsPageView.fs","webpack:///../PortalLibs/src/PortalLibs.Shared/Util.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Components/Tooltip.fs","webpack:///../PortalLibs/src/PortalLibs.Shared/Extensions/Boolean.fs","webpack:///../PortalLibs/src/PortalLibs.Client/Components/Datepicker.fs","webpack:///../PortalLibs/src/PortalLibs.Shared/Extensions/List.fs","webpack:///./src/Client/output/fable_modules/FSharpPlus.1.3.2/Control/Applicative.fs","webpack:///./src/Client/output/fable_modules/FSharpPlus.1.3.2/Extensions/Option.fs","webpack:///./src/Client/CompanyPage/CompanyPageView.fs","webpack:///./src/Shared/BusinessLogic.fs","webpack:///./src/Client/ContractProfitFadePage/ContractProfitFadePageView.fs","webpack:///./src/Client/output/fable_modules/Fulma.2.16.0/Components/Message.fs","webpack:///./src/Client/HomePage/HomePageView.fs","webpack:///./src/Client/Client.fs","webpack:///./src/Client/ContractProfitFadePage/ContractProfitFadePageModel.fs","webpack:///./src/Client/HomePage/HomePageModel.fs","webpack:///./src/Client/output/fable_modules/Fable.Elmish.React.3.0.1/react.fs","webpack:///./src/Client/App.fs","webpack:///./src/Shared/Shared.fs","webpack:///../PortalLibs/node_modules/moment/locale/ sync ^\\.\\/.*$"],"sourcesContent":["// tslint:disable:ban-types\nexport function isIterable(x) {\n return x != null && typeof x === \"object\" && Symbol.iterator in x;\n}\nexport function isArrayLike(x) {\n return Array.isArray(x) || ArrayBuffer.isView(x);\n}\nfunction isComparer(x) {\n return typeof x.Compare === \"function\";\n}\nfunction isComparable(x) {\n return typeof x.CompareTo === \"function\";\n}\nfunction isEquatable(x) {\n return typeof x.Equals === \"function\";\n}\nfunction isHashable(x) {\n return typeof x.GetHashCode === \"function\";\n}\nexport function isDisposable(x) {\n return x != null && typeof x.Dispose === \"function\";\n}\nexport function disposeSafe(x) {\n if (isDisposable(x)) {\n x.Dispose();\n }\n}\nexport function sameConstructor(x, y) {\n var _a, _b;\n return ((_a = Object.getPrototypeOf(x)) === null || _a === void 0 ? void 0 : _a.constructor) === ((_b = Object.getPrototypeOf(y)) === null || _b === void 0 ? void 0 : _b.constructor);\n}\nexport class Enumerator {\n constructor(iter) {\n this.iter = iter;\n }\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\n return this.current;\n }\n [\"System.Collections.IEnumerator.get_Current\"]() {\n return this.current;\n }\n [\"System.Collections.IEnumerator.MoveNext\"]() {\n const cur = this.iter.next();\n this.current = cur.value;\n return !cur.done;\n }\n [\"System.Collections.IEnumerator.Reset\"]() {\n throw new Error(\"JS iterators cannot be reset\");\n }\n Dispose() {\n return;\n }\n}\nexport function getEnumerator(o) {\n return typeof o.GetEnumerator === \"function\"\n ? o.GetEnumerator()\n : new Enumerator(o[Symbol.iterator]());\n}\nexport function toIterator(en) {\n return {\n [Symbol.iterator]() { return this; },\n next() {\n const hasNext = en[\"System.Collections.IEnumerator.MoveNext\"]();\n const current = hasNext ? en[\"System.Collections.IEnumerator.get_Current\"]() : undefined;\n return { done: !hasNext, value: current };\n },\n };\n}\nexport class Comparer {\n constructor(f) {\n this.Compare = f || compare;\n }\n}\nexport function comparerFromEqualityComparer(comparer) {\n // Sometimes IEqualityComparer also implements IComparer\n if (isComparer(comparer)) {\n return new Comparer(comparer.Compare);\n }\n else {\n return new Comparer((x, y) => {\n const xhash = comparer.GetHashCode(x);\n const yhash = comparer.GetHashCode(y);\n if (xhash === yhash) {\n return comparer.Equals(x, y) ? 0 : -1;\n }\n else {\n return xhash < yhash ? -1 : 1;\n }\n });\n }\n}\nexport function assertEqual(actual, expected, msg) {\n if (!equals(actual, expected)) {\n throw Object.assign(new Error(msg || `Expected: ${expected} - Actual: ${actual}`), {\n actual,\n expected,\n });\n }\n}\nexport function assertNotEqual(actual, expected, msg) {\n if (equals(actual, expected)) {\n throw Object.assign(new Error(msg || `Expected: ${expected} - Actual: ${actual}`), {\n actual,\n expected,\n });\n }\n}\nexport class Lazy {\n constructor(factory) {\n this.factory = factory;\n this.isValueCreated = false;\n }\n get Value() {\n if (!this.isValueCreated) {\n this.createdValue = this.factory();\n this.isValueCreated = true;\n }\n return this.createdValue;\n }\n get IsValueCreated() {\n return this.isValueCreated;\n }\n}\nexport function lazyFromValue(v) {\n return new Lazy(() => v);\n}\nexport function padWithZeros(i, length) {\n let str = i.toString(10);\n while (str.length < length) {\n str = \"0\" + str;\n }\n return str;\n}\nexport function padLeftAndRightWithZeros(i, lengthLeft, lengthRight) {\n let str = i.toString(10);\n while (str.length < lengthLeft) {\n str = \"0\" + str;\n }\n while (str.length < lengthRight) {\n str = str + \"0\";\n }\n return str;\n}\nexport function dateOffset(date) {\n const date1 = date;\n return typeof date1.offset === \"number\"\n ? date1.offset\n : (date.kind === 1 /* UTC */\n ? 0 : date.getTimezoneOffset() * -60000);\n}\nexport function int16ToString(i, radix) {\n i = i < 0 && radix != null && radix !== 10 ? 0xFFFF + i + 1 : i;\n return i.toString(radix);\n}\nexport function int32ToString(i, radix) {\n i = i < 0 && radix != null && radix !== 10 ? 0xFFFFFFFF + i + 1 : i;\n return i.toString(radix);\n}\nexport class ObjectRef {\n static id(o) {\n if (!ObjectRef.idMap.has(o)) {\n ObjectRef.idMap.set(o, ++ObjectRef.count);\n }\n return ObjectRef.idMap.get(o);\n }\n}\nObjectRef.idMap = new WeakMap();\nObjectRef.count = 0;\nexport function stringHash(s) {\n let i = 0;\n let h = 5381;\n const len = s.length;\n while (i < len) {\n h = (h * 33) ^ s.charCodeAt(i++);\n }\n return h;\n}\nexport function numberHash(x) {\n return x * 2654435761 | 0;\n}\n// From https://stackoverflow.com/a/37449594\nexport function combineHashCodes(hashes) {\n if (hashes.length === 0) {\n return 0;\n }\n return hashes.reduce((h1, h2) => {\n return ((h1 << 5) + h1) ^ h2;\n });\n}\nexport function physicalHash(x) {\n if (x == null) {\n return 0;\n }\n switch (typeof x) {\n case \"boolean\":\n return x ? 1 : 0;\n case \"number\":\n return numberHash(x);\n case \"string\":\n return stringHash(x);\n default:\n return numberHash(ObjectRef.id(x));\n }\n}\nexport function identityHash(x) {\n if (x == null) {\n return 0;\n }\n else if (isHashable(x)) {\n return x.GetHashCode();\n }\n else {\n return physicalHash(x);\n }\n}\nexport function dateHash(x) {\n return x.getTime();\n}\nexport function arrayHash(x) {\n const len = x.length;\n const hashes = new Array(len);\n for (let i = 0; i < len; i++) {\n hashes[i] = structuralHash(x[i]);\n }\n return combineHashCodes(hashes);\n}\nexport function structuralHash(x) {\n var _a;\n if (x == null) {\n return 0;\n }\n switch (typeof x) {\n case \"boolean\":\n return x ? 1 : 0;\n case \"number\":\n return numberHash(x);\n case \"string\":\n return stringHash(x);\n default: {\n if (isHashable(x)) {\n return x.GetHashCode();\n }\n else if (isArrayLike(x)) {\n return arrayHash(x);\n }\n else if (x instanceof Date) {\n return dateHash(x);\n }\n else if (((_a = Object.getPrototypeOf(x)) === null || _a === void 0 ? void 0 : _a.constructor) === Object) {\n // TODO: check call-stack to prevent cyclic objects?\n const hashes = Object.values(x).map((v) => structuralHash(v));\n return combineHashCodes(hashes);\n }\n else {\n // Classes don't implement GetHashCode by default, but must use identity hashing\n return numberHash(ObjectRef.id(x));\n // return stringHash(String(x));\n }\n }\n }\n}\n// Intended for custom numeric types, like long or decimal\nexport function fastStructuralHash(x) {\n return stringHash(String(x));\n}\n// Intended for declared types that may or may not implement GetHashCode\nexport function safeHash(x) {\n return x == null ? 0 : isHashable(x) ? x.GetHashCode() : numberHash(ObjectRef.id(x));\n}\nexport function equalArraysWith(x, y, eq) {\n if (x == null) {\n return y == null;\n }\n if (y == null) {\n return false;\n }\n if (x.length !== y.length) {\n return false;\n }\n for (let i = 0; i < x.length; i++) {\n if (!eq(x[i], y[i])) {\n return false;\n }\n }\n return true;\n}\nexport function equalArrays(x, y) {\n return equalArraysWith(x, y, equals);\n}\nfunction equalObjects(x, y) {\n const xKeys = Object.keys(x);\n const yKeys = Object.keys(y);\n if (xKeys.length !== yKeys.length) {\n return false;\n }\n xKeys.sort();\n yKeys.sort();\n for (let i = 0; i < xKeys.length; i++) {\n if (xKeys[i] !== yKeys[i] || !equals(x[xKeys[i]], y[yKeys[i]])) {\n return false;\n }\n }\n return true;\n}\nexport function equals(x, y) {\n var _a;\n if (x === y) {\n return true;\n }\n else if (x == null) {\n return y == null;\n }\n else if (y == null) {\n return false;\n }\n else if (typeof x !== \"object\") {\n return false;\n }\n else if (isEquatable(x)) {\n return x.Equals(y);\n }\n else if (isArrayLike(x)) {\n return isArrayLike(y) && equalArrays(x, y);\n }\n else if (x instanceof Date) {\n return (y instanceof Date) && compareDates(x, y) === 0;\n }\n else {\n return ((_a = Object.getPrototypeOf(x)) === null || _a === void 0 ? void 0 : _a.constructor) === Object && equalObjects(x, y);\n }\n}\nexport function compareDates(x, y) {\n let xtime;\n let ytime;\n // DateTimeOffset and DateTime deals with equality differently.\n if (\"offset\" in x && \"offset\" in y) {\n xtime = x.getTime();\n ytime = y.getTime();\n }\n else {\n xtime = x.getTime() + dateOffset(x);\n ytime = y.getTime() + dateOffset(y);\n }\n return xtime === ytime ? 0 : (xtime < ytime ? -1 : 1);\n}\nexport function comparePrimitives(x, y) {\n return x === y ? 0 : (x < y ? -1 : 1);\n}\nexport function compareArraysWith(x, y, comp) {\n if (x == null) {\n return y == null ? 0 : 1;\n }\n if (y == null) {\n return -1;\n }\n if (x.length !== y.length) {\n return x.length < y.length ? -1 : 1;\n }\n for (let i = 0, j = 0; i < x.length; i++) {\n j = comp(x[i], y[i]);\n if (j !== 0) {\n return j;\n }\n }\n return 0;\n}\nexport function compareArrays(x, y) {\n return compareArraysWith(x, y, compare);\n}\nfunction compareObjects(x, y) {\n const xKeys = Object.keys(x);\n const yKeys = Object.keys(y);\n if (xKeys.length !== yKeys.length) {\n return xKeys.length < yKeys.length ? -1 : 1;\n }\n xKeys.sort();\n yKeys.sort();\n for (let i = 0, j = 0; i < xKeys.length; i++) {\n const key = xKeys[i];\n if (key !== yKeys[i]) {\n return key < yKeys[i] ? -1 : 1;\n }\n else {\n j = compare(x[key], y[key]);\n if (j !== 0) {\n return j;\n }\n }\n }\n return 0;\n}\nexport function compare(x, y) {\n var _a;\n if (x === y) {\n return 0;\n }\n else if (x == null) {\n return y == null ? 0 : -1;\n }\n else if (y == null) {\n return 1;\n }\n else if (typeof x !== \"object\") {\n return x < y ? -1 : 1;\n }\n else if (isComparable(x)) {\n return x.CompareTo(y);\n }\n else if (isArrayLike(x)) {\n return isArrayLike(y) ? compareArrays(x, y) : -1;\n }\n else if (x instanceof Date) {\n return y instanceof Date ? compareDates(x, y) : -1;\n }\n else {\n return ((_a = Object.getPrototypeOf(x)) === null || _a === void 0 ? void 0 : _a.constructor) === Object ? compareObjects(x, y) : -1;\n }\n}\nexport function min(comparer, x, y) {\n return comparer(x, y) < 0 ? x : y;\n}\nexport function max(comparer, x, y) {\n return comparer(x, y) > 0 ? x : y;\n}\nexport function clamp(comparer, value, min, max) {\n return (comparer(value, min) < 0) ? min : (comparer(value, max) > 0) ? max : value;\n}\nexport function createAtom(value) {\n let atom = value;\n return (value, isSetter) => {\n if (!isSetter) {\n return atom;\n }\n else {\n atom = value;\n return void 0;\n }\n };\n}\nexport function createObj(fields) {\n const obj = {};\n for (const kv of fields) {\n obj[kv[0]] = kv[1];\n }\n return obj;\n}\nexport function jsOptions(mutator) {\n const opts = {};\n mutator(opts);\n return opts;\n}\nexport function round(value, digits = 0) {\n const m = Math.pow(10, digits);\n const n = +(digits ? value * m : value).toFixed(8);\n const i = Math.floor(n);\n const f = n - i;\n const e = 1e-8;\n const r = (f > 0.5 - e && f < 0.5 + e) ? ((i % 2 === 0) ? i : i + 1) : Math.round(n);\n return digits ? r / m : r;\n}\nexport function sign(x) {\n return x > 0 ? 1 : x < 0 ? -1 : 0;\n}\nexport function unescapeDataString(s) {\n // https://stackoverflow.com/a/4458580/524236\n return decodeURIComponent((s).replace(/\\+/g, \"%20\"));\n}\nexport function escapeDataString(s) {\n return encodeURIComponent(s).replace(/!/g, \"%21\")\n .replace(/'/g, \"%27\")\n .replace(/\\(/g, \"%28\")\n .replace(/\\)/g, \"%29\")\n .replace(/\\*/g, \"%2A\");\n}\nexport function escapeUriString(s) {\n return encodeURI(s);\n}\n// ICollection.Clear and Count members can be called on Arrays\n// or Dictionaries so we need a runtime check (see #1120)\nexport function count(col) {\n if (isArrayLike(col)) {\n return col.length;\n }\n else {\n let count = 0;\n for (const _ of col) {\n count++;\n }\n return count;\n }\n}\nexport function clear(col) {\n if (isArrayLike(col)) {\n col.splice(0);\n }\n else {\n col.clear();\n }\n}\nconst CURRIED = Symbol(\"curried\");\nexport function uncurry(arity, f) {\n // f may be a function option with None value\n if (f == null || f.length > 1) {\n return f;\n }\n const uncurried = (...args) => {\n let res = f;\n for (let i = 0; i < arity; i++) {\n res = res(args[i]);\n }\n return res;\n };\n uncurried[CURRIED] = f;\n return uncurried;\n}\nfunction _curry(args, arity, f) {\n return (arg) => arity === 1\n ? f(...args.concat([arg]))\n // Note it's important to generate a new args array every time\n // because a partially applied function can be run multiple times\n : _curry(args.concat([arg]), arity - 1, f);\n}\nexport function curry(arity, f) {\n if (f == null || f.length === 1) {\n return f;\n }\n else if (CURRIED in f) {\n return f[CURRIED];\n }\n else {\n return _curry([], arity, f);\n }\n}\nexport function checkArity(arity, f) {\n return f.length > arity\n ? (...args1) => (...args2) => f.apply(undefined, args1.concat(args2))\n : f;\n}\nexport function partialApply(arity, f, args) {\n if (f == null) {\n return undefined;\n }\n else if (CURRIED in f) {\n f = f[CURRIED];\n for (let i = 0; i < args.length; i++) {\n f = f(args[i]);\n }\n return f;\n }\n else {\n return _curry(args, arity, f);\n }\n}\nexport function mapCurriedArgs(fn, mappings) {\n function mapArg(fn, arg, mappings, idx) {\n const mapping = mappings[idx];\n if (mapping !== 0) {\n const expectedArity = mapping[0];\n const actualArity = mapping[1];\n if (expectedArity > 1) {\n arg = curry(expectedArity, arg);\n }\n if (actualArity > 1) {\n arg = uncurry(actualArity, arg);\n }\n }\n const res = fn(arg);\n if (idx + 1 === mappings.length) {\n return res;\n }\n else {\n return (arg) => mapArg(res, arg, mappings, idx + 1);\n }\n }\n return (arg) => mapArg(fn, arg, mappings, 0);\n}\n","import { combineHashCodes, compare, compareArrays, equalArrays, equals, sameConstructor, numberHash, structuralHash } from \"./Util.js\";\nexport function seqToString(self) {\n let count = 0;\n let str = \"[\";\n for (const x of self) {\n if (count === 0) {\n str += toString(x);\n }\n else if (count === 100) {\n str += \"; ...\";\n break;\n }\n else {\n str += \"; \" + toString(x);\n }\n count++;\n }\n return str + \"]\";\n}\nexport function toString(x, callStack = 0) {\n var _a, _b;\n if (x != null && typeof x === \"object\") {\n if (typeof x.toString === \"function\") {\n return x.toString();\n }\n else if (Symbol.iterator in x) {\n return seqToString(x);\n }\n else { // TODO: Date?\n const cons = (_a = Object.getPrototypeOf(x)) === null || _a === void 0 ? void 0 : _a.constructor;\n return cons === Object && callStack < 10\n // Same format as recordToString\n ? \"{ \" + Object.entries(x).map(([k, v]) => k + \" = \" + toString(v, callStack + 1)).join(\"\\n \") + \" }\"\n : (_b = cons === null || cons === void 0 ? void 0 : cons.name) !== null && _b !== void 0 ? _b : \"\";\n }\n }\n return String(x);\n}\nexport function unionToString(name, fields) {\n if (fields.length === 0) {\n return name;\n }\n else {\n let fieldStr = \"\";\n let withParens = true;\n if (fields.length === 1) {\n fieldStr = toString(fields[0]);\n withParens = fieldStr.indexOf(\" \") >= 0;\n }\n else {\n fieldStr = fields.map((x) => toString(x)).join(\", \");\n }\n return name + (withParens ? \" (\" : \" \") + fieldStr + (withParens ? \")\" : \"\");\n }\n}\nexport class Union {\n get name() {\n return this.cases()[this.tag];\n }\n toJSON() {\n return this.fields.length === 0 ? this.name : [this.name].concat(this.fields);\n }\n toString() {\n return unionToString(this.name, this.fields);\n }\n GetHashCode() {\n const hashes = this.fields.map((x) => structuralHash(x));\n hashes.splice(0, 0, numberHash(this.tag));\n return combineHashCodes(hashes);\n }\n Equals(other) {\n if (this === other) {\n return true;\n }\n else if (!sameConstructor(this, other)) {\n return false;\n }\n else if (this.tag === other.tag) {\n return equalArrays(this.fields, other.fields);\n }\n else {\n return false;\n }\n }\n CompareTo(other) {\n if (this === other) {\n return 0;\n }\n else if (!sameConstructor(this, other)) {\n return -1;\n }\n else if (this.tag === other.tag) {\n return compareArrays(this.fields, other.fields);\n }\n else {\n return this.tag < other.tag ? -1 : 1;\n }\n }\n}\nfunction recordToJSON(self) {\n const o = {};\n const keys = Object.keys(self);\n for (let i = 0; i < keys.length; i++) {\n o[keys[i]] = self[keys[i]];\n }\n return o;\n}\nfunction recordToString(self) {\n return \"{ \" + Object.entries(self).map(([k, v]) => k + \" = \" + toString(v)).join(\"\\n \") + \" }\";\n}\nfunction recordGetHashCode(self) {\n const hashes = Object.values(self).map((v) => structuralHash(v));\n return combineHashCodes(hashes);\n}\nfunction recordEquals(self, other) {\n if (self === other) {\n return true;\n }\n else if (!sameConstructor(self, other)) {\n return false;\n }\n else {\n const thisNames = Object.keys(self);\n for (let i = 0; i < thisNames.length; i++) {\n if (!equals(self[thisNames[i]], other[thisNames[i]])) {\n return false;\n }\n }\n return true;\n }\n}\nfunction recordCompareTo(self, other) {\n if (self === other) {\n return 0;\n }\n else if (!sameConstructor(self, other)) {\n return -1;\n }\n else {\n const thisNames = Object.keys(self);\n for (let i = 0; i < thisNames.length; i++) {\n const result = compare(self[thisNames[i]], other[thisNames[i]]);\n if (result !== 0) {\n return result;\n }\n }\n return 0;\n }\n}\nexport class Record {\n toJSON() { return recordToJSON(this); }\n toString() { return recordToString(this); }\n GetHashCode() { return recordGetHashCode(this); }\n Equals(other) { return recordEquals(this, other); }\n CompareTo(other) { return recordCompareTo(this, other); }\n}\nexport class FSharpRef {\n constructor(contentsOrGetter, setter) {\n if (typeof setter === \"function\") {\n this.getter = contentsOrGetter;\n this.setter = setter;\n }\n else {\n this.getter = () => contentsOrGetter;\n this.setter = (v) => { contentsOrGetter = v; };\n }\n }\n get contents() {\n return this.getter();\n }\n set contents(v) {\n this.setter(v);\n }\n}\n// EXCEPTIONS\n// Exception is intentionally not derived from Error, for performance reasons (see #2160)\nexport class Exception {\n constructor(message) {\n this.message = message;\n }\n}\nexport function isException(x) {\n return x instanceof Exception || x instanceof Error;\n}\nexport function ensureErrorOrException(e) {\n return isException(e) ? e : new Error(String(e));\n}\nexport class FSharpException extends Exception {\n toJSON() { return recordToJSON(this); }\n toString() { return recordToString(this); }\n GetHashCode() { return recordGetHashCode(this); }\n Equals(other) { return recordEquals(this, other); }\n CompareTo(other) { return recordCompareTo(this, other); }\n}\nexport class MatchFailureException extends FSharpException {\n constructor(arg1, arg2, arg3) {\n super();\n this.arg1 = arg1;\n this.arg2 = arg2 | 0;\n this.arg3 = arg3 | 0;\n this.message = \"The match cases were incomplete\";\n }\n}\nexport class Attribute {\n}\n","// export type decimal = Decimal;\nexport var NumberStyles;\n(function (NumberStyles) {\n // None = 0x00000000,\n // AllowLeadingWhite = 0x00000001,\n // AllowTrailingWhite = 0x00000002,\n // AllowLeadingSign = 0x00000004,\n // AllowTrailingSign = 0x00000008,\n // AllowParentheses = 0x00000010,\n // AllowDecimalPoint = 0x00000020,\n // AllowThousands = 0x00000040,\n // AllowExponent = 0x00000080,\n // AllowCurrencySymbol = 0x00000100,\n NumberStyles[NumberStyles[\"AllowHexSpecifier\"] = 512] = \"AllowHexSpecifier\";\n // Integer = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign,\n // HexNumber = AllowLeadingWhite | AllowTrailingWhite | AllowHexSpecifier,\n // Number = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |\n // AllowTrailingSign | AllowDecimalPoint | AllowThousands,\n // Float = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |\n // AllowDecimalPoint | AllowExponent,\n // Currency = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign |\n // AllowParentheses | AllowDecimalPoint | AllowThousands | AllowCurrencySymbol,\n // Any = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign |\n // AllowParentheses | AllowDecimalPoint | AllowThousands | AllowCurrencySymbol | AllowExponent,\n})(NumberStyles || (NumberStyles = {}));\nfunction validResponse(regexMatch, radix) {\n const [/*all*/ , sign, prefix, digits] = regexMatch;\n return {\n sign: sign || \"\",\n prefix: prefix || \"\",\n digits,\n radix,\n };\n}\nfunction getRange(unsigned, bitsize) {\n switch (bitsize) {\n case 8: return unsigned ? [0, 255] : [-128, 127];\n case 16: return unsigned ? [0, 65535] : [-32768, 32767];\n case 32: return unsigned ? [0, 4294967295] : [-2147483648, 2147483647];\n default: throw new Error(\"Invalid bit size.\");\n }\n}\nfunction getInvalidDigits(radix) {\n switch (radix) {\n case 2: return /[^0-1]/;\n case 8: return /[^0-7]/;\n case 10: return /[^0-9]/;\n case 16: return /[^0-9a-fA-F]/;\n default:\n throw new Error(\"Invalid Base.\");\n }\n}\nfunction getRadix(prefix, style) {\n if (style & NumberStyles.AllowHexSpecifier) {\n return 16;\n }\n else {\n switch (prefix) {\n case \"0b\":\n case \"0B\": return 2;\n case \"0o\":\n case \"0O\": return 8;\n case \"0x\":\n case \"0X\": return 16;\n default: return 10;\n }\n }\n}\nexport function isValid(str, style, radix) {\n const integerRegex = /^\\s*([\\+\\-])?(0[xXoObB])?([0-9a-fA-F]+)\\s*$/;\n const res = integerRegex.exec(str.replace(/_/g, \"\"));\n if (res != null) {\n const [/*all*/ , /*sign*/ , prefix, digits] = res;\n radix = radix || getRadix(prefix, style);\n const invalidDigits = getInvalidDigits(radix);\n if (!invalidDigits.test(digits)) {\n return validResponse(res, radix);\n }\n }\n return null;\n}\nexport function parse(str, style, unsigned, bitsize, radix) {\n const res = isValid(str, style, radix);\n if (res != null) {\n let v = Number.parseInt(res.sign + res.digits, res.radix);\n if (!Number.isNaN(v)) {\n const [umin, umax] = getRange(true, bitsize);\n if (!unsigned && res.radix !== 10 && v >= umin && v <= umax) {\n v = v << (32 - bitsize) >> (32 - bitsize);\n }\n const [min, max] = getRange(unsigned, bitsize);\n if (v >= min && v <= max) {\n return v;\n }\n }\n }\n throw new Error(\"Input string was not in a correct format.\");\n}\nexport function tryParse(str, style, unsigned, bitsize, defValue) {\n try {\n defValue.contents = parse(str, style, unsigned, bitsize);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nexport function op_UnaryNegation_Int8(x) {\n return x === -128 ? x : -x;\n}\nexport function op_UnaryNegation_Int16(x) {\n return x === -32768 ? x : -x;\n}\nexport function op_UnaryNegation_Int32(x) {\n return x === -2147483648 ? x : -x;\n}\nexport function divRem(x, y, out) {\n const div = ~~(x / y);\n const rem = x % y;\n if (out != null) {\n out.contents = rem;\n return div;\n }\n else {\n return [div, rem];\n }\n}\n","export const symbol = Symbol(\"numeric\");\nexport function isNumeric(x) {\n return typeof x === \"number\" || (x === null || x === void 0 ? void 0 : x[symbol]);\n}\nexport function compare(x, y) {\n if (typeof x === \"number\") {\n return x < y ? -1 : (x > y ? 1 : 0);\n }\n else {\n return x.CompareTo(y);\n }\n}\nexport function multiply(x, y) {\n if (typeof x === \"number\") {\n return x * y;\n }\n else {\n return x[symbol]().multiply(y);\n }\n}\nexport function toFixed(x, dp) {\n if (typeof x === \"number\") {\n return x.toFixed(dp);\n }\n else {\n return x[symbol]().toFixed(dp);\n }\n}\nexport function toPrecision(x, sd) {\n if (typeof x === \"number\") {\n return x.toPrecision(sd);\n }\n else {\n return x[symbol]().toPrecision(sd);\n }\n}\nexport function toExponential(x, dp) {\n if (typeof x === \"number\") {\n return x.toExponential(dp);\n }\n else {\n return x[symbol]().toExponential(dp);\n }\n}\nexport function toHex(x) {\n if (typeof x === \"number\") {\n return (Number(x) >>> 0).toString(16);\n }\n else {\n return x[symbol]().toHex();\n }\n}\n","// Adapted from: https://github.com/dcodeIO/long.js/blob/master/src/long.js\n// Apache License 2.0: https://github.com/dcodeIO/long.js/blob/master/LICENSE\n/* tslint:disable */\nimport { symbol } from \"../Numeric.js\";\n/**\n * wasm optimizations, to do native i64 multiplication and divide\n */\nvar wasm = null;\ntry {\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\n ])), {}).exports;\n}\ncatch (e) {\n // no wasm support :(\n}\n/**\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\n * See the from* functions below for more convenient ways of constructing Longs.\n * @exports Long\n * @class A Long class for representing a 64 bit two's-complement integer value.\n * @param {number} low The low (signed) 32 bits of the long\n * @param {number} high The high (signed) 32 bits of the long\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @constructor\n */\nexport function Long(low, high, unsigned) {\n /**\n * The low 32 bits as a signed value.\n * @type {number}\n */\n this.low = low | 0;\n /**\n * The high 32 bits as a signed value.\n * @type {number}\n */\n this.high = high | 0;\n /**\n * Whether unsigned or not.\n * @type {boolean}\n */\n this.unsigned = !!unsigned;\n}\nLong.prototype.GetHashCode = function () {\n let h1 = this.unsigned ? 1 : 0;\n h1 = ((h1 << 5) + h1) ^ this.high;\n h1 = ((h1 << 5) + h1) ^ this.low;\n return h1;\n};\nLong.prototype.Equals = function (x) { return equals(this, x); };\nLong.prototype.CompareTo = function (x) { return compare(this, x); };\nLong.prototype.toString = function (radix) { return toString(this, radix); };\nLong.prototype.toJSON = function () { return toString(this); };\nLong.prototype[symbol] = function () {\n const x = this;\n return {\n multiply: y => multiply(x, y),\n toPrecision: sd => String(x) + (0).toPrecision(sd).substr(1),\n toExponential: dp => String(x) + (0).toExponential(dp).substr(1),\n toFixed: dp => String(x) + (0).toFixed(dp).substr(1),\n toHex: () => toString(x.unsigned ? x : fromBytes(toBytes(x), true), 16),\n };\n};\n// The internal representation of a long is the two given signed, 32-bit values.\n// We use 32-bit pieces because these are the size of integers on which\n// Javascript performs bit-operations. For operations like addition and\n// multiplication, we split each number into 16 bit pieces, which can easily be\n// multiplied within Javascript's floating-point representation without overflow\n// or change in sign.\n//\n// In the algorithms below, we frequently reduce the negative case to the\n// positive case by negating the input(s) and then post-processing the result.\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n// a positive number, it overflows back into a negative). Not handling this\n// case would often result in infinite recursion.\n//\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\n// methods on which they depend.\n/**\n * An indicator used to reliably determine if an object is a Long or not.\n * @type {boolean}\n * @const\n * @private\n */\nLong.prototype.__isLong__;\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\n/**\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n * @inner\n */\nexport function isLong(obj) {\n return (obj && obj[\"__isLong__\"]) === true;\n}\n/**\n * Tests if the specified object is a Long.\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n */\n// Long.isLong = isLong;\n/**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @inner\n */\nvar INT_CACHE = {};\n/**\n * A cache of the Long representations of small unsigned integer values.\n * @type {!Object}\n * @inner\n */\nvar UINT_CACHE = {};\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nexport function fromInt(value, unsigned) {\n var obj, cachedObj, cache;\n if (unsigned) {\n value >>>= 0;\n if (cache = (0 <= value && value < 256)) {\n cachedObj = UINT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\n if (cache)\n UINT_CACHE[value] = obj;\n return obj;\n }\n else {\n value |= 0;\n if (cache = (-128 <= value && value < 128)) {\n cachedObj = INT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, value < 0 ? -1 : 0, false);\n if (cache)\n INT_CACHE[value] = obj;\n return obj;\n }\n}\n/**\n * Returns a Long representing the given 32 bit integer value.\n * @function\n * @param {number} value The 32 bit integer in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\n// Long.fromInt = fromInt;\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nexport function fromNumber(value, unsigned) {\n if (isNaN(value))\n return unsigned ? UZERO : ZERO;\n if (unsigned) {\n if (value < 0)\n return UZERO;\n if (value >= TWO_PWR_64_DBL)\n return MAX_UNSIGNED_VALUE;\n }\n else {\n if (value <= -TWO_PWR_63_DBL)\n return MIN_VALUE;\n if (value + 1 >= TWO_PWR_63_DBL)\n return MAX_VALUE;\n }\n if (value < 0)\n return negate(fromNumber(-value, unsigned));\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\n}\n/**\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\n * @function\n * @param {number} value The number in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\n// Long.fromNumber = fromNumber;\n/**\n * @param {number} lowBits\n * @param {number} highBits\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nexport function fromBits(lowBits, highBits, unsigned) {\n return new Long(lowBits, highBits, unsigned);\n}\n/**\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\n * assumed to use 32 bits.\n * @function\n * @param {number} lowBits The low 32 bits\n * @param {number} highBits The high 32 bits\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\n// Long.fromBits = fromBits;\n/**\n * @function\n * @param {number} base\n * @param {number} exponent\n * @returns {number}\n * @inner\n */\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\n/**\n * @param {string} str\n * @param {(boolean|number)=} unsigned\n * @param {number=} radix\n * @returns {!Long}\n * @inner\n */\nexport function fromString(str, unsigned, radix) {\n if (str.length === 0)\n throw Error('empty string');\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\n return ZERO;\n if (typeof unsigned === 'number') {\n // For goog.math.long compatibility\n radix = unsigned,\n unsigned = false;\n }\n else {\n unsigned = !!unsigned;\n }\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n var p = str.indexOf('-');\n if (p > 0)\n throw Error('interior hyphen');\n else if (p === 0) {\n return negate(fromString(str.substring(1), unsigned, radix));\n }\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 8));\n var result = ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = fromNumber(pow_dbl(radix, size));\n result = add(multiply(result, power), fromNumber(value));\n }\n else {\n result = multiply(result, radixToPower);\n result = add(result, fromNumber(value));\n }\n }\n result.unsigned = unsigned;\n return result;\n}\n/**\n * Returns a Long representation of the given string, written using the specified radix.\n * @function\n * @param {string} str The textual representation of the Long\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\n * @returns {!Long} The corresponding Long value\n */\n// Long.fromString = fromString;\n/**\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nexport function fromValue(val, unsigned) {\n if (typeof val === 'number')\n return fromNumber(val, unsigned);\n if (typeof val === 'string')\n return fromString(val, unsigned);\n // Throws for non-objects, converts non-instanceof Long:\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\n}\n/**\n * Converts the specified value to a Long using the appropriate from* function for its type.\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long}\n */\n// Long.fromValue = fromValue;\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\n// no runtime penalty for these.\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_16_DBL = 1 << 16;\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_24_DBL = 1 << 24;\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\n/**\n * @type {!Long}\n * @const\n * @inner\n */\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\n/**\n * @type {!Long}\n * @inner\n */\nexport var ZERO = fromInt(0);\n/**\n * Signed zero.\n * @type {!Long}\n */\n// Long.ZERO = ZERO;\n/**\n * @type {!Long}\n * @inner\n */\nexport var UZERO = fromInt(0, true);\n/**\n * Unsigned zero.\n * @type {!Long}\n */\n// Long.UZERO = UZERO;\n/**\n * @type {!Long}\n * @inner\n */\nexport var ONE = fromInt(1);\n/**\n * Signed one.\n * @type {!Long}\n */\n// Long.ONE = ONE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var UONE = fromInt(1, true);\n/**\n * Unsigned one.\n * @type {!Long}\n */\n// Long.UONE = UONE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var NEG_ONE = fromInt(-1);\n/**\n * Signed negative one.\n * @type {!Long}\n */\n// Long.NEG_ONE = NEG_ONE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var MAX_VALUE = fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0, false);\n/**\n * Maximum signed value.\n * @type {!Long}\n */\n// Long.MAX_VALUE = MAX_VALUE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF | 0, 0xFFFFFFFF | 0, true);\n/**\n * Maximum unsigned value.\n * @type {!Long}\n */\n// Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var MIN_VALUE = fromBits(0, 0x80000000 | 0, false);\n/**\n * Minimum signed value.\n * @type {!Long}\n */\n// Long.MIN_VALUE = MIN_VALUE;\n/**\n * @alias Long.prototype\n * @inner\n */\n// var LongPrototype = Long.prototype;\n/**\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\n * @this {!Long}\n * @returns {number}\n */\nexport function toInt($this) {\n return $this.unsigned ? $this.low >>> 0 : $this.low;\n}\n;\n/**\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\n * @this {!Long}\n * @returns {number}\n */\nexport function toNumber($this) {\n if ($this.unsigned)\n return (($this.high >>> 0) * TWO_PWR_32_DBL) + ($this.low >>> 0);\n return $this.high * TWO_PWR_32_DBL + ($this.low >>> 0);\n}\n;\n/**\n * Converts the Long to a string written in the specified radix.\n * @this {!Long}\n * @param {number=} radix Radix (2-36), defaults to 10\n * @returns {string}\n * @override\n * @throws {RangeError} If `radix` is out of range\n */\nexport function toString($this, radix) {\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n if (isZero($this))\n return '0';\n if (isNegative($this)) { // Unsigned Longs are never negative\n if (equals($this, MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = fromNumber(radix), div = divide($this, radixLong), rem1 = subtract(multiply(div, radixLong), $this);\n return toString(div, radix) + toInt(rem1).toString(radix);\n }\n else\n return '-' + toString(negate($this), radix);\n }\n // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 6), $this.unsigned), rem = $this;\n var result = '';\n while (true) {\n var remDiv = divide(rem, radixToPower), intval = toInt(subtract(rem, multiply(remDiv, radixToPower))) >>> 0, digits = intval.toString(radix);\n rem = remDiv;\n if (isZero(rem))\n return digits + result;\n else {\n while (digits.length < 6)\n digits = '0' + digits;\n result = '' + digits + result;\n }\n }\n}\n;\n/**\n * Gets the high 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed high bits\n */\nexport function getHighBits($this) {\n return $this.high;\n}\n;\n/**\n * Gets the high 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned high bits\n */\nexport function getHighBitsUnsigned($this) {\n return $this.high >>> 0;\n}\n;\n/**\n * Gets the low 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed low bits\n */\nexport function getLowBits($this) {\n return $this.low;\n}\n;\n/**\n * Gets the low 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned low bits\n */\nexport function getLowBitsUnsigned($this) {\n return $this.low >>> 0;\n}\n;\n/**\n * Gets the number of bits needed to represent the absolute value of this Long.\n * @this {!Long}\n * @returns {number}\n */\nexport function getNumBitsAbs($this) {\n if (isNegative($this)) // Unsigned Longs are never negative\n return equals($this, MIN_VALUE) ? 64 : getNumBitsAbs(negate($this));\n var val = $this.high != 0 ? $this.high : $this.low;\n for (var bit = 31; bit > 0; bit--)\n if ((val & (1 << bit)) != 0)\n break;\n return $this.high != 0 ? bit + 33 : bit + 1;\n}\n;\n/**\n * Tests if this Long's value equals zero.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isZero($this) {\n return $this.high === 0 && $this.low === 0;\n}\n;\n/**\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\n * @returns {boolean}\n */\n// LongPrototype.eqz = LongPrototype.isZero;\n/**\n * Tests if this Long's value is negative.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isNegative($this) {\n return !$this.unsigned && $this.high < 0;\n}\n;\n/**\n * Tests if this Long's value is positive.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isPositive($this) {\n return $this.unsigned || $this.high >= 0;\n}\n;\n/**\n * Tests if this Long's value is odd.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isOdd($this) {\n return ($this.low & 1) === 1;\n}\n;\n/**\n * Tests if this Long's value is even.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isEven($this) {\n return ($this.low & 1) === 0;\n}\n;\n/**\n * Tests if this Long's value equals the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function equals($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n if ($this.unsigned !== other.unsigned && ($this.high >>> 31) === 1 && (other.high >>> 31) === 1)\n return false;\n return $this.high === other.high && $this.low === other.low;\n}\n;\n/**\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.eq = LongPrototype.equals;\n/**\n * Tests if this Long's value differs from the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function notEquals($this, other) {\n return !equals($this, /* validates */ other);\n}\n;\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.neq = LongPrototype.notEquals;\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.ne = LongPrototype.notEquals;\n/**\n * Tests if this Long's value is less than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function lessThan($this, other) {\n return compare($this, /* validates */ other) < 0;\n}\n;\n/**\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.lt = LongPrototype.lessThan;\n/**\n * Tests if this Long's value is less than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function lessThanOrEqual($this, other) {\n return compare($this, /* validates */ other) <= 0;\n}\n;\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.lte = LongPrototype.lessThanOrEqual;\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.le = LongPrototype.lessThanOrEqual;\n/**\n * Tests if this Long's value is greater than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function greaterThan($this, other) {\n return compare($this, /* validates */ other) > 0;\n}\n;\n/**\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.gt = LongPrototype.greaterThan;\n/**\n * Tests if this Long's value is greater than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function greaterThanOrEqual($this, other) {\n return compare($this, /* validates */ other) >= 0;\n}\n;\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.gte = LongPrototype.greaterThanOrEqual;\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.ge = LongPrototype.greaterThanOrEqual;\n/**\n * Compares this Long's value with the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\nexport function compare($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n if (equals($this, other))\n return 0;\n var thisNeg = isNegative($this), otherNeg = isNegative(other);\n if (thisNeg && !otherNeg)\n return -1;\n if (!thisNeg && otherNeg)\n return 1;\n // At this point the sign bits are the same\n if (!$this.unsigned)\n return isNegative(subtract($this, other)) ? -1 : 1;\n // Both are positive if at least one is unsigned\n return (other.high >>> 0) > ($this.high >>> 0) || (other.high === $this.high && (other.low >>> 0) > ($this.low >>> 0)) ? -1 : 1;\n}\n;\n/**\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\n// LongPrototype.comp = LongPrototype.compare;\n/**\n * Negates this Long's value.\n * @this {!Long}\n * @returns {!Long} Negated Long\n */\nexport function negate($this) {\n if (!$this.unsigned && equals($this, MIN_VALUE))\n return MIN_VALUE;\n return add(not($this), ONE);\n}\n;\n/**\n * Negates this Long's value. This is an alias of {@link Long#negate}.\n * @function\n * @returns {!Long} Negated Long\n */\n// LongPrototype.neg = LongPrototype.negate;\n/**\n * Returns the sum of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} addend Addend\n * @returns {!Long} Sum\n */\nexport function add($this, addend) {\n if (!isLong(addend))\n addend = fromValue(addend);\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n var a48 = $this.high >>> 16;\n var a32 = $this.high & 0xFFFF;\n var a16 = $this.low >>> 16;\n var a00 = $this.low & 0xFFFF;\n var b48 = addend.high >>> 16;\n var b32 = addend.high & 0xFFFF;\n var b16 = addend.low >>> 16;\n var b00 = addend.low & 0xFFFF;\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, $this.unsigned);\n}\n;\n/**\n * Returns the difference of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nexport function subtract($this, subtrahend) {\n if (!isLong(subtrahend))\n subtrahend = fromValue(subtrahend);\n return add($this, negate(subtrahend));\n}\n;\n/**\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\n * @function\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\n// LongPrototype.sub = LongPrototype.subtract;\n/**\n * Returns the product of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nexport function multiply($this, multiplier) {\n if (isZero($this))\n return $this.unsigned ? UZERO : ZERO;\n if (!isLong(multiplier))\n multiplier = fromValue(multiplier);\n // use wasm support if present\n if (wasm) {\n var low = wasm.mul($this.low, $this.high, multiplier.low, multiplier.high);\n return fromBits(low, wasm.get_high(), $this.unsigned);\n }\n if (isZero(multiplier))\n return $this.unsigned ? UZERO : ZERO;\n if (equals($this, MIN_VALUE))\n return isOdd(multiplier) ? MIN_VALUE : ZERO;\n if (equals(multiplier, MIN_VALUE))\n return isOdd($this) ? MIN_VALUE : ZERO;\n if (isNegative($this)) {\n if (isNegative(multiplier))\n return multiply(negate($this), negate(multiplier));\n else\n return negate(multiply(negate($this), multiplier));\n }\n else if (isNegative(multiplier))\n return negate(multiply($this, negate(multiplier)));\n // If both longs are small, use float multiplication\n if (lessThan($this, TWO_PWR_24) && lessThan(multiplier, TWO_PWR_24))\n return fromNumber(toNumber($this) * toNumber(multiplier), $this.unsigned);\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n var a48 = $this.high >>> 16;\n var a32 = $this.high & 0xFFFF;\n var a16 = $this.low >>> 16;\n var a00 = $this.low & 0xFFFF;\n var b48 = multiplier.high >>> 16;\n var b32 = multiplier.high & 0xFFFF;\n var b16 = multiplier.low >>> 16;\n var b00 = multiplier.low & 0xFFFF;\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, $this.unsigned);\n}\n;\n/**\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\n * @function\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\n// LongPrototype.mul = LongPrototype.multiply;\n/**\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\n * unsigned if this Long is unsigned.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nexport function divide($this, divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n if (isZero(divisor))\n throw Error('division by zero');\n // use wasm support if present\n if (wasm) {\n // guard against signed division overflow: the largest\n // negative number / -1 would be 1 larger than the largest\n // positive number, due to two's complement.\n if (!$this.unsigned &&\n $this.high === -0x80000000 &&\n divisor.low === -1 && divisor.high === -1) {\n // be consistent with non-wasm code path\n return $this;\n }\n var low = ($this.unsigned ? wasm.div_u : wasm.div_s)($this.low, $this.high, divisor.low, divisor.high);\n return fromBits(low, wasm.get_high(), $this.unsigned);\n }\n if (isZero($this))\n return $this.unsigned ? UZERO : ZERO;\n var approx, rem, res;\n if (!$this.unsigned) {\n // This section is only relevant for signed longs and is derived from the\n // closure library as a whole.\n if (equals($this, MIN_VALUE)) {\n if (equals(divisor, ONE) || equals(divisor, NEG_ONE))\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n else if (equals(divisor, MIN_VALUE))\n return ONE;\n else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = shiftRight($this, 1);\n approx = shiftLeft(divide(halfThis, divisor), 1);\n if (equals(approx, ZERO)) {\n return isNegative(divisor) ? ONE : NEG_ONE;\n }\n else {\n rem = subtract($this, multiply(divisor, approx));\n res = add(approx, divide(rem, divisor));\n return res;\n }\n }\n }\n else if (equals(divisor, MIN_VALUE))\n return $this.unsigned ? UZERO : ZERO;\n if (isNegative($this)) {\n if (isNegative(divisor))\n return divide(negate($this), negate(divisor));\n return negate(divide(negate($this), divisor));\n }\n else if (isNegative(divisor))\n return negate(divide($this, negate(divisor)));\n res = ZERO;\n }\n else {\n // The algorithm below has not been made for unsigned longs. It's therefore\n // required to take special care of the MSB prior to running it.\n if (!divisor.unsigned)\n divisor = toUnsigned(divisor);\n if (greaterThan(divisor, $this))\n return UZERO;\n if (greaterThan(divisor, shiftRightUnsigned($this, 1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\n return UONE;\n res = UZERO;\n }\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n rem = $this;\n while (greaterThanOrEqual(rem, divisor)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n approx = Math.max(1, Math.floor(toNumber(rem) / toNumber(divisor)));\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48), \n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n approxRes = fromNumber(approx), approxRem = multiply(approxRes, divisor);\n while (isNegative(approxRem) || greaterThan(approxRem, rem)) {\n approx -= delta;\n approxRes = fromNumber(approx, $this.unsigned);\n approxRem = multiply(approxRes, divisor);\n }\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (isZero(approxRes))\n approxRes = ONE;\n res = add(res, approxRes);\n rem = subtract(rem, approxRem);\n }\n return res;\n}\n;\n/**\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\n// LongPrototype.div = LongPrototype.divide;\n/**\n * Returns this Long modulo the specified.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nexport function modulo($this, divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n // use wasm support if present\n if (wasm) {\n var low = ($this.unsigned ? wasm.rem_u : wasm.rem_s)($this.low, $this.high, divisor.low, divisor.high);\n return fromBits(low, wasm.get_high(), $this.unsigned);\n }\n return subtract($this, multiply(divide($this, divisor), divisor));\n}\n;\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\n// LongPrototype.mod = LongPrototype.modulo;\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\n// LongPrototype.rem = LongPrototype.modulo;\n/**\n * Returns the bitwise NOT of this Long.\n * @this {!Long}\n * @returns {!Long}\n */\nexport function not($this) {\n return fromBits(~$this.low, ~$this.high, $this.unsigned);\n}\n;\n/**\n * Returns the bitwise AND of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nexport function and($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits($this.low & other.low, $this.high & other.high, $this.unsigned);\n}\n;\n/**\n * Returns the bitwise OR of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nexport function or($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits($this.low | other.low, $this.high | other.high, $this.unsigned);\n}\n;\n/**\n * Returns the bitwise XOR of this Long and the given one.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nexport function xor($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits($this.low ^ other.low, $this.high ^ other.high, $this.unsigned);\n}\n;\n/**\n * Returns this Long with bits shifted to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nexport function shiftLeft($this, numBits) {\n if (isLong(numBits))\n numBits = toInt(numBits);\n if ((numBits &= 63) === 0)\n return $this;\n else if (numBits < 32)\n return fromBits($this.low << numBits, ($this.high << numBits) | ($this.low >>> (32 - numBits)), $this.unsigned);\n else\n return fromBits(0, $this.low << (numBits - 32), $this.unsigned);\n}\n;\n/**\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n// LongPrototype.shl = LongPrototype.shiftLeft;\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nexport function shiftRight($this, numBits) {\n if (isLong(numBits))\n numBits = toInt(numBits);\n if ((numBits &= 63) === 0)\n return $this;\n else if (numBits < 32)\n return fromBits(($this.low >>> numBits) | ($this.high << (32 - numBits)), $this.high >> numBits, $this.unsigned);\n else\n return fromBits($this.high >> (numBits - 32), $this.high >= 0 ? 0 : -1, $this.unsigned);\n}\n;\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n// LongPrototype.shr = LongPrototype.shiftRight;\n/**\n * Returns this Long with bits logically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nexport function shiftRightUnsigned($this, numBits) {\n if (isLong(numBits))\n numBits = toInt(numBits);\n numBits &= 63;\n if (numBits === 0)\n return $this;\n else {\n var high = $this.high;\n if (numBits < 32) {\n var low = $this.low;\n return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, $this.unsigned);\n }\n else if (numBits === 32)\n return fromBits(high, 0, $this.unsigned);\n else\n return fromBits(high >>> (numBits - 32), 0, $this.unsigned);\n }\n}\n;\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n// LongPrototype.shru = LongPrototype.shiftRightUnsigned;\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n// LongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\n/**\n * Returns this Long with bits rotated to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nexport const rotateLeft = function rotateLeft(numBits) {\n var b;\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n if (numBits === 32)\n return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.low << numBits) | (this.high >>> b)), ((this.high << numBits) | (this.low >>> b)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.high << numBits) | (this.low >>> b)), ((this.low << numBits) | (this.high >>> b)), this.unsigned);\n};\n/**\n * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\n// LongPrototype.rotl = LongPrototype.rotateLeft;\n/**\n * Returns this Long with bits rotated to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nexport const rotateRight = function rotateRight(numBits) {\n var b;\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n if (numBits === 32)\n return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.high << b) | (this.low >>> numBits)), ((this.low << b) | (this.high >>> numBits)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.low << b) | (this.high >>> numBits)), ((this.high << b) | (this.low >>> numBits)), this.unsigned);\n};\n/**\n * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\n// LongPrototype.rotr = LongPrototype.rotateRight;\n/**\n * Converts this Long to signed.\n * @this {!Long}\n * @returns {!Long} Signed long\n */\nexport function toSigned($this) {\n if (!$this.unsigned)\n return $this;\n return fromBits($this.low, $this.high, false);\n}\n;\n/**\n * Converts this Long to unsigned.\n * @this {!Long}\n * @returns {!Long} Unsigned long\n */\nexport function toUnsigned($this) {\n if ($this.unsigned)\n return $this;\n return fromBits($this.low, $this.high, true);\n}\n;\n/**\n * Converts this Long to its byte representation.\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @this {!Long}\n * @returns {!Array.} Byte representation\n */\nexport function toBytes($this, le) {\n return le ? toBytesLE($this) : toBytesBE($this);\n}\n;\n/**\n * Converts this Long to its little endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Little endian byte representation\n */\nexport function toBytesLE($this) {\n var hi = $this.high, lo = $this.low;\n return [\n lo & 0xff,\n lo >>> 8 & 0xff,\n lo >>> 16 & 0xff,\n lo >>> 24,\n hi & 0xff,\n hi >>> 8 & 0xff,\n hi >>> 16 & 0xff,\n hi >>> 24\n ];\n}\n;\n/**\n * Converts this Long to its big endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Big endian byte representation\n */\nexport function toBytesBE($this) {\n var hi = $this.high, lo = $this.low;\n return [\n hi >>> 24,\n hi >>> 16 & 0xff,\n hi >>> 8 & 0xff,\n hi & 0xff,\n lo >>> 24,\n lo >>> 16 & 0xff,\n lo >>> 8 & 0xff,\n lo & 0xff\n ];\n}\n;\n/**\n * Creates a Long from its byte representation.\n * @param {!Array.} bytes Byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @returns {Long} The corresponding Long value\n */\nexport function fromBytes(bytes, unsigned, le) {\n return le ? fromBytesLE(bytes, unsigned) : fromBytesBE(bytes, unsigned);\n}\n;\n/**\n * Creates a Long from its little endian byte representation.\n * @param {!Array.} bytes Little endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nexport function fromBytesLE(bytes, unsigned) {\n return new Long(bytes[0] |\n bytes[1] << 8 |\n bytes[2] << 16 |\n bytes[3] << 24, bytes[4] |\n bytes[5] << 8 |\n bytes[6] << 16 |\n bytes[7] << 24, unsigned);\n}\n;\n/**\n * Creates a Long from its big endian byte representation.\n * @param {!Array.} bytes Big endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nexport function fromBytesBE(bytes, unsigned) {\n return new Long(bytes[4] << 24 |\n bytes[5] << 16 |\n bytes[6] << 8 |\n bytes[7], bytes[0] << 24 |\n bytes[1] << 16 |\n bytes[2] << 8 |\n bytes[3], unsigned);\n}\n;\n","import { isValid } from \"./Int32.js\";\nimport * as LongLib from \"./lib/long.js\";\nexport default LongLib.Long;\nexport const get_Zero = LongLib.ZERO;\nexport const get_One = LongLib.ONE;\nexport const op_Addition = LongLib.add;\nexport const op_Subtraction = LongLib.subtract;\nexport const op_Multiply = LongLib.multiply;\nexport const op_Division = LongLib.divide;\nexport const op_Modulus = LongLib.modulo;\nexport const op_UnaryNegation = LongLib.negate;\nexport const op_LeftShift = LongLib.shiftLeft;\nexport const op_RightShift = LongLib.shiftRight;\nexport const op_RightShiftUnsigned = LongLib.shiftRightUnsigned;\nexport const op_BitwiseAnd = LongLib.and;\nexport const op_BitwiseOr = LongLib.or;\nexport const op_ExclusiveOr = LongLib.xor;\nexport const op_LogicalNot = LongLib.not;\nexport const op_LessThan = LongLib.lessThan;\nexport const op_LessThanOrEqual = LongLib.lessThanOrEqual;\nexport const op_GreaterThan = LongLib.greaterThan;\nexport const op_GreaterThanOrEqual = LongLib.greaterThanOrEqual;\nexport const op_Equality = LongLib.equals;\nexport const op_Inequality = LongLib.notEquals;\nexport const equals = LongLib.equals;\nexport const compare = LongLib.compare;\nexport const fromInt = LongLib.fromInt;\nexport const fromBits = LongLib.fromBits;\nexport const fromBytes = LongLib.fromBytes;\nexport const fromNumber = LongLib.fromNumber;\nexport const fromString = LongLib.fromString;\nexport const fromValue = LongLib.fromValue;\nexport const toInt = LongLib.toInt;\nexport const toBytes = LongLib.toBytes;\nexport const toNumber = LongLib.toNumber;\nexport const toString = LongLib.toString;\nexport const getLowBits = LongLib.getLowBits;\nexport const getHighBits = LongLib.getHighBits;\nexport const getLowBitsUnsigned = LongLib.getLowBitsUnsigned;\nexport const getHighBitsUnsigned = LongLib.getHighBitsUnsigned;\nfunction getMaxValue(unsigned, radix, isNegative) {\n switch (radix) {\n case 2: return unsigned ?\n \"1111111111111111111111111111111111111111111111111111111111111111\" :\n (isNegative ? \"1000000000000000000000000000000000000000000000000000000000000000\"\n : \"111111111111111111111111111111111111111111111111111111111111111\");\n case 8: return unsigned ?\n \"1777777777777777777777\" :\n (isNegative ? \"1000000000000000000000\" : \"777777777777777777777\");\n case 10: return unsigned ?\n \"18446744073709551615\" :\n (isNegative ? \"9223372036854775808\" : \"9223372036854775807\");\n case 16: return unsigned ?\n \"FFFFFFFFFFFFFFFF\" :\n (isNegative ? \"8000000000000000\" : \"7FFFFFFFFFFFFFFF\");\n default: throw new Error(\"Invalid radix.\");\n }\n}\nexport function abs(x) {\n if (!x.unsigned && LongLib.isNegative(x)) {\n return op_UnaryNegation(x);\n }\n else {\n return x;\n }\n}\nexport function fromInteger(value, unsigned, kind) {\n let x = value;\n let xh = 0;\n switch (kind) {\n case 0:\n x = value << 24 >> 24;\n xh = x;\n break;\n case 4:\n x = value << 24 >>> 24;\n break;\n case 1:\n x = value << 16 >> 16;\n xh = x;\n break;\n case 5:\n x = value << 16 >>> 16;\n break;\n case 2:\n x = value >> 0;\n xh = x;\n break;\n case 6:\n x = value >>> 0;\n break;\n }\n return LongLib.fromBits(x, xh >> 31, unsigned);\n}\nexport function parse(str, style, unsigned, _bitsize, radix) {\n const res = isValid(str, style, radix);\n if (res != null) {\n const lessOrEqual = (x, y) => {\n const len = Math.max(x.length, y.length);\n return x.padStart(len, \"0\") <= y.padStart(len, \"0\");\n };\n const isNegative = res.sign === \"-\";\n const maxValue = getMaxValue(unsigned || res.radix !== 10, res.radix, isNegative);\n if (lessOrEqual(res.digits.toUpperCase(), maxValue)) {\n str = isNegative ? res.sign + res.digits : res.digits;\n return LongLib.fromString(str, unsigned, res.radix);\n }\n }\n throw new Error(\"Input string was not in a correct format.\");\n}\nexport function tryParse(str, style, unsigned, bitsize, defValue) {\n try {\n defValue.contents = parse(str, style, unsigned, bitsize);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nexport function unixEpochMillisecondsToTicks(ms, offset) {\n return op_Multiply(op_Addition(op_Addition(LongLib.fromNumber(ms), 62135596800000), offset), 10000);\n}\nexport function ticksToUnixEpochMilliseconds(ticks) {\n return LongLib.toNumber(op_Subtraction(op_Division(ticks, 10000), 62135596800000));\n}\n// export function makeRangeStepFunction(step: Long, last: Long, unsigned: boolean) {\n// const stepComparedWithZero = LongLib.compare(step, unsigned ? LongLib.UZERO : LongLib.ZERO);\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: Long) => {\n// const comparedWithLast = LongLib.compare(x, last);\n// if ((stepGreaterThanZero && comparedWithLast <= 0)\n// || (!stepGreaterThanZero && comparedWithLast >= 0)) {\n// return [x, op_Addition(x, step)];\n// } else {\n// return undefined;\n// }\n// };\n// }\nexport function divRem(x, y, out) {\n const div = op_Division(x, y);\n const rem = op_Modulus(x, y);\n if (out != null) {\n out.contents = rem;\n return div;\n }\n else {\n return [div, rem];\n }\n}\n","/**\n * DateTimeOffset functions.\n *\n * Note: Date instances are always DateObjects in local\n * timezone (because JS dates are all kinds of messed up).\n * A local date returns UTC epoc when `.getTime()` is called.\n *\n * Basically; invariant: date.getTime() always return UTC time.\n */\nimport { fromValue, ticksToUnixEpochMilliseconds, unixEpochMillisecondsToTicks } from \"./Long.js\";\nimport { compareDates, dateOffset, padWithZeros } from \"./Util.js\";\nexport function dateOffsetToString(offset) {\n const isMinus = offset < 0;\n offset = Math.abs(offset);\n const hours = ~~(offset / 3600000);\n const minutes = (offset % 3600000) / 60000;\n return (isMinus ? \"-\" : \"+\") +\n padWithZeros(hours, 2) + \":\" +\n padWithZeros(minutes, 2);\n}\nexport function dateToHalfUTCString(date, half) {\n const str = date.toISOString();\n return half === \"first\"\n ? str.substring(0, str.indexOf(\"T\"))\n : str.substring(str.indexOf(\"T\") + 1, str.length - 1);\n}\nfunction dateToISOString(d, utc) {\n if (utc) {\n return d.toISOString();\n }\n else {\n // JS Date is always local\n const printOffset = d.kind == null ? true : d.kind === 2 /* Local */;\n return padWithZeros(d.getFullYear(), 4) + \"-\" +\n padWithZeros(d.getMonth() + 1, 2) + \"-\" +\n padWithZeros(d.getDate(), 2) + \"T\" +\n padWithZeros(d.getHours(), 2) + \":\" +\n padWithZeros(d.getMinutes(), 2) + \":\" +\n padWithZeros(d.getSeconds(), 2) + \".\" +\n padWithZeros(d.getMilliseconds(), 3) +\n (printOffset ? dateOffsetToString(d.getTimezoneOffset() * -60000) : \"\");\n }\n}\nfunction dateToISOStringWithOffset(dateWithOffset, offset) {\n const str = dateWithOffset.toISOString();\n return str.substring(0, str.length - 1) + dateOffsetToString(offset);\n}\nfunction dateToStringWithCustomFormat(date, format, utc) {\n return format.replace(/(\\w)\\1*/g, (match) => {\n let rep = Number.NaN;\n switch (match.substring(0, 1)) {\n case \"y\":\n const y = utc ? date.getUTCFullYear() : date.getFullYear();\n rep = match.length < 4 ? y % 100 : y;\n break;\n case \"M\":\n rep = (utc ? date.getUTCMonth() : date.getMonth()) + 1;\n break;\n case \"d\":\n rep = utc ? date.getUTCDate() : date.getDate();\n break;\n case \"H\":\n rep = utc ? date.getUTCHours() : date.getHours();\n break;\n case \"h\":\n const h = utc ? date.getUTCHours() : date.getHours();\n rep = h > 12 ? h % 12 : h;\n break;\n case \"m\":\n rep = utc ? date.getUTCMinutes() : date.getMinutes();\n break;\n case \"s\":\n rep = utc ? date.getUTCSeconds() : date.getSeconds();\n break;\n case \"f\":\n rep = utc ? date.getUTCMilliseconds() : date.getMilliseconds();\n break;\n }\n if (Number.isNaN(rep)) {\n return match;\n }\n else {\n return (rep < 10 && match.length > 1) ? \"0\" + rep : \"\" + rep;\n }\n });\n}\nfunction dateToStringWithOffset(date, format) {\n var _a, _b, _c;\n const d = new Date(date.getTime() + ((_a = date.offset) !== null && _a !== void 0 ? _a : 0));\n if (typeof format !== \"string\") {\n return d.toISOString().replace(/\\.\\d+/, \"\").replace(/[A-Z]|\\.\\d+/g, \" \") + dateOffsetToString(((_b = date.offset) !== null && _b !== void 0 ? _b : 0));\n }\n else if (format.length === 1) {\n switch (format) {\n case \"D\":\n case \"d\": return dateToHalfUTCString(d, \"first\");\n case \"T\":\n case \"t\": return dateToHalfUTCString(d, \"second\");\n case \"O\":\n case \"o\": return dateToISOStringWithOffset(d, ((_c = date.offset) !== null && _c !== void 0 ? _c : 0));\n default: throw new Error(\"Unrecognized Date print format\");\n }\n }\n else {\n return dateToStringWithCustomFormat(d, format, true);\n }\n}\nfunction dateToStringWithKind(date, format) {\n const utc = date.kind === 1 /* UTC */;\n if (typeof format !== \"string\") {\n return utc ? date.toUTCString() : date.toLocaleString();\n }\n else if (format.length === 1) {\n switch (format) {\n case \"D\":\n case \"d\":\n return utc ? dateToHalfUTCString(date, \"first\") : date.toLocaleDateString();\n case \"T\":\n case \"t\":\n return utc ? dateToHalfUTCString(date, \"second\") : date.toLocaleTimeString();\n case \"O\":\n case \"o\":\n return dateToISOString(date, utc);\n default:\n throw new Error(\"Unrecognized Date print format\");\n }\n }\n else {\n return dateToStringWithCustomFormat(date, format, utc);\n }\n}\nexport function toString(date, format, _provider) {\n return date.offset != null\n ? dateToStringWithOffset(date, format)\n : dateToStringWithKind(date, format);\n}\nexport function DateTime(value, kind) {\n const d = new Date(value);\n d.kind = (kind == null ? 0 /* Unspecified */ : kind) | 0;\n return d;\n}\nexport function fromTicks(ticks, kind) {\n ticks = fromValue(ticks);\n kind = kind != null ? kind : 2 /* Local */; // better default than Unspecified\n let date = DateTime(ticksToUnixEpochMilliseconds(ticks), kind);\n // Ticks are local to offset (in this case, either UTC or Local/Unknown).\n // If kind is anything but UTC, that means that the tick number was not\n // in utc, thus getTime() cannot return UTC, and needs to be shifted.\n if (kind !== 1 /* UTC */) {\n date = DateTime(date.getTime() - dateOffset(date), kind);\n }\n return date;\n}\nexport function fromDateTimeOffset(date, kind) {\n var _a;\n switch (kind) {\n case 1 /* UTC */: return DateTime(date.getTime(), 1 /* UTC */);\n case 2 /* Local */: return DateTime(date.getTime(), 2 /* Local */);\n default:\n const d = DateTime(date.getTime() + ((_a = date.offset) !== null && _a !== void 0 ? _a : 0), kind);\n return DateTime(d.getTime() - dateOffset(d), kind);\n }\n}\nexport function getTicks(date) {\n return unixEpochMillisecondsToTicks(date.getTime(), dateOffset(date));\n}\nexport function minValue() {\n // This is \"0001-01-01T00:00:00.000Z\", actual JS min value is -8640000000000000\n return DateTime(-62135596800000, 0 /* Unspecified */);\n}\nexport function maxValue() {\n // This is \"9999-12-31T23:59:59.999Z\", actual JS max value is 8640000000000000\n return DateTime(253402300799999, 0 /* Unspecified */);\n}\nexport function parseRaw(input) {\n function fail() {\n throw new Error(`The string is not a valid Date: ${input}`);\n }\n if (input == null || input.trim() === \"\") {\n fail();\n }\n // ISO dates without TZ are parsed as UTC. Adding time without TZ keeps them local.\n if (input.length === 10 && input[4] === \"-\" && input[7] === \"-\") {\n input += \"T00:00:00\";\n }\n let date = new Date(input);\n let offset = null;\n if (isNaN(date.getTime())) {\n // Try to check strings JS Date cannot parse (see #1045, #1422)\n // tslint:disable-next-line:max-line-length\n const m = /^\\s*(\\d+[^\\w\\s:]\\d+[^\\w\\s:]\\d+)?\\s*(\\d+:\\d+(?::\\d+(?:\\.\\d+)?)?)?\\s*([AaPp][Mm])?\\s*(Z|[+-]([01]?\\d):?([0-5]?\\d)?)?\\s*$/.exec(input);\n if (m != null) {\n let baseDate;\n let timeInSeconds = 0;\n if (m[2] != null) {\n const timeParts = m[2].split(\":\");\n timeInSeconds =\n parseInt(timeParts[0], 10) * 3600 +\n parseInt(timeParts[1] || \"0\", 10) * 60 +\n parseFloat(timeParts[2] || \"0\");\n if (m[3] != null && m[3].toUpperCase() === \"PM\") {\n timeInSeconds += 720;\n }\n }\n if (m[4] != null) { // There's an offset, parse as UTC\n if (m[1] != null) {\n baseDate = new Date(m[1] + \" UTC\");\n }\n else {\n const d = new Date();\n baseDate = new Date(d.getUTCFullYear() + \"/\" + (d.getUTCMonth() + 1) + \"/\" + d.getUTCDate());\n }\n if (m[4] === \"Z\") {\n offset = \"Z\";\n }\n else {\n let offsetInMinutes = parseInt(m[5], 10) * 60 + parseInt(m[6] || \"0\", 10);\n if (m[4][0] === \"-\") {\n offsetInMinutes *= -1;\n }\n offset = offsetInMinutes;\n timeInSeconds -= offsetInMinutes * 60;\n }\n }\n else {\n if (m[1] != null) {\n baseDate = new Date(m[1]);\n }\n else {\n const d = new Date();\n baseDate = new Date(d.getFullYear() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getDate());\n }\n }\n date = new Date(baseDate.getTime() + timeInSeconds * 1000);\n // correct for daylight savings time\n date = new Date(date.getTime() + (date.getTimezoneOffset() - baseDate.getTimezoneOffset()) * 60000);\n }\n else {\n fail();\n }\n // Check again the date is valid after transformations, see #2229\n if (isNaN(date.getTime())) {\n fail();\n }\n }\n return [date, offset];\n}\nexport function parse(str, detectUTC = false) {\n const [date, offset] = parseRaw(str);\n // .NET always parses DateTime as Local if there's offset info (even \"Z\")\n // Newtonsoft.Json uses UTC if the offset is \"Z\"\n const kind = offset != null\n ? (detectUTC && offset === \"Z\" ? 1 /* UTC */ : 2 /* Local */)\n : 0 /* Unspecified */;\n return DateTime(date.getTime(), kind);\n}\nexport function tryParse(v, defValue) {\n try {\n defValue.contents = parse(v);\n return true;\n }\n catch (_err) {\n return false;\n }\n}\nexport function create(year, month, day, h = 0, m = 0, s = 0, ms = 0, kind) {\n const dateValue = kind === 1 /* UTC */\n ? Date.UTC(year, month - 1, day, h, m, s, ms)\n : new Date(year, month - 1, day, h, m, s, ms).getTime();\n if (isNaN(dateValue)) {\n throw new Error(\"The parameters describe an unrepresentable Date.\");\n }\n const date = DateTime(dateValue, kind);\n if (year <= 99) {\n date.setFullYear(year, month - 1, day);\n }\n return date;\n}\nexport function now() {\n return DateTime(Date.now(), 2 /* Local */);\n}\nexport function utcNow() {\n return DateTime(Date.now(), 1 /* UTC */);\n}\nexport function today() {\n return date(now());\n}\nexport function isLeapYear(year) {\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n}\nexport function daysInMonth(year, month) {\n return month === 2\n ? (isLeapYear(year) ? 29 : 28)\n : (month >= 8 ? (month % 2 === 0 ? 31 : 30) : (month % 2 === 0 ? 30 : 31));\n}\nexport function toUniversalTime(date) {\n return date.kind === 1 /* UTC */ ? date : DateTime(date.getTime(), 1 /* UTC */);\n}\nexport function toLocalTime(date) {\n return date.kind === 2 /* Local */ ? date : DateTime(date.getTime(), 2 /* Local */);\n}\nexport function specifyKind(d, kind) {\n return create(year(d), month(d), day(d), hour(d), minute(d), second(d), millisecond(d), kind);\n}\nexport function timeOfDay(d) {\n return hour(d) * 3600000\n + minute(d) * 60000\n + second(d) * 1000\n + millisecond(d);\n}\nexport function date(d) {\n return create(year(d), month(d), day(d), 0, 0, 0, 0, d.kind);\n}\nexport function day(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCDate() : d.getDate();\n}\nexport function hour(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCHours() : d.getHours();\n}\nexport function millisecond(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCMilliseconds() : d.getMilliseconds();\n}\nexport function minute(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCMinutes() : d.getMinutes();\n}\nexport function month(d) {\n return (d.kind === 1 /* UTC */ ? d.getUTCMonth() : d.getMonth()) + 1;\n}\nexport function second(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCSeconds() : d.getSeconds();\n}\nexport function year(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCFullYear() : d.getFullYear();\n}\nexport function dayOfWeek(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCDay() : d.getDay();\n}\nexport function dayOfYear(d) {\n const _year = year(d);\n const _month = month(d);\n let _day = day(d);\n for (let i = 1; i < _month; i++) {\n _day += daysInMonth(_year, i);\n }\n return _day;\n}\nexport function add(d, ts) {\n const newDate = DateTime(d.getTime() + ts, d.kind);\n if (d.kind === 2 /* Local */) {\n const oldTzOffset = d.getTimezoneOffset();\n const newTzOffset = newDate.getTimezoneOffset();\n return oldTzOffset !== newTzOffset\n ? DateTime(newDate.getTime() + (newTzOffset - oldTzOffset) * 60000, d.kind)\n : newDate;\n }\n else {\n return newDate;\n }\n}\nexport function addDays(d, v) {\n return add(d, v * 86400000);\n}\nexport function addHours(d, v) {\n return add(d, v * 3600000);\n}\nexport function addMinutes(d, v) {\n return add(d, v * 60000);\n}\nexport function addSeconds(d, v) {\n return add(d, v * 1000);\n}\nexport function addMilliseconds(d, v) {\n return add(d, v);\n}\nexport function addYears(d, v) {\n const newMonth = month(d);\n const newYear = year(d) + v;\n const _daysInMonth = daysInMonth(newYear, newMonth);\n const newDay = Math.min(_daysInMonth, day(d));\n return create(newYear, newMonth, newDay, hour(d), minute(d), second(d), millisecond(d), d.kind);\n}\nexport function addMonths(d, v) {\n let newMonth = month(d) + v;\n let newMonth_ = 0;\n let yearOffset = 0;\n if (newMonth > 12) {\n newMonth_ = newMonth % 12;\n yearOffset = Math.floor(newMonth / 12);\n newMonth = newMonth_;\n }\n else if (newMonth < 1) {\n newMonth_ = 12 + newMonth % 12;\n yearOffset = Math.floor(newMonth / 12) + (newMonth_ === 12 ? -1 : 0);\n newMonth = newMonth_;\n }\n const newYear = year(d) + yearOffset;\n const _daysInMonth = daysInMonth(newYear, newMonth);\n const newDay = Math.min(_daysInMonth, day(d));\n return create(newYear, newMonth, newDay, hour(d), minute(d), second(d), millisecond(d), d.kind);\n}\nexport function subtract(d, that) {\n return typeof that === \"number\"\n ? add(d, -that)\n : d.getTime() - that.getTime();\n}\nexport function toLongDateString(d) {\n return d.toDateString();\n}\nexport function toShortDateString(d) {\n return d.toLocaleDateString();\n}\nexport function toLongTimeString(d) {\n return d.toLocaleTimeString();\n}\nexport function toShortTimeString(d) {\n return d.toLocaleTimeString().replace(/:\\d\\d(?!:)/, \"\");\n}\nexport function equals(d1, d2) {\n return d1.getTime() === d2.getTime();\n}\nexport const compare = compareDates;\nexport const compareTo = compareDates;\nexport function op_Addition(x, y) {\n return add(x, y);\n}\nexport function op_Subtraction(x, y) {\n return subtract(x, y);\n}\nexport function isDaylightSavingTime(x) {\n const jan = new Date(x.getFullYear(), 0, 1);\n const jul = new Date(x.getFullYear(), 6, 1);\n return isDST(jan.getTimezoneOffset(), jul.getTimezoneOffset(), x.getTimezoneOffset());\n}\nfunction isDST(janOffset, julOffset, tOffset) {\n return Math.min(janOffset, julOffset) === tOffset;\n}\nexport default DateTime;\n","export function create(pattern, options = 0) {\n // Supported RegexOptions\n // * IgnoreCase: 0x0001\n // * Multiline: 0x0002\n // * Compiled: 0x0008 (ignored)\n // * Singleline: 0x0010\n // * ECMAScript: 0x0100 (ignored)\n if ((options & ~(1 ^ 2 ^ 8 ^ 16 ^ 256)) !== 0) {\n throw new Error(\"RegexOptions only supports: IgnoreCase, Multiline, Compiled, Singleline and ECMAScript\");\n }\n // Set always global and unicode flags for compatibility with dotnet, see #2925\n let flags = \"gu\";\n flags += options & 1 ? \"i\" : \"\"; // 0x0001 RegexOptions.IgnoreCase\n flags += options & 2 ? \"m\" : \"\";\n flags += options & 16 ? \"s\" : \"\";\n return new RegExp(pattern, flags);\n}\n// From http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex\nexport function escape(str) {\n return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\");\n}\nexport function unescape(str) {\n return str.replace(/\\\\([\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|])/g, \"$1\");\n}\nexport function isMatch(reg, input, startAt = 0) {\n reg.lastIndex = startAt;\n return reg.test(input);\n}\nexport function match(reg, input, startAt = 0) {\n reg.lastIndex = startAt;\n return reg.exec(input);\n}\nexport function matches(reg, input, startAt = 0) {\n if (input == null) {\n throw new Error(\"Input cannot ve null\");\n }\n if (!reg.global) {\n throw new Error(\"Non-global RegExp\"); // Prevent infinite loop\n }\n reg.lastIndex = startAt;\n const matches = [];\n let m;\n let lastMatchIndex = -1;\n // tslint:disable-next-line:no-conditional-assignment\n while ((m = reg.exec(input)) != null) {\n // It can happen even global regex get stuck, see #2845\n if (m.index === lastMatchIndex) {\n reg.lastIndex++;\n }\n else {\n lastMatchIndex = m.index;\n matches.push(m);\n }\n }\n return matches;\n}\nexport function options(reg) {\n let options = 256; // ECMAScript\n options |= reg.ignoreCase ? 1 : 0;\n options |= reg.multiline ? 2 : 0;\n return options;\n}\nexport function replace(reg, input, replacement, limit, offset = 0) {\n function replacer() {\n let res = arguments[0];\n if (limit) {\n limit--;\n const match = [];\n const len = arguments.length;\n // arguments: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_function_as_a_parameter\n // * match: matched substring\n // * p1, p2, ...: nth capture group string\n // * offset: offset of matched substring\n // * string: whole string examined\n // * groups: named capturing groups\n // ONLY if regex contains a named capture group AND browser supports named groups\n // -> last element can be groups OR input string\n // -> check if last element is string\n const withGroups = typeof arguments[len - 1] !== \"string\";\n let pLast = withGroups ? len - 3 : len - 2;\n for (let i = 0; i < pLast; i++) {\n match.push(arguments[i]);\n }\n match.index = arguments[pLast++];\n match.input = arguments[pLast++];\n if (withGroups) {\n match.groups = arguments[pLast];\n }\n res = replacement(match);\n }\n return res;\n }\n if (typeof reg === \"string\") {\n const tmp = reg;\n reg = create(input, limit !== null && limit !== void 0 ? limit : 0);\n input = tmp;\n limit = undefined;\n }\n if (typeof replacement === \"function\") {\n limit = limit == null ? -1 : limit;\n return input.substring(0, offset) + input.substring(offset).replace(reg, replacer);\n }\n else {\n replacement =\n replacement\n // $0 doesn't work with JS regex, see #1155\n .replace(/\\$0/g, (_s) => \"$&\")\n // named groups in replacement are `${name}` in .Net, but `$` in JS (in regex: groups are `(?...)` in both)\n .replace(/\\${([^}]+)}/g, \"\\$<$1>\");\n if (limit != null) {\n let m;\n const sub1 = input.substring(offset);\n const _matches = matches(reg, sub1);\n const sub2 = matches.length > limit ? (m = _matches[limit - 1], sub1.substring(0, m.index + m[0].length)) : sub1;\n return input.substring(0, offset) + sub2.replace(reg, replacement)\n + input.substring(offset + sub2.length);\n }\n else {\n return input.replace(reg, replacement);\n }\n }\n}\nexport function split(reg, input, limit, offset = 0) {\n if (typeof reg === \"string\") {\n const tmp = reg;\n reg = create(input, limit !== null && limit !== void 0 ? limit : 0);\n input = tmp;\n limit = undefined;\n }\n input = input.substring(offset);\n return input.split(reg, limit);\n}\n","import { toString as dateToString } from \"./Date.js\";\nimport { compare as numericCompare, isNumeric, multiply, toExponential, toFixed, toHex, toPrecision } from \"./Numeric.js\";\nimport { escape } from \"./RegExp.js\";\nimport { toString } from \"./Types.js\";\nconst fsFormatRegExp = /(^|[^%])%([0+\\- ]*)(\\*|\\d+)?(?:\\.(\\d+))?(\\w)/g;\nconst interpolateRegExp = /(?:(^|[^%])%([0+\\- ]*)(\\d+)?(?:\\.(\\d+))?(\\w))?%P\\(\\)/g;\nconst formatRegExp = /\\{(\\d+)(,-?\\d+)?(?:\\:([a-zA-Z])(\\d{0,2})|\\:(.+?))?\\}/g;\nfunction isLessThan(x, y) {\n return numericCompare(x, y) < 0;\n}\nfunction cmp(x, y, ic) {\n function isIgnoreCase(i) {\n return i === true ||\n i === 1 /* CurrentCultureIgnoreCase */ ||\n i === 3 /* InvariantCultureIgnoreCase */ ||\n i === 5 /* OrdinalIgnoreCase */;\n }\n function isOrdinal(i) {\n return i === 4 /* Ordinal */ ||\n i === 5 /* OrdinalIgnoreCase */;\n }\n if (x == null) {\n return y == null ? 0 : -1;\n }\n if (y == null) {\n return 1;\n } // everything is bigger than null\n if (isOrdinal(ic)) {\n if (isIgnoreCase(ic)) {\n x = x.toLowerCase();\n y = y.toLowerCase();\n }\n return (x === y) ? 0 : (x < y ? -1 : 1);\n }\n else {\n if (isIgnoreCase(ic)) {\n x = x.toLocaleLowerCase();\n y = y.toLocaleLowerCase();\n }\n return x.localeCompare(y);\n }\n}\nexport function compare(...args) {\n switch (args.length) {\n case 2: return cmp(args[0], args[1], false);\n case 3: return cmp(args[0], args[1], args[2]);\n case 4: return cmp(args[0], args[1], args[2] === true);\n case 5: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), false);\n case 6: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), args[5]);\n case 7: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), args[5] === true);\n default: throw new Error(\"String.compare: Unsupported number of parameters\");\n }\n}\nexport function compareOrdinal(x, y) {\n return cmp(x, y, 4 /* Ordinal */);\n}\nexport function compareTo(x, y) {\n return cmp(x, y, 0 /* CurrentCulture */);\n}\nexport function startsWith(str, pattern, ic) {\n if (str.length >= pattern.length) {\n return cmp(str.substr(0, pattern.length), pattern, ic) === 0;\n }\n return false;\n}\nexport function indexOfAny(str, anyOf, ...args) {\n if (str == null || str === \"\") {\n return -1;\n }\n const startIndex = (args.length > 0) ? args[0] : 0;\n if (startIndex < 0) {\n throw new Error(\"Start index cannot be negative\");\n }\n const length = (args.length > 1) ? args[1] : str.length - startIndex;\n if (length < 0) {\n throw new Error(\"Length cannot be negative\");\n }\n if (length > str.length - startIndex) {\n throw new Error(\"Invalid startIndex and length\");\n }\n str = str.substr(startIndex, length);\n for (const c of anyOf) {\n const index = str.indexOf(c);\n if (index > -1) {\n return index + startIndex;\n }\n }\n return -1;\n}\nexport function printf(input) {\n return {\n input,\n cont: fsFormat(input),\n };\n}\nexport function interpolate(str, values) {\n let valIdx = 0;\n let strIdx = 0;\n let result = \"\";\n interpolateRegExp.lastIndex = 0;\n let match = interpolateRegExp.exec(str);\n while (match) {\n // The first group corresponds to the no-escape char (^|[^%]), the actual pattern starts in the next char\n // Note: we don't use negative lookbehind because some browsers don't support it yet\n const matchIndex = match.index + (match[1] || \"\").length;\n result += str.substring(strIdx, matchIndex).replace(/%%/g, \"%\");\n const [, , flags, padLength, precision, format] = match;\n // Save interpolateRegExp.lastIndex before running formatReplacement because the values\n // may also involve interpolation and make use of interpolateRegExp (see #3078)\n strIdx = interpolateRegExp.lastIndex;\n result += formatReplacement(values[valIdx++], flags, padLength, precision, format);\n // Move interpolateRegExp.lastIndex one char behind to make sure we match the no-escape char next time\n interpolateRegExp.lastIndex = strIdx - 1;\n match = interpolateRegExp.exec(str);\n }\n result += str.substring(strIdx).replace(/%%/g, \"%\");\n return result;\n}\nfunction continuePrint(cont, arg) {\n return typeof arg === \"string\" ? cont(arg) : arg.cont(cont);\n}\nexport function toConsole(arg) {\n // Don't remove the lambda here, see #1357\n return continuePrint((x) => console.log(x), arg);\n}\nexport function toConsoleError(arg) {\n return continuePrint((x) => console.error(x), arg);\n}\nexport function toText(arg) {\n return continuePrint((x) => x, arg);\n}\nexport function toFail(arg) {\n return continuePrint((x) => {\n throw new Error(x);\n }, arg);\n}\nfunction formatReplacement(rep, flags, padLength, precision, format) {\n let sign = \"\";\n flags = flags || \"\";\n format = format || \"\";\n if (isNumeric(rep)) {\n if (format.toLowerCase() !== \"x\") {\n if (isLessThan(rep, 0)) {\n rep = multiply(rep, -1);\n sign = \"-\";\n }\n else {\n if (flags.indexOf(\" \") >= 0) {\n sign = \" \";\n }\n else if (flags.indexOf(\"+\") >= 0) {\n sign = \"+\";\n }\n }\n }\n precision = precision == null ? null : parseInt(precision, 10);\n switch (format) {\n case \"f\":\n case \"F\":\n precision = precision != null ? precision : 6;\n rep = toFixed(rep, precision);\n break;\n case \"g\":\n case \"G\":\n rep = precision != null ? toPrecision(rep, precision) : toPrecision(rep);\n break;\n case \"e\":\n case \"E\":\n rep = precision != null ? toExponential(rep, precision) : toExponential(rep);\n break;\n case \"x\":\n rep = toHex(rep);\n break;\n case \"X\":\n rep = toHex(rep).toUpperCase();\n break;\n default: // AOid\n rep = String(rep);\n break;\n }\n }\n else if (rep instanceof Date) {\n rep = dateToString(rep);\n }\n else {\n rep = toString(rep);\n }\n padLength = typeof padLength === \"number\" ? padLength : parseInt(padLength, 10);\n if (!isNaN(padLength)) {\n const zeroFlag = flags.indexOf(\"0\") >= 0; // Use '0' for left padding\n const minusFlag = flags.indexOf(\"-\") >= 0; // Right padding\n const ch = minusFlag || !zeroFlag ? \" \" : \"0\";\n if (ch === \"0\") {\n rep = pad(rep, padLength - sign.length, ch, minusFlag);\n rep = sign + rep;\n }\n else {\n rep = pad(sign + rep, padLength, ch, minusFlag);\n }\n }\n else {\n rep = sign + rep;\n }\n return rep;\n}\nfunction createPrinter(cont, _strParts, _matches, _result = \"\", padArg = -1) {\n return (...args) => {\n // Make copies of the values passed by reference because the function can be used multiple times\n let result = _result;\n const strParts = _strParts.slice();\n const matches = _matches.slice();\n for (const arg of args) {\n const [, , flags, _padLength, precision, format] = matches[0];\n let padLength = _padLength;\n if (padArg >= 0) {\n padLength = padArg;\n padArg = -1;\n }\n else if (padLength === \"*\") {\n if (arg < 0) {\n throw new Error(\"Non-negative number required\");\n }\n padArg = arg;\n continue;\n }\n result += strParts[0];\n result += formatReplacement(arg, flags, padLength, precision, format);\n strParts.splice(0, 1);\n matches.splice(0, 1);\n }\n if (matches.length === 0) {\n result += strParts[0];\n return cont(result);\n }\n else {\n return createPrinter(cont, strParts, matches, result, padArg);\n }\n };\n}\nexport function fsFormat(str) {\n return (cont) => {\n fsFormatRegExp.lastIndex = 0;\n const strParts = [];\n const matches = [];\n let strIdx = 0;\n let match = fsFormatRegExp.exec(str);\n while (match) {\n // The first group corresponds to the no-escape char (^|[^%]), the actual pattern starts in the next char\n // Note: we don't use negative lookbehind because some browsers don't support it yet\n const matchIndex = match.index + (match[1] || \"\").length;\n strParts.push(str.substring(strIdx, matchIndex).replace(/%%/g, \"%\"));\n matches.push(match);\n strIdx = fsFormatRegExp.lastIndex;\n // Likewise we need to move fsFormatRegExp.lastIndex one char behind to make sure we match the no-escape char next time\n fsFormatRegExp.lastIndex -= 1;\n match = fsFormatRegExp.exec(str);\n }\n if (strParts.length === 0) {\n return cont(str.replace(/%%/g, \"%\"));\n }\n else {\n strParts.push(str.substring(strIdx).replace(/%%/g, \"%\"));\n return createPrinter(cont, strParts, matches);\n }\n };\n}\nexport function format(str, ...args) {\n if (typeof str === \"object\" && args.length > 0) {\n // Called with culture info\n str = args[0];\n args.shift();\n }\n return str.replace(formatRegExp, (_, idx, padLength, format, precision, pattern) => {\n if (idx < 0 || idx >= args.length) {\n throw new Error(\"Index must be greater or equal to zero and less than the arguments' length.\");\n }\n let rep = args[idx];\n if (isNumeric(rep)) {\n precision = precision == null ? null : parseInt(precision, 10);\n switch (format) {\n case \"f\":\n case \"F\":\n precision = precision != null ? precision : 2;\n rep = toFixed(rep, precision);\n break;\n case \"g\":\n case \"G\":\n rep = precision != null ? toPrecision(rep, precision) : toPrecision(rep);\n break;\n case \"e\":\n case \"E\":\n rep = precision != null ? toExponential(rep, precision) : toExponential(rep);\n break;\n case \"p\":\n case \"P\":\n precision = precision != null ? precision : 2;\n rep = toFixed(multiply(rep, 100), precision) + \" %\";\n break;\n case \"d\":\n case \"D\":\n rep = precision != null ? padLeft(String(rep), precision, \"0\") : String(rep);\n break;\n case \"x\":\n case \"X\":\n rep = precision != null ? padLeft(toHex(rep), precision, \"0\") : toHex(rep);\n if (format === \"X\") {\n rep = rep.toUpperCase();\n }\n break;\n default:\n if (pattern) {\n let sign = \"\";\n rep = pattern.replace(/([0#,]+)(\\.[0#]+)?/, (_, intPart, decimalPart) => {\n if (isLessThan(rep, 0)) {\n rep = multiply(rep, -1);\n sign = \"-\";\n }\n decimalPart = decimalPart == null ? \"\" : decimalPart.substring(1);\n rep = toFixed(rep, Math.max(decimalPart.length, 0));\n let [repInt, repDecimal] = rep.split(\".\");\n repDecimal || (repDecimal = \"\");\n const leftZeroes = intPart.replace(/,/g, \"\").replace(/^#+/, \"\").length;\n repInt = padLeft(repInt, leftZeroes, \"0\");\n const rightZeros = decimalPart.replace(/#+$/, \"\").length;\n if (rightZeros > repDecimal.length) {\n repDecimal = padRight(repDecimal, rightZeros, \"0\");\n }\n else if (rightZeros < repDecimal.length) {\n repDecimal = repDecimal.substring(0, rightZeros) + repDecimal.substring(rightZeros).replace(/0+$/, \"\");\n }\n // Thousands separator\n if (intPart.indexOf(\",\") > 0) {\n const i = repInt.length % 3;\n const thousandGroups = Math.floor(repInt.length / 3);\n let thousands = i > 0 ? repInt.substr(0, i) + (thousandGroups > 0 ? \",\" : \"\") : \"\";\n for (let j = 0; j < thousandGroups; j++) {\n thousands += repInt.substr(i + j * 3, 3) + (j < thousandGroups - 1 ? \",\" : \"\");\n }\n repInt = thousands;\n }\n return repDecimal.length > 0 ? repInt + \".\" + repDecimal : repInt;\n });\n rep = sign + rep;\n }\n }\n }\n else if (rep instanceof Date) {\n rep = dateToString(rep, pattern || format);\n }\n else {\n rep = toString(rep);\n }\n padLength = parseInt((padLength || \" \").substring(1), 10);\n if (!isNaN(padLength)) {\n rep = pad(String(rep), Math.abs(padLength), \" \", padLength < 0);\n }\n return rep;\n });\n}\nexport function endsWith(str, search) {\n const idx = str.lastIndexOf(search);\n return idx >= 0 && idx === str.length - search.length;\n}\nexport function initialize(n, f) {\n if (n < 0) {\n throw new Error(\"String length must be non-negative\");\n }\n const xs = new Array(n);\n for (let i = 0; i < n; i++) {\n xs[i] = f(i);\n }\n return xs.join(\"\");\n}\nexport function insert(str, startIndex, value) {\n if (startIndex < 0 || startIndex > str.length) {\n throw new Error(\"startIndex is negative or greater than the length of this instance.\");\n }\n return str.substring(0, startIndex) + value + str.substring(startIndex);\n}\nexport function isNullOrEmpty(str) {\n return typeof str !== \"string\" || str.length === 0;\n}\nexport function isNullOrWhiteSpace(str) {\n return typeof str !== \"string\" || /^\\s*$/.test(str);\n}\nexport function concat(...xs) {\n return xs.map((x) => String(x)).join(\"\");\n}\nexport function join(delimiter, xs) {\n if (Array.isArray(xs)) {\n return xs.join(delimiter);\n }\n else {\n return Array.from(xs).join(delimiter);\n }\n}\nexport function joinWithIndices(delimiter, xs, startIndex, count) {\n const endIndexPlusOne = startIndex + count;\n if (endIndexPlusOne > xs.length) {\n throw new Error(\"Index and count must refer to a location within the buffer.\");\n }\n return xs.slice(startIndex, endIndexPlusOne).join(delimiter);\n}\nfunction notSupported(name) {\n throw new Error(\"The environment doesn't support '\" + name + \"', please use a polyfill.\");\n}\nexport function toBase64String(inArray) {\n let str = \"\";\n for (let i = 0; i < inArray.length; i++) {\n str += String.fromCharCode(inArray[i]);\n }\n return typeof btoa === \"function\" ? btoa(str) : notSupported(\"btoa\");\n}\nexport function fromBase64String(b64Encoded) {\n const binary = typeof atob === \"function\" ? atob(b64Encoded) : notSupported(\"atob\");\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\nfunction pad(str, len, ch, isRight) {\n ch = ch || \" \";\n len = len - str.length;\n for (let i = 0; i < len; i++) {\n str = isRight ? str + ch : ch + str;\n }\n return str;\n}\nexport function padLeft(str, len, ch) {\n return pad(str, len, ch);\n}\nexport function padRight(str, len, ch) {\n return pad(str, len, ch, true);\n}\nexport function remove(str, startIndex, count) {\n if (startIndex >= str.length) {\n throw new Error(\"startIndex must be less than length of string\");\n }\n if (typeof count === \"number\" && (startIndex + count) > str.length) {\n throw new Error(\"Index and count must refer to a location within the string.\");\n }\n return str.slice(0, startIndex) + (typeof count === \"number\" ? str.substr(startIndex + count) : \"\");\n}\nexport function replace(str, search, replace) {\n return str.replace(new RegExp(escape(search), \"g\"), replace);\n}\nexport function replicate(n, x) {\n return initialize(n, () => x);\n}\nexport function getCharAtIndex(input, index) {\n if (index < 0 || index >= input.length) {\n throw new Error(\"Index was outside the bounds of the array.\");\n }\n return input[index];\n}\nexport function split(str, splitters, count, options) {\n count = typeof count === \"number\" ? count : undefined;\n options = typeof options === \"number\" ? options : 0;\n if (count && count < 0) {\n throw new Error(\"Count cannot be less than zero\");\n }\n if (count === 0) {\n return [];\n }\n const removeEmpty = (options & 1) === 1;\n const trim = (options & 2) === 2;\n splitters = splitters || [];\n splitters = splitters.filter(x => x).map(escape);\n splitters = splitters.length > 0 ? splitters : [\"\\\\s\"];\n const splits = [];\n const reg = new RegExp(splitters.join(\"|\"), \"g\");\n let findSplits = true;\n let i = 0;\n do {\n const match = reg.exec(str);\n if (match === null) {\n const candidate = trim ? str.substring(i).trim() : str.substring(i);\n if (!removeEmpty || candidate.length > 0) {\n splits.push(candidate);\n }\n findSplits = false;\n }\n else {\n const candidate = trim ? str.substring(i, match.index).trim() : str.substring(i, match.index);\n if (!removeEmpty || candidate.length > 0) {\n if (count != null && splits.length + 1 === count) {\n splits.push(trim ? str.substring(i).trim() : str.substring(i));\n findSplits = false;\n }\n else {\n splits.push(candidate);\n }\n }\n i = reg.lastIndex;\n }\n } while (findSplits);\n return splits;\n}\nexport function trim(str, ...chars) {\n if (chars.length === 0) {\n return str.trim();\n }\n const pattern = \"[\" + escape(chars.join(\"\")) + \"]+\";\n return str.replace(new RegExp(\"^\" + pattern), \"\").replace(new RegExp(pattern + \"$\"), \"\");\n}\nexport function trimStart(str, ...chars) {\n return chars.length === 0\n ? str.trimStart()\n : str.replace(new RegExp(\"^[\" + escape(chars.join(\"\")) + \"]+\"), \"\");\n}\nexport function trimEnd(str, ...chars) {\n return chars.length === 0\n ? str.trimEnd()\n : str.replace(new RegExp(\"[\" + escape(chars.join(\"\")) + \"]+$\"), \"\");\n}\nexport function filter(pred, x) {\n return x.split(\"\").filter((c) => pred(c)).join(\"\");\n}\nexport function substring(str, startIndex, length) {\n if ((startIndex + (length || 0) > str.length)) {\n throw new Error(\"Invalid startIndex and/or length\");\n }\n return length != null ? str.substr(startIndex, length) : str.substr(startIndex);\n}\nexport function fmt(strs, ...args) {\n return ({ strs, args });\n}\nexport function fmtWith(fmts) {\n return (strs, ...args) => ({ strs, args, fmts });\n}\nexport function getFormat(s) {\n return s.fmts\n ? s.strs.reduce((acc, newPart, index) => acc + `{${String(index - 1) + s.fmts[index - 1]}}` + newPart)\n : s.strs.reduce((acc, newPart, index) => acc + `{${index - 1}}` + newPart);\n}\n","\r\nexport const SR_indexOutOfBounds = \"The index was outside the range of elements in the collection.\";\r\n\r\nexport const SR_inputWasEmpty = \"Collection was empty.\";\r\n\r\nexport const SR_inputMustBeNonNegative = \"The input must be non-negative.\";\r\n\r\nexport const SR_inputSequenceEmpty = \"The input sequence was empty.\";\r\n\r\nexport const SR_inputSequenceTooLong = \"The input sequence contains more than one element.\";\r\n\r\nexport const SR_keyNotFoundAlt = \"An index satisfying the predicate was not found in the collection.\";\r\n\r\nexport const SR_differentLengths = \"The collections had different lengths.\";\r\n\r\nexport const SR_notEnoughElements = \"The input sequence has an insufficient number of elements.\";\r\n\r\n","import { compare, equals, structuralHash } from \"./Util.js\";\n// Using a class here for better compatibility with TS files importing Some\nexport class Some {\n constructor(value) {\n this.value = value;\n }\n toJSON() {\n return this.value;\n }\n // Don't add \"Some\" for consistency with erased options\n toString() {\n return String(this.value);\n }\n GetHashCode() {\n return structuralHash(this.value);\n }\n Equals(other) {\n if (other == null) {\n return false;\n }\n else {\n return equals(this.value, other instanceof Some ? other.value : other);\n }\n }\n CompareTo(other) {\n if (other == null) {\n return 1;\n }\n else {\n return compare(this.value, other instanceof Some ? other.value : other);\n }\n }\n}\nexport function some(x) {\n return x == null || x instanceof Some ? new Some(x) : x;\n}\nexport function value(x) {\n if (x == null) {\n throw new Error(\"Option has no value\");\n }\n else {\n return x instanceof Some ? x.value : x;\n }\n}\nexport function ofNullable(x) {\n // This will fail with unit probably, an alternative would be:\n // return x === null ? undefined : (x === undefined ? new Some(x) : x);\n return x == null ? undefined : x;\n}\nexport function toNullable(x) {\n return x == null ? null : value(x);\n}\nexport function flatten(x) {\n return x == null ? undefined : value(x);\n}\nexport function toArray(opt) {\n return (opt == null) ? [] : [value(opt)];\n}\nexport function defaultArg(opt, defaultValue) {\n return (opt != null) ? value(opt) : defaultValue;\n}\nexport function defaultArgWith(opt, defThunk) {\n return (opt != null) ? value(opt) : defThunk();\n}\nexport function orElse(opt, ifNone) {\n return opt == null ? ifNone : opt;\n}\nexport function orElseWith(opt, ifNoneThunk) {\n return opt == null ? ifNoneThunk() : opt;\n}\nexport function filter(predicate, opt) {\n return (opt != null) ? (predicate(value(opt)) ? opt : undefined) : opt;\n}\nexport function map(mapping, opt) {\n return (opt != null) ? some(mapping(value(opt))) : undefined;\n}\nexport function map2(mapping, opt1, opt2) {\n return (opt1 != null && opt2 != null) ? mapping(value(opt1), value(opt2)) : undefined;\n}\nexport function map3(mapping, opt1, opt2, opt3) {\n return (opt1 != null && opt2 != null && opt3 != null) ? mapping(value(opt1), value(opt2), value(opt3)) : undefined;\n}\nexport function bind(binder, opt) {\n return opt != null ? binder(value(opt)) : undefined;\n}\nexport function tryOp(op, arg) {\n try {\n return some(op(arg));\n }\n catch (_a) {\n return undefined;\n }\n}\n","import { value as value_2, map as map_1, defaultArg, some } from \"./Option.js\";\r\nimport { min as min_1, disposeSafe, getEnumerator, comparePrimitives, max as max_1 } from \"./Util.js\";\r\nimport { SR_indexOutOfBounds } from \"./Global.js\";\r\n\r\nexport function Helpers_allocateArrayFromCons(cons, len) {\r\n if ((typeof cons) === \"function\") {\r\n return new cons(len);\r\n }\r\n else {\r\n return new Array(len);\r\n }\r\n}\r\n\r\nfunction indexNotFound() {\r\n throw (new Error(\"An index satisfying the predicate was not found in the collection.\"));\r\n}\r\n\r\nfunction differentLengths() {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n}\r\n\r\nexport function append(array1, array2, cons) {\r\n const len1 = array1.length | 0;\r\n const len2 = array2.length | 0;\r\n const newArray = Helpers_allocateArrayFromCons(cons, len1 + len2);\r\n for (let i = 0; i <= (len1 - 1); i++) {\r\n newArray[i] = array1[i];\r\n }\r\n for (let i_1 = 0; i_1 <= (len2 - 1); i_1++) {\r\n newArray[i_1 + len1] = array2[i_1];\r\n }\r\n return newArray;\r\n}\r\n\r\nexport function filter(predicate, array) {\r\n return array.filter(predicate);\r\n}\r\n\r\nexport function fill(target, targetIndex, count, value) {\r\n const start = targetIndex | 0;\r\n return target.fill(value, start, (start + count));\r\n}\r\n\r\nexport function getSubArray(array, start, count) {\r\n const start_1 = start | 0;\r\n return array.slice(start_1, (start_1 + count));\r\n}\r\n\r\nexport function last(array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\\\\nParameter name: array\"));\r\n }\r\n return array[array.length - 1];\r\n}\r\n\r\nexport function tryLast(array) {\r\n if (array.length === 0) {\r\n return void 0;\r\n }\r\n else {\r\n return some(array[array.length - 1]);\r\n }\r\n}\r\n\r\nexport function mapIndexed(f, source, cons) {\r\n const len = source.length | 0;\r\n const target = Helpers_allocateArrayFromCons(cons, len);\r\n for (let i = 0; i <= (len - 1); i++) {\r\n target[i] = f(i, source[i]);\r\n }\r\n return target;\r\n}\r\n\r\nexport function map(f, source, cons) {\r\n const len = source.length | 0;\r\n const target = Helpers_allocateArrayFromCons(cons, len);\r\n for (let i = 0; i <= (len - 1); i++) {\r\n target[i] = f(source[i]);\r\n }\r\n return target;\r\n}\r\n\r\nexport function mapIndexed2(f, source1, source2, cons) {\r\n if (source1.length !== source2.length) {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, source1.length);\r\n for (let i = 0; i <= (source1.length - 1); i++) {\r\n result[i] = f(i, source1[i], source2[i]);\r\n }\r\n return result;\r\n}\r\n\r\nexport function map2(f, source1, source2, cons) {\r\n if (source1.length !== source2.length) {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, source1.length);\r\n for (let i = 0; i <= (source1.length - 1); i++) {\r\n result[i] = f(source1[i], source2[i]);\r\n }\r\n return result;\r\n}\r\n\r\nexport function mapIndexed3(f, source1, source2, source3, cons) {\r\n if ((source1.length !== source2.length) ? true : (source2.length !== source3.length)) {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, source1.length);\r\n for (let i = 0; i <= (source1.length - 1); i++) {\r\n result[i] = f(i, source1[i], source2[i], source3[i]);\r\n }\r\n return result;\r\n}\r\n\r\nexport function map3(f, source1, source2, source3, cons) {\r\n if ((source1.length !== source2.length) ? true : (source2.length !== source3.length)) {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, source1.length);\r\n for (let i = 0; i <= (source1.length - 1); i++) {\r\n result[i] = f(source1[i], source2[i], source3[i]);\r\n }\r\n return result;\r\n}\r\n\r\nexport function mapFold(mapping, state, array, cons) {\r\n const matchValue = array.length | 0;\r\n if (matchValue === 0) {\r\n return [[], state];\r\n }\r\n else {\r\n let acc = state;\r\n const res = Helpers_allocateArrayFromCons(cons, matchValue);\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n const patternInput = mapping(acc, array[i]);\r\n res[i] = patternInput[0];\r\n acc = patternInput[1];\r\n }\r\n return [res, acc];\r\n }\r\n}\r\n\r\nexport function mapFoldBack(mapping, array, state, cons) {\r\n const matchValue = array.length | 0;\r\n if (matchValue === 0) {\r\n return [[], state];\r\n }\r\n else {\r\n let acc = state;\r\n const res = Helpers_allocateArrayFromCons(cons, matchValue);\r\n for (let i = array.length - 1; i >= 0; i--) {\r\n const patternInput = mapping(array[i], acc);\r\n res[i] = patternInput[0];\r\n acc = patternInput[1];\r\n }\r\n return [res, acc];\r\n }\r\n}\r\n\r\nexport function indexed(source) {\r\n const len = source.length | 0;\r\n const target = new Array(len);\r\n for (let i = 0; i <= (len - 1); i++) {\r\n target[i] = [i, source[i]];\r\n }\r\n return target;\r\n}\r\n\r\nexport function truncate(count, array) {\r\n const count_1 = max_1(comparePrimitives, 0, count) | 0;\r\n const start = 0;\r\n return array.slice(start, (start + count_1));\r\n}\r\n\r\nexport function concat(arrays, cons) {\r\n const arrays_1 = Array.isArray(arrays) ? arrays : (Array.from(arrays));\r\n const matchValue = arrays_1.length | 0;\r\n switch (matchValue) {\r\n case 0: {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n case 1: {\r\n return arrays_1[0];\r\n }\r\n default: {\r\n let totalIdx = 0;\r\n let totalLength = 0;\r\n for (let idx = 0; idx <= (arrays_1.length - 1); idx++) {\r\n const arr_1 = arrays_1[idx];\r\n totalLength = ((totalLength + arr_1.length) | 0);\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, totalLength);\r\n for (let idx_1 = 0; idx_1 <= (arrays_1.length - 1); idx_1++) {\r\n const arr_2 = arrays_1[idx_1];\r\n for (let j = 0; j <= (arr_2.length - 1); j++) {\r\n result[totalIdx] = arr_2[j];\r\n totalIdx = ((totalIdx + 1) | 0);\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n}\r\n\r\nexport function collect(mapping, array, cons) {\r\n return concat(map(mapping, array, null), cons);\r\n}\r\n\r\nexport function where(predicate, array) {\r\n return array.filter(predicate);\r\n}\r\n\r\nexport function indexOf(array, item_1, start, count, eq) {\r\n const start_1 = defaultArg(start, 0) | 0;\r\n const end$0027 = defaultArg(map_1((c) => (start_1 + c), count), array.length) | 0;\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i >= end$0027) {\r\n return -1;\r\n }\r\n else if (eq.Equals(item_1, array[i])) {\r\n return i | 0;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(start_1) | 0;\r\n}\r\n\r\nexport function contains(value, array, eq) {\r\n return indexOf(array, value, void 0, void 0, eq) >= 0;\r\n}\r\n\r\nexport function empty(cons) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n}\r\n\r\nexport function singleton(value, cons) {\r\n const ar = Helpers_allocateArrayFromCons(cons, 1);\r\n ar[0] = value;\r\n return ar;\r\n}\r\n\r\nexport function initialize(count, initializer, cons) {\r\n if (count < 0) {\r\n throw (new Error(\"The input must be non-negative\\\\nParameter name: count\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, count);\r\n for (let i = 0; i <= (count - 1); i++) {\r\n result[i] = initializer(i);\r\n }\r\n return result;\r\n}\r\n\r\nexport function pairwise(array) {\r\n if (array.length < 2) {\r\n return [];\r\n }\r\n else {\r\n const count = (array.length - 1) | 0;\r\n const result = new Array(count);\r\n for (let i = 0; i <= (count - 1); i++) {\r\n result[i] = [array[i], array[i + 1]];\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport function replicate(count, initial, cons) {\r\n if (count < 0) {\r\n throw (new Error(\"The input must be non-negative\\\\nParameter name: count\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, count);\r\n for (let i = 0; i <= (result.length - 1); i++) {\r\n result[i] = initial;\r\n }\r\n return result;\r\n}\r\n\r\nexport function copy(array) {\r\n return array.slice();\r\n}\r\n\r\nexport function reverse(array) {\r\n const array_2 = array.slice();\r\n return array_2.reverse();\r\n}\r\n\r\nexport function scan(folder, state, array, cons) {\r\n const res = Helpers_allocateArrayFromCons(cons, array.length + 1);\r\n res[0] = state;\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n res[i + 1] = folder(res[i], array[i]);\r\n }\r\n return res;\r\n}\r\n\r\nexport function scanBack(folder, array, state, cons) {\r\n const res = Helpers_allocateArrayFromCons(cons, array.length + 1);\r\n res[array.length] = state;\r\n for (let i = array.length - 1; i >= 0; i--) {\r\n res[i] = folder(array[i], res[i + 1]);\r\n }\r\n return res;\r\n}\r\n\r\nexport function skip(count, array, cons) {\r\n if (count > array.length) {\r\n throw (new Error(\"count is greater than array length\\\\nParameter name: count\"));\r\n }\r\n if (count === array.length) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n else {\r\n const count_1 = ((count < 0) ? 0 : count) | 0;\r\n return array.slice(count_1);\r\n }\r\n}\r\n\r\nexport function skipWhile(predicate, array, cons) {\r\n let count = 0;\r\n while ((count < array.length) && predicate(array[count])) {\r\n count = ((count + 1) | 0);\r\n }\r\n if (count === array.length) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n else {\r\n const count_1 = count | 0;\r\n return array.slice(count_1);\r\n }\r\n}\r\n\r\nexport function take(count, array, cons) {\r\n if (count < 0) {\r\n throw (new Error(\"The input must be non-negative\\\\nParameter name: count\"));\r\n }\r\n if (count > array.length) {\r\n throw (new Error(\"count is greater than array length\\\\nParameter name: count\"));\r\n }\r\n if (count === 0) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n else {\r\n const start = 0;\r\n return array.slice(start, (start + count));\r\n }\r\n}\r\n\r\nexport function takeWhile(predicate, array, cons) {\r\n let count = 0;\r\n while ((count < array.length) && predicate(array[count])) {\r\n count = ((count + 1) | 0);\r\n }\r\n if (count === 0) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n else {\r\n const start = 0;\r\n const count_1 = count | 0;\r\n return array.slice(start, (start + count_1));\r\n }\r\n}\r\n\r\nexport function addInPlace(x, array) {\r\n array.push(x);\r\n}\r\n\r\nexport function addRangeInPlace(range, array) {\r\n const enumerator = getEnumerator(range);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n addInPlace(enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), array);\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n}\r\n\r\nexport function insertRangeInPlace(index, range, array) {\r\n let index_1;\r\n let i = index;\r\n const enumerator = getEnumerator(range);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const x = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n (index_1 = (i | 0), array.splice(index_1, 0, x));\r\n i = ((i + 1) | 0);\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n}\r\n\r\nexport function removeInPlace(item_1, array, eq) {\r\n const i = indexOf(array, item_1, void 0, void 0, eq) | 0;\r\n if (i > -1) {\r\n array.splice(i, 1);\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function removeAllInPlace(predicate, array) {\r\n const countRemoveAll = (count) => {\r\n const i = (array.findIndex(predicate)) | 0;\r\n if (i > -1) {\r\n array.splice(i, 1);\r\n return (countRemoveAll(count) + 1) | 0;\r\n }\r\n else {\r\n return count | 0;\r\n }\r\n };\r\n return countRemoveAll(0) | 0;\r\n}\r\n\r\nexport function copyTo(source, sourceIndex, target, targetIndex, count) {\r\n const diff = (targetIndex - sourceIndex) | 0;\r\n for (let i = sourceIndex; i <= ((sourceIndex + count) - 1); i++) {\r\n target[i + diff] = source[i];\r\n }\r\n}\r\n\r\nexport function copyToTypedArray(source, sourceIndex, target, targetIndex, count) {\r\n try {\r\n target.set(source.subarray(sourceIndex, sourceIndex + count), targetIndex);\r\n }\r\n catch (matchValue) {\r\n copyTo(source, sourceIndex, target, targetIndex, count);\r\n }\r\n}\r\n\r\nexport function partition(f, source, cons) {\r\n const len = source.length | 0;\r\n const res1 = Helpers_allocateArrayFromCons(cons, len);\r\n const res2 = Helpers_allocateArrayFromCons(cons, len);\r\n let iTrue = 0;\r\n let iFalse = 0;\r\n for (let i = 0; i <= (len - 1); i++) {\r\n if (f(source[i])) {\r\n res1[iTrue] = source[i];\r\n iTrue = ((iTrue + 1) | 0);\r\n }\r\n else {\r\n res2[iFalse] = source[i];\r\n iFalse = ((iFalse + 1) | 0);\r\n }\r\n }\r\n return [truncate(iTrue, res1), truncate(iFalse, res2)];\r\n}\r\n\r\nexport function find(predicate, array) {\r\n const matchValue = array.find(predicate);\r\n if (matchValue == null) {\r\n return indexNotFound();\r\n }\r\n else {\r\n return value_2(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFind(predicate, array) {\r\n return array.find(predicate);\r\n}\r\n\r\nexport function findIndex(predicate, array) {\r\n const matchValue = (array.findIndex(predicate)) | 0;\r\n if (matchValue > -1) {\r\n return matchValue | 0;\r\n }\r\n else {\r\n return indexNotFound() | 0;\r\n }\r\n}\r\n\r\nexport function tryFindIndex(predicate, array) {\r\n const matchValue = (array.findIndex(predicate)) | 0;\r\n if (matchValue > -1) {\r\n return matchValue;\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function pick(chooser, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i >= array.length) {\r\n return indexNotFound();\r\n }\r\n else {\r\n const matchValue = chooser(array[i]);\r\n if (matchValue != null) {\r\n return value_2(matchValue);\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n continue loop;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0);\r\n}\r\n\r\nexport function tryPick(chooser, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i >= array.length) {\r\n return void 0;\r\n }\r\n else {\r\n const matchValue = chooser(array[i]);\r\n if (matchValue == null) {\r\n i_mut = (i + 1);\r\n continue loop;\r\n }\r\n else {\r\n return matchValue;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0);\r\n}\r\n\r\nexport function findBack(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return indexNotFound();\r\n }\r\n else if (predicate(array[i])) {\r\n return array[i];\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1);\r\n}\r\n\r\nexport function tryFindBack(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return void 0;\r\n }\r\n else if (predicate(array[i])) {\r\n return some(array[i]);\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1);\r\n}\r\n\r\nexport function findLastIndex(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return -1;\r\n }\r\n else if (predicate(array[i])) {\r\n return i | 0;\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1) | 0;\r\n}\r\n\r\nexport function findIndexBack(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return indexNotFound() | 0;\r\n }\r\n else if (predicate(array[i])) {\r\n return i | 0;\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1) | 0;\r\n}\r\n\r\nexport function tryFindIndexBack(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return void 0;\r\n }\r\n else if (predicate(array[i])) {\r\n return i;\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1);\r\n}\r\n\r\nexport function choose(chooser, array, cons) {\r\n const res = [];\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n const matchValue = chooser(array[i]);\r\n if (matchValue != null) {\r\n const y = value_2(matchValue);\r\n res.push(y);\r\n }\r\n }\r\n if ((typeof cons) === \"function\") {\r\n return map((x) => x, res, cons);\r\n }\r\n else {\r\n return res;\r\n }\r\n}\r\n\r\nexport function foldIndexed(folder, state, array) {\r\n return array.reduce(((delegateArg, delegateArg_1, delegateArg_2) => folder(delegateArg_2, delegateArg, delegateArg_1)), state);\r\n}\r\n\r\nexport function fold(folder, state, array) {\r\n return array.reduce((folder), state);\r\n}\r\n\r\nexport function iterate(action, array) {\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n action(array[i]);\r\n }\r\n}\r\n\r\nexport function iterateIndexed(action, array) {\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n action(i, array[i]);\r\n }\r\n}\r\n\r\nexport function iterate2(action, array1, array2) {\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n action(array1[i], array2[i]);\r\n }\r\n}\r\n\r\nexport function iterateIndexed2(action, array1, array2) {\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n action(i, array1[i], array2[i]);\r\n }\r\n}\r\n\r\nexport function isEmpty(array) {\r\n return array.length === 0;\r\n}\r\n\r\nexport function forAll(predicate, array) {\r\n return array.every(predicate);\r\n}\r\n\r\nexport function permute(f, array) {\r\n const size = array.length | 0;\r\n const res = array.slice();\r\n const checkFlags = new Array(size);\r\n iterateIndexed((i, x) => {\r\n const j = f(i) | 0;\r\n if ((j < 0) ? true : (j >= size)) {\r\n throw (new Error(\"Not a valid permutation\"));\r\n }\r\n res[j] = x;\r\n checkFlags[j] = 1;\r\n }, array);\r\n if (!(checkFlags.every((y) => (1 === y)))) {\r\n throw (new Error(\"Not a valid permutation\"));\r\n }\r\n return res;\r\n}\r\n\r\nexport function setSlice(target, lower, upper, source) {\r\n const lower_1 = defaultArg(lower, 0) | 0;\r\n const upper_1 = defaultArg(upper, -1) | 0;\r\n const length = (((upper_1 >= 0) ? upper_1 : (target.length - 1)) - lower_1) | 0;\r\n for (let i = 0; i <= length; i++) {\r\n target[i + lower_1] = source[i];\r\n }\r\n}\r\n\r\nexport function sortInPlaceBy(projection, xs, comparer) {\r\n xs.sort((x, y) => comparer.Compare(projection(x), projection(y)));\r\n}\r\n\r\nexport function sortInPlace(xs, comparer) {\r\n xs.sort((x, y) => comparer.Compare(x, y));\r\n}\r\n\r\nexport function sort(xs, comparer) {\r\n const xs_1 = xs.slice();\r\n xs_1.sort((x, y) => comparer.Compare(x, y));\r\n return xs_1;\r\n}\r\n\r\nexport function sortBy(projection, xs, comparer) {\r\n const xs_1 = xs.slice();\r\n xs_1.sort((x, y) => comparer.Compare(projection(x), projection(y)));\r\n return xs_1;\r\n}\r\n\r\nexport function sortDescending(xs, comparer) {\r\n const xs_1 = xs.slice();\r\n xs_1.sort((x, y) => (comparer.Compare(x, y) * -1));\r\n return xs_1;\r\n}\r\n\r\nexport function sortByDescending(projection, xs, comparer) {\r\n const xs_1 = xs.slice();\r\n xs_1.sort((x, y) => (comparer.Compare(projection(x), projection(y)) * -1));\r\n return xs_1;\r\n}\r\n\r\nexport function sortWith(comparer, xs) {\r\n const comparer_1 = comparer;\r\n const xs_1 = xs.slice();\r\n xs_1.sort(comparer_1);\r\n return xs_1;\r\n}\r\n\r\nexport function allPairs(xs, ys) {\r\n const len1 = xs.length | 0;\r\n const len2 = ys.length | 0;\r\n const res = new Array(len1 * len2);\r\n for (let i = 0; i <= (xs.length - 1); i++) {\r\n for (let j = 0; j <= (ys.length - 1); j++) {\r\n res[(i * len2) + j] = [xs[i], ys[j]];\r\n }\r\n }\r\n return res;\r\n}\r\n\r\nexport function unfold(generator, state) {\r\n const res = [];\r\n const loop = (state_1_mut) => {\r\n loop:\r\n while (true) {\r\n const state_1 = state_1_mut;\r\n const matchValue = generator(state_1);\r\n if (matchValue != null) {\r\n const x = matchValue[0];\r\n const s = matchValue[1];\r\n res.push(x);\r\n state_1_mut = s;\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n loop(state);\r\n return res;\r\n}\r\n\r\nexport function unzip(array) {\r\n const len = array.length | 0;\r\n const res1 = new Array(len);\r\n const res2 = new Array(len);\r\n iterateIndexed((i, tupledArg) => {\r\n res1[i] = tupledArg[0];\r\n res2[i] = tupledArg[1];\r\n }, array);\r\n return [res1, res2];\r\n}\r\n\r\nexport function unzip3(array) {\r\n const len = array.length | 0;\r\n const res1 = new Array(len);\r\n const res2 = new Array(len);\r\n const res3 = new Array(len);\r\n iterateIndexed((i, tupledArg) => {\r\n res1[i] = tupledArg[0];\r\n res2[i] = tupledArg[1];\r\n res3[i] = tupledArg[2];\r\n }, array);\r\n return [res1, res2, res3];\r\n}\r\n\r\nexport function zip(array1, array2) {\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n const result = new Array(array1.length);\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n result[i] = [array1[i], array2[i]];\r\n }\r\n return result;\r\n}\r\n\r\nexport function zip3(array1, array2, array3) {\r\n if ((array1.length !== array2.length) ? true : (array2.length !== array3.length)) {\r\n differentLengths();\r\n }\r\n const result = new Array(array1.length);\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n result[i] = [array1[i], array2[i], array3[i]];\r\n }\r\n return result;\r\n}\r\n\r\nexport function chunkBySize(chunkSize, array) {\r\n if (chunkSize < 1) {\r\n throw (new Error(\"The input must be positive.\\\\nParameter name: size\"));\r\n }\r\n if (array.length === 0) {\r\n return [[]];\r\n }\r\n else {\r\n const result = [];\r\n for (let x = 0; x <= ((~(~Math.ceil(array.length / chunkSize))) - 1); x++) {\r\n let slice;\r\n const start_1 = (x * chunkSize) | 0;\r\n slice = (array.slice(start_1, (start_1 + chunkSize)));\r\n result.push(slice);\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport function splitAt(index, array) {\r\n let start;\r\n if ((index < 0) ? true : (index > array.length)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return [(start = 0, array.slice(start, (start + index))), array.slice(index)];\r\n}\r\n\r\nexport function compareWith(comparer, source1, source2) {\r\n if (source1 == null) {\r\n if (source2 == null) {\r\n return 0;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else if (source2 == null) {\r\n return 1;\r\n }\r\n else {\r\n const len1 = source1.length | 0;\r\n const len2 = source2.length | 0;\r\n const len = ((len1 < len2) ? len1 : len2) | 0;\r\n let i = 0;\r\n let res = 0;\r\n while ((res === 0) && (i < len)) {\r\n res = (comparer(source1[i], source2[i]) | 0);\r\n i = ((i + 1) | 0);\r\n }\r\n if (res !== 0) {\r\n return res | 0;\r\n }\r\n else if (len1 > len2) {\r\n return 1;\r\n }\r\n else if (len1 < len2) {\r\n return -1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n}\r\n\r\nexport function compareTo(comparer, source1, source2) {\r\n if (source1 == null) {\r\n if (source2 == null) {\r\n return 0;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else if (source2 == null) {\r\n return 1;\r\n }\r\n else {\r\n const len1 = source1.length | 0;\r\n const len2 = source2.length | 0;\r\n if (len1 > len2) {\r\n return 1;\r\n }\r\n else if (len1 < len2) {\r\n return -1;\r\n }\r\n else {\r\n let i = 0;\r\n let res = 0;\r\n while ((res === 0) && (i < len1)) {\r\n res = (comparer(source1[i], source2[i]) | 0);\r\n i = ((i + 1) | 0);\r\n }\r\n return res | 0;\r\n }\r\n }\r\n}\r\n\r\nexport function equalsWith(equals, array1, array2) {\r\n if (array1 == null) {\r\n if (array2 == null) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else if (array2 == null) {\r\n return false;\r\n }\r\n else {\r\n let i = 0;\r\n let result = true;\r\n const length1 = array1.length | 0;\r\n const length2 = array2.length | 0;\r\n if (length1 > length2) {\r\n return false;\r\n }\r\n else if (length1 < length2) {\r\n return false;\r\n }\r\n else {\r\n while ((i < length1) && result) {\r\n result = equals(array1[i], array2[i]);\r\n i = ((i + 1) | 0);\r\n }\r\n return result;\r\n }\r\n }\r\n}\r\n\r\nexport function exactlyOne(array) {\r\n if (array.length === 1) {\r\n return array[0];\r\n }\r\n else if (array.length === 0) {\r\n throw (new Error(\"The input sequence was empty\\\\nParameter name: array\"));\r\n }\r\n else {\r\n throw (new Error(\"Input array too long\\\\nParameter name: array\"));\r\n }\r\n}\r\n\r\nexport function tryExactlyOne(array) {\r\n if (array.length === 1) {\r\n return some(array[0]);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function head(array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\\\\nParameter name: array\"));\r\n }\r\n else {\r\n return array[0];\r\n }\r\n}\r\n\r\nexport function tryHead(array) {\r\n if (array.length === 0) {\r\n return void 0;\r\n }\r\n else {\r\n return some(array[0]);\r\n }\r\n}\r\n\r\nexport function tail(array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"Not enough elements\\\\nParameter name: array\"));\r\n }\r\n return array.slice(1);\r\n}\r\n\r\nexport function item(index, array) {\r\n return array[index];\r\n}\r\n\r\nexport function tryItem(index, array) {\r\n if ((index < 0) ? true : (index >= array.length)) {\r\n return void 0;\r\n }\r\n else {\r\n return some(array[index]);\r\n }\r\n}\r\n\r\nexport function foldBackIndexed(folder, array, state) {\r\n return array.reduceRight(((delegateArg, delegateArg_1, delegateArg_2) => folder(delegateArg_2, delegateArg_1, delegateArg)), state);\r\n}\r\n\r\nexport function foldBack(folder, array, state) {\r\n return array.reduceRight(((delegateArg, delegateArg_1) => folder(delegateArg_1, delegateArg)), state);\r\n}\r\n\r\nexport function foldIndexed2(folder, state, array1, array2) {\r\n let acc = state;\r\n if (array1.length !== array2.length) {\r\n throw (new Error(\"Arrays have different lengths\"));\r\n }\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n acc = folder(i, acc, array1[i], array2[i]);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function fold2(folder, state, array1, array2) {\r\n return foldIndexed2((_arg, acc, x, y) => folder(acc, x, y), state, array1, array2);\r\n}\r\n\r\nexport function foldBackIndexed2(folder, array1, array2, state) {\r\n let acc = state;\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n const size = array1.length | 0;\r\n for (let i = 1; i <= size; i++) {\r\n acc = folder(i - 1, array1[size - i], array2[size - i], acc);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function foldBack2(f, array1, array2, state) {\r\n return foldBackIndexed2((_arg, x, y, acc) => f(x, y, acc), array1, array2, state);\r\n}\r\n\r\nexport function reduce(reduction, array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\"));\r\n }\r\n const reduction_1 = reduction;\r\n return array.reduce(reduction_1);\r\n}\r\n\r\nexport function reduceBack(reduction, array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\"));\r\n }\r\n const reduction_1 = reduction;\r\n return array.reduceRight(reduction_1);\r\n}\r\n\r\nexport function forAll2(predicate, array1, array2) {\r\n return fold2((acc, x, y) => (acc && predicate(x, y)), true, array1, array2);\r\n}\r\n\r\nexport function existsOffset(predicate_mut, array_mut, index_mut) {\r\n existsOffset:\r\n while (true) {\r\n const predicate = predicate_mut, array = array_mut, index = index_mut;\r\n if (index === array.length) {\r\n return false;\r\n }\r\n else if (predicate(array[index])) {\r\n return true;\r\n }\r\n else {\r\n predicate_mut = predicate;\r\n array_mut = array;\r\n index_mut = (index + 1);\r\n continue existsOffset;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function exists(predicate, array) {\r\n return existsOffset(predicate, array, 0);\r\n}\r\n\r\nexport function existsOffset2(predicate_mut, array1_mut, array2_mut, index_mut) {\r\n existsOffset2:\r\n while (true) {\r\n const predicate = predicate_mut, array1 = array1_mut, array2 = array2_mut, index = index_mut;\r\n if (index === array1.length) {\r\n return false;\r\n }\r\n else if (predicate(array1[index], array2[index])) {\r\n return true;\r\n }\r\n else {\r\n predicate_mut = predicate;\r\n array1_mut = array1;\r\n array2_mut = array2;\r\n index_mut = (index + 1);\r\n continue existsOffset2;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function exists2(predicate, array1, array2) {\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n return existsOffset2(predicate, array1, array2, 0);\r\n}\r\n\r\nexport function sum(array, adder) {\r\n let acc = adder.GetZero();\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n acc = adder.Add(acc, array[i]);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function sumBy(projection, array, adder) {\r\n let acc = adder.GetZero();\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n acc = adder.Add(acc, projection(array[i]));\r\n }\r\n return acc;\r\n}\r\n\r\nexport function maxBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function max(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function minBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function min(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function average(array, averager) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\\\\nParameter name: array\"));\r\n }\r\n let total = averager.GetZero();\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n total = averager.Add(total, array[i]);\r\n }\r\n return averager.DivideByInt(total, array.length);\r\n}\r\n\r\nexport function averageBy(projection, array, averager) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\\\\nParameter name: array\"));\r\n }\r\n let total = averager.GetZero();\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n total = averager.Add(total, projection(array[i]));\r\n }\r\n return averager.DivideByInt(total, array.length);\r\n}\r\n\r\nexport function windowed(windowSize, source) {\r\n if (windowSize <= 0) {\r\n throw (new Error(\"windowSize must be positive\"));\r\n }\r\n let res;\r\n const len = max_1(comparePrimitives, 0, (source.length - windowSize) + 1) | 0;\r\n res = (new Array(len));\r\n for (let i = windowSize; i <= source.length; i++) {\r\n res[i - windowSize] = source.slice(i - windowSize, (i - 1) + 1);\r\n }\r\n return res;\r\n}\r\n\r\nexport function splitInto(chunks, array) {\r\n if (chunks < 1) {\r\n throw (new Error(\"The input must be positive.\\\\nParameter name: chunks\"));\r\n }\r\n if (array.length === 0) {\r\n return [[]];\r\n }\r\n else {\r\n const result = [];\r\n const chunks_1 = min_1(comparePrimitives, chunks, array.length) | 0;\r\n const minChunkSize = (~(~(array.length / chunks_1))) | 0;\r\n const chunksWithExtraItem = (array.length % chunks_1) | 0;\r\n for (let i = 0; i <= (chunks_1 - 1); i++) {\r\n const chunkSize = ((i < chunksWithExtraItem) ? (minChunkSize + 1) : minChunkSize) | 0;\r\n let slice;\r\n const start_1 = ((i * minChunkSize) + min_1(comparePrimitives, chunksWithExtraItem, i)) | 0;\r\n slice = (array.slice(start_1, (start_1 + chunkSize)));\r\n result.push(slice);\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport function transpose(arrays, cons) {\r\n const arrays_1 = Array.isArray(arrays) ? arrays : (Array.from(arrays));\r\n const len = arrays_1.length | 0;\r\n if (len === 0) {\r\n return new Array(0);\r\n }\r\n else {\r\n const firstArray = arrays_1[0];\r\n const lenInner = firstArray.length | 0;\r\n if (!forAll((a) => (a.length === lenInner), arrays_1)) {\r\n differentLengths();\r\n }\r\n const result = new Array(lenInner);\r\n for (let i = 0; i <= (lenInner - 1); i++) {\r\n result[i] = Helpers_allocateArrayFromCons(cons, len);\r\n for (let j = 0; j <= (len - 1); j++) {\r\n result[i][j] = arrays_1[j][i];\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport function insertAt(index, y, xs) {\r\n const len = xs.length | 0;\r\n if ((index < 0) ? true : (index > len)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n const target = new xs.constructor(len + 1);\r\n for (let i = 0; i <= (index - 1); i++) {\r\n target[i] = xs[i];\r\n }\r\n target[index] = y;\r\n for (let i_1 = index; i_1 <= (len - 1); i_1++) {\r\n target[i_1 + 1] = xs[i_1];\r\n }\r\n return target;\r\n}\r\n\r\nexport function insertManyAt(index, ys, xs) {\r\n const len = xs.length | 0;\r\n if ((index < 0) ? true : (index > len)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n const ys_1 = Array.from(ys);\r\n const len2 = ys_1.length | 0;\r\n const target = new xs.constructor(len + len2);\r\n for (let i = 0; i <= (index - 1); i++) {\r\n target[i] = xs[i];\r\n }\r\n for (let i_1 = 0; i_1 <= (len2 - 1); i_1++) {\r\n target[index + i_1] = ys_1[i_1];\r\n }\r\n for (let i_2 = index; i_2 <= (len - 1); i_2++) {\r\n target[i_2 + len2] = xs[i_2];\r\n }\r\n return target;\r\n}\r\n\r\nexport function removeAt(index, xs) {\r\n if ((index < 0) ? true : (index >= xs.length)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n let i = -1;\r\n return filter((_arg) => {\r\n i = ((i + 1) | 0);\r\n return i !== index;\r\n }, xs);\r\n}\r\n\r\nexport function removeManyAt(index, count, xs) {\r\n let i = -1;\r\n let status = -1;\r\n const ys = filter((_arg) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n status = 0;\r\n return false;\r\n }\r\n else if (i > index) {\r\n if (i < (index + count)) {\r\n return false;\r\n }\r\n else {\r\n status = 1;\r\n return true;\r\n }\r\n }\r\n else {\r\n return true;\r\n }\r\n }, xs);\r\n const status_1 = (((status === 0) && ((i + 1) === (index + count))) ? 1 : status) | 0;\r\n if (status_1 < 1) {\r\n const arg = (status_1 < 0) ? \"index\" : \"count\";\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + arg));\r\n }\r\n return ys;\r\n}\r\n\r\nexport function updateAt(index, y, xs) {\r\n const len = xs.length | 0;\r\n if ((index < 0) ? true : (index >= len)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n const target = new xs.constructor(len);\r\n for (let i = 0; i <= (len - 1); i++) {\r\n target[i] = ((i === index) ? y : xs[i]);\r\n }\r\n return target;\r\n}\r\n\r\n","import { join } from \"./String.js\";\r\nimport { uncurry, disposeSafe, isArrayLike, getEnumerator, toIterator, compare, structuralHash, equals } from \"./Util.js\";\r\nimport { Record } from \"./Types.js\";\r\nimport { class_type, record_type, option_type } from \"./Reflection.js\";\r\nimport { SR_inputSequenceTooLong, SR_inputSequenceEmpty, SR_inputMustBeNonNegative, SR_notEnoughElements, SR_differentLengths, SR_keyNotFoundAlt, SR_indexOutOfBounds, SR_inputWasEmpty } from \"./Global.js\";\r\nimport { defaultArg, value as value_1, some } from \"./Option.js\";\r\nimport { transpose as transpose_1, splitInto as splitInto_1, windowed as windowed_1, pairwise as pairwise_1, chunkBySize as chunkBySize_1, map as map_1, permute as permute_1, tryFindIndexBack as tryFindIndexBack_1, tryFindBack as tryFindBack_1, scanBack as scanBack_1, foldBack2 as foldBack2_1, foldBack as foldBack_1, fill } from \"./Array.js\";\r\n\r\nexport class FSharpList extends Record {\r\n constructor(head, tail) {\r\n super();\r\n this.head = head;\r\n this.tail = tail;\r\n }\r\n toString() {\r\n const xs = this;\r\n return (\"[\" + join(\"; \", xs)) + \"]\";\r\n }\r\n Equals(other) {\r\n const xs = this;\r\n if (xs === other) {\r\n return true;\r\n }\r\n else {\r\n const loop = (xs_1_mut, ys_1_mut) => {\r\n loop:\r\n while (true) {\r\n const xs_1 = xs_1_mut, ys_1 = ys_1_mut;\r\n const matchValue = [xs_1.tail, ys_1.tail];\r\n if (matchValue[0] != null) {\r\n if (matchValue[1] != null) {\r\n const xt = matchValue[0];\r\n const yt = matchValue[1];\r\n if (equals(xs_1.head, ys_1.head)) {\r\n xs_1_mut = xt;\r\n ys_1_mut = yt;\r\n continue loop;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else if (matchValue[1] != null) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(xs, other);\r\n }\r\n }\r\n GetHashCode() {\r\n const xs = this;\r\n const loop = (i_mut, h_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, h = h_mut, xs_1 = xs_1_mut;\r\n const matchValue = xs_1.tail;\r\n if (matchValue != null) {\r\n const t = matchValue;\r\n if (i > 18) {\r\n return h | 0;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n h_mut = (((h << 1) + structuralHash(xs_1.head)) + (631 * i));\r\n xs_1_mut = t;\r\n continue loop;\r\n }\r\n }\r\n else {\r\n return h | 0;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, 0, xs) | 0;\r\n }\r\n toJSON(_key) {\r\n const this$ = this;\r\n return Array.from(this$);\r\n }\r\n CompareTo(other) {\r\n const xs = this;\r\n const loop = (xs_1_mut, ys_1_mut) => {\r\n loop:\r\n while (true) {\r\n const xs_1 = xs_1_mut, ys_1 = ys_1_mut;\r\n const matchValue = [xs_1.tail, ys_1.tail];\r\n if (matchValue[0] != null) {\r\n if (matchValue[1] != null) {\r\n const xt = matchValue[0];\r\n const yt = matchValue[1];\r\n const c = compare(xs_1.head, ys_1.head) | 0;\r\n if (c === 0) {\r\n xs_1_mut = xt;\r\n ys_1_mut = yt;\r\n continue loop;\r\n }\r\n else {\r\n return c | 0;\r\n }\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n else if (matchValue[1] != null) {\r\n return -1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(xs, other) | 0;\r\n }\r\n GetEnumerator() {\r\n const xs = this;\r\n return ListEnumerator$1_$ctor_3002E699(xs);\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const xs = this;\r\n return getEnumerator(xs);\r\n }\r\n}\r\n\r\nexport function FSharpList$reflection(gen0) {\r\n return record_type(\"ListModule.FSharpList\", [gen0], FSharpList, () => [[\"head\", gen0], [\"tail\", option_type(FSharpList$reflection(gen0))]]);\r\n}\r\n\r\nexport class ListEnumerator$1 {\r\n constructor(xs) {\r\n this.xs = xs;\r\n this.it = this.xs;\r\n this.current = null;\r\n }\r\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\r\n const __ = this;\r\n return __.current;\r\n }\r\n [\"System.Collections.IEnumerator.get_Current\"]() {\r\n const __ = this;\r\n return __.current;\r\n }\r\n [\"System.Collections.IEnumerator.MoveNext\"]() {\r\n const __ = this;\r\n const matchValue = __.it.tail;\r\n if (matchValue != null) {\r\n const t = matchValue;\r\n __.current = __.it.head;\r\n __.it = t;\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n [\"System.Collections.IEnumerator.Reset\"]() {\r\n const __ = this;\r\n __.it = __.xs;\r\n __.current = null;\r\n }\r\n Dispose() {\r\n }\r\n}\r\n\r\nexport function ListEnumerator$1$reflection(gen0) {\r\n return class_type(\"ListModule.ListEnumerator`1\", [gen0], ListEnumerator$1);\r\n}\r\n\r\nexport function ListEnumerator$1_$ctor_3002E699(xs) {\r\n return new ListEnumerator$1(xs);\r\n}\r\n\r\nexport function FSharpList_get_Empty() {\r\n return new FSharpList(null, void 0);\r\n}\r\n\r\nexport function FSharpList_Cons_305B8EAC(x, xs) {\r\n return new FSharpList(x, xs);\r\n}\r\n\r\nexport function FSharpList__get_IsEmpty(xs) {\r\n return xs.tail == null;\r\n}\r\n\r\nexport function FSharpList__get_Length(xs) {\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n const matchValue = xs_1.tail;\r\n if (matchValue != null) {\r\n i_mut = (i + 1);\r\n xs_1_mut = matchValue;\r\n continue loop;\r\n }\r\n else {\r\n return i | 0;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, xs) | 0;\r\n}\r\n\r\nexport function FSharpList__get_Head(xs) {\r\n const matchValue = xs.tail;\r\n if (matchValue != null) {\r\n return xs.head;\r\n }\r\n else {\r\n throw (new Error((SR_inputWasEmpty + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n}\r\n\r\nexport function FSharpList__get_Tail(xs) {\r\n const matchValue = xs.tail;\r\n if (matchValue != null) {\r\n return matchValue;\r\n }\r\n else {\r\n throw (new Error((SR_inputWasEmpty + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n}\r\n\r\nexport function FSharpList__get_Item_Z524259A4(xs, index) {\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n const matchValue = xs_1.tail;\r\n if (matchValue != null) {\r\n if (i === index) {\r\n return xs_1.head;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n xs_1_mut = matchValue;\r\n continue loop;\r\n }\r\n }\r\n else {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, xs);\r\n}\r\n\r\nexport function empty() {\r\n return FSharpList_get_Empty();\r\n}\r\n\r\nexport function cons(x, xs) {\r\n return FSharpList_Cons_305B8EAC(x, xs);\r\n}\r\n\r\nexport function singleton(x) {\r\n return FSharpList_Cons_305B8EAC(x, FSharpList_get_Empty());\r\n}\r\n\r\nexport function isEmpty(xs) {\r\n return FSharpList__get_IsEmpty(xs);\r\n}\r\n\r\nexport function length(xs) {\r\n return FSharpList__get_Length(xs);\r\n}\r\n\r\nexport function head(xs) {\r\n return FSharpList__get_Head(xs);\r\n}\r\n\r\nexport function tryHead(xs) {\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n return void 0;\r\n }\r\n else {\r\n return some(FSharpList__get_Head(xs));\r\n }\r\n}\r\n\r\nexport function tail(xs) {\r\n return FSharpList__get_Tail(xs);\r\n}\r\n\r\nexport function tryLast(xs_mut) {\r\n tryLast:\r\n while (true) {\r\n const xs = xs_mut;\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n return void 0;\r\n }\r\n else {\r\n const t = FSharpList__get_Tail(xs);\r\n if (FSharpList__get_IsEmpty(t)) {\r\n return some(FSharpList__get_Head(xs));\r\n }\r\n else {\r\n xs_mut = t;\r\n continue tryLast;\r\n }\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function last(xs) {\r\n const matchValue = tryLast(xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_inputWasEmpty));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function compareWith(comparer, xs, ys) {\r\n const loop = (xs_1_mut, ys_1_mut) => {\r\n loop:\r\n while (true) {\r\n const xs_1 = xs_1_mut, ys_1 = ys_1_mut;\r\n const matchValue = [FSharpList__get_IsEmpty(xs_1), FSharpList__get_IsEmpty(ys_1)];\r\n if (matchValue[0]) {\r\n if (matchValue[1]) {\r\n return 0;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else if (matchValue[1]) {\r\n return 1;\r\n }\r\n else {\r\n const c = comparer(FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1)) | 0;\r\n if (c === 0) {\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n ys_1_mut = FSharpList__get_Tail(ys_1);\r\n continue loop;\r\n }\r\n else {\r\n return c | 0;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(xs, ys) | 0;\r\n}\r\n\r\nexport function toArray(xs) {\r\n const len = FSharpList__get_Length(xs) | 0;\r\n const res = fill(new Array(len), 0, len, null);\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n if (!FSharpList__get_IsEmpty(xs_1)) {\r\n res[i] = FSharpList__get_Head(xs_1);\r\n i_mut = (i + 1);\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n loop(0, xs);\r\n return res;\r\n}\r\n\r\nexport function fold(folder, state, xs) {\r\n let acc = state;\r\n let xs_1 = xs;\r\n while (!FSharpList__get_IsEmpty(xs_1)) {\r\n acc = folder(acc, FSharpList__get_Head(xs_1));\r\n xs_1 = FSharpList__get_Tail(xs_1);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function reverse(xs) {\r\n return fold((acc, x) => FSharpList_Cons_305B8EAC(x, acc), FSharpList_get_Empty(), xs);\r\n}\r\n\r\nexport function foldBack(folder, xs, state) {\r\n return foldBack_1(folder, toArray(xs), state);\r\n}\r\n\r\nexport function foldIndexed(folder, state, xs) {\r\n const loop = (i_mut, acc_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return acc;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n acc_mut = folder(i, acc, FSharpList__get_Head(xs_1));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, state, xs);\r\n}\r\n\r\nexport function fold2(folder, state, xs, ys) {\r\n let acc = state;\r\n let xs_1 = xs;\r\n let ys_1 = ys;\r\n while ((!FSharpList__get_IsEmpty(xs_1)) && (!FSharpList__get_IsEmpty(ys_1))) {\r\n acc = folder(acc, FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1));\r\n xs_1 = FSharpList__get_Tail(xs_1);\r\n ys_1 = FSharpList__get_Tail(ys_1);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function foldBack2(folder, xs, ys, state) {\r\n return foldBack2_1(folder, toArray(xs), toArray(ys), state);\r\n}\r\n\r\nexport function unfold(gen, state) {\r\n const loop = (acc_mut, node_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const acc = acc_mut, node = node_mut;\r\n const matchValue = gen(acc);\r\n if (matchValue != null) {\r\n acc_mut = matchValue[1];\r\n node_mut = ((t = (new FSharpList(matchValue[0], void 0)), (node.tail = t, t)));\r\n continue loop;\r\n }\r\n else {\r\n return node;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node_1 = loop(state, root);\r\n const t_2 = FSharpList_get_Empty();\r\n node_1.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function iterate(action, xs) {\r\n fold((unitVar, x) => {\r\n action(x);\r\n }, void 0, xs);\r\n}\r\n\r\nexport function iterate2(action, xs, ys) {\r\n fold2((unitVar, x, y) => {\r\n action(x, y);\r\n }, void 0, xs, ys);\r\n}\r\n\r\nexport function iterateIndexed(action, xs) {\r\n fold((i, x) => {\r\n action(i, x);\r\n return (i + 1) | 0;\r\n }, 0, xs);\r\n}\r\n\r\nexport function iterateIndexed2(action, xs, ys) {\r\n fold2((i, x, y) => {\r\n action(i, x, y);\r\n return (i + 1) | 0;\r\n }, 0, xs, ys);\r\n}\r\n\r\nexport function toSeq(xs) {\r\n return xs;\r\n}\r\n\r\nexport function ofArrayWithTail(xs, tail_1) {\r\n let res = tail_1;\r\n for (let i = xs.length - 1; i >= 0; i--) {\r\n res = FSharpList_Cons_305B8EAC(xs[i], res);\r\n }\r\n return res;\r\n}\r\n\r\nexport function ofArray(xs) {\r\n return ofArrayWithTail(xs, FSharpList_get_Empty());\r\n}\r\n\r\nexport function ofSeq(xs) {\r\n let xs_3, t;\r\n if (isArrayLike(xs)) {\r\n return ofArray(xs);\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return xs;\r\n }\r\n else {\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n const enumerator = getEnumerator(xs);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const x = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n node = ((xs_3 = node, (t = (new FSharpList(x, void 0)), (xs_3.tail = t, t))));\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n const xs_5 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_5.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n }\r\n}\r\n\r\nexport function concat(lists) {\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n const action = (xs) => {\r\n node = fold((acc, x) => {\r\n const t = new FSharpList(x, void 0);\r\n acc.tail = t;\r\n return t;\r\n }, node, xs);\r\n };\r\n if (isArrayLike(lists)) {\r\n lists.forEach(action);\r\n }\r\n else if (lists instanceof FSharpList) {\r\n iterate(action, lists);\r\n }\r\n else {\r\n const enumerator = getEnumerator(lists);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n action(enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n }\r\n const xs_6 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_6.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function scan(folder, state, xs) {\r\n let xs_4, t_2;\r\n const root = FSharpList_get_Empty();\r\n let node;\r\n const t = new FSharpList(state, void 0);\r\n root.tail = t;\r\n node = t;\r\n let acc = state;\r\n let xs_3 = xs;\r\n while (!FSharpList__get_IsEmpty(xs_3)) {\r\n acc = folder(acc, FSharpList__get_Head(xs_3));\r\n node = ((xs_4 = node, (t_2 = (new FSharpList(acc, void 0)), (xs_4.tail = t_2, t_2))));\r\n xs_3 = FSharpList__get_Tail(xs_3);\r\n }\r\n const xs_6 = node;\r\n const t_4 = FSharpList_get_Empty();\r\n xs_6.tail = t_4;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function scanBack(folder, xs, state) {\r\n return ofArray(scanBack_1(folder, toArray(xs), state));\r\n}\r\n\r\nexport function append(xs, ys) {\r\n return fold((acc, x) => FSharpList_Cons_305B8EAC(x, acc), ys, reverse(xs));\r\n}\r\n\r\nexport function collect(mapping, xs) {\r\n let xs_1, t;\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n let ys = xs;\r\n while (!FSharpList__get_IsEmpty(ys)) {\r\n let zs = mapping(FSharpList__get_Head(ys));\r\n while (!FSharpList__get_IsEmpty(zs)) {\r\n node = ((xs_1 = node, (t = (new FSharpList(FSharpList__get_Head(zs), void 0)), (xs_1.tail = t, t))));\r\n zs = FSharpList__get_Tail(zs);\r\n }\r\n ys = FSharpList__get_Tail(ys);\r\n }\r\n const xs_3 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_3.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function mapIndexed(mapping, xs) {\r\n const root = FSharpList_get_Empty();\r\n const node = foldIndexed((i, acc, x) => {\r\n const t = new FSharpList(mapping(i, x), void 0);\r\n acc.tail = t;\r\n return t;\r\n }, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function map(mapping, xs) {\r\n const root = FSharpList_get_Empty();\r\n const node = fold((acc, x) => {\r\n const t = new FSharpList(mapping(x), void 0);\r\n acc.tail = t;\r\n return t;\r\n }, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function indexed(xs) {\r\n return mapIndexed((i, x) => [i, x], xs);\r\n}\r\n\r\nexport function map2(mapping, xs, ys) {\r\n const root = FSharpList_get_Empty();\r\n const node = fold2((acc, x, y) => {\r\n const t = new FSharpList(mapping(x, y), void 0);\r\n acc.tail = t;\r\n return t;\r\n }, root, xs, ys);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function mapIndexed2(mapping, xs, ys) {\r\n const loop = (i_mut, acc_mut, xs_1_mut, ys_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut, ys_1 = ys_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1) ? true : FSharpList__get_IsEmpty(ys_1)) {\r\n return acc;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n acc_mut = ((t = (new FSharpList(mapping(i, FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1)), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n ys_1_mut = FSharpList__get_Tail(ys_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node_1 = loop(0, root, xs, ys);\r\n const t_2 = FSharpList_get_Empty();\r\n node_1.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function map3(mapping, xs, ys, zs) {\r\n const loop = (acc_mut, xs_1_mut, ys_1_mut, zs_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const acc = acc_mut, xs_1 = xs_1_mut, ys_1 = ys_1_mut, zs_1 = zs_1_mut;\r\n if ((FSharpList__get_IsEmpty(xs_1) ? true : FSharpList__get_IsEmpty(ys_1)) ? true : FSharpList__get_IsEmpty(zs_1)) {\r\n return acc;\r\n }\r\n else {\r\n acc_mut = ((t = (new FSharpList(mapping(FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1), FSharpList__get_Head(zs_1)), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n ys_1_mut = FSharpList__get_Tail(ys_1);\r\n zs_1_mut = FSharpList__get_Tail(zs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node_1 = loop(root, xs, ys, zs);\r\n const t_2 = FSharpList_get_Empty();\r\n node_1.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function mapFold(mapping, state, xs) {\r\n const root = FSharpList_get_Empty();\r\n const patternInput_1 = fold((tupledArg, x) => {\r\n let t;\r\n const patternInput = mapping(tupledArg[1], x);\r\n return [(t = (new FSharpList(patternInput[0], void 0)), (tupledArg[0].tail = t, t)), patternInput[1]];\r\n }, [root, state], xs);\r\n const t_2 = FSharpList_get_Empty();\r\n patternInput_1[0].tail = t_2;\r\n return [FSharpList__get_Tail(root), patternInput_1[1]];\r\n}\r\n\r\nexport function mapFoldBack(mapping, xs, state) {\r\n return mapFold((acc, x) => mapping(x, acc), state, reverse(xs));\r\n}\r\n\r\nexport function tryPick(f, xs) {\r\n const loop = (xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return void 0;\r\n }\r\n else {\r\n const matchValue = f(FSharpList__get_Head(xs_1));\r\n if (matchValue == null) {\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n else {\r\n return matchValue;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(xs);\r\n}\r\n\r\nexport function pick(f, xs) {\r\n const matchValue = tryPick(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFind(f, xs) {\r\n return tryPick((x) => (f(x) ? some(x) : (void 0)), xs);\r\n}\r\n\r\nexport function find(f, xs) {\r\n const matchValue = tryFind(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFindBack(f, xs) {\r\n return tryFindBack_1(f, toArray(xs));\r\n}\r\n\r\nexport function findBack(f, xs) {\r\n const matchValue = tryFindBack(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFindIndex(f, xs) {\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return void 0;\r\n }\r\n else if (f(FSharpList__get_Head(xs_1))) {\r\n return i;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, xs);\r\n}\r\n\r\nexport function findIndex(f, xs) {\r\n const matchValue = tryFindIndex(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return matchValue | 0;\r\n }\r\n}\r\n\r\nexport function tryFindIndexBack(f, xs) {\r\n return tryFindIndexBack_1(f, toArray(xs));\r\n}\r\n\r\nexport function findIndexBack(f, xs) {\r\n const matchValue = tryFindIndexBack(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return matchValue | 0;\r\n }\r\n}\r\n\r\nexport function tryItem(n, xs) {\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return void 0;\r\n }\r\n else if (i === n) {\r\n return some(FSharpList__get_Head(xs_1));\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, xs);\r\n}\r\n\r\nexport function item(n, xs) {\r\n return FSharpList__get_Item_Z524259A4(xs, n);\r\n}\r\n\r\nexport function filter(f, xs) {\r\n const root = FSharpList_get_Empty();\r\n const node = fold((acc, x) => {\r\n if (f(x)) {\r\n const t = new FSharpList(x, void 0);\r\n acc.tail = t;\r\n return t;\r\n }\r\n else {\r\n return acc;\r\n }\r\n }, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function partition(f, xs) {\r\n const patternInput = [FSharpList_get_Empty(), FSharpList_get_Empty()];\r\n const root2 = patternInput[1];\r\n const root1 = patternInput[0];\r\n const patternInput_1 = fold(uncurry(2, (tupledArg) => {\r\n const lacc = tupledArg[0];\r\n const racc = tupledArg[1];\r\n return (x) => {\r\n let t, t_2;\r\n return f(x) ? [(t = (new FSharpList(x, void 0)), (lacc.tail = t, t)), racc] : [lacc, (t_2 = (new FSharpList(x, void 0)), (racc.tail = t_2, t_2))];\r\n };\r\n }), [root1, root2], xs);\r\n const t_4 = FSharpList_get_Empty();\r\n patternInput_1[0].tail = t_4;\r\n const t_5 = FSharpList_get_Empty();\r\n patternInput_1[1].tail = t_5;\r\n return [FSharpList__get_Tail(root1), FSharpList__get_Tail(root2)];\r\n}\r\n\r\nexport function choose(f, xs) {\r\n const root = FSharpList_get_Empty();\r\n const node = fold((acc, x) => {\r\n const matchValue = f(x);\r\n if (matchValue == null) {\r\n return acc;\r\n }\r\n else {\r\n const t = new FSharpList(value_1(matchValue), void 0);\r\n acc.tail = t;\r\n return t;\r\n }\r\n }, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function contains(value, xs, eq) {\r\n return tryFindIndex((v) => eq.Equals(value, v), xs) != null;\r\n}\r\n\r\nexport function initialize(n, f) {\r\n let xs, t;\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n for (let i = 0; i <= (n - 1); i++) {\r\n node = ((xs = node, (t = (new FSharpList(f(i), void 0)), (xs.tail = t, t))));\r\n }\r\n const xs_2 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_2.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function replicate(n, x) {\r\n return initialize(n, (_arg) => x);\r\n}\r\n\r\nexport function reduce(f, xs) {\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n throw (new Error(SR_inputWasEmpty));\r\n }\r\n else {\r\n return fold(f, head(xs), tail(xs));\r\n }\r\n}\r\n\r\nexport function reduceBack(f, xs) {\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n throw (new Error(SR_inputWasEmpty));\r\n }\r\n else {\r\n return foldBack(f, tail(xs), head(xs));\r\n }\r\n}\r\n\r\nexport function forAll(f, xs) {\r\n return fold((acc, x) => (acc && f(x)), true, xs);\r\n}\r\n\r\nexport function forAll2(f, xs, ys) {\r\n return fold2((acc, x, y) => (acc && f(x, y)), true, xs, ys);\r\n}\r\n\r\nexport function exists(f, xs) {\r\n return tryFindIndex(f, xs) != null;\r\n}\r\n\r\nexport function exists2(f_mut, xs_mut, ys_mut) {\r\n exists2:\r\n while (true) {\r\n const f = f_mut, xs = xs_mut, ys = ys_mut;\r\n const matchValue = [FSharpList__get_IsEmpty(xs), FSharpList__get_IsEmpty(ys)];\r\n let pattern_matching_result;\r\n if (matchValue[0]) {\r\n if (matchValue[1]) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 2;\r\n }\r\n }\r\n else if (matchValue[1]) {\r\n pattern_matching_result = 2;\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return false;\r\n }\r\n case 1: {\r\n if (f(FSharpList__get_Head(xs), FSharpList__get_Head(ys))) {\r\n return true;\r\n }\r\n else {\r\n f_mut = f;\r\n xs_mut = FSharpList__get_Tail(xs);\r\n ys_mut = FSharpList__get_Tail(ys);\r\n continue exists2;\r\n }\r\n }\r\n case 2: {\r\n throw (new Error((SR_differentLengths + \"\\\\nParameter name: \") + \"list2\"));\r\n }\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function unzip(xs) {\r\n return foldBack((tupledArg, tupledArg_1) => [FSharpList_Cons_305B8EAC(tupledArg[0], tupledArg_1[0]), FSharpList_Cons_305B8EAC(tupledArg[1], tupledArg_1[1])], xs, [FSharpList_get_Empty(), FSharpList_get_Empty()]);\r\n}\r\n\r\nexport function unzip3(xs) {\r\n return foldBack((tupledArg, tupledArg_1) => [FSharpList_Cons_305B8EAC(tupledArg[0], tupledArg_1[0]), FSharpList_Cons_305B8EAC(tupledArg[1], tupledArg_1[1]), FSharpList_Cons_305B8EAC(tupledArg[2], tupledArg_1[2])], xs, [FSharpList_get_Empty(), FSharpList_get_Empty(), FSharpList_get_Empty()]);\r\n}\r\n\r\nexport function zip(xs, ys) {\r\n return map2((x, y) => [x, y], xs, ys);\r\n}\r\n\r\nexport function zip3(xs, ys, zs) {\r\n return map3((x, y, z) => [x, y, z], xs, ys, zs);\r\n}\r\n\r\nexport function sortWith(comparer, xs) {\r\n const arr = toArray(xs);\r\n arr.sort(comparer);\r\n return ofArray(arr);\r\n}\r\n\r\nexport function sort(xs, comparer) {\r\n return sortWith((x, y) => comparer.Compare(x, y), xs);\r\n}\r\n\r\nexport function sortBy(projection, xs, comparer) {\r\n return sortWith((x, y) => comparer.Compare(projection(x), projection(y)), xs);\r\n}\r\n\r\nexport function sortDescending(xs, comparer) {\r\n return sortWith((x, y) => (comparer.Compare(x, y) * -1), xs);\r\n}\r\n\r\nexport function sortByDescending(projection, xs, comparer) {\r\n return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) * -1), xs);\r\n}\r\n\r\nexport function sum(xs, adder) {\r\n return fold((acc, x) => adder.Add(acc, x), adder.GetZero(), xs);\r\n}\r\n\r\nexport function sumBy(f, xs, adder) {\r\n return fold((acc, x) => adder.Add(acc, f(x)), adder.GetZero(), xs);\r\n}\r\n\r\nexport function maxBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function max(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function minBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function min(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function average(xs, averager) {\r\n let count = 0;\r\n const total = fold((acc, x) => {\r\n count = ((count + 1) | 0);\r\n return averager.Add(acc, x);\r\n }, averager.GetZero(), xs);\r\n return averager.DivideByInt(total, count);\r\n}\r\n\r\nexport function averageBy(f, xs, averager) {\r\n let count = 0;\r\n const total = fold((acc, x) => {\r\n count = ((count + 1) | 0);\r\n return averager.Add(acc, f(x));\r\n }, averager.GetZero(), xs);\r\n return averager.DivideByInt(total, count);\r\n}\r\n\r\nexport function permute(f, xs) {\r\n return ofArray(permute_1(f, toArray(xs)));\r\n}\r\n\r\nexport function chunkBySize(chunkSize, xs) {\r\n return ofArray(map_1(ofArray, chunkBySize_1(chunkSize, toArray(xs))));\r\n}\r\n\r\nexport function allPairs(xs, ys) {\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n iterate((x) => {\r\n iterate((y) => {\r\n let xs_1, t;\r\n node = ((xs_1 = node, (t = (new FSharpList([x, y], void 0)), (xs_1.tail = t, t))));\r\n }, ys);\r\n }, xs);\r\n const xs_3 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_3.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function skip(count_mut, xs_mut) {\r\n skip:\r\n while (true) {\r\n const count = count_mut, xs = xs_mut;\r\n if (count <= 0) {\r\n return xs;\r\n }\r\n else if (FSharpList__get_IsEmpty(xs)) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n else {\r\n count_mut = (count - 1);\r\n xs_mut = FSharpList__get_Tail(xs);\r\n continue skip;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function skipWhile(predicate_mut, xs_mut) {\r\n skipWhile:\r\n while (true) {\r\n const predicate = predicate_mut, xs = xs_mut;\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n return xs;\r\n }\r\n else if (!predicate(FSharpList__get_Head(xs))) {\r\n return xs;\r\n }\r\n else {\r\n predicate_mut = predicate;\r\n xs_mut = FSharpList__get_Tail(xs);\r\n continue skipWhile;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function take(count, xs) {\r\n if (count < 0) {\r\n throw (new Error((SR_inputMustBeNonNegative + \"\\\\nParameter name: \") + \"count\"));\r\n }\r\n const loop = (i_mut, acc_mut, xs_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut;\r\n if (i <= 0) {\r\n return acc;\r\n }\r\n else if (FSharpList__get_IsEmpty(xs_1)) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n acc_mut = ((t = (new FSharpList(FSharpList__get_Head(xs_1), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node = loop(count, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function takeWhile(predicate, xs) {\r\n const loop = (acc_mut, xs_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const acc = acc_mut, xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return acc;\r\n }\r\n else if (!predicate(FSharpList__get_Head(xs_1))) {\r\n return acc;\r\n }\r\n else {\r\n acc_mut = ((t = (new FSharpList(FSharpList__get_Head(xs_1), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node = loop(root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function truncate(count, xs) {\r\n const loop = (i_mut, acc_mut, xs_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut;\r\n if (i <= 0) {\r\n return acc;\r\n }\r\n else if (FSharpList__get_IsEmpty(xs_1)) {\r\n return acc;\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n acc_mut = ((t = (new FSharpList(FSharpList__get_Head(xs_1), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node = loop(count, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function getSlice(startIndex, endIndex, xs) {\r\n const len = length(xs) | 0;\r\n const startIndex_1 = defaultArg(startIndex, 0) | 0;\r\n const endIndex_1 = defaultArg(endIndex, len - 1) | 0;\r\n if (startIndex_1 < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"startIndex\"));\r\n }\r\n else if (endIndex_1 >= len) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"endIndex\"));\r\n }\r\n else if (endIndex_1 < startIndex_1) {\r\n return FSharpList_get_Empty();\r\n }\r\n else {\r\n return take((endIndex_1 - startIndex_1) + 1, skip(startIndex_1, xs));\r\n }\r\n}\r\n\r\nexport function splitAt(index, xs) {\r\n if (index < 0) {\r\n throw (new Error((SR_inputMustBeNonNegative + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n if (index > FSharpList__get_Length(xs)) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return [take(index, xs), skip(index, xs)];\r\n}\r\n\r\nexport function exactlyOne(xs) {\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n else if (FSharpList__get_IsEmpty(FSharpList__get_Tail(xs))) {\r\n return FSharpList__get_Head(xs);\r\n }\r\n else {\r\n throw (new Error((SR_inputSequenceTooLong + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n}\r\n\r\nexport function tryExactlyOne(xs) {\r\n if ((!FSharpList__get_IsEmpty(xs)) && FSharpList__get_IsEmpty(FSharpList__get_Tail(xs))) {\r\n return some(FSharpList__get_Head(xs));\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function where(predicate, xs) {\r\n return filter(predicate, xs);\r\n}\r\n\r\nexport function pairwise(xs) {\r\n return ofArray(pairwise_1(toArray(xs)));\r\n}\r\n\r\nexport function windowed(windowSize, xs) {\r\n return ofArray(map_1(ofArray, windowed_1(windowSize, toArray(xs))));\r\n}\r\n\r\nexport function splitInto(chunks, xs) {\r\n return ofArray(map_1(ofArray, splitInto_1(chunks, toArray(xs))));\r\n}\r\n\r\nexport function transpose(lists) {\r\n return ofArray(map_1(ofArray, transpose_1(map_1(toArray, Array.from(lists)))));\r\n}\r\n\r\nexport function insertAt(index, y, xs) {\r\n let i = -1;\r\n let isDone = false;\r\n const result = fold((acc, x) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n isDone = true;\r\n return FSharpList_Cons_305B8EAC(x, FSharpList_Cons_305B8EAC(y, acc));\r\n }\r\n else {\r\n return FSharpList_Cons_305B8EAC(x, acc);\r\n }\r\n }, FSharpList_get_Empty(), xs);\r\n return reverse(isDone ? result : (((i + 1) === index) ? FSharpList_Cons_305B8EAC(y, result) : (() => {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n })()));\r\n}\r\n\r\nexport function insertManyAt(index, ys, xs) {\r\n let i = -1;\r\n let isDone = false;\r\n const ys_1 = ofSeq(ys);\r\n const result = fold((acc, x) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n isDone = true;\r\n return FSharpList_Cons_305B8EAC(x, append(ys_1, acc));\r\n }\r\n else {\r\n return FSharpList_Cons_305B8EAC(x, acc);\r\n }\r\n }, FSharpList_get_Empty(), xs);\r\n return reverse(isDone ? result : (((i + 1) === index) ? append(ys_1, result) : (() => {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n })()));\r\n}\r\n\r\nexport function removeAt(index, xs) {\r\n let i = -1;\r\n let isDone = false;\r\n const ys = filter((_arg) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n isDone = true;\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }, xs);\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return ys;\r\n}\r\n\r\nexport function removeManyAt(index, count, xs) {\r\n let i = -1;\r\n let status = -1;\r\n const ys = filter((_arg) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n status = 0;\r\n return false;\r\n }\r\n else if (i > index) {\r\n if (i < (index + count)) {\r\n return false;\r\n }\r\n else {\r\n status = 1;\r\n return true;\r\n }\r\n }\r\n else {\r\n return true;\r\n }\r\n }, xs);\r\n const status_1 = (((status === 0) && ((i + 1) === (index + count))) ? 1 : status) | 0;\r\n if (status_1 < 1) {\r\n const arg = (status_1 < 0) ? \"index\" : \"count\";\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + arg));\r\n }\r\n return ys;\r\n}\r\n\r\nexport function updateAt(index, y, xs) {\r\n let isDone = false;\r\n const ys = mapIndexed((i, x) => {\r\n if (i === index) {\r\n isDone = true;\r\n return y;\r\n }\r\n else {\r\n return x;\r\n }\r\n }, xs);\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return ys;\r\n}\r\n\r\n","import { ensureErrorOrException } from './Types.js';\nexport class CancellationToken {\n constructor(cancelled = false) {\n this._id = 0;\n this._cancelled = cancelled;\n this._listeners = new Map();\n }\n get isCancelled() {\n return this._cancelled;\n }\n cancel() {\n if (!this._cancelled) {\n this._cancelled = true;\n for (const [, listener] of this._listeners) {\n listener();\n }\n }\n }\n addListener(f) {\n const id = this._id;\n this._listeners.set(this._id++, f);\n return id;\n }\n removeListener(id) {\n return this._listeners.delete(id);\n }\n register(f, state) {\n const $ = this;\n const id = this.addListener(state == null ? f : () => f(state));\n return { Dispose() { $.removeListener(id); } };\n }\n Dispose() {\n // Implement IDisposable for compatibility but do nothing\n // According to docs, calling Dispose does not trigger cancellation\n // https://docs.microsoft.com/en-us/dotnet/api/system.threading.cancellationtokensource.dispose?view=net-6.0\n }\n}\nexport class OperationCanceledError extends Error {\n constructor() {\n super(\"The operation was canceled\");\n Object.setPrototypeOf(this, OperationCanceledError.prototype);\n }\n}\nexport class Trampoline {\n constructor() {\n this.callCount = 0;\n }\n static get maxTrampolineCallCount() {\n return 2000;\n }\n incrementAndCheck() {\n return this.callCount++ > Trampoline.maxTrampolineCallCount;\n }\n hijack(f) {\n this.callCount = 0;\n setTimeout(f, 0);\n }\n}\nexport function protectedCont(f) {\n return (ctx) => {\n if (ctx.cancelToken.isCancelled) {\n ctx.onCancel(new OperationCanceledError());\n }\n else if (ctx.trampoline.incrementAndCheck()) {\n ctx.trampoline.hijack(() => {\n try {\n f(ctx);\n }\n catch (err) {\n ctx.onError(ensureErrorOrException(err));\n }\n });\n }\n else {\n try {\n f(ctx);\n }\n catch (err) {\n ctx.onError(ensureErrorOrException(err));\n }\n }\n };\n}\nexport function protectedBind(computation, binder) {\n return protectedCont((ctx) => {\n computation({\n onSuccess: (x) => {\n try {\n binder(x)(ctx);\n }\n catch (err) {\n ctx.onError(ensureErrorOrException(err));\n }\n },\n onError: ctx.onError,\n onCancel: ctx.onCancel,\n cancelToken: ctx.cancelToken,\n trampoline: ctx.trampoline,\n });\n });\n}\nexport function protectedReturn(value) {\n return protectedCont((ctx) => ctx.onSuccess(value));\n}\nexport class AsyncBuilder {\n Bind(computation, binder) {\n return protectedBind(computation, binder);\n }\n Combine(computation1, computation2) {\n return this.Bind(computation1, () => computation2);\n }\n Delay(generator) {\n return protectedCont((ctx) => generator()(ctx));\n }\n For(sequence, body) {\n const iter = sequence[Symbol.iterator]();\n let cur = iter.next();\n return this.While(() => !cur.done, this.Delay(() => {\n const res = body(cur.value);\n cur = iter.next();\n return res;\n }));\n }\n Return(value) {\n return protectedReturn(value);\n }\n ReturnFrom(computation) {\n return computation;\n }\n TryFinally(computation, compensation) {\n return protectedCont((ctx) => {\n computation({\n onSuccess: (x) => {\n compensation();\n ctx.onSuccess(x);\n },\n onError: (x) => {\n compensation();\n ctx.onError(x);\n },\n onCancel: (x) => {\n compensation();\n ctx.onCancel(x);\n },\n cancelToken: ctx.cancelToken,\n trampoline: ctx.trampoline,\n });\n });\n }\n TryWith(computation, catchHandler) {\n return protectedCont((ctx) => {\n computation({\n onSuccess: ctx.onSuccess,\n onCancel: ctx.onCancel,\n cancelToken: ctx.cancelToken,\n trampoline: ctx.trampoline,\n onError: (ex) => {\n try {\n catchHandler(ex)(ctx);\n }\n catch (err) {\n ctx.onError(ensureErrorOrException(err));\n }\n },\n });\n });\n }\n Using(resource, binder) {\n return this.TryFinally(binder(resource), () => resource.Dispose());\n }\n While(guard, computation) {\n if (guard()) {\n return this.Bind(computation, () => this.While(guard, computation));\n }\n else {\n return this.Return(void 0);\n }\n }\n Zero() {\n return protectedCont((ctx) => ctx.onSuccess(void 0));\n }\n}\nexport const singleton = new AsyncBuilder();\n","import { Union } from \"./Types.js\";\r\nimport { union_type } from \"./Reflection.js\";\r\nimport { some } from \"./Option.js\";\r\n\r\nexport class FSharpResult$2 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Ok\", \"Error\"];\r\n }\r\n}\r\n\r\nexport function FSharpResult$2$reflection(gen0, gen1) {\r\n return union_type(\"FSharp.Core.FSharpResult`2\", [gen0, gen1], FSharpResult$2, () => [[[\"ResultValue\", gen0]], [[\"ErrorValue\", gen1]]]);\r\n}\r\n\r\nexport function Result_Map(mapping, result) {\r\n if (result.tag === 0) {\r\n return new FSharpResult$2(0, mapping(result.fields[0]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, result.fields[0]);\r\n }\r\n}\r\n\r\nexport function Result_MapError(mapping, result) {\r\n if (result.tag === 0) {\r\n return new FSharpResult$2(0, result.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(1, mapping(result.fields[0]));\r\n }\r\n}\r\n\r\nexport function Result_Bind(binder, result) {\r\n if (result.tag === 0) {\r\n return binder(result.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(1, result.fields[0]);\r\n }\r\n}\r\n\r\nexport class FSharpChoice$2 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of2\", \"Choice2Of2\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$2$reflection(gen0, gen1) {\r\n return union_type(\"FSharp.Core.FSharpChoice`2\", [gen0, gen1], FSharpChoice$2, () => [[[\"Item\", gen0]], [[\"Item\", gen1]]]);\r\n}\r\n\r\nexport class FSharpChoice$3 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of3\", \"Choice2Of3\", \"Choice3Of3\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$3$reflection(gen0, gen1, gen2) {\r\n return union_type(\"FSharp.Core.FSharpChoice`3\", [gen0, gen1, gen2], FSharpChoice$3, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]]]);\r\n}\r\n\r\nexport class FSharpChoice$4 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of4\", \"Choice2Of4\", \"Choice3Of4\", \"Choice4Of4\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$4$reflection(gen0, gen1, gen2, gen3) {\r\n return union_type(\"FSharp.Core.FSharpChoice`4\", [gen0, gen1, gen2, gen3], FSharpChoice$4, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]], [[\"Item\", gen3]]]);\r\n}\r\n\r\nexport class FSharpChoice$5 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of5\", \"Choice2Of5\", \"Choice3Of5\", \"Choice4Of5\", \"Choice5Of5\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$5$reflection(gen0, gen1, gen2, gen3, gen4) {\r\n return union_type(\"FSharp.Core.FSharpChoice`5\", [gen0, gen1, gen2, gen3, gen4], FSharpChoice$5, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]], [[\"Item\", gen3]], [[\"Item\", gen4]]]);\r\n}\r\n\r\nexport class FSharpChoice$6 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of6\", \"Choice2Of6\", \"Choice3Of6\", \"Choice4Of6\", \"Choice5Of6\", \"Choice6Of6\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$6$reflection(gen0, gen1, gen2, gen3, gen4, gen5) {\r\n return union_type(\"FSharp.Core.FSharpChoice`6\", [gen0, gen1, gen2, gen3, gen4, gen5], FSharpChoice$6, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]], [[\"Item\", gen3]], [[\"Item\", gen4]], [[\"Item\", gen5]]]);\r\n}\r\n\r\nexport class FSharpChoice$7 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of7\", \"Choice2Of7\", \"Choice3Of7\", \"Choice4Of7\", \"Choice5Of7\", \"Choice6Of7\", \"Choice7Of7\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$7$reflection(gen0, gen1, gen2, gen3, gen4, gen5, gen6) {\r\n return union_type(\"FSharp.Core.FSharpChoice`7\", [gen0, gen1, gen2, gen3, gen4, gen5, gen6], FSharpChoice$7, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]], [[\"Item\", gen3]], [[\"Item\", gen4]], [[\"Item\", gen5]], [[\"Item\", gen6]]]);\r\n}\r\n\r\nexport function Choice_makeChoice1Of2(x) {\r\n return new FSharpChoice$2(0, x);\r\n}\r\n\r\nexport function Choice_makeChoice2Of2(x) {\r\n return new FSharpChoice$2(1, x);\r\n}\r\n\r\nexport function Choice_tryValueIfChoice1Of2(x) {\r\n if (x.tag === 0) {\r\n return some(x.fields[0]);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function Choice_tryValueIfChoice2Of2(x) {\r\n if (x.tag === 1) {\r\n return some(x.fields[0]);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\n","import { OperationCanceledError, Trampoline } from \"./AsyncBuilder.js\";\nimport { CancellationToken } from \"./AsyncBuilder.js\";\nimport { protectedCont } from \"./AsyncBuilder.js\";\nimport { protectedBind } from \"./AsyncBuilder.js\";\nimport { protectedReturn } from \"./AsyncBuilder.js\";\nimport { Choice_makeChoice1Of2, Choice_makeChoice2Of2 } from \"./Choice.js\";\nimport { TimeoutException } from \"./SystemException.js\";\n// Implemented just for type references\nexport class Async {\n}\nfunction emptyContinuation(_x) {\n // NOP\n}\n// see AsyncBuilder.Delay\nfunction delay(generator) {\n return protectedCont((ctx) => generator()(ctx));\n}\n// MakeAsync: body:(AsyncActivation<'T> -> AsyncReturn) -> Async<'T>\nexport function makeAsync(body) {\n return body;\n}\n// Invoke: computation: Async<'T> -> ctxt:AsyncActivation<'T> -> AsyncReturn\nexport function invoke(computation, ctx) {\n return computation(ctx);\n}\n// CallThenInvoke: ctxt:AsyncActivation<'T> -> result1:'U -> part2:('U -> Async<'T>) -> AsyncReturn\nexport function callThenInvoke(ctx, result1, part2) {\n return part2(result1)(ctx);\n}\n// Bind: ctxt:AsyncActivation<'T> -> part1:Async<'U> -> part2:('U -> Async<'T>) -> AsyncReturn\nexport function bind(ctx, part1, part2) {\n return protectedBind(part1, part2)(ctx);\n}\nexport function createCancellationToken(arg) {\n const token = new CancellationToken(typeof arg === \"boolean\" ? arg : false);\n if (typeof arg === \"number\") {\n setTimeout(() => { token.cancel(); }, arg);\n }\n return token;\n}\nexport function cancel(token) {\n token.cancel();\n}\nexport function cancelAfter(token, ms) {\n setTimeout(() => { token.cancel(); }, ms);\n}\nexport function isCancellationRequested(token) {\n return token != null && token.isCancelled;\n}\nexport function throwIfCancellationRequested(token) {\n if (token != null && token.isCancelled) {\n throw new Error(\"Operation is cancelled\");\n }\n}\nfunction throwAfter(millisecondsDueTime) {\n return protectedCont((ctx) => {\n let tokenId;\n const timeoutId = setTimeout(() => {\n ctx.cancelToken.removeListener(tokenId);\n ctx.onError(new TimeoutException());\n }, millisecondsDueTime);\n tokenId = ctx.cancelToken.addListener(() => {\n clearTimeout(timeoutId);\n ctx.onCancel(new OperationCanceledError());\n });\n });\n}\nexport function startChild(computation, ms) {\n if (ms) {\n const computationWithTimeout = protectedBind(parallel2(computation, throwAfter(ms)), xs => protectedReturn(xs[0]));\n return startChild(computationWithTimeout);\n }\n const promise = startAsPromise(computation);\n // JS Promises are hot, computation has already started\n // but we delay returning the result\n return protectedCont((ctx) => protectedReturn(awaitPromise(promise))(ctx));\n}\nexport function awaitPromise(p) {\n return fromContinuations((conts) => p.then(conts[0]).catch((err) => (err instanceof OperationCanceledError\n ? conts[2] : conts[1])(err)));\n}\nexport function cancellationToken() {\n return protectedCont((ctx) => ctx.onSuccess(ctx.cancelToken));\n}\nexport const defaultCancellationToken = new CancellationToken();\nexport function catchAsync(work) {\n return protectedCont((ctx) => {\n work({\n onSuccess: (x) => ctx.onSuccess(Choice_makeChoice1Of2(x)),\n onError: (ex) => ctx.onSuccess(Choice_makeChoice2Of2(ex)),\n onCancel: ctx.onCancel,\n cancelToken: ctx.cancelToken,\n trampoline: ctx.trampoline,\n });\n });\n}\nexport function fromContinuations(f) {\n return protectedCont((ctx) => f([ctx.onSuccess, ctx.onError, ctx.onCancel]));\n}\nexport function ignore(computation) {\n return protectedBind(computation, (_x) => protectedReturn(void 0));\n}\nexport function parallel(computations) {\n return delay(() => awaitPromise(Promise.all(Array.from(computations, (w) => startAsPromise(w)))));\n}\nfunction parallel2(a, b) {\n return delay(() => awaitPromise(Promise.all([startAsPromise(a), startAsPromise(b)])));\n}\nexport function sequential(computations) {\n function _sequential(computations) {\n let pr = Promise.resolve([]);\n for (const c of computations) {\n pr = pr.then(results => startAsPromise(c).then(r => results.concat([r])));\n }\n return pr;\n }\n return delay(() => awaitPromise(_sequential(computations)));\n}\nexport function sleep(millisecondsDueTime) {\n return protectedCont((ctx) => {\n let tokenId;\n const timeoutId = setTimeout(() => {\n ctx.cancelToken.removeListener(tokenId);\n ctx.onSuccess(void 0);\n }, millisecondsDueTime);\n tokenId = ctx.cancelToken.addListener(() => {\n clearTimeout(timeoutId);\n ctx.onCancel(new OperationCanceledError());\n });\n });\n}\nexport function runSynchronously() {\n throw new Error(\"Asynchronous code cannot be run synchronously in JS\");\n}\nexport function start(computation, cancellationToken) {\n return startWithContinuations(computation, cancellationToken);\n}\nexport function startImmediate(computation, cancellationToken) {\n return start(computation, cancellationToken);\n}\nexport function startWithContinuations(computation, continuation, exceptionContinuation, cancellationContinuation, cancelToken) {\n if (typeof continuation !== \"function\") {\n cancelToken = continuation;\n continuation = undefined;\n }\n const trampoline = new Trampoline();\n computation({\n onSuccess: continuation ? continuation : emptyContinuation,\n onError: exceptionContinuation ? exceptionContinuation : emptyContinuation,\n onCancel: cancellationContinuation ? cancellationContinuation : emptyContinuation,\n cancelToken: cancelToken ? cancelToken : defaultCancellationToken,\n trampoline,\n });\n}\nexport function startAsPromise(computation, cancellationToken) {\n return new Promise((resolve, reject) => startWithContinuations(computation, resolve, reject, reject, cancellationToken ? cancellationToken : defaultCancellationToken));\n}\nexport default Async;\n","import { Observer } from \"./Observable.js\";\nimport { some, value } from \"./Option.js\";\nimport { Choice_tryValueIfChoice1Of2, Choice_tryValueIfChoice2Of2 } from \"./Choice.js\";\nexport class Event {\n constructor() {\n this.delegates = [];\n }\n Add(f) {\n this._addHandler(f);\n }\n get Publish() {\n return this;\n }\n Trigger(senderOrValue, valueOrUndefined) {\n let sender;\n let value;\n if (valueOrUndefined === undefined) {\n sender = null;\n value = senderOrValue;\n }\n else {\n sender = senderOrValue;\n value = valueOrUndefined;\n }\n this.delegates.forEach((f) => f.length === 1 ? f(value) : f(sender, value));\n }\n // IDelegateEvent methods\n AddHandler(handler) {\n this._addHandler(handler);\n }\n RemoveHandler(handler) {\n this._removeHandler(handler);\n }\n // IObservable methods\n Subscribe(arg) {\n const callback = typeof arg === \"function\"\n ? arg\n : arg.OnNext;\n this._addHandler(callback);\n return { Dispose: () => { this._removeHandler(callback); } };\n }\n _addHandler(f) {\n this.delegates.push(f);\n }\n _removeHandler(f) {\n const index = this.delegates.indexOf(f);\n if (index > -1) {\n this.delegates.splice(index, 1);\n }\n }\n}\nexport function add(callback, sourceEvent) {\n if (sourceEvent instanceof Event) {\n sourceEvent.Add(callback);\n }\n else {\n sourceEvent.Subscribe(new Observer(callback));\n }\n}\nexport function choose(chooser, sourceEvent) {\n const ev = new Event();\n add((t) => {\n const u = chooser(t);\n if (u != null) {\n ev.Trigger(value(u));\n }\n }, sourceEvent);\n return ev;\n}\nexport function filter(predicate, sourceEvent) {\n return choose((x) => predicate(x) ? some(x) : undefined, sourceEvent);\n}\nexport function map(mapping, sourceEvent) {\n const ev = new Event();\n add((t) => ev.Trigger(mapping(t)), sourceEvent);\n return ev;\n}\nexport function merge(event1, event2) {\n const ev = new Event();\n const fn = (x) => ev.Trigger(x);\n add(fn, event1);\n add(fn, event2);\n return ev;\n}\nexport function pairwise(sourceEvent) {\n const ev = new Event();\n let last;\n let haveLast = false;\n add((next) => {\n if (haveLast) {\n ev.Trigger([last, next]);\n }\n last = next;\n haveLast = true;\n }, sourceEvent);\n return ev;\n}\nexport function partition(predicate, sourceEvent) {\n return [filter(predicate, sourceEvent), filter((x) => !predicate(x), sourceEvent)];\n}\nexport function scan(collector, state, sourceEvent) {\n return map((t) => state = collector(state, t), sourceEvent);\n}\nexport function split(splitter, sourceEvent) {\n return [\n choose((v) => Choice_tryValueIfChoice1Of2(splitter(v)), sourceEvent),\n choose((v) => Choice_tryValueIfChoice2Of2(splitter(v)), sourceEvent),\n ];\n}\nexport function createEvent(addHandler, removeHandler) {\n return {\n AddHandler(h) { addHandler(h); },\n RemoveHandler(h) { removeHandler(h); },\n Subscribe(r) {\n const h = (_, args) => r.OnNext(args);\n addHandler(h);\n return {\n Dispose() { removeHandler(h); }\n };\n }\n };\n}\nexport default Event;\n","import { Choice_tryValueIfChoice1Of2, Choice_tryValueIfChoice2Of2 } from \"./Choice.js\";\nimport { value } from \"./Option.js\";\nexport class Observer {\n constructor(onNext, onError, onCompleted) {\n this.OnNext = onNext;\n this.OnError = onError || ((_e) => { return; });\n this.OnCompleted = onCompleted || (() => { return; });\n }\n}\nclass Observable {\n constructor(subscribe) {\n this.Subscribe = subscribe;\n }\n}\nexport function protect(f, succeed, fail) {\n try {\n return succeed(f());\n }\n catch (e) {\n fail(e);\n }\n}\nexport function add(callback, source) {\n source.Subscribe(new Observer(callback));\n}\nexport function choose(chooser, source) {\n return new Observable((observer) => source.Subscribe(new Observer((t) => protect(() => chooser(t), (u) => { if (u != null) {\n observer.OnNext(value(u));\n } }, observer.OnError), observer.OnError, observer.OnCompleted)));\n}\nexport function filter(predicate, source) {\n return choose((x) => predicate(x) ? x : null, source);\n}\nexport function map(mapping, source) {\n return new Observable((observer) => source.Subscribe(new Observer((t) => {\n protect(() => mapping(t), observer.OnNext, observer.OnError);\n }, observer.OnError, observer.OnCompleted)));\n}\nexport function merge(source1, source2) {\n return new Observable((observer) => {\n let stopped = false;\n let completed1 = false;\n let completed2 = false;\n const h1 = source1.Subscribe(new Observer((v) => { if (!stopped) {\n observer.OnNext(v);\n } }, (e) => {\n if (!stopped) {\n stopped = true;\n observer.OnError(e);\n }\n }, () => {\n if (!stopped) {\n completed1 = true;\n if (completed2) {\n stopped = true;\n observer.OnCompleted();\n }\n }\n }));\n const h2 = source2.Subscribe(new Observer((v) => { if (!stopped) {\n observer.OnNext(v);\n } }, (e) => {\n if (!stopped) {\n stopped = true;\n observer.OnError(e);\n }\n }, () => {\n if (!stopped) {\n completed2 = true;\n if (completed1) {\n stopped = true;\n observer.OnCompleted();\n }\n }\n }));\n return {\n Dispose() {\n h1.Dispose();\n h2.Dispose();\n },\n };\n });\n}\nexport function pairwise(source) {\n return new Observable((observer) => {\n let last;\n return source.Subscribe(new Observer((next) => {\n if (last != null) {\n observer.OnNext([last, next]);\n }\n last = next;\n }, observer.OnError, observer.OnCompleted));\n });\n}\nexport function partition(predicate, source) {\n return [filter(predicate, source), filter((x) => !predicate(x), source)];\n}\nexport function scan(collector, state, source) {\n return new Observable((observer) => {\n return source.Subscribe(new Observer((t) => {\n protect(() => collector(state, t), (u) => { state = u; observer.OnNext(u); }, observer.OnError);\n }, observer.OnError, observer.OnCompleted));\n });\n}\nexport function split(splitter, source) {\n return [\n choose((v) => Choice_tryValueIfChoice1Of2(splitter(v)), source),\n choose((v) => Choice_tryValueIfChoice2Of2(splitter(v)), source)\n ];\n}\nexport function subscribe(callback, source) {\n return source.Subscribe(new Observer(callback));\n}\n","namespace Elmish\n\n(**\nLog\n---------\nBasic cross-platform logging API.\n\n*)\nmodule internal Log =\n\n#if FABLE_COMPILER\n open Fable.Core.JS\n\n let onError (text: string, ex: exn) = console.error (text,ex)\n let toConsole(text: string, o: #obj) = console.log(text,o)\n\n#else\n#if NETSTANDARD2_0\n let onError (text: string, ex: exn) = System.Diagnostics.Trace.TraceError(\"{0}: {1}\", text, ex)\n let toConsole(text: string, o: #obj) = printfn \"%s: %A\" text o\n#else\n let onError (text: string, ex: exn) = System.Console.Error.WriteLine(\"{0}: {1}\", text, ex)\n let toConsole(text: string, o: #obj) = printfn \"%s: %A\" text o\n#endif\n#endif\n\n#if FABLE_COMPILER\nmodule internal Timer =\n open System.Timers\n let delay interval callback =\n let t = new Timer(float interval, AutoReset = false)\n t.Elapsed.Add callback\n t.Enabled <- true\n t.Start()\n#endif\n","import Event from \"./Event.js\";\nexport class Timer {\n constructor(interval) {\n this._enabled = false;\n this._isDisposed = false;\n this._intervalId = 0;\n this._timeoutId = 0;\n this.Interval = interval && interval > 0 ? interval : 100;\n this.AutoReset = true;\n this._elapsed = new Event();\n }\n Elapsed() {\n return this._elapsed;\n }\n get Enabled() {\n return this._enabled;\n }\n set Enabled(x) {\n if (!this._isDisposed && this._enabled !== x) {\n this._enabled = x;\n if (this._enabled) {\n if (this.AutoReset) {\n this._intervalId = setInterval(() => {\n if (!this.AutoReset) {\n this.Enabled = false;\n }\n this._elapsed.Trigger(new Date());\n }, this.Interval);\n }\n else {\n this._timeoutId = setTimeout(() => {\n this.Enabled = false;\n this._timeoutId = 0;\n if (this.AutoReset) {\n this.Enabled = true;\n }\n this._elapsed.Trigger(new Date());\n }, this.Interval);\n }\n }\n else {\n if (this._timeoutId) {\n clearTimeout(this._timeoutId);\n this._timeoutId = 0;\n }\n if (this._intervalId) {\n clearInterval(this._intervalId);\n this._intervalId = 0;\n }\n }\n }\n }\n Dispose() {\n this.Enabled = false;\n this._isDisposed = true;\n }\n Close() {\n this.Dispose();\n }\n Start() {\n this.Enabled = true;\n }\n Stop() {\n this.Enabled = false;\n }\n}\nexport default Timer;\n","(**\nCmd\n---------\nCore abstractions for dispatching messages in Elmish.\n\n*)\n\nnamespace Elmish\n\nopen System\n\n/// Dispatch - feed new message into the processing loop\ntype Dispatch<'msg> = 'msg -> unit\n\n/// Subscription - return immediately, but may schedule dispatch of a message at any time\ntype Sub<'msg> = Dispatch<'msg> -> unit\n\n/// Cmd - container for subscriptions that may produce messages\ntype Cmd<'msg> = Sub<'msg> list\n\n/// Cmd module for creating and manipulating commands\n[]\nmodule Cmd =\n /// Execute the commands using the supplied dispatcher\n let internal exec onError (dispatch: Dispatch<'msg>) (cmd: Cmd<'msg>) =\n cmd |> List.iter (fun call -> try call dispatch with ex -> onError ex)\n\n /// None - no commands, also known as `[]`\n let none : Cmd<'msg> =\n []\n\n /// When emitting the message, map to another type\n let map (f: 'a -> 'msg) (cmd: Cmd<'a>) : Cmd<'msg> =\n cmd |> List.map (fun g -> (fun dispatch -> f >> dispatch) >> g)\n\n /// Aggregate multiple commands\n let batch (cmds: #seq>) : Cmd<'msg> =\n cmds |> List.concat\n\n /// Command to call the subscriber\n let ofSub (sub: Sub<'msg>) : Cmd<'msg> =\n [sub]\n\n module OfFunc =\n /// Command to evaluate a simple function and map the result\n /// into success or error (of exception)\n let either (task: 'a -> _) (arg: 'a) (ofSuccess: _ -> 'msg) (ofError: _ -> 'msg) : Cmd<'msg> =\n let bind dispatch =\n try\n task arg\n |> (ofSuccess >> dispatch)\n with x ->\n x |> (ofError >> dispatch)\n [bind]\n\n /// Command to evaluate a simple function and map the success to a message\n /// discarding any possible error\n let perform (task: 'a -> _) (arg: 'a) (ofSuccess: _ -> 'msg) : Cmd<'msg> =\n let bind dispatch =\n try\n task arg\n |> (ofSuccess >> dispatch)\n with x ->\n ()\n [bind]\n\n /// Command to evaluate a simple function and map the error (in case of exception)\n let attempt (task: 'a -> unit) (arg: 'a) (ofError: _ -> 'msg) : Cmd<'msg> =\n let bind dispatch =\n try\n task arg\n with x ->\n x |> (ofError >> dispatch)\n [bind]\n\n /// Command to issue a specific message\n let result (msg:'msg) : Cmd<'msg> =\n [fun dispatch -> dispatch msg]\n\n module OfAsyncWith =\n /// Command that will evaluate an async block and map the result\n /// into success or error (of exception)\n let either (start: Async -> unit) \n (task: 'a -> Async<_>)\n (arg: 'a)\n (ofSuccess: _ -> 'msg)\n (ofError: _ -> 'msg) : Cmd<'msg> =\n let bind dispatch =\n async {\n let! r = task arg |> Async.Catch\n dispatch (match r with\n | Choice1Of2 x -> ofSuccess x\n | Choice2Of2 x -> ofError x)\n }\n [bind >> start]\n\n /// Command that will evaluate an async block and map the success\n let perform (start: Async -> unit) \n (task: 'a -> Async<_>)\n (arg: 'a)\n (ofSuccess: _ -> 'msg) : Cmd<'msg> =\n let bind dispatch =\n async {\n let! r = task arg |> Async.Catch\n match r with\n | Choice1Of2 x -> dispatch (ofSuccess x)\n | _ -> ()\n }\n [bind >> start]\n\n /// Command that will evaluate an async block and map the error (of exception)\n let attempt (start: Async -> unit) \n (task: 'a -> Async<_>)\n (arg: 'a)\n (ofError: _ -> 'msg) : Cmd<'msg> =\n let bind dispatch =\n async {\n let! r = task arg |> Async.Catch\n match r with\n | Choice2Of2 x -> dispatch (ofError x)\n | _ -> ()\n }\n [bind >> start]\n\n /// Command that will evaluate an async block to the message\n let result (start: Async -> unit) \n (task: Async<'msg>) : Cmd<'msg> =\n let bind dispatch =\n async {\n let! r = task\n dispatch r\n }\n [bind >> start]\n\n module OfAsync =\n#if FABLE_COMPILER\n let start x = Timer.delay 0 (fun _ -> Async.StartImmediate x)\n#else\n let inline start x = Async.Start x\n#endif \n /// Command that will evaluate an async block and map the result\n /// into success or error (of exception)\n let inline either (task: 'a -> Async<_>)\n (arg: 'a)\n (ofSuccess: _ -> 'msg)\n (ofError: _ -> 'msg) : Cmd<'msg> =\n OfAsyncWith.either start task arg ofSuccess ofError\n\n /// Command that will evaluate an async block and map the success\n let inline perform (task: 'a -> Async<_>)\n (arg: 'a)\n (ofSuccess: _ -> 'msg) : Cmd<'msg> =\n OfAsyncWith.perform start task arg ofSuccess\n\n /// Command that will evaluate an async block and map the error (of exception)\n let inline attempt (task: 'a -> Async<_>)\n (arg: 'a)\n (ofError: _ -> 'msg) : Cmd<'msg> =\n OfAsyncWith.attempt start task arg ofError\n\n /// Command that will evaluate an async block to the message\n let inline result (task: Async<'msg>) : Cmd<'msg> =\n OfAsyncWith.result start task\n\n module OfAsyncImmediate =\n /// Command that will evaluate an async block and map the result\n /// into success or error (of exception)\n let inline either (task: 'a -> Async<_>)\n (arg: 'a)\n (ofSuccess: _ -> 'msg)\n (ofError: _ -> 'msg) : Cmd<'msg> =\n OfAsyncWith.either Async.StartImmediate task arg ofSuccess ofError\n\n /// Command that will evaluate an async block and map the success\n let inline perform (task: 'a -> Async<_>)\n (arg: 'a)\n (ofSuccess: _ -> 'msg) : Cmd<'msg> =\n OfAsyncWith.perform Async.StartImmediate task arg ofSuccess\n\n /// Command that will evaluate an async block and map the error (of exception)\n let inline attempt (task: 'a -> Async<_>)\n (arg: 'a)\n (ofError: _ -> 'msg) : Cmd<'msg> =\n OfAsyncWith.attempt Async.StartImmediate task arg ofError\n\n /// Command that will evaluate an async block to the message\n let inline result (task: Async<'msg>) : Cmd<'msg> =\n OfAsyncWith.result Async.StartImmediate task\n\n#if FABLE_COMPILER\n module OfPromise =\n /// Command to call `promise` block and map the results\n let either (task: 'a -> Fable.Core.JS.Promise<_>)\n (arg:'a)\n (ofSuccess: _ -> 'msg)\n (ofError: #exn -> 'msg) : Cmd<'msg> =\n let bind dispatch =\n (task arg)\n .``then``(ofSuccess >> dispatch)\n .catch(unbox >> ofError >> dispatch)\n |> ignore\n [bind]\n\n /// Command to call `promise` block and map the success\n let perform (task: 'a -> Fable.Core.JS.Promise<_>)\n (arg:'a)\n (ofSuccess: _ -> 'msg) =\n let bind dispatch =\n (task arg)\n .``then``(ofSuccess >> dispatch)\n |> ignore\n [bind]\n\n /// Command to call `promise` block and map the error\n let attempt (task: 'a -> Fable.Core.JS.Promise<_>)\n (arg:'a)\n (ofError: #exn -> 'msg) : Cmd<'msg> =\n let bind dispatch =\n (task arg)\n .catch(unbox >> ofError >> dispatch)\n |> ignore\n [bind]\n\n /// Command to dispatch the `promise` result\n let result (task: Fable.Core.JS.Promise<'msg>) =\n let bind dispatch =\n task.``then`` dispatch\n |> ignore\n [bind]\n\n []\n let inline ofPromise (task: 'a -> Fable.Core.JS.Promise<_>)\n (arg:'a)\n (ofSuccess: _ -> 'msg)\n (ofError: _ -> 'msg) : Cmd<'msg> =\n OfPromise.either task arg ofSuccess ofError \n#else\n open System.Threading.Tasks\n module OfTask =\n /// Command to call a task and map the results\n let inline either (task: 'a -> Task<_>)\n (arg:'a)\n (ofSuccess: _ -> 'msg)\n (ofError: _ -> 'msg) : Cmd<'msg> =\n OfAsync.either (task >> Async.AwaitTask) arg ofSuccess ofError\n\n /// Command to call a task and map the success\n let inline perform (task: 'a -> Task<_>)\n (arg:'a)\n (ofSuccess: _ -> 'msg) : Cmd<'msg> =\n OfAsync.perform (task >> Async.AwaitTask) arg ofSuccess\n\n /// Command to call a task and map the error\n let inline attempt (task: 'a -> Task<_>)\n (arg:'a)\n (ofError: _ -> 'msg) : Cmd<'msg> =\n OfAsync.attempt (task >> Async.AwaitTask) arg ofError\n\n /// Command and map the task success\n let inline result (task: Task<'msg>) : Cmd<'msg> =\n OfAsync.result (task |> Async.AwaitTask)\n\n []\n let inline ofTask (task: 'a -> Task<_>)\n (arg:'a)\n (ofSuccess: _ -> 'msg)\n (ofError: _ -> 'msg) : Cmd<'msg> =\n OfTask.either task arg ofSuccess ofError\n#endif\n\n // Synonymous with `OfFunc.result`, may be removed in the future\n let inline ofMsg (msg:'msg) : Cmd<'msg> =\n OfFunc.result msg\n\n []\n let inline ofAsync (task: 'a -> Async<_>)\n (arg: 'a)\n (ofSuccess: _ -> 'msg)\n (ofError: _ -> 'msg) : Cmd<'msg> =\n OfAsync.either task arg ofSuccess ofError\n\n []\n let inline ofFunc (task: 'a -> _) (arg: 'a) (ofSuccess: _ -> 'msg) (ofError: _ -> 'msg) : Cmd<'msg> =\n OfFunc.either task arg ofSuccess ofError\n\n []\n let inline performFunc (task: 'a -> _) (arg: 'a) (ofSuccess: _ -> 'msg) : Cmd<'msg> =\n OfFunc.perform task arg ofSuccess\n\n []\n let attemptFunc (task: 'a -> unit) (arg: 'a) (ofError: _ -> 'msg) : Cmd<'msg> =\n OfFunc.attempt task arg ofError\n\n","import { disposeSafe, structuralHash, equals } from \"./Util.js\";\r\nimport { HashIdentity_Structural, ComparisonIdentity_Structural } from \"./FSharp.Collections.js\";\r\nimport { StringBuilder__Append_Z721C83C5 } from \"./System.Text.js\";\r\n\r\nexport const LanguagePrimitives_GenericEqualityComparer = {\r\n [\"System.Collections.IEqualityComparer.Equals541DA560\"](x, y) {\r\n return equals(x, y);\r\n },\r\n [\"System.Collections.IEqualityComparer.GetHashCode4E60E31B\"](x_1) {\r\n return structuralHash(x_1);\r\n },\r\n};\r\n\r\nexport const LanguagePrimitives_GenericEqualityERComparer = {\r\n [\"System.Collections.IEqualityComparer.Equals541DA560\"](x, y) {\r\n return equals(x, y);\r\n },\r\n [\"System.Collections.IEqualityComparer.GetHashCode4E60E31B\"](x_1) {\r\n return structuralHash(x_1);\r\n },\r\n};\r\n\r\nexport function LanguagePrimitives_FastGenericComparer() {\r\n return ComparisonIdentity_Structural();\r\n}\r\n\r\nexport function LanguagePrimitives_FastGenericComparerFromTable() {\r\n return ComparisonIdentity_Structural();\r\n}\r\n\r\nexport function LanguagePrimitives_FastGenericEqualityComparer() {\r\n return HashIdentity_Structural();\r\n}\r\n\r\nexport function LanguagePrimitives_FastGenericEqualityComparerFromTable() {\r\n return HashIdentity_Structural();\r\n}\r\n\r\nexport function Operators_Failure(message) {\r\n return new Error(message);\r\n}\r\n\r\nexport function Operators_FailurePattern(exn) {\r\n return exn.message;\r\n}\r\n\r\nexport function Operators_NullArg(x) {\r\n throw (new Error(x));\r\n}\r\n\r\nexport function Operators_Using(resource, action) {\r\n try {\r\n return action(resource);\r\n }\r\n finally {\r\n if (equals(resource, null)) {\r\n }\r\n else {\r\n disposeSafe(resource);\r\n }\r\n }\r\n}\r\n\r\nexport function Operators_Lock(_lockObj, action) {\r\n return action();\r\n}\r\n\r\nexport function ExtraTopLevelOperators_LazyPattern(input) {\r\n return input.Value;\r\n}\r\n\r\nexport function PrintfModule_PrintFormatToStringBuilderThen(continuation, builder, format) {\r\n return format.cont((s) => {\r\n StringBuilder__Append_Z721C83C5(builder, s);\r\n return continuation();\r\n });\r\n}\r\n\r\nexport function PrintfModule_PrintFormatToStringBuilder(builder, format) {\r\n return PrintfModule_PrintFormatToStringBuilderThen(() => {\r\n }, builder, format);\r\n}\r\n\r\n","import { compare, physicalHash, equals, structuralHash } from \"./Util.js\";\r\n\r\nexport function HashIdentity_FromFunctions(hash, eq) {\r\n return {\r\n Equals(x, y) {\r\n return eq(x, y);\r\n },\r\n GetHashCode(x_1) {\r\n return hash(x_1);\r\n },\r\n };\r\n}\r\n\r\nexport function HashIdentity_Structural() {\r\n return HashIdentity_FromFunctions(structuralHash, equals);\r\n}\r\n\r\nexport function HashIdentity_Reference() {\r\n return HashIdentity_FromFunctions(physicalHash, (e, e_1) => (e === e_1));\r\n}\r\n\r\nexport function ComparisonIdentity_FromFunction(comparer) {\r\n return {\r\n Compare(x, y) {\r\n return comparer(x, y);\r\n },\r\n };\r\n}\r\n\r\nexport function ComparisonIdentity_Structural() {\r\n return ComparisonIdentity_FromFunction(compare);\r\n}\r\n\r\n","import { clear, equals, isArrayLike, isDisposable, toIterator, disposeSafe, getEnumerator } from \"./Util.js\";\r\nimport { toString } from \"./Types.js\";\r\nimport { class_type } from \"./Reflection.js\";\r\nimport { some, value as value_1 } from \"./Option.js\";\r\nimport { Operators_Lock, Operators_NullArg } from \"./FSharp.Core.js\";\r\nimport { chunkBySize as chunkBySize_1, permute as permute_1, transpose as transpose_1, windowed as windowed_1, splitInto as splitInto_1, map as map_1, pairwise as pairwise_1, scanBack as scanBack_1, reverse as reverse_1, mapFoldBack as mapFoldBack_1, mapFold as mapFold_1, tryItem as tryItem_1, tryHead as tryHead_1, foldBack2 as foldBack2_1, foldBack as foldBack_1, tryFindIndexBack as tryFindIndexBack_1, tryFindBack as tryFindBack_1, singleton as singleton_1 } from \"./Array.js\";\r\nimport { length as length_1, tryItem as tryItem_2, isEmpty as isEmpty_1, tryHead as tryHead_2, ofSeq as ofSeq_1, ofArray as ofArray_1, toArray as toArray_1, FSharpList } from \"./List.js\";\r\nimport { SR_indexOutOfBounds } from \"./Global.js\";\r\n\r\nexport const SR_enumerationAlreadyFinished = \"Enumeration already finished.\";\r\n\r\nexport const SR_enumerationNotStarted = \"Enumeration has not started. Call MoveNext.\";\r\n\r\nexport const SR_inputSequenceEmpty = \"The input sequence was empty.\";\r\n\r\nexport const SR_inputSequenceTooLong = \"The input sequence contains more than one element.\";\r\n\r\nexport const SR_keyNotFoundAlt = \"An index satisfying the predicate was not found in the collection.\";\r\n\r\nexport const SR_notEnoughElements = \"The input sequence has an insufficient number of elements.\";\r\n\r\nexport const SR_resetNotSupported = \"Reset is not supported on this enumerator.\";\r\n\r\nexport function Enumerator_noReset() {\r\n throw (new Error(SR_resetNotSupported));\r\n}\r\n\r\nexport function Enumerator_notStarted() {\r\n throw (new Error(SR_enumerationNotStarted));\r\n}\r\n\r\nexport function Enumerator_alreadyFinished() {\r\n throw (new Error(SR_enumerationAlreadyFinished));\r\n}\r\n\r\nexport class Enumerator_Seq {\r\n constructor(f) {\r\n this.f = f;\r\n }\r\n toString() {\r\n const xs = this;\r\n const maxCount = 4;\r\n let i = 0;\r\n let str = \"seq [\";\r\n const e = getEnumerator(xs);\r\n try {\r\n while ((i < maxCount) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n if (i > 0) {\r\n str = (str + \"; \");\r\n }\r\n str = (str + toString(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()));\r\n i = ((i + 1) | 0);\r\n }\r\n if (i === maxCount) {\r\n str = (str + \"; ...\");\r\n }\r\n return str + \"]\";\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n }\r\n GetEnumerator() {\r\n const x = this;\r\n return x.f();\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const x = this;\r\n return x.f();\r\n }\r\n}\r\n\r\nexport function Enumerator_Seq$reflection(gen0) {\r\n return class_type(\"SeqModule.Enumerator.Seq\", [gen0], Enumerator_Seq);\r\n}\r\n\r\nexport function Enumerator_Seq_$ctor_673A07F2(f) {\r\n return new Enumerator_Seq(f);\r\n}\r\n\r\nexport class Enumerator_FromFunctions$1 {\r\n constructor(current, next, dispose) {\r\n this.current = current;\r\n this.next = next;\r\n this.dispose = dispose;\r\n }\r\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\r\n const __ = this;\r\n return __.current();\r\n }\r\n [\"System.Collections.IEnumerator.get_Current\"]() {\r\n const __ = this;\r\n return __.current();\r\n }\r\n [\"System.Collections.IEnumerator.MoveNext\"]() {\r\n const __ = this;\r\n return __.next();\r\n }\r\n [\"System.Collections.IEnumerator.Reset\"]() {\r\n Enumerator_noReset();\r\n }\r\n Dispose() {\r\n const __ = this;\r\n __.dispose();\r\n }\r\n}\r\n\r\nexport function Enumerator_FromFunctions$1$reflection(gen0) {\r\n return class_type(\"SeqModule.Enumerator.FromFunctions`1\", [gen0], Enumerator_FromFunctions$1);\r\n}\r\n\r\nexport function Enumerator_FromFunctions$1_$ctor_58C54629(current, next, dispose) {\r\n return new Enumerator_FromFunctions$1(current, next, dispose);\r\n}\r\n\r\nexport function Enumerator_cast(e) {\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => e[\"System.Collections.IEnumerator.get_Current\"](), () => e[\"System.Collections.IEnumerator.MoveNext\"](), () => {\r\n if (isDisposable(e)) {\r\n disposeSafe(e);\r\n }\r\n });\r\n}\r\n\r\nexport function Enumerator_concat(sources) {\r\n let outerOpt = void 0;\r\n let innerOpt = void 0;\r\n let started = false;\r\n let finished = false;\r\n let curr = void 0;\r\n const finish = () => {\r\n finished = true;\r\n if (innerOpt != null) {\r\n const inner = innerOpt;\r\n try {\r\n disposeSafe(inner);\r\n }\r\n finally {\r\n innerOpt = (void 0);\r\n }\r\n }\r\n if (outerOpt != null) {\r\n const outer = outerOpt;\r\n try {\r\n disposeSafe(outer);\r\n }\r\n finally {\r\n outerOpt = (void 0);\r\n }\r\n }\r\n };\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => {\r\n if (!started) {\r\n Enumerator_notStarted();\r\n }\r\n else if (finished) {\r\n Enumerator_alreadyFinished();\r\n }\r\n if (curr != null) {\r\n return value_1(curr);\r\n }\r\n else {\r\n return Enumerator_alreadyFinished();\r\n }\r\n }, () => {\r\n let copyOfStruct;\r\n if (!started) {\r\n started = true;\r\n }\r\n if (finished) {\r\n return false;\r\n }\r\n else {\r\n let res = void 0;\r\n while (res == null) {\r\n const matchValue = [outerOpt, innerOpt];\r\n if (matchValue[0] != null) {\r\n if (matchValue[1] != null) {\r\n const inner_1 = matchValue[1];\r\n if (inner_1[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n curr = some(inner_1[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n res = true;\r\n }\r\n else {\r\n try {\r\n disposeSafe(inner_1);\r\n }\r\n finally {\r\n innerOpt = (void 0);\r\n }\r\n }\r\n }\r\n else {\r\n const outer_1 = matchValue[0];\r\n if (outer_1[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const ie = outer_1[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n innerOpt = ((copyOfStruct = ie, getEnumerator(copyOfStruct)));\r\n }\r\n else {\r\n finish();\r\n res = false;\r\n }\r\n }\r\n }\r\n else {\r\n outerOpt = getEnumerator(sources);\r\n }\r\n }\r\n return value_1(res);\r\n }\r\n }, () => {\r\n if (!finished) {\r\n finish();\r\n }\r\n });\r\n}\r\n\r\nexport function Enumerator_enumerateThenFinally(f, e) {\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => e[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), () => e[\"System.Collections.IEnumerator.MoveNext\"](), () => {\r\n try {\r\n disposeSafe(e);\r\n }\r\n finally {\r\n f();\r\n }\r\n });\r\n}\r\n\r\nexport function Enumerator_generateWhileSome(openf, compute, closef) {\r\n let started = false;\r\n let curr = void 0;\r\n let state = some(openf());\r\n const dispose = () => {\r\n if (state != null) {\r\n const x_1 = value_1(state);\r\n try {\r\n closef(x_1);\r\n }\r\n finally {\r\n state = (void 0);\r\n }\r\n }\r\n };\r\n const finish = () => {\r\n try {\r\n dispose();\r\n }\r\n finally {\r\n curr = (void 0);\r\n }\r\n };\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => {\r\n if (!started) {\r\n Enumerator_notStarted();\r\n }\r\n if (curr != null) {\r\n return value_1(curr);\r\n }\r\n else {\r\n return Enumerator_alreadyFinished();\r\n }\r\n }, () => {\r\n if (!started) {\r\n started = true;\r\n }\r\n if (state != null) {\r\n const s = value_1(state);\r\n let matchValue_1;\r\n try {\r\n matchValue_1 = compute(s);\r\n }\r\n catch (matchValue) {\r\n finish();\r\n throw matchValue;\r\n }\r\n if (matchValue_1 != null) {\r\n curr = matchValue_1;\r\n return true;\r\n }\r\n else {\r\n finish();\r\n return false;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }, dispose);\r\n}\r\n\r\nexport function Enumerator_unfold(f, state) {\r\n let curr = void 0;\r\n let acc = state;\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => {\r\n if (curr != null) {\r\n const x = curr[0];\r\n const st = curr[1];\r\n return x;\r\n }\r\n else {\r\n return Enumerator_notStarted();\r\n }\r\n }, () => {\r\n curr = f(acc);\r\n if (curr != null) {\r\n const x_1 = curr[0];\r\n const st_1 = curr[1];\r\n acc = st_1;\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }, () => {\r\n });\r\n}\r\n\r\nexport function indexNotFound() {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n}\r\n\r\nexport function checkNonNull(argName, arg) {\r\n if (arg == null) {\r\n Operators_NullArg(argName);\r\n }\r\n}\r\n\r\nexport function mkSeq(f) {\r\n return Enumerator_Seq_$ctor_673A07F2(f);\r\n}\r\n\r\nexport function ofSeq(xs) {\r\n checkNonNull(\"source\", xs);\r\n return getEnumerator(xs);\r\n}\r\n\r\nexport function delay(generator) {\r\n return mkSeq(() => getEnumerator(generator()));\r\n}\r\n\r\nexport function concat(sources) {\r\n return mkSeq(() => Enumerator_concat(sources));\r\n}\r\n\r\nexport function unfold(generator, state) {\r\n return mkSeq(() => Enumerator_unfold(generator, state));\r\n}\r\n\r\nexport function empty() {\r\n return delay(() => (new Array(0)));\r\n}\r\n\r\nexport function singleton(x) {\r\n return delay(() => singleton_1(x));\r\n}\r\n\r\nexport function ofArray(arr) {\r\n return arr;\r\n}\r\n\r\nexport function toArray(xs) {\r\n if (xs instanceof FSharpList) {\r\n return toArray_1(xs);\r\n }\r\n else {\r\n return Array.from(xs);\r\n }\r\n}\r\n\r\nexport function ofList(xs) {\r\n return xs;\r\n}\r\n\r\nexport function toList(xs) {\r\n if (isArrayLike(xs)) {\r\n return ofArray_1(xs);\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return xs;\r\n }\r\n else {\r\n return ofSeq_1(xs);\r\n }\r\n}\r\n\r\nexport function generate(create, compute, dispose) {\r\n return mkSeq(() => Enumerator_generateWhileSome(create, compute, dispose));\r\n}\r\n\r\nexport function generateIndexed(create, compute, dispose) {\r\n return mkSeq(() => {\r\n let i = -1;\r\n return Enumerator_generateWhileSome(create, (x) => {\r\n i = ((i + 1) | 0);\r\n return compute(i, x);\r\n }, dispose);\r\n });\r\n}\r\n\r\nexport function append(xs, ys) {\r\n return concat([xs, ys]);\r\n}\r\n\r\nexport function cast(xs) {\r\n return mkSeq(() => {\r\n checkNonNull(\"source\", xs);\r\n return Enumerator_cast(getEnumerator(xs));\r\n });\r\n}\r\n\r\nexport function choose(chooser, xs) {\r\n return generate(() => ofSeq(xs), (e) => {\r\n let curr = void 0;\r\n while ((curr == null) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n curr = chooser(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return curr;\r\n }, (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function compareWith(comparer, xs, ys) {\r\n const e1 = ofSeq(xs);\r\n try {\r\n const e2 = ofSeq(ys);\r\n try {\r\n let c = 0;\r\n let b1 = e1[\"System.Collections.IEnumerator.MoveNext\"]();\r\n let b2 = e2[\"System.Collections.IEnumerator.MoveNext\"]();\r\n while (((c === 0) && b1) && b2) {\r\n c = (comparer(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) | 0);\r\n if (c === 0) {\r\n b1 = e1[\"System.Collections.IEnumerator.MoveNext\"]();\r\n b2 = e2[\"System.Collections.IEnumerator.MoveNext\"]();\r\n }\r\n }\r\n return ((c !== 0) ? c : (b1 ? 1 : (b2 ? -1 : 0))) | 0;\r\n }\r\n finally {\r\n disposeSafe(e2);\r\n }\r\n }\r\n finally {\r\n disposeSafe(e1);\r\n }\r\n}\r\n\r\nexport function contains(value, xs, comparer) {\r\n const e = ofSeq(xs);\r\n try {\r\n let found = false;\r\n while ((!found) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n found = comparer.Equals(value, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return found;\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function enumerateFromFunctions(create, moveNext, current) {\r\n return generate(create, (x) => (moveNext(x) ? some(current(x)) : (void 0)), (x_1) => {\r\n const matchValue = x_1;\r\n if (isDisposable(matchValue)) {\r\n disposeSafe(matchValue);\r\n }\r\n });\r\n}\r\n\r\nexport function enumerateThenFinally(source, compensation) {\r\n const compensation_1 = compensation;\r\n return mkSeq(() => {\r\n try {\r\n return Enumerator_enumerateThenFinally(compensation_1, ofSeq(source));\r\n }\r\n catch (matchValue) {\r\n compensation_1();\r\n throw matchValue;\r\n }\r\n });\r\n}\r\n\r\nexport function enumerateUsing(resource, source) {\r\n const compensation = () => {\r\n if (equals(resource, null)) {\r\n }\r\n else {\r\n let copyOfStruct = resource;\r\n disposeSafe(copyOfStruct);\r\n }\r\n };\r\n return mkSeq(() => {\r\n try {\r\n return Enumerator_enumerateThenFinally(compensation, ofSeq(source(resource)));\r\n }\r\n catch (matchValue_1) {\r\n compensation();\r\n throw matchValue_1;\r\n }\r\n });\r\n}\r\n\r\nexport function enumerateWhile(guard, xs) {\r\n return concat(unfold((i) => (guard() ? [xs, i + 1] : (void 0)), 0));\r\n}\r\n\r\nexport function filter(f, xs) {\r\n return choose((x) => {\r\n if (f(x)) {\r\n return some(x);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, xs);\r\n}\r\n\r\nexport function exists(predicate, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n let found = false;\r\n while ((!found) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n found = predicate(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return found;\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function exists2(predicate, xs, ys) {\r\n const e1 = ofSeq(xs);\r\n try {\r\n const e2 = ofSeq(ys);\r\n try {\r\n let found = false;\r\n while (((!found) && e1[\"System.Collections.IEnumerator.MoveNext\"]()) && e2[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n found = predicate(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return found;\r\n }\r\n finally {\r\n disposeSafe(e2);\r\n }\r\n }\r\n finally {\r\n disposeSafe(e1);\r\n }\r\n}\r\n\r\nexport function exactlyOne(xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const v = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n throw (new Error((SR_inputSequenceTooLong + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return v;\r\n }\r\n }\r\n else {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function tryExactlyOne(xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const v = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? (void 0) : some(v);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function tryFind(predicate, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n let res = void 0;\r\n while ((res == null) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const c = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n if (predicate(c)) {\r\n res = some(c);\r\n }\r\n }\r\n return res;\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function find(predicate, xs) {\r\n const matchValue = tryFind(predicate, xs);\r\n if (matchValue == null) {\r\n return indexNotFound();\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFindBack(predicate, xs) {\r\n return tryFindBack_1(predicate, toArray(xs));\r\n}\r\n\r\nexport function findBack(predicate, xs) {\r\n const matchValue = tryFindBack(predicate, xs);\r\n if (matchValue == null) {\r\n return indexNotFound();\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFindIndex(predicate, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n if (predicate(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) {\r\n return i;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n continue loop;\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0);\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function findIndex(predicate, xs) {\r\n const matchValue = tryFindIndex(predicate, xs);\r\n if (matchValue == null) {\r\n return indexNotFound() | 0;\r\n }\r\n else {\r\n return matchValue | 0;\r\n }\r\n}\r\n\r\nexport function tryFindIndexBack(predicate, xs) {\r\n return tryFindIndexBack_1(predicate, toArray(xs));\r\n}\r\n\r\nexport function findIndexBack(predicate, xs) {\r\n const matchValue = tryFindIndexBack(predicate, xs);\r\n if (matchValue == null) {\r\n return indexNotFound() | 0;\r\n }\r\n else {\r\n return matchValue | 0;\r\n }\r\n}\r\n\r\nexport function fold(folder, state, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n let acc = state;\r\n while (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n acc = folder(acc, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return acc;\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function foldBack(folder, xs, state) {\r\n return foldBack_1(folder, toArray(xs), state);\r\n}\r\n\r\nexport function fold2(folder, state, xs, ys) {\r\n const e1 = ofSeq(xs);\r\n try {\r\n const e2 = ofSeq(ys);\r\n try {\r\n let acc = state;\r\n while (e1[\"System.Collections.IEnumerator.MoveNext\"]() && e2[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n acc = folder(acc, e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return acc;\r\n }\r\n finally {\r\n disposeSafe(e2);\r\n }\r\n }\r\n finally {\r\n disposeSafe(e1);\r\n }\r\n}\r\n\r\nexport function foldBack2(folder, xs, ys, state) {\r\n return foldBack2_1(folder, toArray(xs), toArray(ys), state);\r\n}\r\n\r\nexport function forAll(predicate, xs) {\r\n return !exists((x) => (!predicate(x)), xs);\r\n}\r\n\r\nexport function forAll2(predicate, xs, ys) {\r\n return !exists2((x, y) => (!predicate(x, y)), xs, ys);\r\n}\r\n\r\nexport function tryHead(xs) {\r\n if (isArrayLike(xs)) {\r\n return tryHead_1(xs);\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return tryHead_2(xs);\r\n }\r\n else {\r\n const e = ofSeq(xs);\r\n try {\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0);\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n }\r\n}\r\n\r\nexport function head(xs) {\r\n const matchValue = tryHead(xs);\r\n if (matchValue == null) {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function initialize(count, f) {\r\n return unfold((i) => ((i < count) ? [f(i), i + 1] : (void 0)), 0);\r\n}\r\n\r\nexport function initializeInfinite(f) {\r\n return initialize(2147483647, f);\r\n}\r\n\r\nexport function isEmpty(xs) {\r\n if (isArrayLike(xs)) {\r\n return xs.length === 0;\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return isEmpty_1(xs);\r\n }\r\n else {\r\n const e = ofSeq(xs);\r\n try {\r\n return !e[\"System.Collections.IEnumerator.MoveNext\"]();\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n }\r\n}\r\n\r\nexport function tryItem(index, xs) {\r\n if (isArrayLike(xs)) {\r\n return tryItem_1(index, xs);\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return tryItem_2(index, xs);\r\n }\r\n else {\r\n const e = ofSeq(xs);\r\n try {\r\n const loop = (index_1_mut) => {\r\n loop:\r\n while (true) {\r\n const index_1 = index_1_mut;\r\n if (!e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return void 0;\r\n }\r\n else if (index_1 === 0) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n index_1_mut = (index_1 - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(index);\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n }\r\n}\r\n\r\nexport function item(index, xs) {\r\n const matchValue = tryItem(index, xs);\r\n if (matchValue == null) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function iterate(action, xs) {\r\n fold((unitVar, x) => {\r\n action(x);\r\n }, void 0, xs);\r\n}\r\n\r\nexport function iterate2(action, xs, ys) {\r\n fold2((unitVar, x, y) => {\r\n action(x, y);\r\n }, void 0, xs, ys);\r\n}\r\n\r\nexport function iterateIndexed(action, xs) {\r\n fold((i, x) => {\r\n action(i, x);\r\n return (i + 1) | 0;\r\n }, 0, xs);\r\n}\r\n\r\nexport function iterateIndexed2(action, xs, ys) {\r\n fold2((i, x, y) => {\r\n action(i, x, y);\r\n return (i + 1) | 0;\r\n }, 0, xs, ys);\r\n}\r\n\r\nexport function tryLast(xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n const loop = (acc_mut) => {\r\n loop:\r\n while (true) {\r\n const acc = acc_mut;\r\n if (!e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return acc;\r\n }\r\n else {\r\n acc_mut = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(loop(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0);\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function last(xs) {\r\n const matchValue = tryLast(xs);\r\n if (matchValue == null) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function length(xs) {\r\n if (isArrayLike(xs)) {\r\n return xs.length | 0;\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return length_1(xs) | 0;\r\n }\r\n else {\r\n const e = ofSeq(xs);\r\n try {\r\n let count = 0;\r\n while (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n count = ((count + 1) | 0);\r\n }\r\n return count | 0;\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n }\r\n}\r\n\r\nexport function map(mapping, xs) {\r\n return generate(() => ofSeq(xs), (e) => (e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(mapping(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0)), (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function mapIndexed(mapping, xs) {\r\n return generateIndexed(() => ofSeq(xs), (i, e) => (e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(mapping(i, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0)), (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function indexed(xs) {\r\n return mapIndexed((i, x) => [i, x], xs);\r\n}\r\n\r\nexport function map2(mapping, xs, ys) {\r\n return generate(() => [ofSeq(xs), ofSeq(ys)], (tupledArg) => {\r\n const e1 = tupledArg[0];\r\n const e2 = tupledArg[1];\r\n return (e1[\"System.Collections.IEnumerator.MoveNext\"]() && e2[\"System.Collections.IEnumerator.MoveNext\"]()) ? some(mapping(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0);\r\n }, (tupledArg_1) => {\r\n try {\r\n disposeSafe(tupledArg_1[0]);\r\n }\r\n finally {\r\n disposeSafe(tupledArg_1[1]);\r\n }\r\n });\r\n}\r\n\r\nexport function mapIndexed2(mapping, xs, ys) {\r\n return generateIndexed(() => [ofSeq(xs), ofSeq(ys)], (i, tupledArg) => {\r\n const e1 = tupledArg[0];\r\n const e2 = tupledArg[1];\r\n return (e1[\"System.Collections.IEnumerator.MoveNext\"]() && e2[\"System.Collections.IEnumerator.MoveNext\"]()) ? some(mapping(i, e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0);\r\n }, (tupledArg_1) => {\r\n try {\r\n disposeSafe(tupledArg_1[0]);\r\n }\r\n finally {\r\n disposeSafe(tupledArg_1[1]);\r\n }\r\n });\r\n}\r\n\r\nexport function map3(mapping, xs, ys, zs) {\r\n return generate(() => [ofSeq(xs), ofSeq(ys), ofSeq(zs)], (tupledArg) => {\r\n const e1 = tupledArg[0];\r\n const e2 = tupledArg[1];\r\n const e3 = tupledArg[2];\r\n return ((e1[\"System.Collections.IEnumerator.MoveNext\"]() && e2[\"System.Collections.IEnumerator.MoveNext\"]()) && e3[\"System.Collections.IEnumerator.MoveNext\"]()) ? some(mapping(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e3[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0);\r\n }, (tupledArg_1) => {\r\n try {\r\n disposeSafe(tupledArg_1[0]);\r\n }\r\n finally {\r\n try {\r\n disposeSafe(tupledArg_1[1]);\r\n }\r\n finally {\r\n disposeSafe(tupledArg_1[2]);\r\n }\r\n }\r\n });\r\n}\r\n\r\nexport function readOnly(xs) {\r\n checkNonNull(\"source\", xs);\r\n return map((x) => x, xs);\r\n}\r\n\r\nexport class CachedSeq$1 {\r\n constructor(cleanup, res) {\r\n this.cleanup = cleanup;\r\n this.res = res;\r\n }\r\n Dispose() {\r\n const _ = this;\r\n _.cleanup();\r\n }\r\n GetEnumerator() {\r\n const _ = this;\r\n return getEnumerator(_.res);\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const _ = this;\r\n return getEnumerator(_.res);\r\n }\r\n}\r\n\r\nexport function CachedSeq$1$reflection(gen0) {\r\n return class_type(\"SeqModule.CachedSeq`1\", [gen0], CachedSeq$1);\r\n}\r\n\r\nexport function CachedSeq$1_$ctor_Z7A8347D4(cleanup, res) {\r\n return new CachedSeq$1(cleanup, res);\r\n}\r\n\r\nexport function CachedSeq$1__Clear(_) {\r\n _.cleanup();\r\n}\r\n\r\nexport function cache(source) {\r\n checkNonNull(\"source\", source);\r\n const prefix = [];\r\n let enumeratorR = void 0;\r\n return CachedSeq$1_$ctor_Z7A8347D4(() => {\r\n Operators_Lock(prefix, () => {\r\n clear(prefix);\r\n let pattern_matching_result, e;\r\n if (enumeratorR != null) {\r\n if (value_1(enumeratorR) != null) {\r\n pattern_matching_result = 0;\r\n e = value_1(enumeratorR);\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n disposeSafe(e);\r\n break;\r\n }\r\n }\r\n enumeratorR = (void 0);\r\n });\r\n }, unfold((i_1) => Operators_Lock(prefix, () => {\r\n if (i_1 < prefix.length) {\r\n return [prefix[i_1], i_1 + 1];\r\n }\r\n else {\r\n if (i_1 >= prefix.length) {\r\n let optEnumerator_2;\r\n if (enumeratorR != null) {\r\n optEnumerator_2 = value_1(enumeratorR);\r\n }\r\n else {\r\n const optEnumerator = getEnumerator(source);\r\n enumeratorR = some(optEnumerator);\r\n optEnumerator_2 = optEnumerator;\r\n }\r\n if (optEnumerator_2 == null) {\r\n }\r\n else {\r\n const enumerator = optEnumerator_2;\r\n if (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n void (prefix.push(enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()));\r\n }\r\n else {\r\n disposeSafe(enumerator);\r\n enumeratorR = some(void 0);\r\n }\r\n }\r\n }\r\n return (i_1 < prefix.length) ? [prefix[i_1], i_1 + 1] : (void 0);\r\n }\r\n }), 0));\r\n}\r\n\r\nexport function allPairs(xs, ys) {\r\n const ysCache = cache(ys);\r\n return delay(() => concat(map((x) => map((y) => [x, y], ysCache), xs)));\r\n}\r\n\r\nexport function mapFold(mapping, state, xs) {\r\n const patternInput = mapFold_1(mapping, state, toArray(xs));\r\n return [readOnly(patternInput[0]), patternInput[1]];\r\n}\r\n\r\nexport function mapFoldBack(mapping, xs, state) {\r\n const patternInput = mapFoldBack_1(mapping, toArray(xs), state);\r\n return [readOnly(patternInput[0]), patternInput[1]];\r\n}\r\n\r\nexport function tryPick(chooser, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n let res = void 0;\r\n while ((res == null) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n res = chooser(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return res;\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function pick(chooser, xs) {\r\n const matchValue = tryPick(chooser, xs);\r\n if (matchValue == null) {\r\n return indexNotFound();\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function reduce(folder, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n const loop = (acc_mut) => {\r\n loop:\r\n while (true) {\r\n const acc = acc_mut;\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n acc_mut = folder(acc, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n continue loop;\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n };\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return loop(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n throw (new Error(SR_inputSequenceEmpty));\r\n }\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function reduceBack(folder, xs) {\r\n const arr = toArray(xs);\r\n if (arr.length > 0) {\r\n return arr.reduceRight(folder);\r\n }\r\n else {\r\n throw (new Error(SR_inputSequenceEmpty));\r\n }\r\n}\r\n\r\nexport function replicate(n, x) {\r\n return initialize(n, (_arg) => x);\r\n}\r\n\r\nexport function reverse(xs) {\r\n return delay(() => ofArray(reverse_1(toArray(xs))));\r\n}\r\n\r\nexport function scan(folder, state, xs) {\r\n return delay(() => {\r\n let acc = state;\r\n return concat([singleton(state), map((x) => {\r\n acc = folder(acc, x);\r\n return acc;\r\n }, xs)]);\r\n });\r\n}\r\n\r\nexport function scanBack(folder, xs, state) {\r\n return delay(() => ofArray(scanBack_1(folder, toArray(xs), state)));\r\n}\r\n\r\nexport function skip(count, source) {\r\n return mkSeq(() => {\r\n const e = ofSeq(source);\r\n try {\r\n for (let _ = 1; _ <= count; _++) {\r\n if (!e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n }\r\n return Enumerator_enumerateThenFinally(() => {\r\n }, e);\r\n }\r\n catch (matchValue) {\r\n disposeSafe(e);\r\n throw matchValue;\r\n }\r\n });\r\n}\r\n\r\nexport function skipWhile(predicate, xs) {\r\n return delay(() => {\r\n let skipped = true;\r\n return filter((x) => {\r\n if (skipped) {\r\n skipped = predicate(x);\r\n }\r\n return !skipped;\r\n }, xs);\r\n });\r\n}\r\n\r\nexport function tail(xs) {\r\n return skip(1, xs);\r\n}\r\n\r\nexport function take(count, xs) {\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if (i < count) {\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function takeWhile(predicate, xs) {\r\n return generate(() => ofSeq(xs), (e) => ((e[\"System.Collections.IEnumerator.MoveNext\"]() && predicate(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0)), (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function truncate(count, xs) {\r\n return generateIndexed(() => ofSeq(xs), (i, e) => (((i < count) && e[\"System.Collections.IEnumerator.MoveNext\"]()) ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0)), (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function zip(xs, ys) {\r\n return map2((x, y) => [x, y], xs, ys);\r\n}\r\n\r\nexport function zip3(xs, ys, zs) {\r\n return map3((x, y, z) => [x, y, z], xs, ys, zs);\r\n}\r\n\r\nexport function collect(mapping, xs) {\r\n return delay(() => concat(map(mapping, xs)));\r\n}\r\n\r\nexport function where(predicate, xs) {\r\n return filter(predicate, xs);\r\n}\r\n\r\nexport function pairwise(xs) {\r\n return delay(() => ofArray(pairwise_1(toArray(xs))));\r\n}\r\n\r\nexport function splitInto(chunks, xs) {\r\n return delay(() => ofArray(map_1(ofArray, splitInto_1(chunks, toArray(xs)))));\r\n}\r\n\r\nexport function windowed(windowSize, xs) {\r\n return delay(() => ofArray(map_1(ofArray, windowed_1(windowSize, toArray(xs)))));\r\n}\r\n\r\nexport function transpose(xss) {\r\n return delay(() => ofArray(map_1(ofArray, transpose_1(map_1(toArray, toArray(xss))))));\r\n}\r\n\r\nexport function sortWith(comparer, xs) {\r\n return delay(() => {\r\n const arr = toArray(xs);\r\n arr.sort(comparer);\r\n return ofArray(arr);\r\n });\r\n}\r\n\r\nexport function sort(xs, comparer) {\r\n return sortWith((x, y) => comparer.Compare(x, y), xs);\r\n}\r\n\r\nexport function sortBy(projection, xs, comparer) {\r\n return sortWith((x, y) => comparer.Compare(projection(x), projection(y)), xs);\r\n}\r\n\r\nexport function sortDescending(xs, comparer) {\r\n return sortWith((x, y) => (comparer.Compare(x, y) * -1), xs);\r\n}\r\n\r\nexport function sortByDescending(projection, xs, comparer) {\r\n return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) * -1), xs);\r\n}\r\n\r\nexport function sum(xs, adder) {\r\n return fold((acc, x) => adder.Add(acc, x), adder.GetZero(), xs);\r\n}\r\n\r\nexport function sumBy(f, xs, adder) {\r\n return fold((acc, x) => adder.Add(acc, f(x)), adder.GetZero(), xs);\r\n}\r\n\r\nexport function maxBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function max(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function minBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function min(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function average(xs, averager) {\r\n let count = 0;\r\n const total = fold((acc, x) => {\r\n count = ((count + 1) | 0);\r\n return averager.Add(acc, x);\r\n }, averager.GetZero(), xs);\r\n if (count === 0) {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return averager.DivideByInt(total, count);\r\n }\r\n}\r\n\r\nexport function averageBy(f, xs, averager) {\r\n let count = 0;\r\n const total = fold((acc, x) => {\r\n count = ((count + 1) | 0);\r\n return averager.Add(acc, f(x));\r\n }, averager.GetZero(), xs);\r\n if (count === 0) {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return averager.DivideByInt(total, count);\r\n }\r\n}\r\n\r\nexport function permute(f, xs) {\r\n return delay(() => ofArray(permute_1(f, toArray(xs))));\r\n}\r\n\r\nexport function chunkBySize(chunkSize, xs) {\r\n return delay(() => ofArray(map_1(ofArray, chunkBySize_1(chunkSize, toArray(xs)))));\r\n}\r\n\r\nexport function insertAt(index, y, xs) {\r\n let isDone = false;\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if ((isDone ? true : (i < index)) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else if (i === index) {\r\n isDone = true;\r\n return some(y);\r\n }\r\n else {\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return void 0;\r\n }\r\n }, (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function insertManyAt(index, ys, xs) {\r\n let status = -1;\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => [ofSeq(xs), ofSeq(ys)], (i, tupledArg) => {\r\n const e1 = tupledArg[0];\r\n const e2 = tupledArg[1];\r\n if (i === index) {\r\n status = 0;\r\n }\r\n let inserted;\r\n if (status === 0) {\r\n if (e2[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n inserted = some(e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n status = 1;\r\n inserted = (void 0);\r\n }\r\n }\r\n else {\r\n inserted = (void 0);\r\n }\r\n if (inserted == null) {\r\n if (e1[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n if (status < 1) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return void 0;\r\n }\r\n }\r\n else {\r\n return some(value_1(inserted));\r\n }\r\n }, (tupledArg_1) => {\r\n disposeSafe(tupledArg_1[0]);\r\n disposeSafe(tupledArg_1[1]);\r\n });\r\n}\r\n\r\nexport function removeAt(index, xs) {\r\n let isDone = false;\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if ((isDone ? true : (i < index)) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else if ((i === index) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n isDone = true;\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0);\r\n }\r\n else {\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return void 0;\r\n }\r\n }, (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function removeManyAt(index, count, xs) {\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if (i < index) {\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n }\r\n else {\r\n if (i === index) {\r\n for (let _ = 1; _ <= count; _++) {\r\n if (!e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"count\"));\r\n }\r\n }\r\n }\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0);\r\n }\r\n }, (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function updateAt(index, y, xs) {\r\n let isDone = false;\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if ((isDone ? true : (i < index)) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else if ((i === index) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n isDone = true;\r\n return some(y);\r\n }\r\n else {\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return void 0;\r\n }\r\n }, (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\n","import { compare } from \"./Util.js\";\r\nimport { unfold, delay } from \"./Seq.js\";\r\nimport { op_Addition, fromZero } from \"./BigInt.js\";\r\nimport { op_Addition as op_Addition_1, fromParts } from \"./Decimal.js\";\r\nimport { op_Addition as op_Addition_2, fromBits } from \"./Long.js\";\r\n\r\nexport function makeRangeStepFunction(step, stop, zero, add) {\r\n const stepComparedWithZero = compare(step, zero) | 0;\r\n if (stepComparedWithZero === 0) {\r\n throw (new Error(\"The step of a range cannot be zero\"));\r\n }\r\n const stepGreaterThanZero = stepComparedWithZero > 0;\r\n return (x) => {\r\n const comparedWithLast = compare(x, stop) | 0;\r\n return ((stepGreaterThanZero && (comparedWithLast <= 0)) ? true : ((!stepGreaterThanZero) && (comparedWithLast >= 0))) ? [x, add(x, step)] : (void 0);\r\n };\r\n}\r\n\r\nexport function integralRangeStep(start, step, stop, zero, add) {\r\n const stepFn = makeRangeStepFunction(step, stop, zero, add);\r\n return delay(() => unfold(stepFn, start));\r\n}\r\n\r\nexport function rangeBigInt(start, step, stop) {\r\n return integralRangeStep(start, step, stop, fromZero(), op_Addition);\r\n}\r\n\r\nexport function rangeDecimal(start, step, stop) {\r\n return integralRangeStep(start, step, stop, fromParts(0, 0, 0, false, 0), op_Addition_1);\r\n}\r\n\r\nexport function rangeDouble(start, step, stop) {\r\n return integralRangeStep(start, step, stop, 0, (x, y) => (x + y));\r\n}\r\n\r\nexport function rangeInt64(start, step, stop) {\r\n return integralRangeStep(start, step, stop, fromBits(0, 0, false), op_Addition_2);\r\n}\r\n\r\nexport function rangeUInt64(start, step, stop) {\r\n return integralRangeStep(start, step, stop, fromBits(0, 0, true), op_Addition_2);\r\n}\r\n\r\nexport function rangeChar(start, stop) {\r\n const intStop = stop.charCodeAt(0) | 0;\r\n return delay(() => unfold((c) => {\r\n if (c <= intStop) {\r\n return [String.fromCharCode(c), c + 1];\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, start.charCodeAt(0)));\r\n}\r\n\r\n","namespace Elmish\nopen System\n\n[]\ntype internal RingState<'item> =\n | Writable of wx:'item array * ix:int\n | ReadWritable of rw:'item array * wix:int * rix:int\n\ntype internal RingBuffer<'item>(size) =\n let doubleSize ix (items: 'item array) =\n seq { yield! items |> Seq.skip ix\n yield! items |> Seq.take ix\n for _ in 0..items.Length do\n yield Unchecked.defaultof<'item> }\n |> Array.ofSeq\n\n let mutable state : 'item RingState =\n Writable (Array.zeroCreate (max size 10), 0)\n\n member __.Pop() =\n match state with\n | ReadWritable (items, wix, rix) ->\n let rix' = (rix + 1) % items.Length\n match rix' = wix with\n | true -> \n state <- Writable(items, wix)\n | _ ->\n state <- ReadWritable(items, wix, rix')\n Some items.[rix]\n | _ ->\n None\n\n member __.Push (item:'item) =\n match state with\n | Writable (items, ix) ->\n items.[ix] <- item\n let wix = (ix + 1) % items.Length\n state <- ReadWritable(items, wix, ix)\n | ReadWritable (items, wix, rix) ->\n items.[wix] <- item\n let wix' = (wix + 1) % items.Length\n match wix' = rix with\n | true -> \n state <- ReadWritable(items |> doubleSize rix, items.Length, 0)\n | _ -> \n state <- ReadWritable(items, wix', rix)","(**\nProgram\n---------\nCore abstractions for creating and running the dispatch loop.\n\n*)\n\nnamespace Elmish\n\n\n/// Program type captures various aspects of program behavior\ntype Program<'arg, 'model, 'msg, 'view> = private {\n init : 'arg -> 'model * Cmd<'msg>\n update : 'msg -> 'model -> 'model * Cmd<'msg>\n subscribe : 'model -> Cmd<'msg>\n view : 'model -> Dispatch<'msg> -> 'view\n setState : 'model -> Dispatch<'msg> -> unit\n onError : (string*exn) -> unit\n syncDispatch: Dispatch<'msg> -> Dispatch<'msg>\n}\n\n/// Program module - functions to manipulate program instances\n[]\n[]\nmodule Program =\n /// Typical program, new commands are produced by `init` and `update` along with the new state.\n let mkProgram \n (init : 'arg -> 'model * Cmd<'msg>) \n (update : 'msg -> 'model -> 'model * Cmd<'msg>)\n (view : 'model -> Dispatch<'msg> -> 'view) =\n { init = init\n update = update\n view = view\n setState = fun model -> view model >> ignore\n subscribe = fun _ -> Cmd.none\n onError = Log.onError\n syncDispatch = id }\n\n /// Simple program that produces only new state with `init` and `update`.\n let mkSimple \n (init : 'arg -> 'model) \n (update : 'msg -> 'model -> 'model)\n (view : 'model -> Dispatch<'msg> -> 'view) =\n { init = init >> fun state -> state,Cmd.none\n update = fun msg -> update msg >> fun state -> state,Cmd.none\n view = view\n setState = fun model -> view model >> ignore\n subscribe = fun _ -> Cmd.none\n onError = Log.onError\n syncDispatch = id }\n\n /// Subscribe to external source of events.\n /// The subscription is called once - with the initial model, but can dispatch new messages at any time.\n let withSubscription (subscribe : 'model -> Cmd<'msg>) (program: Program<'arg, 'model, 'msg, 'view>) =\n let sub model =\n Cmd.batch [ program.subscribe model\n subscribe model ]\n { program with subscribe = sub }\n\n /// Trace all the updates to the console\n let withConsoleTrace (program: Program<'arg, 'model, 'msg, 'view>) =\n let traceInit (arg:'arg) =\n let initModel,cmd = program.init arg\n Log.toConsole (\"Initial state:\", initModel)\n initModel,cmd\n\n let traceUpdate msg model =\n Log.toConsole (\"New message:\", msg)\n let newModel,cmd = program.update msg model\n Log.toConsole (\"Updated state:\", newModel)\n newModel,cmd\n\n { program with\n init = traceInit \n update = traceUpdate }\n\n /// Trace all the messages as they update the model\n let withTrace trace (program: Program<'arg, 'model, 'msg, 'view>) =\n let update msg model =\n let state,cmd = program.update msg model\n trace msg state\n state,cmd\n { program\n with update = update }\n\n /// Handle dispatch loop exceptions\n let withErrorHandler onError (program: Program<'arg, 'model, 'msg, 'view>) =\n { program\n with onError = onError }\n\n /// For library authors only: map existing error handler and return new `Program` \n let mapErrorHandler map (program: Program<'arg, 'model, 'msg, 'view>) =\n { program\n with onError = map program.onError }\n\n /// For library authors only: get the current error handler \n let onError (program: Program<'arg, 'model, 'msg, 'view>) =\n program.onError\n\n /// For library authors only: function to render the view with the latest state \n let withSetState (setState:'model -> Dispatch<'msg> -> unit)\n (program: Program<'arg, 'model, 'msg, 'view>) = \n { program\n with setState = setState }\n\n /// For library authors only: return the function to render the state \n let setState (program: Program<'arg, 'model, 'msg, 'view>) = \n program.setState\n\n /// For library authors only: return the view function \n let view (program: Program<'arg, 'model, 'msg, 'view>) = \n program.view\n\n /// For library authors only: function to synchronize the dispatch function\n let withSyncDispatch (syncDispatch:Dispatch<'msg> -> Dispatch<'msg>)\n (program: Program<'arg, 'model, 'msg, 'view>) = \n { program\n with syncDispatch = syncDispatch }\n\n /// For library authors only: map the program type\n let map mapInit mapUpdate mapView mapSetState mapSubscribe\n (program: Program<'arg, 'model, 'msg, 'view>) =\n { init = mapInit program.init\n update = mapUpdate program.update\n view = mapView program.view\n setState = mapSetState program.setState\n subscribe = mapSubscribe program.subscribe\n onError = program.onError\n syncDispatch = id }\n\n /// Start the program loop.\n /// arg: argument to pass to the init() function.\n /// program: program created with 'mkSimple' or 'mkProgram'.\n let runWith (arg: 'arg) (program: Program<'arg, 'model, 'msg, 'view>) =\n let (model,cmd) = program.init arg\n let rb = RingBuffer 10\n let mutable reentered = false\n let mutable state = model \n let rec dispatch msg = \n if reentered then\n rb.Push msg\n else\n reentered <- true\n let mutable nextMsg = Some msg\n while Option.isSome nextMsg do\n let msg = nextMsg.Value\n try\n let (model',cmd') = program.update msg state\n program.setState model' syncDispatch\n cmd' |> Cmd.exec (fun ex -> program.onError (sprintf \"Error in command while handling: %A\" msg, ex)) syncDispatch\n state <- model'\n with ex ->\n program.onError (sprintf \"Unable to process the message: %A\" msg, ex)\n nextMsg <- rb.Pop()\n reentered <- false\n and syncDispatch = program.syncDispatch dispatch \n\n program.setState model syncDispatch\n let sub = \n try \n program.subscribe model \n with ex ->\n program.onError (\"Unable to subscribe:\", ex)\n Cmd.none\n Cmd.batch [sub; cmd]\n |> Cmd.exec (fun ex -> program.onError (\"Error intitializing:\", ex)) syncDispatch\n\n /// Start the dispatch loop with `unit` for the init() function.\n let run (program: Program) = runWith () program\n","namespace Elmish.React\n\nopen Fable.React\nopen Elmish\n\ntype LazyProps<'model> = {\n model:'model\n render:unit->ReactElement\n equal:'model->'model->bool\n}\n\nmodule Components =\n type LazyView<'model>(props) =\n inherit Component,obj>(props)\n\n override this.shouldComponentUpdate(nextProps, _nextState) =\n not <| this.props.equal this.props.model nextProps.model\n\n override this.render () =\n this.props.render ()\n\n[]\nmodule Common =\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 let lazyViewWith (equal:'model->'model->bool)\n (view:'model->ReactElement)\n (state:'model) =\n ofType,_,_>\n { render = fun () -> view state\n equal = equal\n model = state }\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 let lazyView2With (equal:'model->'model->bool)\n (view:'model->'msg Dispatch->ReactElement)\n (state:'model)\n (dispatch:'msg Dispatch) =\n ofType,_,_>\n { render = fun () -> view state dispatch\n equal = equal\n model = state }\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 let lazyView3With (equal:_->_->bool) (view:_->_->_->ReactElement) state1 state2 (dispatch:'msg Dispatch) =\n ofType,_,_>\n { render = fun () -> view state1 state2 dispatch\n equal = equal\n model = (state1,state2) }\n []\n\n /// Avoid rendering the view unless the model has changed.\n /// view: function of model to render the view\n let lazyView (view:'model->ReactElement) =\n lazyViewWith (=) view\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 let lazyView2 (view:'model->'msg Dispatch->ReactElement) =\n lazyView2With (=) view\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 let lazyView3 (view:_->_->_->ReactElement) =\n lazyView3With (=) view\n\n\n","(** Custom navigation\n------\nThis port of the Elm library is about treating the address bar as an input to your program.\nIt converts changes in the address bar into messages and provides functions for manipulation of the browser history.\n*)\nnamespace Elmish.Navigation\n\nopen Browser\nopen Browser.Types\nopen Elmish\n\n(**\n#### Parser\nA function to turn the string in the address bar into data that is easier for your app to handle.\n*)\ntype Parser<'a> = Location -> 'a\n\ntype Navigable<'msg> =\n | Change of Location\n | UserMsg of 'msg\n\n(**\n#### Direct history manipulation\n*)\n[]\nmodule Navigation =\n let [] internal NavigatedEvent = \"NavigatedEvent\"\n\n /// Modify current location\n let modifyUrl (newUrl:string):Cmd<_> =\n [fun _ -> history.replaceState((), \"\", newUrl)]\n\n /// Push new location into history and navigate there\n let newUrl (newUrl:string):Cmd<_> =\n [fun _ -> history.pushState((), \"\", newUrl)\n let ev = CustomEvent.Create(NavigatedEvent)\n window.dispatchEvent ev\n |> ignore ]\n\n /// Jump to some point in history (positve=forward, nagative=backward)\n let jump (n:int):Cmd<_> =\n [fun _ -> history.go n]\n\n\n(**\n#### Program extensions\nTreat user's program as a child component, by wrapping it and handling navigation events.\n*)\n[]\n[]\nmodule Program =\n\n module Internal =\n let mutable private onChangeRef : Event -> unit =\n fun _ ->\n failwith \"`onChangeRef` has not been initialized.\\nPlease make sure you used Elmish.Navigation.Program.Internal.subscribe\"\n\n let subscribe (dispatch:Dispatch<_ Navigable>) =\n let mutable lastLocation = None\n let onChange _ =\n match lastLocation with\n | Some href when href = window.location.href -> ()\n | _ ->\n lastLocation <- Some window.location.href\n Change window.location |> dispatch\n\n onChangeRef <- onChange\n\n window.addEventListener(\"popstate\", onChangeRef)\n window.addEventListener(\"hashchange\", onChangeRef)\n window.addEventListener(Navigation.NavigatedEvent, onChangeRef)\n\n let unsubscribe () =\n window.removeEventListener(\"popstate\", onChangeRef)\n window.removeEventListener(\"hashchange\", onChangeRef)\n window.removeEventListener(Navigation.NavigatedEvent, onChangeRef)\n\n let toNavigableWith (parser : Parser<'a>)\n (urlUpdate : 'a->'model->('model * Cmd<'msg>))\n (program : Program<'a,'model,'msg,'view>)\n (onLocationChange : Dispatch> -> unit) =\n\n let map (model, cmd) =\n model, cmd |> Cmd.map UserMsg\n\n let update userUpdate msg model =\n match msg with\n | Change location ->\n urlUpdate (parser location) model\n | UserMsg userMsg ->\n userUpdate userMsg model\n |> map\n\n let subs userSubscribe model =\n Cmd.batch\n [ [ onLocationChange ]\n userSubscribe model |> Cmd.map UserMsg ]\n\n let init userInit () =\n userInit (parser window.location) |> map\n\n let setState userSetState model dispatch =\n userSetState model (UserMsg >> dispatch)\n\n let view userView model dispatch =\n userView model (UserMsg >> dispatch)\n \n program\n |> Program.map init update view setState subs\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 let toNavigable (parser : Parser<'a>)\n (urlUpdate : 'a->'model->('model * Cmd<'msg>))\n (program : Program<'a,'model,'msg,'view>) =\n\n Internal.toNavigableWith parser urlUpdate program Internal.subscribe\n","import { record_type, bool_type, list_type, option_type, class_type } from \"./Reflection.js\";\r\nimport { some, value as value_1 } from \"./Option.js\";\r\nimport { singleton, ofArrayWithTail, head, tail, isEmpty as isEmpty_1, FSharpList, fold as fold_1, empty as empty_1, cons } from \"./List.js\";\r\nimport { map as map_2, fill } from \"./Array.js\";\r\nimport { structuralHash, compare, toIterator, equals, disposeSafe, getEnumerator, isArrayLike } from \"./Util.js\";\r\nimport { Record } from \"./Types.js\";\r\nimport { tryPick as tryPick_1, pick as pick_1, iterate as iterate_1, compareWith, map as map_1, unfold } from \"./Seq.js\";\r\nimport { format, join } from \"./String.js\";\r\nimport { LanguagePrimitives_FastGenericComparer } from \"./FSharp.Core.js\";\r\n\r\nexport class MapTreeLeaf$2 {\r\n constructor(k, v) {\r\n this.k = k;\r\n this.v = v;\r\n }\r\n}\r\n\r\nexport function MapTreeLeaf$2$reflection(gen0, gen1) {\r\n return class_type(\"Map.MapTreeLeaf`2\", [gen0, gen1], MapTreeLeaf$2);\r\n}\r\n\r\nexport function MapTreeLeaf$2_$ctor_5BDDA1(k, v) {\r\n return new MapTreeLeaf$2(k, v);\r\n}\r\n\r\nexport function MapTreeLeaf$2__get_Key(_) {\r\n return _.k;\r\n}\r\n\r\nexport function MapTreeLeaf$2__get_Value(_) {\r\n return _.v;\r\n}\r\n\r\nexport class MapTreeNode$2 extends MapTreeLeaf$2 {\r\n constructor(k, v, left, right, h) {\r\n super(k, v);\r\n this.left = left;\r\n this.right = right;\r\n this.h = (h | 0);\r\n }\r\n}\r\n\r\nexport function MapTreeNode$2$reflection(gen0, gen1) {\r\n return class_type(\"Map.MapTreeNode`2\", [gen0, gen1], MapTreeNode$2, MapTreeLeaf$2$reflection(gen0, gen1));\r\n}\r\n\r\nexport function MapTreeNode$2_$ctor_499A11FD(k, v, left, right, h) {\r\n return new MapTreeNode$2(k, v, left, right, h);\r\n}\r\n\r\nexport function MapTreeNode$2__get_Left(_) {\r\n return _.left;\r\n}\r\n\r\nexport function MapTreeNode$2__get_Right(_) {\r\n return _.right;\r\n}\r\n\r\nexport function MapTreeNode$2__get_Height(_) {\r\n return _.h;\r\n}\r\n\r\nexport function MapTreeModule_empty() {\r\n return void 0;\r\n}\r\n\r\nexport function MapTreeModule_sizeAux(acc_mut, m_mut) {\r\n MapTreeModule_sizeAux:\r\n while (true) {\r\n const acc = acc_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n acc_mut = MapTreeModule_sizeAux(acc + 1, MapTreeNode$2__get_Left(m2));\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_sizeAux;\r\n }\r\n else {\r\n return (acc + 1) | 0;\r\n }\r\n }\r\n else {\r\n return acc | 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_size(x) {\r\n return MapTreeModule_sizeAux(0, x);\r\n}\r\n\r\nexport function MapTreeModule_mk(l, k, v, r) {\r\n let hl;\r\n const m = l;\r\n if (m != null) {\r\n const m2 = m;\r\n hl = ((m2 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2) : 1);\r\n }\r\n else {\r\n hl = 0;\r\n }\r\n let hr;\r\n const m_1 = r;\r\n if (m_1 != null) {\r\n const m2_1 = m_1;\r\n hr = ((m2_1 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2_1) : 1);\r\n }\r\n else {\r\n hr = 0;\r\n }\r\n const m_2 = ((hl < hr) ? hr : hl) | 0;\r\n if (m_2 === 0) {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, v);\r\n }\r\n else {\r\n return MapTreeNode$2_$ctor_499A11FD(k, v, l, r, m_2 + 1);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_rebalance(t1, k, v, t2) {\r\n let m_2, m2_2, m_3, m2_3;\r\n let t1h;\r\n const m = t1;\r\n if (m != null) {\r\n const m2 = m;\r\n t1h = ((m2 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2) : 1);\r\n }\r\n else {\r\n t1h = 0;\r\n }\r\n let t2h;\r\n const m_1 = t2;\r\n if (m_1 != null) {\r\n const m2_1 = m_1;\r\n t2h = ((m2_1 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2_1) : 1);\r\n }\r\n else {\r\n t2h = 0;\r\n }\r\n if (t2h > (t1h + 2)) {\r\n const matchValue = value_1(t2);\r\n if (matchValue instanceof MapTreeNode$2) {\r\n if (((m_2 = MapTreeNode$2__get_Left(matchValue), (m_2 != null) ? ((m2_2 = m_2, (m2_2 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2_2) : 1)) : 0)) > (t1h + 1)) {\r\n const matchValue_1 = value_1(MapTreeNode$2__get_Left(matchValue));\r\n if (matchValue_1 instanceof MapTreeNode$2) {\r\n return MapTreeModule_mk(MapTreeModule_mk(t1, k, v, MapTreeNode$2__get_Left(matchValue_1)), MapTreeLeaf$2__get_Key(matchValue_1), MapTreeLeaf$2__get_Value(matchValue_1), MapTreeModule_mk(MapTreeNode$2__get_Right(matchValue_1), MapTreeLeaf$2__get_Key(matchValue), MapTreeLeaf$2__get_Value(matchValue), MapTreeNode$2__get_Right(matchValue)));\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.rebalance\"));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_mk(MapTreeModule_mk(t1, k, v, MapTreeNode$2__get_Left(matchValue)), MapTreeLeaf$2__get_Key(matchValue), MapTreeLeaf$2__get_Value(matchValue), MapTreeNode$2__get_Right(matchValue));\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.rebalance\"));\r\n }\r\n }\r\n else if (t1h > (t2h + 2)) {\r\n const matchValue_2 = value_1(t1);\r\n if (matchValue_2 instanceof MapTreeNode$2) {\r\n if (((m_3 = MapTreeNode$2__get_Right(matchValue_2), (m_3 != null) ? ((m2_3 = m_3, (m2_3 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2_3) : 1)) : 0)) > (t2h + 1)) {\r\n const matchValue_3 = value_1(MapTreeNode$2__get_Right(matchValue_2));\r\n if (matchValue_3 instanceof MapTreeNode$2) {\r\n return MapTreeModule_mk(MapTreeModule_mk(MapTreeNode$2__get_Left(matchValue_2), MapTreeLeaf$2__get_Key(matchValue_2), MapTreeLeaf$2__get_Value(matchValue_2), MapTreeNode$2__get_Left(matchValue_3)), MapTreeLeaf$2__get_Key(matchValue_3), MapTreeLeaf$2__get_Value(matchValue_3), MapTreeModule_mk(MapTreeNode$2__get_Right(matchValue_3), k, v, t2));\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.rebalance\"));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_mk(MapTreeNode$2__get_Left(matchValue_2), MapTreeLeaf$2__get_Key(matchValue_2), MapTreeLeaf$2__get_Value(matchValue_2), MapTreeModule_mk(MapTreeNode$2__get_Right(matchValue_2), k, v, t2));\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.rebalance\"));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_mk(t1, k, v, t2);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_add(comparer, k, v, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (c < 0) {\r\n return MapTreeModule_rebalance(MapTreeModule_add(comparer, k, v, MapTreeNode$2__get_Left(m2)), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2));\r\n }\r\n else if (c === 0) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, v, MapTreeNode$2__get_Left(m2), MapTreeNode$2__get_Right(m2), MapTreeNode$2__get_Height(m2));\r\n }\r\n else {\r\n return MapTreeModule_rebalance(MapTreeNode$2__get_Left(m2), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeModule_add(comparer, k, v, MapTreeNode$2__get_Right(m2)));\r\n }\r\n }\r\n else if (c < 0) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, v, MapTreeModule_empty(), m, 2);\r\n }\r\n else if (c === 0) {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, v);\r\n }\r\n else {\r\n return MapTreeNode$2_$ctor_499A11FD(k, v, m, MapTreeModule_empty(), 2);\r\n }\r\n }\r\n else {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, v);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_tryFind(comparer_mut, k_mut, m_mut) {\r\n MapTreeModule_tryFind:\r\n while (true) {\r\n const comparer = comparer_mut, k = k_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (c === 0) {\r\n return some(MapTreeLeaf$2__get_Value(m2));\r\n }\r\n else if (m2 instanceof MapTreeNode$2) {\r\n comparer_mut = comparer;\r\n k_mut = k;\r\n m_mut = ((c < 0) ? MapTreeNode$2__get_Left(m2) : MapTreeNode$2__get_Right(m2));\r\n continue MapTreeModule_tryFind;\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_find(comparer, k, m) {\r\n const matchValue = MapTreeModule_tryFind(comparer, k, m);\r\n if (matchValue == null) {\r\n throw (new Error());\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_partition1(comparer, f, k, v, acc1, acc2) {\r\n if (f(k, v)) {\r\n return [MapTreeModule_add(comparer, k, v, acc1), acc2];\r\n }\r\n else {\r\n return [acc1, MapTreeModule_add(comparer, k, v, acc2)];\r\n }\r\n}\r\n\r\nexport function MapTreeModule_partitionAux(comparer_mut, f_mut, m_mut, acc__mut, acc__1_mut) {\r\n MapTreeModule_partitionAux:\r\n while (true) {\r\n const comparer = comparer_mut, f = f_mut, m = m_mut, acc_ = acc__mut, acc__1 = acc__1_mut;\r\n const acc = [acc_, acc__1];\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const acc_1 = MapTreeModule_partitionAux(comparer, f, MapTreeNode$2__get_Right(m2), acc[0], acc[1]);\r\n const acc_4 = MapTreeModule_partition1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc_1[0], acc_1[1]);\r\n comparer_mut = comparer;\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Left(m2);\r\n acc__mut = acc_4[0];\r\n acc__1_mut = acc_4[1];\r\n continue MapTreeModule_partitionAux;\r\n }\r\n else {\r\n return MapTreeModule_partition1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc[0], acc[1]);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_partition(comparer, f, m) {\r\n return MapTreeModule_partitionAux(comparer, f, m, MapTreeModule_empty(), MapTreeModule_empty());\r\n}\r\n\r\nexport function MapTreeModule_filter1(comparer, f, k, v, acc) {\r\n if (f(k, v)) {\r\n return MapTreeModule_add(comparer, k, v, acc);\r\n }\r\n else {\r\n return acc;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_filterAux(comparer_mut, f_mut, m_mut, acc_mut) {\r\n MapTreeModule_filterAux:\r\n while (true) {\r\n const comparer = comparer_mut, f = f_mut, m = m_mut, acc = acc_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const acc_1 = MapTreeModule_filterAux(comparer, f, MapTreeNode$2__get_Left(m2), acc);\r\n const acc_2 = MapTreeModule_filter1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc_1);\r\n comparer_mut = comparer;\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n acc_mut = acc_2;\r\n continue MapTreeModule_filterAux;\r\n }\r\n else {\r\n return MapTreeModule_filter1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_filter(comparer, f, m) {\r\n return MapTreeModule_filterAux(comparer, f, m, MapTreeModule_empty());\r\n}\r\n\r\nexport function MapTreeModule_spliceOutSuccessor(m) {\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (MapTreeNode$2__get_Left(m2) == null) {\r\n return [MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2)];\r\n }\r\n else {\r\n const patternInput = MapTreeModule_spliceOutSuccessor(MapTreeNode$2__get_Left(m2));\r\n return [patternInput[0], patternInput[1], MapTreeModule_mk(patternInput[2], MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2))];\r\n }\r\n }\r\n else {\r\n return [MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeModule_empty()];\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.spliceOutSuccessor\"));\r\n }\r\n}\r\n\r\nexport function MapTreeModule_remove(comparer, k, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (c < 0) {\r\n return MapTreeModule_rebalance(MapTreeModule_remove(comparer, k, MapTreeNode$2__get_Left(m2)), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2));\r\n }\r\n else if (c === 0) {\r\n if (MapTreeNode$2__get_Left(m2) == null) {\r\n return MapTreeNode$2__get_Right(m2);\r\n }\r\n else if (MapTreeNode$2__get_Right(m2) == null) {\r\n return MapTreeNode$2__get_Left(m2);\r\n }\r\n else {\r\n const patternInput = MapTreeModule_spliceOutSuccessor(MapTreeNode$2__get_Right(m2));\r\n return MapTreeModule_mk(MapTreeNode$2__get_Left(m2), patternInput[0], patternInput[1], patternInput[2]);\r\n }\r\n }\r\n else {\r\n return MapTreeModule_rebalance(MapTreeNode$2__get_Left(m2), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeModule_remove(comparer, k, MapTreeNode$2__get_Right(m2)));\r\n }\r\n }\r\n else if (c === 0) {\r\n return MapTreeModule_empty();\r\n }\r\n else {\r\n return m;\r\n }\r\n }\r\n else {\r\n return MapTreeModule_empty();\r\n }\r\n}\r\n\r\nexport function MapTreeModule_change(comparer, k, u, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (c < 0) {\r\n return MapTreeModule_rebalance(MapTreeModule_change(comparer, k, u, MapTreeNode$2__get_Left(m2)), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2));\r\n }\r\n else if (c === 0) {\r\n const matchValue_1 = u(some(MapTreeLeaf$2__get_Value(m2)));\r\n if (matchValue_1 != null) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, value_1(matchValue_1), MapTreeNode$2__get_Left(m2), MapTreeNode$2__get_Right(m2), MapTreeNode$2__get_Height(m2));\r\n }\r\n else if (MapTreeNode$2__get_Left(m2) == null) {\r\n return MapTreeNode$2__get_Right(m2);\r\n }\r\n else if (MapTreeNode$2__get_Right(m2) == null) {\r\n return MapTreeNode$2__get_Left(m2);\r\n }\r\n else {\r\n const patternInput = MapTreeModule_spliceOutSuccessor(MapTreeNode$2__get_Right(m2));\r\n return MapTreeModule_mk(MapTreeNode$2__get_Left(m2), patternInput[0], patternInput[1], patternInput[2]);\r\n }\r\n }\r\n else {\r\n return MapTreeModule_rebalance(MapTreeNode$2__get_Left(m2), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeModule_change(comparer, k, u, MapTreeNode$2__get_Right(m2)));\r\n }\r\n }\r\n else {\r\n const c_1 = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (c_1 < 0) {\r\n const matchValue_2 = u(void 0);\r\n if (matchValue_2 != null) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, value_1(matchValue_2), MapTreeModule_empty(), m, 2);\r\n }\r\n else {\r\n return m;\r\n }\r\n }\r\n else if (c_1 === 0) {\r\n const matchValue_3 = u(some(MapTreeLeaf$2__get_Value(m2)));\r\n if (matchValue_3 != null) {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, value_1(matchValue_3));\r\n }\r\n else {\r\n return MapTreeModule_empty();\r\n }\r\n }\r\n else {\r\n const matchValue_4 = u(void 0);\r\n if (matchValue_4 != null) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, value_1(matchValue_4), m, MapTreeModule_empty(), 2);\r\n }\r\n else {\r\n return m;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n const matchValue = u(void 0);\r\n if (matchValue != null) {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, value_1(matchValue));\r\n }\r\n else {\r\n return m;\r\n }\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mem(comparer_mut, k_mut, m_mut) {\r\n MapTreeModule_mem:\r\n while (true) {\r\n const comparer = comparer_mut, k = k_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (c < 0) {\r\n comparer_mut = comparer;\r\n k_mut = k;\r\n m_mut = MapTreeNode$2__get_Left(m2);\r\n continue MapTreeModule_mem;\r\n }\r\n else if (c === 0) {\r\n return true;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n k_mut = k;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_mem;\r\n }\r\n }\r\n else {\r\n return c === 0;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_iterOpt(f_mut, m_mut) {\r\n MapTreeModule_iterOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n MapTreeModule_iterOpt(f, MapTreeNode$2__get_Left(m2));\r\n f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_iterOpt;\r\n }\r\n else {\r\n f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_iter(f, m) {\r\n MapTreeModule_iterOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_tryPickOpt(f_mut, m_mut) {\r\n MapTreeModule_tryPickOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const matchValue = MapTreeModule_tryPickOpt(f, MapTreeNode$2__get_Left(m2));\r\n if (matchValue == null) {\r\n const matchValue_1 = f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n if (matchValue_1 == null) {\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_tryPickOpt;\r\n }\r\n else {\r\n return matchValue_1;\r\n }\r\n }\r\n else {\r\n return matchValue;\r\n }\r\n }\r\n else {\r\n return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_tryPick(f, m) {\r\n return MapTreeModule_tryPickOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_existsOpt(f_mut, m_mut) {\r\n MapTreeModule_existsOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (MapTreeModule_existsOpt(f, MapTreeNode$2__get_Left(m2)) ? true : f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2))) {\r\n return true;\r\n }\r\n else {\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_existsOpt;\r\n }\r\n }\r\n else {\r\n return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_exists(f, m) {\r\n return MapTreeModule_existsOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_forallOpt(f_mut, m_mut) {\r\n MapTreeModule_forallOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (MapTreeModule_forallOpt(f, MapTreeNode$2__get_Left(m2)) && f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2))) {\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_forallOpt;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n else {\r\n return true;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_forall(f, m) {\r\n return MapTreeModule_forallOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_map(f, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const l2 = MapTreeModule_map(f, MapTreeNode$2__get_Left(m2));\r\n const v2 = f(MapTreeLeaf$2__get_Value(m2));\r\n const r2 = MapTreeModule_map(f, MapTreeNode$2__get_Right(m2));\r\n return MapTreeNode$2_$ctor_499A11FD(MapTreeLeaf$2__get_Key(m2), v2, l2, r2, MapTreeNode$2__get_Height(m2));\r\n }\r\n else {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(m2), f(MapTreeLeaf$2__get_Value(m2)));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_empty();\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mapiOpt(f, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const l2 = MapTreeModule_mapiOpt(f, MapTreeNode$2__get_Left(m2));\r\n const v2 = f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n const r2 = MapTreeModule_mapiOpt(f, MapTreeNode$2__get_Right(m2));\r\n return MapTreeNode$2_$ctor_499A11FD(MapTreeLeaf$2__get_Key(m2), v2, l2, r2, MapTreeNode$2__get_Height(m2));\r\n }\r\n else {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(m2), f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_empty();\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mapi(f, m) {\r\n return MapTreeModule_mapiOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_foldBackOpt(f_mut, m_mut, x_mut) {\r\n MapTreeModule_foldBackOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut, x = x_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const x_1 = MapTreeModule_foldBackOpt(f, MapTreeNode$2__get_Right(m2), x);\r\n const x_2 = f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x_1);\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Left(m2);\r\n x_mut = x_2;\r\n continue MapTreeModule_foldBackOpt;\r\n }\r\n else {\r\n return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x);\r\n }\r\n }\r\n else {\r\n return x;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_foldBack(f, m, x) {\r\n return MapTreeModule_foldBackOpt(f, m, x);\r\n}\r\n\r\nexport function MapTreeModule_foldOpt(f_mut, x_mut, m_mut) {\r\n MapTreeModule_foldOpt:\r\n while (true) {\r\n const f = f_mut, x = x_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n f_mut = f;\r\n x_mut = f(MapTreeModule_foldOpt(f, x, MapTreeNode$2__get_Left(m2)), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_foldOpt;\r\n }\r\n else {\r\n return f(x, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n else {\r\n return x;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_fold(f, x, m) {\r\n return MapTreeModule_foldOpt(f, x, m);\r\n}\r\n\r\nexport function MapTreeModule_foldSectionOpt(comparer, lo, hi, f, m, x) {\r\n const foldFromTo = (f_1_mut, m_1_mut, x_1_mut) => {\r\n foldFromTo:\r\n while (true) {\r\n const f_1 = f_1_mut, m_1 = m_1_mut, x_1 = x_1_mut;\r\n if (m_1 != null) {\r\n const m2 = m_1;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const cLoKey = comparer.Compare(lo, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n const cKeyHi = comparer.Compare(MapTreeLeaf$2__get_Key(m2), hi) | 0;\r\n const x_2 = (cLoKey < 0) ? foldFromTo(f_1, MapTreeNode$2__get_Left(m2), x_1) : x_1;\r\n const x_3 = ((cLoKey <= 0) && (cKeyHi <= 0)) ? f_1(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x_2) : x_2;\r\n if (cKeyHi < 0) {\r\n f_1_mut = f_1;\r\n m_1_mut = MapTreeNode$2__get_Right(m2);\r\n x_1_mut = x_3;\r\n continue foldFromTo;\r\n }\r\n else {\r\n return x_3;\r\n }\r\n }\r\n else if ((comparer.Compare(lo, MapTreeLeaf$2__get_Key(m2)) <= 0) && (comparer.Compare(MapTreeLeaf$2__get_Key(m2), hi) <= 0)) {\r\n return f_1(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x_1);\r\n }\r\n else {\r\n return x_1;\r\n }\r\n }\r\n else {\r\n return x_1;\r\n }\r\n break;\r\n }\r\n };\r\n if (comparer.Compare(lo, hi) === 1) {\r\n return x;\r\n }\r\n else {\r\n return foldFromTo(f, m, x);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_foldSection(comparer, lo, hi, f, m, x) {\r\n return MapTreeModule_foldSectionOpt(comparer, lo, hi, f, m, x);\r\n}\r\n\r\nexport function MapTreeModule_toList(m) {\r\n const loop = (m_1_mut, acc_mut) => {\r\n loop:\r\n while (true) {\r\n const m_1 = m_1_mut, acc = acc_mut;\r\n if (m_1 != null) {\r\n const m2 = m_1;\r\n if (m2 instanceof MapTreeNode$2) {\r\n m_1_mut = MapTreeNode$2__get_Left(m2);\r\n acc_mut = cons([MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)], loop(MapTreeNode$2__get_Right(m2), acc));\r\n continue loop;\r\n }\r\n else {\r\n return cons([MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)], acc);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(m, empty_1());\r\n}\r\n\r\nexport function MapTreeModule_copyToArray(m, arr, i) {\r\n let j = i;\r\n MapTreeModule_iter((x, y) => {\r\n arr[j] = [x, y];\r\n j = ((j + 1) | 0);\r\n }, m);\r\n}\r\n\r\nexport function MapTreeModule_toArray(m) {\r\n const n = MapTreeModule_size(m) | 0;\r\n const res = fill(new Array(n), 0, n, [null, null]);\r\n MapTreeModule_copyToArray(m, res, 0);\r\n return res;\r\n}\r\n\r\nexport function MapTreeModule_ofList(comparer, l) {\r\n return fold_1((acc, tupledArg) => MapTreeModule_add(comparer, tupledArg[0], tupledArg[1], acc), MapTreeModule_empty(), l);\r\n}\r\n\r\nexport function MapTreeModule_mkFromEnumerator(comparer_mut, acc_mut, e_mut) {\r\n MapTreeModule_mkFromEnumerator:\r\n while (true) {\r\n const comparer = comparer_mut, acc = acc_mut, e = e_mut;\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const patternInput = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n comparer_mut = comparer;\r\n acc_mut = MapTreeModule_add(comparer, patternInput[0], patternInput[1], acc);\r\n e_mut = e;\r\n continue MapTreeModule_mkFromEnumerator;\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_ofArray(comparer, arr) {\r\n let res = MapTreeModule_empty();\r\n for (let idx = 0; idx <= (arr.length - 1); idx++) {\r\n const forLoopVar = arr[idx];\r\n res = MapTreeModule_add(comparer, forLoopVar[0], forLoopVar[1], res);\r\n }\r\n return res;\r\n}\r\n\r\nexport function MapTreeModule_ofSeq(comparer, c) {\r\n if (isArrayLike(c)) {\r\n return MapTreeModule_ofArray(comparer, c);\r\n }\r\n else if (c instanceof FSharpList) {\r\n return MapTreeModule_ofList(comparer, c);\r\n }\r\n else {\r\n const ie = getEnumerator(c);\r\n try {\r\n return MapTreeModule_mkFromEnumerator(comparer, MapTreeModule_empty(), ie);\r\n }\r\n finally {\r\n disposeSafe(ie);\r\n }\r\n }\r\n}\r\n\r\nexport class MapTreeModule_MapIterator$2 extends Record {\r\n constructor(stack, started) {\r\n super();\r\n this.stack = stack;\r\n this.started = started;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_MapIterator$2$reflection(gen0, gen1) {\r\n return record_type(\"Map.MapTreeModule.MapIterator`2\", [gen0, gen1], MapTreeModule_MapIterator$2, () => [[\"stack\", list_type(option_type(MapTreeLeaf$2$reflection(gen0, gen1)))], [\"started\", bool_type]]);\r\n}\r\n\r\nexport function MapTreeModule_collapseLHS(stack_mut) {\r\n MapTreeModule_collapseLHS:\r\n while (true) {\r\n const stack = stack_mut;\r\n if (!isEmpty_1(stack)) {\r\n const rest = tail(stack);\r\n const m = head(stack);\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n stack_mut = ofArrayWithTail([MapTreeNode$2__get_Left(m2), MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)), MapTreeNode$2__get_Right(m2)], rest);\r\n continue MapTreeModule_collapseLHS;\r\n }\r\n else {\r\n return stack;\r\n }\r\n }\r\n else {\r\n stack_mut = rest;\r\n continue MapTreeModule_collapseLHS;\r\n }\r\n }\r\n else {\r\n return empty_1();\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mkIterator(m) {\r\n return new MapTreeModule_MapIterator$2(MapTreeModule_collapseLHS(singleton(m)), false);\r\n}\r\n\r\nexport function MapTreeModule_notStarted() {\r\n throw (new Error(\"enumeration not started\"));\r\n}\r\n\r\nexport function MapTreeModule_alreadyFinished() {\r\n throw (new Error(\"enumeration already finished\"));\r\n}\r\n\r\nexport function MapTreeModule_current(i) {\r\n if (i.started) {\r\n const matchValue = i.stack;\r\n if (!isEmpty_1(matchValue)) {\r\n if (head(matchValue) != null) {\r\n const m = head(matchValue);\r\n if (m instanceof MapTreeNode$2) {\r\n throw (new Error(\"Please report error: Map iterator, unexpected stack for current\"));\r\n }\r\n else {\r\n return [MapTreeLeaf$2__get_Key(m), MapTreeLeaf$2__get_Value(m)];\r\n }\r\n }\r\n else {\r\n throw (new Error(\"Please report error: Map iterator, unexpected stack for current\"));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_alreadyFinished();\r\n }\r\n }\r\n else {\r\n return MapTreeModule_notStarted();\r\n }\r\n}\r\n\r\nexport function MapTreeModule_moveNext(i) {\r\n if (i.started) {\r\n const matchValue = i.stack;\r\n if (!isEmpty_1(matchValue)) {\r\n if (head(matchValue) != null) {\r\n const m = head(matchValue);\r\n if (m instanceof MapTreeNode$2) {\r\n throw (new Error(\"Please report error: Map iterator, unexpected stack for moveNext\"));\r\n }\r\n else {\r\n i.stack = MapTreeModule_collapseLHS(tail(matchValue));\r\n return !isEmpty_1(i.stack);\r\n }\r\n }\r\n else {\r\n throw (new Error(\"Please report error: Map iterator, unexpected stack for moveNext\"));\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n i.started = true;\r\n return !isEmpty_1(i.stack);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mkIEnumerator(m) {\r\n let i = MapTreeModule_mkIterator(m);\r\n return {\r\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\r\n return MapTreeModule_current(i);\r\n },\r\n [\"System.Collections.IEnumerator.get_Current\"]() {\r\n return MapTreeModule_current(i);\r\n },\r\n [\"System.Collections.IEnumerator.MoveNext\"]() {\r\n return MapTreeModule_moveNext(i);\r\n },\r\n [\"System.Collections.IEnumerator.Reset\"]() {\r\n i = MapTreeModule_mkIterator(m);\r\n },\r\n Dispose() {\r\n },\r\n };\r\n}\r\n\r\nexport function MapTreeModule_toSeq(s) {\r\n return unfold((en_1) => {\r\n if (en_1[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return [en_1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), en_1];\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, MapTreeModule_mkIEnumerator(s));\r\n}\r\n\r\nexport class FSharpMap {\r\n constructor(comparer, tree) {\r\n this.comparer = comparer;\r\n this.tree = tree;\r\n }\r\n GetHashCode() {\r\n const this$ = this;\r\n return FSharpMap__ComputeHashCode(this$) | 0;\r\n }\r\n Equals(that) {\r\n const this$ = this;\r\n if (that instanceof FSharpMap) {\r\n const e1 = getEnumerator(this$);\r\n try {\r\n const e2 = getEnumerator(that);\r\n try {\r\n const loop = () => {\r\n const m1 = e1[\"System.Collections.IEnumerator.MoveNext\"]();\r\n if (m1 === e2[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n if (!m1) {\r\n return true;\r\n }\r\n else {\r\n const e1c = e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n const e2c = e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n if (equals(e1c[0], e2c[0]) && equals(e1c[1], e2c[1])) {\r\n return loop();\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n return loop();\r\n }\r\n finally {\r\n disposeSafe(e2);\r\n }\r\n }\r\n finally {\r\n disposeSafe(e1);\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n toString() {\r\n const this$ = this;\r\n return (\"map [\" + join(\"; \", map_1((kv) => format(\"({0}, {1})\", kv[0], kv[1]), this$))) + \"]\";\r\n }\r\n get [Symbol.toStringTag]() {\r\n return \"FSharpMap\";\r\n }\r\n toJSON(_key) {\r\n const this$ = this;\r\n return Array.from(this$);\r\n }\r\n GetEnumerator() {\r\n const __ = this;\r\n return MapTreeModule_mkIEnumerator(__.tree);\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const __ = this;\r\n return MapTreeModule_mkIEnumerator(__.tree);\r\n }\r\n CompareTo(obj) {\r\n const m = this;\r\n if (obj instanceof FSharpMap) {\r\n return compareWith((kvp1, kvp2) => {\r\n const c = m.comparer.Compare(kvp1[0], kvp2[0]) | 0;\r\n return ((c !== 0) ? c : compare(kvp1[1], kvp2[1])) | 0;\r\n }, m, obj) | 0;\r\n }\r\n else {\r\n throw (new Error(\"not comparable\\\\nParameter name: obj\"));\r\n }\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Add2B595\"](x) {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Clear\"]() {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Remove2B595\"](x) {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Contains2B595\"](x) {\r\n const m = this;\r\n return FSharpMap__ContainsKey(m, x[0]) && equals(FSharpMap__get_Item(m, x[0]), x[1]);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.CopyToZ2E171D71\"](arr, i) {\r\n const m = this;\r\n MapTreeModule_copyToArray(m.tree, arr, i);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_IsReadOnly\"]() {\r\n return true;\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_Count\"]() {\r\n const m = this;\r\n return FSharpMap__get_Count(m) | 0;\r\n }\r\n [\"System.Collections.Generic.IReadOnlyCollection`1.get_Count\"]() {\r\n const m = this;\r\n return FSharpMap__get_Count(m) | 0;\r\n }\r\n get size() {\r\n const m = this;\r\n return FSharpMap__get_Count(m) | 0;\r\n }\r\n clear() {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n }\r\n delete(_arg) {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n return false;\r\n }\r\n entries() {\r\n const m = this;\r\n return map_1((p) => [p[0], p[1]], m);\r\n }\r\n get(k) {\r\n const m = this;\r\n return FSharpMap__get_Item(m, k);\r\n }\r\n has(k) {\r\n const m = this;\r\n return FSharpMap__ContainsKey(m, k);\r\n }\r\n keys() {\r\n const m = this;\r\n return map_1((p) => p[0], m);\r\n }\r\n set(k, v) {\r\n const m = this;\r\n throw (new Error(\"Map cannot be mutated\"));\r\n return m;\r\n }\r\n values() {\r\n const m = this;\r\n return map_1((p) => p[1], m);\r\n }\r\n forEach(f, thisArg) {\r\n const m = this;\r\n iterate_1((p) => {\r\n f(p[1], p[0], m);\r\n }, m);\r\n }\r\n}\r\n\r\nexport function FSharpMap$reflection(gen0, gen1) {\r\n return class_type(\"Map.FSharpMap\", [gen0, gen1], FSharpMap);\r\n}\r\n\r\nexport function FSharpMap_$ctor(comparer, tree) {\r\n return new FSharpMap(comparer, tree);\r\n}\r\n\r\n(() => {\r\n FSharpMap.empty = FSharpMap_$ctor(LanguagePrimitives_FastGenericComparer(), MapTreeModule_empty());\r\n})();\r\n\r\nexport function FSharpMap_get_Empty() {\r\n return FSharpMap.empty;\r\n}\r\n\r\nexport function FSharpMap_Create(ie) {\r\n const comparer = LanguagePrimitives_FastGenericComparer();\r\n return FSharpMap_$ctor(comparer, MapTreeModule_ofSeq(comparer, ie));\r\n}\r\n\r\nexport function FSharpMap__get_Comparer(m) {\r\n return m.comparer;\r\n}\r\n\r\nexport function FSharpMap__get_Tree(m) {\r\n return m.tree;\r\n}\r\n\r\nexport function FSharpMap__Add(m, key, value) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_add(m.comparer, key, value, m.tree));\r\n}\r\n\r\nexport function FSharpMap__Change(m, key, f) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_change(m.comparer, key, f, m.tree));\r\n}\r\n\r\nexport function FSharpMap__get_IsEmpty(m) {\r\n return m.tree == null;\r\n}\r\n\r\nexport function FSharpMap__get_Item(m, key) {\r\n return MapTreeModule_find(m.comparer, key, m.tree);\r\n}\r\n\r\nexport function FSharpMap__TryPick(m, f) {\r\n return MapTreeModule_tryPick(f, m.tree);\r\n}\r\n\r\nexport function FSharpMap__Exists(m, predicate) {\r\n return MapTreeModule_exists(predicate, m.tree);\r\n}\r\n\r\nexport function FSharpMap__Filter(m, predicate) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_filter(m.comparer, predicate, m.tree));\r\n}\r\n\r\nexport function FSharpMap__ForAll(m, predicate) {\r\n return MapTreeModule_forall(predicate, m.tree);\r\n}\r\n\r\nexport function FSharpMap__Fold(m, f, acc) {\r\n return MapTreeModule_foldBack(f, m.tree, acc);\r\n}\r\n\r\nexport function FSharpMap__FoldSection(m, lo, hi, f, acc) {\r\n return MapTreeModule_foldSection(m.comparer, lo, hi, f, m.tree, acc);\r\n}\r\n\r\nexport function FSharpMap__Iterate(m, f) {\r\n MapTreeModule_iter(f, m.tree);\r\n}\r\n\r\nexport function FSharpMap__MapRange(m, f) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_map(f, m.tree));\r\n}\r\n\r\nexport function FSharpMap__Map(m, f) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_mapi(f, m.tree));\r\n}\r\n\r\nexport function FSharpMap__Partition(m, predicate) {\r\n const patternInput = MapTreeModule_partition(m.comparer, predicate, m.tree);\r\n return [FSharpMap_$ctor(m.comparer, patternInput[0]), FSharpMap_$ctor(m.comparer, patternInput[1])];\r\n}\r\n\r\nexport function FSharpMap__get_Count(m) {\r\n return MapTreeModule_size(m.tree);\r\n}\r\n\r\nexport function FSharpMap__ContainsKey(m, key) {\r\n return MapTreeModule_mem(m.comparer, key, m.tree);\r\n}\r\n\r\nexport function FSharpMap__Remove(m, key) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_remove(m.comparer, key, m.tree));\r\n}\r\n\r\nexport function FSharpMap__TryGetValue(__, key, value) {\r\n const matchValue = MapTreeModule_tryFind(__.comparer, key, __.tree);\r\n if (matchValue == null) {\r\n return false;\r\n }\r\n else {\r\n const v = value_1(matchValue);\r\n value.contents = v;\r\n return true;\r\n }\r\n}\r\n\r\nexport function FSharpMap__get_Keys(__) {\r\n return map_2((kvp) => kvp[0], MapTreeModule_toArray(__.tree));\r\n}\r\n\r\nexport function FSharpMap__get_Values(__) {\r\n return map_2((kvp) => kvp[1], MapTreeModule_toArray(__.tree));\r\n}\r\n\r\nexport function FSharpMap__TryFind(m, key) {\r\n return MapTreeModule_tryFind(m.comparer, key, m.tree);\r\n}\r\n\r\nexport function FSharpMap__ToList(m) {\r\n return MapTreeModule_toList(m.tree);\r\n}\r\n\r\nexport function FSharpMap__ToArray(m) {\r\n return MapTreeModule_toArray(m.tree);\r\n}\r\n\r\nexport function FSharpMap__ComputeHashCode(this$) {\r\n const combineHash = (x, y) => (((x << 1) + y) + 631);\r\n let res = 0;\r\n const enumerator = getEnumerator(this$);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const activePatternResult = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n res = (combineHash(res, structuralHash(activePatternResult[0])) | 0);\r\n res = (combineHash(res, structuralHash(activePatternResult[1])) | 0);\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n return res | 0;\r\n}\r\n\r\nexport function isEmpty(table) {\r\n return FSharpMap__get_IsEmpty(table);\r\n}\r\n\r\nexport function add(key, value, table) {\r\n return FSharpMap__Add(table, key, value);\r\n}\r\n\r\nexport function change(key, f, table) {\r\n return FSharpMap__Change(table, key, f);\r\n}\r\n\r\nexport function find(key, table) {\r\n return FSharpMap__get_Item(table, key);\r\n}\r\n\r\nexport function tryFind(key, table) {\r\n return FSharpMap__TryFind(table, key);\r\n}\r\n\r\nexport function remove(key, table) {\r\n return FSharpMap__Remove(table, key);\r\n}\r\n\r\nexport function containsKey(key, table) {\r\n return FSharpMap__ContainsKey(table, key);\r\n}\r\n\r\nexport function iterate(action, table) {\r\n FSharpMap__Iterate(table, action);\r\n}\r\n\r\nexport function tryPick(chooser, table) {\r\n return FSharpMap__TryPick(table, chooser);\r\n}\r\n\r\nexport function pick(chooser, table) {\r\n const matchValue = tryPick(chooser, table);\r\n if (matchValue != null) {\r\n return value_1(matchValue);\r\n }\r\n else {\r\n throw (new Error());\r\n }\r\n}\r\n\r\nexport function exists(predicate, table) {\r\n return FSharpMap__Exists(table, predicate);\r\n}\r\n\r\nexport function filter(predicate, table) {\r\n return FSharpMap__Filter(table, predicate);\r\n}\r\n\r\nexport function partition(predicate, table) {\r\n return FSharpMap__Partition(table, predicate);\r\n}\r\n\r\nexport function forAll(predicate, table) {\r\n return FSharpMap__ForAll(table, predicate);\r\n}\r\n\r\nexport function map(mapping, table) {\r\n return FSharpMap__Map(table, mapping);\r\n}\r\n\r\nexport function fold(folder, state, table) {\r\n return MapTreeModule_fold(folder, state, FSharpMap__get_Tree(table));\r\n}\r\n\r\nexport function foldBack(folder, table, state) {\r\n return MapTreeModule_foldBack(folder, FSharpMap__get_Tree(table), state);\r\n}\r\n\r\nexport function toSeq(table) {\r\n return map_1((kvp) => [kvp[0], kvp[1]], table);\r\n}\r\n\r\nexport function findKey(predicate, table) {\r\n return pick_1((kvp) => {\r\n const k = kvp[0];\r\n if (predicate(k, kvp[1])) {\r\n return some(k);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, table);\r\n}\r\n\r\nexport function tryFindKey(predicate, table) {\r\n return tryPick_1((kvp) => {\r\n const k = kvp[0];\r\n if (predicate(k, kvp[1])) {\r\n return some(k);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, table);\r\n}\r\n\r\nexport function ofList(elements) {\r\n return FSharpMap_Create(elements);\r\n}\r\n\r\nexport function ofSeq(elements) {\r\n return FSharpMap_Create(elements);\r\n}\r\n\r\nexport function ofArray(elements) {\r\n const comparer = LanguagePrimitives_FastGenericComparer();\r\n return FSharpMap_$ctor(comparer, MapTreeModule_ofArray(comparer, elements));\r\n}\r\n\r\nexport function toList(table) {\r\n return FSharpMap__ToList(table);\r\n}\r\n\r\nexport function toArray(table) {\r\n return FSharpMap__ToArray(table);\r\n}\r\n\r\nexport function keys(table) {\r\n return FSharpMap__get_Keys(table);\r\n}\r\n\r\nexport function values(table) {\r\n return FSharpMap__get_Values(table);\r\n}\r\n\r\nexport function empty() {\r\n return FSharpMap_get_Empty();\r\n}\r\n\r\nexport function count(table) {\r\n return FSharpMap__get_Count(table);\r\n}\r\n\r\n","namespace Elmish\n\n\n[]\n[]\nmodule internal Option =\n\n let tuple a b =\n match (a,b) with\n | Some a, Some b -> Some (a,b)\n | _ -> None\n\n let ofFunc f arg =\n try\n Some (f arg)\n with _ ->\n None","(** UrlParser\n------\nThis port of the Elm library helps you turn URLs into nicely structured data.\nIt is designed to be used with `Navigation` module to help folks create\nsingle-page applications (SPAs) where you manage browser navigation yourself.\n*)\n\nmodule Elmish.UrlParser\n\n\n(**\n#### Types\n*)\n\ntype State<'v> =\n { visited : string list\n unvisited : string list\n args : Map\n value : 'v }\n\n[]\n[]\nmodule internal State =\n let mkState visited unvisited args value =\n { visited = visited\n unvisited = unvisited\n args = args\n value = value }\n\n let map f { visited = visited; unvisited = unvisited; args = args; value = value } =\n { visited = visited\n unvisited = unvisited\n args = args\n value = f value }\n\n\n/// Turn URLs like `/blog/42/cat-herding-techniques` into nice data.\ntype Parser<'a,'b> = State<'a> -> State<'b> list\n\n\n(**\n#### Parse segments\nCreate a custom path segment parser. You can use it to define something like “only CSS files” like this:\n```\n let css =\n custom \"CSS_FILE\" <| fun segment ->\n if String.EndsWith \".css\" then\n Ok segment\n else\n Error \"Does not end with .css\"\n```\n*)\nlet custom tipe (stringToSomething: string->Result<_,_>) : Parser<_,_> =\n let inner { visited = visited; unvisited = unvisited; args = args; value = value } =\n match unvisited with\n | [] -> []\n | next :: rest ->\n match stringToSomething next with\n | Ok nextValue ->\n [ State.mkState (next :: visited) rest args (value nextValue) ]\n\n | Error msg ->\n []\n inner\n\n\n(** Parse a segment of the path as a `string`.\n```\n parse str location\n```\n
\n    /alice/  ==>  Some \"alice\"\n    /bob     ==>  Some \"bob\"\n    /42/     ==>  Some \"42\"\n
\n*)\nlet str state =\n custom \"string\" Ok state\n\n\n(** Parse a segment of the path as an `int`.\n```\n parse i32 location\n```\n
\n    /alice/  ==>  None\n    /bob     ==>  None\n    /42/     ==>  Some 42\n
\n*)\nlet i32 state =\n custom \"i32\" (System.Int32.TryParse >> function true, value -> Ok value | _ -> Error \"Can't parse int\" ) state\n\n\n(** Parse a segment of the path if it matches a given string.\n```\n s \"blog\" // can parse /blog/\n // but not /glob/ or /42/ or anything else\n```\n*)\nlet s str : Parser<_,_> =\n let inner { visited = visited; unvisited = unvisited; args = args; value = value } =\n match unvisited with\n | [] -> []\n | next :: rest ->\n if next = str then\n [ State.mkState (next :: visited) rest args value ]\n else\n []\n inner\n\n\n\n(**\n#### Combining parsers\nParse a path with multiple segments.\n\n```\n parse (s \"blog\" i32) location\n```\n
\n    /blog/35/  ==>  Some 35\n    /blog/42   ==>  Some 42\n    /blog/     ==>  None\n    /42/       ==>  None\n
\n```\n parse (s \"search\" str) location\n```\n
\n    /search/cats/  ==>  Some \"cats\"\n    /search/frog   ==>  Some \"frog\"\n    /search/       ==>  None\n    /cats/         ==>  None\n
\n*)\nlet inline () (parseBefore: Parser<_,_>) (parseAfter: Parser<_,_>) =\n fun state ->\n List.collect parseAfter (parseBefore state)\n\n\n(** Transform a path parser.\n```\n type Comment = { author : string; id : int }\n rawComment =\n s \"user\" str s \"comments\" i32\n comment =\n map (fun a id -> { author = a; id = id }) rawComment\n parse comment location\n```\n
\n    /user/bob/comments/42  ==>  Some { author = \"bob\"; id = 42 }\n    /user/tom/comments/35  ==>  Some { author = \"tom\"; id = 35 }\n    /user/sam/             ==>  None\n
\n*)\nlet map (subValue: 'a) (parse: Parser<'a,'b>) : Parser<'b->'c,'c> =\n let inner { visited = visited; unvisited = unvisited; args = args; value = value } =\n List.map (State.map value)\n <| parse { visited = visited\n unvisited = unvisited\n args = args\n value = subValue }\n inner\n\n\n\n(** Try a bunch of different path parsers.\n```\n type Route\n = Search of string\n | Blog of int\n | User of string\n | Comment of string*int\n route =\n oneOf\n [ map Search (s \"search\" str)\n map Blog (s \"blog\" i32)\n map User (s \"user\" str)\n map (fun u c -> Comment (u,c)) (s \"user\" str \"comments\" i32) ]\n parse route location\n```\n
\n    /search/cats           ==>  Some (Search \"cats\")\n    /search/               ==>  None\n    /blog/42               ==>  Some (Blog 42)\n    /blog/cats             ==>  None\n    /user/sam/             ==>  Some (User \"sam\")\n    /user/bob/comments/42  ==>  Some (Comment \"bob\" 42)\n    /user/tom/comments/35  ==>  Some (Comment \"tom\" 35)\n    /user/                 ==>  None\n
\n*)\nlet oneOf parsers state =\n List.collect (fun parser -> parser state) parsers\n\n\n(** A parser that does not consume any path segments.\n```\n type BlogRoute = Overview | Post of int\n blogRoute =\n oneOf\n [ map Overview top\n map Post (s \"post\" i32) ]\n parse (s \"blog\" blogRoute) location\n```\n
\n    /blog/         ==>  Some Overview\n    /blog/post/42  ==>  Some (Post 42)\n
\n*)\nlet top state=\n [state]\n\n\n\n(**\n#### Query parameters\nTurn query parameters like `?name=tom&age=42` into nice data.\n\n*)\n\ntype QueryParser<'a,'b> = State<'a> -> State<'b> list\n\n\n(** Parse some query parameters.\n```\n type Route = BlogList (Option string) | BlogPost Int\n route =\n oneOf\n [ map BlogList (s \"blog\" stringParam \"search\")\n map BlogPost (s \"blog\" i32) ]\n parse route location\n```\n
\n    /blog/              ==>  Some (BlogList None)\n    /blog/?search=cats  ==>  Some (BlogList (Some \"cats\"))\n    /blog/42            ==>  Some (BlogPost 42)\n
\n*)\nlet inline () (parser: Parser<_,_>) (queryParser:QueryParser<_,_>) : Parser<_,_> =\n fun state ->\n List.collect queryParser (parser state)\n\n(** Create a custom query parser. You could create parsers like these:\n```\n val jsonParam : string -> Decoder a -> QueryParser (Option a -> b) b\n val enumParam : string -> Map -> QueryParser (Option a -> b) b\n```\n*)\nlet customParam (key: string) (func: string option -> _) : QueryParser<_,_> =\n let inner { visited = visited; unvisited = unvisited; args = args; value = value } =\n [ State.mkState visited unvisited args (value (func (Map.tryFind key args))) ]\n inner\n\n\n(** Parse a query parameter as a `string`.\n```\n parse (s \"blog\" stringParam \"search\") location\n```\n
\n    /blog/              ==>  Some (Overview None)\n    /blog/?search=cats  ==>  Some (Overview (Some \"cats\"))\n
\n*)\nlet stringParam name =\n customParam name id\n\nlet internal intParamHelp =\n Option.bind\n (fun (value: string) ->\n match System.Int32.TryParse value with\n | (true,x) -> Some x\n | _ -> None)\n\n(** Parse a query parameter as an `int`. Option you want to show paginated\nsearch results. You could have a `start` query parameter to say which result\nshould appear first.\n```\n parse (s \"results\" intParam \"start\") location\n```\n
\n    /results           ==>  Some None\n    /results?start=10  ==>  Some (Some 10)\n
\n*)\nlet intParam name =\n customParam name intParamHelp\n\n\n// PARSER HELPERS\n\nlet rec internal parseHelp states =\n match states with\n | [] ->\n None\n | state :: rest ->\n match state.unvisited with\n | [] ->\n Some state.value\n | [\"\"] ->\n Some state.value\n | _ ->\n parseHelp rest\n\nlet internal splitUrl (url: string) =\n match List.ofArray <| url.Split([|'/'|]) with\n | \"\" :: segments ->\n segments\n | segments ->\n segments\n\n/// parse a given part of the location\nlet parse (parser: Parser<'a->'a,'a>) url args =\n { visited = []\n unvisited = splitUrl url\n args = args\n value = id }\n |> parser\n |> parseHelp\n\nopen Fable.Core\n\nlet internal toKeyValuePair (segment: string) =\n match segment.Split('=') with\n | [| key; value |] ->\n Option.tuple (Option.ofFunc JS.decodeURIComponent key) (Option.ofFunc JS.decodeURIComponent value)\n | _ -> None\n\n\nlet internal parseParams (querystring: string) =\n if querystring.Length > 1 then\n querystring.Substring(1).Split('&')\n |> Seq.map toKeyValuePair\n |> Seq.choose id\n |> Map.ofSeq\n else Map.empty\n\nopen Browser.Types\n\n(**\n#### Parsers\nParse based on `location.pathname` and `location.search`. This parser\nignores the hash entirely.\n*)\nlet parsePath (parser: Parser<_,_>) (location: Location) =\n parse parser location.pathname (parseParams location.search)\n\n(** Parse based on `location.hash`. This parser ignores the normal\npath entirely.\n*)\nlet parseHash (parser: Parser<_,_>) (location: Location) =\n let hash, search =\n let hash =\n if location.hash.Length > 1 then location.hash.Substring 1\n else \"\"\n if hash.Contains(\"?\") then\n let h = hash.Substring(0, hash.IndexOf(\"?\"))\n h, hash.Substring(h.Length)\n else\n hash, \"?\"\n\n parse parser hash (parseParams search)\n","module Pages\r\n\r\nopen Elmish.UrlParser\r\n\r\n/// The different pages of the application. If you add a new page, then add an entry here.\r\n[]\r\ntype Page =\r\n | Home\r\n //| Employees\r\n | Contract of string\r\n | Contracts\r\n | ContractProfitFadeReport\r\n | Company\r\n\r\n\r\nlet toPath =\r\n function\r\n | Page.Home -> \"/\"\r\n //| Page.Employees -> \"/employees\"\r\n | Page.Contract id -> \"/contract/\" + id\r\n | Page.Contracts -> \"/contracts\"\r\n | Page.ContractProfitFadeReport -> \"/profit-fade\"\r\n | Page.Company -> \"/company\"\r\n\r\n/// The URL is turned into a Result.\r\nlet pageParser : Parser Page, _> =\r\n oneOf [ //Main sites\r\n map Page.Home (s \"\")\r\n //map Page.Employees (s \"employees\")\r\n map Page.Contract (s \"contract\" str)\r\n map Page.Contracts (s \"contracts\")\r\n map Page.ContractProfitFadeReport (s \"profit-fade\")\r\n map Page.Company (s \"company\")\r\n ]\r\n\r\nlet urlParser location = parsePath pageParser location\r\n\r\nlet contractUrl (id: int64) =\r\n toPath (Page.Contract(id.ToString().Replace(\"+\", \"\")))\r\n\r\n//let goToEmployeeDetails id =\r\n// Navigation.newUrl (\"/employees/\" + id.ToString().Replace(\"+\", \"\"))\r\n// |> List.map (fun f -> f ignore)\r\n// |> ignore\r\n","namespace FSharpPlus.Internals\n\n/// \n/// \n/// Internal to the library - please ignore\n/// \n/// \n \ntype Default6 = class end\ntype Default5 = class inherit Default6 end\ntype Default4 = class inherit Default5 end\ntype Default3 = class inherit Default4 end\ntype Default2 = class inherit Default3 end\ntype Default1 = class inherit Default2 end\n\n#nowarn \"0042\" // retype\n\nmodule internal Prelude =\n open System\n \n let inline flip f x y = f y x\n let inline const' k _ = k\n let inline tupleToOption x = match x with true, value -> Some value | _ -> None\n let inline opaqueId x = Unchecked.defaultof<_>; x\n \n let inline retype (x: 'T) : 'U =\n #if !FABLE_COMPILER\n (# \"\" x: 'U #)\n #else\n unbox<'U> x\n #endif\n\n let inline tuple1<'t> (x: 't) =\n #if FABLE_COMPILER\n let t = ((),(),(),(),(),(),(),x)\n t.Rest\n #else\n System.Tuple<_> x\n #endif\n\n let inline valueTuple1<'T1> (t1: 'T1) = ValueTuple.Create t1\n\n[]\nmodule internal Implicit = let inline Invoke (x: ^t) = ((^R or ^t) : (static member op_Implicit : ^t -> ^R) x) : ^R\n\nmodule Errors =\n let exnDivByZero = new System.DivideByZeroException () :> exn\n let exnNoDivision = new System.Exception \"These numbers are not divisible in this domain.\"\n let exnSqrtOfNegative = new System.Exception \"Cannot calculate square root of a negative number\"\n let exnNoSqrt = new System.Exception \"No square root defined for this value in this domain.\"\n let exnNoSubtraction = new System.Exception \"No subtraction defined for these values in this domain.\"\n let exnUnreachable = new System.InvalidOperationException \"This execution path is unreachable.\"\n\n let inline raiseIfNull paramName paramValue =\n if isNull paramValue then\n nullArg paramName\n\nmodule Decimal =\n let inline trySqrt x =\n match sign x with\n | -1 -> Error Errors.exnSqrtOfNegative\n | 0 -> Ok 0.M\n | _ ->\n let rec loop previous =\n let current = (previous + x / previous) / 2.0M\n if previous - current = 0.0M then current else loop current\n x |> float |> sqrt |> decimal |> loop |> Ok\n\nmodule Rational =\n let inline numerator x = (^F : (member Numerator : 'R) x)\n let inline denominator x = (^F : (member Denominator : 'R) x)\n\nmodule BigInteger =\n open System.Numerics\n let trySqrtRem x =\n if sign x = -1 then Error Errors.exnSqrtOfNegative\n else\n let rec loop previous =\n let current = (previous + x / previous) >>> 1\n if abs (previous - current) < 2I then current else loop current\n #if !FABLE_COMPILER\n let guess = 10I ** (((int (BigInteger.Log10 (x + 1I))) + 1) >>> 1)\n #else\n let guess = 10I ** (((int ((x + 1I))) + 1) >>> 1)\n #endif\n let r = loop guess\n let r2 = r * r\n match compare r2 x with\n | 0 -> Ok (r, 0I)\n | 1 -> let root = r - 1I in Ok (root, x - root * root)\n | _ -> Ok (r, x - r2)\n\nmodule Constraints =\n /// Constrain 't to be a nested tuple of <'t1,'t2,'t3,'t4,'t5,'t6,'t7,'tr>\n let inline whenNestedTuple (t: 't) = \n (^t: (member Item1: 't1) t), (^t: (member Item2: 't2) t), (^t: (member Item3: 't3) t), (^t: (member Item4: 't4) t), (^t: (member Item5: 't5) t), (^t: (member Item6: 't6) t), (^t: (member Item7: 't7) t), (^t: (member Rest: 'tr) t)\n\n// Dummy types\n\ntype Id<'t> (v: 't) =\n let value = v\n member _.getValue = value\n\n[]\nmodule Id =\n let run (x: Id<_>) = x.getValue\n let map f (x: Id<_>) = Id (f x.getValue)\n let create x = Id x\n\ntype Id0 (v: string) =\n let value = v\n member _.getValue = value\n\ntype Either<'t,'u> =\n | Left of 't\n | Right of 'u\n\ntype DmStruct = struct end\n\n[]\ntype Set2<'T when 'T: comparison >() = class end\n\n// BitConverter\n\n#nowarn \"9\"\n#nowarn \"51\"\nopen System\nopen Microsoft.FSharp.NativeInterop\n\ntype BitConverter =\n /// Converts a byte into an array of bytes with length one.\n static member GetBytes (value: bool) = Array.singleton (if value then 1uy else 0uy)\n\n #if !FABLE_COMPILER\n /// Converts a char into an array of bytes with length two.\n static member GetBytes (value: char, isLittleEndian: bool) = BitConverter.GetBytes (int16 value, isLittleEndian)\n\n /// Converts a short into an array of bytes with length\n /// two.\n static member GetBytes (value: int16, isLittleEndian: bool) =\n if not isLittleEndian then [|byte (value >>> 8); byte value|]\n else\n let bytes : byte [] = Array.zeroCreate 2\n use x = fixed bytes\n x |> NativePtr.toNativeInt |> NativePtr.ofNativeInt |> NativePtr.write <| value\n bytes\n\n /// Converts an int into an array of bytes with length\n /// four.\n static member GetBytes (value: int, isLittleEndian) =\n if not isLittleEndian then [|byte (value >>> 24); byte (value >>> 16); byte (value >>> 8); byte value|]\n else\n let bytes : byte [] = Array.zeroCreate 4\n use x = fixed bytes\n x |> NativePtr.toNativeInt |> NativePtr.ofNativeInt |> NativePtr.write <| value\n bytes\n\n /// Converts a long into an array of bytes with length\n /// eight.\n static member GetBytes (value: int64, isLittleEndian) =\n if not isLittleEndian then [|byte (value >>> 56); byte (value >>> 48); byte (value >>> 40); byte (value >>> 32); byte (value >>> 24); byte (value >>> 16); byte (value >>> 8); byte value|]\n else\n let bytes : byte [] = Array.zeroCreate 8\n use x = fixed bytes\n x |> NativePtr.toNativeInt |> NativePtr.ofNativeInt |> NativePtr.write <| value\n bytes\n\n\n /// Converts an ushort into an array of bytes with\n /// length two.\n static member GetBytes (value: uint16, isLittleEndian) = BitConverter.GetBytes (int16 value, isLittleEndian)\n\n /// Converts an uint into an array of bytes with\n /// length four.\n static member GetBytes (value: uint32, isLittleEndian) = BitConverter.GetBytes (int value, isLittleEndian)\n\n /// Converts an unsigned long into an array of bytes with\n /// length eight.\n static member GetBytes (value: uint64, isLittleEndian) = BitConverter.GetBytes (int64 value, isLittleEndian)\n\n /// Converts a float into an array of bytes with length\n /// four.\n static member GetBytes (value: float32, isLittleEndian) =\n let mutable value = value\n BitConverter.GetBytes ((&&value |> NativePtr.toNativeInt |> NativePtr.ofNativeInt |> NativePtr.read : int), isLittleEndian)\n\n /// Converts a double into an array of bytes with length\n /// eight.\n static member GetBytes (value: float, isLittleEndian) =\n let mutable value = value\n BitConverter.GetBytes ((&&value |> NativePtr.toNativeInt |> NativePtr.ofNativeInt |> NativePtr.read : int64), isLittleEndian)\n\n /// Converts an array of bytes into a char.\n static member ToChar (value: byte [], startIndex: int, isLittleEndian: bool) =\n char <| BitConverter.ToInt16 (value, startIndex, isLittleEndian)\n\n /// Converts an array of bytes into a short.\n static member ToInt16 (value: byte[], startIndex: int, isLittleEndian: bool) =\n if isNull value then nullArg \"value\"\n if startIndex >= value.Length then raise <| new ArgumentOutOfRangeException (\"startIndex\", \"ArgumentOutOfRange_Index\")\n if startIndex > value.Length - 2 then raise <| new ArgumentException \"Arg_ArrayPlusOffTooSmall\"\n use pbyte = fixed &value.[startIndex]\n if isLittleEndian then\n if startIndex % 2 = 0 then // data is aligned\n pbyte |> NativePtr.toNativeInt |> NativePtr.ofNativeInt |> NativePtr.read\n else (int16 (NativePtr.get pbyte 0)) ||| (int16 (NativePtr.get pbyte 1) <<< 8)\n else (int16 (NativePtr.get pbyte 0) <<< 8) ||| (int16 (NativePtr.get pbyte 1))\n\n /// Converts an array of bytes into an int.\n static member ToInt32 (value: byte[], startIndex: int, isLittleEndian: bool) : int =\n if isNull value then nullArg \"value\"\n if startIndex >= value.Length then raise <| new ArgumentOutOfRangeException (\"startIndex\", \"ArgumentOutOfRange_Index\")\n if startIndex > value.Length - 4 then raise <| new ArgumentException \"Arg_ArrayPlusOffTooSmall\"\n use pbyte = fixed &value.[startIndex]\n if isLittleEndian then\n if startIndex % 4 = 0 then // data is aligned\n pbyte |> NativePtr.toNativeInt |> NativePtr.ofNativeInt |> NativePtr.read\n else (int (NativePtr.get pbyte 0)) ||| (int (NativePtr.get pbyte 1) <<< 8) ||| (int (NativePtr.get pbyte 2) <<< 16) ||| (int (NativePtr.get pbyte 3) <<< 24)\n else (int (NativePtr.get pbyte 0) <<< 24) ||| (int (NativePtr.get pbyte 1) <<< 16) ||| (int (NativePtr.get pbyte 2) <<< 8) ||| (int (NativePtr.get pbyte 3))\n\n /// Converts an array of bytes into a long.\n static member ToInt64 (value: byte[], startIndex: int, isLittleEndian: bool) =\n if isNull value then nullArg \"value\"\n if startIndex >= value.Length then raise <| new ArgumentOutOfRangeException (\"startIndex\", \"ArgumentOutOfRange_Index\")\n if startIndex > value.Length - 8 then raise <| new ArgumentException \"Arg_ArrayPlusOffTooSmall\"\n use pbyte = fixed &value.[startIndex]\n if isLittleEndian then\n if startIndex % 8 = 0 then // data is aligned\n pbyte |> NativePtr.toNativeInt |> NativePtr.ofNativeInt |> NativePtr.read\n else \n let i1 = (int64 (NativePtr.get pbyte 0)) ||| (int64 (NativePtr.get pbyte 1) <<< 8) ||| (int64 (NativePtr.get pbyte 2) <<< 16) ||| (int64 (NativePtr.get pbyte 3) <<< 24)\n let i2 = (int64 (NativePtr.get pbyte 4)) ||| (int64 (NativePtr.get pbyte 5) <<< 8) ||| (int64 (NativePtr.get pbyte 6) <<< 16) ||| (int64 (NativePtr.get pbyte 7) <<< 24)\n int64 i1 ||| ((int64 i2) <<< 32)\n else\n let i1 = (int64 (NativePtr.get pbyte 0) <<< 24) ||| (int64 (NativePtr.get pbyte 1) <<< 16) ||| (int64 (NativePtr.get pbyte 2) <<< 8) ||| (int64 (NativePtr.get pbyte 3))\n let i2 = (int64 (NativePtr.get pbyte 4) <<< 24) ||| (int64 (NativePtr.get pbyte 5) <<< 16) ||| (int64 (NativePtr.get pbyte 6) <<< 8) ||| (int64 (NativePtr.get pbyte 7))\n i2 ||| (i1 <<< 32)\n\n\n /// Converts an array of bytes into an ushort.\n ///\n static member ToUInt16 (value: byte [], startIndex, isLittleEndian) = uint16 <| BitConverter.ToInt16 (value, startIndex, isLittleEndian)\n\n /// Converts an array of bytes into an uint.\n ///\n static member ToUInt32 (value: byte [], startIndex, isLittleEndian) = uint32 <| BitConverter.ToInt32 (value, startIndex, isLittleEndian)\n\n /// Converts an array of bytes into an unsigned long.\n ///\n static member ToUInt64 (value: byte [], startIndex, isLittleEndian) = uint64 <| BitConverter.ToInt64 (value, startIndex, isLittleEndian)\n\n /// Converts an array of bytes into a float.\n static member ToSingle (value: byte [], startIndex, isLittleEndian) : float32 =\n let mutable value = BitConverter.ToInt32 (value, startIndex, isLittleEndian)\n &&value |> NativePtr.toNativeInt |> NativePtr.ofNativeInt |> NativePtr.read\n\n /// Converts an array of bytes into a double.\n static member ToDouble (value: byte [], startIndex, isLittleEndian) : float =\n let mutable value = BitConverter.ToInt64 (value, startIndex, isLittleEndian)\n &&value |> NativePtr.toNativeInt |> NativePtr.ofNativeInt |> NativePtr.read\n #endif\n\n static member private GetHexValue (i: int) =\n Diagnostics.Debug.Assert (i >= 0 && i < 16, \"i is out of range.\")\n if i < 10 then char i + '0'\n else char (i - 10) + 'A'\n\n /// Converts an array of bytes into a String.\n static member ToString (value: byte [], startIndex, length) =\n if isNull value then nullArg \"value\"\n let arrayLen = value.Length\n if startIndex >= value.Length then raise <| new ArgumentOutOfRangeException (\"startIndex\", \"ArgumentOutOfRange_StartIndex\") \n let realLength = length\n if realLength < 0 then raise <| new ArgumentOutOfRangeException (\"length\", \"ArgumentOutOfRange_GenericPositive\")\n if startIndex > arrayLen - realLength then raise <| new ArgumentException \"Arg_ArrayPlusOffTooSmall\"\n if realLength = 0 then String.Empty\n else\n let chArray = Array.zeroCreate (realLength * 3)\n let mutable index = startIndex\n for i in 0 .. 3 .. (3 * realLength) - 1 do\n let b = int value.[index]\n index <- index + 1\n chArray.[i] <- BitConverter.GetHexValue (b / 16)\n chArray.[i + 1] <- BitConverter.GetHexValue (b % 16)\n chArray.[i + 2] <- '-'\n\n // We don't need the last '-' character\n String (chArray, 0, chArray.Length - 1)\n\n /// Converts an array of bytes into a String.\n static member ToString (value: byte []) =\n if isNull value then nullArg \"value\"\n BitConverter.ToString (value, 0, value.Length)\n\n /// Converts an array of bytes into a String.\n static member ToString (value: byte [], startIndex) =\n if isNull value then nullArg \"value\"\n BitConverter.ToString (value, startIndex, value.Length - startIndex)\n\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n// findSliceIndex\nmodule FindSliceIndex =\n open System.Collections.Generic\n #if !FABLE_COMPILER\n open System.Linq\n let seqImpl (slice: seq<_>) (source: seq<_>) =\n let cache = Queue<_>()\n // we assume the slice is finite (otherwise it cannot be searched)\n let slice = slice |> Seq.toArray\n use sourceEnumerator = source.GetEnumerator()\n // we also assume either the source is finite or it actually contains the slice.\n let rec go index =\n if sourceEnumerator.MoveNext() then\n cache.Enqueue sourceEnumerator.Current\n if cache.Count = slice.Length then\n if cache.SequenceEqual slice then index - slice.Length + 1\n else\n cache.Dequeue() |> ignore\n go (index + 1)\n else go (index + 1)\n else -1\n go 0\n let sequenceEqual (a: _ seq) (b: _ seq) = a.SequenceEqual b\n #else\n let internal sequenceEqual (a: _ seq) (b: _ seq) :bool = Seq.compareWith Operators.compare a b = 0\n module internal Q=\n type queue<'a> = | Queue of 'a list * 'a list\n\n let empty = Queue([], [])\n\n let enqueue q e = match q with | Queue(fs, bs) -> Queue(e :: fs, bs)\n\n let dequeue =\n function\n | Queue([], []) as q -> None, q\n | Queue(fs, b :: bs) -> Some b, Queue(fs, bs)\n | Queue(fs, []) ->\n let bs = List.rev fs\n Some bs.Head, Queue([], bs.Tail)\n let toSeq =\n function\n | Queue([], []) -> Seq.empty\n | Queue(fs, bs) -> bs @ List.rev fs |> List.toSeq\n let length =\n function\n | Queue([], []) -> 0\n | Queue(fs, bs) -> List.length bs + List.length fs\n open System.Collections\n type Queue<'T> () =\n let mutable q : Q.queue<'T> = Q.empty\n interface IEnumerable<'T> with\n member _.GetEnumerator () = let s = Q.toSeq q in s.GetEnumerator()\n interface IEnumerable with\n member _.GetEnumerator () = let s = Q.toSeq q in s.GetEnumerator() :> IEnumerator\n member _.Enqueue (v) = q <- Q.enqueue q v\n member _.Dequeue () =\n let (dequeued, next) = Q.dequeue q in q <- next\n match dequeued with | Some v -> v | None -> failwith \"Empty queue!\"\n member _.Count = Q.length q\n #endif\n\n let listImpl (slice: _ list) (source: _ list) =\n let cache = Queue<_>()\n // List.length is O(n)\n let sliceLength = slice.Length\n let rec go index source =\n match source with\n | h :: t ->\n cache.Enqueue h\n if cache.Count = sliceLength then\n if sequenceEqual cache slice then index - sliceLength + 1\n else\n cache.Dequeue() |> ignore\n go (index + 1) t\n else go (index + 1) t\n | [] -> -1\n go 0 source\n\n let arrayImpl (slice: _ []) (source: _ []) =\n let cache = Queue<_>()\n let rec go index =\n if index < source.Length then\n let h = source.[index]\n cache.Enqueue h\n if cache.Count = slice.Length then\n if sequenceEqual cache slice then index - slice.Length + 1\n else\n cache.Dequeue() |> ignore\n go (index + 1)\n else go (index + 1)\n else -1\n go 0\n#endif\n\n#if FABLE_COMPILER\nexception AggregateException of Exception seq\n\n#endif\n","namespace FSharpPlus.Control\n\nopen System\nopen System.Runtime.CompilerServices\nopen System.Runtime.InteropServices\nopen System.Text\nopen System.Collections.Generic\nopen System.Threading.Tasks\nopen Microsoft.FSharp.Quotations\n\nopen FSharpPlus.Internals\nopen FSharpPlus.Internals.Prelude\nopen FSharpPlus\nopen FSharpPlus.Data\n\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\n// Functor class ----------------------------------------------------------\n\ntype Iterate =\n static member Iterate (x: Lazy<'T> , action) = action x.Value : unit\n static member Iterate (x: seq<'T> , action) = Seq.iter action x\n static member Iterate (x: option<'T> , action) = match x with Some x -> action x | _ -> ()\n static member Iterate (x: voption<'T> , action) = match x with ValueSome x -> action x | _ -> ()\n static member Iterate (x: list<'T> , action) = List.iter action x\n static member Iterate ((_: 'W, a: 'T), action) = action a :unit\n static member Iterate (x: 'T [] , action) = Array.iter action x\n #if !FABLE_COMPILER\n static member Iterate (x: 'T [,] , action) = Array2D.iter action x\n static member Iterate (x: 'T [,,] , action) = Array3D.iter action x\n static member Iterate (x: 'T [,,,] , action) =\n for i = 0 to Array4D.length1 x - 1 do\n for j = 0 to Array4D.length2 x - 1 do\n for k = 0 to Array4D.length3 x - 1 do\n for l = 0 to Array4D.length4 x - 1 do\n action x.[i,j,k,l]\n #endif\n #if !FABLE_COMPILER\n static member Iterate (x: Async<'T> , action) = action (Async.RunSynchronously x) : unit\n #else\n static member Iterate (x: Async<'T> , action) = action (x |> Async.Ignore |> Async.StartImmediate) : unit\n #endif\n static member Iterate (x: Result<'T, 'E> , action) = match x with Ok x -> action x | _ -> ()\n static member Iterate (x: Choice<'T, 'E> , action) = match x with Choice1Of2 x -> action x | _ -> ()\n static member Iterate (KeyValue(_: 'Key, x: 'T), action) = action x : unit\n static member Iterate (x: Map<'Key,'T> , action) = Map.iter (const' action) x \n static member Iterate (x: Dictionary<'Key, 'T> , action) = Seq.iter action x.Values\n static member Iterate (x: _ ResizeArray , action) = Seq.iter action x\n\n // Restricted\n static member Iterate (x:string , action) = String.iter action x\n static member Iterate (x:StringBuilder , action) = String.iter action (string x)\n static member Iterate (x:Set<'T> , action) = Set.iter action x\n\n static member inline Invoke (action: 'T->unit) (source: '``Functor<'T>``) : unit =\n let inline call (_: ^M, source: ^I) = ((^M or ^I) : (static member Iterate : _*_ -> _) source, action)\n call (Unchecked.defaultof, source)\n\n#endif\n\ntype Map =\n inherit Default1\n\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\n static member Map ((x: Lazy<_> , f: 'T->'U), _mthd: Map) = Lazy.map f x\n #if !FABLE_COMPILER\n static member Map ((x: Task<'T> , f: 'T->'U), _mthd: Map) = Task.map f x : Task<'U>\n #endif\n #if NETSTANDARD2_1 && !FABLE_COMPILER\n static member Map ((x: ValueTask<'T> , f: 'T->'U), _mthd: Map) = ValueTask.map f x : ValueTask<'U>\n #endif\n static member Map ((x: option<_> , f: 'T->'U), _mthd: Map) = Option.map f x\n #if !FABLE_COMPILER\n static member Map ((x: voption<_> , f: 'T->'U), _mthd: Map) = ValueOption.map f x\n #endif\n static member Map ((x: list<_> , f: 'T->'U), _mthd: Map) = List.map f x : list<'U>\n static member Map ((g: 'R->'T , f: 'T->'U), _mthd: Map) = (>>) g f\n static member Map ((g: Func<'R, 'T> , f: 'T->'U), _mthd: Map) = Func<'R, 'U> (g.Invoke >> f)\n static member Map (((m: 'Monoid, a) , f: 'T->'U), _mthd: Map) = (m, f a)\n static member Map ((struct (m: 'Monoid, a) , f: 'T->'U), _mthd: Map) = struct (m, f a)\n static member Map ((x: _ [] , f: 'T->'U), _mthd: Map) = Array.map f x\n #if !FABLE_COMPILER\n static member Map ((x: _ [,] , f: 'T->'U), _mthd: Map) = Array2D.map f x\n static member Map ((x: _ [,,] , f: 'T->'U), _mthd: Map) = Array3D.map f x\n static member Map ((x: _ [,,,] , f: 'T->'U), _mthd: Map) = Array4D.init (x.GetLength 0) (x.GetLength 1) (x.GetLength 2) (x.GetLength 3) (fun a b c d -> f x.[a,b,c,d])\n #endif\n static member Map ((x: Async<_> , f: 'T->'U), _mthd: Map) = Async.map f x\n static member Map ((x: Result<_,'E> , f: 'T->'U), _mthd: Map) = Result.map f x\n static member Map ((x: Choice<_,'E> , f: 'T->'U), _mthd: Map) = Choice.map f x\n static member Map ((KeyValue(k, x) , f: 'T->'U), _mthd: Map) = KeyValuePair (k, f x)\n static member Map ((x: Map<'Key,'T> , f: 'T->'U), _mthd: Map) = Map.map (const' f) x : Map<'Key,'U>\n static member Map ((x: Dictionary<_,_> , f: 'T->'U), _mthd: Map) = Dictionary.map f x : Dictionary<'Key,'U>\n #if !FABLE_COMPILER\n static member Map ((x: Expr<'T> , f: 'T->'U), _mthd: Map) = Expr.Cast<'U> (Expr.Application (Expr.Value (f), x))\n #endif\n\n static member Map ((x: ResizeArray<'T> , f: 'T->'U), _mthd: Map) = ResizeArray.map f x\n\n // Restricted\n static member Map ((x: string , f ), _mthd: Map) = String.map f x\n static member Map ((x: StringBuilder , f ), _mthd: Map) = StringBuilder (String.map f (string x))\n static member Map ((x: Set<_> , f ), _mthd: Map) = Set.map f x\n static member Map ((_: Set2<'T> , _: 'T->'U), _mthd: Map) = Set2<'U>()\n\n\n static member inline Invoke (mapping: 'T->'U) (source: '``Functor<'T>``) : '``Functor<'U>`` = \n let inline call (mthd: ^M, source: ^I, _output: ^R) = ((^M or ^I or ^R) : (static member Map : (_*_)*_ -> _) (source, mapping), mthd)\n call (Unchecked.defaultof, source, Unchecked.defaultof<'``Functor<'U>``>)\n\n#endif\n\n static member inline InvokeOnInstance (mapping: 'T->'U) (source: '``Functor<'T>``) : '``Functor<'U>`` = \n (^``Functor<'T>`` : (static member Map : _ * _ -> _) source, mapping)\n\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\n\ntype Map with\n static member inline Map ((x: '``Monad<'T>`` when '``Monad<'T>`` : (static member (>>=) : '``Monad<'T>`` * ('T -> '``Monad<'U>``) -> '``Monad<'U>``)\n and '``Monad<'U>`` : (static member Return : 'U -> '``Monad<'U>``)\n , f: 'T->'U), []_mthd: Default4) = Bind.InvokeOnInstance x (f >> Return.InvokeOnInstance) : '``Monad<'U>``\n\n static member inline Map ((x: '``Applicative<'T>`` when '``Applicative<'T>`` : (static member (<*>) : '``Applicative<'T->'U>`` * '``Applicative<'T>`` -> '``Applicative<'U>``)\n and '``Applicative<'T->'U>`` : (static member Return : ('T -> 'U) -> '``Applicative<'T->'U>``)\n , f: 'T->'U), []_mthd: Default3) = Apply.InvokeOnInstance (Return.InvokeOnInstance f: '``Applicative<'T->'U>``) x : '``Applicative<'U>``\n\n static member Map ((x: seq<_> , f: 'T->'U), _mthd: Default2) = Seq.map f x : seq<'U>\n static member Map ((x: NonEmptySeq<_> , f: 'T->'U), _mthd: Default2) = NonEmptySeq.map f x : NonEmptySeq<'U>\n static member Map ((x: IEnumerator<_> , f: 'T->'U), _mthd: Default2) = Enumerator.map f x : IEnumerator<'U>\n static member Map ((x: IDictionary<_,_> , f: 'T->'U), _mthd: Default2) = Dict.map f x : IDictionary<'Key,'U>\n static member Map ((x: IReadOnlyDictionary<_,_>, f: 'T->'U), _mthd: Default2) = IReadOnlyDictionary.map f x : IReadOnlyDictionary<'Key,_>\n static member Map ((x: IObservable<'T> , f: 'T->'U), _mthd: Default2) = Observable.map f x : IObservable<'U>\n #if !FABLE_COMPILER\n static member Map ((x: Nullable<_> , f: 'T->'U), _mthd: Default2) = Nullable.map f x : Nullable<'U>\n #endif\n static member Map ((x: IReadOnlyCollection<'T> , f: 'T->'U), _mthd: Default1) = IReadOnlyCollection.map f x : IReadOnlyCollection<'U>\n static member inline Map ((x: '``Functor<'T>`` , f: 'T->'U), _mthd: Default1) = Map.InvokeOnInstance f x : '``Functor<'U>``\n static member inline Map ((_: ^t when ^t: null and ^t: struct, _ ), _mthd: Default1) = ()\n\n#endif\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\ntype Unzip =\n inherit Default1\n static member inline Unzip ((source: '``Functor<'T * 'U>`` , _output: '``Functor<'T>`` * '``Functor<'U>`` ) , _mthd: Default2) = Map.InvokeOnInstance fst source, Map.Invoke snd source : '``Functor<'T>`` * '``Functor<'U>``\n static member inline Unzip ((source: '``Functor<'T * 'U>`` , _output: '``Functor<'T>`` * '``Functor<'U>`` ) , _mthd: Default1) = (^``Functor<'T * 'U>``: (static member Unzip : _->_) source) : '``Functor<'T>`` * '``Functor<'U>``\n static member inline Unzip (( _ : ^t when ^t: null and ^t: struct , _ ) , _ ) = ()\n \n static member Unzip ((source: Lazy<'T * 'U> , _output: Lazy<'T> * Lazy<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n\n #if !FABLE_COMPILER\n static member Unzip ((source: Task<'T * 'U> , _output: Task<'T> * Task<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n #endif\n #if NETSTANDARD2_1 && !FABLE_COMPILER\n static member Unzip ((source: ValueTask<'T * 'U> , _output: ValueTask<'T> * ValueTask<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n #endif\n static member Unzip ((source: option<'T * 'U> , _output: option<'T> * option<'U> ) , _mthd: Unzip ) = Option.unzip source\n static member Unzip ((source: voption<'T * 'U> , _output: voption<'T> * voption<'U> ) , _mthd: Unzip ) = ValueOption.unzip source\n\n static member Unzip ((source: list<'T * 'U> , _output: list<'T> * list<'U> ) , _mthd: Unzip ) = List.unzip source\n static member Unzip ((source: 'R -> ('T * 'U) , _output: ('R -> 'T) * ('R -> 'U) ) , _mthd: Unzip ) = (fun x -> fst (source x)), (fun x -> snd (source x))\n static member Unzip ((source: Func<'R, ('T * 'U)> , _output: Func<'R,'T> * Func<'R,'U> ) , _mthd: Unzip ) = Func<_,_> (fun x -> fst (source.Invoke x)), Func<_,_> (fun x -> snd (source.Invoke x))\n static member Unzip (((m: 'Monoid, t: ('T * 'U)) , _output: ('Monoid * 'T) * ('Monoid * 'U) ) , _mthd: Unzip ) = (m, fst t), (m, snd t)\n static member Unzip ((struct (m: 'Monoid, t: ('T * 'U)) , _output: struct ('Monoid * 'T) * struct ('Monoid * 'U) ) , _mthd: Unzip ) = struct (m, fst t), struct (m, snd t)\n static member Unzip ((source: ('T * 'U) [] , _output: 'T [] * 'U [] ) , _mthd: Unzip ) = Array.unzip source\n #if !FABLE_COMPILER\n static member Unzip ((source: ('T * 'U) [,] , _output: 'T [,] * 'U [,] ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n static member Unzip ((source: ('T * 'U) [,,] , _output: 'T [,,] * 'U [,,] ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n static member Unzip ((source: ('T * 'U) [,,,] , _output: 'T [,,,] * 'U [,,,] ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n #endif\n\n static member Unzip ((source: Async<'T * 'U> , _output: Async<'T> * Async<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n static member Unzip ((source: Result<'T * 'U, 'E> , _output: Result<'T,'E> * Result<'U,'E> ) , _mthd: Unzip ) = Result.unzip source\n static member Unzip ((source: Choice<'T * 'U, 'E> , _output: Choice<'T,'E> * Choice<'U,'E> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n static member Unzip ((source: KeyValuePair<'Key, 'T * 'U> , _output: KeyValuePair<_, 'T> * KeyValuePair<_, 'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n static member Unzip ((source: Map<'Key, 'T * 'U> , _output: Map<_, 'T> * Map<_, 'U> ) , _mthd: Unzip ) = Map.unzip source\n static member Unzip ((source: Dictionary<'Key, 'T * 'U> , _output: Dictionary<_, 'T> * Dictionary<_, 'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n\n #if !FABLE_COMPILER\n static member Unzip ((source: Expr<'T * 'U> , _output: Expr<'T> * Expr<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n #endif\n\n static member Unzip ((source: ResizeArray<'T * 'U> , _output: ResizeArray<'T> * ResizeArray<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n \n static member Unzip ((source: seq<'T * 'U> , _output: seq<'T> * seq<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n static member Unzip ((source: NonEmptySeq<'T * 'U> , _output: NonEmptySeq<'T> * NonEmptySeq<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n\n static member Unzip ((source: IEnumerator<'T * 'U> , _output: IEnumerator<'T> * ResizeArray<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n static member Unzip ((source: IDictionary<'Key, 'T * 'U> , _output: IDictionary<_,'T> * IDictionary<_,'U> ) , _mthd: Unzip ) = Dict.unzip source\n static member Unzip ((source: IReadOnlyDictionary<'Key,'T * 'U> , _output: IReadOnlyDictionary<_,'T> * IReadOnlyDictionary<_,'U>) , _mthd: Unzip ) = IReadOnlyDictionary.unzip source\n static member Unzip ((source: IObservable<'T * 'U> , _output: IObservable<'T> * ResizeArray<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source\n\n []static member Unzip (source: list<'T * 'U> , []_output: list<'T> * list<'U> , []_mthd:Unzip ) = List.unzip source\n []static member Unzip (source: ('T * 'U) [] , []_output: 'T [] * 'U [] , []_mthd:Unzip ) = Array.unzip source\n\n\n static member inline Invoke (source: '``Functor<'T1 * 'T2>``) =\n let inline call_3 (a: ^a, b: ^b, d: ^d) = ((^a or ^b or ^d) : (static member Unzip : (_*_)*_ -> _) (b, d), a)\n let inline call (a: 'a, b: 'b) = call_3 (a, b, Unchecked.defaultof<'r>) : 'r\n call (Unchecked.defaultof, source) : '``Functor<'T1>`` * '``Functor<'T2>``\n\n#endif\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\ntype Zip =\n inherit Default1\n static member Zip ((x: IEnumerator<'T> , y: IEnumerator<'U> , _output: IEnumerator<'T*'U> ), _mthd: Zip) = Enumerator.zip x y\n static member Zip ((x: seq<'T> , y: seq<'U> , _output: seq<'T*'U> ), _mthd: Zip) = Seq.zip x y\n static member Zip ((x: NonEmptySeq<'T> , y: NonEmptySeq<'U> , _output: NonEmptySeq<'T*'U> ), _mthd: Zip) = NonEmptySeq.zip x y\n static member Zip ((x: IDictionary<'K, 'T> , y: IDictionary<'K,'U> , _output: IDictionary<'K,'T*'U> ), _mthd: Zip) = Dict.zip x y\n static member Zip ((x: IReadOnlyDictionary<'K, 'T>, y: IReadOnlyDictionary<'K,'U>, _output: IReadOnlyDictionary<'K,'T*'U>), _mthd: Zip) = IReadOnlyDictionary.zip x y\n static member Zip ((x: Dictionary<'K, 'T> , y: Dictionary<'K,'U> , _output: Dictionary<'K,'T*'U> ), _mthd: Zip) = Dict.zip x y :?> Dictionary<'K,'T*'U>\n static member Zip ((x: Map<'K, 'T> , y: Map<'K,'U> , _output: Map<'K,'T*'U> ), _mthd: Zip) = Map.zip x y\n static member Zip ((f: 'R -> 'T , g: 'R -> 'U , _output: 'R -> 'T * 'U ), _mthd: Zip) = fun x -> (f x, g x)\n static member Zip ((f: Func<'R, 'T> , g: Func<'R, 'U> , _output: Func<'R, 'T * 'U> ), _mthd: Zip) = Func<_,_> (fun x -> (f.Invoke x, g.Invoke x))\n static member Zip ((x: list<'T> , y: list<'U> , _output: list<'T*'U> ), _mthd: Zip) = List.zipShortest x y\n static member Zip ((x: 'T [] , y: 'U [] , _output: ('T*'U) [] ), _mthd: Zip) = Array.zipShortest x y\n static member Zip ((x: ResizeArray<'T> , y: ResizeArray<'U> , _output: ResizeArray<'T*'U> ), _mthd: Zip) = ResizeArray.zipShortest x y\n static member Zip ((x: option<'T> , y: option<'U> , _output: option<'T*'U> ), _mthd: Zip) = Option.zip x y\n static member Zip ((x: voption<'T> , y: voption<'U> , _output: voption<'T*'U> ), _mthd: Zip) = ValueOption.zip x y\n static member Zip ((x: Result<'T, 'Error> , y: Result<'U, 'Error> , _output: Result<'T * 'U, 'Error> ), _mthd: Zip) = Result.zip x y\n static member Zip ((x: Async<'T> , y: Async<'U> , _output: Async<'T*'U> ), _mthd: Zip) = Async.zip x y\n #if !FABLE_COMPILER\n static member Zip ((x: Task<'T> , y: Task<'U> , _output: Task<'T*'U> ), _mthd: Zip) = Task.zip x y\n #endif\n #if NETSTANDARD2_1 && !FABLE_COMPILER\n static member Zip ((x: ValueTask<'T> , y: ValueTask<'U> , _output: ValueTask<'T*'U> ), _mthd: Zip) = ValueTask.zip x y\n #endif\n\n static member inline Invoke (source1: '``ZipFunctor<'T1>``) (source2: '``ZipFunctor<'T2>``) =\n let inline call_4 (a: ^a, b: ^b, c: ^c, d: ^d) = ((^a or ^b or ^c or ^d) : (static member Zip : (_*_*_)*_ -> _) (b, c, d), a)\n let inline call (a: 'a, b: 'b, c: 'c) = call_4 (a, b, c, Unchecked.defaultof<'r>) : 'r\n call (Unchecked.defaultof, source1, source2) : '``ZipFunctor<'T1 * 'T2>``\n\n static member inline InvokeOnInstance (source1: '``ZipFunctor<'T1>``) (source2: '``ZipFunctor<'T2>``) : '``ZipFunctor<'T1 * 'T2>`` =\n ((^``ZipFunctor<'T1>`` or ^``ZipFunctor<'T2>`` or ^``ZipFunctor<'T1 * 'T2>``) : (static member Zip : _*_ -> _) source1, source2)\n\ntype Zip with \n static member inline Zip ((_: ^t when ^t : null and ^t: struct, _: ^u when ^u : null and ^u: struct, _output: ^r when ^r : null and ^r: struct), _mthd: Default1) = id\n static member inline Zip ((x: '``ZipFunctor<'T1>`` , y: '``ZipFunctor<'T2>`` , _output: '``ZipFunctor<'T1 * 'T2>`` ), _mthd: Default1) = Zip.InvokeOnInstance x y : '``ZipFunctor<'T1 * 'T2>``\n\n#endif\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\n// Bifunctor class --------------------------------------------------------\n\ntype Bimap =\n inherit Default1\n \n static member Bimap ((x: 'T1, y: 'T2) , f: 'T1->'U1, g: 'T2->'U2, []_mthd: Bimap) = (f x, g y)\n static member Bimap (struct (x: 'T1, y: 'T2), f: 'T1->'U1, g: 'T2->'U2, []_mthd: Bimap) = struct (f x, g y)\n static member Bimap (x: Result<'T2, 'T1> , f: 'T1->'U1, g: 'T2->'U2, []_mthd: Bimap) = Result.either (Ok << g) (Error << f) x\n static member Bimap (KeyValue(k:'T1, x:'T2), f: 'T1->'U1, g: 'T2->'U2, []_mthd: Bimap) = KeyValuePair (f k, g x)\n static member Bimap (x: Choice<'T2, 'T1> , f: 'T1->'U1, g: 'T2->'U2, []_mthd: Bimap) = Choice.either (Choice1Of2 << g) (Choice2Of2 << f) x\n\n static member inline Invoke (f: 'T->'U) (g: 'V->'W) (source: '``Bifunctor<'T,'V>``) : '``Bifunctor<'U,'W>`` =\n let inline call (mthd: ^M, source: ^I, _output: ^R) = ((^M or ^I or ^R) : (static member Bimap : _*_*_*_ -> _) source, f, g, mthd)\n call (Unchecked.defaultof, source, Unchecked.defaultof<'``Bifunctor<'U,'W>``>)\n\n static member inline InvokeOnInstance (f: 'T->'U) (g: 'V->'W) (source: '``Bifunctor<'T,'V>``) : '``Bifunctor<'U,'W>`` =\n (^``Bifunctor<'T,'V>``: (static member Bimap : _*_*_ -> _) source, f, g)\n\n#endif\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\ntype MapFirst =\n inherit Default1\n\n static member First ((x: 'T1, y: 'T2) , f: 'T1->'U1, []_mthd: MapFirst) = (f x, y)\n static member First (struct (x: 'T1, y: 'T2) , f: 'T1->'U1, []_mthd: MapFirst) = struct (f x, y)\n static member First (x: Result<'T2, 'T1> , f: 'T1->'U1, []_mthd: MapFirst) = Result.either Ok (Error << f) x\n static member First (x: Choice<'T2, 'T1> , f: 'T1->'U1, []_mthd: MapFirst) = Choice.either Choice1Of2 (Choice2Of2 << f) x\n static member First (KeyValue(k: 'T1, x: 'T2), f: 'T1->'U1, []_mthd: MapFirst) = KeyValuePair (f k, x)\n\n static member inline Invoke (f: 'T->'U) (source: '``Bifunctor<'T,'V>``) : '``Bifunctor<'U,'V>`` =\n let inline call (mthd: ^M, source: ^I, _output: ^R) = ((^M or ^I or ^R) : (static member First : _*_*_ -> _) source, f, mthd)\n call (Unchecked.defaultof, source, Unchecked.defaultof<'``Bifunctor<'U,'V>``>)\n\n static member inline InvokeOnInstance (f: 'T->'V) (source: '``Bifunctor<'T,'V>``) : '``Bifunctor<'U,'V>`` =\n (^``Bifunctor<'T,'V>`` : (static member First : _*_ -> _) source, f)\n\ntype MapFirst with\n static member inline First (x: '``Bifunctor<'T,'V>``, f: 'T->'U, []_mthd: Default2) = Bimap.InvokeOnInstance f id x : '``Bifunctor<'U,'V>``\n\n static member inline First (x: '``Bifunctor<'T,'V>``, f: 'T->'U, []_mthd: Default1) = MapFirst.InvokeOnInstance f x : '``Bifunctor<'U,'V>``\n static member inline First (_: ^t when ^t: null and ^t: struct, _ : 'T->'U, _mthd: Default1) = ()\n\n\ntype Map with\n static member inline Map ((x: '``Bifunctor<'T,'V>``, f: 'V->'W), []_mthd: Default6) = Bimap.InvokeOnInstance id f x\n\n\ntype Bimap with\n static member inline Bimap (x: '``Bifunctor<'T,'V>``, f: 'T->'U, g: 'V->'W, []_mthd: Default2) = x |> MapFirst.InvokeOnInstance f |> Map.InvokeOnInstance g : '``Bifunctor<'U,'W>``\n\n static member inline Bimap (x: '``Bifunctor<'T,'V>``, f: 'T->'U, g: 'V->'W, []_mthd: Default1) = Bimap.InvokeOnInstance f g x : '``Bifunctor<'U,'W>``\n static member inline Bimap (_: ^t when ^t: null and ^t: struct, _: 'T->'U, _: 'V->'W, _mthd: Default1) = ()\n\n\n// Profunctor class -------------------------------------------------------\n\ntype Dimap =\n inherit Default1\n\n static member Dimap (f , g: 'A->'B, h: 'C->'D, []_mthd: Dimap) = g >> f >> h : 'A->'D\n static member Dimap (f: Func<'B,'C>, g: 'A->'B, h: 'C->'D, []_mthd: Dimap) = Func<'A,'D> (g >> f.Invoke >> h)\n \n static member inline Invoke (ab: 'A->'B) (cd: 'C->'D) (source: '``Profunctor<'B,'C>``) : '``Profunctor<'A,'D>`` =\n let inline call (mthd: ^M, source: ^I, _output: ^R) = ((^M or ^I or ^R) : (static member Dimap : _*_*_*_ -> _) source, ab, cd, mthd)\n call (Unchecked.defaultof, source, Unchecked.defaultof<'``Profunctor<'A,'D>``>)\n\n static member inline InvokeOnInstance (ab: 'A->'B) (cd: 'C->'D) (source: '``Profunctor<'B,'C>``) : '``Profunctor<'A,'D>`` =\n (^``Profunctor<'B,'C>`` : (static member Dimap : _*_*_ -> _) source, ab, cd)\n\n#endif\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\n// Contravariant class ----------------------------------------------------\n\ntype Contramap =\n inherit Default1\n\n static member inline Invoke (f: 'U -> 'T) (source: '``Contravariant<'T>``) : '``Contravariant<'U>`` = \n let inline call (mthd: ^M, source: ^I, _output: ^R) = ((^M or ^I or ^R) : (static member Contramap : _*_*_ -> _) source, f, mthd)\n call (Unchecked.defaultof, source, Unchecked.defaultof<'``Contravariant<'U>``>)\n\n static member inline InvokeOnInstance (ab: 'A->'B) (source: '``Profunctor<'B,'C>``) : '``Profunctor<'A,'C>`` =\n (^``Profunctor<'B,'C>`` : (static member Contramap : _*_ -> _) source, ab)\n\n static member Contramap (k: 'T -> 'C , f: 'U -> 'T, []_mthd: Contramap) = f >> k : 'U->'C\n static member Contramap (k: Func<'T, 'C> , f: 'U -> 'T, []_mthd: Contramap) = Func<'U, 'C> (f >> k.Invoke)\n #if !FABLE_COMPILER\n static member Contramap (p: Predicate<_> , f: 'U -> 'T, []_mthd: Contramap) = Predicate (fun x -> p.Invoke (f x)) \n static member Contramap (c: IComparer<_> , f: 'U -> 'T, []_mthd: Contramap) = { new IComparer<'U> with member _.Compare (x, y) = c.Compare (f x, f y) }\n static member Contramap (c: IEqualityComparer<_>, f: 'U -> 'T, []_mthd: Contramap) = { \n new IEqualityComparer<'U> with\n member _.Equals (x, y) = c.Equals (f x, f y)\n member _.GetHashCode x = c.GetHashCode (f x) }\n #endif\n#endif\n\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n \ntype Contramap with\n static member inline Contramap (x: '``Profunctor<'B,'C>``, f: 'A->'B, []_mthd: Default2) = Dimap.InvokeOnInstance f id x : '``Profunctor<'A,'C>``\n static member inline Contramap (x: '``Contravariant<'T>``, f: 'U->'T, []_mthd: Default1) = Contramap.InvokeOnInstance f x: '``Contravariant<'U>``\n static member inline Contramap (_: ^t when ^t: null and ^t: struct , _: 'A->'B, _mthd: Default1) = ()\n\n#endif\n#if !FABLE_COMPILER|| FABLE_COMPILER_3\n\ntype Map with\n static member inline Map ((x: '``Profunctor<'B,'C>``, cd: 'C->'D), []_mthd: Default5) = Dimap.InvokeOnInstance id cd x : '``Profunctor<'B,'D>``\n\n#endif\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\ntype Dimap with\n static member inline Dimap (x: '``Profunctor<'B,'C>``, ab: 'A->'B, cd: 'C->'D, []_mthd: Default2) = x |> Map.InvokeOnInstance cd |> Contramap.InvokeOnInstance ab : '``Profunctor<'A,'D>``\n static member inline Dimap (x: '``Profunctor<'B,'C>``, ab: 'A->'B, cd: 'C->'D, []_mthd: Default1) = Dimap.InvokeOnInstance ab cd x : '``Profunctor<'A,'D>``\n static member inline Dimap (_: ^t when ^t: null and ^t: struct, _: 'T->'U, _: 'V->'W, _mthd: Default1) = ()\n\n#endif\n\n// Invariant functor\n\ntype Invmap = static member inline Invoke (f: 'T -> 'U) (g: 'U -> 'T) (source: '``InvariantFunctor<'T>``) = (^``InvariantFunctor<'T>`` : (static member Invmap : _*_*_ -> _) source, f, g) : '``InvariantFunctor<'U>``\n","// Adapted from https://github.com/MikeMcl/big.js/blob/0f94dc9110d55c4f324a47ba6a2e832ce23ac589/big.mjs\n/* tslint:disable */\nimport { combineHashCodes } from \"../Util.js\";\nimport { symbol } from \"../Numeric.js\";\n// The shared prototype object.\nvar P = {\n GetHashCode() { return combineHashCodes([this.s, this.e].concat(this.c)); },\n Equals(x) { return !this.cmp(x); },\n CompareTo(x) { return this.cmp(x); },\n [symbol]() {\n const _this = this;\n return {\n multiply: y => _this.mul(y),\n toPrecision: sd => _this.toPrecision(sd),\n toExponential: dp => _this.toExponential(dp),\n toFixed: dp => _this.toFixed(dp),\n toHex: () => (Number(_this) >>> 0).toString(16),\n };\n }\n};\n/*\n * big.js v6.0.3\n * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.\n * Copyright (c) 2020 Michael Mclaughlin\n * https://github.com/MikeMcl/big.js/LICENCE.md\n */\n/************************************** EDITABLE DEFAULTS *****************************************/\n// The default values below must be integers within the stated ranges.\n/*\n * The maximum number of decimal places (DP) of the results of operations involving division:\n * div and sqrt, and pow with negative exponents.\n */\nvar DP = 28, // 0 to MAX_DP\n/*\n * The rounding mode (RM) used when rounding to the above decimal places.\n *\n * 0 Towards zero (i.e. truncate, no rounding). (ROUND_DOWN)\n * 1 To nearest neighbour. If equidistant, round up. (ROUND_HALF_UP)\n * 2 To nearest neighbour. If equidistant, to even. (ROUND_HALF_EVEN)\n * 3 Away from zero. (ROUND_UP)\n */\nRM = 1, // 0, 1, 2 or 3\n// The maximum value of DP and Big.DP.\nMAX_DP = 1E6, // 0 to 1000000\n// The maximum magnitude of the exponent argument to the pow method.\nMAX_POWER = 1E6, // 1 to 1000000\n/*\n * The negative exponent (NE) at and beneath which toString returns exponential notation.\n * (JavaScript numbers: -7)\n * -1000000 is the minimum recommended exponent value of a Big.\n */\nNE = -29, // 0 to -1000000\n/*\n * The positive exponent (PE) at and above which toString returns exponential notation.\n * (JavaScript numbers: 21)\n * 1000000 is the maximum recommended exponent value of a Big, but this limit is not enforced.\n */\nPE = 29, // 0 to 1000000\n/*\n * When true, an error will be thrown if a primitive number is passed to the Big constructor,\n * or if valueOf is called, or if toNumber is called on a Big which cannot be converted to a\n * primitive number without a loss of precision.\n */\nSTRICT = false, // true or false\n/**************************************************************************************************/\n// Error messages.\nNAME = '[big.js] ', INVALID = NAME + 'Invalid ', INVALID_DP = INVALID + 'decimal places', INVALID_RM = INVALID + 'rounding mode', DIV_BY_ZERO = NAME + 'Division by zero', UNDEFINED = void 0, NUMERIC = /^-?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i;\n/*\n * Create and return a Big constructor.\n */\nfunction _Big_() {\n /*\n * The Big constructor and exported function.\n * Create and return a new instance of a Big number object.\n *\n * n {number|string|Big} A numeric value.\n */\n function Big(n) {\n var x = this;\n // Enable constructor usage without new.\n if (!(x instanceof Big))\n return n === UNDEFINED ? _Big_() : new Big(n);\n // Duplicate.\n if (n instanceof Big) {\n x.s = n.s;\n x.e = n.e;\n x.c = n.c.slice();\n normalize(x);\n }\n else {\n if (typeof n !== 'string') {\n if (Big.strict === true) {\n throw TypeError(INVALID + 'number');\n }\n // Minus zero?\n n = n === 0 && 1 / n < 0 ? '-0' : String(n);\n }\n parse(x, n);\n }\n // Retain a reference to this Big constructor.\n // Shadow Big.prototype.constructor which points to Object.\n x.constructor = Big;\n }\n Big.prototype = P;\n Big.DP = DP;\n Big.RM = RM;\n Big.NE = NE;\n Big.PE = PE;\n Big.strict = STRICT;\n return Big;\n}\nfunction normalize(x) {\n // x = round(x, DP, 0);\n if (x.c.length > 1 && !x.c[0]) {\n let i = x.c.findIndex(x => x);\n x.c = x.c.slice(i);\n x.e = x.e - i;\n }\n}\n/*\n * Parse the number or string value passed to a Big constructor.\n *\n * x {Big} A Big number instance.\n * n {number|string} A numeric value.\n */\nfunction parse(x, n) {\n var e, i, nl;\n if (!NUMERIC.test(n)) {\n throw Error(INVALID + 'number');\n }\n // Determine sign.\n x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1;\n // Decimal point?\n if ((e = n.indexOf('.')) > -1)\n n = n.replace('.', '');\n // Exponential form?\n if ((i = n.search(/e/i)) > 0) {\n // Determine exponent.\n if (e < 0)\n e = i;\n e += +n.slice(i + 1);\n n = n.substring(0, i);\n }\n else if (e < 0) {\n // Integer.\n e = n.length;\n }\n nl = n.length;\n // Determine leading zeros before decimal point.\n for (i = 0; i < e && i < nl && n.charAt(i) == '0';)\n ++i;\n // original version (ignores decimal point).\n // // Determine leading zeros.\n // for (i = 0; i < nl && n.charAt(i) == '0';) ++i;\n if (i == nl) {\n // Zero.\n x.c = [x.e = 0];\n }\n else {\n x.e = e - i - 1;\n x.c = [];\n // Convert string to array of digits without leading zeros\n for (e = 0; i < nl;)\n x.c[e++] = +n.charAt(i++);\n // older version (doesn't keep trailing zeroes).\n // // Determine trailing zeros.\n // for (; nl > 0 && n.charAt(--nl) == '0';);\n // // Convert string to array of digits without leading/trailing zeros.\n // for (e = 0; i <= nl;) x.c[e++] = +n.charAt(i++);\n }\n x = round(x, Big.DP + 1, Big.RM);\n return x;\n}\n/*\n * Round Big x to a maximum of sd significant digits using rounding mode rm.\n *\n * x {Big} The Big to round.\n * sd {number} Significant digits: integer, 0 to MAX_DP inclusive.\n * rm {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n * [more] {boolean} Whether the result of division was truncated.\n */\nfunction round(x, sd, rm, more) {\n var xc = x.c;\n if (rm === UNDEFINED)\n rm = Big.RM;\n if (rm !== 0 && rm !== 1 && rm !== 2 && rm !== 3) {\n throw Error(INVALID_RM);\n }\n if (sd < 1) {\n more =\n rm === 3 && (more || !!xc[0]) || sd === 0 && (rm === 1 && xc[0] >= 5 ||\n rm === 2 && (xc[0] > 5 || xc[0] === 5 && (more || xc[1] !== UNDEFINED)));\n xc.length = 1;\n if (more) {\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\n x.e = x.e - sd + 1;\n xc[0] = 1;\n }\n else {\n // Zero.\n xc[0] = x.e = 0;\n }\n }\n else if (sd < xc.length) {\n // xc[sd] is the digit after the digit that may be rounded up.\n const isZero = xc.findIndex((xci, idx) => idx >= sd && xci > 0) < 0;\n more =\n rm === 1 && xc[sd] >= 5 ||\n rm === 2 && (xc[sd] > 5 || xc[sd] === 5 &&\n (more || xc[sd + 1] !== UNDEFINED || xc[sd - 1] & 1)) ||\n rm === 3 && (more || !isZero);\n // Remove any digits after the required precision.\n xc.length = sd--;\n // Round up?\n if (more) {\n // Rounding up may mean the previous digit has to be rounded up.\n for (; ++xc[sd] > 9;) {\n xc[sd] = 0;\n if (!sd--) {\n ++x.e;\n xc.unshift(1);\n }\n }\n }\n // Remove trailing zeros.\n for (sd = xc.length; !xc[--sd];)\n xc.pop();\n }\n return x;\n}\n/*\n * Return a string representing the value of Big x in normal or exponential notation.\n * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.\n */\nfunction stringify(x, doExponential, isNonzero) {\n var e = x.e, s = x.c.join(''), n = s.length;\n // Exponential notation?\n if (doExponential) {\n s = s.charAt(0) + (n > 1 ? '.' + s.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e;\n // Normal notation.\n }\n else if (e < 0) {\n for (; ++e;)\n s = '0' + s;\n s = '0.' + s;\n }\n else if (e > 0) {\n if (++e > n) {\n for (e -= n; e--;)\n s += '0';\n }\n else if (e < n) {\n s = s.slice(0, e) + '.' + s.slice(e);\n }\n }\n else if (n > 1) {\n s = s.charAt(0) + '.' + s.slice(1);\n }\n return x.s < 0 && isNonzero ? '-' + s : s;\n}\n// Prototype/instance methods\n/*\n * Return a new Big whose value is the absolute value of this Big.\n */\nP.abs = function () {\n var x = new this.constructor(this);\n x.s = 1;\n return x;\n};\n/*\n * Return 1 if the value of this Big is greater than the value of Big y,\n * -1 if the value of this Big is less than the value of Big y, or\n * 0 if they have the same value.\n */\nP.cmp = function (y) {\n var isneg, Big = this.constructor, x = new Big(this), y = new Big(y), xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;\n // Either zero?\n if (!xc[0] || !yc[0])\n return !xc[0] ? !yc[0] ? 0 : -j : i;\n // Signs differ?\n if (i != j)\n return i;\n isneg = i < 0;\n // Compare exponents.\n if (k != l)\n return k > l ^ isneg ? 1 : -1;\n // Compare digit by digit.\n j = Math.max(xc.length, yc.length);\n for (i = 0; i < j; i++) {\n k = i < xc.length ? xc[i] : 0;\n l = i < yc.length ? yc[i] : 0;\n if (k != l)\n return k > l ^ isneg ? 1 : -1;\n }\n return 0;\n // original version (doesn't compare well trailing zeroes, e.g. 1.0 with 1.00)\n // j = (k = xc.length) < (l = yc.length) ? k : l;\n // // Compare digit by digit.\n // for (i = -1; ++i < j;) {\n // if (xc[i] != yc[i]) return xc[i] > yc[i] ^ isneg ? 1 : -1;\n // }\n // // Compare lengths.\n // return k == l ? 0 : k > l ^ isneg ? 1 : -1;\n};\n/*\n * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,\n * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\n */\nP.div = function (y) {\n var Big = this.constructor, x = new Big(this), y = new Big(y), a = x.c, // dividend\n b = y.c, // divisor\n k = x.s == y.s ? 1 : -1, dp = Big.DP;\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n // Divisor is zero?\n if (!b[0]) {\n throw Error(DIV_BY_ZERO);\n }\n // Dividend is 0? Return +-0.\n if (!a[0]) {\n y.s = k;\n y.c = [y.e = 0];\n return y;\n }\n var bl, bt, n, cmp, ri, bz = b.slice(), ai = bl = b.length, al = a.length, r = a.slice(0, bl), // remainder\n rl = r.length, q = y, // quotient\n qc = q.c = [], qi = 0, p = dp + (q.e = x.e - y.e) + 1; // precision of the result\n q.s = k;\n k = p < 0 ? 0 : p;\n // Create version of divisor with leading zero.\n bz.unshift(0);\n // Add zeros to make remainder as long as divisor.\n for (; rl++ < bl;)\n r.push(0);\n do {\n // n is how many times the divisor goes into current remainder.\n for (n = 0; n < 10; n++) {\n // Compare divisor and remainder.\n if (bl != (rl = r.length)) {\n cmp = bl > rl ? 1 : -1;\n }\n else {\n for (ri = -1, cmp = 0; ++ri < bl;) {\n if (b[ri] != r[ri]) {\n cmp = b[ri] > r[ri] ? 1 : -1;\n break;\n }\n }\n }\n // If divisor < remainder, subtract divisor from remainder.\n if (cmp < 0) {\n // Remainder can't be more than 1 digit longer than divisor.\n // Equalise lengths using divisor with extra leading zero?\n for (bt = rl == bl ? b : bz; rl;) {\n if (r[--rl] < bt[rl]) {\n ri = rl;\n for (; ri && !r[--ri];)\n r[ri] = 9;\n --r[ri];\n r[rl] += 10;\n }\n r[rl] -= bt[rl];\n }\n for (; !r[0];)\n r.shift();\n }\n else {\n break;\n }\n }\n // Add the digit n to the result array.\n qc[qi++] = cmp ? n : ++n;\n // Update the remainder.\n if (r[0] && cmp)\n r[rl] = a[ai] || 0;\n else\n r = [a[ai]];\n } while ((ai++ < al || r[0] !== UNDEFINED) && k--);\n // Leading zero? Do not remove if result is simply zero (qi == 1).\n if (!qc[0] && qi != 1) {\n // There can't be more than one zero.\n qc.shift();\n q.e--;\n p--;\n }\n // Round?\n if (qi > p)\n round(q, p, Big.RM, r[0] !== UNDEFINED);\n return q;\n};\n/*\n * Return true if the value of this Big is equal to the value of Big y, otherwise return false.\n */\nP.eq = function (y) {\n return this.cmp(y) === 0;\n};\n/*\n * Return true if the value of this Big is greater than the value of Big y, otherwise return\n * false.\n */\nP.gt = function (y) {\n return this.cmp(y) > 0;\n};\n/*\n * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise\n * return false.\n */\nP.gte = function (y) {\n return this.cmp(y) > -1;\n};\n/*\n * Return true if the value of this Big is less than the value of Big y, otherwise return false.\n */\nP.lt = function (y) {\n return this.cmp(y) < 0;\n};\n/*\n * Return true if the value of this Big is less than or equal to the value of Big y, otherwise\n * return false.\n */\nP.lte = function (y) {\n return this.cmp(y) < 1;\n};\n/*\n * Return a new Big whose value is the value of this Big minus the value of Big y.\n */\nP.minus = P.sub = function (y) {\n var i, j, t, xlty, Big = this.constructor, x = new Big(this), y = new Big(y), a = x.s, b = y.s;\n // Signs differ?\n if (a != b) {\n y.s = -b;\n return x.plus(y);\n }\n var xc = x.c.slice(), xe = x.e, yc = y.c, ye = y.e;\n // Either zero?\n if (!xc[0] || !yc[0]) {\n if (yc[0]) {\n y.s = -b;\n }\n else if (xc[0]) {\n y = new Big(x);\n }\n else {\n y.s = 1;\n }\n return y;\n }\n // Determine which is the bigger number. Prepend zeros to equalise exponents.\n if (a = xe - ye) {\n if (xlty = a < 0) {\n a = -a;\n t = xc;\n }\n else {\n ye = xe;\n t = yc;\n }\n t.reverse();\n for (b = a; b--;)\n t.push(0);\n t.reverse();\n }\n else {\n // Exponents equal. Check digit by digit.\n j = ((xlty = xc.length < yc.length) ? xc : yc).length;\n for (a = b = 0; b < j; b++) {\n if (xc[b] != yc[b]) {\n xlty = xc[b] < yc[b];\n break;\n }\n }\n }\n // x < y? Point xc to the array of the bigger number.\n if (xlty) {\n t = xc;\n xc = yc;\n yc = t;\n y.s = -y.s;\n }\n /*\n * Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only\n * needs to start at yc.length.\n */\n if ((b = (j = yc.length) - (i = xc.length)) > 0)\n for (; b--;)\n xc[i++] = 0;\n // Subtract yc from xc.\n for (b = i; j > a;) {\n if (xc[--j] < yc[j]) {\n for (i = j; i && !xc[--i];)\n xc[i] = 9;\n --xc[i];\n xc[j] += 10;\n }\n xc[j] -= yc[j];\n }\n // Remove trailing zeros.\n for (; xc[--b] === 0;)\n xc.pop();\n // Remove leading zeros and adjust exponent accordingly.\n for (; xc[0] === 0;) {\n xc.shift();\n --ye;\n }\n if (!xc[0]) {\n // n - n = +0\n y.s = 1;\n // Result must be zero.\n xc = [ye = 0];\n }\n y.c = xc;\n y.e = ye;\n return y;\n};\n/*\n * Return a new Big whose value is the value of this Big modulo the value of Big y.\n */\nP.mod = function (y) {\n var ygtx, Big = this.constructor, x = new Big(this), y = new Big(y), a = x.s, b = y.s;\n if (!y.c[0]) {\n throw Error(DIV_BY_ZERO);\n }\n x.s = y.s = 1;\n ygtx = y.cmp(x) == 1;\n x.s = a;\n y.s = b;\n if (ygtx)\n return new Big(x);\n a = Big.DP;\n b = Big.RM;\n Big.DP = Big.RM = 0;\n x = x.div(y);\n Big.DP = a;\n Big.RM = b;\n return this.minus(x.times(y));\n};\n/*\n * Return a new Big whose value is the value of this Big plus the value of Big y.\n */\nP.plus = P.add = function (y) {\n var e, k, t, Big = this.constructor, x = new Big(this), y = new Big(y);\n // Signs differ?\n if (x.s != y.s) {\n y.s = -y.s;\n return x.minus(y);\n }\n var xe = x.e, xc = x.c, ye = y.e, yc = y.c;\n // Either zero?\n if (!xc[0] || !yc[0]) {\n if (!yc[0]) {\n if (xc[0]) {\n y = new Big(x);\n }\n else {\n y.s = x.s;\n }\n }\n return y;\n }\n xc = xc.slice();\n // Prepend zeros to equalise exponents.\n // Note: reverse faster than unshifts.\n if (e = xe - ye) {\n if (e > 0) {\n ye = xe;\n t = yc;\n }\n else {\n e = -e;\n t = xc;\n }\n t.reverse();\n for (; e--;)\n t.push(0);\n t.reverse();\n }\n // Point xc to the longer array.\n if (xc.length - yc.length < 0) {\n t = yc;\n yc = xc;\n xc = t;\n }\n e = yc.length;\n // Only start adding at yc.length - 1 as the further digits of xc can be left as they are.\n for (k = 0; e; xc[e] %= 10)\n k = (xc[--e] = xc[e] + yc[e] + k) / 10 | 0;\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\n if (k) {\n xc.unshift(k);\n ++ye;\n }\n // Remove trailing zeros.\n for (e = xc.length; xc[--e] === 0;)\n xc.pop();\n y.c = xc;\n y.e = ye;\n return y;\n};\n/*\n * Return a Big whose value is the value of this Big raised to the power n.\n * If n is negative, round to a maximum of Big.DP decimal places using rounding\n * mode Big.RM.\n *\n * n {number} Integer, -MAX_POWER to MAX_POWER inclusive.\n */\nP.pow = function (n) {\n var Big = this.constructor, x = new Big(this), y = new Big('1'), one = new Big('1'), isneg = n < 0;\n if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) {\n throw Error(INVALID + 'exponent');\n }\n if (isneg)\n n = -n;\n for (;;) {\n if (n & 1)\n y = y.times(x);\n n >>= 1;\n if (!n)\n break;\n x = x.times(x);\n }\n return isneg ? one.div(y) : y;\n};\n/*\n * Return a new Big whose value is the value of this Big rounded to a maximum precision of sd\n * significant digits using rounding mode rm, or Big.RM if rm is not specified.\n *\n * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.prec = function (sd, rm) {\n if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {\n throw Error(INVALID + 'precision');\n }\n return round(new this.constructor(this), sd, rm);\n};\n/*\n * Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal places\n * using rounding mode rm, or Big.RM if rm is not specified.\n * If dp is negative, round to an integer which is a multiple of 10**-dp.\n * If dp is not specified, round to 0 decimal places.\n *\n * dp? {number} Integer, -MAX_DP to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.round = function (dp, rm) {\n if (dp === UNDEFINED)\n dp = 0;\n else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n return round(new this.constructor(this), dp + this.e + 1, rm);\n};\n/*\n * Return a new Big whose value is the square root of the value of this Big, rounded, if\n * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\n */\nP.sqrt = function () {\n var r, c, t, Big = this.constructor, x = new Big(this), s = x.s, e = x.e, half = new Big('0.5');\n // Zero?\n if (!x.c[0])\n return new Big(x);\n // Negative?\n if (s < 0) {\n throw Error(NAME + 'No square root');\n }\n // Estimate.\n s = Math.sqrt(x + '');\n // Math.sqrt underflow/overflow?\n // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.\n if (s === 0 || s === 1 / 0) {\n c = x.c.join('');\n if (!(c.length + e & 1))\n c += '0';\n s = Math.sqrt(c);\n e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);\n r = new Big((s == 1 / 0 ? '5e' : (s = s.toExponential()).slice(0, s.indexOf('e') + 1)) + e);\n }\n else {\n r = new Big(s + '');\n }\n e = r.e + (Big.DP += 4);\n // Newton-Raphson iteration.\n do {\n t = r;\n r = half.times(t.plus(x.div(t)));\n } while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join(''));\n return round(r, (Big.DP -= 4) + r.e + 1, Big.RM);\n};\n/*\n * Return a new Big whose value is the value of this Big times the value of Big y.\n */\nP.times = P.mul = function (y) {\n var c, Big = this.constructor, x = new Big(this), y = new Big(y), xc = x.c, yc = y.c, a = xc.length, b = yc.length, i = x.e, j = y.e;\n // Determine sign of result.\n y.s = x.s == y.s ? 1 : -1;\n // Return signed 0 if either 0.\n if (!xc[0] || !yc[0]) {\n y.c = [y.e = 0];\n return y;\n }\n // Initialise exponent of result as x.e + y.e.\n y.e = i + j;\n // If array xc has fewer digits than yc, swap xc and yc, and lengths.\n if (a < b) {\n c = xc;\n xc = yc;\n yc = c;\n j = a;\n a = b;\n b = j;\n }\n // Initialise coefficient array of result with zeros.\n for (c = new Array(j = a + b); j--;)\n c[j] = 0;\n // Multiply.\n // i is initially xc.length.\n for (i = b; i--;) {\n b = 0;\n // a is yc.length.\n for (j = a + i; j > i;) {\n // Current sum of products at this digit position, plus carry.\n b = c[j] + yc[i] * xc[j - i - 1] + b;\n c[j--] = b % 10;\n // carry\n b = b / 10 | 0;\n }\n c[j] = b;\n }\n // Increment result exponent if there is a final carry, otherwise remove leading zero.\n if (b)\n ++y.e;\n else\n c.shift();\n // Remove trailing zeros.\n for (i = c.length; !c[--i];)\n c.pop();\n y.c = c;\n return y;\n};\n/*\n * Return a string representing the value of this Big in exponential notation rounded to dp fixed\n * decimal places using rounding mode rm, or Big.RM if rm is not specified.\n *\n * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.toExponential = function (dp, rm) {\n var x = this, n = x.c[0];\n if (dp !== UNDEFINED) {\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n x = round(new x.constructor(x), ++dp, rm);\n for (; x.c.length < dp;)\n x.c.push(0);\n }\n return stringify(x, true, !!n);\n};\n/*\n * Return a string representing the value of this Big in normal notation rounded to dp fixed\n * decimal places using rounding mode rm, or Big.RM if rm is not specified.\n *\n * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n *\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\n */\nP.toFixed = function (dp, rm) {\n var x = this, n = x.c[0];\n if (dp !== UNDEFINED) {\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n x = round(new x.constructor(x), dp + x.e + 1, rm);\n // x.e may have changed if the value is rounded up.\n for (dp = dp + x.e + 1; x.c.length < dp;)\n x.c.push(0);\n }\n return stringify(x, false, !!n);\n};\n/*\n * Return a string representing the value of this Big.\n * Return exponential notation if this Big has a positive exponent equal to or greater than\n * Big.PE, or a negative exponent equal to or less than Big.NE.\n * Omit the sign for negative zero.\n */\nP.toJSON = P.toString = function () {\n var x = this, Big = x.constructor;\n return stringify(x, x.e <= Big.NE || x.e >= Big.PE, !!x.c[0]);\n};\n/*\n * Return the value of this Big as a primitve number.\n */\nP.toNumber = function () {\n var n = Number(stringify(this, true, true));\n if (this.constructor.strict === true && !this.eq(n.toString())) {\n throw Error(NAME + 'Imprecise conversion');\n }\n return n;\n};\n/*\n * Return a string representing the value of this Big rounded to sd significant digits using\n * rounding mode rm, or Big.RM if rm is not specified.\n * Use exponential notation if sd is less than the number of digits necessary to represent\n * the integer part of the value in normal notation.\n *\n * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.toPrecision = function (sd, rm) {\n var x = this, Big = x.constructor, n = x.c[0];\n if (sd !== UNDEFINED) {\n if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {\n throw Error(INVALID + 'precision');\n }\n x = round(new Big(x), sd, rm);\n for (; x.c.length < sd;)\n x.c.push(0);\n }\n return stringify(x, sd <= x.e || x.e <= Big.NE || x.e >= Big.PE, !!n);\n};\n/*\n * Return a string representing the value of this Big.\n * Return exponential notation if this Big has a positive exponent equal to or greater than\n * Big.PE, or a negative exponent equal to or less than Big.NE.\n * Include the sign for negative zero.\n */\nP.valueOf = function () {\n var x = this, Big = x.constructor;\n if (Big.strict === true) {\n throw Error(NAME + 'valueOf disallowed');\n }\n return stringify(x, x.e <= Big.NE || x.e >= Big.PE, true);\n};\n// Export\nexport var Big = _Big_();\n/// \nexport default Big;\n","import Decimal from \"./lib/big.js\";\nimport { FSharpRef } from \"./Types.js\";\nexport default Decimal;\nexport const get_Zero = new Decimal(0);\nexport const get_One = new Decimal(1);\nexport const get_MinusOne = new Decimal(-1);\nexport const get_MaxValue = new Decimal(\"79228162514264337593543950335\");\nexport const get_MinValue = new Decimal(\"-79228162514264337593543950335\");\nexport function compare(x, y) {\n return x.cmp(y);\n}\nexport function equals(x, y) {\n return !x.cmp(y);\n}\nexport function abs(x) {\n return x.abs();\n}\nexport function round(x, digits = 0) {\n return x.round(digits, 2 /* ROUND_HALF_EVEN */);\n}\nexport function truncate(x) {\n return x.round(0, 0 /* ROUND_DOWN */);\n}\nexport function ceiling(x) {\n return x.round(0, x.cmp(0) >= 0 ? 3 /* ROUND_UP */ : 0 /* ROUND_DOWN */);\n}\nexport function floor(x) {\n return x.round(0, x.cmp(0) >= 0 ? 0 /* ROUND_DOWN */ : 3 /* ROUND_UP */);\n}\nexport function pow(x, n) {\n return x.pow(n);\n}\nexport function sqrt(x) {\n return x.sqrt();\n}\nexport function op_Addition(x, y) {\n return x.add(y);\n}\nexport function op_Subtraction(x, y) {\n return x.sub(y);\n}\nexport function op_Multiply(x, y) {\n return x.mul(y);\n}\nexport function op_Division(x, y) {\n return x.div(y);\n}\nexport function op_Modulus(x, y) {\n return x.mod(y);\n}\nexport function op_UnaryNegation(x) {\n const x2 = new Decimal(x);\n x2.s = -x2.s || 0;\n return x2;\n}\nexport const add = op_Addition;\nexport const subtract = op_Subtraction;\nexport const multiply = op_Multiply;\nexport const divide = op_Division;\nexport const remainder = op_Modulus;\nexport const negate = op_UnaryNegation;\nexport function toString(x) {\n return x.toString();\n}\nexport function tryParse(str, defValue) {\n try {\n defValue.contents = new Decimal(str.trim());\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nexport function parse(str) {\n const defValue = new FSharpRef(get_Zero);\n if (tryParse(str, defValue)) {\n return defValue.contents;\n }\n else {\n throw new Error(\"Input string was not in a correct format.\");\n }\n}\nexport function toNumber(x) {\n return +x;\n}\nfunction decimalToHex(dec, bitSize) {\n const hex = new Uint8Array(bitSize / 4 | 0);\n let hexCount = 1;\n for (let d = 0; d < dec.length; d++) {\n let value = dec[d];\n for (let i = 0; i < hexCount; i++) {\n const digit = hex[i] * 10 + value | 0;\n hex[i] = digit & 0xF;\n value = digit >> 4;\n }\n if (value !== 0) {\n hex[hexCount++] = value;\n }\n }\n return hex.slice(0, hexCount); // digits in reverse order\n}\nfunction hexToDecimal(hex, bitSize) {\n const dec = new Uint8Array(bitSize * 301 / 1000 + 1 | 0);\n let decCount = 1;\n for (let d = hex.length - 1; d >= 0; d--) {\n let carry = hex[d];\n for (let i = 0; i < decCount; i++) {\n const val = dec[i] * 16 + carry | 0;\n dec[i] = (val % 10) | 0;\n carry = (val / 10) | 0;\n }\n while (carry > 0) {\n dec[decCount++] = (carry % 10) | 0;\n carry = (carry / 10) | 0;\n }\n }\n return dec.slice(0, decCount); // digits in reverse order\n}\nfunction setInt32Bits(hexDigits, bits, offset) {\n for (let i = 0; i < 8; i++) {\n hexDigits[offset + i] = (bits >> (i * 4)) & 0xF;\n }\n}\nfunction getInt32Bits(hexDigits, offset) {\n let bits = 0;\n for (let i = 0; i < 8; i++) {\n bits = bits | (hexDigits[offset + i] << (i * 4));\n }\n return bits;\n}\nexport function fromIntArray(bits) {\n return fromInts(bits[0], bits[1], bits[2], bits[3]);\n}\nexport function fromInts(low, mid, high, signExp) {\n const isNegative = signExp < 0;\n const scale = (signExp >> 16) & 0x7F;\n return fromParts(low, mid, high, isNegative, scale);\n}\nexport function fromParts(low, mid, high, isNegative, scale) {\n const bitSize = 96;\n const hexDigits = new Uint8Array(bitSize / 4);\n setInt32Bits(hexDigits, low, 0);\n setInt32Bits(hexDigits, mid, 8);\n setInt32Bits(hexDigits, high, 16);\n const decDigits = hexToDecimal(hexDigits, bitSize);\n scale = scale & 0x7F;\n const big = new Decimal(0);\n big.c = Array.from(decDigits.reverse());\n big.e = decDigits.length - scale - 1;\n big.s = isNegative ? -1 : 1;\n const d = new Decimal(big);\n return d;\n}\nexport function getBits(d) {\n const bitSize = 96;\n const decDigits = Uint8Array.from(d.c);\n const hexDigits = decimalToHex(decDigits, bitSize);\n const low = getInt32Bits(hexDigits, 0);\n const mid = getInt32Bits(hexDigits, 8);\n const high = getInt32Bits(hexDigits, 16);\n const decStr = d.toString();\n const dotPos = decStr.indexOf(\".\");\n const scale = dotPos < 0 ? 0 : decStr.length - dotPos - 1;\n const signExp = ((scale & 0x7F) << 16) | (d.s < 0 ? 0x80000000 : 0);\n return [low, mid, high, signExp];\n}\n// export function makeRangeStepFunction(step: Decimal, last: Decimal) {\n// const stepComparedWithZero = step.cmp(get_Zero);\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: Decimal) => {\n// const comparedWithLast = x.cmp(last);\n// if ((stepGreaterThanZero && comparedWithLast <= 0)\n// || (!stepGreaterThanZero && comparedWithLast >= 0)) {\n// return [x, op_Addition(x, step)];\n// } else {\n// return undefined;\n// }\n// };\n// }\n","namespace FSharpPlus.Control\n\nopen System\nopen System.Runtime.InteropServices\nopen System.Text\nopen System.Collections.Generic\nopen System.Threading.Tasks\nopen Microsoft.FSharp.Quotations\n\nopen FSharpPlus\nopen FSharpPlus.Data\nopen FSharpPlus.Internals\nopen FSharpPlus.Internals.Prelude\n\n\n// Monad class ------------------------------------------------------------\n\ntype Bind =\n static member (>>=) (source: Lazy<'T> , f: 'T -> Lazy<'U> ) = lazy (f source.Value).Value : Lazy<'U>\n static member (>>=) (source: seq<'T> , f: 'T -> seq<'U> ) = Seq.bind f source : seq<'U>\n #if !FABLE_COMPILER\n static member (>>=) (source: Task<'T> , f: 'T -> Task<'U> ) = Task.bind f source : Task<'U>\n static member (>>=) (source , f: 'T -> _ ) = Nullable.bind f source : Nullable<'U>\n #endif\n #if NETSTANDARD2_1 && !FABLE_COMPILER\n static member (>>=) (source: ValueTask<'T> , f: 'T -> ValueTask<'U> ) = ValueTask.bind f source : ValueTask<'U>\n #endif\n\n static member (>>=) (source , f: 'T -> _ ) = Option.bind f source : option<'U>\n #if !FABLE_COMPILER\n static member (>>=) (source , f: 'T -> _ ) = ValueOption.bind f source : voption<'U>\n #endif\n static member (>>=) (source , f: 'T -> _ ) = List.collect f source : list<'U>\n static member (>>=) (source , f: 'T -> _ ) = Array.collect f source : 'U []\n static member (>>=) (source , k: 'T -> _ ) = (fun r -> k (source r) r) : 'R->'U\n #if !FABLE_COMPILER\n static member inline (>>=) ((w: 'Monoid, a: 'T), k: 'T -> 'Monoid * 'U) = let m, b = k a in (Plus.Invoke w m, b) : 'Monoid*'U\n static member inline (>>=) (struct (w: 'Monoid, a: 'T), k: 'T -> struct ('Monoid * 'U)) = let struct (m, b) = k a in struct (Plus.Invoke w m, b) : struct ('Monoid * 'U)\n #else\n static member inline (>>=) ((w: 'Monoid, a: 'T), k: 'T -> 'Monoid * 'U) = let m, b = k a in (w + m, b) : 'Monoid*'U\n static member inline (>>=) (struct (w: 'Monoid, a: 'T), k: 'T -> struct ('Monoid * 'U)) = let struct (m, b) = k a in struct (w + m, b) : struct ('Monoid * 'U)\n #endif\n static member (>>=) (source , f: 'T -> _ ) = async.Bind (source, f) : Async<'U>\n static member (>>=) (source , k: 'T -> _ ) = Result.bind k source : Result<'U,'E>\n static member (>>=) (source , k: 'T -> _ ) = Choice.bind k source : Choice<'U,'E>\n\n static member (>>=) (source: Map<'Key,'T>, f: 'T -> Map<'Key,'U>) = Map (seq {\n for KeyValue(k, v) in source do\n match Map.tryFind k (f v) with\n | Some v -> yield k, v\n | _ -> () })\n\n static member (>>=) (source: Dictionary<'Key,'T>, f: 'T -> Dictionary<'Key,'U>) = \n let dct = Dictionary ()\n for KeyValue(k, v) in source do\n match (f v).TryGetValue (k) with\n | true, v -> dct.Add (k, v)\n | _ -> ()\n dct\n\n static member (>>=) (source: ResizeArray<'T>, f: 'T -> ResizeArray<'U>) = ResizeArray (Seq.bind (f >> seq<_>) source) : ResizeArray<'U>\n\n static member (>>=) (source: NonEmptySeq<'T>, f: 'T -> NonEmptySeq<'U>) = NonEmptySeq.collect f source : NonEmptySeq<'U>\n\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n static member inline Invoke (source: '``Monad<'T>``) (binder: 'T -> '``Monad<'U>``) : '``Monad<'U>`` =\n let inline call (_mthd: 'M, input: 'I, _output: 'R, f) = ((^M or ^I or ^R) : (static member (>>=) : _*_ -> _) input, f)\n call (Unchecked.defaultof, source, Unchecked.defaultof<'``Monad<'U>``>, binder)\n#endif\n\n static member inline InvokeOnInstance (source: '``Monad<'T>``) (binder: 'T -> '``Monad<'U>``) : '``Monad<'U>`` =\n ((^``Monad<'T>`` or ^``Monad<'U>``) : (static member (>>=) : _*_ -> _) source, binder)\n\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\ntype Join =\n inherit Default1\n static member inline Join (x: '``Monad<'Monad<'T>>`` , []_output: '``Monad<'T>`` , []_mthd: Default2) = Bind.InvokeOnInstance x id : '``Monad<'T>``\n static member inline Join (x: '``Monad<'Monad<'T>>`` , []_output: '``Monad<'T>`` , []_mthd: Default1) = ((^``Monad<'Monad<'T>>`` or ^``Monad<'T>``) : (static member Join : _ -> _) x) : '``Monad<'T>``\n static member Join (x: Lazy> , []_output: Lazy<'T> , []_mthd: Join ) = lazy x.Value.Value : Lazy<'T>\n static member Join (x: seq> , []_output: seq<'T> , []_mthd: Join ) = Seq.concat x : seq<'T>\n static member Join (x: Id<_> , []_output: Id<'T> , []_mthd: Join ) = x.getValue : Id<'T>\n #if !FABLE_COMPILER \n static member Join (x: Task> , []_output: Task<'T> , []_mthd: Join ) = Task.join x : Task<'T>\n #endif\n #if NETSTANDARD2_1 && !FABLE_COMPILER\n static member Join (x: ValueTask> , []_output: ValueTask<'T> , []_mthd: Join ) = ValueTask.join x : ValueTask<'T>\n #endif\n static member Join (x , []_output: option<'T> , []_mthd: Join ) = Option.flatten x : option<'T>\n #if !FABLE_COMPILER\n static member Join (x , []_output: voption<'T> , []_mthd: Join ) = ValueOption.flatten x : voption<'T>\n #endif\n static member Join (x: list> , []_output: list<'T> , []_mthd: Join ) = List.concat x : list<'T>\n static member Join (x: _ [][] , []_output: 'T [] , []_mthd: Join ) = Array.concat x : 'T []\n static member Join (g , []_output: 'R->'T , []_mthd: Join ) = (fun r -> (g r) r) : 'R->'T\n static member inline Join ((m1, (m2, x)) , []_output: 'Monoid * 'T , []_mthd: Join ) = Plus.Invoke m1 m2, x : 'Monoid*'T\n static member inline Join (struct (m1, struct (m2, x)), []_output: struct ('Monoid * 'T), []_mthd: Join) = Plus.Invoke m1 m2, x : struct ('Monoid * 'T)\n static member Join (x , []_output: Async<'T> , []_mthd: Join ) = async.Bind (x, id) : Async<'T>\n static member Join (x , []_output: Result<'T,'E> , []_mthd: Join ) = Result.flatten x : Result<'T,'E>\n static member Join (x , []_output: Choice<'T,'E> , []_mthd: Join ) = Choice.flatten x : Choice<'T,'E>\n\n static member Join (x: Map<_,_> , []_output: Map<'Key,'Value>, []_mthd: Join ) : Map<'Key,'Value> =\n Map (seq {\n for KeyValue(k, v) in x do\n match Map.tryFind k v with\n | Some v -> yield k, v\n | _ -> () })\n\n static member Join (x: Dictionary<_,Dictionary<_,_>>, []_output: Dictionary<'Key,'Value>, []_mthd: Join) : Dictionary<'Key,'Value> =\n let dct = Dictionary ()\n for KeyValue(k, v) in x do\n match v.TryGetValue (k) with\n | true, v -> dct.Add (k, v)\n | _ -> ()\n dct\n\n static member Join (x: ResizeArray> , []_output: ResizeArray<'T> , []_mthd: Join) = ResizeArray (Seq.bind seq<_> x) : ResizeArray<'T> \n \n static member Join (x: NonEmptySeq> , []_output: NonEmptySeq<'T> , []_mthd: Join) = NonEmptySeq.concat x : NonEmptySeq<'T> \n\n static member inline Invoke (source: '``Monad>``) : '``Monad<'T>`` =\n let inline call (mthd: 'M, input: 'I, output: 'R) = ((^M or ^I or ^R) : (static member Join : _*_*_ -> _) input, output, mthd)\n call (Unchecked.defaultof, source, Unchecked.defaultof<'``Monad<'T>``>)\n\n#endif\n\ntype Return =\n inherit Default1\n static member inline InvokeOnInstance (x: 'T) = (^``Applicative<'T>`` : (static member Return : ^T -> ^``Applicative<'T>``) x)\n\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\n static member inline Invoke (x: 'T) : '``Applicative<'T>`` =\n let inline call (mthd: ^M, output: ^R) = ((^M or ^R) : (static member Return : _*_ -> _) output, mthd)\n call (Unchecked.defaultof, Unchecked.defaultof<'``Applicative<'T>``>) x\n \n \n\n static member Return (_: seq<'a> , _: Default2) = fun x -> Seq.singleton x : seq<'a>\n static member Return (_: NonEmptySeq<'a>, _: Default2) = fun x -> NonEmptySeq.singleton x : NonEmptySeq<'a>\n static member Return (_: IEnumerator<'a>, _: Default2) = fun x -> Enumerator.upto None (fun _ -> x) : IEnumerator<'a>\n static member inline Return (_: 'R , _: Default1) = fun (x: 'T) -> Return.InvokeOnInstance x : 'R\n static member Return (_: Lazy<'a> , _: Return ) = fun x -> Lazy<_>.CreateFromValue x : Lazy<'a>\n #if !FABLE_COMPILER\n static member Return (_: 'T Task , _: Return ) = fun x -> Task.FromResult x : 'T Task\n #endif\n #if NETSTANDARD2_1 && !FABLE_COMPILER\n static member Return (_: 'T ValueTask , _: Return ) = fun (x: 'T) -> ValueTask<'T> x : 'T ValueTask\n #endif\n static member Return (_: option<'a> , _: Return ) = fun x -> Some x : option<'a>\n static member Return (_ : voption<'a> , _: Return ) = fun x -> ValueSome x : voption<'a>\n static member Return (_: list<'a> , _: Return ) = fun x -> [ x ] : list<'a>\n static member Return (_: 'a [] , _: Return ) = fun x -> [|x|] : 'a []\n static member Return (_: 'r -> 'a , _: Return ) = const': 'a -> 'r -> _\n static member inline Return (_: 'm * 'a , _: Return ) = fun (x: 'a) -> (Zero.Invoke (): 'm), x\n static member inline Return (_: struct ('m * 'a), _: Return ) = fun (x: 'a) -> struct ((Zero.Invoke (): 'm), x)\n static member Return (_: 'a Async , _: Return ) = fun (x: 'a) -> async.Return x\n static member Return (_: Result<'a,'e> , _: Return ) = fun x -> Ok x : Result<'a,'e>\n static member Return (_: Choice<'a,'e> , _: Return ) = fun x -> Choice1Of2 x : Choice<'a,'e>\n #if !FABLE_COMPILER\n static member Return (_: Expr<'a> , _: Return ) = fun x -> Expr.Cast<'a> (Expr.Value (x: 'a))\n #endif\n static member Return (_: ResizeArray<'a>, _: Return ) = fun x -> ResizeArray<'a> (Seq.singleton x)\n\n //Restricted\n static member Return (_: string , _: Return ) = fun (x: char) -> string x : string\n static member Return (_: StringBuilder , _: Return ) = fun (x: char) -> new StringBuilder (string x) : StringBuilder\n static member Return (_: 'a Set , _: Return ) = fun (x: 'a ) -> Set.singleton x\n static member Return (_: 'a Set2 , _: Return ) = fun (_: 'a ) -> Set2() : 'a Set2\n\n\ntype Delay =\n inherit Default1\n \n #if !FABLE_COMPILER\n static member inline Delay (_mthd: Default3, x: unit-> ^``Monad<'T>`` , _: Default1) = Bind.Invoke (Return.Invoke ()) x : ^``Monad<'T>``\n \n static member inline Delay (_mthd: Default1, x: unit-> ^I , _: Delay ) = (^I : (static member Delay : _->_) x) : ^I\n static member inline Delay (_mthd: Default1, _: unit-> ^t when ^t : null and ^t : struct , _ ) = ()\n\n static member Delay (_mthd: Default2, x: unit-> _ , _ ) = Seq.delay x : seq<'T>\n static member Delay (_mthd: Default2, x: unit-> _ , _ ) = NonEmptySeq.delay x : NonEmptySeq<'T>\n static member Delay (_mthd: Default2, x: unit-> 'R -> _ , _ ) = (fun s -> x () s): 'R -> _\n static member Delay (_mthd: Delay , x: unit-> _ , _ ) = async.Delay x : Async<'T>\n static member Delay (_mthd: Delay , x: unit-> Task<_> , _ ) = x () : Task<'T>\n static member Delay (_mthd: Delay , x: unit-> Lazy<_> , _ ) = lazy (x().Value) : Lazy<'T>\n \n static member inline Invoke (source : unit -> '``Monad<'T>``) : '``Monad<'T>`` =\n let inline call (mthd: ^M, input: unit -> ^I) = ((^M or ^I) : (static member Delay : _*_*_ -> _) mthd, input, Unchecked.defaultof)\n call (Unchecked.defaultof, source)\n \n #else\n \n static member inline Invoke (source : unit -> '``Monad<'T>``) : '``Monad<'T>`` = Bind.Invoke (Return.Invoke ()) source\n \n #endif\n \n #if NETSTANDARD2_1 && !FABLE_COMPILER\n static member Delay (_mthd: Delay , x: unit-> ValueTask<_> , _ ) = x () : ValueTask<'T>\n #endif\n\n\n[]\nmodule TryBlock =\n type True = True\n type False = False\n type While = While\n\n let []MessageTryWith = \"Method TryWith not implemented. If the computation type is not lazy use a strict monad computation expression by adding .strict, otherwise it should have a static member TryWith.\"\n let []CodeTryWith = 10708\n\n let []MessageTryFinally = \"Method TryFinally not implemented. If the computation type is not lazy use a strict monad computation expression by adding .strict, otherwise it should have a static member TryFinally.\"\n let []CodeTryFinally = 10709\n\n let []MessageWhile = \"This monad doesn't seem to be lazy or at least it doesn't have a try-with method implemented, so using a while loop can lead to runtime errors. Make sure this type is lazy, otherwise use a strict monad by adding .strict\"\n let []CodeWhile = 10710\n\nopen TryBlock\n\ntype TryWith =\n inherit Default1\n // Begin compat members\n static member TryWith (computation: '``Monad<'T>``, catchHandler: exn -> '``Monad<'T>``, _: Default3) = try computation with e -> catchHandler e\n static member TryWith (computation: seq<_> , catchHandler: exn -> seq<_> , _: Default2) = seq (try (Seq.toArray computation) with e -> Seq.toArray (catchHandler e))\n static member TryWith (computation: 'R -> _ , catchHandler: exn -> 'R -> _ , _: Default2) = (fun s -> try computation s with e -> catchHandler e s) : 'R ->_\n static member TryWith (computation: Async<_> , catchHandler: exn -> Async<_> , _: TryWith ) = async.TryWith (computation, catchHandler)\n static member TryWith (computation: Lazy<_> , catchHandler: exn -> Lazy<_> , _: TryWith ) = lazy (try computation.Force () with e -> (catchHandler e).Force ()) : Lazy<_>\n // End compat members\n \n []\n static member TryWith (_: unit -> '``Monad<'T>`` when '``Monad<'T>`` : not struct, _: exn -> '``Monad<'T>``, _: Default4, _defaults: While) = raise Internals.Errors.exnUnreachable\n \n []\n static member TryWith (_: unit -> '``Monad<'T>`` when '``Monad<'T>`` : struct, _: exn -> '``Monad<'T>``, _: Default3, _defaults: While) = raise Internals.Errors.exnUnreachable\n \n []\n static member TryWith (_: unit -> '``Monad<'T>`` when '``Monad<'T>`` : not struct, _: exn -> '``Monad<'T>``, _: Default4, _defaults: False) = raise Internals.Errors.exnUnreachable\n \n []\n static member TryWith (_: unit -> '``Monad<'T>`` when '``Monad<'T>`` : struct, _: exn -> '``Monad<'T>``, _: Default3, _defaults: False) = raise Internals.Errors.exnUnreachable\n\n static member TryWith (computation: unit -> '``Monad<'T>`` when '``Monad<'T>`` : not struct, catchHandler: exn -> '``Monad<'T>``, _: Default4, _defaults: True) = try computation () with e -> catchHandler e\n static member TryWith (computation: unit -> '``Monad<'T>`` when '``Monad<'T>`` : struct, catchHandler: exn -> '``Monad<'T>``, _: Default3, _defaults: True) = try computation () with e -> catchHandler e\n\n static member inline TryWith (computation: unit -> '``Monad<'T>``, catchHandler: exn -> '``Monad<'T>``, _: Default1, _) = (^``Monad<'T>`` : (static member TryWith : _*_->_) computation (), catchHandler) : '``Monad<'T>``\n static member inline TryWith (_: unit -> ^t when ^t: null and ^t: struct, _ : exn -> 't , _: Default1, _) = ()\n \n static member TryWith (computation: unit -> seq<_> , catchHandler: exn -> seq<_> , _: Default2, _) = seq (try (Seq.toArray (computation ())) with e -> Seq.toArray (catchHandler e))\n static member TryWith (computation: unit -> NonEmptySeq<_>, catchHandler: exn -> NonEmptySeq<_>, _: Default2, _) = seq (try (Seq.toArray (computation ())) with e -> Seq.toArray (catchHandler e)) |> NonEmptySeq.unsafeOfSeq\n static member TryWith (computation: unit -> 'R -> _ , catchHandler: exn -> 'R -> _ , _: Default2, _) = (fun s -> try (computation ()) s with e -> catchHandler e s) : 'R ->_\n static member TryWith (computation: unit -> Async<_> , catchHandler: exn -> Async<_> , _: TryWith , _) = async.TryWith ((computation ()), catchHandler)\n #if !FABLE_COMPILER\n static member TryWith (computation: unit -> Task<_> , catchHandler: exn -> Task<_> , _: TryWith, True) = Task.tryWith computation catchHandler\n #endif\n static member TryWith (computation: unit -> Lazy<_> , catchHandler: exn -> Lazy<_> , _: TryWith , _) = lazy (try (computation ()).Force () with e -> (catchHandler e).Force ()) : Lazy<_>\n\n static member inline Invoke (source: '``Monad<'T>``) (f: exn -> '``Monad<'T>``) : '``Monad<'T>`` =\n let inline call (mthd: 'M, input: unit -> 'I, _output: 'R, h: exn -> 'I) = ((^M or ^I) : (static member TryWith : _*(exn -> _)*_*_ -> _) input, h, mthd, False)\n call (Unchecked.defaultof, (fun () -> source), Unchecked.defaultof<'``Monad<'T>``>, f)\n\n static member inline InvokeForStrict (source: unit ->'``Monad<'T>``) (f: exn -> '``Monad<'T>``) : '``Monad<'T>`` =\n let inline call (mthd: 'M, input: unit -> 'I, _output: 'R, h: exn -> 'I) = ((^M or ^I) : (static member TryWith : _*(exn -> _)*_*_ -> _) input, h, mthd, True)\n call (Unchecked.defaultof, source, Unchecked.defaultof<'``Monad<'T>``>, f)\n\n static member inline InvokeForWhile (source: '``Monad<'T>``) (f: exn -> '``Monad<'T>``) : '``Monad<'T>`` =\n let inline call (mthd: 'M, input: unit -> 'I, _output: 'R, h: exn -> 'I) = ((^M or ^I) : (static member TryWith : _*(exn -> _)*_*_ -> _) input, h, mthd, While)\n call (Unchecked.defaultof, (fun () -> source), Unchecked.defaultof<'``Monad<'T>``>, f)\n\n\ntype TryFinally =\n inherit Default1\n // Begin compat members\n static member TryFinally ((computation: seq<_> , compensation: unit -> unit), _: Default2 , _) = seq (try (Seq.toArray computation) finally compensation ())\n static member TryFinally ((computation: 'R -> _ , compensation: unit -> unit), _: Default2, _) = fun s -> try computation s finally compensation ()\n static member TryFinally ((computation: Id<_> , compensation: unit -> unit), _: TryFinally, _) = try computation finally compensation()\n static member TryFinally ((computation: Async<_>, compensation: unit -> unit), _: TryFinally, _) = async.TryFinally (computation, compensation) : Async<_>\n static member TryFinally ((computation: Lazy<_> , compensation: unit -> unit), _: TryFinally, _) = lazy (try computation.Force () finally compensation ()) : Lazy<_>\n static member TryFinally ((computation: '``Monad<'T>`` when '``Monad<'T>`` : struct, compensation: unit -> unit), _: Default3, _: Default2 ) = try computation finally compensation ()\n static member TryFinally ((computation: '``Monad<'T>`` when '``Monad<'T>`` : not struct, compensation: unit -> unit), _: Default3, _: Default1 ) = try computation finally compensation ()\n // End compat members\n\n static member TryFinally ((computation: unit -> seq<_> , compensation: unit -> unit), _: Default2, _, _) = seq (try (Seq.toArray (computation ())) finally compensation ())\n static member TryFinally ((computation: unit -> NonEmptySeq<_>, compensation: unit -> unit), _: Default2, _, _) = seq (try (Seq.toArray (computation ())) finally compensation ()) |> NonEmptySeq.unsafeOfSeq\n\n []\n static member TryFinally ((_: unit -> 'R -> _ , _: unit -> unit), _: Default2 , _, _defaults: False) = raise Internals.Errors.exnUnreachable\n static member TryFinally ((computation: unit -> 'R -> _ , compensation: unit -> unit), _: Default2 , _, _defaults: True ) = fun s -> try computation () s finally compensation ()\n \n static member TryFinally ((computation: unit -> Id<_> , compensation: unit -> unit), _: TryFinally, _, _) = try computation () finally compensation ()\n static member TryFinally ((computation: unit -> Async<_>, compensation: unit -> unit), _: TryFinally, _, _) = async.TryFinally (computation (), compensation) : Async<_>\n #if !FABLE_COMPILER\n static member TryFinally ((computation: unit -> Task<_> , compensation: unit -> unit), _: TryFinally, _, True) = Task.tryFinally computation compensation : Task<_>\n #endif\n static member TryFinally ((computation: unit -> Lazy<_> , compensation: unit -> unit), _: TryFinally, _, _) = lazy (try (computation ()).Force () finally compensation ()) : Lazy<_>\n\n static member inline Invoke (source: '``Monad<'T>``) (f: unit -> unit) : '``Monad<'T>`` =\n let inline call (mthd: 'M, input: unit ->'I, _output: 'I, h: unit -> unit) = ((^M or ^I) : (static member TryFinally : (_*_)*_*_*_ -> _) (input, h), mthd, Unchecked.defaultof, False)\n call (Unchecked.defaultof, (fun () -> source), Unchecked.defaultof<'``Monad<'T>``>, f)\n\n static member inline InvokeForStrict (source: unit ->'``Monad<'T>``) (f: unit -> unit) : '``Monad<'T>`` =\n let inline call (mthd: 'M, input: unit ->'I, _output: 'I, h: unit -> unit) = ((^M or ^I) : (static member TryFinally : (_*_)*_*_*_ -> _) (input, h), mthd, Unchecked.defaultof, True)\n call (Unchecked.defaultof, source, Unchecked.defaultof<'``Monad<'T>``>, f)\n\n static member inline InvokeOnInstance (source: '``Monad<'T>``) (f: unit -> unit) : '``Monad<'T>`` = (^``Monad<'T>`` : (static member TryFinally : _*_->_) source, f) : '``Monad<'T>``\n\ntype TryFinally with\n\n []\n static member TryFinally ((_: unit -> '``Monad<'T>`` when '``Monad<'T>`` : struct, _: unit -> unit), _: Default3, _: Default2, _defaults: False) = raise Internals.Errors.exnUnreachable\n\n []\n static member TryFinally ((_: unit -> '``Monad<'T>`` when '``Monad<'T>`` : not struct, _: unit -> unit), _: Default3, _: Default1, _defaults: False) = raise Internals.Errors.exnUnreachable\n\n static member TryFinally ((computation: unit -> '``Monad<'T>`` when '``Monad<'T>`` : struct, compensation: unit -> unit), _: Default3, _: Default2, _defaults: True) = try computation () finally compensation ()\n static member TryFinally ((computation: unit -> '``Monad<'T>`` when '``Monad<'T>`` : not struct, compensation: unit -> unit), _: Default3, _: Default1, _defaults: True) = try computation () finally compensation ()\n \n static member inline TryFinally ((computation: unit -> '``Monad<'T>`` , compensation: unit -> unit), _: Default1, _: TryFinally, _) = TryFinally.InvokeOnInstance (computation ()) compensation: '``Monad<'T>``\n static member inline TryFinally (( _ : unit -> ^t when ^t:null and ^t:struct , _ : unit -> unit), _: Default1, _ , _) = ()\n\n\ntype Using =\n inherit Default1\n \n static member Using (resource: 'T when 'T :> IDisposable, body: 'T -> seq<'U> , _: Using) = seq (try Seq.toArray (body resource) finally if not (isNull (box resource)) then resource.Dispose ()) : seq<'U>\n static member Using (resource: 'T when 'T :> IDisposable, body: 'T -> NonEmptySeq<'U>, _: Using) = seq (try Seq.toArray (body resource) finally if not (isNull (box resource)) then resource.Dispose ()) |> NonEmptySeq.unsafeOfSeq : NonEmptySeq<'U>\n static member Using (resource: 'T when 'T :> IDisposable, body: 'T -> 'R -> 'U , _: Using ) = (fun s -> try body resource s finally if not (isNull (box resource)) then resource.Dispose ()) : 'R->'U\n static member Using (resource: 'T when 'T :> IDisposable, body: 'T -> Async<'U>, _: Using ) = async.Using (resource, body)\n #if !FABLE_COMPILER\n static member Using (resource: 'T when 'T :> IDisposable, body: 'T -> Task<'U>, _: Using ) = Task.using resource body\n #endif\n static member Using (resource: 'T when 'T :> IDisposable, body: 'T -> Lazy<'U> , _: Using ) = lazy (try (body resource).Force () finally if not (isNull (box resource)) then resource.Dispose ()) : Lazy<'U>\n\n static member inline Invoke (source : 'T when 'T :> IDisposable) (f : 'T -> '``Monad<'U>``) : '``Monad<'U>`` =\n let inline call (mthd: 'M, input: 'T, _output: 'R, h: 'T -> 'I) = ((^M or ^I) : (static member Using : _*_*_ -> _) input, h, mthd)\n call (Unchecked.defaultof, source, Unchecked.defaultof<'``Monad<'U>``>, f)\n\n static member inline InvokeOnInstance (resource: 'T when 'T :> IDisposable) (body: 'T -> '``Monad<'U>``) : '``Monad<'U>`` =\n (^``Monad<'U>`` : (static member Using : _*_->_) resource, body) : '``Monad<'U>``\n\ntype Using with\n static member inline Using (resource: 'T when 'T :> IDisposable, body: 'T -> '``Monad<'U>`` when '``Monad<'U>``: struct , _: Default3) = using resource body\n static member inline Using (resource: 'T when 'T :> IDisposable, body: 'T -> '``Monad<'U>`` when '``Monad<'U>``: not struct , _: Default2) = using resource body\n static member inline Using (resource: 'T when 'T :> IDisposable, body: 'T -> '``Monad<'U>`` , _: Default1) = TryFinally.InvokeOnInstance (body resource) (fun () -> if not (isNull (box resource)) then resource.Dispose ()) : '``Monad<'U>``\n static member inline Using (resource: 'T when 'T :> IDisposable, body: 'T -> '``Monad<'U>`` , _: Using ) = Using.InvokeOnInstance resource body : '``Monad<'U>``\n static member inline Using (_ , _ : 'a -> ^t when ^t : null and ^t: struct , _: Using ) = ()\n\n#endif\n","[]\r\nmodule PortalLibs.Shared.Option\r\n\r\nopen System\r\nopen FSharpPlus\r\n\r\nlet emptyStrIfNone<'T when 'T :> obj> (strOpt: Option<'T>) =\r\n match strOpt with\r\n | None -> String.Empty\r\n | Some s -> s.ToString()\r\n\r\nlet noneIfEmptyStr (str: string) =\r\n if String.IsNullOrEmpty str then None else Some str\r\n\r\nlet noneIfEmptyStrTrim (str: string) =\r\n if isNull str || str.Trim() = \"\" then\r\n None\r\n else\r\n Some(str.Trim())\r\n\r\nlet noneIfEmptyStrOpt strOpt = strOpt >>= noneIfEmptyStr\r\n\r\nlet noneIfEmptyStrOptTrim strOpt = strOpt >>= noneIfEmptyStrTrim\r\n\r\n\r\nlet emptyMapIfNone<'K, 'T when 'K: comparison> (mapOpt: Map<'K, 'T> option) : Map<'K, 'T> =\r\n match mapOpt with\r\n | None -> Map.empty\r\n | Some map -> map\r\n\r\nlet emptyListIfNone<'T> (result: 'T list option) : 'T list =\r\n match result with\r\n | None -> []\r\n | Some list -> list\r\n\r\nlet noneIfEmptyList<'T> (result: 'T list) : 'T list option =\r\n if result.IsEmpty then None else Some result\r\n\r\nlet toNullableAll opt =\r\n match opt with\r\n | None -> null\r\n | Some value -> value\r\n\r\nlet ofNullableAll nullable =\r\n if isNull (box nullable) then None else Some nullable\r\n\r\n\r\nlet fromParseResult parseRes =\r\n match parseRes with\r\n | false, _ -> None\r\n | true, parsed -> Some parsed\r\n\r\nlet rec unwrapObjIfOption (obj: obj) =\r\n let unwrapOpt opt =\r\n match opt with\r\n | Some value -> value |> unwrapObjIfOption\r\n | None -> null\r\n\r\n match obj with\r\n | :? Option as opt -> unwrapOpt opt\r\n | :? Option as opt -> unwrapOpt opt\r\n | :? Option as opt -> unwrapOpt opt\r\n | :? Option as opt -> unwrapOpt opt\r\n | :? Option as opt -> unwrapOpt opt\r\n | :? Option as opt -> unwrapOpt opt\r\n | :? Option as opt -> unwrapOpt opt\r\n | :? Option as opt -> unwrapOpt opt\r\n | :? Option as opt -> unwrapOpt opt\r\n | :? Option as opt -> opt |>> string |> unwrapOpt\r\n | :? Option as opt -> opt |>> (fun (byte, right) -> string byte, right) |> unwrapOpt\r\n | :? Option as opt -> opt |>> (fun (byte, right) -> string byte, right) |> unwrapOpt\r\n | :? Option as opt -> unwrapOpt opt\r\n | :? Option * Option> as opt ->\r\n opt\r\n >>= (fun (byteOpt, strOpt) -> (byteOpt, strOpt) ||> lift2 (fun byte str -> string byte, str))\r\n |> unwrapOpt\r\n | :? Option as opt -> unwrapOpt opt\r\n | _ -> obj\r\n\r\nlet combine f new' old =\r\n match new', old with\r\n | None, None -> None\r\n | Some new', Some old -> Some(f new' old)\r\n | None, Some old -> Some old\r\n | Some new', None -> Some new'\r\n\r\nlet tryAllElementsHaveValue collection =\r\n if Seq.exists Option.isNone collection then\r\n None\r\n else\r\n Some(Seq.choose id collection)","module Feliz.Bulma.ElementBuilders\r\n\r\nopen Feliz\r\nopen Feliz.Bulma\r\n\r\nmodule Helpers =\r\n let [] private ClassName = \"className\"\r\n\r\n let inline internal getClasses (xs:IReactProperty list) =\r\n xs\r\n |> List.choose (unbox >> function\r\n | (k, v) when k = ClassName -> Some (string v)\r\n | _ -> None)\r\n\r\n let extractClasses (xs:IReactProperty list) =\r\n xs\r\n |> List.rev\r\n |> List.fold (fun (classes, props) x ->\r\n match unbox x with\r\n | (k, v) when k = ClassName -> string v :: classes, props\r\n | _ -> classes, x :: props) ([], [])\r\n\r\n let combineClasses cn (xs:IReactProperty list) =\r\n xs\r\n |> extractClasses\r\n |> fun (classes, props) -> (cn :: classes |> prop.classes) :: props\r\n\r\nmodule Div =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.div (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.div [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n let inline valueStr (cn:string) (value:string) = Html.div [ prop.className cn; prop.text value ]\r\n let inline valueInt (cn:string) (value:int) = Html.div [ prop.className cn; prop.text value ]\r\n\r\nmodule Nav =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.nav (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.nav [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n\r\nmodule Article =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.article (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.article [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n\r\nmodule Section =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.section (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.section [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n\r\nmodule Footer =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.footer (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.footer [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n\r\nmodule Label =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.label (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.label [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n let inline valueStr (cn:string) (value:string) = Html.label [ prop.className cn; prop.text value ]\r\n let inline valueInt (cn:string) (value:int) = Html.label [ prop.className cn; prop.text value ]\r\n\r\nmodule Input =\r\n let inline propsWithType (cn:string) (typ: IReactProperty) (xs:IReactProperty list) =\r\n Html.input (typ :: Helpers.combineClasses cn xs)\r\n\r\nmodule Textarea =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.textarea (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.textarea [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n\r\nmodule Button =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.button (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.button [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n let inline valueStr (cn:string) (value:string) = Html.button [ prop.className cn; prop.text value ]\r\n let inline valueInt (cn:string) (value:int) = Html.button [ prop.className cn; prop.text value ]\r\n\r\nmodule Span =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.span (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.span [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n let inline valueStr (cn:string) (value:string) = Html.span [ prop.className cn; prop.text value ]\r\n let inline valueInt (cn:string) (value:int) = Html.span [ prop.className cn; prop.text value ]\r\n\r\nmodule Figure =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.figure (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.figure [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n\r\nmodule Progress =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.progress (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.progress [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n let inline valueStr (cn:string) (value:string) = Html.progress [ prop.className cn; prop.text value ]\r\n let inline valueInt (cn:string) (value:int) = Html.progress [ prop.className cn; prop.text value ]\r\n\r\nmodule Table =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.table (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.table [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n\r\nmodule H1 =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.h1 (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.h1 [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n let inline valueStr (cn:string) (value:string) = Html.h1 [ prop.className cn; prop.text value ]\r\n let inline valueInt (cn:string) (value:int) = Html.h1 [ prop.className cn; prop.text value ]\r\n\r\nmodule H2 =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.h2 (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.h2 [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n let inline valueStr (cn:string) (value:string) = Html.h2 [ prop.className cn; prop.text value ]\r\n let inline valueInt (cn:string) (value:int) = Html.h2 [ prop.className cn; prop.text value ]\r\n\r\nmodule H3 =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.h3 (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.h3 [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n let inline valueStr (cn:string) (value:string) = Html.h3 [ prop.className cn; prop.text value ]\r\n let inline valueInt (cn:string) (value:int) = Html.h3 [ prop.className cn; prop.text value ]\r\n\r\nmodule H4 =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.h4 (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.h4 [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n let inline valueStr (cn:string) (value:string) = Html.h4 [ prop.className cn; prop.text value ]\r\n let inline valueInt (cn:string) (value:int) = Html.h4 [ prop.className cn; prop.text value ]\r\n\r\nmodule H5 =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.h5 (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.h5 [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n let inline valueStr (cn:string) (value:string) = Html.h5 [ prop.className cn; prop.text value ]\r\n let inline valueInt (cn:string) (value:int) = Html.h5 [ prop.className cn; prop.text value ]\r\n\r\nmodule H6 =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.h6 (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.h6 [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n let inline valueStr (cn:string) (value:string) = Html.h6 [ prop.className cn; prop.text value ]\r\n let inline valueInt (cn:string) (value:int) = Html.h6 [ prop.className cn; prop.text value ]\r\n\r\nmodule Hr =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.hr (Helpers.combineClasses cn xs)\r\n\r\nmodule Aside =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.aside (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.aside [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n\r\nmodule P =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.p (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.p [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n let inline valueStr (cn:string) (value:string) = Html.p [ prop.className cn; prop.text value ]\r\n let inline valueInt (cn:string) (value:int) = Html.p [ prop.className cn; prop.text value ]\r\n\r\nmodule Ul =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.ul (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.ul [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n\r\nmodule Li =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.li (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.li [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n\r\nmodule Header =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.header (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.header [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n\r\nmodule A =\r\n let inline props (cn:string) (xs:IReactProperty list) = Html.a (Helpers.combineClasses cn xs)\r\n let inline children (cn:string) (children:seq) = Html.a [ prop.className cn; prop.children children ]\r\n let inline valueElm (cn:string) (value:ReactElement) = value |> List.singleton |> children cn\r\n let inline valueStr (cn:string) (value:string) = Html.a [ prop.className cn; prop.text value ]\r\n let inline valueInt (cn:string) (value:int) = Html.a [ prop.className cn; prop.text value ]\r\n","import { equals } from \"./Util.js\";\nimport { Union } from \"./Types.js\";\nconst CaseRules = {\n None: 0,\n LowerFirst: 1,\n SnakeCase: 2,\n SnakeCaseAllCaps: 3,\n KebabCase: 4,\n};\nfunction dashify(str, separator) {\n return str.replace(/[a-z]?[A-Z]/g, (m) => m.length === 1\n ? m.toLowerCase()\n : m.charAt(0) + separator + m.charAt(1).toLowerCase());\n}\nfunction changeCase(str, caseRule) {\n switch (caseRule) {\n case CaseRules.LowerFirst:\n return str.charAt(0).toLowerCase() + str.slice(1);\n case CaseRules.SnakeCase:\n return dashify(str, \"_\");\n case CaseRules.SnakeCaseAllCaps:\n return dashify(str, \"_\").toUpperCase();\n case CaseRules.KebabCase:\n return dashify(str, \"-\");\n case CaseRules.None:\n default:\n return str;\n }\n}\nexport function keyValueList(fields, caseRule = CaseRules.None) {\n const obj = {};\n const definedCaseRule = caseRule;\n function fail(kvPair) {\n throw new Error(\"Cannot infer key and value of \" + String(kvPair));\n }\n function assign(key, caseRule, value) {\n key = changeCase(key, caseRule);\n obj[key] = value;\n }\n for (let kvPair of fields) {\n let caseRule = CaseRules.None;\n if (kvPair == null) {\n fail(kvPair);\n }\n // Deflate unions and use the defined case rule\n if (kvPair instanceof Union) {\n const name = kvPair.cases()[kvPair.tag];\n kvPair = kvPair.fields.length === 0 ? name : [name].concat(kvPair.fields);\n caseRule = definedCaseRule;\n }\n if (Array.isArray(kvPair)) {\n switch (kvPair.length) {\n case 0:\n fail(kvPair);\n break;\n case 1:\n assign(kvPair[0], caseRule, true);\n break;\n case 2:\n const value = kvPair[1];\n assign(kvPair[0], caseRule, value);\n break;\n default:\n assign(kvPair[0], caseRule, kvPair.slice(1));\n }\n }\n else if (typeof kvPair === \"string\") {\n assign(kvPair, caseRule, true);\n }\n else {\n fail(kvPair);\n }\n }\n return obj;\n}\n// TODO: Move these methods to Map and Set modules\nexport function containsValue(v, map) {\n for (const kv of map) {\n if (equals(v, kv[1])) {\n return true;\n }\n }\n return false;\n}\nexport function tryGetValue(map, key, defaultValue) {\n if (map.has(key)) {\n defaultValue.contents = map.get(key);\n return true;\n }\n return false;\n}\nexport function addToSet(v, set) {\n if (set.has(v)) {\n return false;\n }\n set.add(v);\n return true;\n}\nexport function addToDict(dict, k, v) {\n if (dict.has(k)) {\n throw new Error(\"An item with the same key has already been added. Key: \" + k);\n }\n dict.set(k, v);\n}\nexport function getItemFromDict(map, key) {\n if (map.has(key)) {\n return map.get(key);\n }\n else {\n throw new Error(`The given key '${key}' was not present in the dictionary.`);\n }\n}\n","namespace Fable.FontAwesome\n\nopen Fable.Core\nopen Fable.React\nopen Fable.React.Props\n\nmodule internal Helpers =\n\n let classes std (options : string option list) (booleans: (string * bool) list) =\n let std = (std, options) ||> List.fold (fun complete opt ->\n match opt with Some name -> complete + \" \" + name | None -> complete)\n (std, booleans) ||> List.fold (fun complete (name, flag) ->\n if flag then complete + \" \" + name else complete)\n |> ClassName :> IHTMLProp\n\n[]\nmodule Fa =\n\n module Classes =\n module Size =\n let [] FaExtraSmall = \"fa-xs\"\n let [] FaSmall = \"fa-sm\"\n let [] FaLarge = \"fa-lg\"\n let [] Fa2x = \"fa-2x\"\n let [] Fa3x = \"fa-3x\"\n let [] Fa4x = \"fa-4x\"\n let [] Fa5x = \"fa-5x\"\n let [] Fa6x = \"fa-6x\"\n let [] Fa7x = \"fa-7x\"\n let [] Fa8x = \"fa-8x\"\n let [] Fa9x = \"fa-9x\"\n let [] Fa10 = \"fa-10x\"\n\n module Style =\n let [] FixedWidth = \"fa-fw\"\n let [] IsLi = \"fa-li\"\n let [] Border = \"fa-border\"\n let [] Inverse = \"fa-inverse\"\n\n module Rotations =\n let [] Rotate90 = \"fa-rotate-90\"\n let [] Rotate180 = \"fa-rotate-180\"\n let [] Rotate270 = \"fa-rotate-270\"\n\n module Flips =\n let [] Horizontal = \"fa-flip-horizontal\"\n let [] Vertical = \"fa-flip-vertical\"\n\n module Animations =\n let [] Spin = \"fa-spin\"\n let [] Pulse = \"fa-pulse\"\n\n module Pull =\n let [] Right = \"fa-pull-right\"\n let [] Left = \"fa-pull-left\"\n\n module Stack =\n\n let [] Container = \"fa-stack\"\n\n module Size =\n let [] Fa1x = \"fa-stack-1x\"\n let [] Fa2x = \"fa-stack-2x\"\n\n type ISize =\n | FaExtraSmall\n | FaSmall\n | FaLarge\n | Fa2x\n | Fa3x\n | Fa4x\n | Fa5x\n | Fa6x\n | Fa7x\n | Fa8x\n | Fa9x\n | Fa10\n\n type IconOption =\n | Size of ISize\n | Border\n | PullLeft\n | PullRight\n | Inverse\n | Rotate90\n | Rotate180\n | Rotate270\n | FlipHorizontal\n | FlipVertical\n | IsLi\n | Icon of string\n | Spin\n | Pulse\n | Props of IHTMLProp list\n | CustomClass of string\n | FixedWidth\n | Stack1x\n | Stack2x\n\n let internal ofSize (size : ISize) =\n match size with\n | FaExtraSmall -> Classes.Size.FaExtraSmall\n | FaSmall -> Classes.Size.FaSmall\n | FaLarge -> Classes.Size.FaLarge\n | Fa2x -> Classes.Size.Fa2x\n | Fa3x -> Classes.Size.Fa3x\n | Fa4x -> Classes.Size.Fa4x\n | Fa5x -> Classes.Size.Fa5x\n | Fa6x -> Classes.Size.Fa6x\n | Fa7x -> Classes.Size.Fa7x\n | Fa8x -> Classes.Size.Fa8x\n | Fa9x -> Classes.Size.Fa9x\n | Fa10 -> Classes.Size.Fa10\n\n type IconOptions =\n { Icon : string option\n Size : string option\n Border : string option\n Pull : string option\n HaveSpin : bool\n HavePulse : bool\n Rotation : string option\n Flip : string option\n IsInverse : bool\n Props : IHTMLProp list\n FixedWidth : bool\n IsLi : bool\n StackSize : string option\n CustomClass : string option }\n\n static member Empty =\n { Icon = None\n Size = None\n Border = None\n Pull = None\n HaveSpin = false\n HavePulse = false\n Rotation = None\n Flip = None\n IsInverse = false\n Props = [ ]\n FixedWidth = false\n IsLi = false\n StackSize = None\n CustomClass = None }\n\n let toIconOptions (faOptions: IconOption list) =\n let parseOptions (result: IconOptions) (option: IconOption) =\n match option with\n | Size s ->\n { result with Size = ofSize s |> Some }\n | Border ->\n { result with Border = Some Classes.Style.Border }\n | PullLeft ->\n { result with Pull = Some Classes.Pull.Left }\n | PullRight ->\n { result with Pull = Some Classes.Pull.Right }\n | Inverse ->\n { result with IsInverse = true }\n | Icon faIcon ->\n { result with Icon = faIcon |> Some }\n | Rotate90 ->\n { result with Rotation = Classes.Rotations.Rotate90 |> Some }\n | Rotate180 ->\n { result with Rotation = Classes.Rotations.Rotate180 |> Some }\n | Rotate270 ->\n { result with Rotation = Classes.Rotations.Rotate270 |> Some }\n | FlipHorizontal ->\n { result with Rotation = Classes.Flips.Horizontal |> Some }\n | FlipVertical ->\n { result with Rotation = Classes.Flips.Vertical |> Some }\n | Spin ->\n { result with HaveSpin = true }\n | Pulse ->\n { result with HavePulse = true }\n | Props props ->\n { result with Props = props }\n | FixedWidth ->\n { result with FixedWidth = true }\n | IsLi ->\n { result with IsLi = true }\n | CustomClass customClass ->\n { result with CustomClass = Some customClass }\n | Stack1x ->\n { result with StackSize = Some Classes.Stack.Size.Fa1x }\n | Stack2x ->\n { result with StackSize = Some Classes.Stack.Size.Fa2x }\n\n faOptions |> List.fold parseOptions IconOptions.Empty\n\n /// Logic used to display one icon alone or as one item in an unordered list:\n let internal displayIcon baseElement baseClass (opts: IconOptions) children =\n let classes =\n Helpers.classes baseClass\n [ opts.Icon\n opts.Size\n opts.Border\n opts.Pull\n opts.Rotation\n opts.Flip\n opts.CustomClass\n opts.StackSize ]\n [ Classes.Style.FixedWidth, opts.FixedWidth\n Classes.Style.IsLi, opts.IsLi\n Classes.Animations.Pulse, opts.HavePulse\n Classes.Animations.Spin, opts.HaveSpin\n Classes.Style.Inverse, opts.IsInverse ]\n\n baseElement (classes::opts.Props)\n children\n\n let ul props children =\n ul [ ClassName \"fa-ul\" ]\n children\n\n let ol props children =\n ol [ ClassName \"fa-ul\" ]\n children\n\n let i (faOptions: IconOption list) children =\n let opts = toIconOptions faOptions\n displayIcon i \"\" opts children\n\n let span (faOptions: IconOption list) children =\n let opts = toIconOptions faOptions\n displayIcon span \"\" opts children\n\n module Stack =\n type Option =\n | Size of ISize\n | CustomClass of string\n | Props of IHTMLProp list\n\n type internal Options =\n { Size : string option\n Props : IHTMLProp list\n CustomClass : string option }\n\n static member Empty =\n { Size = None\n Props = [ ]\n CustomClass = None }\n\n\n let stack options children =\n let parseOption (result : Stack.Options) opt =\n match opt with\n | Stack.Size size ->\n { result with Size = ofSize size |> Some }\n | Stack.CustomClass customClass ->\n { result with CustomClass = Some customClass }\n | Stack.Props props ->\n { result with Props = props }\n\n let opts = options |> List.fold parseOption Stack.Options.Empty\n let classes = Helpers.classes\n Classes.Stack.Container\n ( opts.Size\n :: opts.CustomClass\n :: [] )\n [ ]\n\n Fable.React.Standard.span (classes::opts.Props)\n children\n","module PortalLibs.Client.Util\r\n\r\n\r\nopen System\r\nopen Fable.Core.JsInterop\r\nopen FSharpPlus\r\nopen Fable.Import.Moment\r\nopen Elmish.Navigation\r\nopen Fable.Remoting.Client\r\nopen Fable.FontAwesome\r\nopen Feliz\r\nopen Feliz.Bulma\r\nopen Fable.Core\r\nopen Browser\r\nopen PortalLibs.Shared\r\n\r\nlet forceReload () = window?location?reload()\r\n\r\nlet inline (=>) k v = k ==> v\r\n\r\nlet goToUrl (e: Browser.Types.MouseEvent) =\r\n e.preventDefault ()\r\n let href = !!e.target?href\r\n\r\n Navigation.newUrl href\r\n |>> (fun f -> f ignore)\r\n |> ignore\r\n\r\nlet ifEnter f (e: Browser.Types.KeyboardEvent) =\r\n if e.key = \"Enter\" then f e\r\n\r\nlet calcMaxDisplayWidth minWidth display lengthToPix (headerText: string) set =\r\n let maxContentLength =\r\n match set with\r\n | [] -> 0\r\n | _ ->\r\n set\r\n |>> (display >> (fun (s: string) -> s.Length))\r\n |> List.max\r\n\r\n\r\n let spacing = 30.0\r\n let maxLength = max maxContentLength headerText.Length\r\n max ((float maxLength) * lengthToPix + spacing) minWidth\r\n\r\nlet prettyPrintDateLong (date: DateTime) = Global.Invoke(date).format \"LL\"\r\n\r\nlet prettyPrintDateShort (date: DateTime) = Global.Invoke(date).format \"L\"\r\n\r\nlet prettyPrintDateDashes (date: DateTime) =\r\n Global.Invoke(date).format \"YYYY-MM-DD\"\r\n\r\nlet prettyPrintDateOptionLong =\r\n function\r\n | None -> String.Empty\r\n | Some x -> prettyPrintDateLong x\r\n\r\nlet prettyPrintDateOptionShort =\r\n function\r\n | None -> String.Empty\r\n | Some x -> prettyPrintDateShort x\r\n\r\nlet printLong (num: int64) = num.ToString()\r\nlet printDecimal (num: decimal) = num.ToString()\r\n\r\nlet isDateBefore (a: Moment) b = a.isBefore b\r\nlet isDateAfter (a: Moment) b = a.isAfter b\r\n\r\nlet compareDateOptions a b operator =\r\n match a with\r\n | None -> true\r\n | Some (dateA: DateTime) ->\r\n match b with\r\n | None -> false\r\n | Some (dateB: DateTime) -> operator (Global.Invoke(dateA)) (Global.Invoke(dateB))\r\n\r\nlet triggerPrint () =\r\n async {\r\n do! Async.Sleep 300\r\n window.print ()\r\n do! Async.Sleep 300\r\n }\r\n\r\nlet emptyStrTagIfNone<'T> (strOpt: Option<'T>) =\r\n strOpt |> Option.emptyStrIfNone |> Html.text\r\n\r\nlet fieldWithControlStyles (name: string) (controls: ReactElement list) styles =\r\n Bulma.field.div [\r\n prop.style [ style.textAlign.left ]\r\n prop.children [\r\n Bulma.label [ prop.text name ]\r\n Bulma.control.div [\r\n prop.style styles\r\n prop.children controls\r\n ]\r\n ]\r\n ]\r\n\r\nlet field (name: string) (controls: ReactElement list) = fieldWithControlStyles name controls []\r\n\r\nlet fieldHoriz (name: string) (controls: ReactElement list) =\r\n fieldWithControlStyles\r\n name\r\n controls\r\n [ style.display.flex\r\n style.alignItems.center ]\r\n\r\n\r\nlet scrollToTop () = window.scrollTo (0.0, 0.0)\r\n\r\nlet scrollTo y =\r\n JS.setTimeout (fun () -> window.scrollTo (0.0, y)) 100\r\n\r\nlet getDivScrollPos id =\r\n let div = document.getElementsByName id\r\n\r\n if div.length > 0 then\r\n let scroll = div.[0].scrollTop\r\n Some scroll\r\n else\r\n None\r\n\r\nlet scrollDivToPos id pos =\r\n let div = document.getElementsByName id\r\n\r\n if div.length > 0 then\r\n div.[0].scrollTop <- pos\r\n\r\nlet getTableScrollPos () =\r\n let div =\r\n document.getElementsByClassName \"rt-tbody\"\r\n\r\n if div.length > 0 then\r\n let scroll = div.[0].scrollTop\r\n Some scroll\r\n else\r\n None\r\n\r\nlet scrollTableToPos pos =\r\n JS.setTimeout\r\n (fun () ->\r\n let div =\r\n document.getElementsByClassName \"rt-tbody\"\r\n\r\n if div.length > 0 then\r\n div.[0].scrollTop <- pos)\r\n 100\r\n |> ignore\r\n\r\nlet scrollIntoView id =\r\n JS.setTimeout\r\n (fun () ->\r\n let elem = document.getElementById id\r\n elem.scrollIntoView true)\r\n 100\r\n |> ignore\r\n\r\nlet getWindowScrollValue () = Dom.window.scrollY\r\n\r\nlet authenticatingCompOrErrorMessage (e: exn) comp =\r\n match e with\r\n | :? ProxyRequestException as ex ->\r\n if ex.StatusCode = 401 then\r\n comp\r\n else\r\n [ Html.text \"Error: \"\r\n Html.text e.Message ]\r\n | _ ->\r\n [ Html.text \"Error: \"\r\n Html.text e.Message ]\r\n\r\nlet authenticatingOrErrorMessage (e: exn) =\r\n authenticatingCompOrErrorMessage e [ Html.text \"Authentication required, redirecting...\" ]\r\n\r\ntype IconSize =\r\n | Large\r\n | Small\r\n | Normal\r\n\r\nlet loadingWithElem (elem: ReactElement) size =\r\n Html.div [\r\n prop.style [ style.textAlign.center ]\r\n prop.children [\r\n Bulma.icon [\r\n match size with\r\n | Large -> icon.isLarge\r\n | Small -> icon.isSmall\r\n | Normal -> icon.isMedium\r\n prop.children [\r\n Fa.i [ Fa.Solid.Spinner\r\n Fa.Pulse\r\n match size with\r\n | Large -> Fa.Size Fa.Fa2x\r\n | Small -> Fa.Size Fa.FaSmall\r\n | Normal -> () ] []\r\n ]\r\n ]\r\n Html.div [ elem ]\r\n ]\r\n ]\r\n\r\nlet smallSpinner = loadingWithElem Html.none IconSize.Small\r\n\r\nlet loadingWithMessage (message: String) =\r\n loadingWithElem (Html.text message) Large\r\n\r\nlet loadingWithMessageHoriz (message: String) =\r\n Html.div [\r\n prop.style [ style.display.flex ]\r\n prop.children [\r\n Bulma.icon [\r\n prop.children [\r\n Fa.i [ Fa.Solid.Spinner; Fa.Pulse ] []\r\n ]\r\n ]\r\n Html.text message\r\n ]\r\n ]\r\n\r\nlet loadingMessageOrContent message content option =\r\n match option with\r\n | None ->\r\n Html.div [\r\n prop.style [ style.height 300 ]\r\n prop.children (\r\n Html.div [\r\n prop.style [\r\n style.position.relative\r\n style.top (length.perc 30)\r\n ]\r\n prop.children (loadingWithMessage message)\r\n ]\r\n )\r\n ]\r\n | Some some -> content some\r\n\r\nlet spinnerOrContent' option size content =\r\n match option with\r\n | None -> loadingWithElem Html.none size\r\n | Some some -> content some\r\n\r\nlet nothingOrContent option content =\r\n match option with\r\n | None -> Html.none\r\n | Some some -> content some\r\n\r\nlet spinnerOrContent option content = spinnerOrContent' option Large content\r\n\r\nlet loadingMessageBoxOrContent option message content =\r\n Bulma.box (loadingMessageOrContent option message content)\r\n\r\nlet elemInBox (elem: ReactElement) =\r\n Bulma.box [\r\n prop.style [ style.height 300 ]\r\n prop.children (\r\n Html.div [\r\n prop.style [\r\n style.position.relative\r\n style.top (length.perc 30)\r\n ]\r\n prop.children elem\r\n ]\r\n )\r\n ]\r\n\r\nlet loadingMessageInBoxOrContent option message content =\r\n match option with\r\n | None -> elemInBox (loadingWithMessage message)\r\n | Some some -> content some\r\n\r\n\r\n[]\r\nlet ReactNumericInput: obj = jsNative\r\n\r\nlet numericInputControl value valueChanged =\r\n let props =\r\n createObj [\r\n \"min\" => 0\r\n \"value\" => value\r\n \"onChange\"\r\n => (fun v ->\r\n printfn $\"value changed %i{v}\"\r\n valueChanged v)\r\n \"className\" => \"input\"\r\n ]\r\n\r\n Fable.React.Helpers.ofImport \"default\" \"rc-input-number\" props []\r\n\r\n\r\nlet reactFileViewer (url: string) =\r\n let inputProps =\r\n createObj [\r\n \"fileType\"\r\n => (url.Split(\".\") |> List.ofArray |> List.last)\r\n \"filePath\" => url\r\n ]\r\n\r\n Fable.React.Helpers.ofImport \"default\" \"@studyworld/react-file-viewer\" inputProps []\r\n\r\nlet inline valueOrDefault value (e: obj) =\r\n\r\n if e |> isNull |> not && !!e?value <> !!value then\r\n e?value <- !!value\r\n\r\n\r\nlet fieldWithHeader (widthOpt: int option) _styles (name: string) (field: ReactElement) =\r\n Html.div [\r\n prop.style [\r\n style.marginRight 15\r\n match widthOpt with\r\n | None -> ()\r\n | Some width -> style.width width\r\n ]\r\n prop.children [\r\n Html.div [\r\n prop.style [\r\n style.display.flex\r\n style.flexDirection.column\r\n style.height (length.perc 100)\r\n ]\r\n prop.children [\r\n Html.div [\r\n prop.style [\r\n style.flexGrow 1\r\n style.display.flex\r\n style.alignItems.center\r\n style.marginBottom 0\r\n ]\r\n prop.children [ Bulma.label name ]\r\n ]\r\n Bulma.control.div [ field ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n\r\nlet textFieldReadOnlyStyles (widthOpt: int option) styles (name: string) (value: string) =\r\n fieldWithHeader\r\n widthOpt\r\n styles\r\n name\r\n (Bulma.control.div [\r\n Bulma.input.text [\r\n prop.style styles\r\n prop.value value\r\n prop.disabled true\r\n ]\r\n ])\r\n\r\nlet textFieldReadOnly = textFieldReadOnlyStyles (Some 200) []\r\n\r\nlet filterItemBySearchTerm<'T> (getters: ('T -> string) list) (term: string) (item: 'T) =\r\n match term with\r\n | \"\" -> true\r\n | x ->\r\n let matcher =\r\n List.fold (fun acc getter -> (acc + (getter item) + \" \")) \"\" getters\r\n\r\n matcher.ToLower().Contains(x.ToLower())\r\n || List.fold (fun acc getter -> acc && (getter item) = \"\") true getters\r\n\r\n\r\n[]\r\nlet bodyScrollToggle: obj = jsNative\r\n\r\nlet bodyScrollEnable () = !! bodyScrollToggle?enable ()\r\n\r\nlet bodyScrollDisable () = !! bodyScrollToggle?disable ()\r\n\r\nlet dateToSqlString (date: DateTime) =\r\n date.ToString(\"yyyy-MM-dd HH:mm:ss.fff\")\r\n\r\n\r\nlet centeredElem elem =\r\n Html.div [\r\n prop.style [\r\n style.display.flex\r\n style.flexDirection.column\r\n style.alignItems.center\r\n ]\r\n prop.children [\r\n Html.span [\r\n prop.style [\r\n style.textAlign.center\r\n style.marginTop 30\r\n ]\r\n prop.children [ elem ]\r\n ]\r\n ]\r\n ]\r\n\r\nlet textMiddle (text: String) = centeredElem (Html.text text)","namespace Thoth.Elmish\n\n[]\nmodule Debouncer =\n\n open System\n open Fable.Core\n open Elmish\n\n type Id = string\n\n type State =\n { PendingMessages : Map }\n\n let create () =\n { PendingMessages = Map.empty }\n\n type SelfMessage<'AppMsg> =\n | Timeout of id:Id * appMsg:'AppMsg\n | OnError of exn\n\n let bounce (delay : TimeSpan) (id: Id) (msgToSend: 'a) (currentState : State) =\n let counterInc =\n Option.map ((+) 1) >> Option.defaultValue 1\n\n let delayedCmd _ =\n promise {\n do! Promise.sleep (int delay.TotalMilliseconds)\n return (id, msgToSend)\n }\n\n let updatedState =\n let newCounter = Map.tryFind id currentState.PendingMessages |> counterInc\n\n { currentState\n with PendingMessages = Map.add id newCounter currentState.PendingMessages }\n\n updatedState, Cmd.OfPromise.either delayedCmd () Timeout OnError\n\n let update (selfMessage : SelfMessage<_>) (currentState : State) =\n match selfMessage with\n | OnError error ->\n JS.console.error error.Message\n currentState, Cmd.none\n\n | Timeout (id, appMsg) ->\n let remainingMessages =\n (Map.tryFind id currentState.PendingMessages |> Option.defaultValue 0) - 1\n\n if remainingMessages = 0 then\n { currentState with PendingMessages = Map.remove id currentState.PendingMessages }, Cmd.OfFunc.result appMsg\n else if remainingMessages > 0 then\n { currentState with PendingMessages = Map.add id remainingMessages currentState.PendingMessages }, Cmd.none\n else\n JS.console.warn \"Invalid debouncer state: there was no state information for the supplier id\"\n currentState, Cmd.none\n","\r\n[]\r\nmodule Promise\r\n\r\n#nowarn \"1182\" // Unused values\r\n\r\nopen System\r\nopen Fable.Core\r\nopen Fable.Core.JsInterop\r\n\r\n/// \r\n/// Create a promise from a function\r\n/// \r\n/// \r\n/// let write (path: string) (content: string) =\r\n/// Promise.create (fun resolve reject ->\r\n/// Node.Api.fs.writeFile(path, content, (fun res ->\r\n/// match res with\r\n/// | Some res -> reject (res :?> System.Exception)\r\n/// | None -> resolve ()\r\n/// ))\r\n/// )\r\n/// \r\n/// \r\n/// \r\n/// \r\n/// Function used to create the promise, it receives two other function parameters:\r\n///\r\n/// - success : called when the promise is resolved\r\n/// - fail : called when the promise is rejected\r\n/// \r\n/// Return type of the promise\r\n/// \r\n/// The promise created by the function\r\n/// \r\n[]\r\nlet create (f: ('T -> unit) -> (exn -> unit) -> unit): JS.Promise<'T> = jsNative\r\n\r\n/// \r\n/// Create a promise which wait X ms before resolving.\r\n/// \r\n/// \r\n/// // Do something\r\n/// doSomething ()\r\n/// // Sleep for 1 second\r\n/// |> Promise.sleep 1000\r\n/// // Do another thing\r\n/// |> Promise.map (fun _ ->\r\n/// doAnotherThing ()\r\n/// )\r\n/// |> Promise.map ...\r\n/// \r\n/// \r\n/// \r\n/// Number of milliseconds to wait\r\n/// A delayed promise\r\n[ setTimeout(resolve, $0))\")>]\r\nlet sleep (ms: int): JS.Promise = jsNative\r\n\r\n/// \r\n/// Create a promise (in resolved state) with supplied value.\r\n/// \r\n/// \r\n/// Promise.lift {| Firstname = \"John\" |}\r\n/// |> Promise.map (fun user ->\r\n/// console.log $\"Hello, %s{user.Firstname}\"\r\n/// // Expected output: \"Hello, John\"\r\n/// )\r\n/// |> Promise.map ...\r\n/// \r\n/// \r\n/// \r\n/// Value to return\r\n/// \r\n/// Returns a promise returning the supplied value\r\n[]\r\nlet lift<'T> (a: 'T): JS.Promise<'T> = jsNative\r\n\r\n/// \r\n/// Creates promise (in rejected state) with supplied reason.\r\n/// \r\n/// \r\n/// Promise.reject (Exception \"User not found\")\r\n/// |> Promise.map (fun _ ->\r\n/// // This promise is skipped\r\n/// )\r\n/// |> Promise.catch (fun error ->\r\n/// console.error $\"An error ocurred: %s{error.Message}\"\r\n/// // Expected output: \"An error ocurred: User not found\"\r\n/// )\r\n/// |> Promise.map ...\r\n/// \r\n/// \r\n/// \r\n/// Reason to return\r\n/// \r\n/// Return a promise in a rejected state\r\n[]\r\nlet reject<'T> (reason: exn) : JS.Promise<'T> = jsNative\r\n\r\n/// \r\n/// Bind a value into a promise of a new type.\r\n/// \r\n/// \r\n/// Promise.lift {| Firstname = \"John\" |}\r\n/// |> Promise.bind (fun user ->\r\n/// // Do something with user and returns a promise\r\n/// Promise.create (fun resolve reject ->\r\n/// resolve $\"Hello, %s{user.Firstname}\"\r\n/// )\r\n/// )\r\n/// |> Promise.map (fun message ->\r\n/// console.log message\r\n/// // Expected output: \"Hello, John\"\r\n/// )\r\n/// |> Promise.map ...\r\n/// \r\n/// \r\n/// \r\n/// \r\n/// A function that takes the value of type T1 and transforms it into a promise of type T2.\r\n/// \r\n/// The input promise\r\n/// \r\n/// \r\n/// A promise of the output type of the binder.\r\n[]\r\nlet bind (a: 'T1 -> JS.Promise<'T2>) (pr: JS.Promise<'T1>): JS.Promise<'T2> = jsNative\r\n\r\n/// \r\n/// Map a value into another type, the result will be wrapped in a promise for you.\r\n/// \r\n/// \r\n/// Promise.lift {| Firstname = \"John\" |}\r\n/// |> Promise.map (fun user ->\r\n/// user.Firstname\r\n/// ) // Returns a Promise<string> with the value \"John\"\r\n/// |> Promise.map ...\r\n/// \r\n/// \r\n/// \r\n/// A function to apply to the result of the input promise.\r\n/// The input promise\r\n/// \r\n/// \r\n/// A promise after applying the mapping function\r\n[]\r\nlet map (a: 'T1 -> 'T2) (pr: JS.Promise<'T1>): JS.Promise<'T2> = jsNative\r\n\r\n/// \r\n/// Call a function with the result of a promise and stop the promise chain.\r\n///\r\n/// This is equivalent to Promise.map ... |> ignore\r\n/// \r\n/// \r\n/// fetchUser ()\r\n/// |> Promise.iter (fun user ->\r\n/// console.log \"User firstname is user.Firstname\"\r\n/// ) // unit\r\n/// \r\n/// \r\n/// \r\n/// A function to apply to the result of the input promise\r\n/// The input promise\r\n/// \r\n[]\r\nlet iter (a: 'T -> unit) (pr: JS.Promise<'T>): unit = jsNative\r\n\r\n/// \r\n/// This is an identity function, it calls the given function and return the promise value untouched.\r\n/// \r\n/// \r\n/// fetchUser ()\r\n/// |> Promise.tap (fun user ->\r\n/// // Do something\r\n/// console.log \"The user has been received\"\r\n/// )\r\n/// |> Promise.map (fun user ->\r\n/// // user value is available here untouched\r\n/// )\r\n/// \r\n/// \r\n/// \r\n/// A function to call after receiving the receiving of the input promise\r\n/// The input promise\r\n/// \r\n/// A promise of the same type as the input promise\r\nlet tap (fn: 'T -> unit) (a: JS.Promise<'T>): JS.Promise<'T> =\r\n a |> map (fun x -> fn x; x)\r\n\r\n/// \r\n/// Handle an errored promise allowing you pass a return value.\r\n///\r\n/// This version of catch expects a function returning just 'T, as opposed to Promise<'T>. If you need to return Promise<'T>, use catchBind.\r\n/// \r\n/// \r\n/// Promise.create (fun resolve reject ->\r\n/// reject (System.Exception \"User not found\")\r\n/// )\r\n/// |> Promise.catch (fun error ->\r\n/// // Log the error\r\n/// console.error error\r\n/// // Do something to recover from the error\r\n/// Error error.Message\r\n/// )\r\n/// |> Promise.map ...\r\n/// \r\n/// \r\n/// \r\n/// Function to call if the input promise fail\r\n/// The input promise\r\n/// \r\n/// A promise which result of the call of fail\r\n[]\r\nlet catch (fail: exn -> 'T) (pr: JS.Promise<'T>): JS.Promise<'T> = jsNative\r\n\r\n/// \r\n/// Handle an errored promise allowing to call a promise.\r\n///\r\n/// This version of catch expects a function returning Promise<'T> as opposed to just 'T. If you need to return just 'T, use catch.\r\n/// \r\n/// \r\n/// Promise.create (fun resolve reject ->\r\n/// reject (System.Exception \"User not found\")\r\n/// )\r\n/// |> Promise.catchBind (fun error ->\r\n/// // Recover from the error, here we call another promise and returns it's result\r\n/// logErrorToTheServer error\r\n/// )\r\n/// |> Promise.map ...\r\n/// \r\n/// \r\n/// \r\n/// Function to call if the input promise fail\r\n/// The input promise\r\n/// \r\n/// A promise which is the result of the fail function\r\n[]\r\nlet catchBind (fail: exn -> JS.Promise<'T>) (pr: JS.Promise<'T>): JS.Promise<'T> = jsNative\r\n\r\n/// \r\n/// Used to catch errors at the end of a promise chain.\r\n/// \r\n/// \r\n/// Promise.create (fun resolve reject ->\r\n/// reject (System.Exception \"User not found\")\r\n/// )\r\n/// |> Promise.map (fun _ ->\r\n/// // ...\r\n/// )\r\n/// |> Promise.map (fun _ ->\r\n/// // ...\r\n/// )\r\n/// |> Promise.catchEnd (fun error ->\r\n/// // ...\r\n/// ) // Returns unit\r\n/// \r\n/// \r\n/// \r\n/// Fuction to call if the input promise fail\r\n/// The input promise\r\n/// \r\n[]\r\nlet catchEnd (fail: exn -> unit) (pr: JS.Promise<'T>): unit = jsNative\r\n\r\n/// \r\n/// A combination of map and catch, this function applies the success continuation when the input promise resolves successfully, or fail continuation when the input promise fails.\r\n/// \r\n/// \r\n/// somePromise\r\n/// |> Promise.either\r\n/// (fun x -> string x)\r\n/// (fun err -> Promise.lift err.Message)\r\n/// |> Promise.map ...\r\n/// \r\n/// \r\n/// \r\n/// Function to call if the input promise succeeds\r\n/// Function to call if the input promise fail\r\n/// The input promise\r\n/// \r\n/// \r\n/// A new promise which is the result of calling success if pr succeedes, or of fail if pr failed\r\n[]\r\nlet either (success: 'T1 -> 'T2) (fail: exn -> 'T2) (pr: JS.Promise<'T1>): JS.Promise<'T2> = jsNative\r\n\r\n/// \r\n/// A combination of bind and catchBind, this function applies the success continuation when the input promise resolves successfully, or fail continuation when the input promise fails.\r\n/// \r\n/// \r\n/// somePromise\r\n/// |> Promise.eitherBind\r\n/// (fun x -> string x |> Promise.lift)\r\n/// (fun err -> Promise.lift err.Message)\r\n/// |> Promise.map ...\r\n/// \r\n/// \r\n/// \r\n/// Binder function to call if the input promise succeeds\r\n/// Binder function to call if the input promise fail\r\n/// The input promise\r\n/// \r\n/// \r\n/// A new promise which is the result of calling success if pr succeedes, or of fail if pr failed\r\n[]\r\nlet eitherBind (success: 'T1 -> JS.Promise<'T2>) (fail: exn -> JS.Promise<'T2>) (pr: JS.Promise<'T1>): JS.Promise<'T2> = jsNative\r\n\r\n/// \r\n/// Same as Promise.either but stopping the promise execution.\r\n/// \r\n/// \r\n/// somePromise\r\n/// |> Promise.eitherEnd\r\n/// (fun x -> string x)\r\n/// (fun err -> Promise.lift err.Message)\r\n/// \r\n/// \r\n/// \r\n/// Binder function to call if the input promise succeeds\r\n/// Binder function to call if the input promise fail\r\n/// The input promise\r\n/// \r\n[]\r\nlet eitherEnd (success: 'T -> unit) (fail: exn -> unit) (pr: JS.Promise<'T>): unit = jsNative\r\n\r\n/// \r\n/// Start a promise.\r\n///\r\n/// Fake starting a promise. It is faking it because promise are hot meaning they execute directly after their creation.\r\n///\r\n/// Promise.start is equivalent to promise |> ignore\r\n///\r\n/// \r\n/// \r\n/// myPromise\r\n/// |> Promise.start\r\n/// \r\n/// \r\n/// \r\n/// The input promise\r\n/// \r\n[]\r\nlet start (pr: JS.Promise<'T>): unit = jsNative\r\n\r\n/// \r\n/// Same as Promise.start but forcing you to handle the rejected state.\r\n/// \r\n/// \r\n/// myPromise\r\n/// |> Promise.tryStart\r\n/// (fun error ->\r\n/// // Do something on error\r\n/// )\r\n/// \r\n/// \r\n/// \r\n/// Function to apply if the promise fail\r\n/// The input promise\r\n/// \r\n[]\r\nlet tryStart (fail: exn -> unit) (pr: JS.Promise<'T>): unit = jsNative\r\n\r\n/// \r\n/// Takes a sequence of promises as an input, and returns a single Promise that resolves to an array of the results of the input promises.\r\n/// \r\n/// \r\n/// let p1 =\r\n/// promise {\r\n/// do! Promise.sleep 100\r\n/// return 1\r\n/// }\r\n/// let p2 =\r\n/// promise {\r\n/// do! Promise.sleep 200\r\n/// return 2\r\n/// }\r\n/// let p3 =\r\n/// promise {\r\n/// do! Promise.sleep 300\r\n/// return 3\r\n/// }\r\n///\r\n/// Promise.Parallel [p1; p2; p3]\r\n/// |> Promise.map (fun res ->\r\n/// // res = [|1; 2; 3 |]\r\n/// )\r\n/// |> Promise.map ...\r\n/// \r\n/// \r\n/// \r\n/// A list of promise to wait for\r\n/// \r\n/// Return a new promise returning an array containing all the promise result\r\n[]\r\nlet Parallel (pr: seq>): JS.Promise<'T[]> = jsNative\r\n\r\n/// \r\n/// Takes a sequence of promises as an input, and returns a single Promise that resolves to an array of the results of the input promises.\r\n/// \r\n/// \r\n/// let p1 =\r\n/// promise {\r\n/// do! Promise.sleep 100\r\n/// return 1\r\n/// }\r\n/// let p2 =\r\n/// promise {\r\n/// do! Promise.sleep 200\r\n/// return 2\r\n/// }\r\n/// let p3 =\r\n/// promise {\r\n/// do! Promise.sleep 300\r\n/// return 3\r\n/// }\r\n///\r\n/// Promise.all [p1; p2; p3]\r\n/// |> Promise.map (fun res ->\r\n/// // res = [|1; 2; 3 |]\r\n/// )\r\n/// |> Promise.map ...\r\n/// \r\n/// \r\n///\r\n/// Note: If you need to return mixed types you can use boxing and unboxing\r\n///\r\n/// \r\n/// \r\n/// let users =\r\n/// promise {\r\n/// let! users = fetchUsers ()\r\n/// return box users\r\n/// }\r\n/// let posts =\r\n/// promise {\r\n/// let! posts = fetchPosts ()\r\n/// return box posts\r\n/// }\r\n///\r\n/// Promise.all [p1; p2]\r\n/// |> Promise.map (fun res ->\r\n/// let users = unbox<User list> res.[0]\r\n/// let posts = unbox<Post list> res.[1]\r\n/// // ...\r\n/// )\r\n/// \r\n/// \r\n/// \r\n/// A list of promise to wait for\r\n/// \r\n/// Return a new promise returning an array containing all the promise result\r\n[]\r\nlet all (pr: seq>): JS.Promise<'T[]> = jsNative\r\n\r\n[]\r\ntype SettledStatus =\r\n | Fulfilled\r\n | Rejected\r\n\r\ntype SettledValue<'T> =\r\n abstract status: SettledStatus\r\n abstract value: 'T option\r\n abstract reason: exn option\r\n\r\n/// \r\n/// The Promise.allSettled function returns a promise that resolves after all of the given promises have either\r\n/// fulfilled or rejected, with an array of objects that each describes the outcome of each promise.\r\n/// It is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully,\r\n/// or you'd always like to know the result of each promise.\r\n/// In comparison, the Promise returned by Promise.all may be more appropriate if the tasks are dependent\r\n/// on each other / if you'd like to immediately reject upon any of them rejecting.\r\n/// \r\n/// A list of promise to wait for\r\n/// \r\n/// \r\n/// \r\n/// let success =\r\n/// promise {\r\n/// do! Promise.sleep 100\r\n/// return 1\r\n/// }\r\n/// let rejection = Promise.reject (exn \"I Failed\")\r\n/// \r\n/// Promise.allSettled [success; rejection]\r\n/// |> Promise.map(fun values ->\r\n/// let success = values.[0]\r\n/// let rejection = values.[1]\r\n/// success.value.Value |> equal 1\r\n/// rejection.reason.Value.Message |> equal \"I Failed\"\r\n/// )\r\n/// \r\n/// \r\n[]\r\nlet allSettled (pr: seq>): JS.Promise[]> = jsNative\r\n\r\n/// \r\n/// Promise.any takes an iterable of Promise objects.\r\n/// It returns a single promise that resolves as soon as\r\n/// any of the promises in the iterable fulfills,\r\n/// with the value of the fulfilled promise. If no promises in the iterable fulfill\r\n/// (if all of the given promises are rejected),\r\n/// then the returned promise is rejected with an AggregateError,\r\n/// a new subclass of Error that groups together individual errors.\r\n/// \r\n/// A list of promise to wait for\r\n/// \r\n/// \r\n/// \r\n/// let success() =\r\n/// promise {\r\n/// do! Promise.sleep 100\r\n/// return 1\r\n/// }\r\n/// let rejection() = Promise.reject (exn \"I Failed\")\r\n/// let rejection2() =\r\n/// promise {\r\n/// do! Promise.sleep 50\r\n/// return! Promise.reject (exn \"I Failed\")\r\n/// }\r\n/// \r\n/// Promise.any [rejection(); rejection2(); success()]\r\n/// |> Promise.map (fun result ->\r\n/// result |> equal 1\r\n/// )\r\n/// \r\n/// \r\n[]\r\nlet any (pr: seq>): JS.Promise<'T> = jsNative\r\n\r\n/// \r\n/// The Promise.race method returns a promise that fulfills or\r\n/// rejects as soon as one of the promises in an iterable fulfills or rejects,\r\n/// with the value or reason from that promise.\r\n/// \r\n/// \r\n/// \r\n/// let success() =\r\n/// promise {\r\n/// do! Promise.sleep 5\r\n/// return 1\r\n/// }\r\n/// let rejection() =\r\n/// promise {\r\n/// do! Promise.sleep 10\r\n/// return! Promise.reject (exn \"I Failed First\")\r\n/// }\r\n/// let rejection2() =\r\n/// promise {\r\n/// do! Promise.sleep 50\r\n/// return! Promise.reject (exn \"I Failed Last\")\r\n/// }\r\n/// \r\n/// Promise.race [rejection2(); rejection(); success()]\r\n/// |> Promise.map(fun result ->\r\n/// result |> equal 1 \r\n/// )\r\n/// \r\n/// \r\n[]\r\nlet race (pr: seq>): JS.Promise<'T> = jsNative\r\n\r\n/// \r\n/// Map the Promise result into a Result type.\r\n/// \r\n/// \r\n/// Success example\r\n/// Promise.lift 42\r\n/// |> Promise.result\r\n/// |> Promise.map (fun value ->\r\n/// // value = Ok 42\r\n/// )\r\n///\r\n/// // Fail example\r\n/// Promise.reject \"Invalid value\"\r\n/// |> Promise.result\r\n/// |> Promise.map (fun value ->\r\n/// // value = Error \"Invalid value\"\r\n/// )\r\n/// \r\n/// \r\n/// \r\n/// The input promise\r\n/// \r\n/// A promise returning Ok if the input promise succeed, Error if the input promise failed\r\nlet result (a: JS.Promise<'T>): JS.Promise> =\r\n either Ok Error a\r\n\r\n/// \r\n/// Evaluates to `myPromise |> Promise.map (Result.map fn)`\r\n/// \r\n/// \r\n/// Promise.lift 42\r\n/// |> Promise.result\r\n/// |> Promise.mapResult (fun value ->\r\n/// value + 10\r\n/// )\r\n/// |> Promise.map (fun value ->\r\n/// // value = Ok 52\r\n/// )\r\n/// \r\n/// \r\n/// \r\n/// The mapping function\r\n/// The input promise\r\n/// \r\n/// \r\n/// \r\n/// A promise returning the result of applying the mapping function to the input promise result\r\nlet mapResult (fn: 'T1 -> 'T2) (a: JS.Promise>): JS.Promise> =\r\n a |> map (Result.map fn)\r\n\r\n\r\n/// \r\n/// Transform the success part of a result promise into another promise.\r\n/// \r\n/// \r\n/// let multiplyBy2 (value : int) =\r\n/// Promise.create (fun resolve reject ->\r\n/// resolve (value * 2)\r\n/// )\r\n///\r\n/// Promise.lift 42\r\n/// |> Promise.result\r\n/// |> Promise.bindResult (fun value ->\r\n/// multiplyBy2 value\r\n/// )\r\n/// |> Promise.map (fun value ->\r\n/// // value = Ok 84\r\n/// )\r\n/// \r\n/// \r\n/// \r\n/// The binder function\r\n/// The input promise\r\n/// \r\n/// \r\n/// \r\n/// Returns a new promise applying to the binder function to it if the input promise succeed\r\nlet bindResult (fn: 'T1 -> JS.Promise<'T2>) (a: JS.Promise>): JS.Promise> =\r\n a |> bind (fun a ->\r\n match a with\r\n | Ok a ->\r\n fn a |> map Ok\r\n | Error e ->\r\n lift (Error e))\r\n\r\n/// \r\n/// Evaluates to myPromise |> Promise.map (Result.map fn)\r\n/// \r\n/// \r\n/// Promise.reject -1\r\n/// |> Promise.result\r\n/// |> Promise.mapResultError (fun value ->\r\n/// $\"%s{value} is not a valid value\"\r\n/// )\r\n/// |> Promise.map (fun value ->\r\n/// // value = Error \"-1 is not a valid value\"\r\n/// )\r\n/// \r\n/// \r\n/// \r\n/// A mapper function\r\n/// The input promise\r\n/// \r\n/// \r\n/// \r\n/// A promise returning the result of applying the mapper function to the input promise in case of error, otherwise the result of the input promise as it is\r\nlet mapResultError (fn: 'E1 -> 'E2) (a: JS.Promise>): JS.Promise> =\r\n a |> map (Result.mapError fn)\r\n\r\n/// \r\n/// A builder to provide promise Computation Expression support.\r\n///\r\n/// The CE is available via promise { ... }\r\n/// \r\n/// \r\n/// let double (value : int) =\r\n/// promise {\r\n/// return value * 2\r\n/// }\r\n/// \r\n/// \r\n/// \r\ntype PromiseBuilder() =\r\n []\r\n member _.Bind(p: JS.Promise<'T1>, f: 'T1 -> JS.Promise<'T2>): JS.Promise<'T2> = jsNative\r\n\r\n [ $2)\")>]\r\n member _.Combine(p1: JS.Promise, p2: JS.Promise<'T>): JS.Promise<'T> = jsNative\r\n\r\n member _.For(seq: seq<'T>, body: 'T -> JS.Promise): JS.Promise =\r\n // (lift (), seq)\r\n // ||> Seq.fold (fun p a ->\r\n // bind (fun () -> body a) p)\r\n let mutable p = lift ()\r\n for a in seq do\r\n p <- p |> bind (fun () -> body a)\r\n p\r\n\r\n []\r\n member _.For(p: JS.Promise<'T1>, f: 'T1 -> JS.Promise<'T2>): JS.Promise<'T2> = jsNative\r\n\r\n member this.While(guard: unit -> bool, p: JS.Promise): JS.Promise =\r\n if guard()\r\n then bind (fun () -> this.While(guard, p)) p\r\n else lift()\r\n\r\n []\r\n member _.Return(a: 'T): JS.Promise<'T> = jsNative\r\n\r\n []\r\n member _.ReturnFrom(p: JS.Promise<'T>): JS.Promise<'T> = jsNative\r\n\r\n []\r\n member _.Zero(): JS.Promise = jsNative\r\n\r\n member _.TryFinally(p: JS.Promise<'T>, compensation: unit -> unit): JS.Promise<'T> =\r\n either (fun (x: 'T) -> compensation(); x) (fun er -> compensation(); raise er) p\r\n\r\n []\r\n member _.TryWith(p: JS.Promise<'T>, catchHandler: exn -> JS.Promise<'T>): JS.Promise<'T> = jsNative\r\n\r\n // Delay must generate a cold promise-like object that re-runs every time it's called,\r\n // so we cannot use the JS Promise constructor which is stateful\r\n member _.Delay(generator: unit -> JS.Promise<'T>): JS.Promise<'T> =\r\n !!createObj [\r\n \"then\" ==> fun onSuccess onError ->\r\n try generator().``then``(onSuccess, onError)\r\n with er ->\r\n if isNull(box onError) then reject er\r\n else\r\n try onError er |> lift\r\n with er -> reject er\r\n \"catch\" ==> fun onError ->\r\n try generator().catch(onError)\r\n with er ->\r\n try onError er |> lift\r\n with er -> reject er\r\n ]\r\n\r\n // Make sure we call `then` because this may be used with \"cold\" fake promises generated by Delay\r\n member _.Run(p:JS.Promise<'T>): JS.Promise<'T> = p.``then``(id)\r\n\r\n member this.Using<'T1, 'T2 when 'T1 :> IDisposable>(resource: 'T1, binder: 'T1 -> JS.Promise<'T2>): JS.Promise<'T2> =\r\n this.TryFinally(binder(resource), fun () -> resource.Dispose())\r\n\r\n []\r\n member _.MergeSources(a: JS.Promise<'T1>, b: JS.Promise<'T2>): JS.Promise<'T1 * 'T2> = jsNative\r\n\r\n []\r\n member _.MergeSources3(a: JS.Promise<'T1>, b: JS.Promise<'T2>, c: JS.Promise<'T3>): JS.Promise<'T1 * 'T2 * 'T3> = jsNative\r\n\r\n []\r\n member _.MergeSources4(a: JS.Promise<'T1>, b: JS.Promise<'T2>, c: JS.Promise<'T3>, d: JS.Promise<'T4>): JS.Promise<'T1 * 'T2 * 'T3 * 'T4> = jsNative\r\n\r\n []\r\n member _.MergeSources5(a: JS.Promise<'T1>, b: JS.Promise<'T2>, c: JS.Promise<'T3>, d: JS.Promise<'T4>, e: JS.Promise<'T5>): JS.Promise<'T1 * 'T2 * 'T3 * 'T4 * 'T5> = jsNative\r\n\r\n []\r\n member _.MergeSources6(a: JS.Promise<'T1>, b: JS.Promise<'T2>, c: JS.Promise<'T3>, d: JS.Promise<'T4>, e: JS.Promise<'T5>, f: JS.Promise<'T6>): JS.Promise<'T1 * 'T2 * 'T3 * 'T4 * 'T5 * 'T6> = jsNative\r\n\r\n// member _.BindReturn(y: JS.Promise<'T1>, f) = map f y\r\n\r\n [ $3(a,b))\")>]\r\n []\r\n member _.Merge(a: JS.Promise<'T1>, b: JS.Promise<'T2>, [] resultSelector : 'T1 -> 'T2 -> 'R): JS.Promise<'R> = jsNative\r\n","import { Record, Union } from \"./Types.js\";\nimport { combineHashCodes, equalArraysWith, stringHash } from \"./Util.js\";\nimport Decimal from \"./Decimal.js\";\nimport { fromInt as int64FromInt } from \"./Long.js\";\nexport class CaseInfo {\n constructor(declaringType, tag, name, fields) {\n this.declaringType = declaringType;\n this.tag = tag;\n this.name = name;\n this.fields = fields;\n }\n}\nexport class MethodInfo {\n constructor(name, parameters, returnType) {\n this.name = name;\n this.parameters = parameters;\n this.returnType = returnType;\n }\n}\nexport class TypeInfo {\n constructor(fullname, generics, construct, parent, fields, cases, enumCases) {\n this.fullname = fullname;\n this.generics = generics;\n this.construct = construct;\n this.parent = parent;\n this.fields = fields;\n this.cases = cases;\n this.enumCases = enumCases;\n }\n toString() {\n return fullName(this);\n }\n GetHashCode() {\n return getHashCode(this);\n }\n Equals(other) {\n return equals(this, other);\n }\n}\nexport class GenericParameter extends TypeInfo {\n constructor(name) {\n super(name);\n }\n}\nexport function getGenerics(t) {\n return t.generics != null ? t.generics : [];\n}\nexport function getHashCode(t) {\n const fullnameHash = stringHash(t.fullname);\n const genHashes = getGenerics(t).map(getHashCode);\n return combineHashCodes([fullnameHash, ...genHashes]);\n}\nexport function equals(t1, t2) {\n if (t1.fullname === \"\") { // Anonymous records\n return t2.fullname === \"\"\n && equalArraysWith(getRecordElements(t1), getRecordElements(t2), ([k1, v1], [k2, v2]) => k1 === k2 && equals(v1, v2));\n }\n else {\n return t1.fullname === t2.fullname\n && equalArraysWith(getGenerics(t1), getGenerics(t2), equals);\n }\n}\nexport function class_type(fullname, generics, construct, parent) {\n return new TypeInfo(fullname, generics, construct, parent);\n}\nexport function record_type(fullname, generics, construct, fields) {\n return new TypeInfo(fullname, generics, construct, undefined, fields);\n}\nexport function anonRecord_type(...fields) {\n return new TypeInfo(\"\", undefined, undefined, undefined, () => fields);\n}\nexport function union_type(fullname, generics, construct, cases) {\n const t = new TypeInfo(fullname, generics, construct, undefined, undefined, () => {\n const caseNames = construct.prototype.cases();\n return cases().map((fields, i) => new CaseInfo(t, i, caseNames[i], fields));\n });\n return t;\n}\nexport function tuple_type(...generics) {\n return new TypeInfo(\"System.Tuple`\" + generics.length, generics);\n}\nexport function delegate_type(...generics) {\n return new TypeInfo(\"System.Func`\" + generics.length, generics);\n}\nexport function lambda_type(argType, returnType) {\n return new TypeInfo(\"Microsoft.FSharp.Core.FSharpFunc`2\", [argType, returnType]);\n}\nexport function option_type(generic) {\n return new TypeInfo(\"Microsoft.FSharp.Core.FSharpOption`1\", [generic]);\n}\nexport function list_type(generic) {\n return new TypeInfo(\"Microsoft.FSharp.Collections.FSharpList`1\", [generic]);\n}\nexport function array_type(generic) {\n return new TypeInfo(\"[]\", [generic]);\n}\nexport function enum_type(fullname, underlyingType, enumCases) {\n return new TypeInfo(fullname, [underlyingType], undefined, undefined, undefined, undefined, enumCases);\n}\nexport function measure_type(fullname) {\n return new TypeInfo(fullname);\n}\nexport function generic_type(name) {\n return new GenericParameter(name);\n}\nexport const obj_type = new TypeInfo(\"System.Object\");\nexport const unit_type = new TypeInfo(\"Microsoft.FSharp.Core.Unit\");\nexport const char_type = new TypeInfo(\"System.Char\");\nexport const string_type = new TypeInfo(\"System.String\");\nexport const bool_type = new TypeInfo(\"System.Boolean\");\nexport const int8_type = new TypeInfo(\"System.SByte\");\nexport const uint8_type = new TypeInfo(\"System.Byte\");\nexport const int16_type = new TypeInfo(\"System.Int16\");\nexport const uint16_type = new TypeInfo(\"System.UInt16\");\nexport const int32_type = new TypeInfo(\"System.Int32\");\nexport const uint32_type = new TypeInfo(\"System.UInt32\");\nexport const float32_type = new TypeInfo(\"System.Single\");\nexport const float64_type = new TypeInfo(\"System.Double\");\nexport const decimal_type = new TypeInfo(\"System.Decimal\");\nexport function name(info) {\n if (Array.isArray(info)) {\n return info[0];\n }\n else if (info instanceof TypeInfo) {\n const elemType = getElementType(info);\n if (elemType != null) {\n return name(elemType) + \"[]\";\n }\n else {\n const i = info.fullname.lastIndexOf(\".\");\n return i === -1 ? info.fullname : info.fullname.substr(i + 1);\n }\n }\n else {\n return info.name;\n }\n}\nexport function fullName(t) {\n const elemType = getElementType(t);\n if (elemType != null) {\n return fullName(elemType) + \"[]\";\n }\n else if (t.generics == null || t.generics.length === 0) {\n return t.fullname;\n }\n else {\n return t.fullname + \"[\" + t.generics.map((x) => fullName(x)).join(\",\") + \"]\";\n }\n}\nexport function namespace(t) {\n const elemType = getElementType(t);\n if (elemType != null) {\n return namespace(elemType);\n }\n else {\n const i = t.fullname.lastIndexOf(\".\");\n return i === -1 ? \"\" : t.fullname.substr(0, i);\n }\n}\nexport function isArray(t) {\n return getElementType(t) != null;\n}\nexport function getElementType(t) {\n var _a;\n return t.fullname === \"[]\" && ((_a = t.generics) === null || _a === void 0 ? void 0 : _a.length) === 1 ? t.generics[0] : undefined;\n}\nexport function isGenericType(t) {\n return t.generics != null && t.generics.length > 0;\n}\nexport function isGenericParameter(t) {\n return t instanceof GenericParameter;\n}\nexport function isEnum(t) {\n return t.enumCases != null && t.enumCases.length > 0;\n}\nexport function isSubclassOf(t1, t2) {\n return (t2.fullname === obj_type.fullname) || (t1.parent != null && (t1.parent.Equals(t2) || isSubclassOf(t1.parent, t2)));\n}\nfunction isErasedToNumber(t) {\n return isEnum(t) || [\n int8_type.fullname,\n uint8_type.fullname,\n int16_type.fullname,\n uint16_type.fullname,\n int32_type.fullname,\n uint32_type.fullname,\n float32_type.fullname,\n float64_type.fullname,\n ].includes(t.fullname);\n}\nexport function isInstanceOfType(t, o) {\n if (t.fullname === obj_type.fullname)\n return true;\n switch (typeof o) {\n case \"boolean\":\n return t.fullname === bool_type.fullname;\n case \"string\":\n return t.fullname === string_type.fullname;\n case \"function\":\n return isFunction(t);\n case \"number\":\n return isErasedToNumber(t);\n default:\n return t.construct != null && o instanceof t.construct;\n }\n}\n/**\n * This doesn't replace types for fields (records) or cases (unions)\n * but it should be enough for type comparison purposes\n */\nexport function getGenericTypeDefinition(t) {\n return t.generics == null ? t : new TypeInfo(t.fullname, t.generics.map(() => obj_type));\n}\nexport function getEnumUnderlyingType(t) {\n var _a;\n return (_a = t.generics) === null || _a === void 0 ? void 0 : _a[0];\n}\nexport function getEnumValues(t) {\n if (isEnum(t) && t.enumCases != null) {\n return t.enumCases.map((kv) => kv[1]);\n }\n else {\n throw new Error(`${t.fullname} is not an enum type`);\n }\n}\nexport function getEnumNames(t) {\n if (isEnum(t) && t.enumCases != null) {\n return t.enumCases.map((kv) => kv[0]);\n }\n else {\n throw new Error(`${t.fullname} is not an enum type`);\n }\n}\nfunction getEnumCase(t, v) {\n if (t.enumCases != null) {\n if (typeof v === \"string\") {\n for (const kv of t.enumCases) {\n if (kv[0] === v) {\n return kv;\n }\n }\n throw new Error(`'${v}' was not found in ${t.fullname}`);\n }\n else {\n for (const kv of t.enumCases) {\n if (kv[1] === v) {\n return kv;\n }\n }\n // .NET returns the number even if it doesn't match any of the cases\n return [\"\", v];\n }\n }\n else {\n throw new Error(`${t.fullname} is not an enum type`);\n }\n}\nexport function parseEnum(t, str) {\n // TODO: better int parsing here, parseInt ceils floats: \"4.8\" -> 4\n const value = parseInt(str, 10);\n return getEnumCase(t, isNaN(value) ? str : value)[1];\n}\nexport function tryParseEnum(t, str, defValue) {\n try {\n defValue.contents = parseEnum(t, str);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nexport function getEnumName(t, v) {\n return getEnumCase(t, v)[0];\n}\nexport function isEnumDefined(t, v) {\n try {\n const kv = getEnumCase(t, v);\n return kv[0] != null && kv[0] !== \"\";\n }\n catch (_a) {\n // supress error\n }\n return false;\n}\n// FSharpType\nexport function getUnionCases(t) {\n if (t.cases != null) {\n return t.cases();\n }\n else {\n throw new Error(`${t.fullname} is not an F# union type`);\n }\n}\nexport function getRecordElements(t) {\n if (t.fields != null) {\n return t.fields();\n }\n else {\n throw new Error(`${t.fullname} is not an F# record type`);\n }\n}\nexport function getTupleElements(t) {\n if (isTuple(t) && t.generics != null) {\n return t.generics;\n }\n else {\n throw new Error(`${t.fullname} is not a tuple type`);\n }\n}\nexport function getFunctionElements(t) {\n if (isFunction(t) && t.generics != null) {\n const gen = t.generics;\n return [gen[0], gen[1]];\n }\n else {\n throw new Error(`${t.fullname} is not an F# function type`);\n }\n}\nexport function isUnion(t) {\n return t instanceof TypeInfo ? t.cases != null : t instanceof Union;\n}\nexport function isRecord(t) {\n return t instanceof TypeInfo ? t.fields != null : t instanceof Record;\n}\nexport function isTuple(t) {\n return t.fullname.startsWith(\"System.Tuple\");\n}\n// In .NET this is false for delegates\nexport function isFunction(t) {\n return t.fullname === \"Microsoft.FSharp.Core.FSharpFunc`2\";\n}\n// FSharpValue\nexport function getUnionFields(v, t) {\n const cases = getUnionCases(t);\n const case_ = cases[v.tag];\n if (case_ == null) {\n throw new Error(`Cannot find case ${v.name} in union type`);\n }\n return [case_, v.fields];\n}\nexport function getUnionCaseFields(uci) {\n return uci.fields == null ? [] : uci.fields;\n}\n// This is used as replacement of `FSharpValue.GetRecordFields`\n// For `FSharpTypes.GetRecordFields` see `getRecordElements`\n// Object.keys returns keys in the order they were added to the object\nexport function getRecordFields(v) {\n return Object.keys(v).map((k) => v[k]);\n}\nexport function getRecordField(v, field) {\n return v[field[0]];\n}\nexport function getTupleFields(v) {\n return v;\n}\nexport function getTupleField(v, i) {\n return v[i];\n}\nexport function makeUnion(uci, values) {\n const expectedLength = (uci.fields || []).length;\n if (values.length !== expectedLength) {\n throw new Error(`Expected an array of length ${expectedLength} but got ${values.length}`);\n }\n return uci.declaringType.construct != null\n ? new uci.declaringType.construct(uci.tag, ...values)\n : {};\n}\nexport function makeRecord(t, values) {\n const fields = getRecordElements(t);\n if (fields.length !== values.length) {\n throw new Error(`Expected an array of length ${fields.length} but got ${values.length}`);\n }\n return t.construct != null\n ? new t.construct(...values)\n : fields.reduce((obj, [key, _t], i) => {\n obj[key] = values[i];\n return obj;\n }, {});\n}\nexport function makeTuple(values, _t) {\n return values;\n}\nexport function makeGenericType(t, generics) {\n return new TypeInfo(t.fullname, generics, t.construct, t.parent, t.fields, t.cases);\n}\nexport function createInstance(t, consArgs) {\n // TODO: Check if consArgs length is same as t.construct?\n // (Arg types can still be different)\n if (typeof t.construct === \"function\") {\n return new t.construct(...(consArgs !== null && consArgs !== void 0 ? consArgs : []));\n }\n else if (isErasedToNumber(t)) {\n return 0;\n }\n else {\n switch (t.fullname) {\n case obj_type.fullname:\n return {};\n case bool_type.fullname:\n return false;\n case \"System.Int64\":\n case \"System.UInt64\":\n // typeof and typeof get transformed to class_type(\"System.Int64\")\n // and class_type(\"System.UInt64\") respectively. Test for the name of the primitive type.\n return int64FromInt(0);\n case decimal_type.fullname:\n return new Decimal(0);\n case char_type.fullname:\n // Even though char is a value type, it's erased to string, and Unchecked.defaultof is null\n return null;\n default:\n throw new Error(`Cannot access constructor of ${t.fullname}`);\n }\n }\n}\nexport function getValue(propertyInfo, v) {\n return v[propertyInfo[0]];\n}\n// Fable.Core.Reflection\nfunction assertUnion(x) {\n if (!(x instanceof Union)) {\n throw new Error(`Value is not an F# union type`);\n }\n}\nexport function getCaseTag(x) {\n assertUnion(x);\n return x.tag;\n}\nexport function getCaseName(x) {\n assertUnion(x);\n return x.cases()[x.tag];\n}\nexport function getCaseFields(x) {\n assertUnion(x);\n return x.fields;\n}\n","namespace Shared\r\n\r\ntype ARBucket =\r\n { Label: string\r\n From: int option\r\n To: int option }\r\n\r\ntype OverviewSettings =\r\n { CostsLabel: string\r\n ProfitLabel: string\r\n GPPerLabel: string }\r\n static member Default =\r\n { CostsLabel = \"Costs\"\r\n ProfitLabel = \"Profit\"\r\n GPPerLabel = \"GP%\" }\r\n\r\ntype PurchaseOrderSettingsMode = Basic | OrderItemReport\r\ntype PurchaseOrderSettings =\r\n { Requests: bool\r\n Version: PurchaseOrderSettingsMode }\r\n static member Default =\r\n { Requests = false\r\n Version = Basic }\r\n\r\ntype ContractSettings =\r\n { Projections: bool\r\n PurchaseOrderSettings: PurchaseOrderSettings\r\n CostAndBillingForecasting: bool\r\n ARBuckets: ARBucket list\r\n OverviewSettings: OverviewSettings }\r\n static member Default =\r\n { Projections = false\r\n PurchaseOrderSettings = PurchaseOrderSettings.Default\r\n CostAndBillingForecasting = false\r\n ARBuckets =\r\n [ { Label = \"Future\"\r\n From = None\r\n To = Some -1 }\r\n { Label = \"Current\"\r\n From = Some 0\r\n To = Some 30 }\r\n { Label = \"31 - 60\"\r\n From = Some 31\r\n To = Some 60 }\r\n { Label = \"61 - 90\"\r\n From = Some 61\r\n To = Some 90 }\r\n { Label = \"Over 90\"\r\n From = Some 90\r\n To = None } ]\r\n OverviewSettings = OverviewSettings.Default }\r\n\r\ntype HomeSettings =\r\n { AverageLaborRate: bool\r\n BillingAndCostGPPercent: bool\r\n Bucket: ARBucket }\r\n static member Default =\r\n { AverageLaborRate = false\r\n BillingAndCostGPPercent = false\r\n Bucket = HomeSettings.DefaultHomeBucket }\r\n\r\n static member DefaultHomeBucket =\r\n { From = Some 60\r\n To = None\r\n Label = \"AR Over 60 Days\" }\r\n\r\ntype ApplicationSettings =\r\n { ContractSettings: ContractSettings\r\n AverageLaborRate_RemainingHours: bool\r\n HomeSettings: HomeSettings\r\n CompanyTab: bool\r\n BillingRequestEmail: string option }\r\n static member Default =\r\n { ContractSettings = ContractSettings.Default\r\n AverageLaborRate_RemainingHours = false\r\n HomeSettings = HomeSettings.Default\r\n CompanyTab = false\r\n BillingRequestEmail = None }","import { trim } from \"./String.js\";\n// RFC 4122 compliant. From https://stackoverflow.com/a/13653180/3922220\n// const guidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;\n// Relax GUID parsing, see #1637\nconst guidRegex = /^[\\(\\{]{0,2}[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[\\)\\}]{0,2}$/;\nconst guidRegexNoHyphen = /^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/;\nconst guidRegexHex = /^\\{0x[0-9a-f]{8},(0x[0-9a-f]{4},){2}\\{(0x[0-9a-f]{2},){7}0x[0-9a-f]{2}\\}\\}$/;\nconst guidHexCaptures = /^([0-9a-f]{8})-(([0-9a-f]{4})-)(([0-9a-f]{4})-)([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/;\nexport function toString(str, format, _provider) {\n if (format && (format === null || format === void 0 ? void 0 : format.length) > 0) {\n switch (format) {\n case \"N\":\n return str.replace(/-/g, '');\n case \"D\":\n return str;\n case \"B\":\n return \"{\" + str + \"}\";\n case \"P\":\n return \"(\" + str + \")\";\n case \"X\":\n return str.replace(guidHexCaptures, \"{0x$1,0x$3,0x$5,{0x$6,0x$7,0x$8,0x$9,0x$10,0x$11,0x$12,0x$13}}\");\n default:\n throw new Error(\"Unrecognized Guid print format\");\n }\n }\n else {\n return str;\n }\n}\n/** Validates UUID as specified in RFC4122 (versions 1-5). */\nexport function parse(str) {\n function hyphenateGuid(str) {\n return str.replace(guidRegexNoHyphen, \"$1-$2-$3-$4-$5\");\n }\n const wsTrimAndLowered = str.trim().toLowerCase();\n if (guidRegex.test(wsTrimAndLowered)) {\n return trim(wsTrimAndLowered, \"{\", \"}\", \"(\", \")\");\n }\n else if (guidRegexNoHyphen.test(wsTrimAndLowered)) {\n return hyphenateGuid(wsTrimAndLowered);\n }\n else if (guidRegexHex.test(wsTrimAndLowered)) {\n return hyphenateGuid(wsTrimAndLowered.replace(/[\\{\\},]|0x/g, ''));\n }\n else {\n throw new Error(\"Guid should contain 32 digits with 4 dashes: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\");\n }\n}\nexport function tryParse(str, defValue) {\n try {\n defValue.contents = parse(str);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\n// From https://gist.github.com/LeverOne/1308368\nexport function newGuid() {\n let b = \"\";\n for (let a = 0; a++ < 36;) {\n b += a * 51 & 52\n ? (a ^ 15 ? 8 ^ Math.random() * (a ^ 20 ? 16 : 4) : 4).toString(16)\n : \"-\";\n }\n return b;\n}\n// Maps for number <-> hex string conversion\nlet _convertMapsInitialized = false;\nlet _byteToHex;\nlet _hexToByte;\nfunction initConvertMaps() {\n _byteToHex = new Array(256);\n _hexToByte = {};\n for (let i = 0; i < 256; i++) {\n _byteToHex[i] = (i + 0x100).toString(16).substr(1);\n _hexToByte[_byteToHex[i]] = i;\n }\n _convertMapsInitialized = true;\n}\n/** Parse a UUID into it's component bytes */\n// Adapted from https://github.com/zefferus/uuid-parse\nexport function guidToArray(s) {\n if (!_convertMapsInitialized) {\n initConvertMaps();\n }\n let i = 0;\n const buf = new Uint8Array(16);\n s.toLowerCase().replace(/[0-9a-f]{2}/g, ((oct) => {\n switch (i) {\n // .NET saves first three byte groups with different endianness\n // See https://stackoverflow.com/a/16722909/3922220\n case 0:\n case 1:\n case 2:\n case 3:\n buf[3 - i++] = _hexToByte[oct];\n break;\n case 4:\n case 5:\n buf[9 - i++] = _hexToByte[oct];\n break;\n case 6:\n case 7:\n buf[13 - i++] = _hexToByte[oct];\n break;\n case 8:\n case 9:\n case 10:\n case 11:\n case 12:\n case 13:\n case 14:\n case 15:\n buf[i++] = _hexToByte[oct];\n break;\n }\n }));\n // Zero out remaining bytes if string was short\n while (i < 16) {\n buf[i++] = 0;\n }\n return buf;\n}\n/** Convert UUID byte array into a string */\nexport function arrayToGuid(buf) {\n if (buf.length !== 16) {\n throw new Error(\"Byte array for GUID must be exactly 16 bytes long\");\n }\n if (!_convertMapsInitialized) {\n initConvertMaps();\n }\n const guid = _byteToHex[buf[3]] + _byteToHex[buf[2]] +\n _byteToHex[buf[1]] + _byteToHex[buf[0]] + \"-\" +\n _byteToHex[buf[5]] + _byteToHex[buf[4]] + \"-\" +\n _byteToHex[buf[7]] + _byteToHex[buf[6]] + \"-\" +\n _byteToHex[buf[8]] + _byteToHex[buf[9]] + \"-\" +\n _byteToHex[buf[10]] + _byteToHex[buf[11]] +\n _byteToHex[buf[12]] + _byteToHex[buf[13]] +\n _byteToHex[buf[14]] + _byteToHex[buf[15]];\n return guid;\n}\n","module PortalLibs.Shared.Map\r\n\r\nopen FSharpPlus\r\n\r\nlet toKeyList map =\r\n Map.toSeq map\r\n |>> fst\r\n |> Seq.toList\r\n\r\nlet getValues map =\r\n Map.toSeq map |>> snd\r\n\r\nlet toValueList map = getValues map |> Seq.toList\r\n\r\nlet addRange items map =\r\n Seq.fold (fun m (k, v) -> Map.add k v m) map items\r\n \r\nlet addIfDoesntExist key item map =\r\n match Map.tryFind key map with\r\n | None -> Map.add key item map\r\n | Some _ -> map\r\n\r\nlet updateIfExists key update map =\r\n match Map.tryFind key map with\r\n | None -> map\r\n | Some entry -> Map.add key (update entry) map\r\n\r\nlet updateOrAdd key update add map =\r\n match Map.tryFind key map with\r\n | None -> Map.add key add map\r\n | Some item -> Map.add key (update item) map\r\n\r\nlet iterIfExists key iter map =\r\n map |> Map.tryFind key |> Option.iter iter\r\n\r\nlet mergeMap one two =\r\n Map.fold (fun map key value -> Map.add key value map) two one\r\n\r\nlet mergeMapWithUpdateOrAdd update oldMap newMap =\r\n Map.fold (fun map key value -> updateOrAdd key update value map) oldMap newMap\r\n\r\nlet mergeMapWithUpdate2OrAdd update oldMap newMap =\r\n Map.fold (fun map key value -> updateOrAdd key (update value) value map) oldMap newMap\r\n\r\nlet mergeMapWithUpdateIfExists update oldMap newMap =\r\n Map.fold (fun map key value -> updateIfExists key (update value) map) oldMap newMap\r\n\r\nlet mergeMapOpt one twoOpt =\r\n match twoOpt with\r\n | None -> Some one\r\n | Some map -> Some(mergeMap one map)\r\n","namespace FSharpPlus.Control\n\n#nowarn \"77\"\n// Warn FS0077 -> Member constraints with the name 'get_Item' are given special status by the F# compiler as certain .NET types are implicitly augmented with this member. This may result in runtime failures if you attempt to invoke the member constraint from your own code.\n// Those .NET types are string and array but they are explicitely handled here.\n\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\nopen System\nopen System.Runtime.InteropServices\nopen System.Text\nopen System.Collections.Generic\nopen FSharpPlus\nopen FSharpPlus.Internals\nopen FSharpPlus.Internals.MonadOps\n\ntype Item =\n inherit Default1\n \n static member inline Item (x: '``Indexable<'T>`` , k , []_impl: Default1) = (^``Indexable<'T>`` : (member get_Item : _ -> 'T) x, k) : 'T\n static member inline Item (_: 'T when 'T: null and 'T: struct, _, _impl: Default1) = ()\n \n static member Item (x: string , n , []_impl: Item ) = String.item n x\n static member Item (x: StringBuilder , n , []_impl: Item ) = x.ToString().[n]\n static member Item (x: 'T [] , n , []_impl: Item ) = x.[n] : 'T \n #if !FABLE_COMPILER\n static member Item (x: 'T [,] , (i,j) , []_impl: Item ) = x.[i,j] : 'T\n static member Item (x: 'T [,,] , (i,j,k) , []_impl: Item ) = x.[i,j,k] : 'T\n static member Item (x: 'T [,,,] , (i,j,k,l), []_impl: Item ) = x.[i,j,k,l] : 'T\n #endif\n static member Item (x: 'T list , n , []_impl: Item ) = x.[n] : 'T \n static member inline Invoke (n: 'K) (source: '``Indexed<'T>``) : 'T =\n let inline call_2 (a: ^a, b: ^b, n) = ((^a or ^b) : (static member Item: _*_*_ -> _) b, n, a)\n let inline call (a: 'a, b: 'b, n) = call_2 (a, b, n)\n call (Unchecked.defaultof, source, n)\n\n\ntype TryItem =\n inherit Default1\n static member inline TryItem (x: '``Indexable<'T>``, k, []_impl: Default2) =\n let mutable r = Unchecked.defaultof< ^R>\n if (^``Indexable<'T>``: (member TryGetValue: _ * _ -> _) (x, k, &r)) then Some r else None\n \n static member inline TryItem (x: '``Indexable<'T>``, k , []_impl: Default1) = (^``Indexable<'T>`` : (static member TryItem : _ * _ -> _) k, x) : 'T option\n static member inline TryItem (_: 'T when 'T: null and 'T: struct, _ , _impl: Default1) = ()\n\n static member TryItem (x: string , n , []_impl: TryItem ) = String.tryItem n x\n static member TryItem (x: StringBuilder , n , []_impl: TryItem ) = if n >= 0 && n < x.Length then Some ((string x).[n]) else None\n #if !FABLE_COMPILER\n static member TryItem (x: 'a [] , n , []_impl: TryItem ) = if n >= x.GetLowerBound 0 && n <= x.GetUpperBound 0 then Some x.[n] else None : 'a option\n static member TryItem (x: 'a [,] , (i,j) , []_impl: TryItem ) = if (i, j) >= (x.GetLowerBound 0, x.GetLowerBound 1 ) && (i, j) <= (x.GetUpperBound 0, x.GetUpperBound 1 ) then Some x.[i,j] else None : 'a option\n static member TryItem (x: 'a [,,] , (i,j,k) , []_impl: TryItem ) = if (i, j, k) >= (x.GetLowerBound 0, x.GetLowerBound 1, x.GetLowerBound 2) && (i, j, k) <= (x.GetUpperBound 0, x.GetUpperBound 1, x.GetUpperBound 2 ) then Some x.[i,j,k] else None : 'a option\n static member TryItem (x: 'a [,,,] , (i,j,k,l), []_impl: TryItem ) = if (i, j, k, l) >= (x.GetLowerBound 0, x.GetLowerBound 1, x.GetLowerBound 2, x.GetLowerBound 3) && (i, j, k, l) <= (x.GetUpperBound 0, x.GetUpperBound 1, x.GetUpperBound 2, x.GetUpperBound 3) then Some x.[i,j,k,l] else None : 'a option\n #endif\n static member TryItem (x: 'a ResizeArray , n , []_impl: TryItem ) = if n >= 0 && n < x.Count then Some x.[n] else None\n static member TryItem (x: list<'a> , n , []_impl: TryItem ) = List.tryItem n x\n static member TryItem (x: IList<'a> , n , []_impl: Default2) = if n >= 0 && n < x.Count then Some x.[n] else None\n static member TryItem (x: IReadOnlyList<'a> , n , []_impl: Default3) = if n >= 0 && n < x.Count then Some x.[n] else None\n static member TryItem (x: Map<'K,'T> , k , []_impl: TryItem ) = x.TryFind k : 'T option\n []\n static member TryItemLegacy (x: IDictionary<'K,'T>, k , []_impl: Default2) = let mutable r = Unchecked.defaultof< 'T>\n if (x.TryGetValue( k, &r)) then Some r else None : 'T option\n\n static member inline Invoke (n: 'K) (source: '``Indexed<'T>``) : 'T option =\n let inline call_2 (a: ^a, b: ^b, n) = ((^a or ^b) : (static member TryItem : _*_*_ -> _) b, n, a)\n let inline call (a: 'a, b: 'b, n) = call_2 (a, b, n)\n call (Unchecked.defaultof, source, n)\n\n\n\ntype MapIndexed =\n inherit Default1\n // Begin compat members\n static member MapIndexed (x: Id<'T> , f: _->'T->'U , []_impl: MapIndexed) = f () x.getValue\n static member MapIndexed (x: seq<'T> , f , []_impl: MapIndexed) = Seq.mapi f x\n static member MapIndexed (x: list<'T> , f , []_impl: MapIndexed) = List.mapi f x\n static member MapIndexed (x: 'T [] , f , []_impl: MapIndexed) = Array.mapi f x\n static member MapIndexed ((k: 'K, a: 'T), f , []_impl: MapIndexed) = (k, ((f k a) : 'U))\n static member MapIndexed (g , f: 'K->'T->'U, []_impl: MapIndexed) = fun x -> f x (g x)\n static member MapIndexed (x: Map<'K,'T> , f , []_impl: MapIndexed) = Map.map f x : Map<'K,'U>\n // End compat members\n\n static member MapIndexed ((x: list<'T> , f ), []_impl: MapIndexed) = List.mapi f x\n static member MapIndexed ((x: 'T [] , f ), []_impl: MapIndexed) = Array.mapi f x\n static member MapIndexed (((k: 'K, a: 'T), f ), []_impl: MapIndexed) = (k, ((f k a) : 'U))\n static member MapIndexed ((g , f: 'K->'T->'U), []_impl: MapIndexed) = fun x -> f x (g x)\n static member MapIndexed ((x: Map<'K,'T> , f ), []_impl: MapIndexed) = Map.map f x : Map<'K,'U>\n\n static member inline Invoke (mapping: 'K->'T->'U) (source: '``Indexable<'T>``) =\n let inline call_2 (a: ^a, b: ^b, f) = ((^a or ^b) : (static member MapIndexed : (_*_)*_ -> _) (b, f), a)\n let inline call (a: 'a, b: 'b, f) = call_2 (a, b, f)\n call (Unchecked.defaultof, source, mapping)\n static member inline InvokeOnInstance (mapping: 'K->'T->'Key) (source: '``Indexable<'T>``) : '``Indexable<'U>`` = (^``Indexable<'T>`` : (static member MapIndexed : _*_->_) source, mapping) : ^``Indexable<'U>``\n\n static member inline MapIndexed ((x: #seq<'T> , f: int->'T->'U), _impl: Default2) = x |> Seq.mapi f : seq<'U>\n static member inline MapIndexed ((x: ^``I<'T>``, f: 'K->'T->'U) , _impl: Default1) : '``I<'U>`` = MapIndexed.InvokeOnInstance f x\n static member inline MapIndexed ((_: ^t when ^t: null and ^t: struct, _: 'K->'T->'U), _mthd: Default1) = ()\n\ntype ChooseIndexed =\n inherit Default1\n static member ChooseIndexed (x: list<'T> , f, []_impl: ChooseIndexed) = List.choosei f x\n static member ChooseIndexed (x: 'T [] , f, []_impl: ChooseIndexed) = Array.choosei f x\n static member ChooseIndexed ((k: 'K, a: 'T) , f, []_impl: ChooseIndexed) = (k, ((f k a) : 'U))\n static member ChooseIndexed (g , f: 'K->'T->'U option, []_impl: ChooseIndexed) = fun x -> f x (g x)\n static member ChooseIndexed (x: Map<'K,'T> , f, []_impl: ChooseIndexed) = Map.choosei f x : Map<'K,'U>\n\n static member inline Invoke (mapping: 'K->'T->'U option) (source: '``Indexable<'T>``) =\n let inline call_2 (a: ^a, b: ^b, f) = ((^a or ^b) : (static member ChooseIndexed : _*_*_ -> _) b, f, a)\n let inline call (a: 'a, b: 'b, f) = call_2 (a, b, f)\n call (Unchecked.defaultof, source, mapping)\n static member inline InvokeOnInstance (mapping: 'K->'T->'U option) (source: '``Indexable<'T>``) : '``Indexable<'U>`` = (^``Indexable<'T>`` : (static member ChooseIndexed : _*_->_) source, mapping) : ^``Indexable<'U>``\n\n static member inline ChooseIndexed (x: seq<'T> , f: int->'T->'U option, _impl: Default2) = x |> Seq.choosei f : seq<'U>\n static member inline ChooseIndexed (x: ^``I<'T>``, f: 'K->'T->'U option, _impl: Default1) : '``I<'U>`` = ChooseIndexed.InvokeOnInstance f x\n static member inline ChooseIndexed (_: ^t when ^t: null and ^t: struct, _: 'K->'T->'U option, _mthd: Default1) = ()\n\ntype IterateIndexed =\n inherit Default1\n // Begin compat members\n static member IterateIndexed (x: Id<'T> , f: _->'T->unit, []_impl: IterateIndexed) = f () x.getValue\n static member IterateIndexed (x: seq<'T> , f , []_impl: IterateIndexed) = Seq.iteri f x\n static member IterateIndexed (x: list<'T> , f , []_impl: IterateIndexed) = List.iteri f x\n static member IterateIndexed (x: 'T [] , f , []_impl: IterateIndexed) = Array.iteri f x\n static member IterateIndexed (x: Map<'K,'T>, f , []_impl: IterateIndexed) = Map.iter f x\n // End compat members\n\n static member IterateIndexed ((x: list<'T> , f ), []_impl: IterateIndexed) = List.iteri f x\n static member IterateIndexed ((x: 'T [] , f ), []_impl: IterateIndexed) = Array.iteri f x\n static member IterateIndexed ((x: Map<'K,'T>, f ), []_impl: IterateIndexed) = Map.iter f x\n\n static member inline Invoke (action: 'K->'T->unit) (source: '``Indexable<'T>``) =\n let inline call_2 (a: ^a, b: ^b, f) = ((^a or ^b) : (static member IterateIndexed : (_*_)*_ -> _) (b, f), a)\n let inline call (a: 'a, b: 'b, f) = call_2 (a, b, f)\n call (Unchecked.defaultof, source, action) : unit\n static member inline InvokeOnInstance (action: 'K->'T->unit) (source: '``Indexable<'T>``) = (^``Indexable<'T>`` : (static member IterateIndexed : _*_->unit) source, action)\n\n static member inline IterateIndexed ((x: #seq<'T> , f: int->'T->unit ), _impl: Default2) = Seq.iteri f x\n static member inline IterateIndexed ((x: ^``I<'T>``, f: 'K->'T->unit ), _impl: Default1) = IterateIndexed.InvokeOnInstance f x\n static member inline IterateIndexed ((_: ^t when ^t: null and ^t: struct, _: 'K->'T->'U), _mthd: Default1) = ()\n\n\n\ntype FoldIndexed =\n inherit Default1\n // Begin compat members\n static member FoldIndexed (x: seq<_> , f, z, _impl: FoldIndexed) = x |> Seq.fold (fun (p, i) t -> (f p i t, i + 1)) (z, 0) |> fst\n static member FoldIndexed (x: list<_> , f, z, _impl: FoldIndexed) = x |> List.fold (fun (p, i) t -> (f p i t, i + 1)) (z, 0) |> fst\n static member FoldIndexed (x: _ [] , f, z, _impl: FoldIndexed) = x |> Array.fold (fun (p, i) t -> (f p i t, i + 1)) (z, 0) |> fst\n static member FoldIndexed (_: Map<'k,'t>, f, z, _impl: FoldIndexed) = Map.fold f z\n // End compat members\n\n static member FoldIndexed ((x: list<_> , f, z), _impl: FoldIndexed) = x |> List.fold (fun (p, i) t -> (f p i t, i + 1)) (z, 0) |> fst\n static member FoldIndexed ((x: _ [] , f, z), _impl: FoldIndexed) = x |> Array.fold (fun (p, i) t -> (f p i t, i + 1)) (z, 0) |> fst\n static member FoldIndexed ((_: Map<'k,'t>, f, z), _impl: FoldIndexed) = Map.fold f z\n\n static member inline Invoke (folder: 'State->'Key->'T->'State) (state: 'State) (foldable: '``Foldable<'T>``) : 'State =\n let inline call_2 (a: ^a, b: ^b, f, z) = ((^a or ^b) : (static member FoldIndexed : (_*_*_)*_ -> _) (b, f, z), a)\n let inline call (a: 'a, b: 'b, f, z) = call_2 (a, b, f, z)\n call (Unchecked.defaultof, foldable, folder, state)\n static member inline InvokeOnInstance (folder: 'State->'Key->'T->'State) (state: 'State) (source: '``Indexable<'T>``) : 'State = (^``Indexable<'T>`` : (static member FoldIndexed : _*_*_->_) source, folder, state) : 'State\n\n static member inline FoldIndexed ((x: #seq<_> , f: 'State->int->'T->'State , z:'State), _impl: Default2) = x |> Seq.fold (fun (p, i) t -> (f p i t, i + 1)) (z, 0) |> fst\n static member inline FoldIndexed ((x: ^``I<'T>``, f: 'State->'Key->'T->'State , z:'State), _impl: Default1) : 'State = FoldIndexed.InvokeOnInstance f z x\n static member inline FoldIndexed ((_: ^t when ^t: null and ^t: struct, _: 'State->'Key->'T->'State, _:'S), _mthd: Default1) = ()\n\n\ntype TraverseIndexed =\n inherit Default1\n static member inline TraverseIndexed (t: list<_> , f , []_output: 'R, []_impl: TraverseIndexed) : 'R = Traverse.Invoke (fun (i, x) -> f i x) (List.indexed t)\n static member inline TraverseIndexed (t: _ [] , f , []_output: 'R, []_impl: TraverseIndexed) : 'R = Traverse.Invoke (fun (i, x) -> f i x) (Array.indexed t)\n static member inline TraverseIndexed ((k: 'K, a: 'T), f , []_output: 'R, []_impl: TraverseIndexed) : 'R = Map.Invoke ((fun x y -> (x, y)) k) (f k a)\n static member inline TraverseIndexed (a: Tuple<_> , f , []_output: 'R, []_impl: TraverseIndexed) : 'R = Map.Invoke Tuple (f () a.Item1)\n \n static member inline TraverseIndexed (t: Map<_,_> , f , []_output: 'R, []_impl: TraverseIndexed) : 'R =\n let insert_f k x ys = Map.Invoke (Map.add k) (f k x) <*> ys\n Map.foldBack insert_f t (result Map.empty)\n\n static member inline InvokeOnInstance (f: 'Key -> 'T -> '``Functor<'U>``) (t: '``Indexable<'T>``) : '``Functor<'Indexable<'U>>`` = (^``Indexable<'T>`` : (static member TraverseIndexed: _*_->_) t,f) : '``Functor<'Indexable<'U>>`` \n\n static member inline TraverseIndexed (t: seq<'T>, f: int -> 'T -> '``Functor<'U>``, []_output: '``Functor>``, []_impl: Default2) : '``Functor>`` = Traverse.Invoke (fun (i, x) -> f i x) (Seq.indexed t)\n static member inline TraverseIndexed (t: ^``I<'T>``, f: 'Index -> 'T -> '``Functor<'U>``, []_output: '``Functor<'I<'U>>``, []_impl: Default1) : '``Functor<'I<'U>>`` = TraverseIndexed.InvokeOnInstance f t : '``Functor<'I<'U>>``\n static member inline TraverseIndexed (_: ^t when ^t: null and ^t: struct, _: 'Index -> 'T -> '``Functor<'U>``, _: 'R, _mthd: Default1) = id\n\n static member inline Invoke (f: 'Key -> 'T -> '``Functor<'U>``) (t: '``Indexable<'T>``) : '``Functor<'Indexable<'U>>`` =\n let inline call_3 (a: ^a, b: ^b, c: ^c, f) = ((^a or ^b or ^c) : (static member TraverseIndexed : _*_*_*_ -> _) b, f, c, a)\n let inline call (a: 'a, b: 'b, f) = call_3 (a, b, Unchecked.defaultof<'r>, f) : 'r\n call (Unchecked.defaultof, t, f)\n\n\n\ntype FindIndex =\n inherit Default1\n // Begin compat members\n static member FindIndex (x: string , p , []_impl: FindIndex) = String.findIndex p x\n static member FindIndex (x: 'a [] , p , []_impl: FindIndex) = Array.findIndex p x\n static member FindIndex (x: 'a ResizeArray , p: 'a -> bool, []_impl: FindIndex) = Seq.findIndex p x\n static member FindIndex (x: list<'a> , p , []_impl: FindIndex) = List.findIndex p x\n static member FindIndex (x: seq<'a> , p , []_impl: FindIndex) = Seq.findIndex p x\n\n static member FindIndex (x: 'a Id , p: 'a -> bool, []_impl: FindIndex) = List.findIndex p [x.getValue]\n // End compat members\n\n static member FindIndex ((x: string , p ), []_impl: FindIndex) = String.findIndex p x\n static member FindIndex ((x: 'a [] , p ), []_impl: FindIndex) = Array.findIndex p x\n static member FindIndex ((x: 'a ResizeArray , p: 'a -> bool), []_impl: FindIndex) = Seq.findIndex p x\n static member FindIndex ((x: list<'a> , p ), []_impl: FindIndex) = List.findIndex p x\n static member FindIndex ((x: 'a Id , p: 'a -> bool), []_impl: FindIndex) = List.findIndex p [x.getValue]\n\n static member inline InvokeOnInstance (p: 'T -> bool) (source: '``Collection<'T>``) : 'Index = (^``Collection<'T>``: (static member FindIndex: _*_->_) source,p)\n\n static member FindIndex ((x: #seq<'a> , p ), []_impl: Default2) = Seq.findIndex p x\n static member inline FindIndex ((x: '``C``, p: 'T -> bool), _impl: Default1) : 'Index = FindIndex.InvokeOnInstance p x\n static member inline FindIndex ((_: ^t when ^t: null and ^t: struct, _: 'T -> 'bool), _impl: Default1) = ()\n\n static member inline Invoke (p: 'T -> bool) (source: '``Collection<'T>``) : 'Index =\n let inline call_2 (a: ^a, b: ^b, n) = ((^a or ^b) : (static member FindIndex : (_*_)*_ -> _) (b, n), a)\n let inline call (a: 'a, b: 'b, n) = call_2 (a, b, n)\n call (Unchecked.defaultof, source, p)\n\ntype TryFindIndex =\n inherit Default1\n // Begin compat members\n static member TryFindIndex (x: string , p , []_impl: TryFindIndex) = String.tryFindIndex p x\n static member TryFindIndex (x: 'a [] , p , []_impl: TryFindIndex) = Array.tryFindIndex p x\n static member TryFindIndex (x: 'a ResizeArray , p: 'a -> bool, []_impl: TryFindIndex) = Seq.tryFindIndex p x\n static member TryFindIndex (x: list<'a> , p , []_impl: TryFindIndex) = List.tryFindIndex p x\n static member TryFindIndex (x: seq<'a> , p , []_impl: TryFindIndex) = Seq.tryFindIndex p x\n static member TryFindIndex (x: 'a Id , p: 'a -> bool, []_impl: TryFindIndex) = List.tryFindIndex p [x.getValue]\n // End compat members\n\n static member TryFindIndex ((x: string , p ), []_impl: TryFindIndex) = String.tryFindIndex p x\n static member TryFindIndex ((x: 'a [] , p ), []_impl: TryFindIndex) = Array.tryFindIndex p x\n static member TryFindIndex ((x: 'a ResizeArray , p: 'a -> bool), []_impl: TryFindIndex) = Seq.tryFindIndex p x\n static member TryFindIndex ((x: list<'a> , p ), []_impl: TryFindIndex) = List.tryFindIndex p x\n static member TryFindIndex ((x: 'a Id , p: 'a -> bool), []_impl: TryFindIndex) = List.tryFindIndex p [x.getValue]\n\n static member inline InvokeOnInstance (p: 'T -> bool) (source: '``Collection<'T>``) : 'Index option = (^``Collection<'T>``: (static member TryFindIndex: _*_->_) source,p)\n\n static member TryFindIndex ((x: #seq<'a> , p ), []_impl: Default2) = Seq.tryFindIndex p x\n static member inline TryFindIndex ((x: '``C``, p: 'T -> bool), _impl: Default1) : 'Index option = TryFindIndex.InvokeOnInstance p x\n static member inline TryFindIndex ((_: ^t when ^t: null and ^t: struct, _: 'T -> bool), _impl: Default1) = ()\n\n static member inline Invoke (p: 'T -> bool) (source: '``Collection<'T>``) : 'Index option =\n let inline call_2 (a: ^a, b: ^b, n) = ((^a or ^b) : (static member TryFindIndex : (_*_)*_ -> _) (b, n), a)\n let inline call (a: 'a, b: 'b, n) = call_2 (a, b, n)\n call (Unchecked.defaultof, source, p)\n\n\ntype FindSliceIndex =\n inherit Default1\n // Begin compat members\n static member FindSliceIndex (x: string , e , []_impl: FindSliceIndex) = String.findSliceIndex e x\n #if !FABLE_COMPILER || FABLE_COMPILER_3\n static member FindSliceIndex (x: 'a ResizeArray , e: 'a ResizeArray , []_impl: FindSliceIndex) = Seq.findSliceIndex e x\n static member FindSliceIndex (x: 'a [] , e , []_impl: FindSliceIndex) = Array.findSliceIndex e x\n static member FindSliceIndex (x: list<'a> , e , []_impl: FindSliceIndex) = List.findSliceIndex e x\n static member FindSliceIndex (x: seq<'a> , e , []_impl: FindSliceIndex) = Seq.findSliceIndex e x\n static member FindSliceIndex (x: 'a Id , e: 'a Id , []_impl: FindSliceIndex) = List.findSliceIndex [e.getValue] [x.getValue]\n #endif\n // End compat members\n static member FindSliceIndex ((x: string , e ), []_impl: FindSliceIndex) = String.findSliceIndex e x\n static member FindSliceIndex ((x: 'a [] , e ), []_impl: FindSliceIndex) = Array.findSliceIndex e x\n static member FindSliceIndex ((x: 'a ResizeArray , e: 'a ResizeArray ), []_impl: FindSliceIndex) = Seq.findSliceIndex e x\n static member FindSliceIndex ((x: list<'a> , e ), []_impl: FindSliceIndex) = List.findSliceIndex e x\n static member FindSliceIndex ((x: 'a Id , e: 'a Id ), []_impl: FindSliceIndex) = List.findSliceIndex [e.getValue] [x.getValue]\n \n static member inline InvokeOnInstance (slice: '``Collection<'T>``) (source: '``Collection<'T>``) : 'Index =\n (^``Collection<'T>``: (static member FindSliceIndex: _*_->_) source, slice)\n\n static member FindSliceIndex ((x: #seq<'a> , e ), []_impl: Default2) = Seq.findSliceIndex e x\n static member inline FindSliceIndex ((x: '``C<'T>``, e: '``C<'T>``), _impl: Default1) : 'Index = FindSliceIndex.InvokeOnInstance e x\n static member inline FindSliceIndex ((_: ^t when ^t: null and ^t: struct, _), _impl: Default1) = ()\n\n static member inline Invoke (slice: '``Collection<'T>``) (source: '``Collection<'T>``) : 'Index =\n let inline call_2 (a: ^a, b: ^b, n) = ((^a or ^b) : (static member FindSliceIndex : (_*_)*_ -> _) (b, n), a)\n let inline call (a: 'a, b: 'b, n) = call_2 (a, b, n)\n call (Unchecked.defaultof, source, slice)\n\ntype TryFindSliceIndex =\n inherit Default1\n // Begin compat members\n static member TryFindSliceIndex (x: 'a ResizeArray , e: 'a ResizeArray , []_impl: TryFindSliceIndex) = Seq.tryFindSliceIndex e x\n static member TryFindSliceIndex (x: string , e , []_impl: TryFindSliceIndex) = String.tryFindSliceIndex e x\n static member TryFindSliceIndex (x: 'a [] , e , []_impl: TryFindSliceIndex) = Array.tryFindSliceIndex e x\n static member TryFindSliceIndex (x: list<'a> , e , []_impl: TryFindSliceIndex) = List.tryFindSliceIndex e x\n static member TryFindSliceIndex (x: seq<'a> , e , []_impl: TryFindSliceIndex) = Seq.tryFindSliceIndex e x\n static member TryFindSliceIndex (x: 'a Id , e: 'a Id , []_impl: TryFindSliceIndex) = List.tryFindSliceIndex [e.getValue] [x.getValue]\n // End compat members\n\n static member TryFindSliceIndex ((x: string , e ), []_impl: TryFindSliceIndex) = String.tryFindSliceIndex e x\n static member TryFindSliceIndex ((x: 'a [] , e ), []_impl: TryFindSliceIndex) = Array.tryFindSliceIndex e x\n static member TryFindSliceIndex ((x: 'a ResizeArray , e: 'a ResizeArray ), []_impl: TryFindSliceIndex) = Seq.tryFindSliceIndex e x\n static member TryFindSliceIndex ((x: list<'a> , e ), []_impl: TryFindSliceIndex) = List.tryFindSliceIndex e x\n static member TryFindSliceIndex ((x: 'a Id , e: 'a Id ), []_impl: TryFindSliceIndex) = List.tryFindSliceIndex [e.getValue] [x.getValue]\n\n static member inline InvokeOnInstance (slice: '``Collection<'T>``) (source: '``Collection<'T>``) : 'Index option =\n (^``Collection<'T>``: (static member TryFindSliceIndex: _*_->_) source, slice)\n\n static member TryFindSliceIndex ((x: #seq<'a> , e ), []_impl: Default2) = Seq.tryFindSliceIndex e x\n static member inline TryFindSliceIndex ((x: '``C<'T>``, e: '``C<'T>``), _impl: Default1) : 'Index option = TryFindSliceIndex.InvokeOnInstance e x\n static member inline TryFindSliceIndex ((_: ^t when ^t: null and ^t: struct, _), _impl: Default1) = ()\n\n static member inline Invoke (slice: '``Collection<'T>``) (source: '``Collection<'T>``) : 'Index option =\n let inline call_2 (a: ^a, b: ^b, n) = ((^a or ^b) : (static member TryFindSliceIndex : (_*_)*_ -> _) (b, n), a)\n let inline call (a: 'a, b: 'b, n) = call_2 (a, b, n)\n call (Unchecked.defaultof, source, slice)\n\n#endif\n","import {\n useEffect as useEffectReact,\n useLayoutEffect as useLayoutEffectReact,\n useDebugValue as useDebugValueReact } from 'react'\n\nexport const useEffect = getDisposable => {\n useEffectReact(() => {\n const disposable = getDisposable()\n return () => {\n disposable.Dispose();\n }\n })\n}\n\nexport const useEffectWithDeps = (getDisposable, deps) => {\n useEffectReact(() => {\n const disposable = getDisposable()\n return () => {\n disposable.Dispose();\n }\n }, deps)\n}\n\nexport const useLayoutEffect = getDisposable => {\n useLayoutEffectReact(() => {\n const disposable = getDisposable()\n return () => {\n disposable.Dispose();\n }\n })\n}\n\nexport const useLayoutEffectWithDeps = (getDisposable, deps) => {\n useLayoutEffectReact(() => {\n const disposable = getDisposable()\n return () => {\n disposable.Dispose();\n }\n }, deps)\n}\n\nexport const useDebugValue = (value, formatter) => useDebugValueReact(value, formatter)","namespace Feliz\n\nopen System\nopen System.ComponentModel\nopen Fable.Core\nopen Fable.Core.JsInterop\nopen Browser.Types\n\nmodule internal ReactInterop =\n let useDebugValueWithFormatter<'t>(value: 't, formatter: 't -> string) : unit = import \"useDebugValue\" \"./ReactInterop.js\"\n let useEffect (effect: obj) : unit = import \"useEffect\" \"./ReactInterop.js\"\n let useEffectWithDeps (effect: obj) (deps: obj) : unit = import \"useEffectWithDeps\" \"./ReactInterop.js\"\n let useLayoutEffect (effect: obj) : unit = import \"useLayoutEffect\" \"./ReactInterop.js\"\n let useLayoutEffectWithDeps (effect: obj) (deps: obj) : unit = import \"useLayoutEffectWithDeps\" \"./ReactInterop.js\"\n\n[]\n[]\nmodule Helpers =\n let inline optDispose (disposeOption: #IDisposable option) =\n { new IDisposable with member _.Dispose () = disposeOption |> Option.iter (fun d -> d.Dispose()) }\n\ntype internal Internal() =\n static let propsWithKey (withKey: ('props -> string) option) props =\n match withKey with\n | Some f ->\n props?key <- f props\n props\n | None -> props\n static member\n functionComponent\n (\n renderElement: 'props -> ReactElement,\n ?name: string,\n ?withKey: 'props -> string\n )\n : 'props -> Fable.React.ReactElement =\n name |> Option.iter (fun name -> renderElement?displayName <- name)\n #if FABLE_COMPILER_3\n Browser.Dom.console.warn(\"Feliz: using React.functionComponent in Fable 3 is obsolete, please consider using the [] attribute instead which makes Feliz output better Javascript code that is compatible with react-refresh\")\n #endif\n fun props ->\n let props = props |> propsWithKey withKey\n Interop.reactApi.createElement(renderElement, props)\n static member\n memo\n (\n renderElement: 'props -> ReactElement,\n ?name: string,\n ?areEqual: 'props -> 'props -> bool,\n ?withKey: 'props -> string\n )\n : 'props -> Fable.React.ReactElement =\n let memoElementType = Interop.reactApi.memo(renderElement, (defaultArg areEqual (unbox null)))\n name |> Option.iter (fun name -> renderElement?displayName <- name)\n fun props ->\n let props = props |> propsWithKey withKey\n Interop.reactApi.createElement(memoElementType, props)\n\ntype React =\n /// Creates a disposable instance by providing the implementation of the dispose member.\n static member createDisposable(dispose: unit -> unit) =\n { new IDisposable with member _.Dispose() = dispose() }\n\n /// The `React.fragment` component lets you return multiple elements in your `render()` method without creating an additional DOM element.\n static member inline fragment xs = Fable.React.Helpers.fragment [] xs\n\n /// The `React.fragment` component lets you return multiple elements in your `render()` method without creating an additional DOM element.\n static member inline keyedFragment(key: int, xs) = Fable.React.Helpers.fragment [ !!(\"key\", key) ] xs\n /// The `React.fragment` component lets you return multiple elements in your `render()` method without creating an additional DOM element.\n static member inline keyedFragment(key: string, xs) = Fable.React.Helpers.fragment [ !!(\"key\", key) ] xs\n /// The `React.fragment` component lets you return multiple elements in your `render()` method without creating an additional DOM element.\n static member inline keyedFragment(key: System.Guid, xs) = Fable.React.Helpers.fragment [ !!(\"key\", string key) ] xs\n /// Placeholder empty React element to be used when importing external React components with the [] attribute.\n static member inline imported() = Html.none\n /// The `useState` hook that creates a state variable for React function components from an initialization function.\n []\n static member useState<'t>(initializer: unit -> 't) = Interop.reactApi.useState 't,'t>(initializer)\n\n /// Accepts a reducer and returns the current state paired with a dispatch.\n []\n static member useReducer(update, initialState) = Interop.reactApi.useReducer update initialState\n\n /// The `useEffect` hook that creates a disposable effect for React function components.\n /// This effect has no dependencies which means the effect is re-executed on every re-render.\n /// To make the effect run once (for example you subscribe once to web sockets) then provide an empty array\n /// for the dependencies: `React.useEffect(disposableEffect, [| |])`.\n []\n static member useEffect(effect: unit -> #IDisposable) : unit = ReactInterop.useEffect(effect)\n /// The `useEffect` hook that creates a disposable effect for React function components.\n /// This effect has no dependencies which means the effect is re-executed on every re-render.\n /// To make the effect run once (for example you subscribe once to web sockets) then provide an empty array\n /// for the dependencies: `React.useEffect(disposableEffect, [| |])`.\n []\n static member inline useEffect(effect: unit -> #IDisposable option) = React.useEffect(effect >> Helpers.optDispose)\n /// The `useEffect` hook that creates a disposable effect for React function components.\n /// This effect takes an array of *dependencies*.\n /// Whenever any of these dependencies change, the effect is re-executed. To execute the effect only once,\n /// you have to explicitly provide an empty array for the dependencies: `React.useEffect(effect, [| |])`.\n []\n static member useEffect(effect: unit -> #IDisposable, dependencies: obj []) : unit = ReactInterop.useEffectWithDeps effect dependencies\n /// The `useEffect` hook that creates a disposable effect for React function components.\n /// This effect takes an array of *dependencies*.\n /// Whenever any of these dependencies change, the effect is re-executed. To execute the effect only once,\n /// you have to explicitly provide an empty array for the dependencies: `React.useEffect(effect, [| |])`.\n []\n static member inline useEffect(effect: unit -> #IDisposable option, dependencies: obj []) = React.useEffect(effect >> Helpers.optDispose, dependencies)\n\n /// The `useLayoutEffect` hook that creates a disposable effect for React function components.\n /// This effect has no dependencies which means the effect is re-executed on every re-render.\n /// To make the effect run once (for example you subscribe once to web sockets) then provide an empty array\n /// for the dependencies: `React.useLayoutEffect(disposableEffect, [| |])`.\n /// The signature is identical to useEffect, but it fires synchronously after all DOM mutations. Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside useLayoutEffect will be flushed synchronously, before the browser has a chance to paint.\n []\n static member useLayoutEffect(effect: unit -> #IDisposable) : unit = ReactInterop.useLayoutEffect(effect)\n /// The `useLayoutEffect` hook that creates a disposable effect for React function components.\n /// This effect has no dependencies which means the effect is re-executed on every re-render.\n /// To make the effect run once (for example you subscribe once to web sockets) then provide an empty array\n /// for the dependencies: `React.useLayoutEffect(disposableEffect, [| |])`.\n /// The signature is identical to useEffect, but it fires synchronously after all DOM mutations. Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside useLayoutEffect will be flushed synchronously, before the browser has a chance to paint.\n []\n static member inline useLayoutEffect(effect: unit -> #IDisposable option) = React.useLayoutEffect(effect >> Helpers.optDispose)\n /// The `useLayoutEffect` hook that creates a disposable effect for React function components.\n /// This effect takes an array of *dependencies*.\n /// Whenever any of these dependencies change, the effect is re-executed. To execute the effect only once,\n /// you have to explicitly provide an empty array for the dependencies: `React.useLayoutEffect(effect, [| |])`.\n /// The signature is identical to useEffect, but it fires synchronously after all DOM mutations. Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside useLayoutEffect will be flushed synchronously, before the browser has a chance to paint.\n []\n static member useLayoutEffect(effect: unit -> #IDisposable, dependencies: obj []) : unit = ReactInterop.useLayoutEffectWithDeps effect dependencies\n /// The `useLayoutEffect` hook that creates a disposable effect for React function components.\n /// This effect takes an array of *dependencies*.\n /// Whenever any of these dependencies change, the effect is re-executed. To execute the effect only once,\n /// you have to explicitly provide an empty array for the dependencies: `React.useLayoutEffect(effect, [| |])`.\n /// The signature is identical to useEffect, but it fires synchronously after all DOM mutations. Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside useLayoutEffect will be flushed synchronously, before the browser has a chance to paint.\n []\n static member inline useLayoutEffect(effect: unit -> #IDisposable option, dependencies: obj []) =\n React.useLayoutEffect(effect >> Helpers.optDispose, dependencies)\n /// The signature is identical to useEffect, but it fires synchronously after all DOM mutations. Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside useLayoutEffect will be flushed synchronously, before the browser has a chance to paint.\n /// This effect is executed on every (re)render\n []\n static member useLayoutEffect(effect: unit -> unit) =\n ReactInterop.useLayoutEffect\n (fun _ ->\n effect()\n React.createDisposable(ignore))\n\n /// The signature is identical to useEffect, but it fires synchronously after all DOM mutations. Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside useLayoutEffect will be flushed synchronously, before the browser has a chance to paint.\n []\n static member useLayoutEffect(effect: unit -> unit, dependencies: obj []) =\n ReactInterop.useLayoutEffectWithDeps\n (fun _ ->\n effect()\n React.createDisposable(ignore))\n dependencies\n\n []\n static member inline useLayoutEffectOnce(effect: unit -> unit) =\n React.useLayoutEffect(effect, [| |])\n\n []\n static member inline useLayoutEffectOnce(effect: unit -> #IDisposable) =\n React.useLayoutEffect(effect, [| |])\n\n []\n static member inline useLayoutEffectOnce(effect: unit -> #IDisposable option) =\n React.useLayoutEffect(effect, [| |])\n\n /// React hook to define and use an effect only once when a function component renders for the first time.\n /// This is an alias for `React.useEffect(effect, [| |])` which explicitly provides an empty array for the dependencies of the effect which means the effect will only run once.\n []\n static member useEffectOnce(effect: unit -> unit) =\n React.useEffect(effect, [| |])\n\n /// React hook to define and use a disposable effect only once when a function component renders for the first time.\n /// This is an alias for `React.useEffect(effect, [| |])` which explicitly provides an empty array for the dependencies of the effect which means the effect will only run once.\n []\n static member useEffectOnce(effect: unit -> #IDisposable) =\n React.useEffect(effect, [| |])\n /// React hook to define and use a disposable effect only once when a function component renders for the first time.\n /// This is an alias for `React.useEffect(effect, [| |])` which explicitly provide an empty array for the dependencies of the effect which means the effect will only run once.\n []\n static member useEffectOnce(effect: unit -> #IDisposable option) =\n React.useEffect(effect >> Helpers.optDispose, [| |])\n\n /// The `useEffect` hook that creates an effect for React function components.\n /// This effect is executed *every time* the function component re-renders.\n ///\n /// To make the effect run only once, write: `React.useEffect(effect, [| |])` which explicitly states\n /// that this effect has no dependencies and should only run once on initial render.\n []\n static member useEffect(effect: unit -> unit) : unit =\n ReactInterop.useEffect\n (fun _ ->\n effect()\n React.createDisposable(ignore))\n\n /// The `useEffect` hook that creates an effect for React function components. This effect takes an array of *dependencies*.\n /// Whenever any of these dependencies change, the effect is re-executed. To execute the effect only once,\n /// you have to explicitly provide an empty array for the dependencies: `React.useEffect(effect, [| |])`.\n []\n static member useEffect(effect: unit -> unit, dependencies: obj []) : unit =\n ReactInterop.useEffectWithDeps\n (fun _ ->\n effect()\n React.createDisposable(ignore))\n dependencies\n\n /// Can be used to display a label for custom hooks in React DevTools.\n []\n static member useDebugValue(value: string) =\n ReactInterop.useDebugValueWithFormatter(value, id)\n\n /// Can be used to display a label for custom hooks in React DevTools.\n []\n static member useDebugValue(value: 't, formatter: 't -> string) =\n ReactInterop.useDebugValueWithFormatter(value, formatter)\n\n /// \n /// The `useCallback` hook. Returns a memoized callback. Pass an inline callback and an array of dependencies.\n /// `useCallback` will return a memoized version of the callback that only changes if one of the dependencies has changed.\n /// \n /// A callback function to be memoized.\n /// An array of dependencies upon which the callback function depends.\n /// If not provided, defaults to empty array, representing dependencies that never change.\n []\n static member useCallback(callbackFunction: 'a -> 'b, ?dependencies: obj array) =\n Interop.reactApi.useCallback callbackFunction (defaultArg dependencies [||])\n\n /// Returns a mutable ref object whose .current property is initialized to the passed argument (initialValue). The returned object will persist for the full lifetime of the component.\n ///\n /// Essentially, useRef is like a container that can hold a mutable value in its .current property.\n []\n static member useRef(initialValue) = Interop.reactApi.useRef(initialValue)\n\n /// A specialized version of React.useRef() that creates a reference to an input element.\n ///\n /// Useful for controlling the internal properties and methods of that element, for example to enable focus().\n []\n static member useInputRef() : IRefValue = React.useRef(None)\n\n /// A specialized version of React.useRef() that creates a reference to a button element.\n []\n static member useButtonRef() : IRefValue = React.useRef(None)\n\n /// A specialized version of React.useRef() that creates a reference to a generic HTML element.\n ///\n /// Useful for controlling the internal properties and methods of that element, for integration with third-party libraries that require a Html element.\n []\n static member useElementRef() : IRefValue = React.useRef(None)\n\n /// \n /// The `useMemo` hook. Returns a memoized value. Pass a \"create\" function and an array of dependencies.\n /// `useMemo` will only recompute the memoized value when one of the dependencies has changed.\n /// \n /// A create function returning a value to be memoized.\n /// An array of dependencies upon which the create function depends.\n /// If not provided, defaults to empty array, representing dependencies that never change.\n []\n static member useMemo(createFunction: unit -> 'a, ?dependencies: obj array) =\n Interop.reactApi.useMemo createFunction (defaultArg dependencies [||])\n\n //\n // React.functionComponent\n //\n\n /// \n /// Creates a React function component from a function that accepts a \"props\" object and renders a result.\n /// A component key can be provided in the props object, or a custom `withKey` function can be provided.\n /// \n /// A render function that returns an element.\n /// A function to derive a component key from the props.\n static member functionComponent(render: 'props -> ReactElement, ?withKey: 'props -> string) =\n Internal.functionComponent(render, ?withKey=withKey)\n\n /// \n /// Creates a React function component from a function that accepts a \"props\" object and renders a result.\n /// A component key can be provided in the props object, or a custom `withKey` function can be provided.\n /// \n /// The component name to display in the React dev tools.\n /// A render function that returns an element.\n /// A function to derive a component key from the props.\n static member functionComponent(name: string, render: 'props -> ReactElement, ?withKey: 'props -> string) =\n Internal.functionComponent(render, name, ?withKey=withKey)\n\n /// \n /// Creates a React function component from a function that accepts a \"props\" object and renders a result.\n /// A component key can be provided in the props object, or a custom `withKey` function can be provided.\n /// \n /// A render function that returns a list of elements.\n /// A function to derive a component key from the props.\n static member functionComponent(render: 'props -> #seq, ?withKey: 'props -> string) =\n Internal.functionComponent(render >> React.fragment, ?withKey=withKey)\n\n /// \n /// Creates a React function component from a function that accepts a \"props\" object and renders a result.\n /// A component key can be provided in the props object, or a custom `withKey` function can be provided.\n /// \n /// A render function that returns a list of elements.\n /// The component name to display in the React dev tools.\n /// A function to derive a component key from the props.\n static member functionComponent(name: string, render: 'props -> #seq, ?withKey: 'props -> string) =\n Internal.functionComponent(render >> React.fragment, name, ?withKey=withKey)\n\n //\n // React.memo\n //\n\n /// \n /// `React.memo` memoizes the result of a function component. Given the same props, React will skip rendering the component, and reuse the last rendered result.\n /// By default it will only shallowly compare complex objects in the props object. For more control, a custom `areEqual` function can be provided.\n /// A component key can be provided in the props object, or a custom `withKey` function can be provided.\n /// \n /// A render function or a React.functionComponent.\n /// A custom comparison function to use instead of React's default shallow compare.\n /// A function to derive a component key from the props.\n static member memo(render: 'props -> ReactElement, ?withKey: 'props -> string, ?areEqual: 'props -> 'props -> bool) =\n Internal.memo(render, ?areEqual=areEqual, ?withKey=withKey)\n\n /// \n /// `React.memo` memoizes the result of a function component. Given the same props, React will skip rendering the component, and reuse the last rendered result.\n /// By default it will only shallowly compare complex objects in the props object. For more control, a custom `areEqual` function can be provided.\n /// A component key can be provided in the props object, or a custom `withKey` function can be provided.\n /// \n /// The component name to display in the React dev tools.\n /// A render function or a React.functionComponent.\n /// A custom comparison function to use instead of React's default shallow compare.\n /// A function to derive a component key from the props.\n static member memo(name: string, render: 'props -> ReactElement, ?withKey: 'props -> string, ?areEqual: 'props -> 'props -> bool) =\n Internal.memo(render, name, ?areEqual=areEqual, ?withKey=withKey)\n\n /// \n /// `React.memo` memoizes the result of a function component. Given the same props, React will skip rendering the component, and reuse the last rendered result.\n /// By default it will only shallowly compare complex objects in the props object. For more control, a custom `areEqual` function can be provided.\n /// A component key can be provided in the props object, or a custom `withKey` function can be provided.\n /// \n /// A render function that returns a list of elements.\n /// A function to derive a component key from the props.\n /// A custom comparison function to use instead of React's default shallow compare.\n static member memo(render: 'props -> #seq, ?withKey: 'props -> string, ?areEqual: 'props -> 'props -> bool) =\n Internal.memo(render >> React.fragment, ?areEqual=areEqual, ?withKey=withKey)\n\n /// \n /// `React.memo` memoizes the result of a function component. Given the same props, React will skip rendering the component, and reuse the last rendered result.\n /// By default it will only shallowly compare complex objects in the props object. For more control, a custom `areEqual` function can be provided.\n /// A component key can be provided in the props object, or a custom `withKey` function can be provided.\n /// \n /// The component name to display in the React dev tools.\n /// A render function that returns a list of elements.\n /// A function to derive a component key from the props.\n /// A custom comparison function to use instead of React's default shallow compare.\n static member memo(name: string, render: 'props -> #seq, ?withKey: 'props -> string, ?areEqual: 'props -> 'props -> bool) =\n Internal.memo(render >> React.fragment, name, ?areEqual=areEqual, ?withKey=withKey)\n\n //\n // React.useContext\n //\n\n /// \n /// Creates a Context object. When React renders a component that subscribes to this Context object\n /// it will read the current context value from the closest matching Provider above it in the tree.\n /// \n /// The component name to display in the React dev tools.\n /// A default value that is only used when a component does not have a matching Provider above it in the tree.\n static member createContext<'a>(?name: string, ?defaultValue: 'a) =\n let contextObject = Interop.reactApi.createContext (defaultArg defaultValue Fable.Core.JS.undefined<'a>)\n name |> Option.iter (fun name -> contextObject?displayName <- name)\n contextObject\n\n /// \n /// A Provider component that allows consuming components to subscribe to context changes.\n /// \n /// A context object returned from a previous React.createContext call.\n /// The context value to be provided to descendant components.\n /// A child element.\n static member contextProvider(contextObject: Fable.React.IContext<'a>, contextValue: 'a, child: ReactElement) : ReactElement =\n Interop.reactApi.createElement(contextObject?Provider, createObj [\"value\" ==> contextValue], [child])\n /// \n /// A Provider component that allows consuming components to subscribe to context changes.\n /// \n /// A context object returned from a previous React.createContext call.\n /// The context value to be provided to descendant components.\n /// A sequence of child elements.\n static member contextProvider(contextObject: Fable.React.IContext<'a>, contextValue: 'a, children: #seq) : ReactElement =\n Interop.reactApi.createElement(contextObject?Provider, createObj [\"value\" ==> contextValue], children)\n\n /// \n /// A Consumer component that subscribes to context changes.\n /// \n /// A context object returned from a previous React.createContext call.\n /// A render function that returns an element.\n static member contextConsumer(contextObject: Fable.React.IContext<'a>, render: 'a -> ReactElement) : ReactElement =\n Interop.reactApi.createElement(contextObject?Consumer, null, [!!render])\n /// \n /// A Consumer component that subscribes to context changes.\n /// \n /// A context object returned from a previous React.createContext call.\n /// A render function that returns a sequence of elements.\n static member contextConsumer(contextObject: Fable.React.IContext<'a>, render: 'a -> #seq) : ReactElement =\n Interop.reactApi.createElement(contextObject?Consumer, null, [!!(render >> React.fragment)])\n\n /// \n /// The `useContext` hook. Accepts a context object (the value returned from React.createContext) and returns the current context value for that context.\n /// The current context value is determined by the value prop of the nearest Provider component above the calling component in the tree.\n /// \n /// A context object returned from a previous React.createContext call.\n []\n static member useContext(contextObject: Fable.React.IContext<'a>) = Interop.reactApi.useContext contextObject\n\n /// \n /// Creates a callback that keeps the same reference during the entire lifecycle of the component while having access to\n /// the current value of the dependencies on every call.\n ///\n /// This hook should only be used for (like a dispatch) functions that are not used to provide information during render.\n ///\n /// This is not a complete replacement for the `useCallback` hook. It returns a callback that does not need explicit\n /// dependency declarations and never causes a re-render.\n /// \n /// The function call.\n []\n static member useCallbackRef(callback: ('a -> 'b)) =\n let lastRenderCallbackRef = React.useRef(callback)\n\n let callbackRef =\n React.useCallback((fun (arg: 'a) ->\n lastRenderCallbackRef.current(arg)\n ), [||])\n\n React.useLayoutEffect(fun () ->\n // render is commited - it's safe to update the callback\n lastRenderCallbackRef.current <- callback\n )\n\n callbackRef\n\n /// \n /// Just like React.useState except that the updater function uses the previous state of the state variable as input and allows you to compute the next value using it.\n /// This is useful in cases where defining helpers functions inside the definition of a React function component would actually cache the initial value (because they become closures) during first render as opposed to using the current value after multiple render cycles.\n ///\n /// Use this instead of React.useState when your state variable is a list, an array, a dictionary, a map or other complex structures.\n /// \n static member useStateWithUpdater (initial: 't) : ('t * (('t -> 't) -> unit)) = import \"useState\" \"react\"\n\n /// \n /// Forwards a given ref, allowing you to pass it further down to a child.\n /// \n /// A render function that returns an element.\n static member forwardRef(render: ('props * IRefValue<'t> -> ReactElement)) : ('props * IRefValue<'t> -> ReactElement) =\n let forwardRefType = Interop.reactApi.forwardRef(Func<'props,IRefValue<'t>,ReactElement> (fun props ref -> render(props,ref)))\n fun (props, ref) ->\n let propsObj = props |> JsInterop.toPlainJsObj\n propsObj?ref <- ref\n Interop.reactApi.createElement(forwardRefType, propsObj)\n\n /// \n /// Forwards a given ref, allowing you to pass it further down to a child.\n /// \n /// The component name to display in the React dev tools.\n /// A render function that returns an element.\n static member forwardRef(name: string, render: ('props * IRefValue<'t> -> ReactElement)) : ('props * IRefValue<'t> -> ReactElement) =\n let forwardRefType = Interop.reactApi.forwardRef(Func<'props,IRefValue<'t>,ReactElement> (fun props ref -> render(props,ref)))\n render?displayName <- name\n fun (props, ref) ->\n let propsObj = props |> JsInterop.toPlainJsObj\n propsObj?ref <- ref\n Interop.reactApi.createElement(forwardRefType, propsObj)\n\n /// \n /// Highlights potential problems in an application by enabling additional checks\n /// and warnings for descendants. As well as double rendering function components.\n ///\n /// This *does not do anything* in production mode. You do not need to hide it\n /// with compiler directives.\n /// \n /// The elements that will be rendered with additional\n /// checks and warnings.\n static member strictMode(children: ReactElement list) =\n Interop.reactApi.createElement(Interop.reactApi.StrictMode, None, children)\n\n /// \n /// Lets you define a component that is loaded dynamically. Which helps with code splitting.\n /// \n /// \n /// The dynamicImport of the component.\n ///\n /// Such as `let asyncComponent : JS.Promise[unit -> ReactElement] = JsInterop.importDynamic \"./CodeSplitting.fs\"`.\n ///\n /// Where you would then pass in `asyncComponent`.\n /// \n /// The props to be passed to the component.\n static member lazy'<'t,'props>(dynamicImport: JS.Promise<'t>, props: 'props) =\n Interop.reactApi.createElement(Interop.reactApi.lazy'(fun () -> dynamicImport),props)\n /// \n /// Lets you define a component that is loaded dynamically. Which helps with code\n /// splitting.\n /// \n /// \n /// The dynamicImport of the component.\n ///\n /// Such as `let asyncComponent : JS.Promise[unit -> ReactElement] = JsInterop.importDynamic \"./CodeSplitting.fs\"`.\n ///\n /// Where you would then pass in `fun () -> asyncComponent`.\n /// \n /// The props to be passed to the component.\n static member lazy'<'t,'props>(dynamicImport: unit -> JS.Promise<'t>, props: 'props) =\n Interop.reactApi.createElement(Interop.reactApi.lazy'(dynamicImport),props)\n\n /// \n /// Lets you specify a loading indicator whenever a child element is not yet ready\n /// to render.\n ///\n /// Currently this is only usable with `React.lazy'`.\n /// \n /// The elements that will be rendered within the suspense block.\n static member suspense(children: ReactElement list) =\n Interop.reactApi.createElement(Interop.reactApi.Suspense, {| fallback = Html.none |} |> JsInterop.toPlainJsObj, children)\n /// \n /// Lets you specify a loading indicator whenever a child element is not yet ready\n /// to render.\n ///\n /// Currently this is only usable with `React.lazy'`.\n /// \n /// The elements that will be rendered within the suspense block.\n /// The element that will be rendered while the children are loading.\n static member suspense(children: ReactElement list, fallback: ReactElement) =\n Interop.reactApi.createElement(Interop.reactApi.Suspense, {| fallback = fallback |} |> JsInterop.toPlainJsObj, children)\n\n /// \n /// Allows you to override the behavior of a given ref.\n ///\n /// \n /// The ref you want to override.\n /// A function that returns a new ref with changed behavior.\n []\n static member useImperativeHandle(ref: IRefValue<'t>, createHandle: unit -> 't) =\n Interop.reactApi.useImperativeHandleNoDeps ref createHandle\n\n /// \n /// Lets you specify a loading indicator whenever a child element is not yet ready\n /// to render.\n ///\n /// Currently this is only usable with `React.lazy'`.\n /// \n /// The ref you want to override.\n /// A function that returns a new ref with changed behavior.\n /// An array of dependencies upon which the imperative handle function depends.\n []\n static member useImperativeHandle(ref: IRefValue<'t>, createHandle: unit -> 't, dependencies: obj []) =\n Interop.reactApi.useImperativeHandle ref createHandle dependencies\n\n /// \n /// Creates a CancellationToken that is cancelled when a component is unmounted.\n /// \n []\n static member inline useCancellationToken () =\n let cts = React.useRef(new System.Threading.CancellationTokenSource())\n let token = React.useRef(cts.current.Token)\n\n React.useEffectOnce(fun () ->\n React.createDisposable(fun () ->\n cts.current.Cancel()\n cts.current.Dispose()\n )\n )\n\n token\n\n[]\nmodule ReactOverloadMagic =\n type React with\n /// Creates a disposable instance by merging multiple IDisposables.\n static member inline createDisposable([] disposables: #IDisposable []) =\n React.createDisposable(fun () ->\n disposables\n |> Array.iter (fun d -> d.Dispose())\n )\n /// Creates a disposable instance by merging multiple IDisposable options.\n static member inline createDisposable([] disposables: #IDisposable option []) =\n React.createDisposable(fun () ->\n disposables\n |> Array.iter (Option.iter (fun d -> d.Dispose()))\n )\n /// Creates a disposable instance by merging multiple IDisposable refs.\n static member inline createDisposable([] disposables: IRefValue<#IDisposable> []) =\n React.createDisposable(fun () ->\n disposables\n |> Array.iter (fun d -> d.current.Dispose())\n )\n\n /// Creates a disposable instance by merging multiple IDisposable refs.\n static member inline createDisposable([] disposables: IRefValue<#IDisposable option> []) =\n React.createDisposable(fun () ->\n disposables\n |> Array.iter (fun d -> d.current |> Option.iter (fun d -> d.Dispose()))\n )\n\n /// The `useState` hook that creates a state variable for React function components.\n []\n static member useState<'t>(initial: 't) = Interop.reactApi.useState<'t,'t>(initial)\n\n\n []\n static member useStateWithUpdater<'t>(initializer: unit -> 't): ('t * (('t -> 't) -> unit)) = import \"useState\" \"react\"\n","// tslint:disable:max-line-length\nimport { fromNumber as Long_fromNumber, op_Division as Long_op_Division, op_Multiply as Long_op_Multiply, toNumber as Long_toNumber } from \"./Long.js\";\nimport { comparePrimitives, padLeftAndRightWithZeros, padWithZeros } from \"./Util.js\";\n// TimeSpan in runtime just becomes a number representing milliseconds\n/**\n * Calls:\n * - `Math.ceil` if the `value` is **negative**\n * - `Math.floor` if the `value` is **positive**\n * @param value Value to round\n */\nfunction signedRound(value) {\n return value < 0 ? Math.ceil(value) : Math.floor(value);\n}\nexport function create(d = 0, h = 0, m = 0, s = 0, ms = 0) {\n switch (arguments.length) {\n case 1:\n // ticks\n return fromTicks(arguments[0]);\n case 3:\n // h,m,s\n d = 0, h = arguments[0], m = arguments[1], s = arguments[2], ms = 0;\n break;\n default:\n // d,h,m,s,ms\n break;\n }\n return d * 86400000 + h * 3600000 + m * 60000 + s * 1000 + ms;\n}\nexport function fromTicks(ticks) {\n return Long_toNumber(Long_op_Division(ticks, 10000));\n}\nexport function fromDays(d) {\n return create(d, 0, 0, 0);\n}\nexport function fromHours(h) {\n return create(h, 0, 0);\n}\nexport function fromMinutes(m) {\n return create(0, m, 0);\n}\nexport function fromSeconds(s) {\n return create(0, 0, s);\n}\nexport function days(ts) {\n return signedRound(ts / 86400000);\n}\nexport function hours(ts) {\n return signedRound(ts % 86400000 / 3600000);\n}\nexport function minutes(ts) {\n return signedRound(ts % 3600000 / 60000);\n}\nexport function seconds(ts) {\n return signedRound(ts % 60000 / 1000);\n}\nexport function milliseconds(ts) {\n return signedRound(ts % 1000);\n}\nexport function ticks(ts) {\n return Long_op_Multiply(Long_fromNumber(ts), 10000);\n}\nexport function totalDays(ts) {\n return ts / 86400000;\n}\nexport function totalHours(ts) {\n return ts / 3600000;\n}\nexport function totalMinutes(ts) {\n return ts / 60000;\n}\nexport function totalSeconds(ts) {\n return ts / 1000;\n}\nexport function negate(ts) {\n return ts * -1;\n}\nexport function add(ts1, ts2) {\n return ts1 + ts2;\n}\nexport function subtract(ts1, ts2) {\n return ts1 - ts2;\n}\nexport function multiply(ts, factor) {\n return ts * factor;\n}\nexport function divide(ts, b) {\n return ts / b;\n}\nexport const op_Addition = add;\nexport const op_Subtraction = subtract;\nexport const op_Multiply = multiply;\nexport const op_Division = divide;\nexport const compare = comparePrimitives;\nexport const compareTo = comparePrimitives;\nexport function duration(x) {\n return Math.abs(x);\n}\nexport function toString(ts, format = \"c\", _provider) {\n if ([\"c\", \"g\", \"G\"].indexOf(format) === -1) {\n throw new Error(\"Custom formats are not supported\");\n }\n const d = Math.abs(days(ts));\n const h = Math.abs(hours(ts));\n const m = Math.abs(minutes(ts));\n const s = Math.abs(seconds(ts));\n const ms = Math.abs(milliseconds(ts));\n const sign = ts < 0 ? \"-\" : \"\";\n return `${sign}${d === 0 && (format === \"c\" || format === \"g\") ? \"\" : format === \"c\" ? d + \".\" : d + \":\"}${format === \"g\" ? h : padWithZeros(h, 2)}:${padWithZeros(m, 2)}:${padWithZeros(s, 2)}${ms === 0 && (format === \"c\" || format === \"g\") ? \"\" : format === \"g\" ? \".\" + padWithZeros(ms, 3) : \".\" + padLeftAndRightWithZeros(ms, 3, 7)}`;\n}\nexport function parse(str) {\n const firstDot = str.search(\"\\\\.\");\n const firstColon = str.search(\"\\\\:\");\n if (firstDot === -1 && firstColon === -1) { // There is only a day ex: 4\n const d = parseInt(str, 0);\n if (isNaN(d)) {\n throw new Error(`String '${str}' was not recognized as a valid TimeSpan.`);\n }\n else {\n return create(d, 0, 0, 0, 0);\n }\n }\n if (firstColon > 0) { // process time part\n // WIP: (-?)(((\\d+)\\.)?([0-9]|0[0-9]|1[0-9]|2[0-3]):(\\d+)(:\\d+(\\.\\d{1,7})?)?|\\d+(?:(?!\\.)))\n const r = /^(-?)((\\d+)\\.)?(?:0*)([0-9]|0[0-9]|1[0-9]|2[0-3]):(?:0*)([0-5][0-9]|[0-9])(:(?:0*)([0-5][0-9]|[0-9]))?\\.?(\\d+)?$/.exec(str);\n if (r != null && r[4] != null && r[5] != null) {\n let d = 0;\n let ms = 0;\n let s = 0;\n const sign = r[1] != null && r[1] === \"-\" ? -1 : 1;\n const h = +r[4];\n const m = +r[5];\n if (r[3] != null) {\n d = +r[3];\n }\n if (r[7] != null) {\n s = +r[7];\n }\n if (r[8] != null) {\n // Depending on the number of decimals passed, we need to adapt the numbers\n switch (r[8].length) {\n case 1:\n ms = +r[8] * 100;\n break;\n case 2:\n ms = +r[8] * 10;\n break;\n case 3:\n ms = +r[8];\n break;\n case 4:\n ms = +r[8] / 10;\n break;\n case 5:\n ms = +r[8] / 100;\n break;\n case 6:\n ms = +r[8] / 1000;\n break;\n case 7:\n ms = +r[8] / 10000;\n break;\n default:\n throw new Error(`String '${str}' was not recognized as a valid TimeSpan.`);\n }\n }\n return sign * create(d, h, m, s, ms);\n }\n }\n throw new Error(`String '${str}' was not recognized as a valid TimeSpan.`);\n}\nexport function tryParse(v, defValue) {\n try {\n defValue.contents = parse(v);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\n","namespace Feliz.UseElmish\r\n\r\nopen Feliz\r\nopen Elmish\r\n\r\n[]\r\nmodule UseElmishExtensions =\r\n type private ElmishObservable<'Model, 'Msg>() =\r\n let mutable hasDisposedOnce = false\r\n let mutable state: 'Model option = None\r\n let mutable listener: ('Model -> unit) option = None\r\n let mutable dispatcher: ('Msg -> unit) option = None\r\n\r\n member _.Value = state\r\n member _.HasDisposedOnce = hasDisposedOnce\r\n\r\n member _.SetState (model: 'Model) (dispatch: 'Msg -> unit) =\r\n state <- Some model\r\n dispatcher <- Some dispatch\r\n match listener with\r\n | None -> ()\r\n | Some listener -> listener model\r\n\r\n member _.Dispatch(msg) =\r\n match dispatcher with\r\n | None -> () // Error?\r\n | Some dispatch -> dispatch msg\r\n\r\n member _.Subscribe(f) =\r\n match listener with\r\n | Some _ -> ()\r\n | None -> listener <- Some f\r\n\r\n /// Disposes state (and dispatcher) but keeps subscription\r\n member _.DisposeState() =\r\n match state with\r\n | Some state ->\r\n match box state with\r\n | :? System.IDisposable as disp -> disp.Dispose()\r\n | _ -> ()\r\n | _ -> ()\r\n dispatcher <- None\r\n state <- None\r\n hasDisposedOnce <- true\r\n\r\n let private runProgram (program: unit -> Program<'Arg, 'Model, 'Msg, unit>) (arg: 'Arg) (obs: ElmishObservable<'Model, 'Msg>) () =\r\n program()\r\n |> Program.withSetState obs.SetState\r\n |> Program.runWith arg\r\n\r\n match obs.Value with\r\n | None -> failwith \"Elmish program has not initialized\"\r\n | Some v -> v \r\n\r\n let disposeState (state: obj) =\r\n match box state with\r\n | :? System.IDisposable as disp -> disp.Dispose()\r\n | _ -> ()\r\n\r\n type React with\r\n []\r\n static member useElmish(program: unit -> Program<'Arg, 'Model, 'Msg, unit>, arg: 'Arg, ?dependencies: obj array) =\r\n // Don't use useMemo here because React doesn't guarantee it won't recreate it again\r\n let obs, _ = React.useState(fun () -> ElmishObservable<'Model, 'Msg>())\r\n\r\n let state, setState = React.useState(runProgram program arg obs)\r\n\r\n React.useEffect((fun () ->\r\n if obs.HasDisposedOnce then\r\n runProgram program arg obs () |> setState\r\n React.createDisposable(obs.DisposeState)\r\n ), defaultArg dependencies [||])\r\n\r\n obs.Subscribe(setState)\r\n state, obs.Dispatch\r\n\r\n []\r\n static member useElmish(program: unit -> Program, ?dependencies: obj array) =\r\n React.useElmish(program, (), ?dependencies=dependencies)\r\n\r\n []\r\n static member useElmish(init: 'Arg -> 'Model * Cmd<'Msg>, update: 'Msg -> 'Model -> 'Model * Cmd<'Msg>, arg: 'Arg, ?dependencies: obj array) =\r\n React.useElmish((fun () -> Program.mkProgram init update (fun _ _ -> ())), arg, ?dependencies=dependencies)\r\n\r\n []\r\n static member useElmish(init: unit -> 'Model * Cmd<'Msg>, update: 'Msg -> 'Model -> 'Model * Cmd<'Msg>, ?dependencies: obj array) =\r\n React.useElmish((fun () -> Program.mkProgram init update (fun _ _ -> ())), ?dependencies=dependencies)\r\n\r\n []\r\n static member useElmish(init: 'Model * Cmd<'Msg>, update: 'Msg -> 'Model -> 'Model * Cmd<'Msg>, ?dependencies: obj array) =\r\n React.useElmish((fun () -> Program.mkProgram (fun () -> init) update (fun _ _ -> ())), ?dependencies=dependencies)\r\n","module PortalLibs.Client.Components.DebouncedView\r\n\r\n\r\nopen Elmish\r\nopen Thoth.Elmish\r\nopen System\r\nopen Feliz\r\n\r\ntype Model<'T> =\r\n { BoundValue: 'T option\r\n Value: 'T option\r\n Debouncer: Debouncer.State }\r\n\r\ntype Msg<'T> =\r\n | Input of 'T option\r\n | InputChanged of 'T option\r\n | DebouncerSelfMsg of Debouncer.SelfMessage>\r\n\r\nlet init initVal : Model<'T> * Cmd> =\r\n { Value = initVal\r\n BoundValue = initVal\r\n Debouncer = Debouncer.create () },\r\n Cmd.none\r\n\r\nlet update interceptOpt valueChanged msg model =\r\n match msg with\r\n | DebouncerSelfMsg debouncerMsg ->\r\n let debouncerModel, debouncerCmd =\r\n Debouncer.update debouncerMsg model.Debouncer\r\n\r\n { model with\r\n Debouncer = debouncerModel },\r\n debouncerCmd\r\n | Input inputOpt ->\r\n let debouncerModel, debouncerCmd =\r\n if Option.isSome inputOpt then\r\n model.Debouncer\r\n |> Debouncer.bounce (TimeSpan.FromSeconds 1.0) \"user_input\" (InputChanged inputOpt)\r\n else\r\n Debouncer.create (), Cmd.none\r\n\r\n { model with\r\n BoundValue = inputOpt\r\n Debouncer = debouncerModel },\r\n Cmd.batch [\r\n yield Cmd.map DebouncerSelfMsg debouncerCmd\r\n if Option.isNone inputOpt then\r\n yield Cmd.ofMsg (InputChanged inputOpt)\r\n ]\r\n | InputChanged inputOpt ->\r\n let interceptedValue =\r\n match inputOpt, interceptOpt with\r\n | Some input, Some intercept ->\r\n intercept\r\n {| LastValue = model.Value\r\n Value = input |}\r\n | _, _ -> inputOpt\r\n\r\n valueChanged interceptedValue\r\n { model with\r\n Value = interceptedValue\r\n BoundValue = interceptedValue },\r\n Cmd.none\r\n\r\n\r\nopen Feliz.UseElmish\r\n\r\n[]\r\nlet DebouncedView<'T>\r\n (props: {| Key: string\r\n Value: 'T option\r\n Intercept: ({| LastValue: 'T option; Value: 'T |} -> 'T option) option\r\n View: 'T option -> ('T option -> unit) -> ReactElement\r\n ValueChanged: 'T option -> unit |})\r\n =\r\n let model, dispatch =\r\n React.useElmish (init props.Value, update props.Intercept props.ValueChanged, [| box props.Value |])\r\n\r\n props.View model.BoundValue (Feliz.React.useCallback ((Input >> dispatch), [||]))\r\n","namespace Fable.React\r\n\r\nopen Fable.Core\r\nopen Fable.Core.JsInterop\r\nopen Browser\r\nopen Props\r\n\r\n#if !FABLE_COMPILER\r\ntype HTMLNode =\r\n | Text of string\r\n | RawText of string\r\n | Node of string * IProp seq * ReactElement seq\r\n | List of ReactElement seq\r\n | Empty\r\nwith interface ReactElement\r\n\r\ntype ServerElementType =\r\n | Tag\r\n | Fragment\r\n | Component\r\n\r\ntype ReactElementTypeWrapper<'P> =\r\n | Comp of obj\r\n | Fn of ('P -> ReactElement)\r\n | HtmlTag of string\r\n interface ReactElementType<'P>\r\n\r\n[]\r\nmodule ServerRendering =\r\n let [] private ChildrenName = \"children\"\r\n\r\n let private createServerElementPrivate(tag: obj, props: obj, children: ReactElement seq, elementType: ServerElementType) =\r\n match elementType with\r\n | ServerElementType.Tag ->\r\n HTMLNode.Node (string tag, props :?> IProp seq, children) :> ReactElement\r\n | ServerElementType.Fragment ->\r\n HTMLNode.List children :> ReactElement\r\n | ServerElementType.Component ->\r\n let tag = tag :?> System.Type\r\n let comp = System.Activator.CreateInstance(tag, props)\r\n let childrenProp = tag.GetProperty(ChildrenName)\r\n childrenProp.SetValue(comp, children |> Seq.toArray)\r\n let render = tag.GetMethod(\"render\")\r\n render.Invoke(comp, null) :?> ReactElement\r\n\r\n let private createServerElementByFnPrivate(f, props, children) =\r\n let propsType = props.GetType()\r\n let props =\r\n if propsType.GetProperty (ChildrenName) |> isNull then\r\n props\r\n else\r\n let values = ResizeArray ()\r\n let properties = propsType.GetProperties()\r\n for p in properties do\r\n if p.Name = ChildrenName then\r\n values.Add (children |> Seq.toArray)\r\n else\r\n values.Add (FSharp.Reflection.FSharpValue.GetRecordField(props, p))\r\n FSharp.Reflection.FSharpValue.MakeRecord(propsType, values.ToArray()) :?> 'P\r\n f props\r\n\r\n // In most cases these functions are inlined (mainly for Fable optimizations)\r\n // so we create a proxy to avoid inlining big functions every time\r\n\r\n let createServerElement(tag: obj, props: obj, children: ReactElement seq, elementType: ServerElementType) =\r\n createServerElementPrivate(tag, props, children, elementType)\r\n\r\n let createServerElementByFn(f, props, children) =\r\n createServerElementByFnPrivate(f, props, children)\r\n#endif\r\n\r\n[]\r\n[]\r\nmodule ReactElementType =\r\n let inline ofComponent<'comp, 'props, 'state when 'comp :> Component<'props, 'state>> : ReactElementType<'props> =\r\n#if FABLE_REPL_LIB\r\n failwith \"Cannot create React components from types in Fable REPL\"\r\n#else\r\n#if FABLE_COMPILER\r\n jsConstructor<'comp> |> unbox\r\n#else\r\n Comp (typeof<'comp>) :> _\r\n#endif\r\n#endif\r\n\r\n let inline ofFunction<'props> (f: 'props -> ReactElement): ReactElementType<'props> =\r\n#if FABLE_COMPILER\r\n f |> unbox\r\n#else\r\n Fn f :> _\r\n#endif\r\n\r\n let inline ofHtmlElement<'props> (name: string): ReactElementType<'props> =\r\n#if FABLE_COMPILER\r\n unbox name\r\n#else\r\n HtmlTag name :> ReactElementType<'props>\r\n#endif\r\n\r\n /// Create a ReactElement to be rendered from an element type, props and children\r\n let inline create<'props> (comp: ReactElementType<'props>) (props: 'props) (children: ReactElement seq): ReactElement =\r\n#if FABLE_COMPILER\r\n ReactBindings.React.createElement(comp, props, children)\r\n#else\r\n match (comp :?> ReactElementTypeWrapper<'props>) with\r\n | Comp obj -> ServerRendering.createServerElement(obj, props, children, ServerElementType.Component)\r\n | Fn f -> ServerRendering.createServerElementByFn(f, props, children)\r\n | HtmlTag obj -> ServerRendering.createServerElement(obj, props, children, ServerElementType.Tag)\r\n#endif\r\n\r\n /// React.memo is a higher order component. It’s similar to React.PureComponent but for function components instead of classes.\r\n /// If your function component renders the same result given the same props, you can wrap it in a call to React.memo.\r\n /// React will skip rendering the component, and reuse the last rendered result.\r\n /// By default it will only shallowly compare complex objects in the props object. If you want control over the comparison, you can use `memoWith`.\r\n let memo<'props> (render: 'props -> ReactElement) =\r\n#if FABLE_COMPILER\r\n ReactBindings.React.memo(render, unbox null)\r\n#else\r\n ofFunction render\r\n#endif\r\n\r\n /// React.memo is a higher order component. It’s similar to React.PureComponent but for function components instead of classes.\r\n /// If your function renders the same result given the \"same\" props (according to `areEqual`), you can wrap it in a call to React.memo.\r\n /// React will skip rendering the component, and reuse the last rendered result.\r\n /// By default it will only shallowly compare complex objects in the props object. If you want control over the comparison, you can use `memoWith`.\r\n /// This version allow you to control the comparison used instead of the default shallow one by provide a custom comparison function.\r\n let memoWith<'props> (areEqual: 'props -> 'props -> bool) (render: 'props -> ReactElement) =\r\n#if FABLE_COMPILER\r\n ReactBindings.React.memo(render, areEqual)\r\n#else\r\n ofFunction render\r\n#endif\r\n\r\n\r\n[]\r\nmodule Helpers =\r\n []\r\n let inline createElement(comp: obj, props: obj, [] children: ReactElement seq): ReactElement =\r\n#if FABLE_COMPILER\r\n ReactBindings.React.createElement(comp, props, children)\r\n#else\r\n HTMLNode.Empty :> _\r\n#endif\r\n\r\n /// Instantiate a component from a type inheriting React.Component\r\n /// Example: `ofType { myProps = 5 } []`\r\n let inline ofType<'T,'P,'S when 'T :> Component<'P,'S>> (props: 'P) (children: ReactElement seq): ReactElement =\r\n ReactElementType.create ReactElementType.ofComponent<'T,_,_> props children\r\n\r\n []\r\n let inline com<'T,'P,'S when 'T :> Component<'P,'S>> (props: 'P) (children: ReactElement seq): ReactElement =\r\n ofType<'T, 'P, 'S> props children\r\n\r\n let inline ofFunction<'P> (f: 'P -> ReactElement) (props: 'P) (children: ReactElement seq): ReactElement =\r\n ReactElementType.create (ReactElementType.ofFunction f) props children\r\n\r\n /// Instantiate an imported React component. The first two arguments must be string literals, \"default\" can be used for the first one.\r\n /// Example: `ofImport \"Map\" \"leaflet\" { x = 10; y = 50 } []`\r\n let inline ofImport<'P> (importMember: string) (importPath: string) (props: 'P) (children: ReactElement seq): ReactElement =\r\n#if FABLE_REPL_LIB\r\n failwith \"Cannot import React components in Fable REPL\"\r\n#else\r\n#if FABLE_COMPILER\r\n ReactBindings.React.createElement(import importMember importPath, props, children)\r\n#else\r\n failwith \"Cannot import React components in .NET\"\r\n#endif\r\n#endif\r\n\r\n#if FABLE_COMPILER\r\n []\r\n let private isFunction (x: obj): bool = jsNative\r\n\r\n []\r\n let private isNonEnumerableObject (x: obj): bool = jsNative\r\n#endif\r\n\r\n /// Normal structural F# comparison, but ignores top-level functions (e.g. Elmish dispatch).\r\n /// Can be used e.g. with the `FunctionComponent.Of` `memoizeWith` parameter.\r\n let equalsButFunctions (x: 'a) (y: 'a) =\r\n#if FABLE_COMPILER\r\n if obj.ReferenceEquals(x, y) then\r\n true\r\n elif isNonEnumerableObject x && not(isNull(box y)) then\r\n let keys = JS.Constructors.Object.keys x\r\n let length = keys.Count\r\n let mutable i = 0\r\n let mutable result = true\r\n while i < length && result do\r\n let key = keys.[i]\r\n i <- i + 1\r\n let xValue = x?(key)\r\n result <- isFunction xValue || xValue = y?(key)\r\n result\r\n else\r\n (box x) = (box y)\r\n#else\r\n // Server rendering, won't be actually used\r\n // Avoid `x = y` because it will force 'a to implement structural equality\r\n false\r\n#endif\r\n\r\n /// Comparison similar to default React.memo, but ignores functions (e.g. Elmish dispatch).\r\n /// Performs a memberwise comparison where value types and strings are compared by value,\r\n /// and other types by reference.\r\n /// Can be used e.g. with the `FunctionComponent.Of` `memoizeWith` parameter.\r\n let memoEqualsButFunctions (x: 'a) (y: 'a) =\r\n#if FABLE_COMPILER\r\n if obj.ReferenceEquals(x, y) then\r\n true\r\n elif isNonEnumerableObject x && not(isNull(box y)) then\r\n let keys = JS.Constructors.Object.keys x\r\n let length = keys.Count\r\n let mutable i = 0\r\n let mutable result = true\r\n while i < length && result do\r\n let key = keys.[i]\r\n i <- i + 1\r\n let xValue = x?(key)\r\n result <- isFunction xValue || obj.ReferenceEquals(xValue, y?(key))\r\n result\r\n else\r\n false\r\n#else\r\n // Server rendering, won't be actually used\r\n // Avoid `x = y` because it will force 'a to implement structural equality\r\n false\r\n#endif\r\n\r\n []\r\n let memoBuilder<'props> (name: string) (render: 'props -> ReactElement) : 'props -> ReactElement =\r\n#if FABLE_COMPILER\r\n render?displayName <- name\r\n#endif\r\n let memoType = ReactElementType.memo render\r\n fun props ->\r\n ReactElementType.create memoType props []\r\n\r\n []\r\n let memoBuilderWith<'props> (name: string) (areEqual: 'props -> 'props -> bool) (render: 'props -> ReactElement) : 'props -> ReactElement =\r\n#if FABLE_COMPILER\r\n render?displayName <- name\r\n#endif\r\n let memoType = ReactElementType.memoWith areEqual render\r\n fun props ->\r\n ReactElementType.create memoType props []\r\n\r\n []\r\n let inline from<'P> (com: ReactElementType<'P>) (props: 'P) (children: ReactElement seq): ReactElement =\r\n ReactElementType.create com props children\r\n\r\n /// Alias of `ofString`\r\n let inline str (s: string): ReactElement =\r\n#if FABLE_COMPILER\r\n unbox s\r\n#else\r\n HTMLNode.Text s :> ReactElement\r\n#endif\r\n\r\n /// Cast a string to a React element (erased in runtime)\r\n let inline ofString (s: string): ReactElement =\r\n str s\r\n \r\n /// The equivalent of `sprintf (...) |> str`\r\n let inline strf format =\r\n Printf.kprintf str format\r\n\r\n /// Cast an option value to a React element (erased in runtime)\r\n let inline ofOption (o: ReactElement option): ReactElement =\r\n match o with Some o -> o | None -> null // Option.toObj(o)\r\n\r\n []\r\n let opt (o: ReactElement option): ReactElement =\r\n ofOption o\r\n\r\n /// Cast an int to a React element (erased in runtime)\r\n let inline ofInt (i: int): ReactElement =\r\n#if FABLE_COMPILER\r\n unbox i\r\n#else\r\n HTMLNode.RawText (string i) :> ReactElement\r\n#endif\r\n\r\n /// Cast a float to a React element (erased in runtime)\r\n let inline ofFloat (f: float): ReactElement =\r\n#if FABLE_COMPILER\r\n unbox f\r\n#else\r\n HTMLNode.RawText (string f) :> ReactElement\r\n#endif\r\n\r\n /// Returns a list **from .render() method**\r\n let inline ofList (els: ReactElement list): ReactElement =\r\n#if FABLE_COMPILER\r\n unbox(List.toArray els)\r\n#else\r\n HTMLNode.List els :> ReactElement\r\n#endif\r\n\r\n /// Returns an array **from .render() method**\r\n let inline ofArray (els: ReactElement array): ReactElement =\r\n#if FABLE_COMPILER\r\n unbox els\r\n#else\r\n HTMLNode.List els :> ReactElement\r\n#endif\r\n\r\n /// A ReactElement when you don't want to render anything (null in javascript)\r\n let nothing: ReactElement =\r\n#if FABLE_COMPILER\r\n null\r\n#else\r\n HTMLNode.Empty :> ReactElement\r\n#endif\r\n\r\n /// Instantiate a DOM React element\r\n let inline domEl (tag: string) (props: IHTMLProp seq) (children: ReactElement seq): ReactElement =\r\n#if FABLE_COMPILER\r\n ReactBindings.React.createElement(tag, keyValueList CaseRules.LowerFirst props, children)\r\n#else\r\n ServerRendering.createServerElement(tag, (props |> Seq.cast), children, ServerElementType.Tag)\r\n#endif\r\n\r\n /// Instantiate a DOM React element (void)\r\n let inline voidEl (tag: string) (props: IHTMLProp seq) : ReactElement =\r\n#if FABLE_COMPILER\r\n ReactBindings.React.createElement(tag, keyValueList CaseRules.LowerFirst props, [])\r\n#else\r\n ServerRendering.createServerElement(tag, (props |> Seq.cast), [], ServerElementType.Tag)\r\n#endif\r\n\r\n /// Instantiate an SVG React element\r\n let inline svgEl (tag: string) (props: IProp seq) (children: ReactElement seq): ReactElement =\r\n#if FABLE_COMPILER\r\n ReactBindings.React.createElement(tag, keyValueList CaseRules.LowerFirst props, children)\r\n#else\r\n ServerRendering.createServerElement(tag, (props |> Seq.cast), children, ServerElementType.Tag)\r\n#endif\r\n\r\n /// Instantiate a React fragment\r\n let inline fragment (props: IFragmentProp seq) (children: ReactElement seq): ReactElement =\r\n#if FABLE_COMPILER\r\n ReactBindings.React.createElement(ReactBindings.React.Fragment, keyValueList CaseRules.LowerFirst props, children)\r\n#else\r\n ServerRendering.createServerElement(typeof, (props |> Seq.cast), children, ServerElementType.Fragment)\r\n#endif\r\n\r\n /// Accepts a context value to be passed to consuming components that are descendants of this Provider.\r\n /// One Provider can be connected to many consumers. Providers can be nested to override values deeper within the tree.\r\n /// Important: In SSR, this is ignored, and the DEFAULT value is consumed!\r\n /// More info at https://reactjs.org/docs/context.html#contextprovider\r\n let inline contextProvider (ctx: IContext<'T>) (value: 'T) (children: ReactElement seq): ReactElement =\r\n#if FABLE_COMPILER\r\n ReactBindings.React.createElement(ctx?Provider, createObj [\"value\" ==> value], children)\r\n#else\r\n fragment [] children\r\n#endif\r\n\r\n /// Consumes a context value, either from the nearest parent in the tree, or from the default value.\r\n /// Important: in SSR, this will always consume the context DEFAULT value!\r\n /// More info at https://reactjs.org/docs/context.html#contextconsumer\r\n let inline contextConsumer (ctx: IContext<'T>) (children: 'T -> ReactElement): ReactElement =\r\n#if FABLE_COMPILER\r\n ReactBindings.React.createElement(ctx?Consumer, null, [!!children])\r\n#else\r\n let ctx = ctx :?> ISSRContext<_>\r\n fragment [] [children(ctx.DefaultValue)]\r\n#endif\r\n\r\n /// Creates a Context object. When React renders a component that subscribes to this Context\r\n /// object it will read the current context value from the closest matching Provider above it\r\n /// in the tree. More info at https://reactjs.org/docs/context.html#reactcreatecontext\r\n let inline createContext (defaultValue: 'T): IContext<'T> =\r\n#if FABLE_COMPILER\r\n ReactBindings.React.createContext(defaultValue)\r\n#else\r\n upcast { new ISSRContext<_> with member __.DefaultValue = defaultValue }\r\n#endif\r\n\r\n /// To be used in constructors of class components\r\n /// (for function components use `useRef` hook)\r\n let inline createRef (initialValue: 'T): IRefValue<'T> =\r\n#if FABLE_COMPILER\r\n ReactBindings.React.createRef(initialValue)\r\n#else\r\n { new IRefValue<_> with\r\n member __.current with get() = initialValue and set _ = () }\r\n#endif\r\n\r\n // Class list helpers\r\n let classBaseList baseClass classes =\r\n classes\r\n |> Seq.choose (fun (name, condition) ->\r\n if condition && not(System.String.IsNullOrEmpty(name)) then Some name\r\n else None)\r\n |> Seq.fold (fun state name -> state + \" \" + name) baseClass\r\n |> ClassName\r\n\r\n let classList classes = classBaseList \"\" classes\r\n\r\n /// Finds a DOM element by its ID and mounts the React element there\r\n /// Important: Not available in SSR\r\n let inline mountById (domElId: string) (reactEl: ReactElement): unit =\r\n#if FABLE_COMPILER\r\n ReactDom.render(reactEl, document.getElementById(domElId))\r\n#else\r\n failwith \"mountById is not available for SSR\"\r\n#endif\r\n /// Finds the first DOM element matching a CSS selector and mounts the React element there\r\n /// Important: Not available in SSR\r\n let inline mountBySelector (domElSelector: string) (reactEl: ReactElement): unit =\r\n#if FABLE_COMPILER\r\n ReactDom.render(reactEl, document.querySelector(domElSelector))\r\n#else\r\n failwith \"mountBySelector is not available for SSR\"\r\n#endif\r\n","namespace Fulma\r\n\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\nmodule Reflection =\r\n\r\n open Microsoft.FSharp.Reflection\r\n open System\r\n\r\n let getCaseName (case : 'T) =\r\n#if FABLE_COMPILER\r\n Fable.Core.Reflection.getCaseName case\r\n#else\r\n // Get UnionCaseInfo value from the F# reflection tools\r\n let (caseInfo, _args) = FSharpValue.GetUnionFields(case, typeof<'T>)\r\n caseInfo.GetCustomAttributes()\r\n |> Seq.tryPick (function\r\n | :? CompiledNameAttribute as att -> Some att.CompiledName\r\n | _ -> None)\r\n |> Option.defaultWith (fun () -> caseInfo.Name)\r\n#endif\r\n\r\n let getCaseTag (case : 'T) =\r\n#if FABLE_COMPILER\r\n Fable.Core.Reflection.getCaseTag case\r\n#else\r\n let (caseInfo, _args) = FSharpValue.GetUnionFields(case, typeof<'T>)\r\n caseInfo.Tag\r\n#endif\r\n\r\n[]\r\ntype Screen =\r\n | All\r\n | [] Desktop\r\n | [] Tablet\r\n | [] Mobile\r\n | [] WideScreen\r\n | [] Touch\r\n | [] FullHD\r\n\r\n static member ToString (screen : Screen) =\r\n match screen with\r\n | All -> \"\"\r\n | Desktop\r\n | Tablet\r\n | Mobile\r\n | WideScreen\r\n | Touch\r\n | FullHD -> \"-\" + Reflection.getCaseName screen\r\n\r\n[]\r\nmodule Color =\r\n\r\n type IColor =\r\n | [] IsBlack\r\n | [] IsDark\r\n | [] IsLight\r\n | [] IsWhite\r\n | [] IsPrimary\r\n | [] IsInfo\r\n | [] IsSuccess\r\n | [] IsWarning\r\n | [] IsDanger\r\n | [] IsLink\r\n | [] IsBlackBis\r\n | [] IsBlackTer\r\n | [] IsGreyDarker\r\n | [] IsGreyDark\r\n | [] IsGrey\r\n | [] IsGreyLight\r\n | [] IsGreyLighter\r\n | [] IsWhiteTer\r\n | [] IsWhiteBis\r\n /// Allow you to specify a custom color. The color will be prefixed by \"is-\"\r\n | IsCustomColor of string\r\n /// Allow you to specify a NoColor case.\r\n | NoColor\r\n\r\n let ofColor level =\r\n match level with\r\n | NoColor -> \"\"\r\n | IsCustomColor color -> \"is-\" + color\r\n | IsBlack\r\n | IsDark\r\n | IsLight\r\n | IsWhite\r\n | IsPrimary\r\n | IsInfo\r\n | IsSuccess\r\n | IsWarning\r\n | IsDanger\r\n | IsLink\r\n | IsBlackBis\r\n | IsBlackTer\r\n | IsGreyDarker\r\n | IsGreyDark\r\n | IsGrey\r\n | IsGreyLight\r\n | IsGreyLighter\r\n | IsWhiteTer\r\n | IsWhiteBis -> Reflection.getCaseName level\r\n\r\n[]\r\nmodule Size =\r\n\r\n type ISize =\r\n | [] IsSmall\r\n | [] IsMedium\r\n | [] IsLarge\r\n\r\n let inline ofSize size =\r\n Reflection.getCaseName size\r\n\r\n[]\r\nmodule TextSize =\r\n type Option =\r\n | Is1\r\n | Is2\r\n | Is3\r\n | Is4\r\n | Is5\r\n | Is6\r\n | Is7\r\n\r\n static member ToString (x: Option) =\r\n Reflection.getCaseTag x + 1 |> string\r\n\r\n let inline generic screen size =\r\n \"is-size-\" + Option.ToString size + Screen.ToString screen\r\n\r\n let inline only screen size =\r\n match screen with\r\n | Screen.Tablet\r\n | Screen.Desktop\r\n | Screen.WideScreen ->\r\n \"is-size-\" + Option.ToString size + Screen.ToString screen + \"-only\"\r\n | x ->\r\n Fable.Core.JS.console.warn(sprintf \"Screen `%s` does not support `is-size-xxx-only`.\" (string x))\r\n \"\"\r\n\r\n[]\r\nmodule TextAlignment =\r\n\r\n type Option =\r\n /// Add `has-text-centered`\r\n | [] Centered\r\n /// Add `has-text-justified`\r\n | [] Justified\r\n /// Add `has-text-left`\r\n | [] Left\r\n /// Add `has-text-right`\r\n | [] Right\r\n\r\n static member inline ToString opt =\r\n Reflection.getCaseName opt\r\n\r\n let inline generic screen alignment =\r\n Option.ToString alignment + Screen.ToString screen\r\n\r\n let inline only screen alignment =\r\n match screen with\r\n | Screen.Tablet\r\n | Screen.Desktop\r\n | Screen.WideScreen ->\r\n Option.ToString alignment + Screen.ToString screen + \"-only\"\r\n | x ->\r\n Fable.Core.JS.console.warn(sprintf \"Screen `%s` does not support `is-size-xxx-only`.\" (string x))\r\n \"\"\r\n\r\n[]\r\nmodule FlexDirection =\r\n\r\n type Option =\r\n /// Add is-flex-direction-row\r\n | [] Row\r\n /// Add is-flex-direction-row-reverse\r\n | [] RowReverse\r\n /// Add is-flex-direction-column\r\n | [] Column\r\n /// Add is-flex-direction-column-reverse\r\n | [] ColumnReverse\r\n\r\n static member inline toClass (opt : Option) =\r\n Reflection.getCaseName opt\r\n\r\n[]\r\nmodule FlexWrap =\r\n\r\n type Option =\r\n /// Add is-flex-wrap-nowrap\r\n | [] NoWrap\r\n /// Add is-flex-wrap-wrap\r\n | [] Wrap\r\n /// Add is-flex-wrap-wrap-reverse\r\n | [] WrapReverse\r\n\r\n static member inline toClass (opt : Option) =\r\n Reflection.getCaseName opt\r\n\r\n[]\r\nmodule FlexJustifyContent =\r\n\r\n type Option =\r\n /// Add is-justify-content-flex-start\r\n | [] FlexStart\r\n /// Add is-justify-content-flex-end\r\n | [] FlexEnd\r\n /// Add is-justify-content-center\r\n | [] Center\r\n /// Add is-justify-content-space-between\r\n | [] SpaceBetween\r\n /// Add is-justify-content-space-around\r\n | [] SpaceAround\r\n /// Add is-justify-content-space-evenly\r\n | [] SpaceEvenly\r\n /// Add is-justify-content-start\r\n | [] Start\r\n /// Add is-justify-content-end\r\n | [] End\r\n /// Add is-justify-content-left\r\n | [] Left\r\n /// Add is-justify-content-right\r\n | [] Right\r\n\r\n static member inline toClass (opt : Option) =\r\n Reflection.getCaseName opt\r\n\r\n[]\r\nmodule FlexAlignContent =\r\n\r\n type Option =\r\n /// Add is-align-content-flex-start\r\n | [] FlexStart\r\n /// Add is-align-content-flex-end\r\n | [] FlexEnd\r\n /// Add is-align-content-center\r\n | [] Center\r\n /// Add is-align-content-space-between\r\n | [] SpaceBetween\r\n /// Add is-align-content-space-around\r\n | [] SpaceAround\r\n /// Add is-align-content-space-evenly\r\n | [] SpaceEvenly\r\n /// Add is-align-content-stretch\r\n | [] Stretch\r\n /// Add is-align-content-start\r\n | [] Start\r\n /// Add is-align-content-end\r\n | [] End\r\n /// Add is-align-content-baseline\r\n | [] Baseline\r\n\r\n static member inline toClass (opt : Option) =\r\n Reflection.getCaseName opt\r\n\r\n\r\n[]\r\nmodule FlexAlignItems =\r\n\r\n type Option =\r\n /// Add is-align-items-stretch\r\n | [] Stretch\r\n /// Add is-align-items-flex-start\r\n | [] FlexStart\r\n /// Add is-align-items-flex-end\r\n | [] FlexEnd\r\n /// Add is-align-items-center\r\n | [] Center\r\n /// Add is-align-items-baseline\r\n | [] Baseline\r\n /// Add is-align-items-start\r\n | [] Start\r\n /// Add is-align-items-end\r\n | [] End\r\n /// Add is-align-items-self-start\r\n | [] SelfStart\r\n /// Add is-align-items-self-end\r\n | [] SelfEnd\r\n\r\n static member inline toClass (opt : Option) =\r\n Reflection.getCaseName opt\r\n\r\n[]\r\nmodule FlexAlignSelf =\r\n\r\n type Option =\r\n /// Add is-align-self-auto\r\n | [] Auto\r\n /// Add is-align-self-flex-start\r\n | [] FlexStart\r\n /// Add is-align-self-flex-end\r\n | [] FlexEnd\r\n /// Add is-align-self-center\r\n | [] Center\r\n /// Add is-align-self-baseline\r\n | [] Baseline\r\n /// Add is-align-self-stretch\r\n | [] Stretch\r\n\r\n static member inline toClass (opt : Option) =\r\n Reflection.getCaseName opt\r\n\r\n[]\r\nmodule FlexGrow =\r\n\r\n type Option =\r\n /// Add is-flex-grow-0\r\n | [] Is0\r\n /// Add is-flex-grow-1\r\n | [] Is1\r\n /// Add is-flex-grow-2\r\n | [] Is2\r\n /// Add is-flex-grow-3\r\n | [] Is3\r\n /// Add is-flex-grow-4\r\n | [] Is4\r\n /// Add is-flex-grow-5\r\n | [] Is5\r\n\r\n static member inline toClass (opt : Option) =\r\n Reflection.getCaseName opt\r\n\r\n[]\r\nmodule FlexShrink =\r\n\r\n type Option =\r\n /// Add is-flex-shrink-0\r\n | [] Is0\r\n /// Add is-flex-shrink-1\r\n | [] Is1\r\n /// Add is-flex-shrink-2\r\n | [] Is2\r\n /// Add is-flex-shrink-3\r\n | [] Is3\r\n /// Add is-flex-shrink-4\r\n | [] Is4\r\n /// Add is-flex-shrink-5\r\n | [] Is5\r\n\r\n static member inline toClass (opt : Option) =\r\n Reflection.getCaseName opt\r\n\r\n\r\n[]\r\nmodule TextWeight =\r\n\r\n type Option =\r\n /// Add `has-text-weight-light`\r\n | [] Light\r\n /// Add `has-text-weight-normal`\r\n | [] Normal\r\n /// Add `has-text-weight-semibold`\r\n | [] SemiBold\r\n /// Add `has-text-weight-bold`\r\n | [] Bold\r\n /// Add `has-text-weight-medium`\r\n | [] Medium\r\n\r\n let inline internal ofOption opt =\r\n Reflection.getCaseName opt\r\n\r\n[]\r\nmodule TextTransform =\r\n\r\n type Option =\r\n /// Add `is-capitalized`\r\n | [] Capitalized\r\n /// Add `is-lowercase`\r\n | [] LowerCase\r\n /// Add `is-uppercase`\r\n | [] UpperCase\r\n /// Add `is-italic`\r\n | [] Italic\r\n /// Add `is-underlined`\r\n | [] Underlined\r\n\r\n static member inline toClass opt =\r\n Reflection.getCaseName opt\r\n\r\n[]\r\nmodule Display =\r\n\r\n type Option =\r\n | [] Block\r\n | [] Flex\r\n | [] Inline\r\n | [] InlineBlock\r\n | [] InlineFlex\r\n\r\n static member inline toClass opt =\r\n Reflection.getCaseName opt\r\n\r\n let internal toDisplayClass screen display =\r\n let display = Option.toClass display\r\n let screen = Screen.ToString screen\r\n\r\n \"is-\" + display + screen\r\n\r\n let internal toDisplayOnlyClass screen display =\r\n match screen with\r\n | Screen.Tablet\r\n | Screen.Desktop\r\n | Screen.WideScreen ->\r\n let display = Option.toClass display\r\n let screen = Screen.ToString screen\r\n \"is-\" + display + screen + \"-only\"\r\n\r\n | x ->\r\n Fable.Core.JS.console.warn(sprintf \"Screen `%s` does not support display only.\" (string x))\r\n \"\"\r\n\r\n[]\r\nmodule Spacing =\r\n type TypeAndDirection =\r\n | [] Margin\r\n | [] MarginTop\r\n | [] MarginRight\r\n | [] MarginBottom\r\n | [] MarginLeft\r\n | [] MarginTopAndBottom\r\n | [] MarginLeftAndRight\r\n | [] Padding\r\n | [] PaddingTop\r\n | [] PaddingRight\r\n | [] PaddingBottom\r\n | [] PaddingLeft\r\n | [] PaddingTopAndBottom\r\n | [] PaddingLeftAndRight\r\n\r\n static member inline toClass opt =\r\n Reflection.getCaseName opt\r\n\r\n type Amount =\r\n | [] IsAuto\r\n | [] Is0\r\n | [] Is1\r\n | [] Is2\r\n | [] Is3\r\n | [] Is4\r\n | [] Is5\r\n | [] Is6\r\n\r\n static member inline toClass opt =\r\n Reflection.getCaseName opt\r\n\r\n let internal toSpacingClass typ amount =\r\n let typ = TypeAndDirection.toClass typ\r\n let amount = Amount.toClass amount\r\n\r\n typ + \"-\" + amount\r\n\r\n[]\r\nmodule Modifier =\r\n let internal ofBackground level =\r\n match level with\r\n | NoColor -> \"\"\r\n | IsCustomColor color -> \"has-background-\" + color\r\n | IsBlack\r\n | IsDark\r\n | IsLight\r\n | IsWhite\r\n | IsPrimary\r\n | IsInfo\r\n | IsSuccess\r\n | IsWarning\r\n | IsDanger\r\n | IsLink\r\n | IsBlackBis\r\n | IsBlackTer\r\n | IsGreyDarker\r\n | IsGreyDark\r\n | IsGrey\r\n | IsGreyLight\r\n | IsGreyLighter\r\n | IsWhiteTer\r\n | IsWhiteBis -> \"has-background-\" + (Reflection.getCaseName level).[3..]\r\n\r\n let internal ofText level =\r\n match level with\r\n | NoColor -> \"\"\r\n | IsCustomColor color -> \"has-text-\" + color\r\n | IsBlack\r\n | IsDark\r\n | IsLight\r\n | IsWhite\r\n | IsPrimary\r\n | IsInfo\r\n | IsSuccess\r\n | IsWarning\r\n | IsDanger\r\n | IsLink\r\n | IsBlackBis\r\n | IsBlackTer\r\n | IsGreyDarker\r\n | IsGreyDark\r\n | IsGrey\r\n | IsGreyLight\r\n | IsGreyLighter\r\n | IsWhiteTer\r\n | IsWhiteBis -> \"has-text-\" + (Reflection.getCaseName level).[3..]\r\n\r\n let internal ofInvisible screen =\r\n \"is-invisible\" + Screen.ToString screen\r\n\r\n let internal ofHidden screen =\r\n \"is-hidden\" + Screen.ToString screen\r\n\r\n let internal ofInvisibleOnly screen =\r\n match screen with\r\n | Screen.Tablet\r\n | Screen.Desktop\r\n | Screen.WideScreen ->\r\n \"is-invisible\" + Screen.ToString screen + \"-only\"\r\n | x ->\r\n Fable.Core.JS.console.warn(sprintf \"Screen `%s` does not support `is-invisible-xxx-only`.\" (string x))\r\n \"\"\r\n\r\n let internal ofHiddenOnly screen =\r\n match screen with\r\n | Screen.Tablet\r\n | Screen.Desktop\r\n | Screen.WideScreen ->\r\n \"is-hidden\" + Screen.ToString screen + \"-only\"\r\n | x ->\r\n Fable.Core.JS.console.warn(sprintf \"Screen `%s` does not support `is-hidden-xxx-only`.\" (string x))\r\n \"\"\r\n\r\n type IModifier =\r\n | BackgroundColor of IColor\r\n | TextColor of IColor\r\n | TextWeight of TextWeight.Option\r\n | TextSize of Screen * TextSize.Option\r\n | TextSizeOnly of Screen * TextSize.Option\r\n | TextAlignment of Screen * TextAlignment.Option\r\n | TextAlignmentOnly of Screen * TextAlignment.Option\r\n | TextTransform of TextTransform.Option\r\n | Display of Screen * Display.Option\r\n | DisplayOnly of Screen * Display.Option\r\n | [] IsClearfix\r\n | [] IsPulledLeft\r\n | [] IsPulledRight\r\n | [] IsMarginless\r\n | [] IsPaddingless\r\n | [] IsOverlay\r\n | [] IsClipped\r\n | [] IsRadiusless\r\n | [] IsShadowless\r\n | [] IsUnselectable\r\n | [] IsClickable\r\n | [] IsRelative\r\n | [] IsFlex\r\n | IsInvisible of Screen * bool\r\n | IsHidden of Screen * bool\r\n | IsInvisibleOnly of Screen * bool\r\n | IsHiddenOnly of Screen * bool\r\n | IsSrOnly\r\n | IsScreenReaderOnly\r\n | Spacing of Spacing.TypeAndDirection * Spacing.Amount\r\n // Flexbox helpers\r\n | FlexDirection of FlexDirection.Option\r\n | FlexWrap of FlexWrap.Option\r\n | FlexJustifyContent of FlexJustifyContent.Option\r\n | FlexAlignContent of FlexAlignContent.Option\r\n | FlexAlignItems of FlexAlignItems.Option\r\n | FlexAlignSelf of FlexAlignSelf.Option\r\n | FlexGrow of FlexGrow.Option\r\n | FlexShrink of FlexShrink.Option\r\n\r\n\r\n\r\n // | IsGap (screen, size) ->\r\n // if not (List.contains \"is-variable\" result.Classes) then\r\n // result.AddClass(\"is-variable\").AddClass(gapSizeGeneric screen size)\r\n // else\r\n // result.AddClass(gapSizeGeneric screen size)\r\n\r\n\r\n\r\n let parseModifiers options =\r\n let parseOptions result option =\r\n match option with\r\n | BackgroundColor color -> (ofBackground color)::result\r\n | TextColor color -> (ofText color)::result\r\n | TextWeight textWeight -> (TextWeight.ofOption textWeight)::result\r\n | TextSize (screen, size) -> (TextSize.generic screen size)::result\r\n | TextSizeOnly (screen, size) -> (TextSize.only screen size)::result\r\n | TextAlignment (screen, size) -> (TextAlignment.generic screen size)::result\r\n | TextAlignmentOnly (screen, size) -> (TextAlignment.only screen size)::result\r\n | TextTransform transform -> (TextTransform.Option.toClass transform)::result\r\n | Display (screen, display) -> (Display.toDisplayClass screen display)::result\r\n | DisplayOnly (screen, display) -> (Display.toDisplayOnlyClass screen display)::result\r\n | IsInvisible (screen, b) -> if b then (ofInvisible screen)::result else result\r\n | IsInvisibleOnly (screen, b) -> if b then (ofInvisibleOnly screen)::result else result\r\n | IsHidden (screen, b) -> if b then (ofHidden screen)::result else result\r\n | IsHiddenOnly (screen, b) -> if b then (ofHiddenOnly screen)::result else result\r\n | IsSrOnly\r\n | IsScreenReaderOnly -> \"is-sr-only\"::result\r\n | IsClearfix\r\n | IsPulledLeft\r\n | IsPulledRight\r\n | IsMarginless\r\n | IsPaddingless\r\n | IsOverlay\r\n | IsClipped\r\n | IsRadiusless\r\n | IsShadowless\r\n | IsClickable\r\n | IsUnselectable\r\n | IsFlex\r\n | IsRelative -> (Reflection.getCaseName option)::result\r\n | Spacing (typ, amount) -> (Spacing.toSpacingClass typ amount)::result\r\n | FlexDirection direction ->\r\n if not (List.contains \"is-flex\" result) then\r\n \"is-flex\"::(FlexDirection.Option.toClass direction)::result\r\n else\r\n (FlexDirection.Option.toClass direction)::result\r\n | FlexWrap option ->\r\n if not (List.contains \"is-flex\" result) then\r\n \"is-flex\"::(FlexWrap.Option.toClass option)::result\r\n else\r\n (FlexWrap.Option.toClass option)::result\r\n | FlexJustifyContent option ->\r\n if not (List.contains \"is-flex\" result) then\r\n \"is-flex\"::(FlexJustifyContent.Option.toClass option)::result\r\n else\r\n (FlexJustifyContent.Option.toClass option)::result\r\n | FlexAlignContent option ->\r\n if not (List.contains \"is-flex\" result) then\r\n \"is-flex\"::(FlexAlignContent.Option.toClass option)::result\r\n else\r\n (FlexAlignContent.Option.toClass option)::result\r\n | FlexAlignItems option ->\r\n if not (List.contains \"is-flex\" result) then\r\n \"is-flex\"::(FlexAlignItems.Option.toClass option)::result\r\n else\r\n (FlexAlignItems.Option.toClass option)::result\r\n\r\n | FlexAlignSelf option ->\r\n (FlexAlignSelf.Option.toClass option)::result\r\n\r\n | FlexGrow size ->\r\n (FlexGrow.Option.toClass size)::result\r\n\r\n | FlexShrink size ->\r\n (FlexShrink.Option.toClass size)::result\r\n\r\n options |> List.fold parseOptions []\r\n\r\n[]\r\nmodule Common =\r\n type GenericOption =\r\n | CustomClass of string\r\n | Props of IHTMLProp list\r\n | Modifiers of Modifier.IModifier list\r\n\r\n type GenericOptions =\r\n { Props : IHTMLProp list\r\n Classes : string list\r\n RemovedClasses : string list }\r\n\r\n static member Empty =\r\n { Props = []; Classes = []; RemovedClasses = [] }\r\n\r\n static member Parse(options, parser, ?baseClass, ?baseProps) =\r\n let result = options |> List.fold parser GenericOptions.Empty\r\n\r\n let result =\r\n match baseClass with\r\n | Some baseClass -> result.AddClass(baseClass)\r\n | None -> result\r\n\r\n match baseProps with\r\n | Some baseProps -> result.AddProps(baseProps)\r\n | None -> result\r\n\r\n member this.AddProp(prop : IHTMLProp) =\r\n { this with Props = prop::this.Props }\r\n\r\n member this.AddProps(props : IHTMLProp list) =\r\n { this with Props = props@this.Props }\r\n\r\n member this.AddClass(cl: string) =\r\n { this with Classes = cl::this.Classes }\r\n\r\n member this.RemoveClass(cl: string) =\r\n { this with RemovedClasses = cl::this.RemovedClasses }\r\n\r\n member this.AddCaseName(case: 'T) =\r\n Reflection.getCaseName case |> this.AddClass\r\n\r\n member this.AddModifiers(modifiers) =\r\n { this with Classes = (modifiers |> Modifier.parseModifiers) @ this.Classes }\r\n\r\n member this.ToAttributes() =\r\n match this.Classes |> List.filter (fun cls -> not (System.String.IsNullOrEmpty cls) && not (List.contains cls this.RemovedClasses)) with\r\n | [] -> this.Props\r\n | classes -> (classes |> String.concat \" \" |> ClassName :> _) :: this.Props\r\n\r\n /// Convert to standard element\r\n member this.ToReactElement(el : IHTMLProp list -> ReactElement list -> ReactElement, ?children): ReactElement =\r\n let children = defaultArg children []\r\n el (this.ToAttributes ()) children\r\n\r\n /// Convert to self closing element\r\n member this.ToReactElement(el : IHTMLProp list -> ReactElement): ReactElement =\r\n el (this.ToAttributes ())\r\n\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n module Helpers =\r\n\r\n []\r\n let classes std (options : string option list) (booleans: (string * bool) list) =\r\n let std = (std, options) ||> List.fold (fun complete option ->\r\n match option with\r\n | Some name -> complete + \" \" + name\r\n | None -> complete )\r\n (std, booleans) ||> List.fold (fun complete (name, flag) ->\r\n if flag then complete + \" \" + name else complete)\r\n |> ClassName :> IHTMLProp\r\n\r\n[]\r\nmodule Text =\r\n open Fable.React\r\n\r\n let p (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions).ToReactElement(p, children)\r\n\r\n let div (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions).ToReactElement(div, children)\r\n\r\n let span (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions).ToReactElement(span, children)\r\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Field =\r\n\r\n type Option =\r\n /// Add `has-addons` class\r\n | [] HasAddons\r\n /// Add `has-addons-centered` class\r\n | [] HasAddonsCentered\r\n /// Add `has-addons-right` class\r\n | [] HasAddonsRight\r\n /// Add `has-addons-fullwidth` class\r\n | [] HasAddonsFullWidth\r\n /// Add `is-grouped` class\r\n | [] IsGrouped\r\n /// Add `is-grouped-centered` class\r\n | [] IsGroupedCentered\r\n /// Add `is-grouped-right` class\r\n | [] IsGroupedRight\r\n /// Add `is-grouped-multiline` class\r\n | [] IsGroupedMultiline\r\n /// Add `is-horizontal` class\r\n | [] IsHorizontal\r\n /// Add `is-expanded` class\r\n | [] IsExpanded\r\n | CustomClass of string\r\n | Props of IHTMLProp list\r\n | Modifiers of Modifier.IModifier list\r\n\r\n module Label =\r\n\r\n type Option =\r\n | Size of ISize\r\n /// Add `is-normal` class\r\n | [] IsNormal\r\n | CustomClass of string\r\n | Props of IHTMLProp list\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate
\r\n let body (options : GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"field-body\").ToReactElement(div, children)\r\n\r\n /// Generate
\r\n let label options children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Label.Size size -> ofSize size |> result.AddClass\r\n | Label.IsNormal -> result.AddCaseName option\r\n | Label.Props props -> result.AddProps props\r\n | Label.CustomClass customClass -> result.AddClass customClass\r\n | Label.Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"field-label\").ToReactElement(div, children)\r\n\r\n let internal fieldView element options children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | HasAddonsCentered -> result.AddClass(\"has-addons\").AddCaseName option\r\n | HasAddonsRight -> result.AddClass(\"has-addons\").AddCaseName option\r\n | HasAddonsFullWidth -> result.AddClass(\"has-addons\").AddCaseName option\r\n | IsGroupedCentered -> result.AddClass(\"is-grouped\").AddCaseName option\r\n | IsGroupedRight -> result.AddClass(\"is-grouped\").AddCaseName option\r\n | IsGroupedMultiline -> result.AddClass(\"is-grouped\").AddCaseName option\r\n | HasAddons\r\n | IsGrouped\r\n | IsHorizontal\r\n | IsExpanded -> result.AddCaseName option\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"field\").ToReactElement(element, children)\r\n\r\n /// Generate
\r\n let div x y = fieldView div x y\r\n /// Generate

\r\n let p x y = fieldView p x y\r\n","namespace Fulma.Extensions.Wikiki\n\nopen Fulma\nopen Fable.React\nopen Fable.React.Props\n\n[]\nmodule Checkradio =\n\n type Option =\n | Color of IColor\n | Size of ISize\n /// Add `is-rtl` class\n | [] IsRtl\n /// Add `has-no-border` class\n | [] HasNoBorder\n /// Add `has-background-color` class\n | [] HasBackgroundColor\n /// Add `is-circle` class\n | [] IsCircle\n /// Add `checked` HTMLAttr if true\n | Checked of bool\n /// Add `disabled` HTMLAttr if true\n | Disabled of bool\n /// Add `is-block` class\n | [] IsBlock\n | LabelProps of IHTMLProp list\n | InputProps of IHTMLProp list\n | OnChange of (Browser.Types.Event -> unit)\n | CustomClass of string\n | Id of string\n | Name of string\n\n let private parseOptionsForInput (result : GenericOptions) option =\n match option with\n | Option.Color color -> ofColor color |> result.AddClass\n | Size size -> ofSize size |> result.AddClass\n | IsCircle\n | IsRtl\n | HasNoBorder\n | HasBackgroundColor\n | IsBlock -> result.AddCaseName option\n | Checked state -> Props.Checked state |> result.AddProp\n | Disabled state -> Props.Disabled state |> result.AddProp\n | Name customName -> Props.Name customName |> result.AddProp\n | InputProps props -> result.AddProps props\n | OnChange cb -> Props.OnChange cb |> result.AddProp\n | Id customId -> Props.Id customId |> result.AddProp\n | CustomClass customClass -> result.AddClass customClass\n // If option abose don't match, then others don't impact the input generation\n | LabelProps _ -> result\n\n let private parseOptionsForLabel (result : GenericOptions) option =\n match option with\n | Id customId -> Props.HtmlFor customId |> result.AddProp\n | LabelProps props -> result.AddProps props\n // If option abose don't match, then others don't impact the label generation\n | _ -> result\n\n let private hasId (options : Option list) =\n options\n |> List.tryPick (fun option ->\n match option with\n | Id _ -> Some true\n | _ -> None\n )\n |> Option.isSome\n\n let private genericElement inputType baseClass (options : Option list) children =\n if hasId options then\n let inputElement =\n GenericOptions.Parse(options, parseOptionsForInput, baseClass, [Props.Type inputType]).ToReactElement(input)\n\n let labelElement =\n GenericOptions.Parse(options, parseOptionsForLabel).ToReactElement(label, children)\n\n fragment [ ]\n [ inputElement\n labelElement ]\n else\n Text.span [ Modifiers [ Modifier.TextColor IsDanger\n Modifier.TextWeight TextWeight.Bold ] ]\n [ str \"You need to set an Id value for your Checkradio \"]\n\n /// Generate\n /// \n /// \n /// \n /// \n let checkboxInline (options : Option list) children =\n genericElement \"checkbox\" \"is-checkradio\" options children\n\n /// Generate\n ///
\n /// \n /// \n /// \n /// \n ///
\n let checkbox (options : Option list) children =\n Field.div [ ]\n [ checkboxInline options children ]\n\n /// Generate\n /// \n /// \n /// \n /// \n let radioInline (options : Option list) children =\n genericElement \"radio\" \"is-checkradio\" options children\n\n /// Generate\n ///
\n /// \n /// \n /// \n /// \n ///
\n let radio (options : Option list) children =\n Field.div [ ]\n [ radioInline options children ]\n","namespace PortalLibs.Client.Components\r\n\r\n\r\nopen System\r\nopen FSharpPlus\r\nopen Browser.Types\r\nopen Fable.Core.JsInterop\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen PortalLibs.Client\r\nopen PortalLibs.Client.Util\r\nopen Fulma\r\nopen Fulma.Extensions.Wikiki\r\nopen Feliz\r\nopen PortalLibs.Client.Model\r\nopen PortalLibs.Shared\r\n\r\n\r\nmodule NumberInput =\r\n let private parseInputOrZero =\r\n JsUtil.parseFloat >> fun x -> if Double.IsNaN x then 0.0 else x\r\n \r\n let private valueOr condition boundaryOpt value =\r\n match boundaryOpt with\r\n | None -> value\r\n | Some b -> if condition b value then b else value\r\n \r\n let private valueOrMin = valueOr (fun m v -> v < m)\r\n let private valueOrMax = valueOr (fun m v -> v > m)\r\n \r\n let NumberInput =\r\n React.memo (\r\n \"NumberInput\",\r\n areEqual = Helpers.equalsButFunctions,\r\n render =\r\n (fun (props: {| Key: string\r\n Value: float option\r\n Step: float option\r\n Min: float option\r\n Max: float option\r\n DecimalPlaces: int option\r\n Ref: IRefValue option\r\n EditMode: ControlEditMode |}) ->\r\n DebouncedView.DebouncedView\r\n {| Key = $\"NumberInputDebouncedView-%s{props.Key}\"\r\n Value = props.Value\r\n ValueChanged =\r\n match props.EditMode with\r\n | ControlEditMode.ReadOnly -> (fun _ -> ())\r\n | ControlEditMode.Edit edit -> edit.OnChange\r\n Intercept =\r\n Some\r\n (fun values ->\r\n parseInputOrZero values.Value\r\n |> valueOrMin props.Min\r\n |> valueOrMax props.Max\r\n |> Some)\r\n View =\r\n (fun valueOpt valueChanged ->\r\n Html.input [\r\n prop.className \"input\"\r\n prop.type'.number\r\n match props.Ref with\r\n | Some r -> prop.ref r\r\n | None -> ()\r\n prop.onClick (fun e -> (e.target :?> HTMLInputElement).select())\r\n prop.onChange (fun (e: Browser.Types.Event) -> !!e.target?value |> valueChanged)\r\n prop.value (\r\n valueOpt\r\n |>> fun floatVal ->\r\n match props.DecimalPlaces with\r\n | None -> string floatVal\r\n | Some places -> floatVal.ToString $\"F%i{places}\"\r\n |> Option.emptyStrIfNone )\r\n prop.style [ style.textAlign.right ]\r\n \r\n match props.Step with\r\n | None -> ()\r\n | Some step -> prop.step step\r\n match props.Min with\r\n | None -> ()\r\n | Some min -> prop.min min\r\n match props.Max with\r\n | None -> ()\r\n | Some max -> prop.max max\r\n \r\n match props.EditMode with\r\n | ControlEditMode.ReadOnly ->\r\n prop.readOnly true\r\n prop.tabIndex -1\r\n | _ -> ()\r\n ] ) |}),\r\n withKey = fun props -> props.Key)\r\n\r\n let viewWithHeader header props = field header [ NumberInput props ]\r\n\r\nmodule Checkradio =\r\n importAll \"bulma-checkradio/dist/css/bulma-checkradio.min.css\"\r\n let YesNoAllRadio =\r\n React.memo (\r\n \"YesNoAllRadio\",\r\n areEqual = Helpers.equalsButFunctions,\r\n render =\r\n (fun (props: {| Key: string\r\n Value: bool option\r\n ValueChanged: bool option -> unit |}) ->\r\n Field.div [] [\r\n Checkradio.radioInline [ Checkradio.Name \"inline\"\r\n Checkradio.Id $\"checkradio-%s{props.Key}-all\"\r\n Checkradio.Checked(Option.isNone props.Value)\r\n Checkradio.OnChange(fun _ -> props.ValueChanged None) ] [\r\n str \"All\"\r\n ]\r\n Checkradio.radioInline [ Checkradio.Name \"inline\"\r\n Checkradio.Id $\"checkradio-%s{props.Key}-yes\"\r\n Checkradio.Checked(props.Value = Some true)\r\n Checkradio.OnChange(fun _ -> props.ValueChanged(Some true)) ] [\r\n str \"Yes \"\r\n ]\r\n Checkradio.radioInline [ Checkradio.Name \"inline\"\r\n Checkradio.Id $\"checkradio-%s{props.Key}-no\"\r\n Checkradio.Checked(props.Value = Some false)\r\n Checkradio.OnChange(fun _ -> props.ValueChanged(Some false)) ] [\r\n str \"No \"\r\n ]\r\n ]),\r\n withKey = fun props -> props.Key)\r\n\r\n let CheckboxComp =\r\n React.memo (\r\n \"CheckboxComp\",\r\n areEqual = Helpers.equalsButFunctions,\r\n render =\r\n (fun (props: {| Key: string\r\n EditMode: ControlEditMode\r\n Label: string option\r\n Value: bool |}) ->\r\n div [ Style [ FlexShrink 0 ] ] [\r\n Checkradio.checkbox [ Checkradio.Id $\"checkbox-%s{props.Key}\"\r\n Checkradio.Checked(props.Value)\r\n Checkradio.InputProps [\r\n match props.EditMode with\r\n | ReadOnly -> ()\r\n | Edit edit ->\r\n OnKeyDown (ifEnter (fun _ -> props.Value |> not |> Some |> edit.OnChange))\r\n \r\n match props.EditMode with\r\n | Edit mode ->\r\n if mode.StopPropagation then\r\n OnClick(fun event -> event.stopPropagation ())\r\n | _ -> ()\r\n Style [\r\n match props.EditMode with\r\n | ReadOnly -> CSSProp.PointerEvents \"none\"\r\n | _ -> ()\r\n\r\n ]\r\n ]\r\n Checkradio.LabelProps [\r\n match props.EditMode with\r\n | Edit mode ->\r\n if mode.StopPropagation then\r\n OnClick(fun event -> event.stopPropagation ())\r\n | _ -> ()\r\n Style [\r\n match props.EditMode with\r\n | ReadOnly -> CSSProp.PointerEvents \"none\"\r\n | _ -> ()\r\n if props.Label.IsNone then\r\n PaddingLeft \"0\"\r\n ]\r\n ]\r\n match props.EditMode with\r\n | ReadOnly -> Checkradio.Disabled true\r\n | Edit edit ->\r\n Checkradio.OnChange(fun _ -> props.Value |> not |> Some |> edit.OnChange) ] [\r\n match props.Label with\r\n | None -> ()\r\n | Some label -> str label\r\n ]\r\n ]),\r\n withKey = fun props -> props.Key)\r\n","module PortalLibs.Client.Model\r\n\r\n\r\nopen System\r\n\r\n[]\r\ntype EditControlMode<'T> =\r\n { OnChange: 'T option -> unit\r\n StopPropagation: bool }\r\n\r\n interface IEquatable> with\r\n member this.Equals other =\r\n this.StopPropagation = other.StopPropagation\r\n && Object.ReferenceEquals(this.OnChange, other.OnChange)\r\n\r\n override this.Equals other =\r\n match other with\r\n | :? EditControlMode<'T> as ue -> (this :> IEquatable<_>).Equals ue\r\n | _ -> false\r\n\r\n override this.GetHashCode() = this.GetHashCode()\r\n\r\n\r\n\r\n\r\ntype ControlEditMode<'T> =\r\n | ReadOnly\r\n | Edit of EditControlMode<'T>\r\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Icon =\r\n\r\n type Option =\r\n // Sizes\r\n | Size of ISize\r\n /// Add `is-left` class\r\n | [] IsLeft\r\n /// Add `is-right` class\r\n | [] IsRight\r\n // Extra\r\n | CustomClass of string\r\n | Props of IHTMLProp list\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate \r\n let icon options children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n // Sizes\r\n | Size size -> ofSize size |> result.AddClass\r\n // Position\r\n | IsLeft\r\n | IsRight -> result.AddCaseName option\r\n // Extra\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"icon\").ToReactElement(span, children)\r\n\r\n module Text =\r\n\r\n let span (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"icon-text\").ToReactElement(span, children)\r\n\r\n let div (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"icon-text\").ToReactElement(div, children)\r\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Browser.Types\r\n\r\n[]\r\nmodule Button =\r\n\r\n type Option =\r\n // Colors\r\n | Color of IColor\r\n | Size of ISize\r\n /// Add `is-fullwidth` class\r\n | [] IsFullWidth\r\n /// Add `is-link` class\r\n | [] IsLink\r\n /// Add `is-outlined` class\r\n | [] IsOutlined\r\n /// Add `is-inverted` class\r\n | [] IsInverted\r\n /// Add `is-text` class\r\n | [] IsText\r\n /// Add `is-ghost` class\r\n | [] IsGhost\r\n /// Add `is-rounded` class\r\n | [] IsRounded\r\n /// Add `is-expanded` class\r\n | [] IsExpanded\r\n /// Add `is-hovered` class if true\r\n | [] IsHovered of bool\r\n /// Add `is-focused` class if true\r\n | [] IsFocused of bool\r\n /// Add `is-active` class if true\r\n | [] IsActive of bool\r\n /// Add `is-loading` class if true\r\n | [] IsLoading of bool\r\n /// Add `is-static` class if true\r\n | [] IsStatic of bool\r\n /// Add `is-light` class\r\n | [] IsLight\r\n /// Set `disabled` HTMLAttr\r\n | Disabled of bool\r\n | Props of IHTMLProp list\r\n | OnClick of (MouseEvent -> unit)\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n let internal btnView element (options : Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Color color -> ofColor color |> result.AddClass\r\n | Size size -> ofSize size |> result.AddClass\r\n // Styles\r\n | IsLink\r\n | IsFullWidth\r\n | IsOutlined\r\n | IsInverted\r\n | IsText\r\n | IsRounded\r\n | IsExpanded\r\n | IsGhost\r\n | IsLight -> result.AddCaseName option\r\n // States\r\n | IsHovered state\r\n | IsFocused state\r\n | IsActive state\r\n | IsLoading state\r\n | IsStatic state -> if state then result.AddCaseName option else result\r\n | Disabled isDisabled -> Fable.React.Props.Disabled isDisabled |> result.AddProp\r\n | OnClick cb -> DOMAttr.OnClick cb |> result.AddProp\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"button\").ToReactElement(element, children)\r\n\r\n /// Generate \r\n let button options children = btnView button options children\r\n /// Generate \r\n let span options children = btnView span options children\r\n /// Generate \r\n let a options children = btnView a options children\r\n\r\n module Input =\r\n let internal btnInput typ options =\r\n let hasProps =\r\n options\r\n |> List.exists (fun opts ->\r\n match opts with\r\n | Props _ -> true\r\n | _ -> false\r\n )\r\n\r\n if hasProps then\r\n let newOptions =\r\n options\r\n |> List.map (fun opts ->\r\n match opts with\r\n | Props props -> Props ((Type typ :> IHTMLProp) ::props)\r\n | forward -> forward\r\n )\r\n btnView (fun options _ -> input options) newOptions [ ]\r\n\r\n else\r\n btnView (fun options _ -> input options) ((Props [ Type typ ])::options) [ ]\r\n\r\n /// Generate \r\n let reset options = btnInput \"reset\" options\r\n /// Generate \r\n let submit options = btnInput \"submit\" options\r\n\r\n module List =\r\n\r\n type Option =\r\n /// Add `has-addons` class\r\n | [] HasAddons\r\n /// Add `is-centered` class\r\n | [] IsCentered\r\n | [] IsRight\r\n /// Add `are-small` class\r\n | [] AreSmall\r\n /// Add `are-medium` class\r\n | [] AreMedium\r\n /// Add `are-large` class\r\n | [] AreLarge\r\n // | Size of ISize\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate
\r\n let list (options : List.Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | List.HasAddons\r\n | List.IsCentered\r\n | List.IsRight\r\n | List.AreSmall\r\n | List.AreMedium\r\n | List.AreLarge -> result.AddCaseName option\r\n | List.Props props -> result.AddProps props\r\n | List.CustomClass customClass -> result.AddClass customClass\r\n | List.Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"buttons\").ToReactElement(div, children)\r\n","namespace Fulma.Extensions.Wikiki\n\nopen Fable.React.Props\n\n[]\nmodule Tooltip =\n\n let [] ClassName = \"tooltip\"\n let [] IsTooltipTop = \"has-tooltip-top\"\n let [] IsTooltipRight = \"has-tooltip-right\"\n let [] IsTooltipBottom = \"has-tooltip-bottom\"\n let [] IsTooltipLeft = \"has-tooltip-left\"\n let [] IsMultiline = \"has-tooltip-multiline\"\n let [] IsPrimary = \"has-tooltip-primary\"\n let [] IsInfo = \"has-tooltip-info\"\n let [] IsSuccess = \"has-tooltip-success\"\n let [] IsWarning = \"has-tooltip-warning\"\n let [] IsDanger = \"has-tooltip-danger\"\n let [] IsActive = \"has-tooltip-active\"\n\n let dataTooltip d = Data (\"tooltip\", d)\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Dropdown =\r\n\r\n type Option =\r\n /// Add `is-active` class if true\r\n | [] IsActive of bool\r\n /// Add `is-hoverable` class\r\n | [] IsHoverable\r\n /// Add `is-right` class\r\n | [] IsRight\r\n /// Add `is-up` class\r\n | [] IsUp\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate
\r\n let dropdown (options: Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | IsActive state -> if state then result.AddCaseName option else result\r\n | IsRight\r\n | IsHoverable\r\n | IsUp as opt -> result.AddCaseName option\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"dropdown\").ToReactElement(div, children)\r\n\r\n /// Generate
\r\n let menu (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"dropdown-menu\").ToReactElement(div, children)\r\n\r\n /// Generate
\r\n let content (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"dropdown-content\").ToReactElement(div, children)\r\n\r\n /// Generate
\r\n let divider (options: GenericOption list) =\r\n GenericOptions.Parse(options, parseOptions, \"dropdown-divider\").ToReactElement(hr)\r\n\r\n /// Generate
\r\n let trigger (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"dropdown-trigger\").ToReactElement(div, children)\r\n\r\n module Item =\r\n type Option =\r\n /// Add `is-active` class if true\r\n | [] IsActive of bool\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n let internal item element (options: Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | IsActive state -> if state then result.AddCaseName option else result\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"dropdown-item\").ToReactElement(element, children)\r\n\r\n /// Generate
\r\n let div x y = item div x y\r\n\r\n /// Generate \r\n let a x y = item a x y\r\n\r\n /// Generate \r\n let button x y = item button x y\r\n","module PortalLibs.Client.Components.ReactTransitionGroup\r\n\r\n\r\nopen Fable.Core.JsInterop\r\nopen Fable.ReactTransitionGroup\r\n\r\nimportSideEffects \"./AnimatedCreate.css\"\r\n\r\nlet AnimatedCreate =\r\n Feliz.React.memo (\r\n \"AnimatedCreate\",\r\n (fun (props: {| Key: string\r\n ContentOpt: Fable.React.ReactElement option |}) ->\r\n transitionGroup [ TransitionGroupProp.Key props.Key\r\n TransitionGroupProp.Component null\r\n TransitionGroupProp.Appear true\r\n TransitionGroupProp.Exit true ] [\r\n match props.ContentOpt with\r\n | None -> ()\r\n | Some item ->\r\n cssTransition\r\n [ CSSTransitionProp.Key \"1\"\r\n CSSTransitionProp.Timeout !^500\r\n CSSTransitionProp.ClassNames !^ \"animated-create\" ]\r\n item\r\n ]),\r\n (fun (props: {| Key: string\r\n ContentOpt: Fable.React.ReactElement option |}) -> $\"AnimatedCreate-%s{props.Key}\"),\r\n areEqual = Fable.React.Helpers.equalsButFunctions\r\n )\r\n","module Fable.ReactTransitionGroup\r\n\r\nopen Fable.Core\r\nopen Fable.Core.JsInterop\r\nopen Fable.React\r\nopen Browser.Types\r\n\r\ntype Timeout = {\r\n enter: int option\r\n exit: int option\r\n}\r\n\r\ntype [] TransitionStatus =\r\n | [] Entering\r\n | [] Entered\r\n | [] Exiting\r\n | [] Exited\r\n | [] Unmounted\r\n\r\n[]\r\ntype TransitionProp =\r\n /// Show the element; triggers the `enter` or `exit` states\r\n | In of bool\r\n /// Normally a element is not transitioned if it is shown when the `transition` element mounts.\r\n /// If you want to transition on the first mount set appear to true,\r\n /// and the element will transition in as soon as the `transition` mounts.\r\n | Appear of bool\r\n /// Enable or disable enter transitions.\r\n | Enter of bool\r\n /// Enable or disable exit transitions.\r\n | Exit of bool\r\n /// By default the child element is mounted immediately along with the parent `transition` element.\r\n /// If you want to \"lazy mount\" the element on the first `In true` you can set `MountOnEnter`.\r\n /// After the first enter transition the element will stay mounted, even on `exited`, unless you also specify `UnmountOnExit`.\r\n | MountOnEnter of bool\r\n /// By default the child element stays mounted after it reaches the `exited` state.\r\n /// Set `UnmountOnExit` if you'd prefer to unmount the element after it finishes exiting.\r\n | UnmountOnExit of bool\r\n /// The duration of the transition, in milliseconds. Required unless `AddEndListener` is provided\r\n | Timeout of U2\r\n /// Add a custom transition end trigger.\r\n /// Called with the transitioning DOM node and a done callback.\r\n /// Allows for more fine grained transition end logic.\r\n /// Note: Timeouts are still used as a fallback if provided.\r\n | AddEndListener of (HTMLElement -> (unit -> unit) -> unit)\r\n /// A transition callback fired immediately after the `enter` or `appear` class is applied.\r\n | OnEnter of (HTMLElement -> bool -> unit)\r\n /// A transition callback fired immediately after the `enter-active` or `appear-active` class is applied.\r\n | OnEntering of (HTMLElement -> bool -> unit)\r\n /// A transition callback fired immediately after the `enter` or `appear` classes are removed and the done class is added to the DOM node.\r\n | OnEntered of (HTMLElement -> bool -> unit)\r\n /// A transition callback fired immediately after the `exit` class is applied.\r\n | OnExit of (HTMLElement -> unit)\r\n /// A transition callback fired immediately after the `exit-active` is applied.\r\n | OnExiting of (HTMLElement -> unit)\r\n /// A transition callback fired immediately after the `exit` classes are removed and the exit-done class is added to the DOM node.\r\n | OnExited of (HTMLElement -> unit)\r\n /// A function child can be used instead of a React element.\r\n /// This function is called with the current transition status\r\n /// (`entering`, `entered`, `exiting`, `exited`, `unmounted`),\r\n /// which can be used to apply context specific props to a element.\r\n | Children of U2 ReactElement>\r\n | [] Class of string\r\n | Ref of (obj -> obj)\r\n | Key of string\r\n static member Custom(key: string, value: obj): TransitionProp =\r\n unbox(key, value)\r\n\r\ntype CSSTransitionClassNames = {\r\n appear: string option\r\n appearActive: string option\r\n enter: string option\r\n enterActive: string option\r\n enterDone: string option\r\n exit: string option\r\n exitActive: string option\r\n exitDone: string option\r\n}\r\n\r\n[]\r\ntype CSSTransitionProp =\r\n /// Show the element; triggers the `enter` or `exit` states\r\n | In of bool\r\n /// Normally a element is not transitioned if it is shown when the `transition` element mounts.\r\n /// If you want to transition on the first mount set appear to true,\r\n /// and the element will transition in as soon as the `transition` mounts.\r\n | Appear of bool\r\n /// Enable or disable enter transitions.\r\n | Enter of bool\r\n /// Enable or disable exit transitions.\r\n | Exit of bool\r\n /// By default the child element is mounted immediately along with the parent `transition` element.\r\n /// If you want to \"lazy mount\" the element on the first `In true` you can set `MountOnEnter`.\r\n /// After the first enter transition the element will stay mounted, even on `exited`, unless you also specify `UnmountOnExit`.\r\n | MountOnEnter of bool\r\n /// By default the child element stays mounted after it reaches the `exited` state.\r\n /// Set `UnmountOnExit` if you'd prefer to unmount the element after it finishes exiting.\r\n | UnmountOnExit of bool\r\n /// The duration of the transition, in milliseconds. Required unless `AddEndListener` is provided\r\n | Timeout of U2\r\n /// Add a custom transition end trigger.\r\n /// Called with the transitioning DOM node and a done callback.\r\n /// Allows for more fine grained transition end logic.\r\n /// Note: Timeouts are still used as a fallback if provided.\r\n | AddEndListener of (HTMLElement -> (unit -> unit) -> unit)\r\n /// A transition callback fired immediately after the `enter` or `appear` class is applied.\r\n | OnEnter of (HTMLElement -> bool -> unit)\r\n /// A transition callback fired immediately after the `enter-active` or `appear-active` class is applied.\r\n | OnEntering of (HTMLElement -> bool -> unit)\r\n /// A transition callback fired immediately after the `enter` or `appear` classes are removed and the done class is added to the DOM node.\r\n | OnEntered of (HTMLElement -> bool -> unit)\r\n /// A transition callback fired immediately after the `exit` class is applied.\r\n | OnExit of (HTMLElement -> unit)\r\n /// A transition callback fired immediately after the `exit-active` is applied.\r\n | OnExiting of (HTMLElement -> unit)\r\n /// A transition callback fired immediately after the `exit` classes are removed and the exit-done class is added to the DOM node.\r\n | OnExited of (HTMLElement -> unit)\r\n /// A function child can be used instead of a React element.\r\n /// This function is called with the current transition status\r\n /// (`entering`, `entered`, `exiting`, `exited`, `unmounted`),\r\n /// which can be used to apply context specific props to a element.\r\n | Children of U2 ReactElement>\r\n /// The animation ClassNames applied to the element as it enters or exits.\r\n /// A single name can be provided and it will be suffixed for each stage: e.g.\r\n ///\r\n /// `classNames=\"fade\"` applies `fade-enter`, `fade-enter-active`,\r\n /// `fade-exit`, `fade-exit-active`, `fade-appear`, and `fade-appear-active`.\r\n /// Each individual classNames can also be specified independently.\r\n | ClassNames of U2\r\n | [] Class of string\r\n | Ref of (obj -> obj)\r\n | Key of string\r\n static member Custom(key: string, value: obj): CSSTransitionProp =\r\n unbox(key, value)\r\n\r\n[]\r\ntype TransitionGroupProp =\r\n /// `transitionGroup` renders a
by default.\r\n /// You can change this behavior by providing a component prop.\r\n /// If you use React v16+ and would like to avoid a wrapping
element you can pass in `Component null`.\r\n /// This is useful if the wrapping div borks your css styles.\r\n | Component of ReactElement\r\n /// A convenience prop that enables or disables appear animations for all children.\r\n /// Note that specifying this will override any defaults set on individual children Transitions.\r\n | Appear of bool\r\n /// A convenience prop that enables or disables enter animations for all children.\r\n /// Note that specifying this will override any defaults set on individual children Transitions.\r\n | Enter of bool\r\n /// A convenience prop that enables or disables exit animations for all children.\r\n /// Note that specifying this will override any defaults set on individual children Transitions.\r\n | Exit of bool\r\n /// You may need to apply reactive updates to a child as it is exiting.\r\n /// This is generally done by using cloneElement however in the case of an\r\n /// exiting child the element has already been removed and not accessible to the consumer.\r\n | ChildFactory of (ReactElement -> ReactElement)\r\n | [] Class of string\r\n | Ref of (obj -> obj)\r\n | Key of string\r\n static member Custom(key: string, value: obj): TransitionGroupProp =\r\n unbox(key, value)\r\n\r\n/// The transition element lets you describe a transition from one element\r\n/// state to another _over time_ with a simple declarative API. Most commonly\r\n/// It's used to animate the mounting and unmounting of Component, but can also\r\n/// be used to describe in-place transition states as well.\r\n///\r\n/// By default the `transition` element does not alter the behavior of the\r\n/// element it renders, it only tracks Enter and Exit states for the elements.\r\n/// It's up to you to give meaning and effect to those states. For example we can\r\n/// add styles to a element when it enters or exits.\r\nlet transition (props: TransitionProp list) (child: ReactElement): ReactElement =\r\n let props = (TransitionProp.Children !^child)::props\r\n ofImport \"Transition\" \"react-transition-group\" (keyValueList CaseRules.LowerFirst props) []\r\n\r\n/// The transition element lets you describe a transition from one component\r\n/// state to another _over time_ with a simple declarative API. Most commonly\r\n/// It's used to animate the mounting and unmounting of Component, but can also\r\n/// be used to describe in-place transition states as well.\r\n///\r\n/// By default the `transition` element does not alter the behavior of the\r\n/// element it renders, it only tracks Enter and Exit states for the elements.\r\n/// It's up to you to give meaning and effect to those states. For example we can\r\n/// add styles to a element when it enters or exits.\r\nlet transitionWithRender (props: TransitionProp list) (render: TransitionStatus -> ReactElement): ReactElement =\r\n let props = (TransitionProp.Children !^render)::props\r\n ofImport \"Transition\" \"react-transition-group\" (keyValueList CaseRules.LowerFirst props) []\r\n\r\n/// A transition element using CSS transitions and animations.\r\n/// See `transition` for more information.\r\nlet cssTransition (props: CSSTransitionProp list) (child: ReactElement): ReactElement =\r\n let props = (CSSTransitionProp.Children !^child)::props\r\n ofImport \"CSSTransition\" \"react-transition-group\" (keyValueList CaseRules.LowerFirst props) []\r\n\r\n/// A transition element using CSS transitions and animations.\r\n/// See `transitionWithRender` for more information.\r\nlet cssTransitionWithRender (props: CSSTransitionProp list) (render: TransitionStatus -> ReactElement): ReactElement =\r\n let props = (CSSTransitionProp.Children !^render)::props\r\n ofImport \"CSSTransition\" \"react-transition-group\" (keyValueList CaseRules.LowerFirst props) []\r\n\r\n/// The `transitionGroup` element manages a set of `transition` elements\r\n/// in a list. Like with the `transition` element, `transitionGroup`, is a\r\n/// state machine for managing the mounting and unmounting of elements over\r\n/// time.\r\nlet transitionGroup (props: TransitionGroupProp list) (children: ReactElement list): ReactElement =\r\n ofImport \"TransitionGroup\" \"react-transition-group\" (keyValueList CaseRules.LowerFirst props) children\r\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Heading =\r\n\r\n type Option =\r\n /// Add `is-1` class\r\n | []Is1\r\n /// Add `is-2` class\r\n | []Is2\r\n /// Add `is-3` class\r\n | []Is3\r\n /// Add `is-4` class\r\n | []Is4\r\n /// Add `is-5` class\r\n | []Is5\r\n /// Add `is-6` class\r\n | []Is6\r\n /// Add `subtitle` class\r\n | []IsSubtitle\r\n /// Add `is-spaced` class\r\n | []IsSpaced\r\n // Extra\r\n | CustomClass of string\r\n | Props of IHTMLProp list\r\n | Modifiers of Modifier.IModifier list\r\n\r\n let internal title (element : IHTMLProp list -> ReactElement list -> ReactElement) (options : Option list)\r\n (children) =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n // Sizes\r\n | Is1\r\n | Is2\r\n | Is3\r\n | Is4\r\n | Is5\r\n | Is6\r\n | IsSpaced -> result.AddCaseName option\r\n // Styles\r\n | IsSubtitle ->\r\n result.RemoveClass(\"title\").AddClass(\"subtitle\")\r\n // Extra\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, baseClass=\"title\").ToReactElement(element, children)\r\n\r\n // Alias\r\n /// Generate

\r\n /// Class can be `subtitle` if you pass `Heading.IsSubtitle`\r\n let h1 (options : Option list) = title h1 (Is1 :: options)\r\n /// Generate

\r\n /// Class can be `subtitle` if you pass `Heading.IsSubtitle`\r\n let h2 (options : Option list) = title h2 (Is2 :: options)\r\n /// Generate

\r\n /// Class can be `subtitle` if you pass `Heading.IsSubtitle`\r\n let h3 (options : Option list) = title h3 (Is3 :: options)\r\n /// Generate

\r\n /// Class can be `subtitle` if you pass `Heading.IsSubtitle`\r\n let h4 (options : Option list) = title h4 (Is4 :: options)\r\n /// Generate
\r\n /// Class can be `subtitle` if you pass `Heading.IsSubtitle`\r\n let h5 (options : Option list) = title h5 (Is5 :: options)\r\n /// Generate
\r\n /// Class can be `subtitle` if you pass `Heading.IsSubtitle`\r\n let h6 (options : Option list) = title h6 (Is6 :: options)\r\n /// Generate

\r\n /// Class can be `subtitle` if you pass `Heading.IsSubtitle`\r\n let p opts children = title p opts children\r\n","module PortalLibs.Client.Components.NewTableNext\r\n\r\n\r\n\r\nopen FSharpPlus\r\nopen Elmish\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Fulma\r\nopen Fulma.Extensions.Wikiki\r\nopen Fable.Core.JsInterop\r\nopen System\r\nopen Fable.FontAwesome\r\nopen Feliz\r\nopen PortalLibs.Client.Model\r\nopen PortalLibs.Shared.NewTable\r\nopen PortalLibs.Client.Util\r\nopen Feliz.MaterialUI\r\nopen PortalLibs.Shared\r\nopen PortalLibs.Client.Components.Checkradio\r\n\r\n\r\ntype Page = int\r\n\r\ntype PageSize = int\r\n\r\ntype ValueType<'Item> =\r\n | Text of ('Item -> string)\r\n | Custom of ('Item -> ReactElement)\r\n | CustomAligned of ('Item -> ReactElement)\r\n\r\ntype Alignment =\r\n | Center\r\n | Left\r\n | Right\r\n\r\ntype SelectionConfig<'SelectionAction> =\r\n { Icon: Fa.IconOption\r\n Tooltip: string\r\n SelectionActionType: 'SelectionAction }\r\n\r\n\r\ntype Selection<'Item, 'SelectionAction when 'Item: comparison> =\r\n | Active of SelectionConfig<'SelectionAction> * Map<'Item, unit>\r\n | Executing of SelectionConfig<'SelectionAction> * Map<'Item, unit>\r\n\r\nmodule Selection =\r\n let getItems =\r\n function\r\n | Active (_, items) -> items\r\n | Executing (_, items) -> items\r\n\r\n let toActive =\r\n function\r\n | Active (config, items) -> Active(config, items)\r\n | Executing (config, items) -> Active(config, items)\r\n\r\ntype Footer<'Id> =\r\n | Text of string\r\n | Custom of ReactElement\r\n | Total of (float -> string)\r\n\r\ntype ColumnSort<'Item> =\r\n | NotSortable\r\n | ValueOrExternal\r\n | InMemory of ('Item -> string)\r\n\r\ntype HeaderType<'Item> =\r\n | Text of string\r\n | StyledText of string * CSSProp list\r\n | CheckboxLabel of string * ('Item -> bool) * ('Item list * bool -> unit)\r\n\r\nmodule HeaderType =\r\n let noDecoration str =\r\n StyledText(str, [ TextDecoration \"none\" ])\r\n\r\ntype Column<'Item, 'Id> =\r\n { Header: HeaderType<'Item>\r\n Align: Alignment\r\n Value: ValueType<'Item>\r\n Id: 'Id\r\n Sortable: ColumnSort<'Item>\r\n Draggable: bool\r\n InitiallyVisible: bool\r\n MinWidth: int option\r\n Footer: Footer<'Id> option }\r\n\r\ntype Model<'Item, 'Id, 'SelectionAction when 'Item: comparison and 'Id: comparison> =\r\n { Page: Page\r\n PageSize: PageSize\r\n Sort: Sort<'Id> option\r\n TotalItems: int64\r\n IsLoading: bool\r\n Selection: Selection<'Item, 'SelectionAction> option\r\n ColumnOrder: ('Id * bool) list\r\n ColumnMoving: 'Id option\r\n HoveringOver: int option\r\n Totals: Map<'Id, float>\r\n Key: string }\r\n\r\ntype ExternalMsg<'Item, 'Id, 'SelectionAction> =\r\n | NoOp\r\n | ExecuteSelection of 'SelectionAction * 'Item list\r\n | ColumnsChanged of ('Id * bool) list\r\n | PagingOrSortChanged\r\n\r\n\r\ntype Msg<'Item, 'Id, 'SelectionAction> =\r\n | PagingOrSortChanged of Page * PageSize * Sort<'Id> option\r\n | SelectionActive of SelectionConfig<'SelectionAction> option\r\n | ToggleItemSelection of 'Item\r\n | SelectItems of 'Item list\r\n | DeselectAll\r\n | ConfirmSelection\r\n | ColumnMove of 'Id\r\n | CancelMove\r\n | ColumnDrop of int * Column<'Item, 'Id> list\r\n | ColumnVisibility of 'Id * Column<'Item, 'Id> list\r\n | HoveringOver of int option\r\n\r\ntype Paged =\r\n { HidePaginationUnder1Page: bool\r\n PageSizeOptions: int [] option }\r\n\r\ntype Paging =\r\n | Paged of Paged\r\n | NotPaged\r\n\r\ntype DataLoad =\r\n | OnDemand\r\n | InMemory\r\n\r\ntype Config<'Item, 'Id, 'SelectionAction when 'Item: comparison and 'Id: comparison> =\r\n { Model: Model<'Item, 'Id, 'SelectionAction>\r\n Columns: Column<'Item, 'Id> list\r\n ColumnSelection: bool\r\n Items: 'Item list\r\n ItemKey: 'Item -> string\r\n SubRows: ('Item -> ReactElement list) option\r\n Selection: SelectionConfig<'SelectionAction> list * bool\r\n Paging: Paging\r\n Dispatch: Msg<'Item, 'Id, 'SelectionAction> -> unit\r\n RowClick: ('Item -> unit) option\r\n DataLoad: DataLoad\r\n StickyHeader: {| ZIndex: int |} option\r\n Key: string }\r\n\r\nlet init columnsOpt =\r\n { Page = 0\r\n PageSize = 25\r\n Sort = None\r\n TotalItems = -1L\r\n IsLoading = false\r\n Selection = None\r\n ColumnOrder = columnsOpt |> Option.defaultValue []\r\n ColumnMoving = None\r\n HoveringOver = None\r\n Totals = Map.empty\r\n Key = Guid.NewGuid().ToString() }\r\n\r\nlet resetModel model =\r\n { model with\r\n Page = 0\r\n TotalItems = -1L\r\n Selection = None }\r\n\r\nlet update<'Item, 'Id, 'SelectionAction when 'Item: comparison and 'Id: equality and 'Id: comparison>\r\n (msg: Msg<'Item, 'Id, 'SelectionAction>)\r\n (model: Model<'Item, 'Id, 'SelectionAction>)\r\n : Model<'Item, 'Id, 'SelectionAction> * Cmd> * ExternalMsg<'Item, 'Id, 'SelectionAction> =\r\n match msg with\r\n | PagingOrSortChanged (page, pageSize, sort: Sort<'Id> option) ->\r\n if page <> model.Page then\r\n scrollIntoView $\"sv-table-%s{model.Key}\"\r\n\r\n\r\n { model with\r\n Page = if sort <> model.Sort then 0 else page\r\n PageSize = pageSize\r\n Sort = sort\r\n IsLoading = true\r\n Selection = None },\r\n Cmd.none,\r\n ExternalMsg.PagingOrSortChanged\r\n | SelectionActive selection ->\r\n { model with\r\n Selection =\r\n selection\r\n |>> (fun selection -> Active(selection, Map.empty)) },\r\n Cmd.none,\r\n NoOp\r\n | ToggleItemSelection item ->\r\n { model with\r\n Selection =\r\n model.Selection\r\n |>> (fun selection ->\r\n match selection with\r\n | Executing _ -> selection\r\n | Active (selection, items) ->\r\n let newItems =\r\n if Map.containsKey item items then\r\n Map.remove item items\r\n else\r\n Map.add item () items\r\n\r\n Active(selection, newItems)) },\r\n Cmd.none,\r\n NoOp\r\n | SelectItems items ->\r\n { model with\r\n Selection =\r\n model.Selection\r\n |>> (fun selection ->\r\n match selection with\r\n | Executing _ -> selection\r\n | Active (selection, _) ->\r\n let newItems =\r\n items\r\n |>> (fun item -> item, ())\r\n |> Map.ofList\r\n\r\n Active(selection, newItems)) },\r\n Cmd.none,\r\n NoOp\r\n | DeselectAll ->\r\n { model with\r\n Selection =\r\n model.Selection\r\n |>> (fun selection ->\r\n match selection with\r\n | Executing _ -> selection\r\n | Active (selection, _) -> Active(selection, Map.empty)) },\r\n Cmd.none,\r\n NoOp\r\n | ConfirmSelection ->\r\n { model with\r\n Selection =\r\n model.Selection\r\n |>> (fun selection ->\r\n match selection with\r\n | Executing _ -> selection\r\n | Active (selection, items) -> Executing(selection, items)) },\r\n Cmd.none,\r\n (match model.Selection with\r\n | Some selection ->\r\n match selection with\r\n | Executing _ -> NoOp\r\n | Active (selectionType, items) ->\r\n ExecuteSelection(selectionType.SelectionActionType, (items |> Map.toKeyList))\r\n | None -> NoOp)\r\n | ColumnMove id' -> { model with ColumnMoving = Some id' }, Cmd.none, NoOp\r\n | HoveringOver id' ->\r\n { model with HoveringOver = model.ColumnMoving >>= (fun _ -> id') }, Cmd.none, NoOp\r\n | CancelMove ->\r\n { model with\r\n ColumnMoving = None\r\n HoveringOver = None },\r\n Cmd.none,\r\n NoOp\r\n | ColumnDrop (idx, cols) ->\r\n let newModel =\r\n match model.ColumnMoving with\r\n | Some droppedCol ->\r\n let previousOrder =\r\n if model.ColumnOrder.IsEmpty then\r\n cols\r\n |>> (fun col -> col.Id, col.InitiallyVisible)\r\n else\r\n model.ColumnOrder\r\n\r\n let newOrder =\r\n let newOrderTemp =\r\n previousOrder\r\n |> mapi (fun i (colId, visible) ->\r\n [ if i = idx then droppedCol, true\r\n if colId <> droppedCol then\r\n colId, visible ])\r\n |> List.concat\r\n\r\n if idx = previousOrder.Length then\r\n List.append newOrderTemp [ droppedCol, true ]\r\n else\r\n newOrderTemp\r\n\r\n { model with\r\n ColumnMoving = None\r\n HoveringOver = None\r\n ColumnOrder = newOrder }\r\n | None -> model\r\n\r\n newModel, Cmd.none, ColumnsChanged newModel.ColumnOrder\r\n | ColumnVisibility (id, cols) ->\r\n let previousOrder =\r\n if model.ColumnOrder.IsEmpty then\r\n cols\r\n |>> (fun col -> col.Id, col.InitiallyVisible)\r\n else if model.ColumnOrder\r\n |> List.exists (fun (colId, _) -> id = colId) then\r\n model.ColumnOrder\r\n else\r\n (id, false) :: model.ColumnOrder\r\n\r\n let newModel =\r\n { model with\r\n ColumnOrder =\r\n previousOrder\r\n |>> (fun (colId, vis) ->\r\n if colId = id then\r\n colId, not vis\r\n else\r\n colId, vis) }\r\n\r\n newModel, Cmd.none, ColumnsChanged newModel.ColumnOrder\r\n\r\n\r\n\r\n\r\nlet NewTableCheckboxCell =\r\n React.memo (\r\n \"NewTableCheckboxCell\",\r\n (fun (props: {| Key: string\r\n EditMode: ControlEditMode\r\n Label: string option\r\n Value: bool |}) ->\r\n CheckboxComp\r\n {| Key = $\"%s{props.Key}-CheckBoxComp\"\r\n EditMode = props.EditMode\r\n Label = props.Label\r\n Value = props.Value |}),\r\n (fun (props: {| Key: string\r\n EditMode: ControlEditMode\r\n Label: string option\r\n Value: bool |}) -> props.Key),\r\n areEqual = Helpers.equalsButFunctions\r\n )\r\n\r\n\r\nlet isSelectionActive selectionOpt =\r\n match selectionOpt with\r\n | None -> false\r\n | Some selection ->\r\n match selection with\r\n | Active _ -> true\r\n | Executing _ -> false\r\n\r\nlet isSelectionExecuting selectionOpt =\r\n match selectionOpt with\r\n | None -> false\r\n | Some selection ->\r\n match selection with\r\n | Active _ -> false\r\n | Executing _ -> true\r\n\r\nlet sortColumns config =\r\n if config.Model.ColumnOrder.IsEmpty then\r\n config.Columns\r\n |>> (fun col -> col, col.InitiallyVisible)\r\n else\r\n config.Model.ColumnOrder\r\n |> List.choose (fun (id, visible) ->\r\n config.Columns\r\n |> List.tryFind (fun col -> col.Id = id)\r\n |>> (fun col -> col, visible))\r\n\r\nlet private dropTargetCol idx config =\r\n th [ OnDragOver(fun ev -> ev.preventDefault ())\r\n OnDragEnter(fun _ -> HoveringOver(Some idx) |> config.Dispatch)\r\n OnDragLeave(fun _ -> HoveringOver None |> config.Dispatch)\r\n OnDrop(fun _ -> ColumnDrop(idx, config.Columns) |> config.Dispatch)\r\n Style [\r\n BackgroundColor(\r\n if config.Model.HoveringOver.IsSome\r\n && (config.Model.HoveringOver |> Option.defaultValue 0) = idx then\r\n \"green\"\r\n else\r\n \"lightgray\"\r\n )\r\n ] ] []\r\n\r\n\r\nlet headerControl column items =\r\n match column.Header with\r\n | Text header -> span [] [ header |> str ]\r\n | StyledText (header, cssProps) ->\r\n span [ Style cssProps ] [\r\n header |> str\r\n ]\r\n | CheckboxLabel (header, getVal, onCheck) ->\r\n let allUnchecked =\r\n items |> List.forall (getVal >> not)\r\n\r\n Html.div [\r\n prop.style [\r\n style.display.flex\r\n style.alignItems.stretch\r\n ]\r\n prop.children [\r\n NewTableCheckboxCell\r\n {| Key = $\"NewTableCheckboxHeader-%s{column.Id.ToString()}\"\r\n EditMode =\r\n ControlEditMode.Edit\r\n { OnChange =\r\n (fun checked' ->\r\n (items\r\n |> List.filter (fun item ->\r\n checked' |> Option.defaultValue false\r\n <> getVal item),\r\n checked' |> Option.defaultValue false)\r\n |> onCheck)\r\n StopPropagation = true }\r\n Label = None\r\n Value = not allUnchecked |}\r\n Html.span [\r\n prop.style [ style.marginLeft 15 ]\r\n prop.text header\r\n ]\r\n ]\r\n ]\r\n\r\nlet private header column items config =\r\n th [ Draggable column.Draggable\r\n OnDragEnd(fun _ -> CancelMove |> config.Dispatch)\r\n OnDragStart (fun ev ->\r\n ev.dataTransfer.setData (\"text/plain\", \"dummy\")\r\n |> ignore\r\n\r\n ColumnMove column.Id |> config.Dispatch)\r\n //OnDragOver (fun ev -> ev.preventDefault(); )\r\n //OnDrop (fun _ -> CancelMove |> config.Dispatch)\r\n Style [\r\n TextAlign(\r\n match column.Align with\r\n | Center -> TextAlignOptions.Center\r\n | Left -> TextAlignOptions.Left\r\n | Right -> TextAlignOptions.Right\r\n )\r\n VerticalAlign \"middle\"\r\n match column.MinWidth with\r\n | Some width -> Width $\"%i{width}px\"\r\n | None -> ()\r\n ] ] [\r\n match column.Sortable with\r\n | NotSortable -> headerControl column items\r\n | _ ->\r\n let customStyles =\r\n match column.Header with\r\n | StyledText (_, cssProps) -> cssProps\r\n | _ -> []\r\n\r\n a [ Style(Color \"black\" :: customStyles)\r\n OnClick (fun _ ->\r\n let sort =\r\n match config.Model.Sort with\r\n | None -> Some(Asc column.Id)\r\n | Some sort ->\r\n match sort with\r\n | Asc id ->\r\n if id = column.Id then\r\n Some(Desc column.Id)\r\n else\r\n Some(Asc column.Id)\r\n | Desc id ->\r\n if id = column.Id then\r\n None\r\n else\r\n Some(Asc column.Id)\r\n\r\n (config.Model.Page, config.Model.PageSize, sort)\r\n |> PagingOrSortChanged\r\n |> config.Dispatch) ] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent(\r\n match column.Align with\r\n | Center -> \"center\"\r\n | Left -> \"flex-start\"\r\n | Right -> \"flex-end\"\r\n )\r\n AlignItems AlignItemsOptions.Center\r\n ] ] [\r\n headerControl column items\r\n match config.Model.Sort with\r\n | None -> nothing\r\n | Some sort ->\r\n let sortDiv content =\r\n div [ Style [\r\n MarginLeft \"5px\"\r\n Color \"#3273dc\"\r\n ] ] [\r\n content\r\n ]\r\n\r\n match sort with\r\n | Asc id ->\r\n if id = column.Id then\r\n sortDiv (\r\n Icon.icon [ Icon.Size ISize.IsSmall ] [\r\n Fa.i [ Fa.Solid.ChevronDown ] []\r\n ]\r\n )\r\n | Desc id ->\r\n if id = column.Id then\r\n sortDiv (\r\n Icon.icon [ Icon.Size ISize.IsSmall ] [\r\n Fa.i [ Fa.Solid.ChevronUp ] []\r\n ]\r\n )\r\n ]\r\n ]\r\n ]\r\n\r\n\r\nlet private RowGeneric<'Item, 'Id, 'SelectionAction when 'Item: comparison and 'Id: equality> =\r\n React.memo (\r\n \"NewTableRow\",\r\n (fun (props: {| Item: 'Item\r\n SubRows: bool\r\n SortedColumns: (Column<'Item, 'Id> * bool) list\r\n Selection: Selection<'Item, 'SelectionAction> option\r\n Dispatch: Msg<'Item, 'Id, 'SelectionAction> -> unit\r\n ColumnMoving: 'Id option\r\n RowClick: ('Item -> unit) option\r\n Key: string |}) ->\r\n let dropDestCol =\r\n td [ Style [ BorderBottom \"0\" ] ] []\r\n\r\n tr [ HTMLAttr.Id props.Key\r\n TabIndex 0\r\n match props.RowClick with\r\n | None -> ()\r\n | Some click ->\r\n OnClick(fun _ -> click props.Item)\r\n\r\n OnKeyDown(\r\n ifEnter (fun e ->\r\n e.stopPropagation ()\r\n click props.Item)\r\n )\r\n\r\n Style [ Cursor \"pointer\" ] ] [\r\n match props.Selection with\r\n | None -> nothing\r\n | Some selection ->\r\n let isSelected =\r\n Selection.getItems selection\r\n |> Map.containsKey props.Item\r\n\r\n td [ Style [\r\n VerticalAlign \"middle\"\r\n if props.SubRows then BorderBottom \"0\"\r\n ] ] [\r\n NewTableCheckboxCell\r\n {| Key = $\"NewTableSelectionCheckbox-%s{props.Key}\"\r\n EditMode =\r\n match selection with\r\n | Active _ ->\r\n ControlEditMode.Edit\r\n { OnChange = (fun _ -> ToggleItemSelection props.Item |> props.Dispatch)\r\n StopPropagation = true }\r\n | Executing _ -> ControlEditMode.ReadOnly\r\n Label = None\r\n Value = isSelected |}\r\n ]\r\n\r\n yield!\r\n (props.SortedColumns\r\n |> mapi (fun i (column, visible) ->\r\n [ match props.ColumnMoving with\r\n | Some movingCol ->\r\n if i = 0 && movingCol <> column.Id then\r\n dropDestCol\r\n | None -> ()\r\n if visible then\r\n td [ Style [\r\n VerticalAlign \"middle\"\r\n if props.SubRows then BorderBottom \"0\"\r\n match column.Value with\r\n | ValueType.Custom _ -> Padding \"0\"\r\n | _ -> ()\r\n ] ] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n AlignItems AlignItemsOptions.Center\r\n match column.Value with\r\n | ValueType.Text _\r\n | CustomAligned _ ->\r\n JustifyContent(\r\n match column.Align with\r\n | Center -> \"center\"\r\n | Left -> \"flex-start\"\r\n | Right -> \"flex-end\"\r\n )\r\n | _ -> ()\r\n ] ] [\r\n match column.Value with\r\n | ValueType.Text strValue -> strValue props.Item |> str\r\n | ValueType.Custom custom -> custom props.Item\r\n | ValueType.CustomAligned custom ->\r\n\r\n custom props.Item\r\n ]\r\n ]\r\n\r\n match props.ColumnMoving with\r\n | Some movingCol ->\r\n if movingCol <> column.Id\r\n && (i + 1 >= props.SortedColumns.Length\r\n || (fst (props.SortedColumns.Item(i + 1))).Id\r\n <> movingCol) then\r\n dropDestCol\r\n | None -> () ])\r\n |> List.concat)\r\n ]),\r\n (fun (props: {| Item: 'Item\r\n SubRows: bool\r\n SortedColumns: (Column<'Item, 'Id> * bool) list\r\n Selection: Selection<'Item, 'SelectionAction> option\r\n Dispatch: Msg<'Item, 'Id, 'SelectionAction> -> unit\r\n ColumnMoving: 'Id option\r\n RowClick: ('Item -> unit) option\r\n Key: string |}) -> props.Key),\r\n areEqual = Helpers.equalsButFunctions\r\n )\r\n\r\n\r\nlet selectionButton config dispatch =\r\n Button.button [ Button.OnClick(fun _ -> SelectionActive(Some config) |> dispatch)\r\n Button.Props [\r\n Style [\r\n Width \"25px\"\r\n Height \"30px\"\r\n Padding \"0 0 0 1px\"\r\n MarginRight \"5px\"\r\n ]\r\n Tooltip.dataTooltip config.Tooltip\r\n ]\r\n Button.CustomClass Tooltip.ClassName ] [\r\n Icon.icon [ Icon.Size ISize.IsSmall ] [\r\n Fa.i [ config.Icon ] []\r\n ]\r\n ]\r\n\r\n\r\nlet ColumnSelectionGeneric<'Item, 'Id, 'SelectionAction when 'Item: comparison and 'Id: comparison> =\r\n React.memo (\r\n \"ColumnSelection\",\r\n (fun (props: {| ColumnSelection: bool\r\n Columns: Column<'Item, 'Id> list\r\n ActiveColumns: ('Id * bool) list\r\n Dispatch: Msg<'Item, 'Id, 'SelectionAction> -> unit |}) ->\r\n if props.ColumnSelection then\r\n Dropdown.dropdown [ Dropdown.IsHoverable\r\n Dropdown.IsRight ] [\r\n Dropdown.trigger [] [\r\n Button.button [ Button.Props [\r\n Style [ Width \"25px\"; Height \"30px\" ]\r\n ] ] [\r\n Icon.icon [ Icon.Size IsSmall ] [\r\n Fa.i [ Fa.Solid.Bars ] []\r\n ]\r\n ]\r\n ]\r\n Dropdown.menu [] [\r\n Dropdown.content\r\n []\r\n (props.Columns\r\n |>> (fun column ->\r\n Dropdown.Item.a [ Dropdown.Item.Props [\r\n OnClick (fun e ->\r\n e.preventDefault ()\r\n\r\n ColumnVisibility(column.Id, props.Columns)\r\n |> props.Dispatch)\r\n ] ] [\r\n Checkradio.checkbox [ Checkradio.Id(Guid.NewGuid().ToString())\r\n Checkradio.Checked(\r\n props.ActiveColumns\r\n |> List.tryFind (fun (id, _) -> column.Id = id)\r\n |>> snd\r\n |> Option.defaultValue false\r\n )\r\n Checkradio.OnChange ignore ] [\r\n str (\r\n match column.Header with\r\n | Text string -> string\r\n | StyledText (string, _) -> string\r\n | CheckboxLabel (string, _, _) -> string\r\n )\r\n ]\r\n ]))\r\n ]\r\n ]\r\n else\r\n nothing),\r\n areEqual = Helpers.equalsButFunctions\r\n )\r\n\r\n\r\nlet pageSize (config: Paged) pageSize =\r\n config.PageSizeOptions\r\n >>= (fun pageSizeOptions ->\r\n if Array.contains pageSize pageSizeOptions then\r\n Some pageSize\r\n else\r\n Array.tryHead pageSizeOptions)\r\n |> Option.defaultValue pageSize\r\n\r\n\r\nlet pagination config totalItems =\r\n\r\n let shouldShowPagination paginationConfig =\r\n paginationConfig.HidePaginationUnder1Page\r\n && totalItems > (int64 config.Model.PageSize)\r\n || not paginationConfig.HidePaginationUnder1Page\r\n\r\n match config.Paging with\r\n | Paged paginationConfig when shouldShowPagination paginationConfig ->\r\n let pageSize =\r\n pageSize paginationConfig config.Model.PageSize\r\n\r\n Mui.tablePagination [\r\n tablePagination.component' \"div\"\r\n\r\n tablePagination.count (int totalItems)\r\n\r\n if totalItems = -1L then\r\n tablePagination.labelDisplayedRows (fun args -> $\"%i{args.from} - %i{args.from + pageSize}\" |> str)\r\n\r\n tablePagination.page config.Model.Page\r\n\r\n tablePagination.rowsPerPage pageSize\r\n\r\n let availablePageSizes =\r\n match paginationConfig.PageSizeOptions with\r\n | Some availablePageSizes -> [| yield! availablePageSizes |]\r\n | None -> [| pageSize |]\r\n\r\n tablePagination.rowsPerPageOptions availablePageSizes\r\n\r\n tablePagination.onChangePage (fun _ page ->\r\n (page, pageSize, config.Model.Sort)\r\n |> PagingOrSortChanged\r\n |> config.Dispatch)\r\n\r\n tablePagination.onChangeRowsPerPage (fun pageSize ->\r\n (config.Model.Page, !!pageSize?target?value, config.Model.Sort)\r\n |> PagingOrSortChanged\r\n |> config.Dispatch)\r\n ]\r\n | _ -> nothing\r\n\r\nlet sortItems sortOpt columns items =\r\n match sortOpt with\r\n | None -> items\r\n | Some sort ->\r\n let colId =\r\n match sort with\r\n | Asc id -> id\r\n | Desc id -> id\r\n\r\n let columnOpt =\r\n columns\r\n |> List.tryFind (fun column -> column.Id = colId)\r\n\r\n match columnOpt with\r\n | None -> items\r\n | Some column ->\r\n let sortFun item =\r\n match column.Sortable with\r\n | NotSortable -> \"\"\r\n | ValueOrExternal ->\r\n match column.Value with\r\n | ValueType.Text strVal -> strVal item\r\n | ValueType.Custom _\r\n | ValueType.CustomAligned _ -> \"\"\r\n | ColumnSort.InMemory sortVal -> sortVal item\r\n\r\n match sortOpt with\r\n | None -> items\r\n | Some sort ->\r\n match sort with\r\n | Asc _ -> items |> List.sortBy sortFun\r\n | Desc _ -> items |> List.sortByDescending sortFun\r\n\r\n\r\nlet NewTableNextGeneric<'Item, 'Id, 'SelectionAction when 'Item: comparison and 'Id: comparison> =\r\n let ColumnSelectionSpecific =\r\n ColumnSelectionGeneric<'Item, 'Id, 'SelectionAction>\r\n\r\n let RowSpecific =\r\n RowGeneric<'Item, 'Id, 'SelectionAction>\r\n\r\n Feliz.React.memo (\r\n \"NewTableNext\",\r\n (fun (props: {| Config: Config<'Item, 'Id, 'SelectionAction> |}) ->\r\n let anythingSelected =\r\n props.Config.Model.Selection\r\n |>> (fun sel ->\r\n match sel with\r\n | Active (_, items) -> not items.IsEmpty\r\n | _ -> false)\r\n |> Option.defaultValue false\r\n\r\n let sortedColumns = sortColumns props.Config\r\n\r\n div [ Style [\r\n Position PositionOptions.Relative\r\n ] ] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"space-between\"\r\n ] ] [\r\n div [ Style [\r\n PaddingBottom \"3px\"\r\n Display DisplayOptions.Flex\r\n AlignItems AlignItemsOptions.Center\r\n ] ] [\r\n let selectionList, selectionActive =\r\n props.Config.Selection\r\n\r\n if not selectionList.IsEmpty then\r\n\r\n match props.Config.Model.Selection with\r\n | None ->\r\n if selectionActive then\r\n yield!\r\n selectionList\r\n |>> (fun selectionConfig -> selectionButton selectionConfig props.Config.Dispatch)\r\n else\r\n loadingWithMessageHoriz \"Loading data...\"\r\n\r\n\r\n | Some selection ->\r\n match selection with\r\n | Active _ ->\r\n Button.button [ Button.Disabled(not anythingSelected)\r\n Button.OnClick(fun _ -> ConfirmSelection |> props.Config.Dispatch)\r\n Button.Props [\r\n Style [\r\n Width \"25px\"\r\n Height \"30px\"\r\n Padding \"0\"\r\n Color \"green\"\r\n ]\r\n ] ] [\r\n Icon.icon [ Icon.Size ISize.IsSmall ] [\r\n Fa.i [ Fa.Solid.Check ] []\r\n ]\r\n ]\r\n\r\n Button.button [ Button.OnClick(fun _ -> SelectionActive None |> props.Config.Dispatch)\r\n Button.Props [\r\n Style [\r\n Width \"25px\"\r\n Height \"30px\"\r\n Padding \"0\"\r\n MarginLeft \"3px\"\r\n ]\r\n ] ] [\r\n Icon.icon [ Icon.Size ISize.IsSmall ] [\r\n Fa.i [ Fa.Solid.Times ] []\r\n ]\r\n ]\r\n | Executing _ -> loadingWithMessageHoriz \"Executing...\"\r\n\r\n let config =\r\n match selection with\r\n | Active (selection, _) -> selection\r\n | Executing (selection, _) -> selection\r\n\r\n div [ Style [\r\n Width \"25px\"\r\n Height \"30px\"\r\n Padding \"3px 5px\"\r\n BorderLeft \"1px solid black\"\r\n MarginLeft \"5px\"\r\n ] ] [\r\n Icon.icon [ Icon.Size ISize.IsSmall\r\n Icon.Props [\r\n Tooltip.dataTooltip config.Tooltip\r\n ]\r\n Icon.CustomClass Tooltip.ClassName ] [\r\n Fa.i [ config.Icon ] []\r\n ]\r\n ]\r\n ]\r\n div [] [\r\n ColumnSelectionSpecific\r\n {| ColumnSelection = props.Config.ColumnSelection\r\n Columns = props.Config.Columns\r\n ActiveColumns =\r\n if props.Config.Model.ColumnOrder.IsEmpty then\r\n props.Config.Columns\r\n |>> (fun col -> col.Id, col.InitiallyVisible)\r\n else\r\n props.Config.Model.ColumnOrder\r\n Dispatch = props.Config.Dispatch |}\r\n ]\r\n ]\r\n Standard.table [ Id $\"sv-table-%s{props.Config.Model.Key}\"\r\n ClassName \"table is-striped is-hoverable\"\r\n Style [\r\n if props.Config.StickyHeader.IsSome then BorderCollapse \"Separate\"\r\n Width \"100%\"\r\n MarginBottom \"5px\"\r\n if props.Config.DataLoad = DataLoad.OnDemand\r\n && props.Config.Model.IsLoading then\r\n Filter \"blur(2px)\"\r\n ] ] [\r\n thead [] [\r\n Html.tr [\r\n prop.style [\r\n match props.Config.StickyHeader with\r\n | Some v -> yield! [style.position.sticky; style.top 0; style.zIndex v.ZIndex; style.backgroundColor.white]\r\n | None -> ()\r\n ]\r\n prop.children [\r\n match props.Config.Model.Selection with\r\n | None -> nothing\r\n | Some selection ->\r\n let items = Selection.getItems selection\r\n\r\n let allSelected =\r\n props.Config.Items\r\n |> List.forall (fun item -> Map.containsKey item items)\r\n\r\n th [ Style [ VerticalAlign \"middle\" ] ] [\r\n NewTableCheckboxCell\r\n {| Key = \"NewTableSelectionCheckboxHeader\"\r\n EditMode =\r\n match selection with\r\n | Active _ ->\r\n ControlEditMode.Edit\r\n { OnChange =\r\n (fun _ ->\r\n (if allSelected then\r\n DeselectAll\r\n else\r\n SelectItems props.Config.Items)\r\n |> props.Config.Dispatch)\r\n StopPropagation = false }\r\n | Executing _ -> ControlEditMode.ReadOnly\r\n Label = None\r\n Value = allSelected |}\r\n ]\r\n\r\n\r\n yield!\r\n (sortedColumns\r\n |> mapi (fun i (column, visible) ->\r\n [ match props.Config.Model.ColumnMoving with\r\n | Some movingCol ->\r\n if i = 0 && movingCol <> column.Id then\r\n dropTargetCol i props.Config\r\n | None -> ()\r\n if visible then\r\n header column props.Config.Items props.Config\r\n\r\n match props.Config.Model.ColumnMoving with\r\n | Some movingCol ->\r\n if movingCol <> column.Id\r\n && (i + 1 >= sortedColumns.Length\r\n || (fst (sortedColumns.Item(i + 1))).Id\r\n <> movingCol) then\r\n dropTargetCol (i + 1) props.Config\r\n | None -> () ])\r\n |> List.concat)\r\n ]\r\n ]\r\n ]\r\n tbody\r\n []\r\n (if props.Config.Items.IsEmpty\r\n && props.Config.Model.IsLoading then\r\n [ tr [ Style [ Height \"75px\" ] ] [] ]\r\n else\r\n (props.Config.Items\r\n |> fun items ->\r\n (match props.Config.DataLoad with\r\n | OnDemand -> items\r\n | InMemory ->\r\n sortItems props.Config.Model.Sort props.Config.Columns items\r\n |> fun items ->\r\n match props.Config.Paging with\r\n | NotPaged -> items\r\n | Paged pagingConfig ->\r\n let pageSize =\r\n pageSize pagingConfig props.Config.Model.PageSize\r\n\r\n items\r\n |> List.skip (pageSize * props.Config.Model.Page)\r\n |> List.truncate pageSize)\r\n |> List.collect (fun item ->\r\n let subRows =\r\n props.Config.SubRows\r\n |>> (fun subRows -> subRows item)\r\n |> Option.defaultValue []\r\n |> mapi (fun i reactElement ->\r\n ReactTransitionGroup.AnimatedCreate\r\n {| Key =\r\n $\"NewTableAnimatedExpand-%s{props.Config.Key}-Row-%s{props.Config.ItemKey item}-%i{i}\"\r\n ContentOpt = Some reactElement |})\r\n\r\n [ RowSpecific(\r\n {| Item = item\r\n SubRows = not subRows.IsEmpty\r\n SortedColumns = sortedColumns\r\n Selection = props.Config.Model.Selection\r\n Dispatch = props.Config.Dispatch\r\n ColumnMoving = props.Config.Model.ColumnMoving\r\n RowClick = props.Config.RowClick\r\n Key = $\"NewTable-%s{props.Config.Key}-Row-%s{props.Config.ItemKey item}\" |}\r\n )\r\n yield! subRows ])))\r\n if props.Config.Columns\r\n |> List.exists (fun col -> Option.isSome col.Footer) then\r\n tfoot [] [\r\n tr\r\n []\r\n (sortedColumns\r\n |>> (fun (column, visible) ->\r\n if visible then\r\n td [ Style [ VerticalAlign \"middle\" ] ] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"flex-end\"\r\n ] ] [\r\n span [] [\r\n strong [] [\r\n match column.Footer with\r\n | None -> nothing\r\n | Some footer ->\r\n match footer with\r\n | Footer.Text str' -> str str'\r\n | Custom elem -> elem\r\n | Total totalView ->\r\n match props.Config.Model.Totals |> Map.tryFind column.Id with\r\n | None ->\r\n Icon.icon [ Icon.Props [\r\n Style [ Color \"gray\"; MarginTop \"-1px\" ]\r\n ] ] [\r\n Fa.i [ Fa.Solid.Spinner; Fa.Pulse ] []\r\n ]\r\n | Some total -> str (totalView total)\r\n ]\r\n ]\r\n ]\r\n ]\r\n else\r\n nothing))\r\n ]\r\n ]\r\n pagination\r\n props.Config\r\n (match props.Config.DataLoad with\r\n | OnDemand -> props.Config.Model.TotalItems\r\n | InMemory -> props.Config.Items.Length |> int64)\r\n\r\n\r\n if props.Config.DataLoad = DataLoad.OnDemand\r\n && props.Config.Model.IsLoading then\r\n div [ Style [\r\n Position PositionOptions.Absolute\r\n Top \"0\"\r\n CSSProp.Left \"0\"\r\n Width \"100%\"\r\n Height \"calc(100% - 50px)\"\r\n ] ] [\r\n Heading.h6 [ Heading.Option.Props [\r\n Style [\r\n Position PositionOptions.Absolute\r\n Top \"42%\"\r\n CSSProp.Left \"48%\"\r\n ]\r\n ] ] [\r\n loadingWithMessage \"Loading...\"\r\n ]\r\n ]\r\n ]),\r\n (fun (props: {| Config: Config<'Item, 'Id, 'SelectionAction> |}) -> props.Config.Key),\r\n areEqual = Helpers.equalsButFunctions\r\n )\r\n","namespace FSharpPlus\n\n/// Additional operations on List\n[]\nmodule List =\n\n open System\n open FSharp.Core.CompilerServices\n\n /// Returns a list that contains one item only.\n ///\n /// The input item.\n ///\n /// The result list of one item.\n ///\n /// \n /// \n /// List.singleton 7\n /// \n /// Evaluates to [ 7 ].\n /// \n /// \n /// Note: this function has since been added to FSharp.Core.\n /// It will be removed in next major release of FSharpPlus.\n /// \n let singleton value = [value] : list<'T>\n\n /// Adds an element to the beginning of the given list\n /// The element to add\n /// The list to add to\n /// A concatenated list of the result lists of applying each function to each value\n /// \n /// Note: this function has since been added to FSharp.Core.\n /// It will be removed in next major release of FSharpPlus.\n /// \n let cons value list = value :: list : list<'T>\n\n /// Applies a list of functions to a list of values and concatenates them\n /// The list of functions.\n /// The list of values.\n /// A concatenated list of the result lists of applying each function to each value\n /// \n /// \n /// \n /// > List.apply [double; triple] [1; 2; 3];; \n /// val it : int list = [2; 4; 6; 3; 6; 9]\n /// \n /// \n let apply (f: list<'T -> 'U>) (x: list<'T>) : list<'U> =\n #if FABLE_COMPILER || NET45\n List.collect (fun f -> List.map ((<|) f) x) f\n #else\n let mutable coll = ListCollector<'U> ()\n f |> List.iter (fun f ->\n x |> List.iter (fun x ->\n coll.Add (f x)))\n coll.Close ()\n #endif\n\n /// Combines all values from the first list with the second, using the supplied mapping function.\n let lift2 (f: 'T1 -> 'T2 -> 'U) (x1: list<'T1>) (x2: list<'T2>) =\n #if FABLE_COMPILER || NET45\n List.allPairs x1 x2 |> List.map (fun (x, y) -> f x y)\n #else\n let mutable coll = ListCollector<'U> ()\n x1 |> List.iter (fun x1 ->\n x2 |> List.iter (fun x2 ->\n coll.Add (f x1 x2)))\n coll.Close ()\n #endif\n \n /// Combines values from three list and calls a mapping function on this combination.\n /// Mapping function taking three element combination as input.\n /// First list.\n /// Second list.\n /// Third list.\n ///\n /// List with values returned from mapping function.\n let lift3 f x1 x2 x3 =\n #if !FABLE_COMPILER || FABLE_COMPILER_3 || NET45\n List.allPairs x2 x3\n |> List.allPairs x1\n |> List.map (fun x -> (fst (snd x), snd (snd x), fst x))\n |> List.map (fun (x, y, z) -> f x y z)\n #else\n let mutable coll = ListCollector<'U> ()\n x1 |> List.iter (fun x1 ->\n x2 |> List.iter (fun x2 ->\n x3 |> List.iter (fun x3 ->\n coll.Add (f x1 x2 x3))))\n coll.Close ()\n #endif\n\n /// Returns a list with all possible tails of the source list.\n let tails list = let rec loop = function [] -> [] | _::xs as s -> s::(loop xs) in loop list : list>\n\n\n /// Returns the first N elements of the list.\n /// Throws InvalidOperationException\n /// if the count exceeds the number of elements in the list. List.truncate\n /// returns as many items as the list contains instead of throwing an exception.\n ///\n /// The number of items to take.\n /// The input list.\n ///\n /// The result list.\n ///\n /// Thrown when the input list is empty.\n /// Thrown when count exceeds the number of elements\n /// in the list.\n ///\n /// \n /// \n /// let inputs = [\"a\"; \"b\"; \"c\"; \"d\"]\n ///\n /// inputs |> List.take 2\n /// \n /// Evaluates to [\"a\"; \"b\"]\n /// \n ///\n /// \n /// \n /// let inputs = [\"a\"; \"b\"; \"c\"; \"d\"]\n ///\n /// inputs |> List.take 6\n /// \n /// Throws InvalidOperationException.\n /// \n ///\n /// \n /// \n /// let inputs = [\"a\"; \"b\"; \"c\"; \"d\"]\n ///\n /// inputs |> List.take 0\n /// \n /// Evaluates to the empty list.\n /// \n /// \n /// Note: this function has since been added to FSharp.Core.\n /// It will be removed in next major release of FSharpPlus.\n /// \n let take count list = FSharp.Collections.List.take<'T> count list\n\n /// Returns the list after removing the first N elements.\n ///\n /// The number of elements to skip. If the number is 0 or negative the input list is returned.\n /// The input list.\n ///\n /// The list after removing the first N elements.\n ///\n /// Thrown when count exceeds the number of \n /// elements in the list.\n ///\n /// \n /// \n /// let inputs = [\"a\"; \"b\"; \"c\"; \"d\"]\n ///\n /// inputs |> List.skip 2\n /// \n /// Evaluates to [\"c\"; \"d\"]\n /// \n ///\n /// \n /// \n /// let inputs = [\"a\"; \"b\"; \"c\"; \"d\"]\n ///\n /// inputs |> List.skip 5\n /// \n /// Throws ArgumentException.\n /// \n ///\n /// \n /// \n /// let inputs = [\"a\"; \"b\"; \"c\"; \"d\"]\n ///\n /// inputs |> List.skip -1\n /// \n /// Evaluates to [\"a\"; \"b\"; \"c\"; \"d\"].\n /// \n /// \n /// Note: this function has since been added to FSharp.Core.\n /// It will be removed in next major release of FSharpPlus.\n /// \n let skip count list = FSharp.Collections.List.skip<'T> count list\n\n\n /// Returns a list that drops N elements of the original list and then yields the\n /// remaining elements of the list.\n /// When count exceeds the number of elements in the list it\n /// returns an empty list instead of throwing an exception.\n /// The number of items to drop.\n /// The input list.\n ///\n /// The result list.\n let drop<'T> count source =\n let rec loop i lst = \n match lst, i with\n | [] as x, _ | x, 0 -> x\n | x, n -> loop (n-1) (List.tail<'T> x)\n if count > 0 then loop count source else source\n\n /// Concatenates all elements, using the specified separator between each element.\n let intercalate (separator: list<'T>) (source: seq>) =\n #if FABLE_COMPILER || NET45\n source |> Seq.intercalate separator |> Seq.toList\n #else\n let mutable coll = new ListCollector<'T> ()\n let mutable notFirst = false\n source |> Seq.iter (fun element ->\n if notFirst then coll.AddMany separator\n coll.AddMany element\n notFirst <- true)\n coll.Close ()\n #endif\n\n /// Inserts a separator element between each element in the source list.\n let intersperse separator (source: list<'T>) =\n #if FABLE_COMPILER || NET45\n source |> List.toSeq |> Seq.intersperse separator |> Seq.toList\n #else\n let mutable coll = new ListCollector<'T> ()\n let mutable notFirst = false\n source |> List.iter (fun element ->\n if notFirst then coll.Add separator\n coll.Add element\n notFirst <- true)\n coll.Close ()\n #endif\n\n /// Creates a sequence of lists by splitting the source list on any of the given separators.\n let split (separators: seq>) (source: list<_>) = source |> List.toSeq |> Seq.split separators |> Seq.map Seq.toList\n\n /// Replaces a subsequence of the source list with the given replacement list.\n let replace oldValue (newValue: _ list) (source: _ list) = source |> List.toSeq |> Seq.replace oldValue newValue |> Seq.toList : list<'T>\n\n /// Converts a list to an IReadOnlyList (from System.Collections.Generic).\n /// The list source\n /// The list converted to a System.Collections.Generic.IReadOnlyList\n let toIReadOnlyList (source: _ list) =\n { new System.Collections.Generic.IReadOnlyList<_> with\n member _.Count = source.Length\n member _.Item with get index = source.[index]\n member _.GetEnumerator () = (source :> _ seq).GetEnumerator ()\n member _.GetEnumerator () = (source :> System.Collections.IEnumerable).GetEnumerator () }\n\n #if !FABLE_COMPILER || FABLE_COMPILER_3\n\n /// \n /// Gets the index of the first occurrence of the specified slice in the source.\n /// \n /// \n /// Thrown when the slice was not found in the sequence.\n /// \n /// \n /// The index of the slice.\n /// \n let findSliceIndex (slice: _ list) (source: _ list) =\n let index = Internals.FindSliceIndex.listImpl slice source\n if index = -1 then\n ArgumentException(\"The specified slice was not found in the sequence.\") |> raise\n else\n index\n\n /// \n /// Gets the index of the first occurrence of the specified slice in the source.\n /// Returns None if not found.\n /// \n /// \n /// The index of the slice or None.\n /// \n let tryFindSliceIndex (slice: _ list) (source: _ list) =\n let index = Internals.FindSliceIndex.listImpl slice source\n if index = -1 then None else Some index\n #endif\n\n /// \n /// Creates two lists by applying the mapping function to each element in the list\n /// and classifying the transformed values depending on whether they were wrapped with Choice1Of2 or Choice2Of2.\n /// \n /// \n /// A tuple with both resulting lists.\n /// \n let partitionMap (mapping: 'T -> Choice<'T1, 'T2>) (source: list<'T>) =\n #if FABLE_COMPILER || NET45\n let rec loop ((acc1, acc2) as acc) = function\n | [] -> acc\n | x::xs ->\n match mapping x with\n | Choice1Of2 x -> loop (x::acc1, acc2) xs\n | Choice2Of2 x -> loop (acc1, x::acc2) xs\n loop ([], []) (List.rev source)\n #else\n let mutable coll1 = new ListCollector<'T1> ()\n let mutable coll2 = new ListCollector<'T2> ()\n List.iter (mapping >> function Choice1Of2 e -> coll1.Add e | Choice2Of2 e -> coll2.Add e) source\n coll1.Close (), coll2.Close ()\n #endif\n\n /// Safely build a new list whose elements are the results of applying the given function\n /// to each of the elements of the two lists pairwise.\n /// Mapping function.\n /// First input list.\n /// Second input list.\n /// List with corresponding results of applying the mapping function pairwise over both input lists elments.\n /// If one list is shorter, excess elements are discarded from the right end of the longer list.\n let map2Shortest mapping (list1: list<'T1>) (list2: list<'T2>) : list<'U> =\n #if FABLE_COMPILER || NET45\n let rec loop acc = function\n | (l::ls, r::rs) -> loop ((mapping l r)::acc) (ls, rs)\n | (_, _) -> acc\n loop [] (list1, list2) |> List.rev\n #else\n let mutable coll = new ListCollector<'U> ()\n let rec loop = function\n | ([], _) | (_, []) -> coll.Close ()\n | (l::ls, r::rs) ->\n coll.Add (mapping l r)\n loop (ls, rs)\n loop (list1, list2)\n #endif\n \n /// \n /// Zip safely two lists. If one list is shorter, excess elements are discarded from the right end of the longer list. \n /// \n /// First input list.\n /// Second input list.\n /// List with corresponding pairs of input lists.\n let zipShortest (list1: list<'T1>) (list2: list<'T2>) : list<'T1 * 'T2> =\n #if FABLE_COMPILER || NET45\n let rec loop acc = function\n | (l::ls, r::rs) -> loop ((l, r)::acc) (ls, rs)\n | (_, _) -> acc\n loop [] (list1, list2) |> List.rev\n #else\n let mutable coll = new ListCollector<'T1 * 'T2> ()\n let rec loop = function\n | ([], _) | (_, []) -> coll.Close ()\n | (l::ls,r::rs) ->\n coll.Add (l, r)\n loop (ls,rs)\n loop (list1, list2)\n #endif\n \n /// Same as choose but with access to the index.\n /// The mapping function, taking index and element as parameters.\n /// The input list.\n ///\n /// List with values x for each List value where the function returns Some(x).\n let choosei mapping source =\n let mutable i = ref -1\n let fi x =\n i.Value <- i.Value + 1\n mapping i.Value x\n List.choose fi source\n \n /// Attempts to remove an item from a list.\n /// The index of the item to remove \n /// The input list\n /// \n /// For invalid indexes, the input list. Otherwise, a new list with the item removed.\n /// Use List.removeAt from FSharp.Core if you want to throw exceptions when using invalid indexes.\n let deleteAt i lst =\n if List.length lst > i then\n lst.[0..i-1] @ lst.[i+1..]\n else lst\n\n []\n let removeAt i lst = deleteAt i lst\n\n /// Updates the value of an item in a list\n /// The index of the item to update\n /// The new value of the item\n /// The input list\n ///\n /// A new list with the updated element\n /// Use List.updateAt from FSharp.Core if you want to throw exceptions when using invalid indexes.\n let setAt i x lst =\n if List.length lst > i && i >= 0 then\n lst.[0..i-1] @ x::lst.[i+1..]\n else lst\n","namespace Feliz.MaterialUI\n\n(*////////////////////////////////\n/// THIS FILE IS AUTO-GENERATED //\n////////////////////////////////*)\n\nopen System.ComponentModel\nopen Fable.Core\nopen Fable.Core.JsInterop\nopen Fable.React\nopen Feliz\n\n[]\nmodule MuiHelpers =\n\n let reactElement (el: ReactElementType) (props: 'a) : ReactElement =\n import \"createElement\" \"react\"\n\n let reactElementTag (tag: string) (props: 'a) : ReactElement =\n import \"createElement\" \"react\"\n\n let createElement (el: ReactElementType) (properties: IReactProperty seq) : ReactElement =\n reactElement el (!!properties |> Object.fromFlatEntries)\n\n let createElementTag (tag: string) (properties: IReactProperty seq) : ReactElement =\n reactElementTag tag (!!properties |> Object.fromFlatEntries)\n\n[]\ntype Mui =\n\n static member inline themeProvider props = createElement (import \"ThemeProvider\" \"@material-ui/core/styles\") props\n\n /// This component allows you to change the behavior of the styling solution. It makes the options available down the React tree thanks to the context.\n ///\n /// It should preferably be used at **the root of your component tree**.\n static member inline stylesProvider props = createElement (import \"StylesProvider\" \"@material-ui/core/styles\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n ///\n /// Required props:\n /// - `children`\n static member inline accordion props = createElement (importDefault \"@material-ui/core/Accordion\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n ///\n /// Required props:\n /// - `children`\n static member inline accordion (children: #seq) = createElement (importDefault \"@material-ui/core/Accordion\") [ Feliz.MaterialUI.accordion.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline accordionActions props = createElement (importDefault \"@material-ui/core/AccordionActions\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline accordionActions (children: #seq) = createElement (importDefault \"@material-ui/core/AccordionActions\") [ Feliz.MaterialUI.accordionActions.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline accordionDetails props = createElement (importDefault \"@material-ui/core/AccordionDetails\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline accordionDetails (children: #seq) = createElement (importDefault \"@material-ui/core/AccordionDetails\") [ Feliz.MaterialUI.accordionDetails.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline accordionSummary props = createElement (importDefault \"@material-ui/core/AccordionSummary\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline accordionSummary (children: #seq) = createElement (importDefault \"@material-ui/core/AccordionSummary\") [ Feliz.MaterialUI.accordionSummary.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n static member inline alert props = createElement (importDefault \"@material-ui/lab/Alert\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n static member inline alert (children: #seq) = createElement (importDefault \"@material-ui/lab/Alert\") [ Feliz.MaterialUI.alert.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline alertTitle props = createElement (importDefault \"@material-ui/lab/AlertTitle\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline alertTitle (children: #seq) = createElement (importDefault \"@material-ui/lab/AlertTitle\") [ Feliz.MaterialUI.alertTitle.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n static member inline appBar props = createElement (importDefault \"@material-ui/core/AppBar\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n static member inline appBar (children: #seq) = createElement (importDefault \"@material-ui/core/AppBar\") [ Feliz.MaterialUI.appBar.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `options`\n /// - `renderInput`\n static member inline autocomplete props = createElement (importDefault \"@material-ui/lab/Autocomplete\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline avatar props = createElement (importDefault \"@material-ui/core/Avatar\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline avatar (children: #seq) = createElement (importDefault \"@material-ui/core/Avatar\") [ Feliz.MaterialUI.avatar.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline avatarGroup props = createElement (importDefault \"@material-ui/lab/AvatarGroup\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline avatarGroup (children: #seq) = createElement (importDefault \"@material-ui/lab/AvatarGroup\") [ Feliz.MaterialUI.avatarGroup.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Fade](https://material-ui.com/api/fade/)).\n ///\n /// Required props:\n /// - `open'`\n static member inline backdrop props = createElement (importDefault \"@material-ui/core/Backdrop\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Fade](https://material-ui.com/api/fade/)).\n ///\n /// Required props:\n /// - `open'`\n static member inline backdrop (children: #seq) = createElement (importDefault \"@material-ui/core/Backdrop\") [ Feliz.MaterialUI.backdrop.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline badge props = createElement (importDefault \"@material-ui/core/Badge\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline badge (children: #seq) = createElement (importDefault \"@material-ui/core/Badge\") [ Feliz.MaterialUI.badge.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline bottomNavigation props = createElement (importDefault \"@material-ui/core/BottomNavigation\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline bottomNavigation (children: #seq) = createElement (importDefault \"@material-ui/core/BottomNavigation\") [ Feliz.MaterialUI.bottomNavigation.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline bottomNavigationAction props = createElement (importDefault \"@material-ui/core/BottomNavigationAction\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline breadcrumbs props = createElement (importDefault \"@material-ui/core/Breadcrumbs\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline breadcrumbs (children: #seq) = createElement (importDefault \"@material-ui/core/Breadcrumbs\") [ Feliz.MaterialUI.breadcrumbs.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline button props = createElement (importDefault \"@material-ui/core/Button\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline button (children: #seq) = createElement (importDefault \"@material-ui/core/Button\") [ Feliz.MaterialUI.button.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline buttonBase props = createElement (importDefault \"@material-ui/core/ButtonBase\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline buttonBase (children: #seq) = createElement (importDefault \"@material-ui/core/ButtonBase\") [ Feliz.MaterialUI.buttonBase.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline buttonGroup props = createElement (importDefault \"@material-ui/core/ButtonGroup\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline buttonGroup (children: #seq) = createElement (importDefault \"@material-ui/core/ButtonGroup\") [ Feliz.MaterialUI.buttonGroup.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n static member inline card props = createElement (importDefault \"@material-ui/core/Card\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n static member inline card (children: #seq) = createElement (importDefault \"@material-ui/core/Card\") [ Feliz.MaterialUI.card.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline cardActionArea props = createElement (importDefault \"@material-ui/core/CardActionArea\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline cardActionArea (children: #seq) = createElement (importDefault \"@material-ui/core/CardActionArea\") [ Feliz.MaterialUI.cardActionArea.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline cardActions props = createElement (importDefault \"@material-ui/core/CardActions\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline cardActions (children: #seq) = createElement (importDefault \"@material-ui/core/CardActions\") [ Feliz.MaterialUI.cardActions.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline cardContent props = createElement (importDefault \"@material-ui/core/CardContent\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline cardContent (children: #seq) = createElement (importDefault \"@material-ui/core/CardContent\") [ Feliz.MaterialUI.cardContent.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline cardHeader props = createElement (importDefault \"@material-ui/core/CardHeader\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline cardMedia props = createElement (importDefault \"@material-ui/core/CardMedia\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline cardMedia (children: #seq) = createElement (importDefault \"@material-ui/core/CardMedia\") [ Feliz.MaterialUI.cardMedia.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([IconButton](https://material-ui.com/api/icon-button/)).\n static member inline checkbox props = createElement (importDefault \"@material-ui/core/Checkbox\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline chip props = createElement (importDefault \"@material-ui/core/Chip\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline circularProgress props = createElement (importDefault \"@material-ui/core/CircularProgress\") props\n\n /// The component cannot hold a ref.\n ///\n /// Required props:\n /// - `children`\n /// - `onClickAway`\n static member inline clickAwayListener props = createElement (importDefault \"@material-ui/core/ClickAwayListener\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Transition](https://reactcommunity.org/react-transition-group/transition/#Transition-props)).\n static member inline collapse props = createElement (importDefault \"@material-ui/core/Collapse\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Transition](https://reactcommunity.org/react-transition-group/transition/#Transition-props)).\n static member inline collapse (children: #seq) = createElement (importDefault \"@material-ui/core/Collapse\") [ Feliz.MaterialUI.collapse.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline container props = createElement (importDefault \"@material-ui/core/Container\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline container (children: #seq) = createElement (importDefault \"@material-ui/core/Container\") [ Feliz.MaterialUI.container.children (children :> ReactElement seq) ]\n\n /// The component cannot hold a ref.\n static member inline cssBaseline props = createElement (importDefault \"@material-ui/core/CssBaseline\") props\n\n /// The component cannot hold a ref.\n static member inline cssBaseline (children: #seq) = createElement (importDefault \"@material-ui/core/CssBaseline\") [ Feliz.MaterialUI.cssBaseline.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Modal](https://material-ui.com/api/modal/)).\n ///\n /// Required props:\n /// - `open'`\n static member inline dialog props = createElement (importDefault \"@material-ui/core/Dialog\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Modal](https://material-ui.com/api/modal/)).\n ///\n /// Required props:\n /// - `open'`\n static member inline dialog (children: #seq) = createElement (importDefault \"@material-ui/core/Dialog\") [ Feliz.MaterialUI.dialog.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline dialogActions props = createElement (importDefault \"@material-ui/core/DialogActions\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline dialogActions (children: #seq) = createElement (importDefault \"@material-ui/core/DialogActions\") [ Feliz.MaterialUI.dialogActions.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline dialogContent props = createElement (importDefault \"@material-ui/core/DialogContent\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline dialogContent (children: #seq) = createElement (importDefault \"@material-ui/core/DialogContent\") [ Feliz.MaterialUI.dialogContent.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Typography](https://material-ui.com/api/typography/)).\n static member inline dialogContentText props = createElement (importDefault \"@material-ui/core/DialogContentText\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Typography](https://material-ui.com/api/typography/)).\n static member inline dialogContentText (text: string) = createElement (importDefault \"@material-ui/core/DialogContentText\") [ prop.children (Html.text text) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Typography](https://material-ui.com/api/typography/)).\n static member inline dialogContentText (children: #seq) = createElement (importDefault \"@material-ui/core/DialogContentText\") [ Feliz.MaterialUI.dialogContentText.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline dialogTitle props = createElement (importDefault \"@material-ui/core/DialogTitle\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline dialogTitle (text: string) = createElement (importDefault \"@material-ui/core/DialogTitle\") [ prop.children (Html.text text) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline dialogTitle (children: #seq) = createElement (importDefault \"@material-ui/core/DialogTitle\") [ Feliz.MaterialUI.dialogTitle.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline divider props = createElement (importDefault \"@material-ui/core/Divider\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline drawer props = createElement (importDefault \"@material-ui/core/Drawer\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline drawer (children: #seq) = createElement (importDefault \"@material-ui/core/Drawer\") [ Feliz.MaterialUI.drawer.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n ///\n /// Required props:\n /// - `children`\n static member inline expansionPanel props = createElement (importDefault \"@material-ui/core/ExpansionPanel\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n ///\n /// Required props:\n /// - `children`\n static member inline expansionPanel (children: #seq) = createElement (importDefault \"@material-ui/core/ExpansionPanel\") [ Feliz.MaterialUI.expansionPanel.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline expansionPanelActions props = createElement (importDefault \"@material-ui/core/ExpansionPanelActions\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline expansionPanelActions (children: #seq) = createElement (importDefault \"@material-ui/core/ExpansionPanelActions\") [ Feliz.MaterialUI.expansionPanelActions.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline expansionPanelDetails props = createElement (importDefault \"@material-ui/core/ExpansionPanelDetails\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline expansionPanelDetails (children: #seq) = createElement (importDefault \"@material-ui/core/ExpansionPanelDetails\") [ Feliz.MaterialUI.expansionPanelDetails.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline expansionPanelSummary props = createElement (importDefault \"@material-ui/core/ExpansionPanelSummary\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline expansionPanelSummary (children: #seq) = createElement (importDefault \"@material-ui/core/ExpansionPanelSummary\") [ Feliz.MaterialUI.expansionPanelSummary.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n ///\n /// Required props:\n /// - `children`\n static member inline fab props = createElement (importDefault \"@material-ui/core/Fab\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n ///\n /// Required props:\n /// - `children`\n static member inline fab (children: #seq) = createElement (importDefault \"@material-ui/core/Fab\") [ Feliz.MaterialUI.fab.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Transition](https://reactcommunity.org/react-transition-group/transition/#Transition-props)).\n static member inline fade props = createElement (importDefault \"@material-ui/core/Fade\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([InputBase](https://material-ui.com/api/input-base/)).\n static member inline filledInput props = createElement (importDefault \"@material-ui/core/FilledInput\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline formControl props = createElement (importDefault \"@material-ui/core/FormControl\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline formControl (children: #seq) = createElement (importDefault \"@material-ui/core/FormControl\") [ Feliz.MaterialUI.formControl.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `control`\n static member inline formControlLabel props = createElement (importDefault \"@material-ui/core/FormControlLabel\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline formGroup props = createElement (importDefault \"@material-ui/core/FormGroup\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline formGroup (children: #seq) = createElement (importDefault \"@material-ui/core/FormGroup\") [ Feliz.MaterialUI.formGroup.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline formHelperText props = createElement (importDefault \"@material-ui/core/FormHelperText\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline formHelperText (text: string) = createElement (importDefault \"@material-ui/core/FormHelperText\") [ prop.children (Html.text text) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline formHelperText (children: #seq) = createElement (importDefault \"@material-ui/core/FormHelperText\") [ Feliz.MaterialUI.formHelperText.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline formLabel props = createElement (importDefault \"@material-ui/core/FormLabel\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline formLabel (text: string) = createElement (importDefault \"@material-ui/core/FormLabel\") [ prop.children (Html.text text) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline formLabel (children: #seq) = createElement (importDefault \"@material-ui/core/FormLabel\") [ Feliz.MaterialUI.formLabel.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline grid props = createElement (importDefault \"@material-ui/core/Grid\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline grid (children: #seq) = createElement (importDefault \"@material-ui/core/Grid\") [ Feliz.MaterialUI.grid.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `children`\n static member inline gridList props = createElement (importDefault \"@material-ui/core/GridList\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `children`\n static member inline gridList (children: #seq) = createElement (importDefault \"@material-ui/core/GridList\") [ Feliz.MaterialUI.gridList.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline gridListTile props = createElement (importDefault \"@material-ui/core/GridListTile\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline gridListTile (children: #seq) = createElement (importDefault \"@material-ui/core/GridListTile\") [ Feliz.MaterialUI.gridListTile.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline gridListTileBar props = createElement (importDefault \"@material-ui/core/GridListTileBar\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Transition](https://reactcommunity.org/react-transition-group/transition/#Transition-props)).\n static member inline grow props = createElement (importDefault \"@material-ui/core/Grow\") props\n\n /// The component cannot hold a ref.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline hidden props = createElement (importDefault \"@material-ui/core/Hidden\") props\n\n /// The component cannot hold a ref.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline hidden (children: #seq) = createElement (importDefault \"@material-ui/core/Hidden\") [ Feliz.MaterialUI.hidden.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline icon props = createElement (importDefault \"@material-ui/core/Icon\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline icon (name: string) = createElement (importDefault \"@material-ui/core/Icon\") [ prop.children (Html.text name) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline icon (children: #seq) = createElement (importDefault \"@material-ui/core/Icon\") [ Feliz.MaterialUI.icon.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline iconButton props = createElement (importDefault \"@material-ui/core/IconButton\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline iconButton (children: #seq) = createElement (importDefault \"@material-ui/core/IconButton\") [ Feliz.MaterialUI.iconButton.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([InputBase](https://material-ui.com/api/input-base/)).\n static member inline input props = createElement (importDefault \"@material-ui/core/Input\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `children`\n static member inline inputAdornment props = createElement (importDefault \"@material-ui/core/InputAdornment\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `children`\n static member inline inputAdornment (children: #seq) = createElement (importDefault \"@material-ui/core/InputAdornment\") [ Feliz.MaterialUI.inputAdornment.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline inputBase props = createElement (importDefault \"@material-ui/core/InputBase\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([FormLabel](https://material-ui.com/api/form-label/)).\n static member inline inputLabel props = createElement (importDefault \"@material-ui/core/InputLabel\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([FormLabel](https://material-ui.com/api/form-label/)).\n static member inline inputLabel (text: string) = createElement (importDefault \"@material-ui/core/InputLabel\") [ prop.children (Html.text text) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([FormLabel](https://material-ui.com/api/form-label/)).\n static member inline inputLabel (children: #seq) = createElement (importDefault \"@material-ui/core/InputLabel\") [ Feliz.MaterialUI.inputLabel.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline linearProgress props = createElement (importDefault \"@material-ui/core/LinearProgress\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Typography](https://material-ui.com/api/typography/)).\n ///\n /// Required props:\n /// - `children`\n static member inline link props = createElement (importDefault \"@material-ui/core/Link\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Typography](https://material-ui.com/api/typography/)).\n ///\n /// Required props:\n /// - `children`\n static member inline link (children: #seq) = createElement (importDefault \"@material-ui/core/Link\") [ Feliz.MaterialUI.link.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline list props = createElement (importDefault \"@material-ui/core/List\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline list (children: #seq) = createElement (importDefault \"@material-ui/core/List\") [ Feliz.MaterialUI.list.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline listItem props = createElement (importDefault \"@material-ui/core/ListItem\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline listItem (children: #seq) = createElement (importDefault \"@material-ui/core/ListItem\") [ Feliz.MaterialUI.listItem.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `children`\n static member inline listItemAvatar props = createElement (importDefault \"@material-ui/core/ListItemAvatar\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline listItemIcon props = createElement (importDefault \"@material-ui/core/ListItemIcon\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline listItemIcon (children: #seq) = createElement (importDefault \"@material-ui/core/ListItemIcon\") [ Feliz.MaterialUI.listItemIcon.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline listItemSecondaryAction props = createElement (importDefault \"@material-ui/core/ListItemSecondaryAction\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline listItemSecondaryAction (children: #seq) = createElement (importDefault \"@material-ui/core/ListItemSecondaryAction\") [ Feliz.MaterialUI.listItemSecondaryAction.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline listItemText props = createElement (importDefault \"@material-ui/core/ListItemText\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline listItemText (primary: string) = createElement (importDefault \"@material-ui/core/ListItemText\") [ listItemText.primary primary ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline listItemText (children: #seq) = createElement (importDefault \"@material-ui/core/ListItemText\") [ Feliz.MaterialUI.listItemText.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline listSubheader props = createElement (importDefault \"@material-ui/core/ListSubheader\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline listSubheader (text: string) = createElement (importDefault \"@material-ui/core/ListSubheader\") [ prop.children (Html.text text) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline listSubheader (children: #seq) = createElement (importDefault \"@material-ui/core/ListSubheader\") [ Feliz.MaterialUI.listSubheader.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Popover](https://material-ui.com/api/popover/)).\n ///\n /// Required props:\n /// - `open'`\n static member inline menu props = createElement (importDefault \"@material-ui/core/Menu\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Popover](https://material-ui.com/api/popover/)).\n ///\n /// Required props:\n /// - `open'`\n static member inline menu (children: #seq) = createElement (importDefault \"@material-ui/core/Menu\") [ Feliz.MaterialUI.menu.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ListItem](https://material-ui.com/api/list-item/)).\n static member inline menuItem props = createElement (importDefault \"@material-ui/core/MenuItem\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ListItem](https://material-ui.com/api/list-item/)).\n static member inline menuItem (children: #seq) = createElement (importDefault \"@material-ui/core/MenuItem\") [ Feliz.MaterialUI.menuItem.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([List](https://material-ui.com/api/list/)).\n static member inline menuList props = createElement (importDefault \"@material-ui/core/MenuList\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([List](https://material-ui.com/api/list/)).\n static member inline menuList (children: #seq) = createElement (importDefault \"@material-ui/core/MenuList\") [ Feliz.MaterialUI.menuList.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n ///\n /// Required props:\n /// - `steps`\n static member inline mobileStepper props = createElement (importDefault \"@material-ui/core/MobileStepper\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `children`\n /// - `open'`\n static member inline modal props = createElement (importDefault \"@material-ui/core/Modal\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Input](https://material-ui.com/api/input/)).\n static member inline nativeSelect props = createElement (importDefault \"@material-ui/core/NativeSelect\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Input](https://material-ui.com/api/input/)).\n static member inline nativeSelect (children: #seq) = createElement (importDefault \"@material-ui/core/NativeSelect\") [ Feliz.MaterialUI.nativeSelect.children (children :> ReactElement seq) ]\n\n /// The component cannot hold a ref.\n static member inline noSsr props = createElement (importDefault \"@material-ui/core/NoSsr\") props\n\n /// The component cannot hold a ref.\n static member inline noSsr (children: #seq) = createElement (importDefault \"@material-ui/core/NoSsr\") [ Feliz.MaterialUI.noSsr.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([InputBase](https://material-ui.com/api/input-base/)).\n static member inline outlinedInput props = createElement (importDefault \"@material-ui/core/OutlinedInput\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline pagination props = createElement (importDefault \"@material-ui/lab/Pagination\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline paginationItem props = createElement (importDefault \"@material-ui/lab/PaginationItem\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline paper props = createElement (importDefault \"@material-ui/core/Paper\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline paper (children: #seq) = createElement (importDefault \"@material-ui/core/Paper\") [ Feliz.MaterialUI.paper.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Modal](https://material-ui.com/api/modal/)).\n ///\n /// Required props:\n /// - `open'`\n static member inline popover props = createElement (importDefault \"@material-ui/core/Popover\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Modal](https://material-ui.com/api/modal/)).\n ///\n /// Required props:\n /// - `open'`\n static member inline popover (children: #seq) = createElement (importDefault \"@material-ui/core/Popover\") [ Feliz.MaterialUI.popover.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `children`\n /// - `open'`\n static member inline popper props = createElement (importDefault \"@material-ui/core/Popper\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `children`\n /// - `open'`\n static member inline popper (children: #seq) = createElement (importDefault \"@material-ui/core/Popper\") [ Feliz.MaterialUI.popper.children (children :> ReactElement seq) ]\n\n /// The component cannot hold a ref.\n static member inline portal props = createElement (importDefault \"@material-ui/core/Portal\") props\n\n /// The component cannot hold a ref.\n static member inline portal (children: #seq) = createElement (importDefault \"@material-ui/core/Portal\") [ Feliz.MaterialUI.portal.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([IconButton](https://material-ui.com/api/icon-button/)).\n static member inline radio props = createElement (importDefault \"@material-ui/core/Radio\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([FormGroup](https://material-ui.com/api/form-group/)).\n static member inline radioGroup props = createElement (importDefault \"@material-ui/core/RadioGroup\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([FormGroup](https://material-ui.com/api/form-group/)).\n static member inline radioGroup (children: #seq) = createElement (importDefault \"@material-ui/core/RadioGroup\") [ Feliz.MaterialUI.radioGroup.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline rating props = createElement (importDefault \"@material-ui/lab/Rating\") props\n\n /// The component cannot hold a ref.\n ///\n /// Required props:\n /// - `children`\n /// - `rootRef`\n static member inline rootRef props = createElement (importDefault \"@material-ui/core/RootRef\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline scopedCssBaseline props = createElement (importDefault \"@material-ui/core/ScopedCssBaseline\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline scopedCssBaseline (children: #seq) = createElement (importDefault \"@material-ui/core/ScopedCssBaseline\") [ Feliz.MaterialUI.scopedCssBaseline.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Input](https://material-ui.com/api/input/)).\n static member inline select props = createElement (importDefault \"@material-ui/core/Select\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Input](https://material-ui.com/api/input/)).\n static member inline select (children: #seq) = createElement (importDefault \"@material-ui/core/Select\") [ Feliz.MaterialUI.select.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline skeleton props = createElement (importDefault \"@material-ui/lab/Skeleton\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline skeleton (children: #seq) = createElement (importDefault \"@material-ui/lab/Skeleton\") [ Feliz.MaterialUI.skeleton.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Transition](https://reactcommunity.org/react-transition-group/transition/#Transition-props)).\n static member inline slide props = createElement (importDefault \"@material-ui/core/Slide\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline slider props = createElement (importDefault \"@material-ui/core/Slider\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline snackbar props = createElement (importDefault \"@material-ui/core/Snackbar\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n static member inline snackbarContent props = createElement (importDefault \"@material-ui/core/SnackbarContent\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `ariaLabel`\n /// - `open'`\n static member inline speedDial props = createElement (importDefault \"@material-ui/lab/SpeedDial\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `ariaLabel`\n /// - `open'`\n static member inline speedDial (children: #seq) = createElement (importDefault \"@material-ui/lab/SpeedDial\") [ Feliz.MaterialUI.speedDial.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Tooltip](https://material-ui.com/api/tooltip/)).\n static member inline speedDialAction props = createElement (importDefault \"@material-ui/lab/SpeedDialAction\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline speedDialIcon props = createElement (importDefault \"@material-ui/lab/SpeedDialIcon\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline step props = createElement (importDefault \"@material-ui/core/Step\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline step (children: #seq) = createElement (importDefault \"@material-ui/core/Step\") [ Feliz.MaterialUI.step.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline stepButton props = createElement (importDefault \"@material-ui/core/StepButton\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline stepButton (children: #seq) = createElement (importDefault \"@material-ui/core/StepButton\") [ Feliz.MaterialUI.stepButton.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline stepConnector props = createElement (importDefault \"@material-ui/core/StepConnector\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline stepContent props = createElement (importDefault \"@material-ui/core/StepContent\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline stepContent (children: #seq) = createElement (importDefault \"@material-ui/core/StepContent\") [ Feliz.MaterialUI.stepContent.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline stepIcon props = createElement (importDefault \"@material-ui/core/StepIcon\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline stepLabel props = createElement (importDefault \"@material-ui/core/StepLabel\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline stepLabel (text: string) = createElement (importDefault \"@material-ui/core/StepLabel\") [ prop.children (Html.text text) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline stepLabel (children: #seq) = createElement (importDefault \"@material-ui/core/StepLabel\") [ Feliz.MaterialUI.stepLabel.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n static member inline stepper props = createElement (importDefault \"@material-ui/core/Stepper\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Paper](https://material-ui.com/api/paper/)).\n static member inline stepper (children: #seq) = createElement (importDefault \"@material-ui/core/Stepper\") [ Feliz.MaterialUI.stepper.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline svgIcon props = createElement (importDefault \"@material-ui/core/SvgIcon\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline svgIcon (children: #seq) = createElement (importDefault \"@material-ui/core/SvgIcon\") [ Feliz.MaterialUI.svgIcon.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Drawer](https://material-ui.com/api/drawer/)).\n ///\n /// Required props:\n /// - `onClose`\n /// - `onOpen`\n /// - `open'`\n static member inline swipeableDrawer props = createElement (importDefault \"@material-ui/core/SwipeableDrawer\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Drawer](https://material-ui.com/api/drawer/)).\n ///\n /// Required props:\n /// - `onClose`\n /// - `onOpen`\n /// - `open'`\n static member inline swipeableDrawer (children: #seq) = createElement (importDefault \"@material-ui/core/SwipeableDrawer\") [ Feliz.MaterialUI.swipeableDrawer.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([IconButton](https://material-ui.com/api/icon-button/)).\n static member inline switch props = createElement (importDefault \"@material-ui/core/Switch\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline tab props = createElement (importDefault \"@material-ui/core/Tab\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The component cannot hold a ref.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `value`\n static member inline tabContext props = createElement (importDefault \"@material-ui/lab/TabContext\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The component cannot hold a ref.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `value`\n static member inline tabContext (children: #seq) = createElement (importDefault \"@material-ui/lab/TabContext\") [ Feliz.MaterialUI.tabContext.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `children`\n static member inline table props = createElement (importDefault \"@material-ui/core/Table\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `children`\n static member inline table (children: #seq) = createElement (importDefault \"@material-ui/core/Table\") [ Feliz.MaterialUI.table.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tableBody props = createElement (importDefault \"@material-ui/core/TableBody\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tableBody (children: #seq) = createElement (importDefault \"@material-ui/core/TableBody\") [ Feliz.MaterialUI.tableBody.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tableCell props = createElement (importDefault \"@material-ui/core/TableCell\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tableCell (text: string) = createElement (importDefault \"@material-ui/core/TableCell\") [ prop.children (Html.text text) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tableCell (children: #seq) = createElement (importDefault \"@material-ui/core/TableCell\") [ Feliz.MaterialUI.tableCell.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tableContainer props = createElement (importDefault \"@material-ui/core/TableContainer\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tableContainer (children: #seq) = createElement (importDefault \"@material-ui/core/TableContainer\") [ Feliz.MaterialUI.tableContainer.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tableFooter props = createElement (importDefault \"@material-ui/core/TableFooter\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tableFooter (children: #seq) = createElement (importDefault \"@material-ui/core/TableFooter\") [ Feliz.MaterialUI.tableFooter.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tableHead props = createElement (importDefault \"@material-ui/core/TableHead\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tableHead (children: #seq) = createElement (importDefault \"@material-ui/core/TableHead\") [ Feliz.MaterialUI.tableHead.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([TableCell](https://material-ui.com/api/table-cell/)).\n ///\n /// Required props:\n /// - `count`\n /// - `onChangePage`\n /// - `page`\n /// - `rowsPerPage`\n static member inline tablePagination props = createElement (importDefault \"@material-ui/core/TablePagination\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tableRow props = createElement (importDefault \"@material-ui/core/TableRow\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tableRow (children: #seq) = createElement (importDefault \"@material-ui/core/TableRow\") [ Feliz.MaterialUI.tableRow.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline tableSortLabel props = createElement (importDefault \"@material-ui/core/TableSortLabel\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n static member inline tableSortLabel (children: #seq) = createElement (importDefault \"@material-ui/core/TableSortLabel\") [ Feliz.MaterialUI.tableSortLabel.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Tabs](https://material-ui.com/api/tabs/)).\n static member inline tabList props = createElement (importDefault \"@material-ui/lab/TabList\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Tabs](https://material-ui.com/api/tabs/)).\n static member inline tabList (children: #seq) = createElement (importDefault \"@material-ui/lab/TabList\") [ Feliz.MaterialUI.tabList.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `value`\n static member inline tabPanel props = createElement (importDefault \"@material-ui/lab/TabPanel\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `value`\n static member inline tabPanel (children: #seq) = createElement (importDefault \"@material-ui/lab/TabPanel\") [ Feliz.MaterialUI.tabPanel.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tabs props = createElement (importDefault \"@material-ui/core/Tabs\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline tabs (children: #seq) = createElement (importDefault \"@material-ui/core/Tabs\") [ Feliz.MaterialUI.tabs.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `direction`\n /// - `orientation`\n static member inline tabScrollButton props = createElement (importDefault \"@material-ui/core/TabScrollButton\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `direction`\n /// - `orientation`\n static member inline tabScrollButton (children: #seq) = createElement (importDefault \"@material-ui/core/TabScrollButton\") [ Feliz.MaterialUI.tabScrollButton.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline textareaAutosize props = createElement (importDefault \"@material-ui/core/TextareaAutosize\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([FormControl](https://material-ui.com/api/form-control/)).\n static member inline textField props = createElement (importDefault \"@material-ui/core/TextField\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timeline props = createElement (importDefault \"@material-ui/lab/Timeline\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timeline (children: #seq) = createElement (importDefault \"@material-ui/lab/Timeline\") [ Feliz.MaterialUI.timeline.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timelineConnector props = createElement (importDefault \"@material-ui/lab/TimelineConnector\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timelineConnector (children: #seq) = createElement (importDefault \"@material-ui/lab/TimelineConnector\") [ Feliz.MaterialUI.timelineConnector.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timelineContent props = createElement (importDefault \"@material-ui/lab/TimelineContent\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timelineContent (children: #seq) = createElement (importDefault \"@material-ui/lab/TimelineContent\") [ Feliz.MaterialUI.timelineContent.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timelineDot props = createElement (importDefault \"@material-ui/lab/TimelineDot\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timelineDot (children: #seq) = createElement (importDefault \"@material-ui/lab/TimelineDot\") [ Feliz.MaterialUI.timelineDot.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timelineItem props = createElement (importDefault \"@material-ui/lab/TimelineItem\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timelineItem (children: #seq) = createElement (importDefault \"@material-ui/lab/TimelineItem\") [ Feliz.MaterialUI.timelineItem.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timelineOppositeContent props = createElement (importDefault \"@material-ui/lab/TimelineOppositeContent\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timelineOppositeContent (children: #seq) = createElement (importDefault \"@material-ui/lab/TimelineOppositeContent\") [ Feliz.MaterialUI.timelineOppositeContent.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timelineSeparator props = createElement (importDefault \"@material-ui/lab/TimelineSeparator\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline timelineSeparator (children: #seq) = createElement (importDefault \"@material-ui/lab/TimelineSeparator\") [ Feliz.MaterialUI.timelineSeparator.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n ///\n /// Required props:\n /// - `children`\n /// - `value`\n static member inline toggleButton props = createElement (importDefault \"@material-ui/lab/ToggleButton\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([ButtonBase](https://material-ui.com/api/button-base/)).\n ///\n /// Required props:\n /// - `children`\n /// - `value`\n static member inline toggleButton (children: #seq) = createElement (importDefault \"@material-ui/lab/ToggleButton\") [ Feliz.MaterialUI.toggleButton.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline toggleButtonGroup props = createElement (importDefault \"@material-ui/lab/ToggleButtonGroup\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline toggleButtonGroup (children: #seq) = createElement (importDefault \"@material-ui/lab/ToggleButtonGroup\") [ Feliz.MaterialUI.toggleButtonGroup.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline toolbar props = createElement (importDefault \"@material-ui/core/Toolbar\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline toolbar (children: #seq) = createElement (importDefault \"@material-ui/core/Toolbar\") [ Feliz.MaterialUI.toolbar.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `children`\n /// - `title`\n static member inline tooltip props = createElement (importDefault \"@material-ui/core/Tooltip\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `nodeId`\n static member inline treeItem props = createElement (importDefault \"@material-ui/lab/TreeItem\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n ///\n /// Required props:\n /// - `nodeId`\n static member inline treeItem (children: #seq) = createElement (importDefault \"@material-ui/lab/TreeItem\") [ Feliz.MaterialUI.treeItem.children (children :> ReactElement seq) ]\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline treeView props = createElement (importDefault \"@material-ui/lab/TreeView\") props\n\n /// **This is an experimental component from @material-ui/lab. Breaking changes may occur at any time.**\n ///\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline treeView (children: #seq) = createElement (importDefault \"@material-ui/lab/TreeView\") [ Feliz.MaterialUI.treeView.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline typography props = createElement (importDefault \"@material-ui/core/Typography\") props\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline typography (text: string) = createElement (importDefault \"@material-ui/core/Typography\") [ prop.children (Html.text text) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element (native element).\n static member inline typography (children: #seq) = createElement (importDefault \"@material-ui/core/Typography\") [ Feliz.MaterialUI.typography.children (children :> ReactElement seq) ]\n\n /// The component cannot hold a ref.\n ///\n /// Required props:\n /// - `getDoc`\n /// - `isEnabled`\n /// - `open'`\n static member inline unstable_TrapFocus props = createElement (importDefault \"@material-ui/core/Unstable_TrapFocus\") props\n\n /// The component cannot hold a ref.\n ///\n /// Required props:\n /// - `getDoc`\n /// - `isEnabled`\n /// - `open'`\n static member inline unstable_TrapFocus (children: #seq) = createElement (importDefault \"@material-ui/core/Unstable_TrapFocus\") [ Feliz.MaterialUI.unstable_TrapFocus.children (children :> ReactElement seq) ]\n\n /// The `ref` is forwarded to the root element.\n ///\n /// Any other props supplied will be provided to the root element ([Transition](https://reactcommunity.org/react-transition-group/transition/#Transition-props)).\n static member inline zoom props = createElement (importDefault \"@material-ui/core/Zoom\") props\n","namespace Feliz.MaterialUI\n\nopen System.ComponentModel\nopen Fable.Core\nopen Fable.Core.JsInterop\n\n[]\nmodule Object =\n []\n let private isUndefined x = jsNative\n\n let fromFlatEntries (kvs: seq) : obj =\n let rec setProperty (target : obj) (key : string) (value : obj) =\n match key.IndexOf '.' with\n | -1 -> target?(key) <- value\n | sepIdx ->\n let topKey = key.Substring (0, sepIdx)\n let nestedKey = key.Substring (sepIdx + 1)\n if isUndefined target?(topKey) then\n target?(topKey) <- obj ()\n setProperty target?(topKey) nestedKey value\n\n let target = obj ()\n for (key, value) in kvs do\n setProperty target key value\n target\n\n","import { class_type } from \"./Reflection.js\";\r\nimport { fromNumber, op_Addition, toInt, toNumber, compare, fromInteger } from \"./Long.js\";\r\n\r\nfunction Native_random() {\r\n return Math.random();\r\n}\r\n\r\nfunction Native_randomNext(min, max) {\r\n \n if (max < min) {\n throw new Error(\"minValue must be less than maxValue\");\n }\n return Math.floor(Math.random() * (max - min)) + min\n ;\r\n}\r\n\r\nfunction Native_randomBytes(buffer) {\r\n \n if (buffer == null) {\n throw new Error(\"Buffer cannot be null\");\n }\n for (let i = 0; i < buffer.length; i += 6) {\n // Pick random 48-bit number. Fill buffer in 2 24-bit chunks to avoid bitwise truncation.\n let r = Math.floor(Math.random() * 281474976710656); // Low 24 bits = chunk 1.\n const rhi = Math.floor(r / 16777216); // High 24 bits shifted via division = chunk 2.\n for (let j = 0; j < 6 && i + j < buffer.length; j++) {\n if (j === 3) { r = rhi; }\n buffer[i + j] = r & 255;\n r >>>= 8;\n }\n };\r\n}\r\n\r\nexport class NonSeeded {\r\n constructor() {\r\n }\r\n Next0() {\r\n return Native_randomNext(0, 2147483647);\r\n }\r\n Next1(maxValue) {\r\n return Native_randomNext(0, maxValue);\r\n }\r\n Next2(minValue, maxValue) {\r\n return Native_randomNext(minValue, maxValue);\r\n }\r\n NextDouble() {\r\n return Native_random();\r\n }\r\n NextBytes(buffer) {\r\n Native_randomBytes(buffer);\r\n }\r\n}\r\n\r\nexport function NonSeeded$reflection() {\r\n return class_type(\"Random.NonSeeded\", void 0, NonSeeded);\r\n}\r\n\r\nexport function NonSeeded_$ctor() {\r\n return new NonSeeded();\r\n}\r\n\r\nexport class Seeded {\r\n constructor(seed) {\r\n this.MBIG = 2147483647;\r\n this.inext = 0;\r\n this.inextp = 0;\r\n this.seedArray = (new Int32Array(56));\r\n let ii = 0;\r\n let mj = 0;\r\n let mk = 0;\r\n const subtraction = ((seed === -2147483648) ? 2147483647 : Math.abs(seed)) | 0;\r\n mj = ((161803398 - subtraction) | 0);\r\n this.seedArray[55] = (mj | 0);\r\n mk = 1;\r\n for (let i = 1; i <= 54; i++) {\r\n ii = (((21 * i) % 55) | 0);\r\n this.seedArray[ii] = (mk | 0);\r\n mk = ((mj - mk) | 0);\r\n if (mk < 0) {\r\n mk = ((mk + this.MBIG) | 0);\r\n }\r\n mj = (this.seedArray[ii] | 0);\r\n }\r\n for (let k = 1; k <= 4; k++) {\r\n for (let i_1 = 1; i_1 <= 55; i_1++) {\r\n this.seedArray[i_1] = ((this.seedArray[i_1] - this.seedArray[1 + ((i_1 + 30) % 55)]) | 0);\r\n if (this.seedArray[i_1] < 0) {\r\n this.seedArray[i_1] = ((this.seedArray[i_1] + this.MBIG) | 0);\r\n }\r\n }\r\n }\r\n this.inext = 0;\r\n this.inextp = 21;\r\n }\r\n Next0() {\r\n const this$ = this;\r\n return Seeded__InternalSample(this$) | 0;\r\n }\r\n Next1(maxValue) {\r\n const this$ = this;\r\n if (maxValue < 0) {\r\n const exn = new Error(\"maxValue\", \"maxValue must be positive\");\r\n throw exn;\r\n }\r\n return (~(~(Seeded__Sample(this$) * maxValue))) | 0;\r\n }\r\n Next2(minValue, maxValue) {\r\n const this$ = this;\r\n if (minValue > maxValue) {\r\n const exn = new Error(\"minValue\", \"minValue must be less than maxValue\");\r\n throw exn;\r\n }\r\n const range = fromInteger(maxValue - minValue, false, 2);\r\n return ((compare(range, fromInteger(2147483647, false, 2)) <= 0) ? ((~(~(Seeded__Sample(this$) * toNumber(range)))) + minValue) : (~(~toInt(op_Addition(fromNumber(Seeded__GetSampleForLargeRange(this$) * toNumber(range), false), fromInteger(minValue, false, 2)))))) | 0;\r\n }\r\n NextDouble() {\r\n const this$ = this;\r\n return Seeded__Sample(this$);\r\n }\r\n NextBytes(buffer) {\r\n const this$ = this;\r\n if (buffer == null) {\r\n const exn = new Error(\"buffer\");\r\n throw exn;\r\n }\r\n for (let i = 0; i <= (buffer.length - 1); i++) {\r\n buffer[i] = ((Seeded__InternalSample(this$) % ((~(~255)) + 1)) & 0xFF);\r\n }\r\n }\r\n}\r\n\r\nexport function Seeded$reflection() {\r\n return class_type(\"Random.Seeded\", void 0, Seeded);\r\n}\r\n\r\nexport function Seeded_$ctor_Z524259A4(seed) {\r\n return new Seeded(seed);\r\n}\r\n\r\nfunction Seeded__InternalSample(_) {\r\n let retVal = 0;\r\n let locINext = _.inext;\r\n let locINextp = _.inextp;\r\n locINext = ((locINext + 1) | 0);\r\n if (locINext >= 56) {\r\n locINext = 1;\r\n }\r\n locINextp = ((locINextp + 1) | 0);\r\n if (locINextp >= 56) {\r\n locINextp = 1;\r\n }\r\n retVal = ((_.seedArray[locINext] - _.seedArray[locINextp]) | 0);\r\n if (retVal === _.MBIG) {\r\n retVal = ((retVal - 1) | 0);\r\n }\r\n if (retVal < 0) {\r\n retVal = ((retVal + _.MBIG) | 0);\r\n }\r\n _.seedArray[locINext] = (retVal | 0);\r\n _.inext = (locINext | 0);\r\n _.inextp = (locINextp | 0);\r\n return retVal | 0;\r\n}\r\n\r\nexport function Seeded__Sample(this$) {\r\n return Seeded__InternalSample(this$) * (1 / this$.MBIG);\r\n}\r\n\r\nexport function Seeded__GetSampleForLargeRange(this$) {\r\n let result = Seeded__InternalSample(this$);\r\n if ((Seeded__InternalSample(this$) % 2) === 0) {\r\n result = (-result);\r\n }\r\n let d = result;\r\n d = (d + (2147483647 - 1));\r\n d = (d / (2 * ((2147483647 - 1) >>> 0)));\r\n return d;\r\n}\r\n\r\nexport function nonSeeded() {\r\n return NonSeeded_$ctor();\r\n}\r\n\r\nexport function seeded(seed) {\r\n return Seeded_$ctor_Z524259A4(seed);\r\n}\r\n\r\n","import { FSharpRef } from \"./Types.js\";\nexport function tryParse(str, defValue) {\n // TODO: test if value is valid and in range\n if (str != null && /\\S/.test(str)) {\n const v = +str.replace(\"_\", \"\");\n if (!Number.isNaN(v)) {\n defValue.contents = v;\n return true;\n }\n }\n return false;\n}\nexport function parse(str) {\n const defValue = new FSharpRef(0);\n if (tryParse(str, defValue)) {\n return defValue.contents;\n }\n else {\n throw new Error(\"Input string was not in a correct format.\");\n }\n}\n// JS Number.isFinite function evals false for NaN\nexport function isInfinity(x) {\n return x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY;\n}\n","const ok = (value) => ({\n tag: \"ok\",\n value,\n});\nconst error = (error) => ({ tag: \"error\", error });\nexport class Uri {\n constructor(state) {\n this.uri = state;\n }\n static isAbsoluteUri(uri) {\n try {\n // tslint:disable-next-line no-unused-expression\n new URL(uri);\n return true;\n }\n catch (_a) {\n return false;\n }\n }\n static tryCreateWithKind(uri, kind) {\n switch (kind) {\n case 1 /* Absolute */:\n return Uri.isAbsoluteUri(uri)\n ? ok(new Uri({ original: uri, value: new URL(uri), kind }))\n : error(\"Invalid URI: The format of the URI could not be determined.\");\n case 2 /* Relative */:\n return Uri.isAbsoluteUri(uri)\n ? error(\"URI is not a relative path.\")\n : ok(new Uri({ original: uri, value: uri, kind }));\n case 0 /* RelativeOrAbsolute */:\n return Uri.isAbsoluteUri(uri)\n ? ok(new Uri({ original: uri, value: new URL(uri), kind: 1 /* Absolute */ }))\n : ok(new Uri({ original: uri, value: uri, kind: 2 /* Relative */ }));\n default:\n const never = kind;\n return never;\n }\n }\n static tryCreateWithBase(baseUri, relativeUri) {\n return baseUri.uri.kind !== 1 /* Absolute */\n ? error(\"Base URI should have Absolute kind\")\n : typeof relativeUri === \"string\"\n ? ok(new Uri({\n original: new URL(relativeUri, baseUri.uri.value).toString(),\n value: new URL(relativeUri, baseUri.uri.value),\n kind: 1 /* Absolute */,\n }))\n : relativeUri.uri.kind === 2 /* Relative */\n ? ok(new Uri({\n original: new URL(relativeUri.uri.value, baseUri.uri.value).toString(),\n value: new URL(relativeUri.uri.value, baseUri.uri.value),\n kind: 1 /* Absolute */,\n }))\n : ok(baseUri);\n }\n static tryCreateImpl(value, kindOrUri = 1 /* Absolute */) {\n return typeof value === \"string\"\n ? typeof kindOrUri !== \"number\"\n ? error(\"Kind must be specified when the baseUri is a string.\")\n : Uri.tryCreateWithKind(value, kindOrUri)\n : typeof kindOrUri === \"number\"\n ? error(\"Kind should not be specified when the baseUri is an absolute Uri.\")\n : Uri.tryCreateWithBase(value, kindOrUri);\n }\n static create(value, kindOrUri = 1 /* Absolute */) {\n const result = Uri.tryCreateImpl(value, kindOrUri);\n switch (result.tag) {\n case \"ok\":\n return result.value;\n case \"error\":\n throw new Error(result.error);\n default:\n const never = result;\n return never;\n }\n }\n static tryCreate(value, kindOrUri = 1 /* Absolute */, out) {\n const result = Uri.tryCreateImpl(value, kindOrUri);\n switch (result.tag) {\n case \"ok\":\n out.contents = result.value;\n return true;\n case \"error\":\n return false;\n default:\n const never = result;\n return never;\n }\n }\n toString() {\n switch (this.uri.kind) {\n case 1 /* Absolute */:\n return decodeURIComponent(this.asUrl().toString());\n case 2 /* Relative */:\n return this.uri.value;\n default:\n const never = this.uri;\n return never;\n }\n }\n asUrl() {\n switch (this.uri.kind) {\n case 1 /* Absolute */:\n return this.uri.value;\n case 2 /* Relative */:\n throw new Error(\"This operation is not supported for a relative URI.\");\n default:\n const never = this.uri;\n return never;\n }\n }\n get isAbsoluteUri() {\n return this.uri.kind === 1 /* Absolute */;\n }\n get absoluteUri() {\n return this.asUrl().href;\n }\n get scheme() {\n const protocol = this.asUrl().protocol;\n return protocol.slice(0, protocol.length - 1);\n }\n get host() {\n return this.asUrl().host;\n }\n get absolutePath() {\n return this.asUrl().pathname;\n }\n get query() {\n return this.asUrl().search;\n }\n get pathAndQuery() {\n const url = this.asUrl();\n return url.pathname + url.search;\n }\n get fragment() {\n return this.asUrl().hash;\n }\n get originalString() {\n return this.uri.original;\n }\n}\nexport default Uri;\n","\"use strict\";\r\n\r\nexport function Parsimmon(action) {\r\n if (!(this instanceof Parsimmon)) {\r\n return new Parsimmon(action);\r\n }\r\n this._ = action;\r\n}\r\n\r\nvar _ = Parsimmon.prototype;\r\n\r\nexport function times(n, f) {\r\n var i = 0;\r\n for (i; i < n; i++) {\r\n f(i);\r\n }\r\n}\r\n\r\nexport function forEach(f, arr) {\r\n times(arr.length, function(i) {\r\n f(arr[i], i, arr);\r\n });\r\n}\r\n\r\nexport function reduce(f, seed, arr) {\r\n forEach(function(elem, i, arr) {\r\n seed = f(seed, elem, i, arr);\r\n }, arr);\r\n return seed;\r\n}\r\n\r\nexport function map(f, arr) {\r\n return reduce(\r\n function(acc, elem, i, a) {\r\n return acc.concat([f(elem, i, a)]);\r\n },\r\n [],\r\n arr\r\n );\r\n}\r\n\r\nexport function lshiftBuffer(input) {\r\n var asTwoBytes = reduce(\r\n function(a, v, i, b) {\r\n return a.concat(\r\n i === b.length - 1\r\n ? Buffer.from([v, 0]).readUInt16BE(0)\r\n : b.readUInt16BE(i)\r\n );\r\n },\r\n [],\r\n input\r\n );\r\n return Buffer.from(\r\n map(function(x) {\r\n return ((x << 1) & 0xffff) >> 8;\r\n }, asTwoBytes)\r\n );\r\n}\r\n\r\nfunction consumeBitsFromBuffer(n, input) {\r\n var state = { v: 0, buf: input };\r\n times(n, function() {\r\n state = {\r\n v: (state.v << 1) | bitPeekBuffer(state.buf),\r\n buf: lshiftBuffer(state.buf)\r\n };\r\n });\r\n return state;\r\n}\r\n\r\nfunction bitPeekBuffer(input) {\r\n return input[0] >> 7;\r\n}\r\n\r\nexport function sum(numArr) {\r\n return reduce(\r\n function(x, y) {\r\n return x + y;\r\n },\r\n 0,\r\n numArr\r\n );\r\n}\r\n\r\nexport function find(pred, arr) {\r\n return reduce(\r\n function(found, elem) {\r\n return found || (pred(elem) ? elem : found);\r\n },\r\n null,\r\n arr\r\n );\r\n}\r\n\r\nfunction bufferExists() {\r\n return typeof Buffer !== \"undefined\";\r\n}\r\n\r\nfunction ensureBuffer() {\r\n if (!bufferExists()) {\r\n throw new Error(\r\n \"Buffer global does not exist; please consider using https://github.com/feross/buffer if you are running Parsimmon in a browser.\"\r\n );\r\n }\r\n}\r\n\r\nfunction bitSeq(alignments) {\r\n ensureBuffer();\r\n var totalBits = sum(alignments);\r\n if (totalBits % 8 !== 0) {\r\n throw new Error(\r\n \"The bits [\" +\r\n alignments.join(\", \") +\r\n \"] add up to \" +\r\n totalBits +\r\n \" which is not an even number of bytes; the total should be divisible by 8\"\r\n );\r\n }\r\n var bytes = totalBits / 8;\r\n\r\n var tooBigRange = find(function(x) {\r\n return x > 48;\r\n }, alignments);\r\n if (tooBigRange) {\r\n throw new Error(\r\n tooBigRange + \" bit range requested exceeds 48 bit (6 byte) Number max.\"\r\n );\r\n }\r\n\r\n return new Parsimmon(function(input, i) {\r\n var newPos = bytes + i;\r\n if (newPos > input.length) {\r\n return makeFailure(i, bytes.toString() + \" bytes\");\r\n }\r\n return makeSuccess(\r\n newPos,\r\n reduce(\r\n function(acc, bits) {\r\n var state = consumeBitsFromBuffer(bits, acc.buf);\r\n return {\r\n coll: acc.coll.concat(state.v),\r\n buf: state.buf\r\n };\r\n },\r\n { coll: [], buf: input.slice(i, newPos) },\r\n alignments\r\n ).coll\r\n );\r\n });\r\n}\r\n\r\nfunction bitSeqObj(namedAlignments) {\r\n ensureBuffer();\r\n var seenKeys = {};\r\n var totalKeys = 0;\r\n var fullAlignments = map(function(item) {\r\n if (isArray(item)) {\r\n var pair = item;\r\n if (pair.length !== 2) {\r\n throw new Error(\r\n \"[\" +\r\n pair.join(\", \") +\r\n \"] should be length 2, got length \" +\r\n pair.length\r\n );\r\n }\r\n assertString(pair[0]);\r\n assertNumber(pair[1]);\r\n if (Object.prototype.hasOwnProperty.call(seenKeys, pair[0])) {\r\n throw new Error(\"duplicate key in bitSeqObj: \" + pair[0]);\r\n }\r\n seenKeys[pair[0]] = true;\r\n totalKeys++;\r\n return pair;\r\n } else {\r\n assertNumber(item);\r\n return [null, item];\r\n }\r\n }, namedAlignments);\r\n if (totalKeys < 1) {\r\n throw new Error(\r\n \"bitSeqObj expects at least one named pair, got [\" +\r\n namedAlignments.join(\", \") +\r\n \"]\"\r\n );\r\n }\r\n var namesOnly = map(function(pair) {\r\n return pair[0];\r\n }, fullAlignments);\r\n var alignmentsOnly = map(function(pair) {\r\n return pair[1];\r\n }, fullAlignments);\r\n\r\n return bitSeq(alignmentsOnly).map(function(parsed) {\r\n var namedParsed = map(function(name, i) {\r\n return [name, parsed[i]];\r\n }, namesOnly);\r\n\r\n return reduce(\r\n function(obj, kv) {\r\n if (kv[0] !== null) {\r\n obj[kv[0]] = kv[1];\r\n }\r\n return obj;\r\n },\r\n {},\r\n namedParsed\r\n );\r\n });\r\n}\r\n\r\nfunction parseBufferFor(other, length) {\r\n ensureBuffer();\r\n return new Parsimmon(function(input, i) {\r\n if (i + length > input.length) {\r\n return makeFailure(i, length + \" bytes for \" + other);\r\n }\r\n return makeSuccess(i + length, input.slice(i, i + length));\r\n });\r\n}\r\n\r\nfunction parseBuffer(length) {\r\n return parseBufferFor(\"buffer\", length).map(function(unsafe) {\r\n return Buffer.from(unsafe);\r\n });\r\n}\r\n\r\nfunction encodedString(encoding, length) {\r\n return parseBufferFor(\"string\", length).map(function(buff) {\r\n return buff.toString(encoding);\r\n });\r\n}\r\n\r\nfunction isInteger(value) {\r\n return typeof value === \"number\" && Math.floor(value) === value;\r\n}\r\n\r\nfunction assertValidIntegerByteLengthFor(who, length) {\r\n if (!isInteger(length) || length < 0 || length > 6) {\r\n throw new Error(who + \" requires integer length in range [0, 6].\");\r\n }\r\n}\r\n\r\nfunction uintBE(length) {\r\n assertValidIntegerByteLengthFor(\"uintBE\", length);\r\n return parseBufferFor(\"uintBE(\" + length + \")\", length).map(function(buff) {\r\n return buff.readUIntBE(0, length);\r\n });\r\n}\r\n\r\nfunction uintLE(length) {\r\n assertValidIntegerByteLengthFor(\"uintLE\", length);\r\n return parseBufferFor(\"uintLE(\" + length + \")\", length).map(function(buff) {\r\n return buff.readUIntLE(0, length);\r\n });\r\n}\r\n\r\nfunction intBE(length) {\r\n assertValidIntegerByteLengthFor(\"intBE\", length);\r\n return parseBufferFor(\"intBE(\" + length + \")\", length).map(function(buff) {\r\n return buff.readIntBE(0, length);\r\n });\r\n}\r\n\r\nfunction intLE(length) {\r\n assertValidIntegerByteLengthFor(\"intLE\", length);\r\n return parseBufferFor(\"intLE(\" + length + \")\", length).map(function(buff) {\r\n return buff.readIntLE(0, length);\r\n });\r\n}\r\n\r\nfunction floatBE() {\r\n return parseBufferFor(\"floatBE\", 4).map(function(buff) {\r\n return buff.readFloatBE(0);\r\n });\r\n}\r\n\r\nfunction floatLE() {\r\n return parseBufferFor(\"floatLE\", 4).map(function(buff) {\r\n return buff.readFloatLE(0);\r\n });\r\n}\r\n\r\nfunction doubleBE() {\r\n return parseBufferFor(\"doubleBE\", 8).map(function(buff) {\r\n return buff.readDoubleBE(0);\r\n });\r\n}\r\n\r\nfunction doubleLE() {\r\n return parseBufferFor(\"doubleLE\", 8).map(function(buff) {\r\n return buff.readDoubleLE(0);\r\n });\r\n}\r\n\r\nfunction toArray(arrLike) {\r\n return Array.prototype.slice.call(arrLike);\r\n}\r\n// -*- Helpers -*-\r\n\r\nfunction isParser(obj) {\r\n return obj instanceof Parsimmon;\r\n}\r\n\r\nfunction isArray(x) {\r\n return {}.toString.call(x) === \"[object Array]\";\r\n}\r\n\r\nfunction isBuffer(x) {\r\n /* global Buffer */\r\n return bufferExists() && Buffer.isBuffer(x);\r\n}\r\n\r\nexport function makeSuccess(index, value) {\r\n return {\r\n status: true,\r\n index: index,\r\n value: value,\r\n furthest: -1,\r\n expected: []\r\n };\r\n}\r\n\r\nexport function makeFailure(index, expected) {\r\n if (!isArray(expected)) {\r\n expected = [expected];\r\n }\r\n return {\r\n status: false,\r\n index: -1,\r\n value: null,\r\n furthest: index,\r\n expected: expected\r\n };\r\n}\r\n\r\nfunction mergeReplies(result, last) {\r\n if (!last) {\r\n return result;\r\n }\r\n if (result.furthest > last.furthest) {\r\n return result;\r\n }\r\n var expected =\r\n result.furthest === last.furthest\r\n ? union(result.expected, last.expected)\r\n : last.expected;\r\n return {\r\n status: result.status,\r\n index: result.index,\r\n value: result.value,\r\n furthest: last.furthest,\r\n expected: expected\r\n };\r\n}\r\n\r\nfunction makeLineColumnIndex(input, i) {\r\n if (isBuffer(input)) {\r\n return {\r\n offset: i,\r\n line: -1,\r\n column: -1\r\n };\r\n }\r\n var lines = input.slice(0, i).split(\"\\n\");\r\n // Note that unlike the character offset, the line and column offsets are\r\n // 1-based.\r\n var lineWeAreUpTo = lines.length;\r\n var columnWeAreUpTo = lines[lines.length - 1].length + 1;\r\n return {\r\n offset: i,\r\n line: lineWeAreUpTo,\r\n column: columnWeAreUpTo\r\n };\r\n}\r\n\r\n// Returns the sorted set union of two arrays of strings\r\nfunction union(xs, ys) {\r\n var obj = {};\r\n for (var i = 0; i < xs.length; i++) {\r\n obj[xs[i]] = true;\r\n }\r\n for (var j = 0; j < ys.length; j++) {\r\n obj[ys[j]] = true;\r\n }\r\n var keys = [];\r\n for (var k in obj) {\r\n if ({}.hasOwnProperty.call(obj, k)) {\r\n keys.push(k);\r\n }\r\n }\r\n keys.sort();\r\n return keys;\r\n}\r\n\r\nfunction assertParser(p) {\r\n if (!isParser(p)) {\r\n throw new Error(\"not a parser: \" + p);\r\n }\r\n}\r\n\r\nfunction get(input, i) {\r\n if (typeof input === \"string\") {\r\n return input.charAt(i);\r\n }\r\n return input[i];\r\n}\r\n\r\n// TODO[ES5]: Switch to Array.isArray eventually.\r\nfunction assertArray(x) {\r\n if (!isArray(x)) {\r\n throw new Error(\"not an array: \" + x);\r\n }\r\n}\r\n\r\nfunction assertNumber(x) {\r\n if (typeof x !== \"number\") {\r\n throw new Error(\"not a number: \" + x);\r\n }\r\n}\r\n\r\nfunction assertRegexp(x) {\r\n if (!(x instanceof RegExp)) {\r\n throw new Error(\"not a regexp: \" + x);\r\n }\r\n var f = flags(x);\r\n for (var i = 0; i < f.length; i++) {\r\n var c = f.charAt(i);\r\n // Only allow regexp flags [imu] for now, since [g] and [y] specifically\r\n // mess up Parsimmon. If more non-stateful regexp flags are added in the\r\n // future, this will need to be revisited.\r\n if (c !== \"i\" && c !== \"m\" && c !== \"u\") {\r\n throw new Error('unsupported regexp flag \"' + c + '\": ' + x);\r\n }\r\n }\r\n}\r\n\r\nfunction assertFunction(x) {\r\n if (typeof x !== \"function\") {\r\n throw new Error(\"not a function: \" + x);\r\n }\r\n}\r\n\r\nfunction assertString(x) {\r\n if (typeof x !== \"string\") {\r\n throw new Error(\"not a string: \" + x);\r\n }\r\n}\r\n\r\n// -*- Error Formatting -*-\r\n\r\nvar linesBeforeStringError = 2;\r\nvar linesAfterStringError = 3;\r\nvar bytesPerLine = 8;\r\nvar bytesBefore = bytesPerLine * 5;\r\nvar bytesAfter = bytesPerLine * 4;\r\nvar defaultLinePrefix = \" \";\r\n\r\nexport function repeat(string, amount) {\r\n return new Array(amount + 1).join(string);\r\n}\r\n\r\nexport function formatExpected(expected) {\r\n if (expected.length === 1) {\r\n return \"Expected:\\n\\n\" + expected[0];\r\n }\r\n return \"Expected one of the following: \\n\\n\" + expected.join(\", \");\r\n}\r\n\r\nexport function leftPad(str, pad, char) {\r\n var add = pad - str.length;\r\n if (add <= 0) {\r\n return str;\r\n }\r\n return repeat(char, add) + str;\r\n}\r\n\r\nfunction toChunks(arr, chunkSize) {\r\n var length = arr.length;\r\n var chunks = [];\r\n var chunkIndex = 0;\r\n\r\n if (length <= chunkSize) {\r\n return [arr.slice()];\r\n }\r\n\r\n for (var i = 0; i < length; i++) {\r\n if (!chunks[chunkIndex]) {\r\n chunks.push([]);\r\n }\r\n\r\n chunks[chunkIndex].push(arr[i]);\r\n\r\n if ((i + 1) % chunkSize === 0) {\r\n chunkIndex++;\r\n }\r\n }\r\n\r\n return chunks;\r\n}\r\n\r\n// Get a range of indexes including `i`-th element and `before` and `after` amount of elements from `arr`.\r\nexport function rangeFromIndexAndOffsets(i, before, after, length) {\r\n return {\r\n // Guard against the negative upper bound for lines included in the output.\r\n from: i - before > 0 ? i - before : 0,\r\n to: i + after > length ? length : i + after\r\n };\r\n}\r\n\r\nexport function byteRangeToRange(byteRange) {\r\n // Exception for inputs smaller than `bytesPerLine`\r\n if (byteRange.from === 0 && byteRange.to === 1) {\r\n return {\r\n from: byteRange.from,\r\n to: byteRange.to\r\n };\r\n }\r\n\r\n return {\r\n from: byteRange.from / bytesPerLine,\r\n // Round `to`, so we don't get float if the amount of bytes is not divisible by `bytesPerLine`\r\n to: Math.floor(byteRange.to / bytesPerLine)\r\n };\r\n}\r\n\r\nexport function formatGot(input, error) {\r\n var index = error.index;\r\n var i = index.offset;\r\n\r\n var verticalMarkerLength = 1;\r\n var column;\r\n var lineWithErrorIndex;\r\n var lines;\r\n var lineRange;\r\n var lastLineNumberLabelLength;\r\n\r\n if (i === input.length) {\r\n return \"Got the end of the input\";\r\n }\r\n\r\n if (isBuffer(input)) {\r\n var byteLineWithErrorIndex = i - (i % bytesPerLine);\r\n var columnByteIndex = i - byteLineWithErrorIndex;\r\n var byteRange = rangeFromIndexAndOffsets(\r\n byteLineWithErrorIndex,\r\n bytesBefore,\r\n bytesAfter + bytesPerLine,\r\n input.length\r\n );\r\n var bytes = input.slice(byteRange.from, byteRange.to);\r\n var bytesInChunks = toChunks(bytes.toJSON().data, bytesPerLine);\r\n\r\n var byteLines = map(function(byteRow) {\r\n return map(function(byteValue) {\r\n // Prefix byte values with a `0` if they are shorter than 2 characters.\r\n return leftPad(byteValue.toString(16), 2, \"0\");\r\n }, byteRow);\r\n }, bytesInChunks);\r\n\r\n lineRange = byteRangeToRange(byteRange);\r\n lineWithErrorIndex = byteLineWithErrorIndex / bytesPerLine;\r\n column = columnByteIndex * 3;\r\n\r\n // Account for an extra space.\r\n if (columnByteIndex >= 4) {\r\n column += 1;\r\n }\r\n\r\n verticalMarkerLength = 2;\r\n lines = map(function(byteLine) {\r\n return byteLine.length <= 4\r\n ? byteLine.join(\" \")\r\n : byteLine.slice(0, 4).join(\" \") + \" \" + byteLine.slice(4).join(\" \");\r\n }, byteLines);\r\n lastLineNumberLabelLength = (\r\n (lineRange.to > 0 ? lineRange.to - 1 : lineRange.to) * 8\r\n ).toString(16).length;\r\n\r\n if (lastLineNumberLabelLength < 2) {\r\n lastLineNumberLabelLength = 2;\r\n }\r\n } else {\r\n var inputLines = input.split(/\\r\\n|[\\n\\r\\u2028\\u2029]/);\r\n column = index.column - 1;\r\n lineWithErrorIndex = index.line - 1;\r\n lineRange = rangeFromIndexAndOffsets(\r\n lineWithErrorIndex,\r\n linesBeforeStringError,\r\n linesAfterStringError,\r\n inputLines.length\r\n );\r\n\r\n lines = inputLines.slice(lineRange.from, lineRange.to);\r\n lastLineNumberLabelLength = lineRange.to.toString().length;\r\n }\r\n\r\n var lineWithErrorCurrentIndex = lineWithErrorIndex - lineRange.from;\r\n\r\n if (isBuffer(input)) {\r\n lastLineNumberLabelLength = (\r\n (lineRange.to > 0 ? lineRange.to - 1 : lineRange.to) * 8\r\n ).toString(16).length;\r\n\r\n if (lastLineNumberLabelLength < 2) {\r\n lastLineNumberLabelLength = 2;\r\n }\r\n }\r\n\r\n var linesWithLineNumbers = reduce(\r\n function(acc, lineSource, index) {\r\n var isLineWithError = index === lineWithErrorCurrentIndex;\r\n var prefix = isLineWithError ? \"> \" : defaultLinePrefix;\r\n var lineNumberLabel;\r\n\r\n if (isBuffer(input)) {\r\n lineNumberLabel = leftPad(\r\n ((lineRange.from + index) * 8).toString(16),\r\n lastLineNumberLabelLength,\r\n \"0\"\r\n );\r\n } else {\r\n lineNumberLabel = leftPad(\r\n (lineRange.from + index + 1).toString(),\r\n lastLineNumberLabelLength,\r\n \" \"\r\n );\r\n }\r\n\r\n return [].concat(\r\n acc,\r\n [prefix + lineNumberLabel + \" | \" + lineSource],\r\n isLineWithError\r\n ? [\r\n defaultLinePrefix +\r\n repeat(\" \", lastLineNumberLabelLength) +\r\n \" | \" +\r\n leftPad(\"\", column, \" \") +\r\n repeat(\"^\", verticalMarkerLength)\r\n ]\r\n : []\r\n );\r\n },\r\n [],\r\n lines\r\n );\r\n\r\n return linesWithLineNumbers.join(\"\\n\");\r\n}\r\n\r\nexport function formatError(input, error) {\r\n return [\r\n \"\\n\",\r\n \"-- PARSING FAILED \" + repeat(\"-\", 50),\r\n \"\\n\\n\",\r\n formatGot(input, error),\r\n \"\\n\\n\",\r\n formatExpected(error.expected),\r\n \"\\n\"\r\n ].join(\"\");\r\n}\r\n\r\nexport function flags(re) {\r\n var s = \"\" + re;\r\n return s.slice(s.lastIndexOf(\"/\") + 1);\r\n}\r\n\r\nexport function anchoredRegexp(re) {\r\n return RegExp(\"^(?:\" + re.source + \")\", flags(re));\r\n}\r\n\r\n// -*- Combinators -*-\r\n\r\nexport function seq() {\r\n var parsers = [].slice.call(arguments);\r\n var numParsers = parsers.length;\r\n for (var j = 0; j < numParsers; j += 1) {\r\n assertParser(parsers[j]);\r\n }\r\n return Parsimmon(function(input, i) {\r\n var result;\r\n var accum = new Array(numParsers);\r\n for (var j = 0; j < numParsers; j += 1) {\r\n result = mergeReplies(parsers[j]._(input, i), result);\r\n if (!result.status) {\r\n return result;\r\n }\r\n accum[j] = result.value;\r\n i = result.index;\r\n }\r\n return mergeReplies(makeSuccess(i, accum), result);\r\n });\r\n}\r\n\r\nexport function seqObj() {\r\n var seenKeys = {};\r\n var totalKeys = 0;\r\n var parsers = toArray(arguments);\r\n var numParsers = parsers.length;\r\n for (var j = 0; j < numParsers; j += 1) {\r\n var p = parsers[j];\r\n if (isParser(p)) {\r\n continue;\r\n }\r\n if (isArray(p)) {\r\n var isWellFormed =\r\n p.length === 2 && typeof p[0] === \"string\" && isParser(p[1]);\r\n if (isWellFormed) {\r\n var key = p[0];\r\n if (Object.prototype.hasOwnProperty.call(seenKeys, key)) {\r\n throw new Error(\"seqObj: duplicate key \" + key);\r\n }\r\n seenKeys[key] = true;\r\n totalKeys++;\r\n continue;\r\n }\r\n }\r\n throw new Error(\r\n \"seqObj arguments must be parsers or [string, parser] array pairs.\"\r\n );\r\n }\r\n if (totalKeys === 0) {\r\n throw new Error(\"seqObj expects at least one named parser, found zero\");\r\n }\r\n return Parsimmon(function(input, i) {\r\n var result;\r\n var accum = {};\r\n for (var j = 0; j < numParsers; j += 1) {\r\n var name;\r\n var parser;\r\n if (isArray(parsers[j])) {\r\n name = parsers[j][0];\r\n parser = parsers[j][1];\r\n } else {\r\n name = null;\r\n parser = parsers[j];\r\n }\r\n result = mergeReplies(parser._(input, i), result);\r\n if (!result.status) {\r\n return result;\r\n }\r\n if (name) {\r\n accum[name] = result.value;\r\n }\r\n i = result.index;\r\n }\r\n return mergeReplies(makeSuccess(i, accum), result);\r\n });\r\n}\r\n\r\nexport function seqMap() {\r\n var args = [].slice.call(arguments);\r\n if (args.length === 0) {\r\n throw new Error(\"seqMap needs at least one argument\");\r\n }\r\n var mapper = args.pop();\r\n assertFunction(mapper);\r\n return seq.apply(null, args).map(function(results) {\r\n return mapper.apply(null, results);\r\n });\r\n}\r\n\r\n// TODO[ES5]: Revisit this with Object.keys and .bind.\r\nexport function createLanguage(parsers) {\r\n var language = {};\r\n for (var key in parsers) {\r\n if ({}.hasOwnProperty.call(parsers, key)) {\r\n (function(key) {\r\n var func = function() {\r\n return parsers[key](language);\r\n };\r\n language[key] = lazy(func);\r\n })(key);\r\n }\r\n }\r\n return language;\r\n}\r\n\r\nexport function alt() {\r\n var parsers = [].slice.call(arguments);\r\n var numParsers = parsers.length;\r\n if (numParsers === 0) {\r\n return fail(\"zero alternates\");\r\n }\r\n for (var j = 0; j < numParsers; j += 1) {\r\n assertParser(parsers[j]);\r\n }\r\n return Parsimmon(function(input, i) {\r\n var result;\r\n for (var j = 0; j < parsers.length; j += 1) {\r\n result = mergeReplies(parsers[j]._(input, i), result);\r\n if (result.status) {\r\n return result;\r\n }\r\n }\r\n return result;\r\n });\r\n}\r\n\r\nexport function sepBy(parser, separator) {\r\n // Argument asserted by sepBy1\r\n return sepBy1(parser, separator).or(succeed([]));\r\n}\r\n\r\nexport function sepBy1(parser, separator) {\r\n assertParser(parser);\r\n assertParser(separator);\r\n var pairs = separator.then(parser).many();\r\n return seqMap(parser, pairs, function(r, rs) {\r\n return [r].concat(rs);\r\n });\r\n}\r\n\r\n// -*- Core Parsing Methods -*-\r\n\r\n_.parse = function(input) {\r\n if (typeof input !== \"string\" && !isBuffer(input)) {\r\n throw new Error(\r\n \".parse must be called with a string or Buffer as its argument\"\r\n );\r\n }\r\n var result = this.skip(eof)._(input, 0);\r\n if (result.status) {\r\n return {\r\n status: true,\r\n value: result.value\r\n };\r\n }\r\n return {\r\n status: false,\r\n index: makeLineColumnIndex(input, result.furthest),\r\n expected: result.expected\r\n };\r\n};\r\n\r\n// -*- Other Methods -*-\r\n\r\n_.tryParse = function(str) {\r\n var result = this.parse(str);\r\n if (result.status) {\r\n return result.value;\r\n } else {\r\n var msg = formatError(str, result);\r\n var err = new Error(msg);\r\n err.type = \"ParsimmonError\";\r\n err.result = result;\r\n throw err;\r\n }\r\n};\r\n\r\n_.or = function(alternative) {\r\n return alt(this, alternative);\r\n};\r\n\r\n_.trim = function(parser) {\r\n return this.wrap(parser, parser);\r\n};\r\n\r\n_.wrap = function(leftParser, rightParser) {\r\n return seqMap(leftParser, this, rightParser, function(left, middle) {\r\n return middle;\r\n });\r\n};\r\n\r\n_.thru = function(wrapper) {\r\n return wrapper(this);\r\n};\r\n\r\n_.then = function(next) {\r\n assertParser(next);\r\n return seq(this, next).map(function(results) {\r\n return results[1];\r\n });\r\n};\r\n\r\n_.many = function() {\r\n var self = this;\r\n\r\n return Parsimmon(function(input, i) {\r\n var accum = [];\r\n var result = undefined;\r\n\r\n for (;;) {\r\n result = mergeReplies(self._(input, i), result);\r\n if (result.status) {\r\n if (i === result.index) {\r\n throw new Error(\r\n \"infinite loop detected in .many() parser --- calling .many() on \" +\r\n \"a parser which can accept zero characters is usually the cause\"\r\n );\r\n }\r\n i = result.index;\r\n accum.push(result.value);\r\n } else {\r\n return mergeReplies(makeSuccess(i, accum), result);\r\n }\r\n }\r\n });\r\n};\r\n\r\n_.tieWith = function(separator) {\r\n assertString(separator);\r\n return this.map(function(args) {\r\n assertArray(args);\r\n if (args.length) {\r\n assertString(args[0]);\r\n var s = args[0];\r\n for (var i = 1; i < args.length; i++) {\r\n assertString(args[i]);\r\n s += separator + args[i];\r\n }\r\n return s;\r\n } else {\r\n return \"\";\r\n }\r\n });\r\n};\r\n\r\n_.tie = function() {\r\n return this.tieWith(\"\");\r\n};\r\n\r\n_.times = function(min, max) {\r\n var self = this;\r\n if (arguments.length < 2) {\r\n max = min;\r\n }\r\n assertNumber(min);\r\n assertNumber(max);\r\n return Parsimmon(function(input, i) {\r\n var accum = [];\r\n var result = undefined;\r\n var prevResult = undefined;\r\n for (var times = 0; times < min; times += 1) {\r\n result = self._(input, i);\r\n prevResult = mergeReplies(result, prevResult);\r\n if (result.status) {\r\n i = result.index;\r\n accum.push(result.value);\r\n } else {\r\n return prevResult;\r\n }\r\n }\r\n for (; times < max; times += 1) {\r\n result = self._(input, i);\r\n prevResult = mergeReplies(result, prevResult);\r\n if (result.status) {\r\n i = result.index;\r\n accum.push(result.value);\r\n } else {\r\n break;\r\n }\r\n }\r\n return mergeReplies(makeSuccess(i, accum), prevResult);\r\n });\r\n};\r\n\r\n_.result = function(res) {\r\n return this.map(function() {\r\n return res;\r\n });\r\n};\r\n\r\n_.atMost = function(n) {\r\n return this.times(0, n);\r\n};\r\n\r\n_.atLeast = function(n) {\r\n return seqMap(this.times(n), this.many(), function(init, rest) {\r\n return init.concat(rest);\r\n });\r\n};\r\n\r\n_.map = function(fn) {\r\n assertFunction(fn);\r\n var self = this;\r\n return Parsimmon(function(input, i) {\r\n var result = self._(input, i);\r\n if (!result.status) {\r\n return result;\r\n }\r\n return mergeReplies(makeSuccess(result.index, fn(result.value)), result);\r\n });\r\n};\r\n\r\n_.contramap = function(fn) {\r\n assertFunction(fn);\r\n var self = this;\r\n return Parsimmon(function(input, i) {\r\n var result = self.parse(fn(input.slice(i)));\r\n if (!result.status) {\r\n return result;\r\n }\r\n return makeSuccess(i + input.length, result.value);\r\n });\r\n};\r\n\r\n_.promap = function(f, g) {\r\n assertFunction(f);\r\n assertFunction(g);\r\n return this.contramap(f).map(g);\r\n};\r\n\r\n_.skip = function(next) {\r\n return seq(this, next).map(function(results) {\r\n return results[0];\r\n });\r\n};\r\n\r\n_.mark = function() {\r\n return seqMap(index, this, index, function(start, value, end) {\r\n return {\r\n start: start,\r\n value: value,\r\n end: end\r\n };\r\n });\r\n};\r\n\r\n_.node = function(name) {\r\n return seqMap(index, this, index, function(start, value, end) {\r\n return {\r\n name: name,\r\n value: value,\r\n start: start,\r\n end: end\r\n };\r\n });\r\n};\r\n\r\n_.sepBy = function(separator) {\r\n return sepBy(this, separator);\r\n};\r\n\r\n_.sepBy1 = function(separator) {\r\n return sepBy1(this, separator);\r\n};\r\n\r\n_.lookahead = function(x) {\r\n return this.skip(lookahead(x));\r\n};\r\n\r\n_.notFollowedBy = function(x) {\r\n return this.skip(notFollowedBy(x));\r\n};\r\n\r\n_.desc = function(expected) {\r\n if (!isArray(expected)) {\r\n expected = [expected];\r\n }\r\n var self = this;\r\n return Parsimmon(function(input, i) {\r\n var reply = self._(input, i);\r\n if (!reply.status) {\r\n reply.expected = expected;\r\n }\r\n return reply;\r\n });\r\n};\r\n\r\n_.fallback = function(result) {\r\n return this.or(succeed(result));\r\n};\r\n\r\n_.ap = function(other) {\r\n return seqMap(other, this, function(f, x) {\r\n return f(x);\r\n });\r\n};\r\n\r\n_.chain = function(f) {\r\n var self = this;\r\n return Parsimmon(function(input, i) {\r\n var result = self._(input, i);\r\n if (!result.status) {\r\n return result;\r\n }\r\n var nextParser = f(result.value);\r\n return mergeReplies(nextParser._(input, result.index), result);\r\n });\r\n};\r\n\r\n// -*- Constructors -*-\r\n\r\nexport function string(str) {\r\n assertString(str);\r\n var expected = \"'\" + str + \"'\";\r\n return Parsimmon(function(input, i) {\r\n var j = i + str.length;\r\n var head = input.slice(i, j);\r\n if (head === str) {\r\n return makeSuccess(j, head);\r\n } else {\r\n return makeFailure(i, expected);\r\n }\r\n });\r\n}\r\n\r\nexport function byte(b) {\r\n ensureBuffer();\r\n assertNumber(b);\r\n if (b > 0xff) {\r\n throw new Error(\r\n \"Value specified to byte constructor (\" +\r\n b +\r\n \"=0x\" +\r\n b.toString(16) +\r\n \") is larger in value than a single byte.\"\r\n );\r\n }\r\n var expected = (b > 0xf ? \"0x\" : \"0x0\") + b.toString(16);\r\n return Parsimmon(function(input, i) {\r\n var head = get(input, i);\r\n if (head === b) {\r\n return makeSuccess(i + 1, head);\r\n } else {\r\n return makeFailure(i, expected);\r\n }\r\n });\r\n}\r\n\r\nexport function regexp(re, group) {\r\n assertRegexp(re);\r\n if (arguments.length >= 2) {\r\n assertNumber(group);\r\n } else {\r\n group = 0;\r\n }\r\n var anchored = anchoredRegexp(re);\r\n var expected = \"\" + re;\r\n return Parsimmon(function(input, i) {\r\n var match = anchored.exec(input.slice(i));\r\n if (match) {\r\n if (0 <= group && group <= match.length) {\r\n var fullMatch = match[0];\r\n var groupMatch = match[group];\r\n return makeSuccess(i + fullMatch.length, groupMatch);\r\n }\r\n var message =\r\n \"valid match group (0 to \" + match.length + \") in \" + expected;\r\n return makeFailure(i, message);\r\n }\r\n return makeFailure(i, expected);\r\n });\r\n}\r\n\r\nexport function succeed(value) {\r\n return Parsimmon(function(input, i) {\r\n return makeSuccess(i, value);\r\n });\r\n}\r\n\r\nexport function fail(expected) {\r\n return Parsimmon(function(input, i) {\r\n return makeFailure(i, expected);\r\n });\r\n}\r\n\r\nexport function lookahead(x) {\r\n if (isParser(x)) {\r\n return Parsimmon(function(input, i) {\r\n var result = x._(input, i);\r\n result.index = i;\r\n result.value = \"\";\r\n return result;\r\n });\r\n } else if (typeof x === \"string\") {\r\n return lookahead(string(x));\r\n } else if (x instanceof RegExp) {\r\n return lookahead(regexp(x));\r\n }\r\n throw new Error(\"not a string, regexp, or parser: \" + x);\r\n}\r\n\r\nexport function notFollowedBy(parser) {\r\n assertParser(parser);\r\n return Parsimmon(function(input, i) {\r\n var result = parser._(input, i);\r\n var text = input.slice(i, result.index);\r\n return result.status\r\n ? makeFailure(i, 'not \"' + text + '\"')\r\n : makeSuccess(i, null);\r\n });\r\n}\r\n\r\nexport function test(predicate) {\r\n assertFunction(predicate);\r\n return Parsimmon(function(input, i) {\r\n var char = get(input, i);\r\n if (i < input.length && predicate(char)) {\r\n return makeSuccess(i + 1, char);\r\n } else {\r\n return makeFailure(i, \"a character/byte matching \" + predicate);\r\n }\r\n });\r\n}\r\n\r\nexport function oneOf(str) {\r\n var expected = str.split(\"\");\r\n for (var idx = 0; idx < expected.length; idx++) {\r\n expected[idx] = \"'\" + expected[idx] + \"'\";\r\n }\r\n return test(function(ch) {\r\n return str.indexOf(ch) >= 0;\r\n }).desc(expected);\r\n}\r\n\r\nexport function noneOf(str) {\r\n return test(function(ch) {\r\n return str.indexOf(ch) < 0;\r\n }).desc(\"none of '\" + str + \"'\");\r\n}\r\n\r\nexport function custom(parsingFunction) {\r\n return Parsimmon(parsingFunction(makeSuccess, makeFailure));\r\n}\r\n\r\n// TODO[ES5]: Improve error message using JSON.stringify eventually.\r\nexport function range(begin, end) {\r\n return test(function(ch) {\r\n return begin <= ch && ch <= end;\r\n }).desc(begin + \"-\" + end);\r\n}\r\n\r\nexport function takeWhile(predicate) {\r\n assertFunction(predicate);\r\n\r\n return Parsimmon(function(input, i) {\r\n var j = i;\r\n while (j < input.length && predicate(get(input, j))) {\r\n j++;\r\n }\r\n return makeSuccess(j, input.slice(i, j));\r\n });\r\n}\r\n\r\nexport function lazy(desc, f) {\r\n if (arguments.length < 2) {\r\n f = desc;\r\n desc = undefined;\r\n }\r\n\r\n var parser = Parsimmon(function(input, i) {\r\n parser._ = f()._;\r\n return parser._(input, i);\r\n });\r\n\r\n if (desc) {\r\n return parser.desc(desc);\r\n } else {\r\n return parser;\r\n }\r\n}\r\n\r\n// -*- Fantasy Land Extras -*-\r\n\r\nfunction empty() {\r\n return fail(\"fantasy-land/empty\");\r\n}\r\n\r\n_.concat = _.or;\r\n_.empty = empty;\r\n_.of = succeed;\r\n_[\"fantasy-land/ap\"] = _.ap;\r\n_[\"fantasy-land/chain\"] = _.chain;\r\n_[\"fantasy-land/concat\"] = _.concat;\r\n_[\"fantasy-land/empty\"] = _.empty;\r\n_[\"fantasy-land/of\"] = _.of;\r\n_[\"fantasy-land/map\"] = _.map;\r\n\r\n// -*- Base Parsers -*-\r\n\r\nexport const index = Parsimmon(function(input, i) {\r\n return makeSuccess(i, makeLineColumnIndex(input, i));\r\n});\r\n\r\nexport const any = Parsimmon(function(input, i) {\r\n if (i >= input.length) {\r\n return makeFailure(i, \"any character/byte\");\r\n }\r\n return makeSuccess(i + 1, get(input, i));\r\n});\r\n\r\nexport const all = Parsimmon(function(input, i) {\r\n return makeSuccess(input.length, input.slice(i));\r\n});\r\n\r\nexport const eof = Parsimmon(function(input, i) {\r\n if (i < input.length) {\r\n return makeFailure(i, \"EOF\");\r\n }\r\n return makeSuccess(i, null);\r\n});\r\n\r\nexport const digit = regexp(/[0-9]/).desc(\"a digit\");\r\nexport const digits = regexp(/[0-9]*/).desc(\"optional digits\");\r\nexport const letter = regexp(/[a-z]/i).desc(\"a letter\");\r\nexport const letters = regexp(/[a-z]*/i).desc(\"optional letters\");\r\nexport const optWhitespace = regexp(/\\s*/).desc(\"optional whitespace\");\r\nexport const whitespace = regexp(/\\s+/).desc(\"whitespace\");\r\nexport const cr = string(\"\\r\");\r\nexport const lf = string(\"\\n\");\r\nexport const crlf = string(\"\\r\\n\");\r\nexport const newline = alt(crlf, lf, cr).desc(\"newline\");\r\nexport const end = alt(newline, eof);","namespace Fable.Parsimmon\r\n\r\nopen Fable.Core\r\nopen Fable.Core.JsInterop\r\n\r\ntype ParseResult<'t> =\r\n abstract status : bool\r\n abstract value : 't\r\n\r\ntype IParserOffSet =\r\n abstract offset : int\r\n abstract line : int\r\n abstract column : int\r\n\r\ntype TokenPosition =\r\n { offset: int\r\n line: int\r\n column: int }\r\n\r\ntype NodeResult<'t> =\r\n { name: string\r\n value: 't\r\n start: TokenPosition\r\n ``end``: TokenPosition }\r\n\r\ntype IParser<'t> =\r\n abstract map<'u> : ('t -> 'u) -> IParser<'u>\r\n abstract parse : string -> ParseResult<'t>\r\n abstract times : int -> IParser<'t []>\r\n abstract times : int * int -> IParser<'t []>\r\n abstract many : unit -> IParser<'t []>\r\n []\r\n abstract chain : IParser<'u> -> IParser<'u>\r\n []\r\n abstract bind : ('t -> IParser<'u>) -> IParser<'u>\r\n abstract skip : IParser<'u> -> IParser<'t>\r\n abstract sepBy : IParser<'u> -> IParser<'t []>\r\n abstract fallback : 't -> IParser<'t>\r\n abstract trim : IParser<'u> -> IParser<'t>\r\n abstract notFollowedBy : IParser<'u> -> IParser<'t>\r\n abstract atMost : int -> IParser<'t[]>\r\n abstract atLeast : int -> IParser<'t[]>\r\n []\r\n abstract orTry : IParser<'t> -> IParser<'t>\r\n abstract sepBy1 : IParser<'u> -> IParser<'t []>\r\n []\r\n abstract node : string -> IParser>\r\n\r\nmodule Parsimmon =\r\n let parseRaw (input: string) (parser: IParser<'t>) =\r\n parser.parse input\r\n\r\n let parse (input: string) (parser: IParser<'t>) =\r\n parser.parse input\r\n |> fun result ->\r\n match result.status with\r\n | true -> Some result.value\r\n | false -> None\r\n\r\n /// A parser that consumes no input and yields an object an object representing the current offset into the parse: it has a 0-based character offset property and 1-based line and column properties\r\n let index : IParser =\r\n import \"index\" \"./Parsimmon.js\"\r\n\r\n /// Returns a new parser which tries parser, and if it fails uses otherParser. Example:\r\n let orTry (otherParser: IParser<'t>) (parser: IParser<'t>) : IParser<'t> =\r\n parser.orTry(otherParser)\r\n\r\n /// Returns a new parser that tries to parse the input exactly `n` times\r\n let times<'t> (n: int) (parser : IParser<'t>) : IParser<'t[]> =\r\n parser.times n\r\n\r\n /// Expects parser at least n times. Yields an array of the results.\r\n let atLeast (n: int) (parser: IParser<'t>) : IParser<'t[]> =\r\n parser.atLeast n\r\n\r\n\r\n /// Expects parser at most n times. Yields an array of the results.\r\n let atMost (n: int) (parser: IParser<'t>) : IParser<'t[]> =\r\n parser.atMost n\r\n\r\n let skip (skipped: IParser<'u>) (keep: IParser<'t>) : IParser<'t> =\r\n keep.skip skipped\r\n\r\n let many (parser : IParser<'t>) : IParser<'t[]> =\r\n parser.many()\r\n\r\n /// Returns a parser that looks for a match to the regexp and yields the entire text matched. The regexp will always match starting at the current parse location.\r\n []\r\n let regex (pattern: string) : IParser = jsNative\r\n /// Returns a parser that looks for a match to the regexp and yields the entire text matched. The regexp will always match starting at the current parse location.\r\n []\r\n let regexGroupNumber (pattern: string) (groupNumber: int): IParser = jsNative\r\n let ofLazy (f: unit -> IParser<'t>) : IParser<'t> =\r\n import \"lazy\" \"./Parsimmon.js\"\r\n\r\n /// This is the same as Parsimmon.sepBy, but matches the parser at least once.\r\n let seperateByAtLeastOne (seperator : IParser<'u>) (parser: IParser<'t>) : IParser<'t[]> =\r\n parser.sepBy1(seperator)\r\n\r\n /// Expects parser \"after\" to follow parser \"before\", and yields the result of \"before\".\r\n let chain (after: IParser<'u>) (before: IParser<'t>) : IParser<'u> =\r\n before.chain after\r\n\r\n /// Returns a new parser which tries parser \"p\", and on success calls the function \"f\" with the result of the parse, which is expected to return another parser, which will be tried next. This allows you to dynamically decide how to continue the parse, which is impossible with the other combinators.\r\n let bind (f: 't -> IParser<'u>) (p: IParser<'t>) : IParser<'u> =\r\n p.bind f\r\n\r\n /// A parser that consumes one letter\r\n let letter : IParser =\r\n import \"letter\" \"./Parsimmon.js\"\r\n\r\n /// Returns a parser that tries `parser` and succeeds if `parser` is able to parse between `min` and `max` times\r\n let timesBetween (min: int) (max: int) (parser: IParser<'u>) =\r\n parser.times(min, max)\r\n\r\n /// A parser that consumes one or more letters\r\n let letters : IParser =\r\n import \"letters\" \"./Parsimmon.js\"\r\n\r\n /// A parser that expects to be at the end of the input (zero characters left).\r\n let endOfFile : IParser =\r\n import \"eof\" \"./Parsimmon.js\"\r\n\r\n /// Returns a parser that looks for anything but whatever \"p\" wants to parse, and does not consume it. Yields the same result as \"before\".\r\n let notFollowedBy (p: IParser<'u>) (before: IParser<'t>) : IParser<'t> =\r\n before.notFollowedBy p\r\n\r\n /// Returns a parser that doesn't consume any input, and yields the given value\r\n let succeed (value: 't) : IParser<'t> =\r\n import \"succeed\" \"./Parsimmon.js\"\r\n\r\n /// Parses using parser, but does not consume what it parses. Yields an empty string.\r\n let lookahead (parser: IParser<'t>) : IParser =\r\n import \"lookahead\" \"./Parsimmon.js\"\r\n\r\n // A parser that consumes one digit\r\n let digit : IParser =\r\n import \"digit\" \"./Parsimmon.js\"\r\n\r\n // A parser that consumes one or more digits\r\n let digits : IParser =\r\n digit\r\n |> many\r\n\r\n /// Returns a new parser which tries \"parser\" and, if it fails, yields value without consuming any input.\r\n let fallback (value: 't) (parser: IParser<'t>) : IParser<'t> =\r\n parser.fallback value\r\n\r\n let seperateBy (content: IParser<'u>) (others: IParser<'t>) : IParser<'t[]> =\r\n others.sepBy(content)\r\n\r\n let between (left: IParser<'t>) (right: IParser<'u>) (middle: IParser<'v>) =\r\n left\r\n |> chain middle\r\n |> skip right\r\n\r\n /// Transforms the parsed value of the given parser.\r\n let map (f: 't -> 'u) (parser: IParser<'t>) = parser.map f\r\n\r\n /// Alias of Parsimmon.concat\r\n let tie (parser: IParser) : IParser =\r\n map (String.concat \"\") parser\r\n\r\n /// A parser that consumes and yields the next character of the input.\r\n let any : IParser =\r\n import \"any\" \"./Parsimmon.js\"\r\n\r\n /// Accepts any number of parsers, yielding the value of the first one that succeeds, backtracking in between.\r\n let choose (ps: IParser<'t> list) : IParser<'t> =\r\n List.reduce (fun acc parser -> acc.orTry(parser)) ps\r\n\r\n /// A parser that consumes and yields the entire remainder of the input.\r\n let all : IParser =\r\n import \"all\" \"./Parsimmon.js\"\r\n\r\n /// Returns a failing parser with the given message.\r\n let fail (input: string) : IParser =\r\n import \"fail\" \"./Parsimmon.js\"\r\n\r\n /// Returns a parser that yield a single character if it passes the predicate function.\r\n let satisfy (f: string -> bool) : IParser =\r\n import \"test\" \"./Parsimmon.js\"\r\n\r\n /// Returns a parser yield a string containing all the next characters that pass the predicate \"f\"\r\n let takeWhile (f: string -> bool) : IParser =\r\n import \"takeWhile\" \"./Parsimmon.js\"\r\n\r\n /// Returns a parser that can only parse the exact given input string\r\n let str (input: string) : IParser =\r\n import \"string\" \"./Parsimmon.js\"\r\n\r\n /// Returns a parser that parses any of the characters of the input string\r\n let oneOf (input: string) : IParser =\r\n import \"oneOf\" \"./Parsimmon.js\"\r\n\r\n let whitespace : IParser =\r\n import \"whitespace\" \"./Parsimmon.js\"\r\n\r\n let optionalWhitespace : IParser =\r\n import \"optWhitespace\" \"./Parsimmon.js\"\r\n\r\n /// Returns a parser that succeeds one or more times\r\n let atLeastOneOrMany (parser: IParser<'t>) : IParser<'t[]> =\r\n atLeast 1 parser\r\n\r\n let stringReturn (input: string) (value: 't) : IParser<'t> =\r\n str input\r\n |> map (fun _ -> value)\r\n\r\n /// Returns a parser that parses comsumes any character of a string other than the characters of the input string\r\n let noneOf (input: string) : IParser =\r\n import \"noneOf\" \"./Parsimmon.js\"\r\n\r\n let seq2 (p1: IParser<'t>) (p2:IParser<'u>) : IParser<'t * 'u> =\r\n import \"seq\" \"./Parsimmon.js\"\r\n\r\n let trim (trimmed: IParser<'a>) (p: IParser<'t>) : IParser<'t> =\r\n p.trim trimmed\r\n\r\n /// Equivalent to `parser.map (String.concat \"\")`\r\n let concat (parser: IParser) : IParser =\r\n parser.map (String.concat \"\")\r\n\r\n let seq3 (p1: IParser<'t>)\r\n (p2: IParser<'u>)\r\n (p3:IParser<'v>) : IParser<'t * 'u * 'v> =\r\n import \"seq\" \"./Parsimmon.js\"\r\n\r\n let seq4 (p1: IParser<'t>)\r\n (p2: IParser<'u>)\r\n (p3:IParser<'v>)\r\n (p4:IParser<'w>) : IParser<'t * 'u * 'v * 'w> =\r\n import \"seq\" \"./Parsimmon.js\"\r\n\r\n let seq5 (p1: IParser<'t>)\r\n (p2: IParser<'u>)\r\n (p3: IParser<'v>)\r\n (p4: IParser<'w>)\r\n (p5: IParser<'q>) : IParser<'t * 'u * 'v * 'w * 'q> =\r\n import \"seq\" \"./Parsimmon.js\"\r\n\r\n /// Equivalent to `parser.node(\"description\")`\r\n let node<'t> description (p:IParser<'t>) = p.node(description)","namespace Fable.SimpleJson\n\nopen Fable.Parsimmon\n\n#nowarn \"40\"\n\nmodule Parser =\n\n let digits = \n Parsimmon.digit \n |> Parsimmon.atLeastOneOrMany\n |> Parsimmon.concat\n\n let jint = digits |> Parsimmon.map float\n\n let negJint = \n Parsimmon.seq2 (Parsimmon.str \"-\") jint \n |> Parsimmon.map (fun (sign, number) -> -number)\n\n let jfloat =\n let floatWithComma =\n Parsimmon.regex \"-?(0|[1-9][0-9]*)?[.][0-9]+([eE][+-]?[0-9]+)?\"\n let floatWithoutComma =\n Parsimmon.regex \"-?[1-9][0-9]*[eE][+-]?[0-9]+\"\n\n [ floatWithComma; floatWithoutComma ]\n |> Parsimmon.choose\n |> Parsimmon.map float\n\n let jnumber = \n [jfloat; jint; negJint] \n |> Parsimmon.choose\n |> Parsimmon.map JNumber\n\n let jbool = \n [ Parsimmon.stringReturn \"true\" (JBool true)\n Parsimmon.stringReturn \"false\" (JBool false)]\n |> Parsimmon.choose\n\n let jnull = Parsimmon.stringReturn \"null\" JNull\n\n let stringLiteral =\n let escape = \n Parsimmon.oneOf \"\\\"\\\\/bfnrt\"\n |> Parsimmon.map(function\n | \"b\" -> \"\\b\"\n | \"f\" -> \"\\u000C\"\n | \"n\" -> \"\\n\"\n | \"r\" -> \"\\r\"\n | \"t\" -> \"\\t\"\n | c -> c) // every other char is mapped to itself\n\n let escapedCharSnippet = \n Parsimmon.seq2 (Parsimmon.str \"\\\\\") escape\n |> Parsimmon.map snd\n\n let normalCharSnippet = Parsimmon.satisfy (fun c -> c <> \"\\\"\" && c <> \"\\\\\")\n\n let anyCharSnippet = \n normalCharSnippet\n |> Parsimmon.orTry escapedCharSnippet\n |> Parsimmon.many\n |> Parsimmon.concat\n\n anyCharSnippet\n |> Parsimmon.between (Parsimmon.str \"\\\"\") (Parsimmon.str \"\\\"\")\n \n let jstring = stringLiteral.map JString\n\n let withWhitespace p = \n Parsimmon.between (Parsimmon.optionalWhitespace) (Parsimmon.optionalWhitespace) p\n \n let jvalue = \n [ jnull; jbool; jnumber; jstring ]\n |> List.map withWhitespace\n |> Parsimmon.choose\n \n let comma = withWhitespace (Parsimmon.str \",\")\n \n let rec json = Parsimmon.ofLazy <| fun () ->\n \n let leftBracket = withWhitespace (Parsimmon.str \"[\")\n let rightBracket = withWhitespace (Parsimmon.str \"]\")\n \n let arrayValue = Parsimmon.seperateBy comma json\n \n let jarray = \n arrayValue\n |> Parsimmon.between leftBracket rightBracket\n |> Parsimmon.map (List.ofArray >> JArray)\n\n let leftBrace = withWhitespace (Parsimmon.str \"{\")\n let rightBrace = withWhitespace (Parsimmon.str \"}\")\n \n let keyValues = \n Parsimmon.seq3 \n (withWhitespace stringLiteral)\n (withWhitespace (Parsimmon.str \":\"))\n (withWhitespace json)\n |> Parsimmon.map (fun (key, _ , value) -> key,value)\n |> Parsimmon.seperateBy comma\n\n let jobject = \n keyValues\n |> Parsimmon.between leftBrace rightBrace\n |> Parsimmon.map (List.ofArray >> Map.ofList >> JObject)\n\n [jvalue; jarray; jobject]\n |> Parsimmon.choose\n \n let jsonParser = withWhitespace json\n","import { Record } from \"../Types.js\";\r\nimport { record_type, array_type, int32_type } from \"../Reflection.js\";\r\nimport { op_LeftShift, op_BitwiseAnd, op_Addition, compare, op_Subtraction, op_Division, equals, fromInteger, op_Multiply, op_Modulus, toInt, fromBits } from \"../Long.js\";\r\nimport { copy, initialize, map, fill } from \"../Array.js\";\r\nimport { toArray, empty, head, tail, isEmpty, cons } from \"../List.js\";\r\nimport { int32ToString } from \"../Util.js\";\r\nimport { isNullOrEmpty, join } from \"../String.js\";\r\n\r\nexport class BigNat extends Record {\r\n constructor(bound, digits) {\r\n super();\r\n this.bound = (bound | 0);\r\n this.digits = digits;\r\n }\r\n}\r\n\r\nexport function BigNat$reflection() {\r\n return record_type(\"BigInt.BigNat\", [], BigNat, () => [[\"bound\", int32_type], [\"digits\", array_type(int32_type)]]);\r\n}\r\n\r\nexport function BigNatModule_FFT_pow32(x_mut, n_mut) {\r\n BigNatModule_FFT_pow32:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (n === 0) {\r\n return 1;\r\n }\r\n else if ((n % 2) === 0) {\r\n x_mut = (x * x);\r\n n_mut = (~(~(n / 2)));\r\n continue BigNatModule_FFT_pow32;\r\n }\r\n else {\r\n return (x * BigNatModule_FFT_pow32(x * x, ~(~(n / 2)))) | 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_FFT_leastBounding2Power(b) {\r\n const findBounding2Power = (b_1_mut, tp_mut, i_mut) => {\r\n findBounding2Power:\r\n while (true) {\r\n const b_1 = b_1_mut, tp = tp_mut, i = i_mut;\r\n if (b_1 <= tp) {\r\n return [tp, i];\r\n }\r\n else {\r\n b_1_mut = b_1;\r\n tp_mut = (tp * 2);\r\n i_mut = (i + 1);\r\n continue findBounding2Power;\r\n }\r\n break;\r\n }\r\n };\r\n return findBounding2Power(b, 1, 0);\r\n}\r\n\r\nexport const BigNatModule_FFT_p = fromBits(2013265921, 0, false);\r\n\r\nconst BigNatModule_FFT_patternInput$004075 = [27, 15, 31, 440564289];\r\n\r\nexport const BigNatModule_FFT_w = BigNatModule_FFT_patternInput$004075[3];\r\n\r\nexport const BigNatModule_FFT_m = BigNatModule_FFT_patternInput$004075[1];\r\n\r\nexport const BigNatModule_FFT_k = BigNatModule_FFT_patternInput$004075[0];\r\n\r\nexport const BigNatModule_FFT_g = BigNatModule_FFT_patternInput$004075[2];\r\n\r\nexport const BigNatModule_FFT_primeP = BigNatModule_FFT_p;\r\n\r\nexport const BigNatModule_FFT_maxBitsInsideFp = 30;\r\n\r\nexport const BigNatModule_FFT_Fp_p = 2013265921;\r\n\r\nexport const BigNatModule_FFT_Fp_p64 = fromBits(2013265921, 0, true);\r\n\r\nexport function BigNatModule_FFT_Fp_toInt(x) {\r\n return ~(~x);\r\n}\r\n\r\nexport function BigNatModule_FFT_Fp_ofInt32(x) {\r\n return x >>> 0;\r\n}\r\n\r\nexport const BigNatModule_FFT_Fp_mzero = 0;\r\n\r\nexport const BigNatModule_FFT_Fp_mone = 1;\r\n\r\nexport const BigNatModule_FFT_Fp_mtwo = 2;\r\n\r\nexport function BigNatModule_FFT_Fp_mpow(x_mut, n_mut) {\r\n BigNatModule_FFT_Fp_mpow:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (n === 0) {\r\n return BigNatModule_FFT_Fp_mone;\r\n }\r\n else if ((n % 2) === 0) {\r\n x_mut = (toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(x, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0);\r\n n_mut = (~(~(n / 2)));\r\n continue BigNatModule_FFT_Fp_mpow;\r\n }\r\n else {\r\n const y_2 = BigNatModule_FFT_Fp_mpow(toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(x, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0, ~(~(n / 2)));\r\n return toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(y_2, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_FFT_Fp_mpowL(x_mut, n_mut) {\r\n BigNatModule_FFT_Fp_mpowL:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (equals(n, fromBits(0, 0, false))) {\r\n return BigNatModule_FFT_Fp_mone;\r\n }\r\n else if (equals(op_Modulus(n, fromBits(2, 0, false)), fromBits(0, 0, false))) {\r\n x_mut = (toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(x, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0);\r\n n_mut = op_Division(n, fromBits(2, 0, false));\r\n continue BigNatModule_FFT_Fp_mpowL;\r\n }\r\n else {\r\n const y_2 = BigNatModule_FFT_Fp_mpowL(toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(x, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0, op_Division(n, fromBits(2, 0, false)));\r\n return toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(y_2, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_FFT_Fp_m2PowNthRoot(n) {\r\n return BigNatModule_FFT_Fp_mpow(BigNatModule_FFT_w >>> 0, BigNatModule_FFT_pow32(2, BigNatModule_FFT_k - n));\r\n}\r\n\r\nexport function BigNatModule_FFT_Fp_minv(x) {\r\n return BigNatModule_FFT_Fp_mpowL(x, op_Subtraction(BigNatModule_FFT_primeP, fromBits(2, 0, false)));\r\n}\r\n\r\nexport function BigNatModule_FFT_computeFFT(lambda, mu, n, w, u, res, offset) {\r\n let x_1, x_3, y_5;\r\n if (n === 1) {\r\n res[offset] = u[mu];\r\n }\r\n else {\r\n const halfN = (~(~(n / 2))) | 0;\r\n const ww = toInt(op_Modulus(op_Multiply(fromInteger(w, true, 6), fromInteger(w, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n const offsetHalfN = (offset + halfN) | 0;\r\n BigNatModule_FFT_computeFFT(lambda * 2, mu, halfN, ww, u, res, offset);\r\n BigNatModule_FFT_computeFFT(lambda * 2, lambda + mu, halfN, ww, u, res, offsetHalfN);\r\n let wj = BigNatModule_FFT_Fp_mone;\r\n for (let j = 0; j <= (halfN - 1); j++) {\r\n const even = res[offset + j];\r\n const odd = res[offsetHalfN + j];\r\n res[offset + j] = ((even + ((x_1 = wj, toInt(op_Modulus(op_Multiply(fromInteger(x_1, true, 6), fromInteger(odd, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0))) % BigNatModule_FFT_Fp_p);\r\n res[offsetHalfN + j] = (((even + BigNatModule_FFT_Fp_p) - ((x_3 = wj, toInt(op_Modulus(op_Multiply(fromInteger(x_3, true, 6), fromInteger(odd, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0))) % BigNatModule_FFT_Fp_p);\r\n wj = ((y_5 = wj, toInt(op_Modulus(op_Multiply(fromInteger(w, true, 6), fromInteger(y_5, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0));\r\n }\r\n }\r\n}\r\n\r\nexport function BigNatModule_FFT_computFftInPlace(n, w, u) {\r\n const res = fill(new Uint32Array(n), 0, n, BigNatModule_FFT_Fp_mzero);\r\n BigNatModule_FFT_computeFFT(1, 0, n, w, u, res, 0);\r\n return res;\r\n}\r\n\r\nexport function BigNatModule_FFT_computeInverseFftInPlace(n, w, uT) {\r\n const bigKInv = BigNatModule_FFT_Fp_minv(n >>> 0);\r\n return map((y) => (toInt(op_Modulus(op_Multiply(fromInteger(bigKInv, true, 6), fromInteger(y, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0), BigNatModule_FFT_computFftInPlace(n, BigNatModule_FFT_Fp_minv(w), uT), Uint32Array);\r\n}\r\n\r\nexport const BigNatModule_FFT_maxTwoPower = 29;\r\n\r\nexport const BigNatModule_FFT_twoPowerTable = initialize(BigNatModule_FFT_maxTwoPower - 1, (i) => BigNatModule_FFT_pow32(2, i), Int32Array);\r\n\r\nexport function BigNatModule_FFT_computeFftPaddedPolynomialProduct(bigK, k, u, v) {\r\n const w = BigNatModule_FFT_Fp_m2PowNthRoot(k);\r\n const n = bigK | 0;\r\n const uT = BigNatModule_FFT_computFftInPlace(n, w, u);\r\n const vT = BigNatModule_FFT_computFftInPlace(n, w, v);\r\n return BigNatModule_FFT_computeInverseFftInPlace(n, w, initialize(n, (i) => {\r\n const x = uT[i];\r\n const y = vT[i];\r\n return toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(y, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n }, Uint32Array));\r\n}\r\n\r\nexport function BigNatModule_FFT_padTo(n, u) {\r\n const uBound = u.length | 0;\r\n return initialize(n, (i) => ((i < uBound) ? BigNatModule_FFT_Fp_ofInt32(u[i]) : BigNatModule_FFT_Fp_mzero), Uint32Array);\r\n}\r\n\r\nexport function BigNatModule_FFT_computeFftPolynomialProduct(degu, u, degv, v) {\r\n const patternInput = BigNatModule_FFT_leastBounding2Power((degu + degv) + 1);\r\n const bigK = patternInput[0] | 0;\r\n const w = BigNatModule_FFT_Fp_m2PowNthRoot(patternInput[1]);\r\n const u_1 = BigNatModule_FFT_padTo(bigK, u);\r\n const v_1 = BigNatModule_FFT_padTo(bigK, v);\r\n const n = bigK | 0;\r\n const uT = BigNatModule_FFT_computFftInPlace(n, w, u_1);\r\n const vT = BigNatModule_FFT_computFftInPlace(n, w, v_1);\r\n return map(BigNatModule_FFT_Fp_toInt, BigNatModule_FFT_computeInverseFftInPlace(n, w, initialize(n, (i) => {\r\n const x = uT[i];\r\n const y = vT[i];\r\n return toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(y, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n }, Uint32Array)), Int32Array);\r\n}\r\n\r\nexport const BigNatModule_FFT_mzero = BigNatModule_FFT_Fp_mzero;\r\n\r\nexport const BigNatModule_FFT_mone = BigNatModule_FFT_Fp_mone;\r\n\r\nexport const BigNatModule_FFT_maxFp = ((BigNatModule_FFT_Fp_p + BigNatModule_FFT_Fp_p) - BigNatModule_FFT_mone) % BigNatModule_FFT_Fp_p;\r\n\r\nexport function BigNatModule_bound(n) {\r\n return n.bound;\r\n}\r\n\r\nexport function BigNatModule_setBound(n, v) {\r\n n.bound = (v | 0);\r\n}\r\n\r\nexport function BigNatModule_coeff(n, i) {\r\n return n.digits[i];\r\n}\r\n\r\nexport function BigNatModule_coeff64(n, i) {\r\n return fromInteger(BigNatModule_coeff(n, i), false, 2);\r\n}\r\n\r\nexport function BigNatModule_setCoeff(n, i, v) {\r\n n.digits[i] = (v | 0);\r\n}\r\n\r\nexport function BigNatModule_pow64(x_mut, n_mut) {\r\n BigNatModule_pow64:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (n === 0) {\r\n return fromBits(1, 0, false);\r\n }\r\n else if ((n % 2) === 0) {\r\n x_mut = op_Multiply(x, x);\r\n n_mut = (~(~(n / 2)));\r\n continue BigNatModule_pow64;\r\n }\r\n else {\r\n return op_Multiply(x, BigNatModule_pow64(op_Multiply(x, x), ~(~(n / 2))));\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_pow32(x_mut, n_mut) {\r\n BigNatModule_pow32:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (n === 0) {\r\n return 1;\r\n }\r\n else if ((n % 2) === 0) {\r\n x_mut = (x * x);\r\n n_mut = (~(~(n / 2)));\r\n continue BigNatModule_pow32;\r\n }\r\n else {\r\n return (x * BigNatModule_pow32(x * x, ~(~(n / 2)))) | 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_hash(n) {\r\n let res = 0;\r\n for (let i = 0; i <= (n.bound - 1); i++) {\r\n res = ((n.digits[i] + (res << 3)) | 0);\r\n }\r\n return res | 0;\r\n}\r\n\r\nexport function BigNatModule_maxInt(a, b) {\r\n if (a < b) {\r\n return b | 0;\r\n }\r\n else {\r\n return a | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_minInt(a, b) {\r\n if (a < b) {\r\n return a | 0;\r\n }\r\n else {\r\n return b | 0;\r\n }\r\n}\r\n\r\nexport const BigNatModule_baseBits = 24;\r\n\r\nexport const BigNatModule_baseN = 16777216;\r\n\r\nexport const BigNatModule_baseMask = 16777215;\r\n\r\nexport const BigNatModule_baseNi64 = fromBits(16777216, 0, false);\r\n\r\nexport const BigNatModule_baseMaski64 = fromBits(16777215, 0, false);\r\n\r\nexport const BigNatModule_baseMaskU = fromBits(16777215, 0, true);\r\n\r\nexport const BigNatModule_baseMask32A = 16777215;\r\n\r\nexport const BigNatModule_baseMask32B = 255;\r\n\r\nexport const BigNatModule_baseShift32B = 24;\r\n\r\nexport const BigNatModule_baseMask64A = 16777215;\r\n\r\nexport const BigNatModule_baseMask64B = 16777215;\r\n\r\nexport const BigNatModule_baseMask64C = 65535;\r\n\r\nexport const BigNatModule_baseShift64B = 24;\r\n\r\nexport const BigNatModule_baseShift64C = 48;\r\n\r\nexport function BigNatModule_divbase(x) {\r\n return ~(~((x >>> 0) >>> BigNatModule_baseBits));\r\n}\r\n\r\nexport function BigNatModule_modbase(x) {\r\n return x & BigNatModule_baseMask;\r\n}\r\n\r\nexport function BigNatModule_createN(b) {\r\n return new BigNat(b, new Int32Array(b));\r\n}\r\n\r\nexport function BigNatModule_copyN(x) {\r\n return new BigNat(x.bound, copy(x.digits));\r\n}\r\n\r\nexport function BigNatModule_normN(n) {\r\n const findLeastBound = (na_mut, i_mut) => {\r\n findLeastBound:\r\n while (true) {\r\n const na = na_mut, i = i_mut;\r\n if ((i === -1) ? true : (na[i] !== 0)) {\r\n return (i + 1) | 0;\r\n }\r\n else {\r\n na_mut = na;\r\n i_mut = (i - 1);\r\n continue findLeastBound;\r\n }\r\n break;\r\n }\r\n };\r\n const bound = findLeastBound(n.digits, n.bound - 1) | 0;\r\n n.bound = (bound | 0);\r\n return n;\r\n}\r\n\r\nexport const BigNatModule_boundInt = 2;\r\n\r\nexport const BigNatModule_boundInt64 = 3;\r\n\r\nexport const BigNatModule_boundBase = 1;\r\n\r\nexport function BigNatModule_embed(x) {\r\n const x_1 = ((x < 0) ? 0 : x) | 0;\r\n if (x_1 < BigNatModule_baseN) {\r\n const r = BigNatModule_createN(1);\r\n r.digits[0] = (x_1 | 0);\r\n return BigNatModule_normN(r);\r\n }\r\n else {\r\n const r_1 = BigNatModule_createN(BigNatModule_boundInt);\r\n for (let i = 0; i <= (BigNatModule_boundInt - 1); i++) {\r\n r_1.digits[i] = (((~(~(x_1 / BigNatModule_pow32(BigNatModule_baseN, i)))) % BigNatModule_baseN) | 0);\r\n }\r\n return BigNatModule_normN(r_1);\r\n }\r\n}\r\n\r\nexport function BigNatModule_embed64(x) {\r\n const x_1 = (compare(x, fromBits(0, 0, false)) < 0) ? fromBits(0, 0, false) : x;\r\n const r = BigNatModule_createN(BigNatModule_boundInt64);\r\n for (let i = 0; i <= (BigNatModule_boundInt64 - 1); i++) {\r\n r.digits[i] = ((~(~toInt(op_Modulus(op_Division(x_1, BigNatModule_pow64(BigNatModule_baseNi64, i)), BigNatModule_baseNi64)))) | 0);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_eval32(n) {\r\n if (n.bound === 1) {\r\n return n.digits[0] | 0;\r\n }\r\n else {\r\n let acc = 0;\r\n for (let i = n.bound - 1; i >= 0; i--) {\r\n acc = ((n.digits[i] + (BigNatModule_baseN * acc)) | 0);\r\n }\r\n return acc | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_eval64(n) {\r\n if (n.bound === 1) {\r\n return fromInteger(n.digits[0], false, 2);\r\n }\r\n else {\r\n let acc = fromBits(0, 0, false);\r\n for (let i = n.bound - 1; i >= 0; i--) {\r\n acc = op_Addition(fromInteger(n.digits[i], false, 2), op_Multiply(BigNatModule_baseNi64, acc));\r\n }\r\n return acc;\r\n }\r\n}\r\n\r\nexport const BigNatModule_one = BigNatModule_embed(1);\r\n\r\nexport const BigNatModule_zero = BigNatModule_embed(0);\r\n\r\nexport function BigNatModule_restrictTo(d, n) {\r\n return new BigNat(BigNatModule_minInt(d, n.bound), n.digits);\r\n}\r\n\r\nexport function BigNatModule_shiftUp(d, n) {\r\n const m = BigNatModule_createN(n.bound + d);\r\n for (let i = 0; i <= (n.bound - 1); i++) {\r\n m.digits[i + d] = (n.digits[i] | 0);\r\n }\r\n return m;\r\n}\r\n\r\nexport function BigNatModule_shiftDown(d, n) {\r\n if ((n.bound - d) <= 0) {\r\n return BigNatModule_zero;\r\n }\r\n else {\r\n const m = BigNatModule_createN(n.bound - d);\r\n for (let i = 0; i <= (m.bound - 1); i++) {\r\n m.digits[i] = (n.digits[i + d] | 0);\r\n }\r\n return m;\r\n }\r\n}\r\n\r\nexport function BigNatModule_degree(n) {\r\n return n.bound - 1;\r\n}\r\n\r\nexport function BigNatModule_addP(i_mut, n_mut, c_mut, p_mut, q_mut, r_mut) {\r\n let z, i_1, z_1, i_2;\r\n BigNatModule_addP:\r\n while (true) {\r\n const i = i_mut, n = n_mut, c = c_mut, p = p_mut, q = q_mut, r = r_mut;\r\n if (i < n) {\r\n const x = ((((z = p, (i_1 = (i | 0), (i_1 < z.bound) ? z.digits[i_1] : 0))) + ((z_1 = q, (i_2 = (i | 0), (i_2 < z_1.bound) ? z_1.digits[i_2] : 0)))) + c) | 0;\r\n r.digits[i] = (BigNatModule_modbase(x) | 0);\r\n i_mut = (i + 1);\r\n n_mut = n;\r\n c_mut = BigNatModule_divbase(x);\r\n p_mut = p;\r\n q_mut = q;\r\n r_mut = r;\r\n continue BigNatModule_addP;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_add(p, q) {\r\n const rbound = (1 + BigNatModule_maxInt(p.bound, q.bound)) | 0;\r\n const r = BigNatModule_createN(rbound);\r\n BigNatModule_addP(0, rbound, 0, p, q, r);\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_subP(i_mut, n_mut, c_mut, p_mut, q_mut, r_mut) {\r\n let z, i_1, z_1, i_2;\r\n BigNatModule_subP:\r\n while (true) {\r\n const i = i_mut, n = n_mut, c = c_mut, p = p_mut, q = q_mut, r = r_mut;\r\n if (i < n) {\r\n const x = ((((z = p, (i_1 = (i | 0), (i_1 < z.bound) ? z.digits[i_1] : 0))) - ((z_1 = q, (i_2 = (i | 0), (i_2 < z_1.bound) ? z_1.digits[i_2] : 0)))) + c) | 0;\r\n if (x > 0) {\r\n r.digits[i] = (BigNatModule_modbase(x) | 0);\r\n i_mut = (i + 1);\r\n n_mut = n;\r\n c_mut = BigNatModule_divbase(x);\r\n p_mut = p;\r\n q_mut = q;\r\n r_mut = r;\r\n continue BigNatModule_subP;\r\n }\r\n else {\r\n const x_1 = (x + BigNatModule_baseN) | 0;\r\n r.digits[i] = (BigNatModule_modbase(x_1) | 0);\r\n i_mut = (i + 1);\r\n n_mut = n;\r\n c_mut = (BigNatModule_divbase(x_1) - 1);\r\n p_mut = p;\r\n q_mut = q;\r\n r_mut = r;\r\n continue BigNatModule_subP;\r\n }\r\n }\r\n else {\r\n return c !== 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_sub(p, q) {\r\n const rbound = BigNatModule_maxInt(p.bound, q.bound) | 0;\r\n const r = BigNatModule_createN(rbound);\r\n if (BigNatModule_subP(0, rbound, 0, p, q, r)) {\r\n return BigNatModule_embed(0);\r\n }\r\n else {\r\n return BigNatModule_normN(r);\r\n }\r\n}\r\n\r\nexport function BigNatModule_isZero(p) {\r\n return p.bound === 0;\r\n}\r\n\r\nexport function BigNatModule_IsZero(p) {\r\n return BigNatModule_isZero(p);\r\n}\r\n\r\nexport function BigNatModule_isOne(p) {\r\n if (p.bound === 1) {\r\n return p.digits[0] === 1;\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigNatModule_equal(p, q) {\r\n if (p.bound === q.bound) {\r\n const check = (pa_mut, qa_mut, i_mut) => {\r\n check:\r\n while (true) {\r\n const pa = pa_mut, qa = qa_mut, i = i_mut;\r\n if (i === -1) {\r\n return true;\r\n }\r\n else if (pa[i] === qa[i]) {\r\n pa_mut = pa;\r\n qa_mut = qa;\r\n i_mut = (i - 1);\r\n continue check;\r\n }\r\n else {\r\n return false;\r\n }\r\n break;\r\n }\r\n };\r\n return check(p.digits, q.digits, p.bound - 1);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigNatModule_shiftCompare(p, pn, q, qn) {\r\n if ((p.bound + pn) < (q.bound + qn)) {\r\n return -1;\r\n }\r\n else if ((p.bound + pn) > (q.bound + pn)) {\r\n return 1;\r\n }\r\n else {\r\n const check = (pa_mut, qa_mut, i_mut) => {\r\n check:\r\n while (true) {\r\n const pa = pa_mut, qa = qa_mut, i = i_mut;\r\n if (i === -1) {\r\n return 0;\r\n }\r\n else {\r\n const pai = ((i < pn) ? 0 : pa[i - pn]) | 0;\r\n const qai = ((i < qn) ? 0 : qa[i - qn]) | 0;\r\n if (pai === qai) {\r\n pa_mut = pa;\r\n qa_mut = qa;\r\n i_mut = (i - 1);\r\n continue check;\r\n }\r\n else if (pai < qai) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return check(p.digits, q.digits, (p.bound + pn) - 1) | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_compare(p, q) {\r\n if (p.bound < q.bound) {\r\n return -1;\r\n }\r\n else if (p.bound > q.bound) {\r\n return 1;\r\n }\r\n else {\r\n const check = (pa_mut, qa_mut, i_mut) => {\r\n check:\r\n while (true) {\r\n const pa = pa_mut, qa = qa_mut, i = i_mut;\r\n if (i === -1) {\r\n return 0;\r\n }\r\n else if (pa[i] === qa[i]) {\r\n pa_mut = pa;\r\n qa_mut = qa;\r\n i_mut = (i - 1);\r\n continue check;\r\n }\r\n else if (pa[i] < qa[i]) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n break;\r\n }\r\n };\r\n return check(p.digits, q.digits, p.bound - 1) | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_lt(p, q) {\r\n return BigNatModule_compare(p, q) === -1;\r\n}\r\n\r\nexport function BigNatModule_gt(p, q) {\r\n return BigNatModule_compare(p, q) === 1;\r\n}\r\n\r\nexport function BigNatModule_lte(p, q) {\r\n return BigNatModule_compare(p, q) !== 1;\r\n}\r\n\r\nexport function BigNatModule_gte(p, q) {\r\n return BigNatModule_compare(p, q) !== -1;\r\n}\r\n\r\nexport function BigNatModule_min(a, b) {\r\n if (BigNatModule_lt(a, b)) {\r\n return a;\r\n }\r\n else {\r\n return b;\r\n }\r\n}\r\n\r\nexport function BigNatModule_max(a, b) {\r\n if (BigNatModule_lt(a, b)) {\r\n return b;\r\n }\r\n else {\r\n return a;\r\n }\r\n}\r\n\r\nexport function BigNatModule_contributeArr(a_mut, i_mut, c_mut) {\r\n BigNatModule_contributeArr:\r\n while (true) {\r\n const a = a_mut, i = i_mut, c = c_mut;\r\n const x = op_Addition(fromInteger(a[i], false, 2), c);\r\n const c_1 = op_Division(x, BigNatModule_baseNi64);\r\n const x_3 = (~(~toInt(op_BitwiseAnd(x, BigNatModule_baseMaski64)))) | 0;\r\n a[i] = (x_3 | 0);\r\n if (compare(c_1, fromBits(0, 0, false)) > 0) {\r\n a_mut = a;\r\n i_mut = (i + 1);\r\n c_mut = c_1;\r\n continue BigNatModule_contributeArr;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_scale(k, p) {\r\n const r = BigNatModule_createN(p.bound + BigNatModule_boundInt);\r\n const k_1 = fromInteger(k, false, 2);\r\n for (let i = 0; i <= (p.bound - 1); i++) {\r\n BigNatModule_contributeArr(r.digits, i, op_Multiply(k_1, fromInteger(p.digits[i], false, 2)));\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBookBothSmall(p, q) {\r\n const r = BigNatModule_createN(2);\r\n const rak = op_Multiply(fromInteger(p, false, 2), fromInteger(q, false, 2));\r\n BigNatModule_setCoeff(r, 0, ~(~toInt(op_BitwiseAnd(rak, BigNatModule_baseMaski64))));\r\n BigNatModule_setCoeff(r, 1, ~(~toInt(op_Division(rak, BigNatModule_baseNi64))));\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBookCarry(r_mut, c_mut, k_mut) {\r\n BigNatModule_mulSchoolBookCarry:\r\n while (true) {\r\n const r = r_mut, c = c_mut, k = k_mut;\r\n if (compare(c, fromBits(0, 0, false)) > 0) {\r\n const rak = op_Addition(BigNatModule_coeff64(r, k), c);\r\n BigNatModule_setCoeff(r, k, ~(~toInt(op_BitwiseAnd(rak, BigNatModule_baseMaski64))));\r\n r_mut = r;\r\n c_mut = op_Division(rak, BigNatModule_baseNi64);\r\n k_mut = (k + 1);\r\n continue BigNatModule_mulSchoolBookCarry;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBookOneSmall(p, q) {\r\n const bp = BigNatModule_bound(p) | 0;\r\n const r = BigNatModule_createN(bp + 1);\r\n const q_1 = fromInteger(q, false, 2);\r\n let c = fromBits(0, 0, false);\r\n for (let i = 0; i <= (bp - 1); i++) {\r\n const rak = op_Addition(op_Addition(c, BigNatModule_coeff64(r, i)), op_Multiply(BigNatModule_coeff64(p, i), q_1));\r\n BigNatModule_setCoeff(r, i, ~(~toInt(op_BitwiseAnd(rak, BigNatModule_baseMaski64))));\r\n c = op_Division(rak, BigNatModule_baseNi64);\r\n }\r\n BigNatModule_mulSchoolBookCarry(r, c, bp);\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBookNeitherSmall(p, q) {\r\n const r = BigNatModule_createN(p.bound + q.bound);\r\n const ra = r.digits;\r\n for (let i = 0; i <= (p.bound - 1); i++) {\r\n const pai = fromInteger(p.digits[i], false, 2);\r\n let c = fromBits(0, 0, false);\r\n let k = i;\r\n for (let j = 0; j <= (q.bound - 1); j++) {\r\n const qaj = fromInteger(q.digits[j], false, 2);\r\n const rak = op_Addition(op_Addition(fromInteger(ra[k], false, 2), c), op_Multiply(pai, qaj));\r\n ra[k] = ((~(~toInt(op_BitwiseAnd(rak, BigNatModule_baseMaski64)))) | 0);\r\n c = op_Division(rak, BigNatModule_baseNi64);\r\n k = ((k + 1) | 0);\r\n }\r\n BigNatModule_mulSchoolBookCarry(r, c, k);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBook(p, q) {\r\n const pSmall = BigNatModule_bound(p) === 1;\r\n const qSmall = BigNatModule_bound(q) === 1;\r\n if (pSmall && qSmall) {\r\n return BigNatModule_mulSchoolBookBothSmall(BigNatModule_coeff(p, 0), BigNatModule_coeff(q, 0));\r\n }\r\n else if (pSmall) {\r\n return BigNatModule_mulSchoolBookOneSmall(q, BigNatModule_coeff(p, 0));\r\n }\r\n else if (qSmall) {\r\n return BigNatModule_mulSchoolBookOneSmall(p, BigNatModule_coeff(q, 0));\r\n }\r\n else {\r\n return BigNatModule_mulSchoolBookNeitherSmall(p, q);\r\n }\r\n}\r\n\r\nexport class BigNatModule_encoding extends Record {\r\n constructor(bigL, twoToBigL, k, bigK, bigN, split, splits) {\r\n super();\r\n this.bigL = (bigL | 0);\r\n this.twoToBigL = (twoToBigL | 0);\r\n this.k = (k | 0);\r\n this.bigK = (bigK | 0);\r\n this.bigN = (bigN | 0);\r\n this.split = (split | 0);\r\n this.splits = splits;\r\n }\r\n}\r\n\r\nexport function BigNatModule_encoding$reflection() {\r\n return record_type(\"BigInt.BigNatModule.encoding\", [], BigNatModule_encoding, () => [[\"bigL\", int32_type], [\"twoToBigL\", int32_type], [\"k\", int32_type], [\"bigK\", int32_type], [\"bigN\", int32_type], [\"split\", int32_type], [\"splits\", array_type(int32_type)]]);\r\n}\r\n\r\nexport function BigNatModule_mkEncoding(bigL, k, bigK, bigN) {\r\n return new BigNatModule_encoding(bigL, BigNatModule_pow32(2, bigL), k, bigK, bigN, ~(~(BigNatModule_baseBits / bigL)), initialize(~(~(BigNatModule_baseBits / bigL)), (i) => BigNatModule_pow32(2, bigL * i), Int32Array));\r\n}\r\n\r\nexport const BigNatModule_table = [BigNatModule_mkEncoding(1, 28, 268435456, 268435456), BigNatModule_mkEncoding(2, 26, 67108864, 134217728), BigNatModule_mkEncoding(3, 24, 16777216, 50331648), BigNatModule_mkEncoding(4, 22, 4194304, 16777216), BigNatModule_mkEncoding(5, 20, 1048576, 5242880), BigNatModule_mkEncoding(6, 18, 262144, 1572864), BigNatModule_mkEncoding(7, 16, 65536, 458752), BigNatModule_mkEncoding(8, 14, 16384, 131072), BigNatModule_mkEncoding(9, 12, 4096, 36864), BigNatModule_mkEncoding(10, 10, 1024, 10240), BigNatModule_mkEncoding(11, 8, 256, 2816), BigNatModule_mkEncoding(12, 6, 64, 768), BigNatModule_mkEncoding(13, 4, 16, 208)];\r\n\r\nexport function BigNatModule_calculateTableTow(bigL) {\r\n const k = (BigNatModule_FFT_maxBitsInsideFp - (2 * bigL)) | 0;\r\n const bigK = BigNatModule_pow64(fromBits(2, 0, false), k);\r\n return [bigL, k, bigK, op_Multiply(bigK, fromInteger(bigL, false, 2))];\r\n}\r\n\r\nexport function BigNatModule_encodingGivenResultBits(bitsRes) {\r\n const selectFrom = (i_mut) => {\r\n selectFrom:\r\n while (true) {\r\n const i = i_mut;\r\n if (((i + 1) < BigNatModule_table.length) && (bitsRes < BigNatModule_table[i + 1].bigN)) {\r\n i_mut = (i + 1);\r\n continue selectFrom;\r\n }\r\n else {\r\n return BigNatModule_table[i];\r\n }\r\n break;\r\n }\r\n };\r\n if (bitsRes >= BigNatModule_table[0].bigN) {\r\n throw (new Error(\"Product is huge, around 268435456 bits, beyond quickmul\"));\r\n }\r\n else {\r\n return selectFrom(0);\r\n }\r\n}\r\n\r\nexport const BigNatModule_bitmask = initialize(BigNatModule_baseBits, (i) => (BigNatModule_pow32(2, i) - 1), Int32Array);\r\n\r\nexport const BigNatModule_twopowers = initialize(BigNatModule_baseBits, (i) => BigNatModule_pow32(2, i), Int32Array);\r\n\r\nexport const BigNatModule_twopowersI64 = initialize(BigNatModule_baseBits, (i) => BigNatModule_pow64(fromBits(2, 0, false), i));\r\n\r\nexport function BigNatModule_wordBits(word) {\r\n const hi = (k_mut) => {\r\n hi:\r\n while (true) {\r\n const k = k_mut;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n else if ((word & BigNatModule_twopowers[k - 1]) !== 0) {\r\n return k | 0;\r\n }\r\n else {\r\n k_mut = (k - 1);\r\n continue hi;\r\n }\r\n break;\r\n }\r\n };\r\n return hi(BigNatModule_baseBits) | 0;\r\n}\r\n\r\nexport function BigNatModule_bits(u) {\r\n if (u.bound === 0) {\r\n return 0;\r\n }\r\n else {\r\n return ((BigNatModule_degree(u) * BigNatModule_baseBits) + BigNatModule_wordBits(u.digits[BigNatModule_degree(u)])) | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_extractBits(n, enc, bi) {\r\n let z, i, z_1, i_1, z_2, i_2;\r\n const biw = (~(~(bi / BigNatModule_baseBits))) | 0;\r\n const bjw = (~(~(((bi + enc.bigL) - 1) / BigNatModule_baseBits))) | 0;\r\n if (biw !== bjw) {\r\n const xbit = (bi % BigNatModule_baseBits) | 0;\r\n return (((((z = n, (i = (biw | 0), (i < z.bound) ? z.digits[i] : 0))) >> xbit) | (((z_1 = n, (i_1 = (bjw | 0), (i_1 < z_1.bound) ? z_1.digits[i_1] : 0))) << (BigNatModule_baseBits - xbit))) & BigNatModule_bitmask[enc.bigL]) | 0;\r\n }\r\n else {\r\n return ((((z_2 = n, (i_2 = (biw | 0), (i_2 < z_2.bound) ? z_2.digits[i_2] : 0))) >> (bi % BigNatModule_baseBits)) & BigNatModule_bitmask[enc.bigL]) | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_encodePoly(enc, n) {\r\n const poly = fill(new Uint32Array(enc.bigK), 0, enc.bigK, BigNatModule_FFT_Fp_ofInt32(0));\r\n const biMax = (n.bound * BigNatModule_baseBits) | 0;\r\n const encoder = (i_mut, bi_mut) => {\r\n encoder:\r\n while (true) {\r\n const i = i_mut, bi = bi_mut;\r\n if ((i === enc.bigK) ? true : (bi > biMax)) {\r\n }\r\n else {\r\n const pi = BigNatModule_extractBits(n, enc, bi) | 0;\r\n poly[i] = BigNatModule_FFT_Fp_ofInt32(pi);\r\n i_mut = (i + 1);\r\n bi_mut = (bi + enc.bigL);\r\n continue encoder;\r\n }\r\n break;\r\n }\r\n };\r\n encoder(0, 0);\r\n return poly;\r\n}\r\n\r\nexport function BigNatModule_decodeResultBits(enc, poly) {\r\n let n = 0;\r\n for (let i = 0; i <= (poly.length - 1); i++) {\r\n if (poly[i] !== BigNatModule_FFT_mzero) {\r\n n = (i | 0);\r\n }\r\n }\r\n return (((BigNatModule_FFT_maxBitsInsideFp + (enc.bigL * n)) + 1) + 1) | 0;\r\n}\r\n\r\nexport function BigNatModule_decodePoly(enc, poly) {\r\n const rbound = ((~(~(BigNatModule_decodeResultBits(enc, poly) / BigNatModule_baseBits))) + 1) | 0;\r\n const r = BigNatModule_createN(rbound);\r\n const evaluate = (i_mut, j_mut, d_mut) => {\r\n evaluate:\r\n while (true) {\r\n const i = i_mut, j = j_mut, d = d_mut;\r\n if (i === enc.bigK) {\r\n }\r\n else {\r\n if (j >= rbound) {\r\n }\r\n else {\r\n BigNatModule_contributeArr(r.digits, j, op_Multiply(fromInteger(BigNatModule_FFT_Fp_toInt(poly[i]), false, 2), BigNatModule_twopowersI64[d]));\r\n }\r\n const d_1 = (d + enc.bigL) | 0;\r\n const patternInput = (d_1 >= BigNatModule_baseBits) ? [j + 1, d_1 - BigNatModule_baseBits] : [j, d_1];\r\n i_mut = (i + 1);\r\n j_mut = patternInput[0];\r\n d_mut = patternInput[1];\r\n continue evaluate;\r\n }\r\n break;\r\n }\r\n };\r\n evaluate(0, 0, 0);\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_quickMulUsingFft(u, v) {\r\n const enc = BigNatModule_encodingGivenResultBits(BigNatModule_bits(u) + BigNatModule_bits(v));\r\n return BigNatModule_normN(BigNatModule_decodePoly(enc, BigNatModule_FFT_computeFftPaddedPolynomialProduct(enc.bigK, enc.k, BigNatModule_encodePoly(enc, u), BigNatModule_encodePoly(enc, v))));\r\n}\r\n\r\nexport const BigNatModule_minDigitsKaratsuba = 16;\r\n\r\nexport function BigNatModule_recMulKaratsuba(mul, p, q) {\r\n const bmax = BigNatModule_maxInt(p.bound, q.bound) | 0;\r\n if (bmax > BigNatModule_minDigitsKaratsuba) {\r\n const k = (~(~(bmax / 2))) | 0;\r\n const a0 = BigNatModule_restrictTo(k, p);\r\n const a1 = BigNatModule_shiftDown(k, p);\r\n const b0 = BigNatModule_restrictTo(k, q);\r\n const b1 = BigNatModule_shiftDown(k, q);\r\n const q0 = mul(a0, b0);\r\n const q1 = mul(BigNatModule_add(a0, a1), BigNatModule_add(b0, b1));\r\n const q2 = mul(a1, b1);\r\n return BigNatModule_add(q0, BigNatModule_shiftUp(k, BigNatModule_add(BigNatModule_sub(q1, BigNatModule_add(q0, q2)), BigNatModule_shiftUp(k, q2))));\r\n }\r\n else {\r\n return BigNatModule_mulSchoolBook(p, q);\r\n }\r\n}\r\n\r\nexport function BigNatModule_mulKaratsuba(x, y) {\r\n return BigNatModule_recMulKaratsuba(BigNatModule_mulKaratsuba, x, y);\r\n}\r\n\r\nexport const BigNatModule_productDigitsUpperSchoolBook = ~(~(64000 / BigNatModule_baseBits));\r\n\r\nexport const BigNatModule_singleDigitForceSchoolBook = ~(~(32000 / BigNatModule_baseBits));\r\n\r\nexport const BigNatModule_productDigitsUpperFft = ~(~(BigNatModule_table[0].bigN / BigNatModule_baseBits));\r\n\r\nexport function BigNatModule_mul(p, q) {\r\n return BigNatModule_mulSchoolBook(p, q);\r\n}\r\n\r\nexport function BigNatModule_scaleSubInPlace(x, f, a, n) {\r\n const patternInput = [x.digits, BigNatModule_degree(x)];\r\n const x_1 = patternInput[0];\r\n const patternInput_1 = [a.digits, BigNatModule_degree(a)];\r\n const ad = patternInput_1[1] | 0;\r\n const a_1 = patternInput_1[0];\r\n const f_1 = fromInteger(f, false, 2);\r\n let j = 0;\r\n let z = op_Multiply(f_1, fromInteger(a_1[0], false, 2));\r\n while ((compare(z, fromBits(0, 0, false)) > 0) ? true : (j < ad)) {\r\n if (j > patternInput[1]) {\r\n throw (new Error(\"scaleSubInPlace: pre-condition did not apply, result would be -ve\"));\r\n }\r\n let zLo = ~(~toInt(op_BitwiseAnd(z, BigNatModule_baseMaski64)));\r\n let zHi = op_Division(z, BigNatModule_baseNi64);\r\n if (zLo <= x_1[j + n]) {\r\n x_1[j + n] = ((x_1[j + n] - zLo) | 0);\r\n }\r\n else {\r\n x_1[j + n] = ((x_1[j + n] + (BigNatModule_baseN - zLo)) | 0);\r\n zHi = op_Addition(zHi, fromBits(1, 0, false));\r\n }\r\n if (j < ad) {\r\n z = op_Addition(zHi, op_Multiply(f_1, fromInteger(a_1[j + 1], false, 2)));\r\n }\r\n else {\r\n z = zHi;\r\n }\r\n j = ((j + 1) | 0);\r\n }\r\n BigNatModule_normN(x);\r\n}\r\n\r\nexport function BigNatModule_scaleSub(x, f, a, n) {\r\n const freshx = BigNatModule_add(x, BigNatModule_zero);\r\n BigNatModule_scaleSubInPlace(freshx, f, a, n);\r\n return BigNatModule_normN(freshx);\r\n}\r\n\r\nexport function BigNatModule_scaleAddInPlace(x, f, a, n) {\r\n const patternInput = [x.digits, BigNatModule_degree(x)];\r\n const x_1 = patternInput[0];\r\n const patternInput_1 = [a.digits, BigNatModule_degree(a)];\r\n const ad = patternInput_1[1] | 0;\r\n const a_1 = patternInput_1[0];\r\n const f_1 = fromInteger(f, false, 2);\r\n let j = 0;\r\n let z = op_Multiply(f_1, fromInteger(a_1[0], false, 2));\r\n while ((compare(z, fromBits(0, 0, false)) > 0) ? true : (j < ad)) {\r\n if (j > patternInput[1]) {\r\n throw (new Error(\"scaleSubInPlace: pre-condition did not apply, result would be -ve\"));\r\n }\r\n let zLo = ~(~toInt(op_BitwiseAnd(z, BigNatModule_baseMaski64)));\r\n let zHi = op_Division(z, BigNatModule_baseNi64);\r\n if (zLo < (BigNatModule_baseN - x_1[j + n])) {\r\n x_1[j + n] = ((x_1[j + n] + zLo) | 0);\r\n }\r\n else {\r\n x_1[j + n] = ((zLo - (BigNatModule_baseN - x_1[j + n])) | 0);\r\n zHi = op_Addition(zHi, fromBits(1, 0, false));\r\n }\r\n if (j < ad) {\r\n z = op_Addition(zHi, op_Multiply(f_1, fromInteger(a_1[j + 1], false, 2)));\r\n }\r\n else {\r\n z = zHi;\r\n }\r\n j = ((j + 1) | 0);\r\n }\r\n BigNatModule_normN(x);\r\n}\r\n\r\nexport function BigNatModule_scaleAdd(x, f, a, n) {\r\n const freshx = BigNatModule_add(x, BigNatModule_zero);\r\n BigNatModule_scaleAddInPlace(freshx, f, a, n);\r\n return BigNatModule_normN(freshx);\r\n}\r\n\r\nexport function BigNatModule_removeFactor(x, a, n) {\r\n const patternInput = [BigNatModule_degree(a), BigNatModule_degree(x)];\r\n const degx = patternInput[1] | 0;\r\n const dega = patternInput[0] | 0;\r\n if (degx < (dega + n)) {\r\n return 0;\r\n }\r\n else {\r\n const patternInput_1 = [a.digits, x.digits];\r\n const xa = patternInput_1[1];\r\n const aa = patternInput_1[0];\r\n const f = ((dega === 0) ? ((degx === n) ? (~(~(xa[n] / aa[0]))) : (~(~toInt(op_Division(op_Addition(op_Multiply(fromInteger(xa[degx], false, 2), BigNatModule_baseNi64), fromInteger(xa[degx - 1], false, 2)), fromInteger(aa[0], false, 2)))))) : ((degx === (dega + n)) ? (~(~(xa[degx] / (aa[dega] + 1)))) : (~(~toInt(op_Division(op_Addition(op_Multiply(fromInteger(xa[degx], false, 2), BigNatModule_baseNi64), fromInteger(xa[degx - 1], false, 2)), op_Addition(fromInteger(aa[dega], false, 2), fromBits(1, 0, false)))))))) | 0;\r\n if (f === 0) {\r\n if (BigNatModule_shiftCompare(a, n, x, 0) !== 1) {\r\n return 1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n else {\r\n return f | 0;\r\n }\r\n }\r\n}\r\n\r\nexport function BigNatModule_divmod(b, a) {\r\n if (BigNatModule_isZero(a)) {\r\n throw (new Error());\r\n }\r\n else if (BigNatModule_degree(b) < BigNatModule_degree(a)) {\r\n return [BigNatModule_zero, b];\r\n }\r\n else {\r\n const x = BigNatModule_copyN(b);\r\n const d = BigNatModule_createN(((BigNatModule_degree(b) - BigNatModule_degree(a)) + 1) + 1);\r\n let p = BigNatModule_degree(b);\r\n const m = BigNatModule_degree(a) | 0;\r\n let n = p - m;\r\n const Invariant = (tupledArg) => {\r\n };\r\n let finished = false;\r\n while (!finished) {\r\n Invariant([d, x, n, p]);\r\n const f = BigNatModule_removeFactor(x, a, n) | 0;\r\n if (f > 0) {\r\n BigNatModule_scaleSubInPlace(x, f, a, n);\r\n BigNatModule_scaleAddInPlace(d, f, BigNatModule_one, n);\r\n Invariant([d, x, n, p]);\r\n }\r\n else {\r\n finished = ((f === 0) && (n === 0));\r\n if (!finished) {\r\n if (p === (m + n)) {\r\n Invariant([d, x, n - 1, p]);\r\n n = ((n - 1) | 0);\r\n }\r\n else {\r\n Invariant([d, x, n - 1, p - 1]);\r\n n = ((n - 1) | 0);\r\n p = ((p - 1) | 0);\r\n }\r\n }\r\n }\r\n }\r\n return [BigNatModule_normN(d), BigNatModule_normN(x)];\r\n }\r\n}\r\n\r\nexport function BigNatModule_div(b, a) {\r\n return BigNatModule_divmod(b, a)[0];\r\n}\r\n\r\nexport function BigNatModule_rem(b, a) {\r\n return BigNatModule_divmod(b, a)[1];\r\n}\r\n\r\nexport function BigNatModule_bitAnd(a, b) {\r\n const r = BigNatModule_createN(BigNatModule_minInt(a.bound, b.bound));\r\n for (let i = 0; i <= (r.bound - 1); i++) {\r\n r.digits[i] = ((a.digits[i] & b.digits[i]) | 0);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_bitOr(a, b) {\r\n const r = BigNatModule_createN(BigNatModule_maxInt(a.bound, b.bound));\r\n for (let i = 0; i <= (a.bound - 1); i++) {\r\n r.digits[i] = ((r.digits[i] | a.digits[i]) | 0);\r\n }\r\n for (let i_1 = 0; i_1 <= (b.bound - 1); i_1++) {\r\n r.digits[i_1] = ((r.digits[i_1] | b.digits[i_1]) | 0);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_bitXor(a, b) {\r\n const r = BigNatModule_createN(BigNatModule_maxInt(a.bound, b.bound));\r\n for (let i = 0; i <= (a.bound - 1); i++) {\r\n r.digits[i] = ((r.digits[i] ^ a.digits[i]) | 0);\r\n }\r\n for (let i_1 = 0; i_1 <= (b.bound - 1); i_1++) {\r\n r.digits[i_1] = ((r.digits[i_1] ^ b.digits[i_1]) | 0);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_hcf(a, b) {\r\n const hcfloop = (a_1_mut, b_1_mut) => {\r\n hcfloop:\r\n while (true) {\r\n const a_1 = a_1_mut, b_1 = b_1_mut;\r\n if (BigNatModule_equal(BigNatModule_zero, a_1)) {\r\n return b_1;\r\n }\r\n else {\r\n a_1_mut = BigNatModule_divmod(b_1, a_1)[1];\r\n b_1_mut = a_1;\r\n continue hcfloop;\r\n }\r\n break;\r\n }\r\n };\r\n if (BigNatModule_lt(a, b)) {\r\n return hcfloop(a, b);\r\n }\r\n else {\r\n return hcfloop(b, a);\r\n }\r\n}\r\n\r\nexport const BigNatModule_two = BigNatModule_embed(2);\r\n\r\nexport function BigNatModule_powi(x, n) {\r\n const power = (acc_mut, x_1_mut, n_1_mut) => {\r\n power:\r\n while (true) {\r\n const acc = acc_mut, x_1 = x_1_mut, n_1 = n_1_mut;\r\n if (n_1 === 0) {\r\n return acc;\r\n }\r\n else if ((n_1 % 2) === 0) {\r\n acc_mut = acc;\r\n x_1_mut = BigNatModule_mul(x_1, x_1);\r\n n_1_mut = (~(~(n_1 / 2)));\r\n continue power;\r\n }\r\n else {\r\n acc_mut = BigNatModule_mul(x_1, acc);\r\n x_1_mut = BigNatModule_mul(x_1, x_1);\r\n n_1_mut = (~(~(n_1 / 2)));\r\n continue power;\r\n }\r\n break;\r\n }\r\n };\r\n return power(BigNatModule_one, x, n);\r\n}\r\n\r\nexport function BigNatModule_pow(x, n) {\r\n const power = (acc_mut, x_1_mut, n_1_mut) => {\r\n power:\r\n while (true) {\r\n const acc = acc_mut, x_1 = x_1_mut, n_1 = n_1_mut;\r\n if (BigNatModule_isZero(n_1)) {\r\n return acc;\r\n }\r\n else {\r\n const patternInput = BigNatModule_divmod(n_1, BigNatModule_two);\r\n const ndiv2 = patternInput[0];\r\n if (BigNatModule_isZero(patternInput[1])) {\r\n acc_mut = acc;\r\n x_1_mut = BigNatModule_mul(x_1, x_1);\r\n n_1_mut = ndiv2;\r\n continue power;\r\n }\r\n else {\r\n acc_mut = BigNatModule_mul(x_1, acc);\r\n x_1_mut = BigNatModule_mul(x_1, x_1);\r\n n_1_mut = ndiv2;\r\n continue power;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return power(BigNatModule_one, x, n);\r\n}\r\n\r\nexport function BigNatModule_toFloat(n) {\r\n const evalFloat = (acc_mut, k_mut, i_mut) => {\r\n evalFloat:\r\n while (true) {\r\n const acc = acc_mut, k = k_mut, i = i_mut;\r\n if (i === n.bound) {\r\n return acc;\r\n }\r\n else {\r\n acc_mut = (acc + (k * n.digits[i]));\r\n k_mut = (k * BigNatModule_baseN);\r\n i_mut = (i + 1);\r\n continue evalFloat;\r\n }\r\n break;\r\n }\r\n };\r\n return evalFloat(0, 1, 0);\r\n}\r\n\r\nexport function BigNatModule_ofInt32(n) {\r\n return BigNatModule_embed(n);\r\n}\r\n\r\nexport function BigNatModule_ofInt64(n) {\r\n return BigNatModule_embed64(n);\r\n}\r\n\r\nexport function BigNatModule_toUInt32(n) {\r\n const matchValue = n.bound | 0;\r\n switch (matchValue) {\r\n case 0: {\r\n return 0;\r\n }\r\n case 1: {\r\n const value = n.digits[0] | 0;\r\n return value >>> 0;\r\n }\r\n case 2: {\r\n const patternInput = [n.digits[0], n.digits[1]];\r\n const xB = patternInput[1] | 0;\r\n if (xB > BigNatModule_baseMask32B) {\r\n throw (new Error());\r\n }\r\n return ((patternInput[0] & BigNatModule_baseMask32A) >>> 0) + ((((xB & BigNatModule_baseMask32B) >>> 0) << BigNatModule_baseShift32B) >>> 0);\r\n }\r\n default: {\r\n throw (new Error());\r\n }\r\n }\r\n}\r\n\r\nexport function BigNatModule_toUInt64(n) {\r\n const matchValue = n.bound | 0;\r\n switch (matchValue) {\r\n case 0: {\r\n return fromBits(0, 0, true);\r\n }\r\n case 1: {\r\n return fromInteger(n.digits[0], true, 2);\r\n }\r\n case 2: {\r\n const patternInput = [n.digits[0], n.digits[1]];\r\n return op_Addition(fromInteger(patternInput[0] & BigNatModule_baseMask64A, true, 2), op_LeftShift(fromInteger(patternInput[1] & BigNatModule_baseMask64B, true, 2), BigNatModule_baseShift64B));\r\n }\r\n case 3: {\r\n const patternInput_1 = [n.digits[0], n.digits[1], n.digits[2]];\r\n const xC = patternInput_1[2] | 0;\r\n if (xC > BigNatModule_baseMask64C) {\r\n throw (new Error());\r\n }\r\n return op_Addition(op_Addition(fromInteger(patternInput_1[0] & BigNatModule_baseMask64A, true, 2), op_LeftShift(fromInteger(patternInput_1[1] & BigNatModule_baseMask64B, true, 2), BigNatModule_baseShift64B)), op_LeftShift(fromInteger(xC & BigNatModule_baseMask64C, true, 2), BigNatModule_baseShift64C));\r\n }\r\n default: {\r\n throw (new Error());\r\n }\r\n }\r\n}\r\n\r\nexport function BigNatModule_toString(n) {\r\n const degn = BigNatModule_degree(n) | 0;\r\n const route = (prior_mut, k_mut, ten2k_mut) => {\r\n route:\r\n while (true) {\r\n const prior = prior_mut, k = k_mut, ten2k = ten2k_mut;\r\n if (BigNatModule_degree(ten2k) > degn) {\r\n return cons([k, ten2k], prior);\r\n }\r\n else {\r\n prior_mut = cons([k, ten2k], prior);\r\n k_mut = (k + 1);\r\n ten2k_mut = BigNatModule_mul(ten2k, ten2k);\r\n continue route;\r\n }\r\n break;\r\n }\r\n };\r\n const collect = (isLeading_mut, digits_mut, n_1_mut, _arg_mut) => {\r\n collect:\r\n while (true) {\r\n const isLeading = isLeading_mut, digits = digits_mut, n_1 = n_1_mut, _arg = _arg_mut;\r\n if (!isEmpty(_arg)) {\r\n const prior_1 = tail(_arg);\r\n const patternInput = BigNatModule_divmod(n_1, head(_arg)[1]);\r\n const nL = patternInput[1];\r\n const nH = patternInput[0];\r\n if (isLeading && BigNatModule_isZero(nH)) {\r\n isLeading_mut = isLeading;\r\n digits_mut = digits;\r\n n_1_mut = nL;\r\n _arg_mut = prior_1;\r\n continue collect;\r\n }\r\n else {\r\n isLeading_mut = isLeading;\r\n digits_mut = collect(false, digits, nL, prior_1);\r\n n_1_mut = nH;\r\n _arg_mut = prior_1;\r\n continue collect;\r\n }\r\n }\r\n else {\r\n const n_2 = BigNatModule_eval32(n_1) | 0;\r\n if (isLeading && (n_2 === 0)) {\r\n return digits;\r\n }\r\n else {\r\n return cons(int32ToString(n_2), digits);\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n const digits_4 = collect(true, empty(), n, route(empty(), 0, BigNatModule_embed(10)));\r\n if (isEmpty(digits_4)) {\r\n return \"0\";\r\n }\r\n else {\r\n return join(\"\", toArray(digits_4));\r\n }\r\n}\r\n\r\nexport function BigNatModule_ofString(str) {\r\n const len = str.length | 0;\r\n if (isNullOrEmpty(str)) {\r\n throw (new Error(\"empty string\\\\nParameter name: str\"));\r\n }\r\n const ten = BigNatModule_embed(10);\r\n const build = (acc_mut, i_mut) => {\r\n build:\r\n while (true) {\r\n const acc = acc_mut, i = i_mut;\r\n if (i === len) {\r\n return acc;\r\n }\r\n else {\r\n const c = str[i];\r\n const d = (c.charCodeAt(0) - 48) | 0;\r\n if ((0 <= d) && (d <= 9)) {\r\n acc_mut = BigNatModule_add(BigNatModule_mul(ten, acc), BigNatModule_embed(d));\r\n i_mut = (i + 1);\r\n continue build;\r\n }\r\n else {\r\n throw (new Error());\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return build(BigNatModule_embed(0), 0);\r\n}\r\n\r\nexport function BigNatModule_isSmall(n) {\r\n return n.bound <= 1;\r\n}\r\n\r\nexport function BigNatModule_getSmall(n) {\r\n const z = n;\r\n const i = 0;\r\n if (i < z.bound) {\r\n return z.digits[i] | 0;\r\n }\r\n else {\r\n return 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_factorial(n) {\r\n const productR = (a, b) => {\r\n if (BigNatModule_equal(a, b)) {\r\n return a;\r\n }\r\n else {\r\n const m = BigNatModule_div(BigNatModule_add(a, b), BigNatModule_ofInt32(2));\r\n return BigNatModule_mul(productR(a, m), productR(BigNatModule_add(m, BigNatModule_one), b));\r\n }\r\n };\r\n return productR(BigNatModule_one, n);\r\n}\r\n\r\n","import { BigNatModule_factorial, BigNatModule_ofString, BigNatModule_toFloat, BigNatModule_toUInt64, BigNatModule_toUInt32, BigNatModule_pow, BigNatModule_two, BigNatModule_rem, BigNatModule_lte, BigNatModule_hcf, BigNatModule_bitXor, BigNatModule_bitOr, BigNatModule_bitAnd, BigNatModule_divmod, BigNatModule_mul, BigNatModule_isOne, BigNatModule_sub, BigNatModule_gte, BigNatModule_scale, BigNatModule_one, BigNatModule_add, BigNatModule_ofInt64, BigNatModule_hash, BigNatModule_gt, BigNatModule_lt, BigNatModule_equal, BigNatModule_getSmall, BigNatModule_isSmall, BigNatModule_ofInt32, BigNatModule_toString, BigNatModule_isZero } from \"./n.js\";\r\nimport { Record, toString } from \"../Types.js\";\r\nimport { class_type } from \"../Reflection.js\";\r\nimport { initialize } from \"../Array.js\";\r\nimport { op_Addition, op_Multiply, fromValue, equals, fromBits, compare, fromInteger, op_UnaryNegation } from \"../Long.js\";\r\nimport { op_UnaryNegation_Int32 } from \"../Int32.js\";\r\nimport Decimal from \"../Decimal.js\";\r\n\r\nexport class BigInteger extends Record {\r\n constructor(signInt, v) {\r\n super();\r\n this.signInt = (signInt | 0);\r\n this.v = v;\r\n }\r\n toString() {\r\n const x = this;\r\n const matchValue = BigInteger__get_SignInt(x) | 0;\r\n switch (matchValue) {\r\n case -1: {\r\n return BigNatModule_isZero(BigInteger__get_V(x)) ? \"0\" : (\"-\" + BigNatModule_toString(BigInteger__get_V(x)));\r\n }\r\n case 0: {\r\n return \"0\";\r\n }\r\n case 1: {\r\n return BigNatModule_toString(BigInteger__get_V(x));\r\n }\r\n default: {\r\n throw (new Error(\"signs should be +/- 1 or 0\"));\r\n }\r\n }\r\n }\r\n Equals(obj) {\r\n const this$ = this;\r\n return (obj instanceof BigInteger) && BigInteger_op_Equality_56F059C0(this$, obj);\r\n }\r\n GetHashCode() {\r\n const x = this;\r\n return BigInteger_hash_Z665282C2(x) | 0;\r\n }\r\n toJSON(_key) {\r\n const this$ = this;\r\n return toString(this$);\r\n }\r\n CompareTo(obj) {\r\n const this$ = this;\r\n if (obj instanceof BigInteger) {\r\n return BigInteger_compare_56F059C0(this$, obj) | 0;\r\n }\r\n else {\r\n throw (new Error(\"the objects are not comparable\\\\nParameter name: obj\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger$reflection() {\r\n return class_type(\"BigInt.BigInteger\", void 0, BigInteger, class_type(\"System.ValueType\"));\r\n}\r\n\r\nexport function BigInteger_$ctor_Z2BE94A1(signInt, v) {\r\n return new BigInteger(signInt, v);\r\n}\r\n\r\n(() => {\r\n BigInteger.smallLim = 4096;\r\n BigInteger.smallPosTab = initialize(BigInteger.smallLim, BigNatModule_ofInt32);\r\n BigInteger.one = BigInteger_$ctor_Z524259A4(1);\r\n BigInteger.two = BigInteger_$ctor_Z524259A4(2);\r\n BigInteger.zero = BigInteger_$ctor_Z524259A4(0);\r\n})();\r\n\r\nexport function BigInteger_nat_Z67CCE57D(n) {\r\n if (BigNatModule_isSmall(n) && (BigNatModule_getSmall(n) < BigInteger.smallLim)) {\r\n return BigInteger.smallPosTab[BigNatModule_getSmall(n)];\r\n }\r\n else {\r\n return n;\r\n }\r\n}\r\n\r\nexport function BigInteger_create_Z2BE94A1(s, n) {\r\n return BigInteger_$ctor_Z2BE94A1(s, BigInteger_nat_Z67CCE57D(n));\r\n}\r\n\r\nexport function BigInteger_posn_Z67CCE57D(n) {\r\n return BigInteger_$ctor_Z2BE94A1(1, BigInteger_nat_Z67CCE57D(n));\r\n}\r\n\r\nexport function BigInteger_negn_Z67CCE57D(n) {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(n));\r\n}\r\n\r\nexport function BigInteger__get_Sign(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return 0;\r\n }\r\n else {\r\n return x.signInt | 0;\r\n }\r\n}\r\n\r\nexport function BigInteger__get_SignInt(x) {\r\n return x.signInt;\r\n}\r\n\r\nexport function BigInteger__get_V(x) {\r\n return x.v;\r\n}\r\n\r\nexport function BigInteger_op_Equality_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 5;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 7;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_equal(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_equal(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 2: {\r\n if (BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n case 3: {\r\n if (BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n case 4: {\r\n return true;\r\n }\r\n case 5: {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 6: {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 7: {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 8: {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Inequality_56F059C0(x, y) {\r\n return !BigInteger_op_Equality_56F059C0(x, y);\r\n}\r\n\r\nexport function BigInteger_op_LessThan_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 5;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 7;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_lt(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_lt(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n return false;\r\n }\r\n case 3: {\r\n if (!BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return true;\r\n }\r\n else {\r\n return !BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n }\r\n case 4: {\r\n return false;\r\n }\r\n case 5: {\r\n return !BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 6: {\r\n return false;\r\n }\r\n case 7: {\r\n return false;\r\n }\r\n case 8: {\r\n return !BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_GreaterThan_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 5;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 7;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_gt(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_gt(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n if (!BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return true;\r\n }\r\n else {\r\n return !BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n }\r\n case 3: {\r\n return false;\r\n }\r\n case 4: {\r\n return false;\r\n }\r\n case 5: {\r\n return false;\r\n }\r\n case 6: {\r\n return !BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 7: {\r\n return !BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 8: {\r\n return false;\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_compare_56F059C0(n, nn) {\r\n if (BigInteger_op_LessThan_56F059C0(n, nn)) {\r\n return -1;\r\n }\r\n else if (BigInteger_op_Equality_56F059C0(n, nn)) {\r\n return 0;\r\n }\r\n else {\r\n return 1;\r\n }\r\n}\r\n\r\nexport function BigInteger_hash_Z665282C2(z) {\r\n if (BigInteger__get_SignInt(z) === 0) {\r\n return 1;\r\n }\r\n else {\r\n return (BigInteger__get_SignInt(z) + BigNatModule_hash(BigInteger__get_V(z))) | 0;\r\n }\r\n}\r\n\r\nexport function BigInteger__get_StructuredDisplayString(x) {\r\n return toString(x);\r\n}\r\n\r\nexport function BigInteger_$ctor_Z524259A4(n) {\r\n if (n >= 0) {\r\n return BigInteger_$ctor_Z2BE94A1(1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt32(n)));\r\n }\r\n else if (n === -2147483648) {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt64(op_UnaryNegation(fromInteger(n, false, 2)))));\r\n }\r\n else {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt32(op_UnaryNegation_Int32(n))));\r\n }\r\n}\r\n\r\nexport function BigInteger_$ctor_Z524259C1(n) {\r\n if (compare(n, fromBits(0, 0, false)) >= 0) {\r\n return BigInteger_$ctor_Z2BE94A1(1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt64(n)));\r\n }\r\n else if (equals(n, fromBits(0, 2147483648, false))) {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(BigNatModule_add(BigNatModule_ofInt64(fromBits(4294967295, 2147483647, false)), BigNatModule_one)));\r\n }\r\n else {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt64(op_UnaryNegation(n))));\r\n }\r\n}\r\n\r\nexport function BigInteger_get_One() {\r\n return BigInteger.one;\r\n}\r\n\r\nexport function BigInteger_get_Two() {\r\n return BigInteger.two;\r\n}\r\n\r\nexport function BigInteger_get_Zero() {\r\n return BigInteger.zero;\r\n}\r\n\r\nexport function BigInteger_op_UnaryNegation_Z665282C2(z) {\r\n const matchValue = BigInteger__get_SignInt(z) | 0;\r\n if (matchValue === 0) {\r\n return BigInteger_get_Zero();\r\n }\r\n else {\r\n return BigInteger_create_Z2BE94A1(op_UnaryNegation_Int32(matchValue), BigInteger__get_V(z));\r\n }\r\n}\r\n\r\nexport function BigInteger_Scale_Z320F31E(k, z) {\r\n if (BigInteger__get_SignInt(z) === 0) {\r\n return BigInteger_get_Zero();\r\n }\r\n else if (k < 0) {\r\n return BigInteger_create_Z2BE94A1(op_UnaryNegation_Int32(BigInteger__get_SignInt(z)), BigNatModule_scale(op_UnaryNegation_Int32(k), BigInteger__get_V(z)));\r\n }\r\n else {\r\n return BigInteger_create_Z2BE94A1(BigInteger__get_SignInt(z), BigNatModule_scale(k, BigInteger__get_V(z)));\r\n }\r\n}\r\n\r\nexport function BigInteger_subnn_6A57060(nx, ny) {\r\n if (BigNatModule_gte(nx, ny)) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_sub(nx, ny));\r\n }\r\n else {\r\n return BigInteger_negn_Z67CCE57D(BigNatModule_sub(ny, nx));\r\n }\r\n}\r\n\r\nexport function BigInteger_addnn_6A57060(nx, ny) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_add(nx, ny));\r\n}\r\n\r\nexport function BigInteger__get_IsZero(x) {\r\n if (BigInteger__get_SignInt(x) === 0) {\r\n return true;\r\n }\r\n else {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_IsOne(x) {\r\n if (BigInteger__get_SignInt(x) === 1) {\r\n return BigNatModule_isOne(BigInteger__get_V(x));\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Addition_56F059C0(x, y) {\r\n if (BigInteger__get_IsZero(y)) {\r\n return x;\r\n }\r\n else if (BigInteger__get_IsZero(x)) {\r\n return y;\r\n }\r\n else {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigInteger_addnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigInteger_op_UnaryNegation_Z665282C2(BigInteger_addnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n }\r\n case 2: {\r\n return BigInteger_subnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 3: {\r\n return BigInteger_subnn_6A57060(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 4: {\r\n throw (new Error(\"signs should be +/- 1\\\\nParameter name: x\"));\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Subtraction_56F059C0(x, y) {\r\n if (BigInteger__get_IsZero(y)) {\r\n return x;\r\n }\r\n else if (BigInteger__get_IsZero(x)) {\r\n return BigInteger_op_UnaryNegation_Z665282C2(y);\r\n }\r\n else {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigInteger_subnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigInteger_subnn_6A57060(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n return BigInteger_addnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 3: {\r\n return BigInteger_op_UnaryNegation_Z665282C2(BigInteger_addnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n }\r\n case 4: {\r\n throw (new Error(\"signs should be +/- 1\\\\nParameter name: x\"));\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Multiply_56F059C0(x, y) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return x;\r\n }\r\n else if (BigInteger__get_IsZero(y)) {\r\n return y;\r\n }\r\n else if (BigInteger__get_IsOne(x)) {\r\n return y;\r\n }\r\n else if (BigInteger__get_IsOne(y)) {\r\n return x;\r\n }\r\n else {\r\n const m = BigNatModule_mul(BigInteger__get_V(x), BigInteger__get_V(y));\r\n return BigInteger_create_Z2BE94A1(BigInteger__get_SignInt(x) * BigInteger__get_SignInt(y), m);\r\n }\r\n}\r\n\r\nexport function BigInteger_DivRem_56F059C0(x, y) {\r\n if (BigInteger__get_IsZero(y)) {\r\n throw (new Error());\r\n }\r\n if (BigInteger__get_IsZero(x)) {\r\n return [BigInteger_get_Zero(), BigInteger_get_Zero()];\r\n }\r\n else {\r\n const patternInput = BigNatModule_divmod(BigInteger__get_V(x), BigInteger__get_V(y));\r\n const r = patternInput[1];\r\n const d = patternInput[0];\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return [BigInteger_posn_Z67CCE57D(d), BigInteger_posn_Z67CCE57D(r)];\r\n }\r\n case 1: {\r\n return [BigInteger_posn_Z67CCE57D(d), BigInteger_negn_Z67CCE57D(r)];\r\n }\r\n case 2: {\r\n return [BigInteger_negn_Z67CCE57D(d), BigInteger_posn_Z67CCE57D(r)];\r\n }\r\n case 3: {\r\n return [BigInteger_negn_Z67CCE57D(d), BigInteger_negn_Z67CCE57D(r)];\r\n }\r\n case 4: {\r\n throw (new Error(\"signs should be +/- 1\\\\nParameter name: x\"));\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Division_56F059C0(x, y) {\r\n return BigInteger_DivRem_56F059C0(x, y)[0];\r\n}\r\n\r\nexport function BigInteger_op_Modulus_56F059C0(x, y) {\r\n return BigInteger_DivRem_56F059C0(x, y)[1];\r\n}\r\n\r\nexport function BigInteger_op_RightShift_62E082A2(x, y) {\r\n return BigInteger_op_Division_56F059C0(x, BigInteger_Pow_62E082A2(BigInteger_get_Two(), y));\r\n}\r\n\r\nexport function BigInteger_op_LeftShift_62E082A2(x, y) {\r\n return BigInteger_op_Multiply_56F059C0(x, BigInteger_Pow_62E082A2(BigInteger_get_Two(), y));\r\n}\r\n\r\nexport function BigInteger_op_BitwiseAnd_56F059C0(x, y) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_bitAnd(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n}\r\n\r\nexport function BigInteger_op_BitwiseOr_56F059C0(x, y) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_bitOr(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n}\r\n\r\nexport function BigInteger_op_ExclusiveOr_56F059C0(x, y) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_bitXor(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n}\r\n\r\nexport function BigInteger_GreatestCommonDivisor_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n if (matchValue[0] === 0) {\r\n if (matchValue[1] === 0) {\r\n return BigInteger_get_Zero();\r\n }\r\n else {\r\n return BigInteger_posn_Z67CCE57D(BigInteger__get_V(y));\r\n }\r\n }\r\n else if (matchValue[1] === 0) {\r\n return BigInteger_posn_Z67CCE57D(BigInteger__get_V(x));\r\n }\r\n else {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_hcf(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_IsNegative(x) {\r\n if (BigInteger__get_SignInt(x) === -1) {\r\n return !BigInteger__get_IsZero(x);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigInteger__get_IsPositive(x) {\r\n if (BigInteger__get_SignInt(x) === 1) {\r\n return !BigInteger__get_IsZero(x);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigInteger_Abs_Z665282C2(x) {\r\n if (BigInteger__get_SignInt(x) === -1) {\r\n return BigInteger_op_UnaryNegation_Z665282C2(x);\r\n }\r\n else {\r\n return x;\r\n }\r\n}\r\n\r\nexport function BigInteger_op_LessThanOrEqual_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 7;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 5;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_lte(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_lte(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n if (BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n case 3: {\r\n return true;\r\n }\r\n case 4: {\r\n return true;\r\n }\r\n case 5: {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 6: {\r\n return true;\r\n }\r\n case 7: {\r\n return true;\r\n }\r\n case 8: {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_GreaterThanOrEqual_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 7;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 5;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_gte(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_gte(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n return true;\r\n }\r\n case 3: {\r\n if (BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n case 4: {\r\n return true;\r\n }\r\n case 5: {\r\n return true;\r\n }\r\n case 6: {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 7: {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 8: {\r\n return true;\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_Pow_62E082A2(x, y) {\r\n if (y < 0) {\r\n throw (new Error(\"y\"));\r\n }\r\n const matchValue = [BigInteger__get_IsZero(x), y];\r\n if (matchValue[0]) {\r\n if (matchValue[1] === 0) {\r\n return BigInteger_get_One();\r\n }\r\n else {\r\n return BigInteger_get_Zero();\r\n }\r\n }\r\n else {\r\n const yval = BigInteger_$ctor_Z524259A4(y);\r\n return BigInteger_create_Z2BE94A1(BigNatModule_isZero(BigNatModule_rem(BigInteger__get_V(yval), BigNatModule_two)) ? 1 : BigInteger__get_SignInt(x), BigNatModule_pow(BigInteger__get_V(x), BigInteger__get_V(yval)));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToInt32(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return 0;\r\n }\r\n else {\r\n const u = BigNatModule_toUInt32(BigInteger__get_V(x));\r\n if (u <= (2147483647 >>> 0)) {\r\n return (BigInteger__get_SignInt(x) * (~(~u))) | 0;\r\n }\r\n else if ((BigInteger__get_SignInt(x) === -1) && (u === ((2147483647 + 1) >>> 0))) {\r\n return -2147483648;\r\n }\r\n else {\r\n throw (new Error());\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToUInt32(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return 0;\r\n }\r\n else {\r\n return BigNatModule_toUInt32(BigInteger__get_V(x));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToInt64(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return fromBits(0, 0, false);\r\n }\r\n else {\r\n const u = BigNatModule_toUInt64(BigInteger__get_V(x));\r\n if (compare(u, fromValue(fromBits(4294967295, 2147483647, false), true)) <= 0) {\r\n return op_Multiply(fromInteger(BigInteger__get_SignInt(x), false, 2), fromValue(u, false));\r\n }\r\n else if ((BigInteger__get_SignInt(x) === -1) && equals(u, fromValue(op_Addition(fromBits(4294967295, 2147483647, false), fromBits(1, 0, false)), true))) {\r\n return fromBits(0, 2147483648, false);\r\n }\r\n else {\r\n throw (new Error());\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToUInt64(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return fromBits(0, 0, true);\r\n }\r\n else {\r\n return BigNatModule_toUInt64(BigInteger__get_V(x));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToDouble(x) {\r\n const matchValue = BigInteger__get_SignInt(x) | 0;\r\n switch (matchValue) {\r\n case -1: {\r\n return -BigNatModule_toFloat(BigInteger__get_V(x));\r\n }\r\n case 0: {\r\n return 0;\r\n }\r\n case 1: {\r\n return BigNatModule_toFloat(BigInteger__get_V(x));\r\n }\r\n default: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToSByte(x) {\r\n return (BigInteger__get_ToInt32(x) + 0x80 & 0xFF) - 0x80;\r\n}\r\n\r\nexport function BigInteger__get_ToByte(x) {\r\n return BigInteger__get_ToUInt32(x) & 0xFF;\r\n}\r\n\r\nexport function BigInteger__get_ToInt16(x) {\r\n return (BigInteger__get_ToInt32(x) + 0x8000 & 0xFFFF) - 0x8000;\r\n}\r\n\r\nexport function BigInteger__get_ToUInt16(x) {\r\n return BigInteger__get_ToUInt32(x) & 0xFFFF;\r\n}\r\n\r\nexport function BigInteger__get_ToSingle(x) {\r\n return BigInteger__get_ToDouble(x);\r\n}\r\n\r\nexport function BigInteger__get_ToDecimal(x) {\r\n return new Decimal(BigInteger__get_ToDouble(x));\r\n}\r\n\r\nexport function BigInteger_Parse_Z721C83C5(text) {\r\n if (text == null) {\r\n throw (new Error(\"text\"));\r\n }\r\n const text_1 = text.trim();\r\n const len = text_1.length | 0;\r\n if (len === 0) {\r\n throw (new Error());\r\n }\r\n const matchValue = [text_1[0], len];\r\n if (matchValue[0] === \"+\") {\r\n if (matchValue[1] === 1) {\r\n throw (new Error());\r\n }\r\n else {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_ofString(text_1.slice(1, (len - 1) + 1)));\r\n }\r\n }\r\n else if (matchValue[0] === \"-\") {\r\n if (matchValue[1] === 1) {\r\n throw (new Error());\r\n }\r\n else {\r\n return BigInteger_negn_Z67CCE57D(BigNatModule_ofString(text_1.slice(1, (len - 1) + 1)));\r\n }\r\n }\r\n else {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_ofString(text_1));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_IsSmall(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return true;\r\n }\r\n else {\r\n return BigNatModule_isSmall(BigInteger__get_V(x));\r\n }\r\n}\r\n\r\nexport function BigInteger_Factorial_Z665282C2(x) {\r\n if (BigInteger__get_IsNegative(x)) {\r\n throw (new Error(\"mustBeNonNegative\\\\nParameter name: x\"));\r\n }\r\n if (BigInteger__get_IsPositive(x)) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_factorial(BigInteger__get_V(x)));\r\n }\r\n else {\r\n return BigInteger_get_One();\r\n }\r\n}\r\n\r\nexport function BigInteger_op_UnaryPlus_Z665282C2(n1) {\r\n return n1;\r\n}\r\n\r\nexport function BigInteger_FromInt64_Z524259C1(x) {\r\n return BigInteger_$ctor_Z524259C1(x);\r\n}\r\n\r\nexport function BigInteger_FromInt32_Z524259A4(x) {\r\n return BigInteger_$ctor_Z524259A4(x);\r\n}\r\n\r\n","import { BigInteger_op_Inequality_56F059C0, BigInteger_op_Equality_56F059C0, BigInteger_op_GreaterThanOrEqual_56F059C0, BigInteger_op_GreaterThan_56F059C0, BigInteger_op_LessThanOrEqual_56F059C0, BigInteger_op_LessThan_56F059C0, BigInteger_op_ExclusiveOr_56F059C0, BigInteger_op_BitwiseOr_56F059C0, BigInteger_op_BitwiseAnd_56F059C0, BigInteger_op_LeftShift_62E082A2, BigInteger_op_RightShift_62E082A2, BigInteger_op_UnaryPlus_Z665282C2, BigInteger_op_UnaryNegation_Z665282C2, BigInteger_op_Modulus_56F059C0, BigInteger_op_Division_56F059C0, BigInteger_op_Multiply_56F059C0, BigInteger_op_Subtraction_56F059C0, BigInteger_op_Addition_56F059C0, BigInteger__get_IsOne, BigInteger__get_IsZero, BigInteger__get_Sign, BigInteger__get_ToDecimal, BigInteger__get_ToDouble, BigInteger__get_ToSingle, BigInteger__get_ToUInt64, BigInteger__get_ToInt64, BigInteger__get_ToUInt32, BigInteger__get_ToInt32, BigInteger__get_ToUInt16, BigInteger__get_ToInt16, BigInteger__get_ToByte, BigInteger__get_ToSByte, BigInteger_$ctor_Z524259A4, BigInteger_$ctor_Z524259C1, BigInteger_get_Two, BigInteger_get_One, BigInteger_get_Zero, BigInteger_Abs_Z665282C2, BigInteger_Pow_62E082A2, BigInteger_GreatestCommonDivisor_56F059C0, BigInteger_DivRem_56F059C0, BigInteger_Parse_Z721C83C5, BigInteger } from \"./BigInt/z.js\";\r\nimport { fromInteger } from \"./Long.js\";\r\nimport { comparePrimitives, min, compare as compare_1, equals as equals_1, safeHash } from \"./Util.js\";\r\nimport { toString as toString_1 } from \"./Types.js\";\r\nimport { fold, empty, ofArrayWithTail, cons, toArray, head, skipWhile } from \"./List.js\";\r\nimport { fill, reverse } from \"./Array.js\";\r\n\r\nexport function isBigInt(x) {\r\n return x instanceof BigInteger;\r\n}\r\n\r\nexport function tryParse(str, res) {\r\n try {\r\n res.contents = BigInteger_Parse_Z721C83C5(str);\r\n return true;\r\n }\r\n catch (matchValue) {\r\n return false;\r\n }\r\n}\r\n\r\nexport function divRem(x, y, remainder) {\r\n const patternInput = BigInteger_DivRem_56F059C0(x, y);\r\n remainder.contents = patternInput[1];\r\n return patternInput[0];\r\n}\r\n\r\nexport function parse(arg) {\r\n return BigInteger_Parse_Z721C83C5(arg);\r\n}\r\n\r\nexport function greatestCommonDivisor(arg, arg_1) {\r\n return BigInteger_GreatestCommonDivisor_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function pow(arg, arg_1) {\r\n return BigInteger_Pow_62E082A2(arg, arg_1);\r\n}\r\n\r\nexport function abs(arg) {\r\n return BigInteger_Abs_Z665282C2(arg);\r\n}\r\n\r\nexport const zero = BigInteger_get_Zero();\r\n\r\nexport const one = BigInteger_get_One();\r\n\r\nexport const two = BigInteger_get_Two();\r\n\r\nexport function fromString(s) {\r\n return BigInteger_Parse_Z721C83C5(s);\r\n}\r\n\r\nexport function fromZero() {\r\n return BigInteger_get_Zero();\r\n}\r\n\r\nexport function fromOne() {\r\n return BigInteger_get_One();\r\n}\r\n\r\nexport function fromInt64(i) {\r\n return BigInteger_$ctor_Z524259C1(i);\r\n}\r\n\r\nexport function fromInt32(i) {\r\n if (i > 2147483647) {\r\n return BigInteger_$ctor_Z524259C1(fromInteger(i, false, 6));\r\n }\r\n else {\r\n return BigInteger_$ctor_Z524259A4(i);\r\n }\r\n}\r\n\r\nexport function toSByte(x) {\r\n return BigInteger__get_ToSByte(x);\r\n}\r\n\r\nexport function toByte(x) {\r\n return BigInteger__get_ToByte(x);\r\n}\r\n\r\nexport function toInt16(x) {\r\n return BigInteger__get_ToInt16(x);\r\n}\r\n\r\nexport function toUInt16(x) {\r\n return BigInteger__get_ToUInt16(x);\r\n}\r\n\r\nexport function toInt32(x) {\r\n return BigInteger__get_ToInt32(x);\r\n}\r\n\r\nexport function toUInt32(x) {\r\n return BigInteger__get_ToUInt32(x);\r\n}\r\n\r\nexport function toInt64(x) {\r\n return BigInteger__get_ToInt64(x);\r\n}\r\n\r\nexport function toUInt64(x) {\r\n return BigInteger__get_ToUInt64(x);\r\n}\r\n\r\nexport function toSingle(x) {\r\n return BigInteger__get_ToSingle(x);\r\n}\r\n\r\nexport function toDouble(x) {\r\n return BigInteger__get_ToDouble(x);\r\n}\r\n\r\nexport function toDecimal(x) {\r\n return BigInteger__get_ToDecimal(x);\r\n}\r\n\r\nexport function sign(x) {\r\n return BigInteger__get_Sign(x);\r\n}\r\n\r\nexport function isZero(x) {\r\n return BigInteger__get_IsZero(x);\r\n}\r\n\r\nexport function isOne(x) {\r\n return BigInteger__get_IsOne(x);\r\n}\r\n\r\nexport function hash(x) {\r\n return safeHash(x);\r\n}\r\n\r\nexport function compare(x, y) {\r\n return x.CompareTo(y);\r\n}\r\n\r\nexport function equals(x, y) {\r\n return equals_1(x, y);\r\n}\r\n\r\nexport function toString(x) {\r\n return toString_1(x);\r\n}\r\n\r\nexport const get_Zero = BigInteger_get_Zero();\r\n\r\nexport const get_One = BigInteger_get_One();\r\n\r\nexport function op_Addition(arg, arg_1) {\r\n return BigInteger_op_Addition_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function op_Subtraction(arg, arg_1) {\r\n return BigInteger_op_Subtraction_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function op_Multiply(arg, arg_1) {\r\n return BigInteger_op_Multiply_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function op_Division(arg, arg_1) {\r\n return BigInteger_op_Division_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function op_Modulus(arg, arg_1) {\r\n return BigInteger_op_Modulus_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function op_UnaryNegation(arg) {\r\n return BigInteger_op_UnaryNegation_Z665282C2(arg);\r\n}\r\n\r\nexport function op_UnaryPlus(arg) {\r\n return BigInteger_op_UnaryPlus_Z665282C2(arg);\r\n}\r\n\r\nexport function op_RightShift(arg, arg_1) {\r\n return BigInteger_op_RightShift_62E082A2(arg, arg_1);\r\n}\r\n\r\nexport function op_LeftShift(arg, arg_1) {\r\n return BigInteger_op_LeftShift_62E082A2(arg, arg_1);\r\n}\r\n\r\nexport function op_BitwiseAnd(arg, arg_1) {\r\n return BigInteger_op_BitwiseAnd_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function op_BitwiseOr(arg, arg_1) {\r\n return BigInteger_op_BitwiseOr_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function op_ExclusiveOr(arg, arg_1) {\r\n return BigInteger_op_ExclusiveOr_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function op_LessThan(arg, arg_1) {\r\n return BigInteger_op_LessThan_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function op_LessThanOrEqual(arg, arg_1) {\r\n return BigInteger_op_LessThanOrEqual_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function op_GreaterThan(arg, arg_1) {\r\n return BigInteger_op_GreaterThan_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function op_GreaterThanOrEqual(arg, arg_1) {\r\n return BigInteger_op_GreaterThanOrEqual_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function op_Equality(arg, arg_1) {\r\n return BigInteger_op_Equality_56F059C0(arg, arg_1);\r\n}\r\n\r\nexport function op_Inequality(arg, arg_1) {\r\n return BigInteger_op_Inequality_56F059C0(arg, arg_1);\r\n}\r\n\r\nfunction flipTwosComplement(currByte, lowBitFound) {\r\n let array;\r\n const matchValue = [currByte, lowBitFound];\r\n if (matchValue[1]) {\r\n return [(currByte ^ 255) & 255, true];\r\n }\r\n else if (matchValue[0] === 0) {\r\n return [0, false];\r\n }\r\n else {\r\n return [(currByte ^ (254 << ((array = (new Int32Array([0, 1, 2, 3, 4, 5, 6, 7])), array.find((i) => ((currByte & (1 << i)) > 0)))))) & 255, true];\r\n }\r\n}\r\n\r\nexport function toByteArray(value) {\r\n if (equals_1(value, zero)) {\r\n return new Uint8Array([0]);\r\n }\r\n else {\r\n const isPositive = compare_1(value, zero) > 0;\r\n const value_1 = isPositive ? value : BigInteger_op_Multiply_56F059C0(BigInteger_$ctor_Z524259A4(-1), value);\r\n const mask32 = fromInt64(fromInteger(4294967295, false, 6));\r\n const loop = (accumBytes_mut, consumeValue_mut, lowBitFound_mut) => {\r\n let value_6, value_8, value_9, value_10;\r\n loop:\r\n while (true) {\r\n const accumBytes = accumBytes_mut, consumeValue = consumeValue_mut, lowBitFound = lowBitFound_mut;\r\n if (compare_1(consumeValue, zero) <= 0) {\r\n const accumBytes_1 = isPositive ? skipWhile((b) => (b === 0), accumBytes) : skipWhile((b_1) => (b_1 === 255), accumBytes);\r\n const isHighBitOne = (head(accumBytes_1) & 128) !== 0;\r\n return reverse(toArray((isPositive && isHighBitOne) ? cons(0, accumBytes_1) : (((!isPositive) && (!isHighBitOne)) ? cons(255, accumBytes_1) : accumBytes_1)));\r\n }\r\n else {\r\n const currValue = toUInt32(BigInteger_op_BitwiseAnd_56F059C0(consumeValue, mask32));\r\n if (isPositive) {\r\n const b0 = currValue & 0xFF;\r\n let b1;\r\n const value_4 = currValue >>> 8;\r\n b1 = (value_4 & 0xFF);\r\n let b2;\r\n const value_5 = currValue >>> 16;\r\n b2 = (value_5 & 0xFF);\r\n accumBytes_mut = ofArrayWithTail([(value_6 = (currValue >>> 24), value_6 & 0xFF), b2, b1, b0], accumBytes);\r\n consumeValue_mut = BigInteger_op_RightShift_62E082A2(consumeValue, 32);\r\n lowBitFound_mut = false;\r\n continue loop;\r\n }\r\n else {\r\n const patternInput = flipTwosComplement(currValue & 0xFF, lowBitFound);\r\n const patternInput_1 = flipTwosComplement((value_8 = (currValue >>> 8), value_8 & 0xFF), patternInput[1]);\r\n const patternInput_2 = flipTwosComplement((value_9 = (currValue >>> 16), value_9 & 0xFF), patternInput_1[1]);\r\n const patternInput_3 = flipTwosComplement((value_10 = (currValue >>> 24), value_10 & 0xFF), patternInput_2[1]);\r\n accumBytes_mut = ofArrayWithTail([patternInput_3[0], patternInput_2[0], patternInput_1[0], patternInput[0]], accumBytes);\r\n consumeValue_mut = BigInteger_op_RightShift_62E082A2(consumeValue, 32);\r\n lowBitFound_mut = patternInput_3[1];\r\n continue loop;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(empty(), value_1, false);\r\n }\r\n}\r\n\r\nexport function fromByteArray(bytes) {\r\n if (bytes == null) {\r\n throw (new Error(\"bytes\"));\r\n }\r\n if (bytes.length === 0) {\r\n return zero;\r\n }\r\n else {\r\n const isPositive = (bytes[bytes.length - 1] & 128) === 0;\r\n const buffer = fill(new Uint8Array(4), 0, 4, 0);\r\n const loop = (accumUInt32_mut, currIndex_mut, bytesRemaining_mut, lowBitFound_mut) => {\r\n loop:\r\n while (true) {\r\n const accumUInt32 = accumUInt32_mut, currIndex = currIndex_mut, bytesRemaining = bytesRemaining_mut, lowBitFound = lowBitFound_mut;\r\n if (bytesRemaining === 0) {\r\n const value_2 = fold((acc, value) => BigInteger_op_Addition_56F059C0(BigInteger_op_LeftShift_62E082A2(acc, 32), fromInt64(fromInteger(value, false, 6))), zero, accumUInt32);\r\n if (isPositive) {\r\n return value_2;\r\n }\r\n else {\r\n return BigInteger_op_Multiply_56F059C0(BigInteger_$ctor_Z524259A4(-1), value_2);\r\n }\r\n }\r\n else {\r\n const bytesToProcess = min(comparePrimitives, bytesRemaining, 4) | 0;\r\n for (let i_1 = 0; i_1 <= (bytesToProcess - 1); i_1++) {\r\n buffer[i_1] = bytes[currIndex + i_1];\r\n }\r\n if (isPositive) {\r\n fill(buffer, bytesToProcess, 4 - bytesToProcess, 0);\r\n accumUInt32_mut = cons((((((buffer[0] | ((buffer[1] << 8) >>> 0)) >>> 0) | ((buffer[2] << 16) >>> 0)) >>> 0) | ((buffer[3] << 24) >>> 0)) >>> 0, accumUInt32);\r\n currIndex_mut = (currIndex + bytesToProcess);\r\n bytesRemaining_mut = (bytesRemaining - bytesToProcess);\r\n lowBitFound_mut = false;\r\n continue loop;\r\n }\r\n else {\r\n fill(buffer, bytesToProcess, 4 - bytesToProcess, 255);\r\n const patternInput = flipTwosComplement(buffer[0], lowBitFound);\r\n const patternInput_1 = flipTwosComplement(buffer[1], patternInput[1]);\r\n const patternInput_2 = flipTwosComplement(buffer[2], patternInput_1[1]);\r\n const patternInput_3 = flipTwosComplement(buffer[3], patternInput_2[1]);\r\n accumUInt32_mut = cons((((((patternInput[0] | ((patternInput_1[0] << 8) >>> 0)) >>> 0) | ((patternInput_2[0] << 16) >>> 0)) >>> 0) | ((patternInput_3[0] << 24) >>> 0)) >>> 0, accumUInt32);\r\n currIndex_mut = (currIndex + bytesToProcess);\r\n bytesRemaining_mut = (bytesRemaining - bytesToProcess);\r\n lowBitFound_mut = patternInput_3[1];\r\n continue loop;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(empty(), 0, bytes.length, false);\r\n }\r\n}\r\n\r\n","namespace Fable.SimpleJson\n\nopen Fable.Core\nopen Fable.Parsimmon\nopen Parser\nopen Fable.Import\nopen System\nopen Fable.Core.JsInterop\n\n[]\nmodule InteropUtil =\n []\n let arrayFrom (xs: obj) : obj = jsNative\n []\n let get<'a> (key: string) (x: obj) : 'a = jsNative\n []\n let isDate (x: obj) = jsNative\n []\n let hasKey (key: string) (x: 'a) = jsNative\n let isDateOffset (x: obj) = isDate x && hasKey \"offset\" x\n []\n let getTypeOf (x: obj) : string = jsNative\n let isObjectLiteral (x: obj) = getTypeOf x = \"object\"\n let isBigInt (x: obj) =\n not (isNull x)\n && isObjectLiteral x\n && hasKey \"signInt\" x\n && hasKey \"v\" x\n && hasKey \"digits\" (get \"v\" x)\n && hasKey \"bound\" (get \"v\" x)\n\n []\n let log (x: 'a) : unit = jsNative\n\n []\n let createEmptyObject() : obj = jsNative\n\nmodule SimpleJson =\n /// Tries to parse a string into a Json structured JSON data.\n let tryParse (input: string) : Option =\n Parsimmon.parse input jsonParser\n\n /// Parses the input string into a structured JSON data. Fails with an exception if parsing fails.\n let parse (input: string) : Json =\n match tryParse input with\n | Some result -> result\n | None -> failwithf \"Could not parse the JSON input: %s\" input\n\n /// Stringifies a Json object back to string representation\n let rec toString = function\n | JNull -> \"null\"\n | JBool true -> \"true\"\n | JBool false -> \"false\"\n | JNumber number -> string number\n | JString text -> sprintf \"\\\"%s\\\"\" text\n | JArray elements ->\n elements\n |> List.map toString\n |> String.concat \",\"\n |> sprintf \"[%s]\"\n | JObject map ->\n map\n |> Map.toList\n |> List.map (fun (key,value) -> sprintf \"\\\"%s\\\":%s\" key (toString value))\n |> String.concat \",\"\n |> sprintf \"{%s}\"\n\n []\n let private setValue (key: string) (value: obj) (destination: obj) = jsNative\n let rec toPlainObject (input: Json) : obj =\n match input with\n | JNull -> unbox null\n | JBool value -> unbox value\n | JNumber value -> unbox value\n | JString value -> unbox value\n | JArray values ->\n let array = new ResizeArray()\n for value in values do array.Add(toPlainObject value)\n unbox array\n | JObject map ->\n let jsObject = createEmptyObject()\n for (key, value) in Map.toList map do\n setValue key (toPlainObject value) jsObject\n unbox jsObject\n\n let stringify (value: 'a) : string =\n if isNullOrUndefined value\n then JS.JSON.stringify(null)\n else JS.JSON.stringify(value, (fun key jsonValue ->\n if isBigInt jsonValue then\n let bigInt : bigint = unbox(jsonValue)\n box (string (decimal bigInt))\n elif isDate jsonValue then\n let dateOffset : DateTimeOffset = unbox(jsonValue)\n box (dateOffset.ToString(\"o\"))\n else\n match jsonValue with\n | :? string -> jsonValue\n | :? System.Collections.IEnumerable ->\n if JS.Constructors.Array.isArray(jsonValue) then jsonValue\n else arrayFrom jsonValue\n | _ when isBigInt jsonValue -> box (string (decimal (unbox jsonValue)))\n | _ when isDateOffset jsonValue -> box ((unbox jsonValue).ToString(\"O\"))\n | _ -> jsonValue\n ), 0)\n\n let rec internal parseNative' (x: obj) =\n match x with\n | TypeCheck.NativeString str -> JString str\n | TypeCheck.NativeNumber number -> JNumber number\n | TypeCheck.NativeBool value -> JBool value\n | TypeCheck.Null _ -> JNull\n | TypeCheck.NativeArray arr -> JArray (List.ofArray (Array.map parseNative' arr))\n | TypeCheck.NativeObject object ->\n [ for key in JS.Constructors.Object.keys object -> key, parseNative' (get key object) ]\n |> Map.ofList\n |> JObject\n | _ -> JNull\n\n /// Parses and converts the input string to Json using Javascript's native parsing capabilities\n let parseNative (input: string) =\n let parsed = JS.JSON.parse input\n parseNative' parsed\n\n let tryParseNative (input: string) =\n try Some (parseNative input)\n with | ex -> None\n\n /// Tries to convert an object literal to the Json by calling JSON.stringify on the object first\n let fromObjectLiteral (x: 'a) =\n try Some (parseNative' x)\n with | _ -> None\n\n /// Transforms all keys of the objects within the Json structure\n let rec mapKeys f = function\n | JObject dictionary ->\n dictionary\n |> Map.toList\n |> List.map (fun (key, value) -> f key, mapKeys f value)\n |> Map.ofList\n |> JObject\n | JArray values ->\n values\n |> List.map (mapKeys f)\n |> JArray\n | otherJsonValue -> otherJsonValue\n\n /// Transforms object values recursively using function `f` that takes the key and value of the object and returns a new value\n let rec mapbyKey f = function\n | JObject dictionary ->\n dictionary\n |> Map.toList\n |> List.map (fun (key, value) -> key, f key value)\n |> Map.ofList\n |> JObject\n | JArray values ->\n values\n |> List.map (mapbyKey f)\n |> JArray\n | otherJsonValue -> otherJsonValue\n\n /// Transforms keys of object selectively by path segments\n let mapKeysByPath f json =\n let rec mapKey xs = function\n | JObject dictionary ->\n dictionary\n |> Map.toList\n |> List.map (fun (key, value) ->\n let keyPath = List.concat [xs; [key]]\n match f keyPath with\n | Some nextKey -> nextKey, mapKey keyPath value\n | None -> key, mapKey keyPath value)\n |> Map.ofList\n |> JObject\n | JArray values ->\n values\n |> List.map (mapKey xs)\n |> JArray\n | otherJsonValue -> otherJsonValue\n mapKey [] json\n\n let rec readPath (keys: string list) (input: Json) =\n match keys, input with\n | [ ], _ -> None\n | [ key ], JObject dict -> Map.tryFind key dict\n | firstKey :: rest, JObject dict ->\n match Map.tryFind firstKey dict with\n | Some (JObject nextDict) -> readPath rest (JObject nextDict)\n | _ -> None\n | _ -> None","namespace Fable.SimpleJson\n\nopen Fable.Core\nopen Fable.Core.JsInterop\n\nmodule TypeCheck =\n\n []\n let typeofString (x: obj) : bool = jsNative\n\n []\n let typeofBool (x: obj) : bool = jsNative\n\n []\n let typeofNumber (x: obj) : bool = jsNative\n []\n let typeofObject (x: obj) : bool = jsNative\n\n let (|NativeString|_|) (x: obj) =\n if typeofString x\n then Some (unbox x)\n else None\n\n let (|NativeBool|_|) (x: obj) =\n if typeofBool x\n then Some (unbox x)\n else None\n\n let (|NativeNumber|_|) (x: obj) =\n if typeofNumber x\n then Some (unbox x)\n else None\n\n let (|NativeObject|_|) (x: obj) =\n if typeofObject x\n then Some x\n else None\n\n let (|Null|_|) (x: obj) =\n if isNull x\n then Some x\n else None\n\n let (|NativeArray|_|) (x: obj) =\n if (JS.Constructors.Array.isArray x)\n then Some (unbox x)\n else None","/**\n * DateTimeOffset functions.\n *\n * Note: DateOffset instances are always DateObjects in local\n * timezone (because JS dates are all kinds of messed up).\n * A local date returns UTC epoc when `.getTime()` is called.\n *\n * However, this means that in order to construct an UTC date\n * from a DateOffset with offset of +5 hours, you first need\n * to subtract those 5 hours, than add the \"local\" offset.\n * As said, all kinds of messed up.\n *\n * Basically; invariant: date.getTime() always return UTC time.\n */\nimport { create as createDate, dateOffsetToString, daysInMonth, parseRaw } from \"./Date.js\";\nimport { fromValue, ticksToUnixEpochMilliseconds, unixEpochMillisecondsToTicks } from \"./Long.js\";\nimport { compareDates, padWithZeros } from \"./Util.js\";\nexport default function DateTimeOffset(value, offset) {\n checkOffsetInRange(offset);\n const d = new Date(value);\n d.offset = offset != null ? offset : new Date().getTimezoneOffset() * -60000;\n return d;\n}\nfunction checkOffsetInRange(offset) {\n if (offset != null && offset !== 0) {\n if (offset % 60000 !== 0) {\n throw new Error(\"Offset must be specified in whole minutes.\");\n }\n if (Math.abs(offset / 3600000) > 14) {\n throw new Error(\"Offset must be within plus or minus 14 hours.\");\n }\n }\n}\nexport function fromDate(date, offset) {\n let offset2 = 0;\n switch (date.kind) {\n case 1 /* UTC */:\n if (offset != null && offset !== 0) {\n throw new Error(\"The UTC Offset for Utc DateTime instances must be 0.\");\n }\n offset2 = 0;\n break;\n case 2 /* Local */:\n offset2 = date.getTimezoneOffset() * -60000;\n if (offset != null && offset !== offset2) {\n throw new Error(\"The UTC Offset of the local dateTime parameter does not match the offset argument.\");\n }\n break;\n case 0 /* Unspecified */:\n default:\n if (offset == null) {\n offset2 = date.getTimezoneOffset() * -60000;\n }\n else {\n offset2 = offset;\n }\n break;\n }\n return DateTimeOffset(date.getTime(), offset2);\n}\nexport function fromTicks(ticks, offset) {\n ticks = fromValue(ticks);\n const epoc = ticksToUnixEpochMilliseconds(ticks) - offset;\n return DateTimeOffset(epoc, offset);\n}\nexport function getUtcTicks(date) {\n return unixEpochMillisecondsToTicks(date.getTime(), 0);\n}\nexport function minValue() {\n // This is \"0001-01-01T00:00:00.000Z\", actual JS min value is -8640000000000000\n return DateTimeOffset(-62135596800000, 0);\n}\nexport function maxValue() {\n // This is \"9999-12-31T23:59:59.999Z\", actual JS max value is 8640000000000000\n return DateTimeOffset(253402300799999, 0);\n}\nexport function parse(str) {\n const [date, offsetMatch] = parseRaw(str);\n const offset = offsetMatch == null\n ? date.getTimezoneOffset() * -60000\n : (offsetMatch === \"Z\" ? 0 : offsetMatch * 60000);\n return DateTimeOffset(date.getTime(), offset);\n}\nexport function tryParse(v, defValue) {\n try {\n defValue.contents = parse(v);\n return true;\n }\n catch (_err) {\n return false;\n }\n}\nexport function create(year, month, day, h, m, s, ms, offset) {\n if (offset == null) {\n offset = ms;\n ms = 0;\n }\n checkOffsetInRange(offset);\n let date;\n if (offset === 0) {\n date = new Date(Date.UTC(year, month - 1, day, h, m, s, ms));\n if (year <= 99) {\n date.setFullYear(year, month - 1, day);\n }\n }\n else {\n const str = padWithZeros(year, 4) + \"-\" +\n padWithZeros(month, 2) + \"-\" +\n padWithZeros(day, 2) + \"T\" +\n padWithZeros(h, 2) + \":\" +\n padWithZeros(m, 2) + \":\" +\n padWithZeros(s, 2) + \".\" +\n padWithZeros(ms, 3) +\n dateOffsetToString(offset);\n date = new Date(str);\n }\n const dateValue = date.getTime();\n if (isNaN(dateValue)) {\n throw new Error(\"The parameters describe an unrepresentable Date\");\n }\n return DateTimeOffset(dateValue, offset);\n}\nexport function now() {\n const date = new Date();\n const offset = date.getTimezoneOffset() * -60000;\n return DateTimeOffset(date.getTime(), offset);\n}\nexport function utcNow() {\n const date = now();\n return DateTimeOffset(date.getTime(), 0);\n}\nexport function toUniversalTime(date) {\n return DateTimeOffset(date.getTime(), 0);\n}\nexport function toLocalTime(date) {\n return DateTimeOffset(date.getTime(), date.getTimezoneOffset() * -60000);\n}\nexport function timeOfDay(d) {\n var _a;\n const d2 = new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n return d2.getUTCHours() * 3600000\n + d2.getUTCMinutes() * 60000\n + d2.getUTCSeconds() * 1000\n + d2.getUTCMilliseconds();\n}\nexport function date(d) {\n var _a;\n const d2 = new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n return createDate(d2.getUTCFullYear(), d2.getUTCMonth() + 1, d2.getUTCDate(), 0, 0, 0, 0);\n}\nexport function day(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCDate();\n}\nexport function hour(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCHours();\n}\nexport function millisecond(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCMilliseconds();\n}\nexport function minute(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCMinutes();\n}\nexport function month(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCMonth() + 1;\n}\nexport function second(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCSeconds();\n}\nexport function year(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCFullYear();\n}\nexport function dayOfWeek(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCDay();\n}\nexport function dayOfYear(d) {\n var _a;\n const d2 = new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n const _year = d2.getUTCFullYear();\n const _month = d2.getUTCMonth() + 1;\n let _day = d2.getUTCDate();\n for (let i = 1; i < _month; i++) {\n _day += daysInMonth(_year, i);\n }\n return _day;\n}\nexport function add(d, ts) {\n var _a;\n return DateTimeOffset(d.getTime() + ts, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addDays(d, v) {\n var _a;\n return DateTimeOffset(d.getTime() + v * 86400000, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addHours(d, v) {\n var _a;\n return DateTimeOffset(d.getTime() + v * 3600000, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addMinutes(d, v) {\n var _a;\n return DateTimeOffset(d.getTime() + v * 60000, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addSeconds(d, v) {\n var _a;\n return DateTimeOffset(d.getTime() + v * 1000, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addMilliseconds(d, v) {\n var _a;\n return DateTimeOffset(d.getTime() + v, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addYears(d, v) {\n var _a;\n const newMonth = d.getUTCMonth() + 1;\n const newYear = d.getUTCFullYear() + v;\n const _daysInMonth = daysInMonth(newYear, newMonth);\n const newDay = Math.min(_daysInMonth, d.getUTCDate());\n return create(newYear, newMonth, newDay, d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds(), ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addMonths(d, v) {\n var _a, _b;\n const d2 = new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n let newMonth = d2.getUTCMonth() + 1 + v;\n let newMonth_ = 0;\n let yearOffset = 0;\n if (newMonth > 12) {\n newMonth_ = newMonth % 12;\n yearOffset = Math.floor(newMonth / 12);\n newMonth = newMonth_;\n }\n else if (newMonth < 1) {\n newMonth_ = 12 + newMonth % 12;\n yearOffset = Math.floor(newMonth / 12) + (newMonth_ === 12 ? -1 : 0);\n newMonth = newMonth_;\n }\n const newYear = d2.getUTCFullYear() + yearOffset;\n const _daysInMonth = daysInMonth(newYear, newMonth);\n const newDay = Math.min(_daysInMonth, d2.getUTCDate());\n return create(newYear, newMonth, newDay, d2.getUTCHours(), d2.getUTCMinutes(), d2.getUTCSeconds(), d2.getUTCMilliseconds(), ((_b = d.offset) !== null && _b !== void 0 ? _b : 0));\n}\nexport function subtract(d, that) {\n var _a;\n return typeof that === \"number\"\n ? DateTimeOffset(d.getTime() - that, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0))\n : d.getTime() - that.getTime();\n}\nexport function equals(d1, d2) {\n return d1.getTime() === d2.getTime();\n}\nexport function equalsExact(d1, d2) {\n return d1.getTime() === d2.getTime() && d1.offset === d2.offset;\n}\nexport function compare(d1, d2) {\n return compareDates(d1, d2);\n}\nexport const compareTo = compare;\nexport function op_Addition(x, y) {\n return add(x, y);\n}\nexport function op_Subtraction(x, y) {\n return subtract(x, y);\n}\nexport function toOffset(d, offset) {\n return DateTimeOffset(d.getTime(), offset);\n}\n","import { DateTime, getTicks, dayOfYear as Date_dayOfYear, year as Date_year, month as Date_month, day as Date_day, daysInMonth as Date_daysInMonth } from \"./Date.js\";\nimport { padWithZeros } from \"./Util.js\";\nimport { toInt, fromNumber, op_Division as Long_op_Division, op_Multiply as Long_op_Multiply, ticksToUnixEpochMilliseconds } from \"./Long.js\";\nexport function fromUnixMilliseconds(value) {\n return DateTime(value, 1 /* UTC */);\n}\nexport function create(year, month, day) {\n const d = fromUnixMilliseconds(Date.UTC(year, month - 1, day));\n if (year <= 99) {\n d.setUTCFullYear(year);\n }\n return d;\n}\nexport function maxValue() {\n // This is \"9999-12-31T00:00:00.000Z\"\n return fromUnixMilliseconds(253402214400000);\n}\nexport function minValue() {\n // This is \"0001-01-01T00:00:00.000Z\"\n return fromUnixMilliseconds(-62135596800000);\n}\nexport function dayNumber(d) {\n return toInt(Long_op_Division(getTicks(d), 864000000000));\n}\nexport function fromDayNumber(dayNumber) {\n const ticks = Long_op_Multiply(fromNumber(864000000000), dayNumber);\n return fromUnixMilliseconds(ticksToUnixEpochMilliseconds(ticks));\n}\nexport function fromDateTime(d) {\n return create(Date_year(d), Date_month(d), Date_day(d));\n}\nexport function day(d) {\n return d.getUTCDate();\n}\nexport function month(d) {\n return d.getUTCMonth() + 1;\n}\nexport function year(d) {\n return d.getUTCFullYear();\n}\nexport function dayOfWeek(d) {\n return d.getUTCDay();\n}\nexport function dayOfYear(d) {\n return Date_dayOfYear(d);\n}\nexport function toDateTime(d, time, kind = 0 /* Unspecified */) {\n return DateTime(d.getTime() + time + (kind !== 1 /* UTC */ ? d.getTimezoneOffset() : 0) * 60000, kind);\n}\nexport function toString(d, format = \"d\", _provider) {\n if ([\"d\", \"o\", \"O\"].indexOf(format) === -1) {\n throw new Error(\"Custom formats are not supported\");\n }\n const y = padWithZeros(year(d), 4);\n const m = padWithZeros(month(d), 2);\n const dd = padWithZeros(day(d), 2);\n return format === \"d\" ? `${m}/${dd}/${y}` : `${y}-${m}-${dd}`;\n}\nexport function parse(str) {\n function fail() {\n throw new Error(`String '${str}' was not recognized as a valid DateOnly.`);\n }\n // Allowed separators: . , / -\n // TODO whitespace alone as the separator\n //\n // Whitespace around separators\n //\n // Allowed format types:\n // yyyy/mm/dd\n // mm/dd/yyyy\n // mm/dd\n // mm/yyyy\n // yyyy/mm\n const r = /^\\s*(\\d{1,4})(?:\\s*[.,-\\/]\\s*(\\d{1,2}))?\\s*[.,-\\/]\\s*(\\d{1,4})\\s*$/.exec(str);\n if (r != null) {\n let y = 0;\n let m = 0;\n let d = 1;\n if (r[2] == null) {\n if (r[1].length < 3) {\n if (r[3].length < 3) {\n // 12/30 = December 30, {CurrentYear}\n y = new Date().getFullYear();\n m = +r[1];\n d = +r[3];\n }\n else {\n // 12/2000 = December 1, 2000\n m = +r[1];\n y = +r[3];\n }\n }\n else {\n if (r[3].length > 2)\n fail();\n // 2000/12 = December 1, 2000\n y = +r[1];\n m = +r[3];\n }\n }\n else {\n // 2000/1/30 or 1/30/2000\n const yearFirst = r[1].length > 2;\n const yTmp = r[yearFirst ? 1 : 3];\n y = +yTmp;\n // year 0-29 is 2000-2029, 30-99 is 1930-1999\n if (yTmp.length < 3)\n y += y >= 30 ? 1900 : 2000;\n m = +r[yearFirst ? 2 : 1];\n d = +r[yearFirst ? 3 : 2];\n }\n if (y > 0 && m > 0 && m < 13 && d > 0 && d <= Date_daysInMonth(y, m))\n return create(y, m, d);\n }\n return fail();\n}\nexport function tryParse(v, defValue) {\n try {\n defValue.contents = parse(v);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\n","import { op_Division as Long_op_Division, toNumber as Long_toNumber } from \"./Long.js\";\nimport { hours, minutes, seconds, milliseconds } from \"./TimeSpan.js\";\nimport { padWithZeros } from \"./Util.js\";\nconst millisecondsPerDay = 86400000;\nexport function create(h = 0, m = 0, s = 0, ms = 0) {\n if (h < 0 || m < 0 || s < 0 || ms < 0)\n throw new Error(\"The parameters describe an unrepresentable TimeOnly.\");\n if (arguments.length === 1)\n // ticks\n return fromTicks(arguments[0]);\n else\n return h * 3600000 + m * 60000 + s * 1000 + ms;\n}\nexport function fromTicks(ticks) {\n return Long_toNumber(Long_op_Division(ticks, 10000));\n}\nexport function fromTimeSpan(timeSpan) {\n if (timeSpan < 0 || timeSpan >= millisecondsPerDay)\n throw new Error(\"The TimeSpan describes an unrepresentable TimeOnly.\");\n return timeSpan;\n}\nexport function fromDateTime(d) {\n return d.kind === 1 /* UTC */\n ? create(d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds())\n : create(d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());\n}\nexport function maxValue() {\n // This is \"23:59:59.999\"\n return millisecondsPerDay - 1;\n}\nexport function add(t, ts, wrappedDays) {\n if (wrappedDays === undefined) {\n const t2 = (t + ts) % millisecondsPerDay;\n return t2 < 0 ? millisecondsPerDay + t2 : t2;\n }\n wrappedDays.contents = ts / millisecondsPerDay;\n let newMs = t + ts % millisecondsPerDay;\n if (newMs < 0) {\n wrappedDays.contents--;\n newMs += millisecondsPerDay;\n }\n else {\n if (newMs >= millisecondsPerDay) {\n wrappedDays.contents++;\n newMs -= millisecondsPerDay;\n }\n }\n return newMs;\n}\nexport function addHours(t, h) {\n return add(t, h * 3600000);\n}\nexport function addMinutes(t, m) {\n return add(t, m * 60000);\n}\nexport function isBetween(t, start, end) {\n return start <= end\n ? (start <= t && end > t)\n : (start <= t || end > t);\n}\nexport function toString(t, format = \"t\", _provider) {\n if ([\"r\", \"R\", \"o\", \"O\", \"t\", \"T\"].indexOf(format) === -1) {\n throw new Error(\"Custom formats are not supported\");\n }\n const base = `${padWithZeros(hours(t), 2)}:${padWithZeros(minutes(t), 2)}`;\n if (format === \"t\")\n return base;\n const s = padWithZeros(seconds(t), 2);\n // We're limited to millisecond precision, so the last 4 digits will always be 0\n return `${base}${format === \"o\" || format === \"O\" ? `:${s}.${padWithZeros(milliseconds(t), 3)}0000` : `:${s}`}`;\n}\nexport function parse(str) {\n // Allowed format types:\n // hh:mm\n // hh:mm:ss\n // hh:mm:ss.fffffff\n const r = /^\\s*([0-1]?\\d|2[0-3])\\s*:\\s*([0-5]?\\d)(\\s*:\\s*([0-5]?\\d)(\\.(\\d+))?)?\\s*$/.exec(str);\n if (r != null && r[1] != null && r[2] != null) {\n let ms = 0;\n let s = 0;\n const h = +r[1];\n const m = +r[2];\n if (r[4] != null) {\n s = +r[4];\n }\n if (r[6] != null) {\n // Depending on the number of decimals passed, we need to adapt the numbers\n switch (r[6].length) {\n case 1:\n ms = +r[6] * 100;\n break;\n case 2:\n ms = +r[6] * 10;\n break;\n case 3:\n ms = +r[6];\n break;\n case 4:\n ms = +r[6] / 10;\n break;\n case 5:\n ms = +r[6] / 100;\n break;\n case 6:\n ms = +r[6] / 1000;\n break;\n default:\n ms = +r[6].substring(0, 7) / 10000;\n break;\n }\n }\n return create(h, m, s, Math.trunc(ms));\n }\n throw new Error(`String '${str}' was not recognized as a valid TimeOnly.`);\n}\nexport function tryParse(v, defValue) {\n try {\n defValue.contents = parse(v);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nexport function op_Subtraction(left, right) {\n return add(left, -right);\n}\n","import { fromBits, getHighBits, getHighBitsUnsigned, getLowBits, getLowBitsUnsigned } from \"./Long.js\";\nconst littleEndian = true;\nexport function isLittleEndian() {\n return littleEndian;\n}\nexport function getBytesBoolean(value) {\n const bytes = new Uint8Array(1);\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n view.setUint8(0, value ? 1 : 0);\n return bytes;\n}\nexport function getBytesChar(value) {\n const bytes = new Uint8Array(2);\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n view.setUint16(0, value.charCodeAt(0), littleEndian);\n return bytes;\n}\nexport function getBytesInt16(value) {\n const bytes = new Uint8Array(2);\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n view.setInt16(0, value, littleEndian);\n return bytes;\n}\nexport function getBytesInt32(value) {\n const bytes = new Uint8Array(4);\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n view.setInt32(0, value, littleEndian);\n return bytes;\n}\nexport function getBytesInt64(value) {\n const bytes = new Uint8Array(8);\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n view.setInt32(littleEndian ? 0 : 4, getLowBits(value), littleEndian);\n view.setInt32(littleEndian ? 4 : 0, getHighBits(value), littleEndian);\n return bytes;\n}\nexport function getBytesUInt16(value) {\n const bytes = new Uint8Array(2);\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n view.setUint16(0, value, littleEndian);\n return bytes;\n}\nexport function getBytesUInt32(value) {\n const bytes = new Uint8Array(4);\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n view.setUint32(0, value, littleEndian);\n return bytes;\n}\nexport function getBytesUInt64(value) {\n const bytes = new Uint8Array(8);\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n view.setUint32(littleEndian ? 0 : 4, getLowBitsUnsigned(value), littleEndian);\n view.setUint32(littleEndian ? 4 : 0, getHighBitsUnsigned(value), littleEndian);\n return bytes;\n}\nexport function getBytesSingle(value) {\n const bytes = new Uint8Array(4);\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n view.setFloat32(0, value, littleEndian);\n return bytes;\n}\nexport function getBytesDouble(value) {\n const bytes = new Uint8Array(8);\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n view.setFloat64(0, value, littleEndian);\n return bytes;\n}\nexport function int64BitsToDouble(value) {\n const buffer = new ArrayBuffer(8);\n const view = new DataView(buffer);\n view.setInt32(littleEndian ? 0 : 4, getLowBits(value), littleEndian);\n view.setInt32(littleEndian ? 4 : 0, getHighBits(value), littleEndian);\n return view.getFloat64(0, littleEndian);\n}\nexport function doubleToInt64Bits(value) {\n const buffer = new ArrayBuffer(8);\n const view = new DataView(buffer);\n view.setFloat64(0, value, littleEndian);\n const lowBits = view.getInt32(littleEndian ? 0 : 4, littleEndian);\n const highBits = view.getInt32(littleEndian ? 4 : 0, littleEndian);\n return fromBits(lowBits, highBits, false);\n}\nexport function toBoolean(bytes, offset) {\n const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);\n const view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n return view.getUint8(offset) === 1 ? true : false;\n}\nexport function toChar(bytes, offset) {\n const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);\n const view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n const code = view.getUint16(offset, littleEndian);\n return String.fromCharCode(code);\n}\nexport function toInt16(bytes, offset) {\n const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);\n const view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n return view.getInt16(offset, littleEndian);\n}\nexport function toInt32(bytes, offset) {\n const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);\n const view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n return view.getInt32(offset, littleEndian);\n}\nexport function toInt64(bytes, offset) {\n const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);\n const view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n const lowBits = view.getInt32(offset + (littleEndian ? 0 : 4), littleEndian);\n const highBits = view.getInt32(offset + (littleEndian ? 4 : 0), littleEndian);\n return fromBits(lowBits, highBits, false);\n}\nexport function toUInt16(bytes, offset) {\n const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);\n const view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n return view.getUint16(offset, littleEndian);\n}\nexport function toUInt32(bytes, offset) {\n const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);\n const view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n return view.getUint32(offset, littleEndian);\n}\nexport function toUInt64(bytes, offset) {\n const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);\n const view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n const lowBits = view.getUint32(offset + (littleEndian ? 0 : 4), littleEndian);\n const highBits = view.getUint32(offset + (littleEndian ? 4 : 0), littleEndian);\n return fromBits(lowBits, highBits, true);\n}\nexport function toSingle(bytes, offset) {\n const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);\n const view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n return view.getFloat32(offset, littleEndian);\n}\nexport function toDouble(bytes, offset) {\n const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);\n const view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n return view.getFloat64(offset, littleEndian);\n}\nexport function toString(bytes, offset, count) {\n const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);\n let buffer = new Uint8Array(array.buffer, array.byteOffset, array.byteLength);\n if (offset != null && count != null) {\n buffer = buffer.subarray(offset, offset + count);\n }\n else if (offset != null) {\n buffer = buffer.subarray(offset);\n }\n return Array.from(buffer).map((b) => (\"0\" + b.toString(16)).slice(-2)).join(\"-\");\n}\n","import { record_type, bool_type, list_type, option_type, class_type } from \"./Reflection.js\";\r\nimport { some, value as value_1 } from \"./Option.js\";\r\nimport { toString, Record } from \"./Types.js\";\r\nimport { FSharpList, fold as fold_2, cons, singleton as singleton_1, empty as empty_1, ofArrayWithTail, tail, head, isEmpty as isEmpty_1 } from \"./List.js\";\r\nimport { fold as fold_1, fill } from \"./Array.js\";\r\nimport { structuralHash, toIterator, disposeSafe, getEnumerator, isArrayLike } from \"./Util.js\";\r\nimport { join } from \"./String.js\";\r\nimport { exists as exists_1, cache, forAll as forAll_1, fold as fold_3, reduce, iterate as iterate_1, map as map_1 } from \"./Seq.js\";\r\nimport { HashSet__get_Comparer, HashSet_$ctor_Z6150332D, HashSet } from \"./MutableSet.js\";\r\n\r\nexport class SetTreeLeaf$1 {\r\n constructor(k) {\r\n this.k = k;\r\n }\r\n}\r\n\r\nexport function SetTreeLeaf$1$reflection(gen0) {\r\n return class_type(\"Set.SetTreeLeaf`1\", [gen0], SetTreeLeaf$1);\r\n}\r\n\r\nexport function SetTreeLeaf$1_$ctor_2B595(k) {\r\n return new SetTreeLeaf$1(k);\r\n}\r\n\r\nexport function SetTreeLeaf$1__get_Key(_) {\r\n return _.k;\r\n}\r\n\r\nexport class SetTreeNode$1 extends SetTreeLeaf$1 {\r\n constructor(v, left, right, h) {\r\n super(v);\r\n this.left = left;\r\n this.right = right;\r\n this.h = (h | 0);\r\n }\r\n}\r\n\r\nexport function SetTreeNode$1$reflection(gen0) {\r\n return class_type(\"Set.SetTreeNode`1\", [gen0], SetTreeNode$1, SetTreeLeaf$1$reflection(gen0));\r\n}\r\n\r\nexport function SetTreeNode$1_$ctor_Z6E7BE5F7(v, left, right, h) {\r\n return new SetTreeNode$1(v, left, right, h);\r\n}\r\n\r\nexport function SetTreeNode$1__get_Left(_) {\r\n return _.left;\r\n}\r\n\r\nexport function SetTreeNode$1__get_Right(_) {\r\n return _.right;\r\n}\r\n\r\nexport function SetTreeNode$1__get_Height(_) {\r\n return _.h;\r\n}\r\n\r\nexport function SetTreeModule_empty() {\r\n return void 0;\r\n}\r\n\r\nexport function SetTreeModule_countAux(t_mut, acc_mut) {\r\n SetTreeModule_countAux:\r\n while (true) {\r\n const t = t_mut, acc = acc_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n acc_mut = SetTreeModule_countAux(SetTreeNode$1__get_Right(t2), acc + 1);\r\n continue SetTreeModule_countAux;\r\n }\r\n else {\r\n return (acc + 1) | 0;\r\n }\r\n }\r\n else {\r\n return acc | 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_count(s) {\r\n return SetTreeModule_countAux(s, 0);\r\n}\r\n\r\nexport function SetTreeModule_mk(l, k, r) {\r\n let hl;\r\n const t = l;\r\n if (t != null) {\r\n const t2 = t;\r\n hl = ((t2 instanceof SetTreeNode$1) ? SetTreeNode$1__get_Height(t2) : 1);\r\n }\r\n else {\r\n hl = 0;\r\n }\r\n let hr;\r\n const t_1 = r;\r\n if (t_1 != null) {\r\n const t2_1 = t_1;\r\n hr = ((t2_1 instanceof SetTreeNode$1) ? SetTreeNode$1__get_Height(t2_1) : 1);\r\n }\r\n else {\r\n hr = 0;\r\n }\r\n const m = ((hl < hr) ? hr : hl) | 0;\r\n if (m === 0) {\r\n return SetTreeLeaf$1_$ctor_2B595(k);\r\n }\r\n else {\r\n return SetTreeNode$1_$ctor_Z6E7BE5F7(k, l, r, m + 1);\r\n }\r\n}\r\n\r\nexport function SetTreeModule_rebalance(t1, v, t2) {\r\n let t_2, t2_3, t_3, t2_4;\r\n let t1h;\r\n const t = t1;\r\n if (t != null) {\r\n const t2_1 = t;\r\n t1h = ((t2_1 instanceof SetTreeNode$1) ? SetTreeNode$1__get_Height(t2_1) : 1);\r\n }\r\n else {\r\n t1h = 0;\r\n }\r\n let t2h;\r\n const t_1 = t2;\r\n if (t_1 != null) {\r\n const t2_2 = t_1;\r\n t2h = ((t2_2 instanceof SetTreeNode$1) ? SetTreeNode$1__get_Height(t2_2) : 1);\r\n }\r\n else {\r\n t2h = 0;\r\n }\r\n if (t2h > (t1h + 2)) {\r\n const matchValue = value_1(t2);\r\n if (matchValue instanceof SetTreeNode$1) {\r\n if (((t_2 = SetTreeNode$1__get_Left(matchValue), (t_2 != null) ? ((t2_3 = t_2, (t2_3 instanceof SetTreeNode$1) ? SetTreeNode$1__get_Height(t2_3) : 1)) : 0)) > (t1h + 1)) {\r\n const matchValue_1 = value_1(SetTreeNode$1__get_Left(matchValue));\r\n if (matchValue_1 instanceof SetTreeNode$1) {\r\n return SetTreeModule_mk(SetTreeModule_mk(t1, v, SetTreeNode$1__get_Left(matchValue_1)), SetTreeLeaf$1__get_Key(matchValue_1), SetTreeModule_mk(SetTreeNode$1__get_Right(matchValue_1), SetTreeLeaf$1__get_Key(matchValue), SetTreeNode$1__get_Right(matchValue)));\r\n }\r\n else {\r\n throw (new Error(\"internal error: Set.rebalance\"));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_mk(SetTreeModule_mk(t1, v, SetTreeNode$1__get_Left(matchValue)), SetTreeLeaf$1__get_Key(matchValue), SetTreeNode$1__get_Right(matchValue));\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Set.rebalance\"));\r\n }\r\n }\r\n else if (t1h > (t2h + 2)) {\r\n const matchValue_2 = value_1(t1);\r\n if (matchValue_2 instanceof SetTreeNode$1) {\r\n if (((t_3 = SetTreeNode$1__get_Right(matchValue_2), (t_3 != null) ? ((t2_4 = t_3, (t2_4 instanceof SetTreeNode$1) ? SetTreeNode$1__get_Height(t2_4) : 1)) : 0)) > (t2h + 1)) {\r\n const matchValue_3 = value_1(SetTreeNode$1__get_Right(matchValue_2));\r\n if (matchValue_3 instanceof SetTreeNode$1) {\r\n return SetTreeModule_mk(SetTreeModule_mk(SetTreeNode$1__get_Left(matchValue_2), SetTreeLeaf$1__get_Key(matchValue_2), SetTreeNode$1__get_Left(matchValue_3)), SetTreeLeaf$1__get_Key(matchValue_3), SetTreeModule_mk(SetTreeNode$1__get_Right(matchValue_3), v, t2));\r\n }\r\n else {\r\n throw (new Error(\"internal error: Set.rebalance\"));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_mk(SetTreeNode$1__get_Left(matchValue_2), SetTreeLeaf$1__get_Key(matchValue_2), SetTreeModule_mk(SetTreeNode$1__get_Right(matchValue_2), v, t2));\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Set.rebalance\"));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_mk(t1, v, t2);\r\n }\r\n}\r\n\r\nexport function SetTreeModule_add(comparer, k, t) {\r\n if (t != null) {\r\n const t2 = t;\r\n const c = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0;\r\n if (t2 instanceof SetTreeNode$1) {\r\n if (c < 0) {\r\n return SetTreeModule_rebalance(SetTreeModule_add(comparer, k, SetTreeNode$1__get_Left(t2)), SetTreeLeaf$1__get_Key(t2), SetTreeNode$1__get_Right(t2));\r\n }\r\n else if (c === 0) {\r\n return t;\r\n }\r\n else {\r\n return SetTreeModule_rebalance(SetTreeNode$1__get_Left(t2), SetTreeLeaf$1__get_Key(t2), SetTreeModule_add(comparer, k, SetTreeNode$1__get_Right(t2)));\r\n }\r\n }\r\n else {\r\n const c_1 = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0;\r\n if (c_1 < 0) {\r\n return SetTreeNode$1_$ctor_Z6E7BE5F7(k, SetTreeModule_empty(), t, 2);\r\n }\r\n else if (c_1 === 0) {\r\n return t;\r\n }\r\n else {\r\n return SetTreeNode$1_$ctor_Z6E7BE5F7(k, t, SetTreeModule_empty(), 2);\r\n }\r\n }\r\n }\r\n else {\r\n return SetTreeLeaf$1_$ctor_2B595(k);\r\n }\r\n}\r\n\r\nexport function SetTreeModule_balance(comparer, t1, k, t2) {\r\n if (t1 != null) {\r\n const t1$0027 = t1;\r\n if (t2 != null) {\r\n const t2$0027 = t2;\r\n if (t1$0027 instanceof SetTreeNode$1) {\r\n if (t2$0027 instanceof SetTreeNode$1) {\r\n if ((SetTreeNode$1__get_Height(t1$0027) + 2) < SetTreeNode$1__get_Height(t2$0027)) {\r\n return SetTreeModule_rebalance(SetTreeModule_balance(comparer, t1, k, SetTreeNode$1__get_Left(t2$0027)), SetTreeLeaf$1__get_Key(t2$0027), SetTreeNode$1__get_Right(t2$0027));\r\n }\r\n else if ((SetTreeNode$1__get_Height(t2$0027) + 2) < SetTreeNode$1__get_Height(t1$0027)) {\r\n return SetTreeModule_rebalance(SetTreeNode$1__get_Left(t1$0027), SetTreeLeaf$1__get_Key(t1$0027), SetTreeModule_balance(comparer, SetTreeNode$1__get_Right(t1$0027), k, t2));\r\n }\r\n else {\r\n return SetTreeModule_mk(t1, k, t2);\r\n }\r\n }\r\n else {\r\n return SetTreeModule_add(comparer, k, SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2$0027), t1));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_add(comparer, k, SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t1$0027), t2));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_add(comparer, k, t1);\r\n }\r\n }\r\n else {\r\n return SetTreeModule_add(comparer, k, t2);\r\n }\r\n}\r\n\r\nexport function SetTreeModule_split(comparer, pivot, t) {\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n const c = comparer.Compare(pivot, SetTreeLeaf$1__get_Key(t2)) | 0;\r\n if (c < 0) {\r\n const patternInput = SetTreeModule_split(comparer, pivot, SetTreeNode$1__get_Left(t2));\r\n return [patternInput[0], patternInput[1], SetTreeModule_balance(comparer, patternInput[2], SetTreeLeaf$1__get_Key(t2), SetTreeNode$1__get_Right(t2))];\r\n }\r\n else if (c === 0) {\r\n return [SetTreeNode$1__get_Left(t2), true, SetTreeNode$1__get_Right(t2)];\r\n }\r\n else {\r\n const patternInput_1 = SetTreeModule_split(comparer, pivot, SetTreeNode$1__get_Right(t2));\r\n return [SetTreeModule_balance(comparer, SetTreeNode$1__get_Left(t2), SetTreeLeaf$1__get_Key(t2), patternInput_1[0]), patternInput_1[1], patternInput_1[2]];\r\n }\r\n }\r\n else {\r\n const c_1 = comparer.Compare(SetTreeLeaf$1__get_Key(t2), pivot) | 0;\r\n if (c_1 < 0) {\r\n return [t, false, SetTreeModule_empty()];\r\n }\r\n else if (c_1 === 0) {\r\n return [SetTreeModule_empty(), true, SetTreeModule_empty()];\r\n }\r\n else {\r\n return [SetTreeModule_empty(), false, t];\r\n }\r\n }\r\n }\r\n else {\r\n return [SetTreeModule_empty(), false, SetTreeModule_empty()];\r\n }\r\n}\r\n\r\nexport function SetTreeModule_spliceOutSuccessor(t) {\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n if (SetTreeNode$1__get_Left(t2) == null) {\r\n return [SetTreeLeaf$1__get_Key(t2), SetTreeNode$1__get_Right(t2)];\r\n }\r\n else {\r\n const patternInput = SetTreeModule_spliceOutSuccessor(SetTreeNode$1__get_Left(t2));\r\n return [patternInput[0], SetTreeModule_mk(patternInput[1], SetTreeLeaf$1__get_Key(t2), SetTreeNode$1__get_Right(t2))];\r\n }\r\n }\r\n else {\r\n return [SetTreeLeaf$1__get_Key(t2), SetTreeModule_empty()];\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Set.spliceOutSuccessor\"));\r\n }\r\n}\r\n\r\nexport function SetTreeModule_remove(comparer, k, t) {\r\n if (t != null) {\r\n const t2 = t;\r\n const c = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0;\r\n if (t2 instanceof SetTreeNode$1) {\r\n if (c < 0) {\r\n return SetTreeModule_rebalance(SetTreeModule_remove(comparer, k, SetTreeNode$1__get_Left(t2)), SetTreeLeaf$1__get_Key(t2), SetTreeNode$1__get_Right(t2));\r\n }\r\n else if (c === 0) {\r\n if (SetTreeNode$1__get_Left(t2) == null) {\r\n return SetTreeNode$1__get_Right(t2);\r\n }\r\n else if (SetTreeNode$1__get_Right(t2) == null) {\r\n return SetTreeNode$1__get_Left(t2);\r\n }\r\n else {\r\n const patternInput = SetTreeModule_spliceOutSuccessor(SetTreeNode$1__get_Right(t2));\r\n return SetTreeModule_mk(SetTreeNode$1__get_Left(t2), patternInput[0], patternInput[1]);\r\n }\r\n }\r\n else {\r\n return SetTreeModule_rebalance(SetTreeNode$1__get_Left(t2), SetTreeLeaf$1__get_Key(t2), SetTreeModule_remove(comparer, k, SetTreeNode$1__get_Right(t2)));\r\n }\r\n }\r\n else if (c === 0) {\r\n return SetTreeModule_empty();\r\n }\r\n else {\r\n return t;\r\n }\r\n }\r\n else {\r\n return t;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_mem(comparer_mut, k_mut, t_mut) {\r\n SetTreeModule_mem:\r\n while (true) {\r\n const comparer = comparer_mut, k = k_mut, t = t_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n const c = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0;\r\n if (t2 instanceof SetTreeNode$1) {\r\n if (c < 0) {\r\n comparer_mut = comparer;\r\n k_mut = k;\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n continue SetTreeModule_mem;\r\n }\r\n else if (c === 0) {\r\n return true;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n k_mut = k;\r\n t_mut = SetTreeNode$1__get_Right(t2);\r\n continue SetTreeModule_mem;\r\n }\r\n }\r\n else {\r\n return c === 0;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_iter(f_mut, t_mut) {\r\n SetTreeModule_iter:\r\n while (true) {\r\n const f = f_mut, t = t_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n SetTreeModule_iter(f, SetTreeNode$1__get_Left(t2));\r\n f(SetTreeLeaf$1__get_Key(t2));\r\n f_mut = f;\r\n t_mut = SetTreeNode$1__get_Right(t2);\r\n continue SetTreeModule_iter;\r\n }\r\n else {\r\n f(SetTreeLeaf$1__get_Key(t2));\r\n }\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_foldBackOpt(f_mut, t_mut, x_mut) {\r\n SetTreeModule_foldBackOpt:\r\n while (true) {\r\n const f = f_mut, t = t_mut, x = x_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n f_mut = f;\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n x_mut = f(SetTreeLeaf$1__get_Key(t2), SetTreeModule_foldBackOpt(f, SetTreeNode$1__get_Right(t2), x));\r\n continue SetTreeModule_foldBackOpt;\r\n }\r\n else {\r\n return f(SetTreeLeaf$1__get_Key(t2), x);\r\n }\r\n }\r\n else {\r\n return x;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_foldBack(f, m, x) {\r\n return SetTreeModule_foldBackOpt(f, m, x);\r\n}\r\n\r\nexport function SetTreeModule_foldOpt(f_mut, x_mut, t_mut) {\r\n SetTreeModule_foldOpt:\r\n while (true) {\r\n const f = f_mut, x = x_mut, t = t_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n f_mut = f;\r\n x_mut = f(SetTreeModule_foldOpt(f, x, SetTreeNode$1__get_Left(t2)), SetTreeLeaf$1__get_Key(t2));\r\n t_mut = SetTreeNode$1__get_Right(t2);\r\n continue SetTreeModule_foldOpt;\r\n }\r\n else {\r\n return f(x, SetTreeLeaf$1__get_Key(t2));\r\n }\r\n }\r\n else {\r\n return x;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_fold(f, x, m) {\r\n return SetTreeModule_foldOpt(f, x, m);\r\n}\r\n\r\nexport function SetTreeModule_forall(f_mut, t_mut) {\r\n SetTreeModule_forall:\r\n while (true) {\r\n const f = f_mut, t = t_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n if (f(SetTreeLeaf$1__get_Key(t2)) && SetTreeModule_forall(f, SetTreeNode$1__get_Left(t2))) {\r\n f_mut = f;\r\n t_mut = SetTreeNode$1__get_Right(t2);\r\n continue SetTreeModule_forall;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n return f(SetTreeLeaf$1__get_Key(t2));\r\n }\r\n }\r\n else {\r\n return true;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_exists(f_mut, t_mut) {\r\n SetTreeModule_exists:\r\n while (true) {\r\n const f = f_mut, t = t_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n if (f(SetTreeLeaf$1__get_Key(t2)) ? true : SetTreeModule_exists(f, SetTreeNode$1__get_Left(t2))) {\r\n return true;\r\n }\r\n else {\r\n f_mut = f;\r\n t_mut = SetTreeNode$1__get_Right(t2);\r\n continue SetTreeModule_exists;\r\n }\r\n }\r\n else {\r\n return f(SetTreeLeaf$1__get_Key(t2));\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_subset(comparer, a, b) {\r\n return SetTreeModule_forall((x) => SetTreeModule_mem(comparer, x, b), a);\r\n}\r\n\r\nexport function SetTreeModule_properSubset(comparer, a, b) {\r\n if (SetTreeModule_forall((x) => SetTreeModule_mem(comparer, x, b), a)) {\r\n return SetTreeModule_exists((x_1) => (!SetTreeModule_mem(comparer, x_1, a)), b);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_filterAux(comparer_mut, f_mut, t_mut, acc_mut) {\r\n SetTreeModule_filterAux:\r\n while (true) {\r\n const comparer = comparer_mut, f = f_mut, t = t_mut, acc = acc_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n const acc_1 = f(SetTreeLeaf$1__get_Key(t2)) ? SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2), acc) : acc;\r\n comparer_mut = comparer;\r\n f_mut = f;\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n acc_mut = SetTreeModule_filterAux(comparer, f, SetTreeNode$1__get_Right(t2), acc_1);\r\n continue SetTreeModule_filterAux;\r\n }\r\n else if (f(SetTreeLeaf$1__get_Key(t2))) {\r\n return SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2), acc);\r\n }\r\n else {\r\n return acc;\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_filter(comparer, f, s) {\r\n return SetTreeModule_filterAux(comparer, f, s, SetTreeModule_empty());\r\n}\r\n\r\nexport function SetTreeModule_diffAux(comparer_mut, t_mut, acc_mut) {\r\n SetTreeModule_diffAux:\r\n while (true) {\r\n const comparer = comparer_mut, t = t_mut, acc = acc_mut;\r\n if (acc == null) {\r\n return acc;\r\n }\r\n else if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n acc_mut = SetTreeModule_diffAux(comparer, SetTreeNode$1__get_Right(t2), SetTreeModule_remove(comparer, SetTreeLeaf$1__get_Key(t2), acc));\r\n continue SetTreeModule_diffAux;\r\n }\r\n else {\r\n return SetTreeModule_remove(comparer, SetTreeLeaf$1__get_Key(t2), acc);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_diff(comparer, a, b) {\r\n return SetTreeModule_diffAux(comparer, b, a);\r\n}\r\n\r\nexport function SetTreeModule_union(comparer, t1, t2) {\r\n if (t1 != null) {\r\n const t1$0027 = t1;\r\n if (t2 != null) {\r\n const t2$0027 = t2;\r\n if (t1$0027 instanceof SetTreeNode$1) {\r\n if (t2$0027 instanceof SetTreeNode$1) {\r\n if (SetTreeNode$1__get_Height(t1$0027) > SetTreeNode$1__get_Height(t2$0027)) {\r\n const patternInput = SetTreeModule_split(comparer, SetTreeLeaf$1__get_Key(t1$0027), t2);\r\n return SetTreeModule_balance(comparer, SetTreeModule_union(comparer, SetTreeNode$1__get_Left(t1$0027), patternInput[0]), SetTreeLeaf$1__get_Key(t1$0027), SetTreeModule_union(comparer, SetTreeNode$1__get_Right(t1$0027), patternInput[2]));\r\n }\r\n else {\r\n const patternInput_1 = SetTreeModule_split(comparer, SetTreeLeaf$1__get_Key(t2$0027), t1);\r\n return SetTreeModule_balance(comparer, SetTreeModule_union(comparer, SetTreeNode$1__get_Left(t2$0027), patternInput_1[0]), SetTreeLeaf$1__get_Key(t2$0027), SetTreeModule_union(comparer, SetTreeNode$1__get_Right(t2$0027), patternInput_1[2]));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2$0027), t1);\r\n }\r\n }\r\n else {\r\n return SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t1$0027), t2);\r\n }\r\n }\r\n else {\r\n return t1;\r\n }\r\n }\r\n else {\r\n return t2;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_intersectionAux(comparer_mut, b_mut, t_mut, acc_mut) {\r\n SetTreeModule_intersectionAux:\r\n while (true) {\r\n const comparer = comparer_mut, b = b_mut, t = t_mut, acc = acc_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n const acc_1 = SetTreeModule_intersectionAux(comparer, b, SetTreeNode$1__get_Right(t2), acc);\r\n const acc_2 = SetTreeModule_mem(comparer, SetTreeLeaf$1__get_Key(t2), b) ? SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2), acc_1) : acc_1;\r\n comparer_mut = comparer;\r\n b_mut = b;\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n acc_mut = acc_2;\r\n continue SetTreeModule_intersectionAux;\r\n }\r\n else if (SetTreeModule_mem(comparer, SetTreeLeaf$1__get_Key(t2), b)) {\r\n return SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2), acc);\r\n }\r\n else {\r\n return acc;\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_intersection(comparer, a, b) {\r\n return SetTreeModule_intersectionAux(comparer, b, a, SetTreeModule_empty());\r\n}\r\n\r\nexport function SetTreeModule_partition1(comparer, f, k, acc1, acc2) {\r\n if (f(k)) {\r\n return [SetTreeModule_add(comparer, k, acc1), acc2];\r\n }\r\n else {\r\n return [acc1, SetTreeModule_add(comparer, k, acc2)];\r\n }\r\n}\r\n\r\nexport function SetTreeModule_partitionAux(comparer_mut, f_mut, t_mut, acc__mut, acc__1_mut) {\r\n SetTreeModule_partitionAux:\r\n while (true) {\r\n const comparer = comparer_mut, f = f_mut, t = t_mut, acc_ = acc__mut, acc__1 = acc__1_mut;\r\n const acc = [acc_, acc__1];\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n const acc_1 = SetTreeModule_partitionAux(comparer, f, SetTreeNode$1__get_Right(t2), acc[0], acc[1]);\r\n const acc_4 = SetTreeModule_partition1(comparer, f, SetTreeLeaf$1__get_Key(t2), acc_1[0], acc_1[1]);\r\n comparer_mut = comparer;\r\n f_mut = f;\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n acc__mut = acc_4[0];\r\n acc__1_mut = acc_4[1];\r\n continue SetTreeModule_partitionAux;\r\n }\r\n else {\r\n return SetTreeModule_partition1(comparer, f, SetTreeLeaf$1__get_Key(t2), acc[0], acc[1]);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_partition(comparer, f, s) {\r\n return SetTreeModule_partitionAux(comparer, f, s, SetTreeModule_empty(), SetTreeModule_empty());\r\n}\r\n\r\nexport function SetTreeModule_minimumElementAux(t_mut, n_mut) {\r\n SetTreeModule_minimumElementAux:\r\n while (true) {\r\n const t = t_mut, n = n_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n n_mut = SetTreeLeaf$1__get_Key(t2);\r\n continue SetTreeModule_minimumElementAux;\r\n }\r\n else {\r\n return SetTreeLeaf$1__get_Key(t2);\r\n }\r\n }\r\n else {\r\n return n;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_minimumElementOpt(t) {\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n return some(SetTreeModule_minimumElementAux(SetTreeNode$1__get_Left(t2), SetTreeLeaf$1__get_Key(t2)));\r\n }\r\n else {\r\n return some(SetTreeLeaf$1__get_Key(t2));\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_maximumElementAux(t_mut, n_mut) {\r\n SetTreeModule_maximumElementAux:\r\n while (true) {\r\n const t = t_mut, n = n_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n t_mut = SetTreeNode$1__get_Right(t2);\r\n n_mut = SetTreeLeaf$1__get_Key(t2);\r\n continue SetTreeModule_maximumElementAux;\r\n }\r\n else {\r\n return SetTreeLeaf$1__get_Key(t2);\r\n }\r\n }\r\n else {\r\n return n;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_maximumElementOpt(t) {\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n return some(SetTreeModule_maximumElementAux(SetTreeNode$1__get_Right(t2), SetTreeLeaf$1__get_Key(t2)));\r\n }\r\n else {\r\n return some(SetTreeLeaf$1__get_Key(t2));\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_minimumElement(s) {\r\n const matchValue = SetTreeModule_minimumElementOpt(s);\r\n if (matchValue == null) {\r\n throw (new Error(\"Set contains no elements\"));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function SetTreeModule_maximumElement(s) {\r\n const matchValue = SetTreeModule_maximumElementOpt(s);\r\n if (matchValue == null) {\r\n throw (new Error(\"Set contains no elements\"));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport class SetTreeModule_SetIterator$1 extends Record {\r\n constructor(stack, started) {\r\n super();\r\n this.stack = stack;\r\n this.started = started;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_SetIterator$1$reflection(gen0) {\r\n return record_type(\"Set.SetTreeModule.SetIterator`1\", [gen0], SetTreeModule_SetIterator$1, () => [[\"stack\", list_type(option_type(SetTreeLeaf$1$reflection(gen0)))], [\"started\", bool_type]]);\r\n}\r\n\r\nexport function SetTreeModule_collapseLHS(stack_mut) {\r\n SetTreeModule_collapseLHS:\r\n while (true) {\r\n const stack = stack_mut;\r\n if (!isEmpty_1(stack)) {\r\n const x = head(stack);\r\n const rest = tail(stack);\r\n if (x != null) {\r\n const x2 = x;\r\n if (x2 instanceof SetTreeNode$1) {\r\n stack_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2)), SetTreeNode$1__get_Right(x2)], rest);\r\n continue SetTreeModule_collapseLHS;\r\n }\r\n else {\r\n return stack;\r\n }\r\n }\r\n else {\r\n stack_mut = rest;\r\n continue SetTreeModule_collapseLHS;\r\n }\r\n }\r\n else {\r\n return empty_1();\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_mkIterator(s) {\r\n return new SetTreeModule_SetIterator$1(SetTreeModule_collapseLHS(singleton_1(s)), false);\r\n}\r\n\r\nexport function SetTreeModule_notStarted() {\r\n throw (new Error(\"Enumeration not started\"));\r\n}\r\n\r\nexport function SetTreeModule_alreadyFinished() {\r\n throw (new Error(\"Enumeration already started\"));\r\n}\r\n\r\nexport function SetTreeModule_current(i) {\r\n if (i.started) {\r\n const matchValue = i.stack;\r\n if (isEmpty_1(matchValue)) {\r\n return SetTreeModule_alreadyFinished();\r\n }\r\n else if (head(matchValue) != null) {\r\n const t = head(matchValue);\r\n return SetTreeLeaf$1__get_Key(t);\r\n }\r\n else {\r\n throw (new Error(\"Please report error: Set iterator, unexpected stack for current\"));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_notStarted();\r\n }\r\n}\r\n\r\nexport function SetTreeModule_moveNext(i) {\r\n if (i.started) {\r\n const matchValue = i.stack;\r\n if (!isEmpty_1(matchValue)) {\r\n if (head(matchValue) != null) {\r\n const t = head(matchValue);\r\n if (t instanceof SetTreeNode$1) {\r\n throw (new Error(\"Please report error: Set iterator, unexpected stack for moveNext\"));\r\n }\r\n else {\r\n i.stack = SetTreeModule_collapseLHS(tail(matchValue));\r\n return !isEmpty_1(i.stack);\r\n }\r\n }\r\n else {\r\n throw (new Error(\"Please report error: Set iterator, unexpected stack for moveNext\"));\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n i.started = true;\r\n return !isEmpty_1(i.stack);\r\n }\r\n}\r\n\r\nexport function SetTreeModule_mkIEnumerator(s) {\r\n let i = SetTreeModule_mkIterator(s);\r\n return {\r\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\r\n return SetTreeModule_current(i);\r\n },\r\n [\"System.Collections.IEnumerator.get_Current\"]() {\r\n return SetTreeModule_current(i);\r\n },\r\n [\"System.Collections.IEnumerator.MoveNext\"]() {\r\n return SetTreeModule_moveNext(i);\r\n },\r\n [\"System.Collections.IEnumerator.Reset\"]() {\r\n i = SetTreeModule_mkIterator(s);\r\n },\r\n Dispose() {\r\n },\r\n };\r\n}\r\n\r\nexport function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) {\r\n SetTreeModule_compareStacks:\r\n while (true) {\r\n const comparer = comparer_mut, l1 = l1_mut, l2 = l2_mut;\r\n const matchValue = [l1, l2];\r\n if (!isEmpty_1(matchValue[0])) {\r\n if (!isEmpty_1(matchValue[1])) {\r\n if (head(matchValue[1]) != null) {\r\n if (head(matchValue[0]) != null) {\r\n const x1_3 = head(matchValue[0]);\r\n const x2_3 = head(matchValue[1]);\r\n if (x1_3 instanceof SetTreeNode$1) {\r\n if (SetTreeNode$1__get_Left(x1_3) == null) {\r\n if (x2_3 instanceof SetTreeNode$1) {\r\n if (SetTreeNode$1__get_Left(x2_3) == null) {\r\n const c = comparer.Compare(SetTreeLeaf$1__get_Key(x1_3), SetTreeLeaf$1__get_Key(x2_3)) | 0;\r\n if (c !== 0) {\r\n return c | 0;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = cons(SetTreeNode$1__get_Right(x1_3), tail(matchValue[0]));\r\n l2_mut = cons(SetTreeNode$1__get_Right(x2_3), tail(matchValue[1]));\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n else {\r\n const matchValue_3 = [l1, l2];\r\n let pattern_matching_result, t1_6, x1_4, t2_6, x2_4;\r\n if (!isEmpty_1(matchValue_3[0])) {\r\n if (head(matchValue_3[0]) != null) {\r\n pattern_matching_result = 0;\r\n t1_6 = tail(matchValue_3[0]);\r\n x1_4 = head(matchValue_3[0]);\r\n }\r\n else if (!isEmpty_1(matchValue_3[1])) {\r\n if (head(matchValue_3[1]) != null) {\r\n pattern_matching_result = 1;\r\n t2_6 = tail(matchValue_3[1]);\r\n x2_4 = head(matchValue_3[1]);\r\n }\r\n else {\r\n pattern_matching_result = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 2;\r\n }\r\n }\r\n else if (!isEmpty_1(matchValue_3[1])) {\r\n if (head(matchValue_3[1]) != null) {\r\n pattern_matching_result = 1;\r\n t2_6 = tail(matchValue_3[1]);\r\n x2_4 = head(matchValue_3[1]);\r\n }\r\n else {\r\n pattern_matching_result = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 2;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n if (x1_4 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1_4), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x1_4), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1_4), 0)], t1_6);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1_4))], t1_6);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 1: {\r\n if (x2_4 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2_4), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x2_4), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2_4), 0)], t2_6);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_4))], t2_6);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 2: {\r\n throw (new Error(\"unexpected state in SetTree.compareStacks\"));\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n const c_1 = comparer.Compare(SetTreeLeaf$1__get_Key(x1_3), SetTreeLeaf$1__get_Key(x2_3)) | 0;\r\n if (c_1 !== 0) {\r\n return c_1 | 0;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = cons(SetTreeNode$1__get_Right(x1_3), tail(matchValue[0]));\r\n l2_mut = cons(SetTreeModule_empty(), tail(matchValue[1]));\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n }\r\n else {\r\n const matchValue_4 = [l1, l2];\r\n let pattern_matching_result_1, t1_7, x1_5, t2_7, x2_5;\r\n if (!isEmpty_1(matchValue_4[0])) {\r\n if (head(matchValue_4[0]) != null) {\r\n pattern_matching_result_1 = 0;\r\n t1_7 = tail(matchValue_4[0]);\r\n x1_5 = head(matchValue_4[0]);\r\n }\r\n else if (!isEmpty_1(matchValue_4[1])) {\r\n if (head(matchValue_4[1]) != null) {\r\n pattern_matching_result_1 = 1;\r\n t2_7 = tail(matchValue_4[1]);\r\n x2_5 = head(matchValue_4[1]);\r\n }\r\n else {\r\n pattern_matching_result_1 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_1 = 2;\r\n }\r\n }\r\n else if (!isEmpty_1(matchValue_4[1])) {\r\n if (head(matchValue_4[1]) != null) {\r\n pattern_matching_result_1 = 1;\r\n t2_7 = tail(matchValue_4[1]);\r\n x2_5 = head(matchValue_4[1]);\r\n }\r\n else {\r\n pattern_matching_result_1 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_1 = 2;\r\n }\r\n switch (pattern_matching_result_1) {\r\n case 0: {\r\n if (x1_5 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1_5), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x1_5), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1_5), 0)], t1_7);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1_5))], t1_7);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 1: {\r\n if (x2_5 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2_5), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x2_5), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2_5), 0)], t2_7);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_5))], t2_7);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 2: {\r\n throw (new Error(\"unexpected state in SetTree.compareStacks\"));\r\n }\r\n }\r\n }\r\n }\r\n else if (x2_3 instanceof SetTreeNode$1) {\r\n if (SetTreeNode$1__get_Left(x2_3) == null) {\r\n const c_2 = comparer.Compare(SetTreeLeaf$1__get_Key(x1_3), SetTreeLeaf$1__get_Key(x2_3)) | 0;\r\n if (c_2 !== 0) {\r\n return c_2 | 0;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = cons(SetTreeModule_empty(), tail(matchValue[0]));\r\n l2_mut = cons(SetTreeNode$1__get_Right(x2_3), tail(matchValue[1]));\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n else {\r\n const matchValue_5 = [l1, l2];\r\n let pattern_matching_result_2, t1_8, x1_6, t2_8, x2_6;\r\n if (!isEmpty_1(matchValue_5[0])) {\r\n if (head(matchValue_5[0]) != null) {\r\n pattern_matching_result_2 = 0;\r\n t1_8 = tail(matchValue_5[0]);\r\n x1_6 = head(matchValue_5[0]);\r\n }\r\n else if (!isEmpty_1(matchValue_5[1])) {\r\n if (head(matchValue_5[1]) != null) {\r\n pattern_matching_result_2 = 1;\r\n t2_8 = tail(matchValue_5[1]);\r\n x2_6 = head(matchValue_5[1]);\r\n }\r\n else {\r\n pattern_matching_result_2 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_2 = 2;\r\n }\r\n }\r\n else if (!isEmpty_1(matchValue_5[1])) {\r\n if (head(matchValue_5[1]) != null) {\r\n pattern_matching_result_2 = 1;\r\n t2_8 = tail(matchValue_5[1]);\r\n x2_6 = head(matchValue_5[1]);\r\n }\r\n else {\r\n pattern_matching_result_2 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_2 = 2;\r\n }\r\n switch (pattern_matching_result_2) {\r\n case 0: {\r\n if (x1_6 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1_6), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x1_6), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1_6), 0)], t1_8);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1_6))], t1_8);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 1: {\r\n if (x2_6 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2_6), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x2_6), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2_6), 0)], t2_8);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_6))], t2_8);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 2: {\r\n throw (new Error(\"unexpected state in SetTree.compareStacks\"));\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n const c_3 = comparer.Compare(SetTreeLeaf$1__get_Key(x1_3), SetTreeLeaf$1__get_Key(x2_3)) | 0;\r\n if (c_3 !== 0) {\r\n return c_3 | 0;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = tail(matchValue[0]);\r\n l2_mut = tail(matchValue[1]);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n }\r\n else {\r\n const x2 = head(matchValue[1]);\r\n const matchValue_1 = [l1, l2];\r\n let pattern_matching_result_3, t1_2, x1, t2_2, x2_1;\r\n if (!isEmpty_1(matchValue_1[0])) {\r\n if (head(matchValue_1[0]) != null) {\r\n pattern_matching_result_3 = 0;\r\n t1_2 = tail(matchValue_1[0]);\r\n x1 = head(matchValue_1[0]);\r\n }\r\n else if (!isEmpty_1(matchValue_1[1])) {\r\n if (head(matchValue_1[1]) != null) {\r\n pattern_matching_result_3 = 1;\r\n t2_2 = tail(matchValue_1[1]);\r\n x2_1 = head(matchValue_1[1]);\r\n }\r\n else {\r\n pattern_matching_result_3 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_3 = 2;\r\n }\r\n }\r\n else if (!isEmpty_1(matchValue_1[1])) {\r\n if (head(matchValue_1[1]) != null) {\r\n pattern_matching_result_3 = 1;\r\n t2_2 = tail(matchValue_1[1]);\r\n x2_1 = head(matchValue_1[1]);\r\n }\r\n else {\r\n pattern_matching_result_3 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_3 = 2;\r\n }\r\n switch (pattern_matching_result_3) {\r\n case 0: {\r\n if (x1 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x1), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1), 0)], t1_2);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1))], t1_2);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 1: {\r\n if (x2_1 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2_1), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x2_1), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2_1), 0)], t2_2);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_1))], t2_2);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 2: {\r\n throw (new Error(\"unexpected state in SetTree.compareStacks\"));\r\n }\r\n }\r\n }\r\n }\r\n else if (head(matchValue[0]) != null) {\r\n const x1_1 = head(matchValue[0]);\r\n const matchValue_2 = [l1, l2];\r\n let pattern_matching_result_4, t1_4, x1_2, t2_4, x2_2;\r\n if (!isEmpty_1(matchValue_2[0])) {\r\n if (head(matchValue_2[0]) != null) {\r\n pattern_matching_result_4 = 0;\r\n t1_4 = tail(matchValue_2[0]);\r\n x1_2 = head(matchValue_2[0]);\r\n }\r\n else if (!isEmpty_1(matchValue_2[1])) {\r\n if (head(matchValue_2[1]) != null) {\r\n pattern_matching_result_4 = 1;\r\n t2_4 = tail(matchValue_2[1]);\r\n x2_2 = head(matchValue_2[1]);\r\n }\r\n else {\r\n pattern_matching_result_4 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_4 = 2;\r\n }\r\n }\r\n else if (!isEmpty_1(matchValue_2[1])) {\r\n if (head(matchValue_2[1]) != null) {\r\n pattern_matching_result_4 = 1;\r\n t2_4 = tail(matchValue_2[1]);\r\n x2_2 = head(matchValue_2[1]);\r\n }\r\n else {\r\n pattern_matching_result_4 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_4 = 2;\r\n }\r\n switch (pattern_matching_result_4) {\r\n case 0: {\r\n if (x1_2 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1_2), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x1_2), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1_2), 0)], t1_4);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1_2))], t1_4);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 1: {\r\n if (x2_2 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2_2), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x2_2), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2_2), 0)], t2_4);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_2))], t2_4);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 2: {\r\n throw (new Error(\"unexpected state in SetTree.compareStacks\"));\r\n }\r\n }\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = tail(matchValue[0]);\r\n l2_mut = tail(matchValue[1]);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n else if (isEmpty_1(matchValue[1])) {\r\n return 0;\r\n }\r\n else {\r\n return -1;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_compare(comparer, t1, t2) {\r\n if (t1 == null) {\r\n if (t2 == null) {\r\n return 0;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else if (t2 == null) {\r\n return 1;\r\n }\r\n else {\r\n return SetTreeModule_compareStacks(comparer, singleton_1(t1), singleton_1(t2)) | 0;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_choose(s) {\r\n return SetTreeModule_minimumElement(s);\r\n}\r\n\r\nexport function SetTreeModule_toList(t) {\r\n const loop = (t$0027_mut, acc_mut) => {\r\n loop:\r\n while (true) {\r\n const t$0027 = t$0027_mut, acc = acc_mut;\r\n if (t$0027 != null) {\r\n const t2 = t$0027;\r\n if (t2 instanceof SetTreeNode$1) {\r\n t$0027_mut = SetTreeNode$1__get_Left(t2);\r\n acc_mut = cons(SetTreeLeaf$1__get_Key(t2), loop(SetTreeNode$1__get_Right(t2), acc));\r\n continue loop;\r\n }\r\n else {\r\n return cons(SetTreeLeaf$1__get_Key(t2), acc);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(t, empty_1());\r\n}\r\n\r\nexport function SetTreeModule_copyToArray(s, arr, i) {\r\n let j = i;\r\n SetTreeModule_iter((x) => {\r\n arr[j] = x;\r\n j = ((j + 1) | 0);\r\n }, s);\r\n}\r\n\r\nexport function SetTreeModule_toArray(s) {\r\n const n = SetTreeModule_count(s) | 0;\r\n const res = fill(new Array(n), 0, n, null);\r\n SetTreeModule_copyToArray(s, res, 0);\r\n return res;\r\n}\r\n\r\nexport function SetTreeModule_mkFromEnumerator(comparer_mut, acc_mut, e_mut) {\r\n SetTreeModule_mkFromEnumerator:\r\n while (true) {\r\n const comparer = comparer_mut, acc = acc_mut, e = e_mut;\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n comparer_mut = comparer;\r\n acc_mut = SetTreeModule_add(comparer, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), acc);\r\n e_mut = e;\r\n continue SetTreeModule_mkFromEnumerator;\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_ofArray(comparer, l) {\r\n return fold_1((acc, k) => SetTreeModule_add(comparer, k, acc), SetTreeModule_empty(), l);\r\n}\r\n\r\nexport function SetTreeModule_ofList(comparer, l) {\r\n return fold_2((acc, k) => SetTreeModule_add(comparer, k, acc), SetTreeModule_empty(), l);\r\n}\r\n\r\nexport function SetTreeModule_ofSeq(comparer, c) {\r\n if (isArrayLike(c)) {\r\n return SetTreeModule_ofArray(comparer, c);\r\n }\r\n else if (c instanceof FSharpList) {\r\n return SetTreeModule_ofList(comparer, c);\r\n }\r\n else {\r\n const ie = getEnumerator(c);\r\n try {\r\n return SetTreeModule_mkFromEnumerator(comparer, SetTreeModule_empty(), ie);\r\n }\r\n finally {\r\n disposeSafe(ie);\r\n }\r\n }\r\n}\r\n\r\nexport class FSharpSet {\r\n constructor(comparer, tree) {\r\n this.comparer = comparer;\r\n this.tree = tree;\r\n }\r\n GetHashCode() {\r\n const this$ = this;\r\n return FSharpSet__ComputeHashCode(this$) | 0;\r\n }\r\n Equals(that) {\r\n const this$ = this;\r\n return (that instanceof FSharpSet) && (SetTreeModule_compare(FSharpSet__get_Comparer(this$), FSharpSet__get_Tree(this$), FSharpSet__get_Tree(that)) === 0);\r\n }\r\n toString() {\r\n const this$ = this;\r\n return (\"set [\" + join(\"; \", map_1((x) => {\r\n let copyOfStruct = x;\r\n return toString(copyOfStruct);\r\n }, this$))) + \"]\";\r\n }\r\n get [Symbol.toStringTag]() {\r\n return \"FSharpSet\";\r\n }\r\n toJSON(_key) {\r\n const this$ = this;\r\n return Array.from(this$);\r\n }\r\n CompareTo(that) {\r\n const s = this;\r\n return SetTreeModule_compare(FSharpSet__get_Comparer(s), FSharpSet__get_Tree(s), FSharpSet__get_Tree(that)) | 0;\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Add2B595\"](x) {\r\n throw (new Error(\"ReadOnlyCollection\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Clear\"]() {\r\n throw (new Error(\"ReadOnlyCollection\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Remove2B595\"](x) {\r\n throw (new Error(\"ReadOnlyCollection\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Contains2B595\"](x) {\r\n const s = this;\r\n return SetTreeModule_mem(FSharpSet__get_Comparer(s), x, FSharpSet__get_Tree(s));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.CopyToZ2E171D71\"](arr, i) {\r\n const s = this;\r\n SetTreeModule_copyToArray(FSharpSet__get_Tree(s), arr, i);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_IsReadOnly\"]() {\r\n return true;\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_Count\"]() {\r\n const s = this;\r\n return FSharpSet__get_Count(s) | 0;\r\n }\r\n [\"System.Collections.Generic.IReadOnlyCollection`1.get_Count\"]() {\r\n const s = this;\r\n return FSharpSet__get_Count(s) | 0;\r\n }\r\n GetEnumerator() {\r\n const s = this;\r\n return SetTreeModule_mkIEnumerator(FSharpSet__get_Tree(s));\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const s = this;\r\n return SetTreeModule_mkIEnumerator(FSharpSet__get_Tree(s));\r\n }\r\n get size() {\r\n const s = this;\r\n return FSharpSet__get_Count(s) | 0;\r\n }\r\n add(k) {\r\n const s = this;\r\n throw (new Error(\"Set cannot be mutated\"));\r\n return s;\r\n }\r\n clear() {\r\n throw (new Error(\"Set cannot be mutated\"));\r\n }\r\n delete(k) {\r\n throw (new Error(\"Set cannot be mutated\"));\r\n return false;\r\n }\r\n has(k) {\r\n const s = this;\r\n return FSharpSet__Contains(s, k);\r\n }\r\n keys() {\r\n const s = this;\r\n return map_1((x) => x, s);\r\n }\r\n values() {\r\n const s = this;\r\n return map_1((x) => x, s);\r\n }\r\n entries() {\r\n const s = this;\r\n return map_1((v) => [v, v], s);\r\n }\r\n forEach(f, thisArg) {\r\n const s = this;\r\n iterate_1((x) => {\r\n f(x, x, s);\r\n }, s);\r\n }\r\n}\r\n\r\nexport function FSharpSet$reflection(gen0) {\r\n return class_type(\"Set.FSharpSet\", [gen0], FSharpSet);\r\n}\r\n\r\nexport function FSharpSet_$ctor(comparer, tree) {\r\n return new FSharpSet(comparer, tree);\r\n}\r\n\r\nexport function FSharpSet__get_Comparer(set$) {\r\n return set$.comparer;\r\n}\r\n\r\nexport function FSharpSet__get_Tree(set$) {\r\n return set$.tree;\r\n}\r\n\r\nexport function FSharpSet_Empty(comparer) {\r\n return FSharpSet_$ctor(comparer, SetTreeModule_empty());\r\n}\r\n\r\nexport function FSharpSet__Add(s, value) {\r\n return FSharpSet_$ctor(FSharpSet__get_Comparer(s), SetTreeModule_add(FSharpSet__get_Comparer(s), value, FSharpSet__get_Tree(s)));\r\n}\r\n\r\nexport function FSharpSet__Remove(s, value) {\r\n return FSharpSet_$ctor(FSharpSet__get_Comparer(s), SetTreeModule_remove(FSharpSet__get_Comparer(s), value, FSharpSet__get_Tree(s)));\r\n}\r\n\r\nexport function FSharpSet__get_Count(s) {\r\n return SetTreeModule_count(FSharpSet__get_Tree(s));\r\n}\r\n\r\nexport function FSharpSet__Contains(s, value) {\r\n return SetTreeModule_mem(FSharpSet__get_Comparer(s), value, FSharpSet__get_Tree(s));\r\n}\r\n\r\nexport function FSharpSet__Iterate(s, x) {\r\n SetTreeModule_iter(x, FSharpSet__get_Tree(s));\r\n}\r\n\r\nexport function FSharpSet__Fold(s, f, z) {\r\n const f_1 = f;\r\n return SetTreeModule_fold((x, z_1) => f_1(z_1, x), z, FSharpSet__get_Tree(s));\r\n}\r\n\r\nexport function FSharpSet__get_IsEmpty(s) {\r\n return FSharpSet__get_Tree(s) == null;\r\n}\r\n\r\nexport function FSharpSet__Partition(s, f) {\r\n if (FSharpSet__get_Tree(s) == null) {\r\n return [s, s];\r\n }\r\n else {\r\n const patternInput = SetTreeModule_partition(FSharpSet__get_Comparer(s), f, FSharpSet__get_Tree(s));\r\n return [FSharpSet_$ctor(FSharpSet__get_Comparer(s), patternInput[0]), FSharpSet_$ctor(FSharpSet__get_Comparer(s), patternInput[1])];\r\n }\r\n}\r\n\r\nexport function FSharpSet__Filter(s, f) {\r\n if (FSharpSet__get_Tree(s) == null) {\r\n return s;\r\n }\r\n else {\r\n return FSharpSet_$ctor(FSharpSet__get_Comparer(s), SetTreeModule_filter(FSharpSet__get_Comparer(s), f, FSharpSet__get_Tree(s)));\r\n }\r\n}\r\n\r\nexport function FSharpSet__Map(s, f, comparer) {\r\n return FSharpSet_$ctor(comparer, SetTreeModule_fold((acc, k) => SetTreeModule_add(comparer, f(k), acc), SetTreeModule_empty(), FSharpSet__get_Tree(s)));\r\n}\r\n\r\nexport function FSharpSet__Exists(s, f) {\r\n return SetTreeModule_exists(f, FSharpSet__get_Tree(s));\r\n}\r\n\r\nexport function FSharpSet__ForAll(s, f) {\r\n return SetTreeModule_forall(f, FSharpSet__get_Tree(s));\r\n}\r\n\r\nexport function FSharpSet_op_Subtraction(set1, set2) {\r\n if (FSharpSet__get_Tree(set1) == null) {\r\n return set1;\r\n }\r\n else if (FSharpSet__get_Tree(set2) == null) {\r\n return set1;\r\n }\r\n else {\r\n return FSharpSet_$ctor(FSharpSet__get_Comparer(set1), SetTreeModule_diff(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set1), FSharpSet__get_Tree(set2)));\r\n }\r\n}\r\n\r\nexport function FSharpSet_op_Addition(set1, set2) {\r\n if (FSharpSet__get_Tree(set2) == null) {\r\n return set1;\r\n }\r\n else if (FSharpSet__get_Tree(set1) == null) {\r\n return set2;\r\n }\r\n else {\r\n return FSharpSet_$ctor(FSharpSet__get_Comparer(set1), SetTreeModule_union(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set1), FSharpSet__get_Tree(set2)));\r\n }\r\n}\r\n\r\nexport function FSharpSet_Intersection(a, b) {\r\n if (FSharpSet__get_Tree(b) == null) {\r\n return b;\r\n }\r\n else if (FSharpSet__get_Tree(a) == null) {\r\n return a;\r\n }\r\n else {\r\n return FSharpSet_$ctor(FSharpSet__get_Comparer(a), SetTreeModule_intersection(FSharpSet__get_Comparer(a), FSharpSet__get_Tree(a), FSharpSet__get_Tree(b)));\r\n }\r\n}\r\n\r\nexport function FSharpSet_IntersectionMany(sets) {\r\n return reduce(FSharpSet_Intersection, sets);\r\n}\r\n\r\nexport function FSharpSet_Equality(a, b) {\r\n return SetTreeModule_compare(FSharpSet__get_Comparer(a), FSharpSet__get_Tree(a), FSharpSet__get_Tree(b)) === 0;\r\n}\r\n\r\nexport function FSharpSet_Compare(a, b) {\r\n return SetTreeModule_compare(FSharpSet__get_Comparer(a), FSharpSet__get_Tree(a), FSharpSet__get_Tree(b));\r\n}\r\n\r\nexport function FSharpSet__get_Choose(x) {\r\n return SetTreeModule_choose(FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__get_MinimumElement(x) {\r\n return SetTreeModule_minimumElement(FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__get_MaximumElement(x) {\r\n return SetTreeModule_maximumElement(FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__IsSubsetOf(x, otherSet) {\r\n return SetTreeModule_subset(FSharpSet__get_Comparer(x), FSharpSet__get_Tree(x), FSharpSet__get_Tree(otherSet));\r\n}\r\n\r\nexport function FSharpSet__IsSupersetOf(x, otherSet) {\r\n return SetTreeModule_subset(FSharpSet__get_Comparer(x), FSharpSet__get_Tree(otherSet), FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__IsProperSubsetOf(x, otherSet) {\r\n return SetTreeModule_properSubset(FSharpSet__get_Comparer(x), FSharpSet__get_Tree(x), FSharpSet__get_Tree(otherSet));\r\n}\r\n\r\nexport function FSharpSet__IsProperSupersetOf(x, otherSet) {\r\n return SetTreeModule_properSubset(FSharpSet__get_Comparer(x), FSharpSet__get_Tree(otherSet), FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__ToList(x) {\r\n return SetTreeModule_toList(FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__ToArray(x) {\r\n return SetTreeModule_toArray(FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__ComputeHashCode(this$) {\r\n let y;\r\n let res = 0;\r\n const enumerator = getEnumerator(this$);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const x_1 = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n res = (((y = (structuralHash(x_1) | 0), ((res << 1) + y) + 631)) | 0);\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n return Math.abs(res) | 0;\r\n}\r\n\r\nexport function isEmpty(set$) {\r\n return FSharpSet__get_IsEmpty(set$);\r\n}\r\n\r\nexport function contains(element, set$) {\r\n return FSharpSet__Contains(set$, element);\r\n}\r\n\r\nexport function add(value, set$) {\r\n return FSharpSet__Add(set$, value);\r\n}\r\n\r\nexport function singleton(value, comparer) {\r\n return FSharpSet__Add(FSharpSet_Empty(comparer), value);\r\n}\r\n\r\nexport function remove(value, set$) {\r\n return FSharpSet__Remove(set$, value);\r\n}\r\n\r\nexport function union(set1, set2) {\r\n return FSharpSet_op_Addition(set1, set2);\r\n}\r\n\r\nexport function unionMany(sets, comparer) {\r\n return fold_3(FSharpSet_op_Addition, FSharpSet_Empty(comparer), sets);\r\n}\r\n\r\nexport function intersect(set1, set2) {\r\n return FSharpSet_Intersection(set1, set2);\r\n}\r\n\r\nexport function intersectMany(sets) {\r\n return FSharpSet_IntersectionMany(sets);\r\n}\r\n\r\nexport function iterate(action, set$) {\r\n FSharpSet__Iterate(set$, action);\r\n}\r\n\r\nexport function empty(comparer) {\r\n return FSharpSet_Empty(comparer);\r\n}\r\n\r\nexport function forAll(predicate, set$) {\r\n return FSharpSet__ForAll(set$, predicate);\r\n}\r\n\r\nexport function exists(predicate, set$) {\r\n return FSharpSet__Exists(set$, predicate);\r\n}\r\n\r\nexport function filter(predicate, set$) {\r\n return FSharpSet__Filter(set$, predicate);\r\n}\r\n\r\nexport function partition(predicate, set$) {\r\n return FSharpSet__Partition(set$, predicate);\r\n}\r\n\r\nexport function fold(folder, state, set$) {\r\n return SetTreeModule_fold(folder, state, FSharpSet__get_Tree(set$));\r\n}\r\n\r\nexport function foldBack(folder, set$, state) {\r\n return SetTreeModule_foldBack(folder, FSharpSet__get_Tree(set$), state);\r\n}\r\n\r\nexport function map(mapping, set$, comparer) {\r\n return FSharpSet__Map(set$, mapping, comparer);\r\n}\r\n\r\nexport function count(set$) {\r\n return FSharpSet__get_Count(set$);\r\n}\r\n\r\nexport function ofList(elements, comparer) {\r\n return FSharpSet_$ctor(comparer, SetTreeModule_ofSeq(comparer, elements));\r\n}\r\n\r\nexport function ofArray(array, comparer) {\r\n return FSharpSet_$ctor(comparer, SetTreeModule_ofArray(comparer, array));\r\n}\r\n\r\nexport function toList(set$) {\r\n return FSharpSet__ToList(set$);\r\n}\r\n\r\nexport function toArray(set$) {\r\n return FSharpSet__ToArray(set$);\r\n}\r\n\r\nexport function toSeq(set$) {\r\n return map_1((x) => x, set$);\r\n}\r\n\r\nexport function ofSeq(elements, comparer) {\r\n return FSharpSet_$ctor(comparer, SetTreeModule_ofSeq(comparer, elements));\r\n}\r\n\r\nexport function difference(set1, set2) {\r\n return FSharpSet_op_Subtraction(set1, set2);\r\n}\r\n\r\nexport function isSubset(set1, set2) {\r\n return SetTreeModule_subset(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set1), FSharpSet__get_Tree(set2));\r\n}\r\n\r\nexport function isSuperset(set1, set2) {\r\n return SetTreeModule_subset(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set2), FSharpSet__get_Tree(set1));\r\n}\r\n\r\nexport function isProperSubset(set1, set2) {\r\n return SetTreeModule_properSubset(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set1), FSharpSet__get_Tree(set2));\r\n}\r\n\r\nexport function isProperSuperset(set1, set2) {\r\n return SetTreeModule_properSubset(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set2), FSharpSet__get_Tree(set1));\r\n}\r\n\r\nexport function minElement(set$) {\r\n return FSharpSet__get_MinimumElement(set$);\r\n}\r\n\r\nexport function maxElement(set$) {\r\n return FSharpSet__get_MaximumElement(set$);\r\n}\r\n\r\nexport function unionWith(s1, s2) {\r\n return fold_3((acc, x) => acc.add(x), s1, s2);\r\n}\r\n\r\nexport function newMutableSetWith(s1, s2) {\r\n if (s1 instanceof HashSet) {\r\n return HashSet_$ctor_Z6150332D(s2, HashSet__get_Comparer(s1));\r\n }\r\n else {\r\n return new Set(s2);\r\n }\r\n}\r\n\r\nexport function intersectWith(s1, s2) {\r\n const s2_1 = newMutableSetWith(s1, s2);\r\n iterate_1((x) => {\r\n if (!s2_1.has(x)) {\r\n s1.delete(x);\r\n }\r\n }, s1.values());\r\n}\r\n\r\nexport function exceptWith(s1, s2) {\r\n iterate_1((x) => {\r\n s1.delete(x);\r\n }, s2);\r\n}\r\n\r\nexport function isSubsetOf(s1, s2) {\r\n const s2_1 = newMutableSetWith(s1, s2);\r\n return forAll_1((arg) => s2_1.has(arg), s1.values());\r\n}\r\n\r\nexport function isSupersetOf(s1, s2) {\r\n return forAll_1((arg) => s1.has(arg), s2);\r\n}\r\n\r\nexport function isProperSubsetOf(s1, s2) {\r\n const s2_1 = newMutableSetWith(s1, s2);\r\n if (s2_1.size > s1.size) {\r\n return forAll_1((arg) => s2_1.has(arg), s1.values());\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function isProperSupersetOf(s1, s2) {\r\n const s2_1 = cache(s2);\r\n if (exists_1((arg_1) => (!s1.has(arg_1)), s2_1)) {\r\n return forAll_1((arg_2) => s1.has(arg_2), s2_1);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\n","import { disposeSafe, equals, toIterator, getEnumerator } from \"./Util.js\";\r\nimport { iterate, map, delay, toArray, iterateIndexed, concat } from \"./Seq.js\";\r\nimport { FSharpRef } from \"./Types.js\";\r\nimport { class_type } from \"./Reflection.js\";\r\nimport { getItemFromDict, tryGetValue } from \"./MapUtil.js\";\r\nimport { format } from \"./String.js\";\r\n\r\nexport class Dictionary {\r\n constructor(pairs, comparer) {\r\n const this$ = new FSharpRef(null);\r\n this.comparer = comparer;\r\n this$.contents = this;\r\n this.hashMap = (new Map([]));\r\n this[\"init@8-1\"] = 1;\r\n const enumerator = getEnumerator(pairs);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const pair = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n Dictionary__Add_5BDDA1(this$.contents, pair[0], pair[1]);\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n }\r\n get [Symbol.toStringTag]() {\r\n return \"Dictionary\";\r\n }\r\n toJSON(_key) {\r\n const this$ = this;\r\n return Array.from(this$);\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const this$ = this;\r\n return getEnumerator(this$);\r\n }\r\n GetEnumerator() {\r\n const this$ = this;\r\n return getEnumerator(concat(this$.hashMap.values()));\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Add2B595\"](item) {\r\n const this$ = this;\r\n Dictionary__Add_5BDDA1(this$, item[0], item[1]);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Clear\"]() {\r\n const this$ = this;\r\n Dictionary__Clear(this$);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Contains2B595\"](item) {\r\n const this$ = this;\r\n const matchValue = Dictionary__TryFind_2B595(this$, item[0]);\r\n let pattern_matching_result;\r\n if (matchValue != null) {\r\n if (equals(matchValue[1], item[1])) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return true;\r\n }\r\n case 1: {\r\n return false;\r\n }\r\n }\r\n }\r\n [\"System.Collections.Generic.ICollection`1.CopyToZ2E171D71\"](array, arrayIndex) {\r\n const this$ = this;\r\n iterateIndexed((i, e) => {\r\n array[arrayIndex + i] = e;\r\n }, this$);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_Count\"]() {\r\n const this$ = this;\r\n return Dictionary__get_Count(this$) | 0;\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_IsReadOnly\"]() {\r\n return false;\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Remove2B595\"](item) {\r\n const this$ = this;\r\n const matchValue = Dictionary__TryFind_2B595(this$, item[0]);\r\n if (matchValue != null) {\r\n if (equals(matchValue[1], item[1])) {\r\n Dictionary__Remove_2B595(this$, item[0]);\r\n }\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n [\"System.Collections.Generic.IDictionary`2.Add5BDDA1\"](key, value) {\r\n const this$ = this;\r\n Dictionary__Add_5BDDA1(this$, key, value);\r\n }\r\n [\"System.Collections.Generic.IDictionary`2.ContainsKey2B595\"](key) {\r\n const this$ = this;\r\n return Dictionary__ContainsKey_2B595(this$, key);\r\n }\r\n [\"System.Collections.Generic.IDictionary`2.get_Item2B595\"](key) {\r\n const this$ = this;\r\n return Dictionary__get_Item_2B595(this$, key);\r\n }\r\n [\"System.Collections.Generic.IDictionary`2.set_Item5BDDA1\"](key, v) {\r\n const this$ = this;\r\n Dictionary__set_Item_5BDDA1(this$, key, v);\r\n }\r\n [\"System.Collections.Generic.IDictionary`2.get_Keys\"]() {\r\n const this$ = this;\r\n return toArray(delay(() => map((pair) => pair[0], this$)));\r\n }\r\n [\"System.Collections.Generic.IDictionary`2.Remove2B595\"](key) {\r\n const this$ = this;\r\n return Dictionary__Remove_2B595(this$, key);\r\n }\r\n [\"System.Collections.Generic.IDictionary`2.TryGetValue23A0B95A\"](key, value) {\r\n const this$ = this;\r\n const matchValue = Dictionary__TryFind_2B595(this$, key);\r\n if (matchValue != null) {\r\n const pair = matchValue;\r\n value.contents = pair[1];\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n [\"System.Collections.Generic.IDictionary`2.get_Values\"]() {\r\n const this$ = this;\r\n return toArray(delay(() => map((pair) => pair[1], this$)));\r\n }\r\n get size() {\r\n const this$ = this;\r\n return Dictionary__get_Count(this$) | 0;\r\n }\r\n clear() {\r\n const this$ = this;\r\n Dictionary__Clear(this$);\r\n }\r\n delete(k) {\r\n const this$ = this;\r\n return Dictionary__Remove_2B595(this$, k);\r\n }\r\n entries() {\r\n const this$ = this;\r\n return map((p) => [p[0], p[1]], this$);\r\n }\r\n get(k) {\r\n const this$ = this;\r\n return Dictionary__get_Item_2B595(this$, k);\r\n }\r\n has(k) {\r\n const this$ = this;\r\n return Dictionary__ContainsKey_2B595(this$, k);\r\n }\r\n keys() {\r\n const this$ = this;\r\n return map((p) => p[0], this$);\r\n }\r\n set(k, v) {\r\n const this$ = this;\r\n Dictionary__set_Item_5BDDA1(this$, k, v);\r\n return this$;\r\n }\r\n values() {\r\n const this$ = this;\r\n return map((p) => p[1], this$);\r\n }\r\n forEach(f, thisArg) {\r\n const this$ = this;\r\n iterate((p) => {\r\n f(p[1], p[0], this$);\r\n }, this$);\r\n }\r\n}\r\n\r\nexport function Dictionary$reflection(gen0, gen1) {\r\n return class_type(\"Fable.Collections.Dictionary\", [gen0, gen1], Dictionary);\r\n}\r\n\r\nexport function Dictionary_$ctor_6623D9B3(pairs, comparer) {\r\n return new Dictionary(pairs, comparer);\r\n}\r\n\r\nfunction Dictionary__TryFindIndex_2B595(this$, k) {\r\n const h = this$.comparer.GetHashCode(k) | 0;\r\n let matchValue;\r\n let outArg = null;\r\n matchValue = [tryGetValue(this$.hashMap, h, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n if (matchValue[0]) {\r\n return [true, h, matchValue[1].findIndex((pair) => this$.comparer.Equals(k, pair[0]))];\r\n }\r\n else {\r\n return [false, h, -1];\r\n }\r\n}\r\n\r\nexport function Dictionary__TryFind_2B595(this$, k) {\r\n const matchValue = Dictionary__TryFindIndex_2B595(this$, k);\r\n let pattern_matching_result;\r\n if (matchValue[0]) {\r\n if (matchValue[2] > -1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return getItemFromDict(this$.hashMap, matchValue[1])[matchValue[2]];\r\n }\r\n case 1: {\r\n return void 0;\r\n }\r\n }\r\n}\r\n\r\nexport function Dictionary__get_Comparer(this$) {\r\n return this$.comparer;\r\n}\r\n\r\nexport function Dictionary__Clear(this$) {\r\n this$.hashMap.clear();\r\n}\r\n\r\nexport function Dictionary__get_Count(this$) {\r\n let count = 0;\r\n let enumerator = getEnumerator(this$.hashMap.values());\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const pairs = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n count = ((count + pairs.length) | 0);\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n return count | 0;\r\n}\r\n\r\nexport function Dictionary__get_Item_2B595(this$, k) {\r\n const matchValue = Dictionary__TryFind_2B595(this$, k);\r\n if (matchValue != null) {\r\n return matchValue[1];\r\n }\r\n else {\r\n throw (new Error(\"The item was not found in collection\"));\r\n }\r\n}\r\n\r\nexport function Dictionary__set_Item_5BDDA1(this$, k, v) {\r\n const matchValue = Dictionary__TryFindIndex_2B595(this$, k);\r\n if (matchValue[0]) {\r\n if (matchValue[2] > -1) {\r\n getItemFromDict(this$.hashMap, matchValue[1])[matchValue[2]] = [k, v];\r\n }\r\n else {\r\n const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));\r\n }\r\n }\r\n else {\r\n this$.hashMap.set(matchValue[1], [[k, v]]);\r\n }\r\n}\r\n\r\nexport function Dictionary__Add_5BDDA1(this$, k, v) {\r\n const matchValue = Dictionary__TryFindIndex_2B595(this$, k);\r\n if (matchValue[0]) {\r\n if (matchValue[2] > -1) {\r\n const msg = format(\"An item with the same key has already been added. Key: {0}\", k);\r\n throw (new Error(msg));\r\n }\r\n else {\r\n const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));\r\n }\r\n }\r\n else {\r\n this$.hashMap.set(matchValue[1], [[k, v]]);\r\n }\r\n}\r\n\r\nexport function Dictionary__ContainsKey_2B595(this$, k) {\r\n const matchValue = Dictionary__TryFindIndex_2B595(this$, k);\r\n let pattern_matching_result;\r\n if (matchValue[0]) {\r\n if (matchValue[2] > -1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return true;\r\n }\r\n case 1: {\r\n return false;\r\n }\r\n }\r\n}\r\n\r\nexport function Dictionary__Remove_2B595(this$, k) {\r\n const matchValue = Dictionary__TryFindIndex_2B595(this$, k);\r\n let pattern_matching_result;\r\n if (matchValue[0]) {\r\n if (matchValue[2] > -1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n getItemFromDict(this$.hashMap, matchValue[1]).splice(matchValue[2], 1);\r\n return true;\r\n }\r\n case 1: {\r\n return false;\r\n }\r\n }\r\n}\r\n\r\n","import { disposeSafe, toIterator, getEnumerator } from \"./Util.js\";\r\nimport { iterate, map, iterateIndexed, concat } from \"./Seq.js\";\r\nimport { FSharpRef } from \"./Types.js\";\r\nimport { class_type } from \"./Reflection.js\";\r\nimport { getItemFromDict, tryGetValue } from \"./MapUtil.js\";\r\nimport { some } from \"./Option.js\";\r\n\r\nexport class HashSet {\r\n constructor(items, comparer) {\r\n const this$ = new FSharpRef(null);\r\n this.comparer = comparer;\r\n this$.contents = this;\r\n this.hashMap = (new Map([]));\r\n this[\"init@8-2\"] = 1;\r\n const enumerator = getEnumerator(items);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const item = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n HashSet__Add_2B595(this$.contents, item);\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n }\r\n get [Symbol.toStringTag]() {\r\n return \"HashSet\";\r\n }\r\n toJSON(_key) {\r\n const this$ = this;\r\n return Array.from(this$);\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const this$ = this;\r\n return getEnumerator(this$);\r\n }\r\n GetEnumerator() {\r\n const this$ = this;\r\n return getEnumerator(concat(this$.hashMap.values()));\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Add2B595\"](item) {\r\n const this$ = this;\r\n HashSet__Add_2B595(this$, item);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Clear\"]() {\r\n const this$ = this;\r\n HashSet__Clear(this$);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Contains2B595\"](item) {\r\n const this$ = this;\r\n return HashSet__Contains_2B595(this$, item);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.CopyToZ2E171D71\"](array, arrayIndex) {\r\n const this$ = this;\r\n iterateIndexed((i, e) => {\r\n array[arrayIndex + i] = e;\r\n }, this$);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_Count\"]() {\r\n const this$ = this;\r\n return HashSet__get_Count(this$) | 0;\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_IsReadOnly\"]() {\r\n return false;\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Remove2B595\"](item) {\r\n const this$ = this;\r\n return HashSet__Remove_2B595(this$, item);\r\n }\r\n get size() {\r\n const this$ = this;\r\n return HashSet__get_Count(this$) | 0;\r\n }\r\n add(k) {\r\n const this$ = this;\r\n HashSet__Add_2B595(this$, k);\r\n return this$;\r\n }\r\n clear() {\r\n const this$ = this;\r\n HashSet__Clear(this$);\r\n }\r\n delete(k) {\r\n const this$ = this;\r\n return HashSet__Remove_2B595(this$, k);\r\n }\r\n has(k) {\r\n const this$ = this;\r\n return HashSet__Contains_2B595(this$, k);\r\n }\r\n keys() {\r\n const this$ = this;\r\n return map((x) => x, this$);\r\n }\r\n values() {\r\n const this$ = this;\r\n return map((x) => x, this$);\r\n }\r\n entries() {\r\n const this$ = this;\r\n return map((v) => [v, v], this$);\r\n }\r\n forEach(f, thisArg) {\r\n const this$ = this;\r\n iterate((x) => {\r\n f(x, x, this$);\r\n }, this$);\r\n }\r\n}\r\n\r\nexport function HashSet$reflection(gen0) {\r\n return class_type(\"Fable.Collections.HashSet\", [gen0], HashSet);\r\n}\r\n\r\nexport function HashSet_$ctor_Z6150332D(items, comparer) {\r\n return new HashSet(items, comparer);\r\n}\r\n\r\nfunction HashSet__TryFindIndex_2B595(this$, k) {\r\n const h = this$.comparer.GetHashCode(k) | 0;\r\n let matchValue;\r\n let outArg = null;\r\n matchValue = [tryGetValue(this$.hashMap, h, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n if (matchValue[0]) {\r\n return [true, h, matchValue[1].findIndex((v_1) => this$.comparer.Equals(k, v_1))];\r\n }\r\n else {\r\n return [false, h, -1];\r\n }\r\n}\r\n\r\nfunction HashSet__TryFind_2B595(this$, k) {\r\n const matchValue = HashSet__TryFindIndex_2B595(this$, k);\r\n let pattern_matching_result;\r\n if (matchValue[0]) {\r\n if (matchValue[2] > -1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return some(getItemFromDict(this$.hashMap, matchValue[1])[matchValue[2]]);\r\n }\r\n case 1: {\r\n return void 0;\r\n }\r\n }\r\n}\r\n\r\nexport function HashSet__get_Comparer(this$) {\r\n return this$.comparer;\r\n}\r\n\r\nexport function HashSet__Clear(this$) {\r\n this$.hashMap.clear();\r\n}\r\n\r\nexport function HashSet__get_Count(this$) {\r\n let count = 0;\r\n let enumerator = getEnumerator(this$.hashMap.values());\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const items = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n count = ((count + items.length) | 0);\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n return count | 0;\r\n}\r\n\r\nexport function HashSet__Add_2B595(this$, k) {\r\n const matchValue = HashSet__TryFindIndex_2B595(this$, k);\r\n if (matchValue[0]) {\r\n if (matchValue[2] > -1) {\r\n return false;\r\n }\r\n else {\r\n const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push(k));\r\n return true;\r\n }\r\n }\r\n else {\r\n this$.hashMap.set(matchValue[1], [k]);\r\n return true;\r\n }\r\n}\r\n\r\nexport function HashSet__Contains_2B595(this$, k) {\r\n const matchValue = HashSet__TryFindIndex_2B595(this$, k);\r\n let pattern_matching_result;\r\n if (matchValue[0]) {\r\n if (matchValue[2] > -1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return true;\r\n }\r\n case 1: {\r\n return false;\r\n }\r\n }\r\n}\r\n\r\nexport function HashSet__Remove_2B595(this$, k) {\r\n const matchValue = HashSet__TryFindIndex_2B595(this$, k);\r\n let pattern_matching_result;\r\n if (matchValue[0]) {\r\n if (matchValue[2] > -1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n getItemFromDict(this$.hashMap, matchValue[1]).splice(matchValue[2], 1);\r\n return true;\r\n }\r\n case 1: {\r\n return false;\r\n }\r\n }\r\n}\r\n\r\n","namespace Fable.SimpleJson\n\nopen System\nopen FSharp.Reflection\nopen Fable.Core\nopen System.Reflection\nopen System.Collections.Generic\n\n[]\nmodule Converter =\n let (|PrimitiveType|_|) (primType: Type) =\n match primType.FullName with\n | \"System.String\" -> Some TypeInfo.String\n | \"System.Char\" -> Some TypeInfo.Char\n | \"System.Int16\" -> Some TypeInfo.Short\n | \"System.Int32\" -> Some TypeInfo.Int32\n | \"Microsoft.FSharp.Core.int64`1\"\n | \"System.Int64\" -> Some TypeInfo.Long\n | \"System.UInt16\" -> Some TypeInfo.UInt16\n | \"System.UInt32\" -> Some TypeInfo.UInt32\n | \"System.UInt64\" -> Some TypeInfo.UInt64\n | \"System.DateTime\" -> Some TypeInfo.DateTime\n | \"System.DateOnly\" -> Some TypeInfo.DateOnly\n | \"System.TimeOnly\" -> Some TypeInfo.TimeOnly\n | \"System.TimeSpan\" -> Some TypeInfo.TimeSpan\n | \"System.DateTimeOffset\" -> Some TypeInfo.DateTimeOffset\n | \"System.Boolean\" -> Some TypeInfo.Bool\n | \"System.Single\" -> Some TypeInfo.Float32\n | \"System.Double\" -> Some TypeInfo.Float\n | \"Microsoft.FSharp.Core.decimal`1\"\n | \"System.Decimal\" -> Some TypeInfo.Decimal\n | \"System.Numerics.BigInteger\" -> Some TypeInfo.BigInt\n | \"Microsoft.FSharp.Core.Unit\" -> Some TypeInfo.Unit\n | \"System.Guid\" -> Some TypeInfo.Guid\n | \"System.Byte\" -> Some TypeInfo.Byte\n | \"System.SByte\" -> Some TypeInfo.SByte\n | \"System.Object\" -> Some TypeInfo.Object\n | \"System.Uri\" -> Some TypeInfo.Uri\n | _ -> None\n\n let (|RecordType|_|) (t: Type) =\n if FSharpType.IsRecord t\n then\n FSharpType.GetRecordFields t\n |> Array.map (fun field -> field, field.Name, field.PropertyType)\n |> Some\n else None\n\n let (|SetType|_|) (t: Type) =\n if t.FullName.StartsWith \"Microsoft.FSharp.Collections.FSharpSet`1\"\n then t.GetGenericArguments().[0] |> Some\n else None\n\n let (|Nullable|_|) (t: Type) =\n if t.FullName.StartsWith \"System.Nullable`1\"\n then t.GetGenericArguments().[0] |> Some\n else None\n\n let (|UnionType|_|) (t: Type) =\n if FSharpType.IsUnion t\n then\n FSharpType.GetUnionCases t\n |> Array.map (fun info ->\n let caseName = info.Name\n let caseTypes = info.GetFields() |> Array.map (fun prop -> prop.PropertyType)\n caseName, info, caseTypes)\n |> Some\n else None\n\n let (|MapType|_|) (t: Type) =\n if (t.FullName.StartsWith \"Microsoft.FSharp.Collections.FSharpMap`2\")\n then\n let genArgs = t.GetGenericArguments()\n Some (genArgs.[0], genArgs.[1])\n else None\n\n let (|ListType|_|) (t: Type) =\n if (t.FullName.StartsWith \"Microsoft.FSharp.Collections.FSharpList`1\")\n then t.GetGenericArguments().[0] |> Some\n else None\n\n let rec flattenFuncTypes (typeDef: Type) =\n [| if FSharpType.IsFunction typeDef\n then let (domain, range) = FSharpType.GetFunctionElements typeDef\n yield! flattenFuncTypes domain\n yield! flattenFuncTypes range\n else yield typeDef |]\n\n let (|FuncType|_|) (t: Type) =\n if FSharpType.IsFunction t\n then flattenFuncTypes t |> Some\n else None\n\n let (|ArrayType|_|) (t:Type) =\n if t.IsArray\n then t.GetElementType() |> Some\n else None\n\n let (|OptionType|_|) (t:Type) =\n if (t.FullName.StartsWith \"Microsoft.FSharp.Core.FSharpOption`1\")\n then t.GetGenericArguments().[0] |> Some\n else None\n\n let (|TupleType|_|) (t: Type) =\n if FSharpType.IsTuple t\n then FSharpType.GetTupleElements(t) |> Some\n else None\n\n let (|SeqType|_|) (t: Type) =\n if t.FullName.StartsWith \"System.Collections.Generic.IEnumerable`1\"\n then t.GetGenericArguments().[0] |> Some\n else None\n\n let (|DictionaryType|_|) (t: Type) =\n if t.FullName.StartsWith \"System.Collections.Generic.Dictionary\"\n then\n let genArgs = t.GetGenericArguments()\n Some (genArgs.[0], genArgs.[1])\n else\n None\n\n let (|ResizeArrayType|_|) (t: Type) =\n if t.FullName.StartsWith \"System.Collections.Generic.List\"\n then t.GetGenericArguments().[0] |> Some\n else None\n\n let (|HashSetType|_|) (t: Type) =\n if t.FullName.StartsWith \"System.Collections.Generic.HashSet\"\n then t.GetGenericArguments().[0] |> Some\n else None\n\n let (|AsyncType|_|) (t:Type) =\n if t.FullName.StartsWith \"Microsoft.FSharp.Control.FSharpAsync`1\"\n then t.GetGenericArguments().[0] |> Some\n else None\n\n let (|PromiseType|_|) (t:Type) =\n if t.FullName.StartsWith \"Fable.Core.JS.Promise`1\"\n then t.GetGenericArguments().[0] |> Some\n else None\n\n let private lazyToDelayed (l:Lazy<_>) = fun () -> l.Value\n\n let (|EnumType|_|) (t: Type) =\n if t.IsEnum\n then Enum.GetUnderlyingType(t) |> Some\n else None\n\n let rec private _createTypeInfo (resolvedType: Type) : Fable.SimpleJson.TypeInfo =\n match resolvedType with\n | PrimitiveType typeInfo -> typeInfo\n | FuncType (types) -> TypeInfo.Func <| lazyToDelayed (lazy (Array.map createTypeInfo types))\n | RecordType fields ->\n let l = lazy (\n let fields =\n [| for (field, fieldName, fieldType) in fields ->\n { PropertyInfo = field\n FieldName = fieldName;\n FieldType = createTypeInfo fieldType } |]\n fields, resolvedType)\n TypeInfo.Record (lazyToDelayed l)\n\n | UnionType cases ->\n let l = lazy (\n [| for (caseName, caseInfo, caseTypes) in cases ->\n { CaseName = caseName;\n Info = caseInfo;\n CaseTypes = Array.map createTypeInfo caseTypes } |], resolvedType)\n TypeInfo.Union (lazyToDelayed l)\n\n | EnumType elemType -> TypeInfo.Enum (lazyToDelayed <| lazy (createTypeInfo elemType, resolvedType))\n | ListType elemType -> TypeInfo.List (lazyToDelayed <| lazy (createTypeInfo elemType))\n | ResizeArrayType elemType -> TypeInfo.ResizeArray (lazyToDelayed <| lazy (createTypeInfo elemType))\n | HashSetType elemType -> TypeInfo.HashSet (lazyToDelayed <| lazy (createTypeInfo elemType))\n | ArrayType elemType -> TypeInfo.Array (lazyToDelayed <| lazy (createTypeInfo elemType))\n // Checking for tuples has to happen after checking for arrays\n | TupleType types -> TypeInfo.Tuple (lazyToDelayed <| lazy (Array.map createTypeInfo types))\n | OptionType elemType -> TypeInfo.Option (lazyToDelayed <| lazy (createTypeInfo elemType))\n | Nullable elemType -> TypeInfo.Option (lazyToDelayed <| lazy (createTypeInfo elemType))\n | SetType elemType -> TypeInfo.Set (lazyToDelayed <| lazy (createTypeInfo elemType))\n | MapType (keyType, valueType) -> TypeInfo.Map (lazyToDelayed <| lazy (createTypeInfo keyType, createTypeInfo valueType))\n | DictionaryType (keyType, valueType) -> TypeInfo.Dictionary (lazyToDelayed <| lazy (createTypeInfo keyType, createTypeInfo valueType, valueType))\n | SeqType elemType -> TypeInfo.Seq (lazyToDelayed <| lazy (createTypeInfo elemType))\n | AsyncType elemType -> TypeInfo.Async (lazyToDelayed <| lazy (createTypeInfo elemType))\n | PromiseType elemType -> TypeInfo.Promise (lazyToDelayed <| lazy (createTypeInfo elemType))\n | _ -> TypeInfo.Any (lazyToDelayed <| lazy (resolvedType))\n\n and private typeInfoCache = Dictionary()\n\n and createTypeInfo (resolvedType: Type) : Fable.SimpleJson.TypeInfo =\n match typeInfoCache.TryGetValue resolvedType with\n | true, ti -> ti\n | false, _ ->\n let ti = _createTypeInfo resolvedType\n // see https://github.com/fable-compiler/Fable/issues/1871\n // Type equality doesn't work for anonymous records - all anon records are considered equal.\n // For anonymous records, the name is the empty string.\n let notAnonymousRecord =\n not (String.IsNullOrEmpty resolvedType.FullName)\n && not (resolvedType.FullName.EndsWith(\"`1[]\"))\n && not (resolvedType.FullName.EndsWith(\"`2[]\"))\n\n if notAnonymousRecord then\n typeInfoCache.[resolvedType] <- ti\n ti\n else\n ti\n\n type Fable.SimpleJson.TypeInfo with\n static member inline createFrom<'t> () : Fable.SimpleJson.TypeInfo =\n createTypeInfo typeof<'t>\n\n /// returns whether a type is primitive\n let isPrimitive = function\n | TypeInfo.Unit\n | TypeInfo.String\n | TypeInfo.UInt16\n | TypeInfo.UInt32\n | TypeInfo.UInt64\n | TypeInfo.Int32\n | TypeInfo.Bool\n | TypeInfo.Float32\n | TypeInfo.Float\n | TypeInfo.Decimal\n | TypeInfo.Short\n | TypeInfo.Long\n | TypeInfo.Byte\n | TypeInfo.DateTime\n | TypeInfo.DateTimeOffset\n | TypeInfo.DateOnly\n | TypeInfo.TimeOnly\n | TypeInfo.BigInt\n | TypeInfo.Guid\n | TypeInfo.Option _ -> true\n | otherwise -> false\n\n /// returns whether the discrimiated union type is like a enum\n let enumUnion = function\n | TypeInfo.Union getCases ->\n getCases()\n |> fst\n |> Array.forall (fun case -> Array.isEmpty case.CaseTypes)\n | otherwise -> false\n","export default function isBrowser() {\n return typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n}","namespace Fable.SimpleJson\n\nopen System\nopen Fable.Core\nopen FSharp.Reflection\nopen System.Numerics\nopen System.Collections\nopen System.Collections.Generic\nopen Fable.Core.JsInterop\n\nmodule Node =\n\n /// Converts Base64 string into a byte array in Node environment\n []\n let bytesFromBase64 (value: string) : byte array = jsNative\n\nmodule Convert =\n let internal isBrowser () : bool = importDefault \"./isBrowser.js\"\n\n let insideBrowser = isBrowser()\n\n []\n let private isUndefined (value: obj) : bool = jsNative\n let private isDefined (value: obj) : bool = not (isUndefined value)\n\n /// Uses internal representation of F# maps to determine whether we are using Fable 3 or not\n let usingFable3() =\n #if FABLE_COMPILER_3\n true\n #else\n let map = JS.JSON.parse(JS.JSON.stringify (Map.ofList [ 1, 1; 2, 2 ]))\n let tree = get \"tree\" map\n isDefined tree && isDefined (get \"k\" tree) && isDefined (get \"v\" tree) && isDefined (get \"h\" tree)\n #endif\n\n let isUsingFable3 = usingFable3()\n\n []\n let internal insideWorker : bool = jsNative\n\n []\n let internal setProp o k v = jsNative\n\n type InternalMap =\n | MapEmpty\n | MapOne of string * Json\n | MapNode of string * Json * InternalMap * InternalMap\n\n let rec flattenMap = function\n | MapEmpty -> [ ]\n | MapOne (key, value) -> [ key, value ]\n | MapNode (key, value, left, right) ->\n [ yield! flattenMap left\n yield! flattenMap right\n yield (key, value) ]\n\n let (|KeyValue|_|) key (map: Map) =\n map\n |> Map.tryFind key\n |> Option.map (fun value -> key, value, Map.remove key map)\n\n let (|NonArray|_|) = function\n | JArray _ -> None\n | json -> Some json\n\n let (|MapEmpty|_|) json =\n match json with\n | JString \"MapEmpty\" -> Some json\n | _ -> None\n\n let (|MapKey|_|) = function\n | JNumber number -> Some (string number)\n | JString key -> Some key\n | _ -> None\n\n let (|MapOne|_|) = function\n | JArray [ JString \"MapOne\"; MapKey key; value ] -> Some (key, value)\n | _ -> None\n\n let (|MapNode|_|) = function\n | JArray [ JString \"MapNode\"; MapKey key; value; left; right; JNumber _ ] ->\n Some (key, value, left, right)\n | _ -> None\n\n let rec generateMap json =\n match json with\n | MapEmpty _ -> Some InternalMap.MapEmpty\n | MapOne (key, value) -> Some (InternalMap.MapOne (key, value))\n | MapNode (key, value, left, right) ->\n match generateMap left, generateMap right with\n | Some leftMap, Some rightMap ->\n Some (InternalMap.MapNode(key, value, leftMap, rightMap))\n | _ -> None\n | _ -> None\n\n let rec flatteFable3Map (tree: Map) =\n [\n match Map.tryFind \"k\" tree, Map.tryFind \"v\" tree with\n | Some (JString key), Some value -> (key, value)\n | _ -> ()\n\n match Map.tryFind \"left\" tree with\n | Some (JObject left) -> yield! flatteFable3Map left\n | _ -> ()\n\n match Map.tryFind \"right\" tree with\n | Some (JObject right) -> yield! flatteFable3Map right\n | _ -> ()\n ]\n\n let rec flattenFable3Lists (linkedList: Map) =\n [\n match Map.tryFind \"head\" linkedList with\n | Some value -> value\n | None -> ()\n\n match Map.tryFind \"tail\" linkedList with\n | Some (JObject tail) -> yield! flattenFable3Lists tail\n | _ -> ()\n ]\n\n /// Returns whether the type information resembles a type of a sequence of elements (including tuples)\n let arrayLike = function\n | TypeInfo.Array _ -> true\n | TypeInfo.List _ -> true\n | TypeInfo.Seq _ -> true\n | TypeInfo.Tuple _ -> true\n | TypeInfo.Set _ -> true\n | TypeInfo.ResizeArray _ -> true\n | TypeInfo.HashSet _ -> true\n | _ -> false\n\n let isRecord = function\n | TypeInfo.Record recordType -> true\n | _ -> false\n\n let unionOfRecords = function\n | TypeInfo.Union getCases ->\n let (unionCases, unionType) = getCases()\n unionCases\n |> Seq.forall (fun case -> case.CaseTypes.Length = 1 && isRecord case.CaseTypes.[0])\n | _ ->\n false\n\n let optional = function\n | TypeInfo.Option _ -> true\n | _ -> false\n\n let isQuoted (input: string) =\n input.StartsWith \"\\\"\" && input.EndsWith \"\\\"\"\n\n let betweenQuotes (input: string) = \"\\\"\" + input + \"\\\"\"\n\n let removeQuotes (input: string) =\n input.Substring(1, input.Length - 2)\n\n let rec fromJsonAs (input: Json) (typeInfo: Fable.SimpleJson.TypeInfo) : obj =\n match input, typeInfo with\n | JNumber value, TypeInfo.Float -> unbox value\n | JString value, TypeInfo.Float when value.ToLower() = \"nan\" -> unbox (Double.NaN)\n | JString value, TypeInfo.Float -> unbox (float value)\n | JNumber value, TypeInfo.Float32 -> unbox (float32 value)\n | JString value, TypeInfo.Float32 when value.ToLower() = \"nan\" -> unbox (Double.NaN)\n | JString value, TypeInfo.Float32 -> unbox (float32 value)\n // reading number as int -> floor it\n | JNumber value, TypeInfo.Int32 -> unbox (JS.Math.floor(value))\n | JBool value, TypeInfo.Bool -> unbox value\n // reading int from string -> parse it\n | JString value, TypeInfo.Int32 -> unbox (int value)\n | JString value, TypeInfo.Char -> unbox (char value)\n | JNumber value, TypeInfo.Char -> unbox (char (unbox value))\n // reading into strings\n | JString value, TypeInfo.String -> unbox value\n | JNumber value, TypeInfo.String -> unbox (string value)\n // uri\n | JString value, TypeInfo.Uri -> unbox(Uri(value))\n // decimals\n | JString value, TypeInfo.Decimal -> unbox (decimal value)\n | JNumber value, TypeInfo.Decimal -> unbox (decimal value)\n | JString value, TypeInfo.Short -> unbox (int16 value)\n | JNumber value, TypeInfo.Short -> unbox (int16 value)\n // Unsigned integers\n | JNumber value, TypeInfo.UInt16 -> unbox (uint16 value)\n | JString value, TypeInfo.UInt16 -> unbox (uint16 value)\n | JNumber value, TypeInfo.UInt32 -> unbox (uint32 value)\n | JString value, TypeInfo.UInt32 -> unbox (uint32 value)\n | JNumber value, TypeInfo.UInt64 -> unbox (uint64 value)\n | JString value, TypeInfo.UInt64 -> unbox (uint64 value)\n | JNumber value, TypeInfo.TimeSpan -> unbox (JS.Math.floor value)\n | JString value, TypeInfo.Enum getlElemType ->\n let (underlyingType, originalType) = getlElemType()\n match underlyingType with\n | TypeInfo.Int32 ->\n match Int32.TryParse(value) with\n | true, parsedNumber ->\n unbox parsedNumber\n | false, _ ->\n failwithf \"The value '%s' is not valid for enum of type '%s'\" value originalType.Name\n | TypeInfo.Long ->\n match Int64.TryParse(value) with\n | true, parsedNumber ->\n unbox parsedNumber\n | false, _ ->\n failwithf \"The value '%s' is not valid for enum of type '%s'\" value originalType.Name\n | other ->\n failwithf \"The value '%s' cannot be converted to enum of type '%s'\" value originalType.Name\n | JNumber value, TypeInfo.Enum getElemType ->\n let (_, originalType) = getElemType()\n unbox value\n // byte[] coming from the server is serialized as base64 string\n // convert it back to the actual byte array\n | JString value, TypeInfo.Array getElemType ->\n let elemType = getElemType()\n match elemType with\n | TypeInfo.Byte ->\n if insideWorker || insideBrowser\n then unbox (Convert.FromBase64String value)\n else unbox (Node.bytesFromBase64 value)\n | otherType -> failwithf \"Cannot convert arbitrary string '%s' to %A\" value otherType\n\n // null values for strings are just the null string\n | JNull, TypeInfo.String -> unbox null\n | JNull, TypeInfo.Unit -> unbox ()\n | genericJson, TypeInfo.Object -> unbox (SimpleJson.toPlainObject genericJson)\n // int64 as string -> parse it\n | JString value, TypeInfo.Long -> unbox (int64 value)\n | JString value, TypeInfo.Byte -> unbox (byte value)\n | JNumber value, TypeInfo.Byte -> unbox (byte value)\n | JNumber value, TypeInfo.SByte -> unbox (sbyte value)\n | JString value, TypeInfo.SByte -> unbox (sbyte value)\n // BigInt as string -> parse it\n | JString value, TypeInfo.BigInt -> unbox (BigInteger.Parse value)\n | JNumber value, TypeInfo.BigInt -> unbox (bigint (JS.Math.floor(value)))\n // parse formatted date time\n | JString value, TypeInfo.DateTime -> unbox (DateTime.Parse(value))\n // parse formatted date time offset\n | JString value, TypeInfo.DateTimeOffset -> unbox (DateTimeOffset.Parse(value))\n | JNumber value, TypeInfo.DateTimeOffset ->\n let seconds = int64 (JS.Math.floor(value))\n unbox (DateTimeOffset.FromUnixTimeSeconds seconds)\n#if NET6_0_OR_GREATER\n // TimeOnly, DateOnly\n | JNumber value, TypeInfo.DateOnly -> unbox (DateOnly.FromDayNumber (int value))\n | JString value, TypeInfo.DateOnly -> unbox (DateOnly.FromDayNumber (int value))\n | JString value, TypeInfo.TimeOnly -> unbox (TimeOnly (int64 value))\n#endif\n\n // deserialize union from objects\n // { \"One\": 20 } or {\"One\": [20]} -> One of int\n | JObject values, TypeInfo.Union (getTypes) ->\n let (cases, unionType) = getTypes()\n match Map.toList values with\n | [ caseName, JArray values ] ->\n cases\n |> Array.tryFind (fun case -> case.CaseName = caseName)\n |> function\n | None ->\n let caseNames = Array.map (fun case -> sprintf \" '%s' \" case.CaseName) cases\n let expectedCases = String.concat \", \" caseNames\n failwithf \"Case %s was not valid for type '%s', expected one of the cases [%s]\" caseName unionType.Name expectedCases\n | Some foundCase when Array.length foundCase.CaseTypes = 1 && arrayLike foundCase.CaseTypes.[0] ->\n let deserialized = fromJsonAs (JArray values) foundCase.CaseTypes.[0]\n FSharpValue.MakeUnion(foundCase.Info, [| deserialized |])\n |> unbox\n | Some foundCase when Array.length foundCase.CaseTypes = 1 && optional foundCase.CaseTypes.[0] ->\n let parsedOptional = unbox (fromJsonAs (JArray values) foundCase.CaseTypes.[0])\n FSharpValue.MakeUnion(foundCase.Info, [| parsedOptional |])\n |> unbox\n | Some foundCase ->\n if Array.length foundCase.CaseTypes = 1\n && not (arrayLike foundCase.CaseTypes.[0])\n && Array.length foundCase.CaseTypes <> List.length values\n then failwithf \"Expected case '%s' to have %d argument types but the JSON data only contained %d values\" foundCase.CaseName (Array.length foundCase.CaseTypes) (List.length values)\n let parsedValues =\n Array.ofList values\n |> Array.zip foundCase.CaseTypes\n |> Array.map (fun (valueType, value) -> fromJsonAs value valueType)\n FSharpValue.MakeUnion(foundCase.Info, parsedValues)\n |> unbox\n | [ caseName, NonArray json ] ->\n cases\n |> Array.tryFind (fun case -> case.CaseName = caseName)\n |> function\n | Some ({ CaseName = caseName; Info = caseInfo; CaseTypes = [| caseType |] }) ->\n FSharpValue.MakeUnion(caseInfo, [| unbox fromJsonAs json caseType |])\n |> unbox\n | _ ->\n let caseNames = Array.map (fun case -> sprintf \" '%s' \" case.CaseName) cases\n let expectedCases = String.concat \", \" caseNames\n failwithf \"Case %s was not valid for type '%s', expected one of the cases [%s]\" caseName unionType.Name expectedCases\n\n // Specific for Fable 3\n | otherwise when Map.containsKey \"tag\" values && Map.containsKey \"fields\" values && Map.count values = 2 ->\n match Map.tryFind \"tag\" values, Map.tryFind \"fields\" values with\n | Some (JNumber caseIndex), Some (JArray fieldValues) ->\n let foundCase = cases.[int caseIndex]\n let values =\n fieldValues\n |> Array.ofList\n |> Array.mapi (fun index value -> fromJsonAs value (foundCase.CaseTypes.[index]))\n\n FSharpValue.MakeUnion(foundCase.Info, values)\n | _ ->\n failwithf \"Could not deserialize JSON(%s) into type %s\" (SimpleJson.toString (JObject values)) unionType.FullName\n\n | otherwise when unionOfRecords typeInfo ->\n let discriminators = [\"__typename\"; \"$typename\"; \"$type\" ]\n let foundDiscriminatorKey =\n discriminators\n |> List.tryFind (fun keyword -> Map.containsKey keyword values)\n\n match foundDiscriminatorKey with\n | None ->\n failwithf \"Could not serialize the JSON object into the union of records of type %s because the JSON did not contain a known discriminator. Expected '__typename', '$typeName' or '$type'\" unionType.Name\n | Some discriminatorKey ->\n let discriminatorValueJson = Map.find discriminatorKey values\n match discriminatorValueJson with\n | JString discriminatorValue ->\n let foundUnionCase =\n cases\n |> Seq.tryFind (fun case -> case.CaseName.ToUpperInvariant() = discriminatorValue.ToUpperInvariant())\n\n match foundUnionCase with\n | None ->\n failwithf \"Union of records of type '%s' does not have a matching case '%s'\" unionType.Name discriminatorValue\n | Some case ->\n // Assuming the case types is [recordType]\n // one element of types and the first element is a record\n // as satisfied by the unionOfRecords function\n let record = unbox (fromJsonAs (JObject values) (case.CaseTypes.[0]))\n FSharpValue.MakeUnion(case.Info, [| record |])\n | otherwise ->\n failwithf \"Union of records of type '%s' cannot be deserialized with the value of the discriminator key is not a string to match against a specific union case\" unionType.Name\n | otherwise ->\n // TODO!!! Better error messages here\n let unexpectedJson = JS.JSON.stringify otherwise\n let expectedType = JS.JSON.stringify cases\n failwithf \"Expected JSON:\\n%s\\nto match the type\\n%s\" unexpectedJson expectedType\n | JNull, TypeInfo.Option _ -> unbox None\n | jsonValue, TypeInfo.Option optionalTypeDelayed when jsonValue <> JNull ->\n let optionalType = optionalTypeDelayed()\n let parsedOptional = unbox (fromJsonAs jsonValue optionalType)\n unbox Some parsedOptional\n | JString value, TypeInfo.Guid _ -> unbox (System.Guid.Parse(value))\n // int64 as a number, convert it to int then to in64\n | JNumber value , TypeInfo.Long _ -> unbox int64 (int value)\n // int64 as the internal representation from Long.js\n // then reconstruct it from the high/low (two integers) components\n | JObject dict, TypeInfo.Long _ ->\n let get key = Map.tryFind key dict\n [ get \"low\"; get \"high\"; get \"unsigned\" ]\n |> List.choose id\n |> function\n | [ JNumber low; JNumber high; JBool _ ] ->\n let lowBytes = BitConverter.GetBytes(int low)\n let highBytes = BitConverter.GetBytes(int high)\n let combinedBytes = Array.concat [ lowBytes; highBytes ]\n BitConverter.ToInt64(combinedBytes, 0)\n |> unbox\n | _ -> failwithf \"Unable to construct int64 from object literal { low: int, high: int, unsigned: bool }\"\n // convert a single case string to union\n // \"One\" -> One, here is a special case where the case in quoted inside the string\n | JString caseName, TypeInfo.Union getTypes when isQuoted caseName ->\n let (caseTypes, unionType) = getTypes()\n caseTypes\n |> Array.tryFind (fun case -> case.CaseName = removeQuotes caseName)\n |> function\n | Some ({ Info = caseInfo }) -> unbox (FSharpValue.MakeUnion(caseInfo, [||]))\n | None ->\n let caseNames = Array.map (fun case -> sprintf \" '%s' \" case.CaseName) caseTypes\n let expectedCases = String.concat \", \" caseNames\n failwithf \"Case %s was not valid for type '%s', expected one of the cases [%s]\" caseName unionType.Name expectedCases\n // convert a single case string to union\n // \"One\" -> One\n | JString caseName, TypeInfo.Union getTypes ->\n let (caseTypes, unionType) = getTypes()\n caseTypes\n |> Array.tryFind (fun case -> case.CaseName = caseName)\n |> function\n | Some ({ Info = caseInfo }) -> unbox (FSharpValue.MakeUnion(caseInfo, [||]))\n | None ->\n let caseNames = Array.map (fun case -> sprintf \" '%s' \" case.CaseName) caseTypes\n let expectedCases = String.concat \", \" caseNames\n failwithf \"Case %s was not valid for type '%s', expected one of the cases [%s]\" caseName unionType.Name expectedCases\n | JString serializedRecord, TypeInfo.Record getFields ->\n fromJsonAs (SimpleJson.parse serializedRecord) typeInfo\n // convert unions from arrays\n // [\"One\", 20] -> One of int\n | JArray caseValue, TypeInfo.Union getTypes ->\n let (cases, unionType) = getTypes()\n match caseValue with\n // Union case without values\n | [ JString caseName ] ->\n cases\n |> Array.tryFind (fun case -> case.CaseName = caseName)\n |> function\n | Some ({ CaseName = caseName; Info = caseInfo; CaseTypes = caseInfoTypes }) ->\n // single case without values\n unbox (FSharpValue.MakeUnion(caseInfo, [||]))\n | None ->\n let caseNames = Array.map (fun case -> sprintf \" '%s' \" case.CaseName) cases\n let expectedCases = String.concat \", \" caseNames\n failwithf \"Case '%s' was not valid for type '%s', expected one of the cases [%s]\" caseName unionType.Name expectedCases\n | JString caseName :: values ->\n cases\n |> Array.tryFind (fun case -> case.CaseName = caseName)\n |> function\n | None ->\n let caseNames = Array.map (fun ({ CaseName = name }) -> name) cases\n let expectedCases = String.concat \", \" caseNames\n failwithf \"Case %s was not valid, expected one of [%s]\" caseName expectedCases\n | Some ({ CaseName = foundCaseName; Info = caseInfo; CaseTypes = types }) ->\n if Array.length types <> List.length values\n then failwithf \"The number of union case parameters for '%s' is different\" foundCaseName\n let parsedValues =\n Array.ofList values\n |> Array.zip types\n |> Array.map (fun (valueType, value) -> fromJsonAs value valueType)\n FSharpValue.MakeUnion(caseInfo, parsedValues)\n |> unbox\n | otherwise ->\n let unexpectedJson = JS.JSON.stringify otherwise\n let expectedType = JS.JSON.stringify cases\n failwithf \"Expected JSON:\\n%s\\nto match the type\\n%s\" unexpectedJson expectedType\n // Arrays\n | JArray values, TypeInfo.Array elementTypeDelayed ->\n let elementType = elementTypeDelayed()\n values\n |> List.map (fun value -> unbox (fromJsonAs value elementType))\n |> Array.ofList\n |> unbox\n // Lists\n | JArray values, TypeInfo.List elementTypeDelayed ->\n let elementType = elementTypeDelayed()\n values\n |> List.map (fun value -> unbox (fromJsonAs value elementType))\n |> unbox\n\n // Specific for Fable 3\n | JObject linkedList, TypeInfo.List elementTypeDelayed ->\n let elementType = elementTypeDelayed()\n let flattenedList = flattenFable3Lists linkedList\n flattenedList\n |> List.map (fun value -> unbox (fromJsonAs value elementType))\n |> unbox\n\n | JArray values, TypeInfo.Set elementTypeDelayed ->\n let elementType = elementTypeDelayed()\n values\n |> List.map (fun value -> unbox (fromJsonAs value elementType))\n |> Set.ofList\n |> unbox\n\n | JArray values, TypeInfo.Seq elementTypeDelayed ->\n let elementType = elementTypeDelayed()\n let converted = List.map (fun value -> unbox (fromJsonAs value elementType)) values\n unbox converted\n // Tuples, become just arrays\n | JArray array, TypeInfo.Tuple tupleTypesDelayed ->\n let tupleTypes = tupleTypesDelayed()\n array\n |> Array.ofList\n |> Array.zip tupleTypes\n |> Array.map (fun (jsonType, jsonData) -> fromJsonAs jsonData jsonType)\n |> unbox\n // Records\n | JObject dict, TypeInfo.Record getTypes ->\n let fields, recordType = getTypes()\n // Match the JSON object literal keys with their types\n let recordValues =\n let values = Map.toList dict\n fields\n |> Array.map (fun ({ FieldName = fieldName; FieldType = fieldType }) ->\n values\n |> List.tryFind (fun (key, value) -> fieldName = key)\n |> function\n | Some (key, value) -> unbox (fromJsonAs value fieldType)\n | None ->\n match fieldType with\n // field type is an option of something, just return None\n | TypeInfo.Option _ -> unbox None\n | _ ->\n // field type is required and it doens't exist in the JSON\n // then generate a nice error message\n let dictKeys =\n Map.toList dict\n |> List.map (fst >> sprintf \"'%s'\")\n |> String.concat \", \"\n |> sprintf \"[ %s ]\"\n let recordFields =\n fields\n |> Array.map (fun ({ FieldName = name; FieldType = innerFieldType }) ->\n match innerFieldType with\n | TypeInfo.Option _ -> sprintf \"optional('%s')\" name\n | _ -> sprintf \"required('%s')\" name)\n |> String.concat \", \"\n |> sprintf \"[ %s ]\"\n failwithf \"Could not find the required key '%s' in the JSON object literal with keys %s to match with record type '%s' that has fields %s\" fieldName dictKeys recordType.Name recordFields)\n unbox (FSharpValue.MakeRecord(recordType, recordValues))\n\n | JArray tuples, TypeInfo.Map getTypes ->\n let (keyType, valueType) = getTypes()\n let pairs =\n [ for keyValuePair in tuples do\n let tuple = fromJsonAs keyValuePair (TypeInfo.Tuple (let a = [| keyType; valueType |] in fun () -> a))\n yield tuple ]\n match keyType with\n | TypeInfo.Int32\n | TypeInfo.String\n | TypeInfo.Bool ->\n pairs\n |> unbox<(string * obj) list>\n |> Map.ofList\n |> unbox\n | _ ->\n pairs\n |> unbox<(IStructuralComparable * obj) list>\n |> Map.ofList\n |> unbox\n\n | JArray tuples, TypeInfo.Dictionary getTypes ->\n let (keyType, valueType, originalType) = getTypes()\n let pairs =\n [ for keyValuePair in tuples do\n let tuple = fromJsonAs keyValuePair (TypeInfo.Tuple (fun () -> [| keyType; valueType |]))\n yield tuple ]\n\n let output =\n match keyType with\n | TypeInfo.Union _ -> Dictionary, _>()\n | TypeInfo.Record _ -> Dictionary<{| dummy: int |}, _>() |> unbox\n | _ -> Dictionary() |> unbox\n\n for (key, value) in (unbox<(IStructuralComparable * obj) list> pairs) do output.Add(unbox key, value)\n unbox output\n\n | JObject dict, TypeInfo.Dictionary getTypes ->\n let (keyType, valueType, originalType) = getTypes()\n dict\n |> Map.toList\n |> List.map (fun (key, value) -> fromJsonAs (JString key) keyType, fromJsonAs value valueType )\n |> fun pairs ->\n let output =\n match keyType with\n | TypeInfo.Union _ -> Dictionary, _>()\n | TypeInfo.Record _ -> Dictionary<{| dummy: int |}, _>() |> unbox\n | _ -> Dictionary() |> unbox\n\n for (key, value) in pairs do output.Add(unbox key, value)\n\n unbox output\n\n | JArray items, TypeInfo.HashSet getType ->\n let elemType = getType()\n let hashset =\n match elemType with\n | TypeInfo.Union _ -> HashSet>()\n | TypeInfo.Record _ -> HashSet<{| dummy: int |}>() |> unbox\n | _ -> HashSet() |> unbox\n\n for item in items do\n let deserialized = fromJsonAs item elemType\n hashset.Add(unbox deserialized) |> ignore\n\n unbox hashset\n\n | JObject map, TypeInfo.Map getTypes ->\n let (keyType, valueType) = getTypes()\n // check whether the map is serialized to it's internal representation\n // and convert that to back to a normal map from the data\n match Map.tryFind \"comparer\" map, Map.tryFind \"tree\" map with\n | Some (JObject comparer), Some (JArray tree) when Map.isEmpty comparer ->\n match generateMap (JArray tree) with\n | Some internalMap ->\n let pairs =\n flattenMap internalMap\n |> List.map (fun (key, value) ->\n let nextKey =\n if not (isQuoted key)\n then unbox (fromJsonAs (JString key) keyType)\n else unbox (fromJsonAs (SimpleJson.parseNative key) keyType)\n let nextValue = unbox (fromJsonAs value valueType)\n unbox nextKey, nextValue)\n match keyType with\n | TypeInfo.Int32\n | TypeInfo.String\n | TypeInfo.Bool ->\n pairs\n |> unbox<(string * obj) list>\n |> Map.ofList\n |> unbox\n | _ ->\n pairs\n |> unbox<(IStructuralComparable * obj) list>\n |> Map.ofList\n |> unbox\n\n | None ->\n let inputJson = SimpleJson.toString (JArray tree)\n failwithf \"Could not generate map from JSON\\n %s\" inputJson\n\n // Specific for Fable 3\n | Some (JObject comparer), Some (JObject tree) when Map.isEmpty comparer ->\n let flattenedMap = Map.ofList (flatteFable3Map tree)\n fromJsonAs (JObject flattenedMap) typeInfo\n | _ ->\n // if comparer and tree are not present,\n // assume we are parsing Fable 1 object literal\n // and converting that to map\n let pairs =\n map\n |> Map.toList\n |> List.map (fun (key, value) ->\n let nextKey =\n if not (isQuoted key)\n then\n if Converter.isPrimitive keyType || Converter.enumUnion keyType\n then\n // for primitive type, just read them as string and parse\n unbox (fromJsonAs (JString key) keyType)\n else\n // server-side JSON can still be complex (for complex types)\n // but doesn't have to be quoted, parse again here\n unbox (fromJsonAs (SimpleJson.parseNative key) keyType)\n else\n unbox (fromJsonAs (SimpleJson.parseNative key) keyType)\n let nextValue = unbox (fromJsonAs value valueType)\n unbox nextKey, nextValue)\n\n match keyType with\n | TypeInfo.Int32\n | TypeInfo.String\n | TypeInfo.Bool ->\n pairs\n |> unbox<(string * obj) list>\n |> Map.ofList\n |> unbox\n | _ ->\n pairs\n |> unbox<(IStructuralComparable * obj) list>\n |> Map.ofList\n |> unbox\n | _, TypeInfo.Any getType ->\n let unknownType = getType()\n failwithf \"Cannot convert %s to %s\" (SimpleJson.toString input) unknownType.FullName\n | _ ->\n failwithf \"Cannot convert %s to %s\" (SimpleJson.toString input) (JS.JSON.stringify typeInfo)\n\n let fromJson<'t> json typeInfo =\n unbox<'t> (fromJsonAs json typeInfo)\n\n let quoteText (inputText: string) : string = importDefault \"./quote.js\"\n\n let rec serialize value (typeInfo: TypeInfo) =\n match typeInfo with\n | TypeInfo.String ->\n let content = unbox value\n if isNull content\n then \"null\"\n else quoteText content\n | TypeInfo.Unit -> \"null\"\n | TypeInfo.Float\n | TypeInfo.Float32 ->\n if Double.IsNaN(unbox value)\n then quoteText \"NaN\"\n else string (unbox value)\n | TypeInfo.Char -> quoteText (string (unbox value))\n | TypeInfo.Byte\n | TypeInfo.SByte\n | TypeInfo.UInt16\n | TypeInfo.UInt32\n | TypeInfo.Short\n | TypeInfo.Enum _\n | TypeInfo.TimeSpan\n | TypeInfo.Int32 -> string (unbox value)\n | TypeInfo.UInt64\n | TypeInfo.Long -> betweenQuotes (string (unbox value))\n | TypeInfo.BigInt -> betweenQuotes (string (unbox value))\n | TypeInfo.Decimal -> betweenQuotes (string (unbox value))\n | TypeInfo.Bool -> if unbox value then \"true\" else \"false\"\n | TypeInfo.Guid -> betweenQuotes ((unbox value).ToString())\n | TypeInfo.Uri -> betweenQuotes ((unbox value).ToString())\n | TypeInfo.DateTime -> betweenQuotes ((unbox value).ToString(\"O\"))\n | TypeInfo.DateTimeOffset -> betweenQuotes ((unbox value).ToString(\"O\"))\n#if NET6_0_OR_GREATER\n | TypeInfo.DateOnly -> string (unbox value).DayNumber\n | TypeInfo.TimeOnly -> betweenQuotes (string (unbox value).Ticks)\n#endif\n | TypeInfo.Record getFields ->\n let (fieldTypes, recordType) = getFields()\n let serializedFields =\n fieldTypes\n |> Array.map (fun field ->\n let fieldValue = FSharpValue.GetRecordField(value, field.PropertyInfo)\n sprintf \"\\\"%s\\\": %s\" field.FieldName (serialize fieldValue field.FieldType)\n )\n\n \"{\" + String.concat \", \" serializedFields + \"}\"\n\n | TypeInfo.ResizeArray getElementType ->\n let elementType = getElementType()\n let values =\n value\n |> unbox>\n |> Seq.map (fun element -> serialize element elementType)\n |> String.concat \", \"\n\n \"[\" + values + \"]\"\n\n | TypeInfo.HashSet getElementType ->\n let elementType = getElementType()\n let values =\n value\n |> unbox>\n |> Seq.map (fun element -> serialize element elementType)\n |> String.concat \", \"\n\n \"[\" + values + \"]\"\n\n | TypeInfo.Set getElementType ->\n let elementType = getElementType()\n let values =\n value\n |> unbox>\n |> Seq.map (fun element -> serialize element elementType)\n |> String.concat \", \"\n\n \"[\" + values + \"]\"\n\n | TypeInfo.Array getElementType ->\n let elementType = getElementType()\n let values =\n value\n |> unbox\n |> Array.map (fun element -> serialize element elementType)\n |> String.concat \", \"\n\n \"[\" + values + \"]\"\n\n | TypeInfo.List getElementType ->\n let elementType = getElementType()\n let values =\n value\n |> unbox\n |> List.map (fun element -> serialize element elementType)\n |> String.concat \", \"\n\n \"[\" + values + \"]\"\n\n | TypeInfo.Seq getElementType ->\n let elementType = getElementType()\n let values =\n value\n |> unbox\n |> Seq.toArray\n |> Array.map (fun element -> serialize element elementType)\n |> String.concat \", \"\n\n \"[\" + values + \"]\"\n\n | TypeInfo.Option getElementType ->\n match unbox value with\n | None -> \"null\"\n | Some existingValue -> serialize existingValue (getElementType())\n\n | TypeInfo.Union getCases ->\n let (unionCases, unionType) = getCases()\n let (usedCase, fields) = FSharpValue.GetUnionFields(value, unionType)\n let caseTypes =\n unionCases\n |> Array.find (fun case -> case.CaseName = usedCase.Name)\n |> fun case -> case.CaseTypes\n\n if enumUnion typeInfo || Array.isEmpty caseTypes then\n betweenQuotes usedCase.Name\n elif caseTypes.Length = 1 then\n \"{\" + betweenQuotes usedCase.Name + \": \" + serialize fields.[0] caseTypes.[0] + \"}\"\n else\n let serializedFields =\n caseTypes\n |> Array.mapi (fun index caseType -> serialize fields.[index] caseType)\n |> String.concat \", \"\n\n \"{\" + betweenQuotes usedCase.Name + \": \" + \"[\" + serializedFields + \"] }\"\n\n | TypeInfo.Map getPairTypes ->\n let (keyType, valueType) = getPairTypes()\n\n let serializedValues =\n value\n |> unbox>\n |> Map.toArray\n |> Array.map (fun (key, value) ->\n let serializedKey = serialize key keyType\n let serializedValue = serialize value valueType\n\n if isPrimitive keyType || enumUnion keyType then\n if not (isQuoted serializedKey)\n then (quoteText serializedKey) + \": \" + serializedValue\n else serializedKey + \": \" + serializedValue\n else\n \"[\" + serializedKey + \", \" + serializedValue + \"]\"\n )\n |> String.concat \", \"\n\n if isPrimitive keyType || enumUnion keyType\n then \"{\" + serializedValues + \"}\"\n else \"[\" + serializedValues + \"]\"\n\n | TypeInfo.Dictionary getPairTypes ->\n let (keyType, valueType, originalType) = getPairTypes()\n let serializedValues =\n value\n |> unbox>\n |> Seq.map (fun pair ->\n let (key, value) = pair.Key, pair.Value\n let serializedKey = serialize key keyType\n let serializedValue = serialize value valueType\n\n if isPrimitive keyType || enumUnion keyType then\n if not (isQuoted serializedKey)\n then (betweenQuotes serializedKey) + \": \" + serializedValue\n else serializedKey + \": \" + serializedValue\n else\n \"[\" + serializedKey + \", \" + serializedValue + \"]\"\n )\n |> String.concat \", \"\n\n if isPrimitive keyType || enumUnion keyType\n then \"{\" + serializedValues + \"}\"\n else \"[\" + serializedValues + \"]\"\n\n | TypeInfo.Tuple getTupleTypes ->\n let tupleTypes = getTupleTypes()\n\n if tupleTypes.Length = 1 then\n \"[\" + serialize value tupleTypes.[0] + \"]\"\n else\n let serializedValues =\n value\n |> unbox\n |> Array.mapi (fun index element -> serialize element tupleTypes.[index])\n |> String.concat \", \"\n\n \"[\" + serializedValues + \"]\"\n\n | TypeInfo.Object ->\n SimpleJson.stringify value\n\n | TypeInfo.Any getType ->\n // fallback to low-level serialization\n SimpleJson.stringify value\n\n | _ ->\n \"null\"\n\n[]\nmodule ConverterExtensions =\n type Json with\n\n /// \n /// Serialized the input value object into JSON, uses built-in JSON.stringify and should be used with Fable 2.x or earlier\n /// \n static member stringify (value: obj) : string =\n if Convert.isUsingFable3\n then JS.console.warn(\"It looks like you using the function Json.stringify from Fable.SimpleJson while also using Fable 3 (nagareyama). Please use Json.serialize instead which supports both Fable 3 and Fable 2.x\")\n SimpleJson.stringify value\n\n /// \n /// Serialized the input value into JSON using Reflection. Compatible with Fable 2.x and Fable 3 (codename: nagareyama)\n /// \n static member inline serialize<'t> (value: 't) : string =\n let typeInfo = TypeInfo.createFrom<'t>()\n Convert.serialize value typeInfo\n\n /// Parses the input string as JSON and tries to convert it as the given type argument\n static member inline parseAs<'t> (input: string) : 't =\n match SimpleJson.tryParse input with\n | None -> failwith \"Couldn't parse the input JSON string because it seems to be invalid\"\n | Some inputJson ->\n let typeInfo = TypeInfo.createFrom<'t> ()\n Convert.fromJson<'t> inputJson typeInfo\n\n /// Parses the input string as JSON using native parsing and tries to convert it as the given type argument\n static member inline parseNativeAs<'t> (input: string) : 't =\n let inputJson = SimpleJson.parseNative input\n let typeInfo = TypeInfo.createFrom<'t> ()\n Convert.fromJson<'t> inputJson typeInfo\n\n /// Tries to parse the input string as JSON and tries to convert it as the given type argument, returing a (hopefully) useful error message when it fails\n static member inline tryParseAs<'t> (input: string) : Result<'t, string> =\n try Ok (Json.parseAs<'t> input)\n with | ex -> Error ex.Message\n\n /// Tries to parse the input string as JSON using native parsing and tries to convert it as the given type argument\n static member inline tryParseNativeAs<'t> (input: string) : Result<'t, string> =\n try Ok (Json.parseNativeAs<'t> input)\n with | ex -> Error ex.Message\n\n /// Tries to convert parsed JSON object as the given type parameter argument, this method is used when you want to apply transformations to the JSON object before parsing\n static member inline convertFromJsonAs<'t> (input: Json) : 't =\n let typeInfo = TypeInfo.createFrom<'t> ()\n Convert.fromJson<'t> input typeInfo\n\n /// Tries to convert parsed JSON object as the given type parameter argument, this method is used when you want to apply transformations to the JSON object before parsing\n static member inline tryConvertFromJsonAs<'t> (input: Json) : Result<'t, string> =\n try Ok (Json.convertFromJsonAs<'t> input)\n with | ex -> Error ex.Message\n","export default function quote(inputText) {\n var escapable = /[\\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var meta = {\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\'\n }\n\n escapable.lastIndex = 0;\n return escapable.test(inputText) ?\n '\"' + inputText.replace(escapable, function (a) {\n var c = meta[a];\n return typeof c === 'string' ? c :\n '\\\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n }) + '\"' :\n '\"' + inputText + '\"';\n}","namespace Elmish.Bridge\n\nopen Browser\nopen Browser.Types\nopen Elmish\nopen Fable.Core\nopen Fable.SimpleJson\nopen Fable.Core.JsInterop\n\n//Configures the transport of the custom serializer\ntype SerializerResult =\n | Text of string\n | Binary of byte []\n\n//Internal use only\n[]\n[]\nmodule Helpers =\n let getBaseUrl() =\n let url =\n Dom.window.location.href\n |> Url.URL.Create\n url.protocol <- url.protocol.Replace(\"http\", \"ws\")\n url.hash <- \"\"\n url\n\n let mappings : Map SerializerResult> * (WebSocket option * bool) ref * (string -> (unit -> unit) -> unit)> option ref =\n match Dom.window?Elmish_Bridge_Helpers with\n | None ->\n let cell = ref (Some Map.empty)\n Dom.window?Elmish_Bridge_Helpers <- cell\n cell\n | Some m -> m\n\n let rpcmappings : Map unit) * System.Guid> option ref =\n match Dom.window?Elmish_Bridge_RpcHelpers with\n | None ->\n let cell = ref (Some Map.empty)\n Dom.window?Elmish_Bridge_RpcHelpers <- cell\n cell\n | Some m -> m\n\n/// Configures the mode about how the endpoint is used\ntype UrlMode =\n | Append\n | Replace\n | Raw\n | Calculated of (string -> string -> string)\n\n/// Creates the bridge. Takes the endpoint and an optional message to be dispatched when the connection is closed.\n/// It exposes a method `Send` that can be used to send messages to the server\ntype BridgeConfig<'Msg,'ElmishMsg> =\n { path : string\n whenDown : 'ElmishMsg option\n mapping : 'Msg -> 'ElmishMsg\n customSerializers: Map SerializerResult>\n retryTime : int\n name : string option\n urlMode : UrlMode}\n\n /// Internal use only\n []\n member this.AddSerializer(serializer: 'a -> SerializerResult, typeOrigin: System.Type) =\n let typeOriginName = typeOrigin.FullName.Replace(\"+\",\".\")\n {\n whenDown = this.whenDown\n path = this.path\n mapping = this.mapping\n customSerializers =\n this.customSerializers\n |> Map.add typeOriginName (fun e -> serializer (e :?> 'a))\n retryTime = this.retryTime\n name = this.name\n urlMode = this.urlMode\n }\n\n interface System.IDisposable with\n member t.Dispose() =\n Helpers.mappings.Value\n |> Option.defaultValue Map.empty\n |> Map.tryFind t.name\n |> Option.iter (fun (_, socket, _) ->\n let (skt,_) = socket.Value\n socket.Value <- (None, true)\n skt |> Option.iter (fun e -> e.close())\n )\n\n\n /// Internal use only\n []\n member inline this.Attach dispatch =\n let url =\n match this.urlMode with\n | Replace ->\n let url = Helpers.getBaseUrl()\n url.pathname <- this.path\n url\n | Append ->\n let url = Helpers.getBaseUrl()\n url.pathname <- url.pathname + this.path\n url\n | Calculated f ->\n let url = Helpers.getBaseUrl()\n f url.href this.path |> Url.URL.Create\n | Raw ->\n let url = Browser.Url.URL.Create this.path\n url.protocol <- url.protocol.Replace(\"http\", \"ws\")\n url\n let wsref : (WebSocket option * bool) ref =\n Helpers.mappings.Value\n |> Option.defaultValue Map.empty\n |> Map.tryFind this.name\n |> Option.bind (fun (_, socket, _) ->\n match socket.Value with\n | None, true -> None\n | _ -> Some socket)\n |> Option.defaultValue (ref (None, false))\n let rec websocket timeout server =\n match wsref.Value with\n | Some _, _ | None, true -> ()\n | None, false ->\n let socket = WebSocket.Create server\n wsref.Value <- Some socket, false\n socket.onclose <- fun _ ->\n let (_,closed) = wsref.Value\n wsref.Value <- None, closed\n this.whenDown |> Option.iter dispatch\n if not closed then\n Dom.window.setTimeout\n ((fun () -> websocket timeout server), timeout, ()) |> ignore\n socket.onmessage <- fun e ->\n let message = string e.data\n if message.StartsWith \"R\" then\n let guid = (System.Guid.Parse message.[1..36])\n let json = message.[37..]\n Helpers.rpcmappings.Value\n |> Option.defaultValue Map.empty\n |> Map.tryFind guid\n |> Option.iter(fun (f,og) ->\n f json\n Helpers.rpcmappings.Value <-\n Helpers.rpcmappings.Value\n |> Option.map( fun m ->\n m\n |> Map.remove guid\n |> Map.remove og)\n )\n elif message.StartsWith \"E\" then\n let guid = (System.Guid.Parse message.[1..])\n Helpers.rpcmappings.Value\n |> Option.defaultValue Map.empty\n |> Map.tryFind guid\n |> Option.iter(fun (f,og) ->\n f (Json.serialize (exn(\"Server couldn't process your message\")))\n Helpers.rpcmappings.Value <-\n Helpers.rpcmappings.Value\n |> Option.map( fun m ->\n m\n |> Map.remove guid\n |> Map.remove og)\n )\n else\n Json.tryParseNativeAs(string e.data)\n |> function\n | Ok msg -> msg |> this.mapping |> dispatch\n | _ -> ()\n websocket (this.retryTime * 1000) (url.href.TrimEnd '#')\n Helpers.mappings.Value <-\n Helpers.mappings.Value\n |> Option.defaultValue Map.empty\n |> Map.add this.name\n (this.customSerializers,\n wsref,\n (fun e callback ->\n match wsref.Value with\n | Some socket, _ -> socket.send e\n | None, _ -> callback ()))\n |> Some\n\ntype Bridge private() =\n\n static member private stringTuple = (TypeInfo.Tuple(fun () -> [|TypeInfo.String;TypeInfo.String|]))\n\n /// Internal use only\n []\n static member Sender(server : 'Server, bridgeName, callback, sentType: System.Type) =\n\n let sentTypeName = sentType.FullName.Replace('+','.')\n Helpers.mappings.Value\n |> Option.defaultValue Map.empty\n |> Map.tryFind bridgeName\n |> function\n | None -> callback ()\n | Some (m,_,s) ->\n let serializer =\n m\n |> Map.tryFind sentTypeName\n |> Option.defaultValue\n (fun o -> Convert.serialize o (createTypeInfo sentType) |> Text)\n let serialized =\n match serializer server with\n | Text e -> e\n | Binary b -> System.Convert.ToBase64String b\n s (Convert.serialize (sentTypeName, serialized) Bridge.stringTuple) callback\n\n /// Internal use only\n []\n static member RPCSender(guid, bridgeName, value, sentType: System.Type) =\n\n Helpers.mappings.Value\n |> Option.defaultValue Map.empty\n |> Map.tryFind bridgeName\n |> Option.iter\n (fun (_,_,s) ->\n let typeInfo = createTypeInfo sentType\n let serialized = Convert.serialize value typeInfo\n s (Convert.serialize (sprintf \"RC|%O\" guid, serialized) Bridge.stringTuple) ignore)\n\n static member inline RPCSend(guid: System.Guid, value: 'a, ?name) =\n Bridge.RPCSender(guid, name, value, typeof<'a>)\n\n /// Send the message to the server\n static member inline Send(server : 'Server,?callback) =\n Bridge.Sender(server, None, defaultArg callback ignore, typeof<'Server>)\n\n /// Send the message to the server using a named bridge\n static member inline NamedSend(name:string, server : 'Server,?callback) =\n Bridge.Sender(server, Some name, defaultArg callback ignore, typeof<'Server>)\n\n\n static member inline AskServer(f: IReplyChannel<'T> -> 'Server ) : Async<'T> =\n Bridge.Asker(f, None, typeof<'Server>, typeof<'T> )\n\n static member inline AskNamedServer(f: IReplyChannel<'T> -> 'Server, name ) : Async<'T> =\n Bridge.Asker(f, Some name, typeof<'Server>, typeof<'T> )\n\n\n static member Asker(f, bridgeName, sentType, ttype ) =\n Async.FromContinuations(fun (cont, econt, _) ->\n let guidValue = System.Guid.NewGuid()\n let guidExn = System.Guid.NewGuid()\n let typeInfoT = createTypeInfo ttype\n let typeInfoExn = createTypeInfo typeof\n\n let reply typeInfo cont s =\n let json = SimpleJson.parse s\n Convert.fromJsonAs json typeInfo |> unbox |> cont\n\n Helpers.rpcmappings.Value <-\n Helpers.rpcmappings.Value\n |> Option.defaultValue Map.empty\n |> Map.add guidExn ((fun s -> reply typeInfoExn econt s), guidValue)\n |> Map.add guidValue ((fun s -> reply typeInfoT cont s), guidExn)\n |> Some\n\n let sentTypeName = sentType.FullName.Replace('+','.')\n Helpers.mappings.Value\n |> Option.defaultValue Map.empty\n |> Map.tryFind bridgeName\n |> function\n | None -> econt (exn(\"Bridge does not exist\"))\n | Some (_,_,s) ->\n let serialized = Convert.serialize (f {ValueId = guidValue; ExceptionId = guidExn}) (createTypeInfo sentType)\n s (Convert.serialize (sprintf \"RS|%s\" sentTypeName, serialized) Bridge.stringTuple) (fun () -> econt (exn(\"Socket is closed\")))\n )\n\n[]\nmodule Bridge =\n\n /// Create a new `BridgeConfig` with the set endpoint\n let inline endpoint endpoint =\n {\n path = endpoint\n whenDown = None\n mapping = id\n customSerializers = Map.empty\n retryTime = 1\n name = None\n urlMode = Replace\n }\n\n /// Set a message to be sent when connection is lost.\n let inline withWhenDown msg this =\n { this with whenDown = Some msg }\n\n /// Sets the mode of how the url is calculated\n /// `Replace` : sets the path to the endpoint defined\n /// `Append` : adds the endpoint to the current path\n /// `Raw`: uses the given endpoint as a complete URL\n /// `Calculated` : takes a function that given the current URL and the endpoint, calculates the complete url to the socket\n let inline withUrlMode mode this =\n { this with urlMode = mode }\n\n /// Set a name for this bridge if you want to have a secondary one.\n let inline withName name this =\n { this with name = Some name }\n\n /// Register a custom serializer\n let inline withCustomSerializer (serializer: 'a -> SerializerResult) (this:BridgeConfig<'Msg,'ElmishMsg>) =\n this.AddSerializer(serializer, typeof<'a>)\n\n /// Configure how many seconds before reconnecting when the connection is lost.\n /// Values below 1 are ignored\n let inline withRetryTime sec this =\n if sec < 1 then\n this\n else\n { this with retryTime = sec}\n\n /// Configure a mapping to the top-level message so the server can send an inner message\n /// That enables using just a subset of the messages on the shared project\n let inline withMapping map this =\n {\n whenDown = this.whenDown\n path = this.path\n mapping = map\n customSerializers = this.customSerializers\n retryTime = this.retryTime\n name = this.name\n urlMode = this.urlMode\n }\n\n /// Creates a subscription to be used with `Cmd.OfSub`. That enables starting Bridge with\n /// a configuration obtained after the `Program` has already started\n let inline asSubscription (this:BridgeConfig<_,_>) dispatch =\n this.Attach dispatch\n\n[]\nmodule Program =\n\n /// Apply the `Bridge` to be used with the program.\n /// Preferably use it before any other operation that can change the type of the message passed to the `Program`.\n let inline withBridge endpoint (program : Program<_, _, _, _>) =\n program |> Program.withSubscription (fun _ -> [Bridge.endpoint(endpoint).Attach])\n\n /// Apply the `Bridge` to be used with the program.\n /// Preferably use it before any other operation that can change the type of the message passed to the `Program`.\n let inline withBridgeConfig (config:BridgeConfig<_,_>) (program : Program<_, _, _, _>) =\n program |> Program.withSubscription (fun _ -> [config.Attach])\n\n[]\nmodule Cmd =\n /// Creates a `Cmd` from a server message.\n let inline bridgeSend (msg:'server) : Cmd<'client> = [ fun _ -> Bridge.Send msg ]\n /// Creates a `Cmd` from a server message. Dispatches the client message if the bridge is broken.\n let inline bridgeSendOr (msg:'server) (fallback:'client) : Cmd<'client> = [ fun dispatch -> Bridge.Send(msg, fun () -> dispatch fallback) ]\n /// Creates a `Cmd` from a server message using a named bridge.\n let inline namedBridgeSend name (msg:'server) : Cmd<'client> = [ fun _ -> Bridge.NamedSend(name, msg) ]\n /// Creates a `Cmd` from a server message using a named bridge. Dispatches the client message if the bridge is broken.\n let inline namedBridgeSendOr name (msg:'server) (fallback:'client) : Cmd<'client> = [ fun dispatch -> Bridge.NamedSend(name, msg, fun () -> dispatch fallback) ]\n\n[]\nmodule RPC =\n\n type RPC.IReplyChannel<'T> with\n\n member inline t.Reply(v:'T) =\n Bridge.RPCSend(t.ValueId, v)\n member inline t.ReplyNamed(name, v:'T) =\n Bridge.RPCSend(t.ValueId, v, name)\n\n member inline t.ReplyException(v:exn) =\n Bridge.RPCSend(t.ExceptionId, v)\n member inline t.ReplyExceptionNamed(name, v:'T) =\n Bridge.RPCSend(t.ExceptionId, v, name)\n","module ContractPageModel\r\n\r\nopen FSharpPlus\r\nopen PortalLibs.Client.Components\r\nopen PortalLibs.Client\r\nopen Shared\r\nopen Model\r\nopen Elmish\r\nopen Pages\r\nopen Elmish.Navigation\r\nopen Elmish.Bridge\r\nopen Browser\r\nopen System\r\nopen PortalLibs.Shared.NewTable\r\nopen PortalLibs.Shared\r\nopen Shared.Models\r\n\r\ntype Tab =\r\n | Overview\r\n | ChangeOrders\r\n | ARAndCashFlow\r\n | CostOfConstruction\r\n | CostAndBilling\r\n | ContractProfitFadeTab\r\n | AverageRate\r\n | PurchaseOrders\r\n | AI\r\n | Scheduling\r\n\r\ntype PhaseCode = string\r\n\r\ntype ExpansionRequest<'T> =\r\n | Expand of 'T\r\n | Collapse of 'T\r\n\r\n\r\ntype Model =\r\n { SearchValues: Map\r\n TableStates: Map>\r\n SelectedContractId: int64 option\r\n SelectedTab: Tab\r\n ChangeOrderHeaders: Map\r\n ChangeOrderItems: Map\r\n ChangeOrderItemLines: Map\r\n JobHistories: Map\r\n JobForecasts: Map\r\n JobSchedules: Map\r\n ContractARBuckets: Map\r\n ContractProfitFades: Map\r\n AIJobHistories: Map\r\n JobCosts: Map\r\n JobCostSubs: Map\r\n JobCostDetails: Map\r\n JobCostDetailAttachments: Map>\r\n JobCostDetailAttachmentFiles: Map\r\n JobCostDetailAttachmentFilesVisited: Map\r\n JobCostAttachmentPreview: JobCostAttachmentId option\r\n JobCostAttachmentDownload: JobCostDetailAttachment option\r\n ExpandedCostOfConstructionPhases: Map\r\n ExpandedCostOfConstructionDetails: Map\r\n JobCostAttachmentsModalOpen: (JobCostId * JobCostDetailId) option\r\n PurchaseOrders: Map\r\n PurchaseOrderRequest: PurchaseOrderRequest option }\r\n\r\ntype Msg =\r\n | SearchValueChanged of JobCostId * string option\r\n | TableStateChanged of JobCostId * NewTableNext.Msg\r\n | ContractSelected of ContractId option\r\n | TabSelected of Tab\r\n | ChangeOrderHeadersLoaded of ContractId * ChangeOrderHeader list\r\n | ChangeOrderItemsLoaded of HeaderId * ChangeOrderItem list\r\n | ChangeOrderItemLinesLoaded of ItemId * ChangeOrderLine list\r\n | JobHistories of ContractId * JobHistory list\r\n | JobForecasts of ContractId * JobForecast list\r\n | JobSchedule of ContractId * JobSchedule option\r\n | ContractProfitFade of ContractId * ContractProfitFade option * ContractProfit list\r\n | JobCosts of {| ContractId: ContractId; Jobs: JobPhaseCosts list |}\r\n | JobCostSubs of List\r\n | JobCostDetails of JobCostId * JobCostDetail list\r\n | JobCostDetailsCount of JobCostId * int64\r\n | JobCostDetailsTotal of JobCostId * JobCostDetailField * float\r\n | JobCostDetailAttachments of JobCostId * Map\r\n | BillingRequested\r\n | CostOfConstructionPhaseExpansionToggled of ContractId * PhaseCode\r\n | CostOfConstructionDetailsExpansion of ExpansionRequest\r\n | ShowAttachmentsModal of (JobCostId * JobCostDetailId) option\r\n | PreviewAttachment of JobCostAttachmentId option\r\n | DownloadAttachment of JobCostDetailAttachment option\r\n | JobCostDetailAttachmentContent of JobCostAttachmentId * JobCostAttachmentContent\r\n | ExecuteCostDetailSearch of JobCostId * SearchType\r\n | RequestPurchaseOrderContractId of ContractId option\r\n | PurchaseOrders of ContractId * PurchaseOrder list\r\n | ARBuckets of ContractId * ContractARBucket list\r\n | MassPurchaseOrders of (ContractId * PurchaseOrder list) list\r\n | PurchaseOrderRequestChanged of PurchaseOrderRequest option\r\n | SendPurchaseOrderRequest of PurchaseOrderRequest option\r\n\r\nlet init () =\r\n { SearchValues = Map.empty\r\n TableStates = Map.empty\r\n SelectedContractId = None\r\n SelectedTab = Overview\r\n ChangeOrderHeaders = Map.empty\r\n ChangeOrderItems = Map.empty\r\n ChangeOrderItemLines = Map.empty\r\n JobHistories = Map.empty\r\n JobForecasts = Map.empty\r\n JobSchedules = Map.empty\r\n ContractProfitFades = Map.empty\r\n ContractARBuckets = Map.empty\r\n AIJobHistories = Map.empty\r\n JobCosts = Map.empty\r\n JobCostSubs = Map.empty\r\n JobCostDetails = Map.empty\r\n JobCostDetailAttachments = Map.empty\r\n JobCostDetailAttachmentFiles = Map.empty\r\n JobCostDetailAttachmentFilesVisited = Map.empty\r\n JobCostAttachmentPreview = None\r\n JobCostAttachmentDownload = None\r\n ExpandedCostOfConstructionPhases = Map.empty\r\n ExpandedCostOfConstructionDetails = Map.empty\r\n JobCostAttachmentsModalOpen = None\r\n PurchaseOrders = Map.empty\r\n PurchaseOrderRequest = None },\r\n Cmd.none\r\n\r\nlet randomAiJobHistories contractsOpt contractId (jobHistories: JobHistory list) aiInfos =\r\n let rnd = Random()\r\n let aiInfoOpt = Map.tryFind contractId aiInfos\r\n\r\n let lastHistoryOpt =\r\n jobHistories\r\n |> List.sortBy (fun s -> s.Date)\r\n |> List.tryLast\r\n\r\n let jobOpt =\r\n contractsOpt\r\n >>= Map.tryFind (contractId.ToString())\r\n\r\n match aiInfoOpt, lastHistoryOpt, jobOpt with\r\n | Some aiInfo, Some lastHistory, Some contract ->\r\n match contract.EstCompletion with\r\n | None -> []\r\n | Some estCompletionDate ->\r\n let weeks =\r\n ((estCompletionDate - lastHistory.Date).TotalDays\r\n / 7.0)\r\n\r\n [ 0 .. rnd.Next(\r\n int (\r\n weeks * 0.7\r\n + weeks * 0.2 * (1.0 - aiInfo.SuccessRate)\r\n ),\r\n int (weeks + weeks * 2.0 * (1.0 - aiInfo.SuccessRate))\r\n ) ]\r\n |> List.fold\r\n (fun output week ->\r\n match List.tryLast output with\r\n | None ->\r\n [ { Id = 0L\r\n ContractId = contract.Id\r\n Date = lastHistory.Date.AddDays((week * 7) |> float)\r\n Cost = lastHistory.Cost\r\n Billing = lastHistory.Billing } ]\r\n | Some last ->\r\n ({ Id = 0L\r\n ContractId = contract.Id\r\n Date = lastHistory.Date.AddDays((week * 7) |> float)\r\n Cost =\r\n Math.Round(\r\n (float (rnd.Next(0, 2000))\r\n * 10.0\r\n * (1.2 - aiInfo.SuccessRate))\r\n + last.Cost,\r\n 0\r\n )\r\n Billing =\r\n Math.Round(\r\n (float (rnd.Next(0, 2000))\r\n * 10.0\r\n * (aiInfo.SuccessRate + 0.2))\r\n + last.Billing,\r\n 0\r\n ) }\r\n :: (output |> List.rev))\r\n |> List.rev)\r\n []\r\n | _, _, _ -> []\r\n\r\n\r\nlet searchValue searchModels costId =\r\n searchModels |> Map.tryFind costId >>= id\r\n\r\nlet tableState tableStates costId =\r\n tableStates\r\n |> Map.tryFind costId\r\n |> Option.defaultValue { NewTableNext.init None with Sort = (JobCostDetailField.PostedDate |> Desc |> Some) }\r\n\r\nlet update msg model contracts aiInfos =\r\n match msg with\r\n | ExecuteCostDetailSearch (costId, searchType) ->\r\n let searchValue = searchValue model.SearchValues costId\r\n let tableState = tableState model.TableStates costId\r\n\r\n let searchParams =\r\n { Query =\r\n [ match searchValue |> Option.noneIfEmptyStrOptTrim with\r\n | None -> ()\r\n | Some input ->\r\n { Field = JobCostDetailField.Description\r\n Query = Wildcard(input) } ]\r\n Page = tableState.Page\r\n PageSize = tableState.PageSize\r\n Sort = tableState.Sort\r\n PageCount = false\r\n Totals = [ Units; Hours; Cost ] }\r\n\r\n match searchType with\r\n | Search ->\r\n let searchParamsPageReset =\r\n { searchParams with\r\n Page = 0\r\n PageCount = true }\r\n\r\n (costId, searchParamsPageReset)\r\n |> RSJobCostDetails\r\n |> Bridge.Send\r\n\r\n { model with TableStates = Map.add costId (tableState |> NewTableNext.resetModel) model.TableStates },\r\n Cmd.none\r\n | TableStateChange ->\r\n (costId, searchParams)\r\n |> RSJobCostDetails\r\n |> Bridge.Send\r\n\r\n model, Cmd.none\r\n | PurchaseOrders (contractId, purchaseOrders) ->\r\n { model with PurchaseOrders = Map.add contractId purchaseOrders model.PurchaseOrders }, Cmd.none\r\n | ARBuckets (contractId, buckets) ->\r\n { model with ContractARBuckets = Map.add contractId buckets model.ContractARBuckets }, Cmd.none\r\n | MassPurchaseOrders allPurchaseOrders ->\r\n { model with\r\n PurchaseOrders =\r\n List.fold\r\n (fun purchaseOrders (contractId, contractsPurchaseOrders) ->\r\n Map.add contractId contractsPurchaseOrders purchaseOrders)\r\n model.PurchaseOrders\r\n allPurchaseOrders },\r\n Cmd.none\r\n | SearchValueChanged (costId, searchValue) ->\r\n { model with SearchValues = Map.add costId searchValue model.SearchValues },\r\n Cmd.ofMsg (ExecuteCostDetailSearch(costId, Search))\r\n | TableStateChanged (costId, msg) ->\r\n let tableModel = tableState model.TableStates costId\r\n let newModel, newCmd, externalMsg = NewTableNext.update msg tableModel\r\n\r\n { model with TableStates = Map.add costId newModel model.TableStates },\r\n Cmd.batch [\r\n Cmd.map (fun msg -> TableStateChanged(costId, msg)) newCmd\r\n match externalMsg with\r\n | NewTableNext.PagingOrSortChanged _ -> Cmd.ofMsg (ExecuteCostDetailSearch(costId, TableStateChange))\r\n | _ -> Cmd.none\r\n ]\r\n | ContractSelected contractId ->\r\n let route =\r\n match contractId with\r\n | None -> \"\"\r\n | Some id -> string id\r\n\r\n model,\r\n route\r\n |> Page.Contract\r\n |> toPath\r\n |> Navigation.newUrl\r\n | TabSelected tab ->\r\n { model with\r\n SelectedTab = tab\r\n JobCostAttachmentsModalOpen = None },\r\n Cmd.none\r\n | ChangeOrderHeadersLoaded (contractId, orders) ->\r\n { model with ChangeOrderHeaders = Map.add contractId orders model.ChangeOrderHeaders }, Cmd.none\r\n | ChangeOrderItemsLoaded (orderId, items) ->\r\n { model with ChangeOrderItems = Map.add orderId items model.ChangeOrderItems }, Cmd.none\r\n | ChangeOrderItemLinesLoaded (itemId, lines) ->\r\n { model with ChangeOrderItemLines = Map.add itemId lines model.ChangeOrderItemLines }, Cmd.none\r\n | JobHistories (contractId, histories) ->\r\n { model with\r\n JobHistories = Map.add contractId histories model.JobHistories\r\n AIJobHistories =\r\n Map.add contractId (randomAiJobHistories contracts contractId histories aiInfos) model.AIJobHistories },\r\n Cmd.none\r\n | JobForecasts (contractId, forecasts) ->\r\n { model with\r\n JobForecasts = Map.add contractId forecasts model.JobForecasts },\r\n Cmd.none\r\n | JobSchedule (contractId, schedule) ->\r\n { model with\r\n JobSchedules = Map.add contractId schedule model.JobSchedules },\r\n Cmd.none\r\n | JobCosts v -> { model with JobCosts = Map.add v.ContractId v.Jobs model.JobCosts }, Cmd.none\r\n | ContractProfitFade (contractId, fade, jobProfitList) ->\r\n { model with ContractProfitFades = Map.add contractId (fade, jobProfitList) model.ContractProfitFades },\r\n Cmd.none\r\n | JobCostSubs costs ->\r\n { model with JobCostSubs = model.JobCostSubs |> Map.addRange costs }, Cmd.none\r\n | JobCostDetails (costId, details) ->\r\n { model with\r\n JobCostDetails = Map.add costId details model.JobCostDetails\r\n TableStates =\r\n Map.tryFind costId model.TableStates\r\n |> Option.map (fun state -> Map.add costId { state with IsLoading = false } model.TableStates)\r\n |> Option.defaultValue model.TableStates },\r\n Cmd.none\r\n | JobCostDetailsCount (costId, count) ->\r\n { model with\r\n TableStates =\r\n Map.tryFind costId model.TableStates\r\n |> Option.map (fun state -> Map.add costId { state with TotalItems = count } model.TableStates)\r\n |> Option.defaultValue model.TableStates },\r\n Cmd.none\r\n | JobCostDetailsTotal (costId, field, total) ->\r\n { model with\r\n TableStates =\r\n Map.tryFind costId model.TableStates\r\n |> Option.map (fun state ->\r\n Map.add costId { state with Totals = Map.add field total state.Totals } model.TableStates)\r\n |> Option.defaultValue model.TableStates },\r\n Cmd.none\r\n | JobCostDetailAttachments (costId, attachments) ->\r\n { model with\r\n JobCostDetailAttachments =\r\n model.JobCostDetailAttachments\r\n |> Map.add costId attachments },\r\n Cmd.none\r\n | JobCostDetailAttachmentContent (attachmentId, content) ->\r\n match model.JobCostAttachmentDownload, content with\r\n | Some attachment, Downloaded ->\r\n if attachment.Id = attachmentId then\r\n let fileUrl =\r\n (sprintf\r\n \"/attachments/%s/%s\"\r\n (attachment.Id.ToString())\r\n (attachment.OrigFileName |> Option.emptyStrIfNone))\r\n\r\n window.location.href <- fileUrl\r\n | _, _ -> ()\r\n\r\n { model with\r\n JobCostDetailAttachmentFiles =\r\n model.JobCostDetailAttachmentFiles\r\n |> Map.add attachmentId content\r\n JobCostAttachmentDownload =\r\n match model.JobCostAttachmentDownload with\r\n | Some attachment ->\r\n if attachment.Id = attachmentId then\r\n match content with\r\n | Downloaded -> None\r\n | VistaNotAvailable -> model.JobCostAttachmentDownload\r\n else\r\n model.JobCostAttachmentDownload\r\n | None -> model.JobCostAttachmentDownload },\r\n Cmd.none\r\n | ShowAttachmentsModal ids ->\r\n if Option.isSome ids then\r\n Util.bodyScrollDisable ()\r\n else\r\n Util.bodyScrollEnable ()\r\n\r\n { model with\r\n JobCostAttachmentsModalOpen = ids\r\n JobCostDetailAttachmentFilesVisited = Map.empty\r\n JobCostAttachmentPreview = None },\r\n match ids with\r\n | None -> Cmd.none\r\n | Some (jobCostId, jobCostDetailId) ->\r\n model.JobCostDetailAttachments\r\n |> Map.tryFind jobCostId\r\n |> Option.defaultValue Map.empty\r\n |> Map.tryFind jobCostDetailId\r\n |> Option.defaultValue []\r\n |> (fun attachments ->\r\n match attachments with\r\n | [ attachment ] -> Cmd.ofMsg (attachment.Id |> Some |> PreviewAttachment)\r\n | _ -> Cmd.none)\r\n | BillingRequested ->\r\n match model.SelectedContractId with\r\n | Some id -> id |> RSContractBillingRequested |> Bridge.Send\r\n | None -> ()\r\n\r\n model, Cmd.none\r\n | PreviewAttachment attachmentIdOpt ->\r\n match attachmentIdOpt with\r\n | Some attachmentId ->\r\n attachmentId |> RSJobCostAttachment |> Bridge.Send\r\n Util.scrollIntoView \"ModalCardBody\"\r\n | None -> ()\r\n\r\n { model with\r\n JobCostAttachmentPreview = attachmentIdOpt\r\n JobCostAttachmentDownload = None\r\n JobCostDetailAttachmentFilesVisited =\r\n match attachmentIdOpt with\r\n | Some attachmentId ->\r\n (model.JobCostDetailAttachmentFilesVisited\r\n |> Map.add attachmentId ())\r\n | None -> model.JobCostDetailAttachmentFilesVisited\r\n JobCostDetailAttachmentFiles =\r\n match attachmentIdOpt with\r\n | Some attachmentId ->\r\n match Map.tryFind attachmentId model.JobCostDetailAttachmentFiles with\r\n | None\r\n | Some (VistaNotAvailable _) -> Map.remove attachmentId model.JobCostDetailAttachmentFiles\r\n | Some _ -> model.JobCostDetailAttachmentFiles\r\n | None -> model.JobCostDetailAttachmentFiles },\r\n Cmd.none\r\n | DownloadAttachment attachmentIdOpt ->\r\n match attachmentIdOpt with\r\n | Some attachment ->\r\n attachment.Id\r\n |> RSJobCostAttachment\r\n |> Bridge.Send\r\n\r\n Util.scrollIntoView \"ModalCardBody\"\r\n | None -> ()\r\n\r\n { model with\r\n JobCostAttachmentDownload = attachmentIdOpt\r\n JobCostAttachmentPreview = None\r\n JobCostDetailAttachmentFiles =\r\n match attachmentIdOpt with\r\n | Some attachment ->\r\n match Map.tryFind attachment.Id model.JobCostDetailAttachmentFiles with\r\n | None\r\n | Some (VistaNotAvailable _) -> Map.remove attachment.Id model.JobCostDetailAttachmentFiles\r\n | Some _ -> model.JobCostDetailAttachmentFiles\r\n | None -> model.JobCostDetailAttachmentFiles },\r\n Cmd.none\r\n | CostOfConstructionPhaseExpansionToggled (contractId, phaseId) ->\r\n \r\n let phases =\r\n model.ExpandedCostOfConstructionPhases\r\n |> Map.tryFind contractId\r\n |> Option.defaultValue []\r\n |> fun phases -> match List.contains phaseId phases with\r\n | true -> List.filter (fun x -> x <> phaseId) phases\r\n | false -> phaseId :: phases\r\n |> fun phases -> Map.add contractId phases model.ExpandedCostOfConstructionPhases\r\n\r\n { model with ExpandedCostOfConstructionPhases = phases }, Cmd.none\r\n | CostOfConstructionDetailsExpansion request ->\r\n let details =\r\n match request with\r\n | Expand costId ->\r\n model.ExpandedCostOfConstructionDetails\r\n |> Map.add costId ()\r\n | Collapse costId ->\r\n model.ExpandedCostOfConstructionDetails\r\n |> Map.remove costId\r\n\r\n { model with ExpandedCostOfConstructionDetails = details },\r\n match request with\r\n | Expand costId ->\r\n if not <| Map.containsKey costId model.JobCostDetails then\r\n Cmd.ofMsg (ExecuteCostDetailSearch(costId, Search))\r\n else\r\n Cmd.none\r\n | _ -> Cmd.none\r\n | RequestPurchaseOrderContractId contractIdOpt ->\r\n if Option.isSome contractIdOpt then\r\n Util.bodyScrollDisable ()\r\n else\r\n Util.bodyScrollEnable ()\r\n\r\n { model with\r\n PurchaseOrderRequest =\r\n contractIdOpt |>>\r\n (fun contractId ->\r\n { ContractId = contractId\r\n Description = \"\"\r\n Items = \"\"\r\n Vendor = \"\"\r\n Location = \"\"\r\n Date = DateTime.Now }) },\r\n Cmd.none\r\n \r\n | PurchaseOrderRequestChanged purchaseOrderRequest ->\r\n { model with PurchaseOrderRequest = purchaseOrderRequest }, Cmd.none\r\n \r\n | SendPurchaseOrderRequest purchaseOrderRequestOpt ->\r\n match purchaseOrderRequestOpt with\r\n | Some request ->\r\n { request with Date = request.Date.ToUniversalTime() }\r\n |> RSSendPurchaseOrderRequest\r\n |> Bridge.Send\r\n | None -> ()\r\n \r\n { model with PurchaseOrderRequest = None }, Cmd.none\r\n","module ContractsPageModel\r\n\r\nopen FSharpPlus\r\nopen Elmish\r\nopen Elmish.Bridge\r\nopen Model\r\nopen PortalLibs.Client.Components\r\nopen Shared\r\nopen PortalLibs.Client.Util\r\nopen PortalLibs.Shared.NewTable\r\n\r\ntype ContractsPageViewColumn =\r\n | Company\r\n | Contract\r\n | ProjectManager\r\n | CurrentAmount\r\n | InterestedParties\r\n | Follow\r\n\r\ntype Model =\r\n { SearchboxValue: string option\r\n Contracts: ContractShort list option\r\n TableState: NewTableNext.Model\r\n Active: bool option }\r\n\r\ntype Msg =\r\n | Contracts of ContractShort list\r\n | SearchboxValueChanged of string option\r\n | TableMsg of NewTableNext.Msg\r\n | ContractFollowChanged of ContractShort\r\n | ContractInterestedPartiesChanged of ContractShort\r\n | ContractFollowMassChanged of (ContractId list * bool)\r\n | ActiveChanged of bool option\r\n\r\nlet init () =\r\n { SearchboxValue = None\r\n Contracts = None\r\n TableState = { (NewTableNext.init None) with Sort = Some(Sort.Desc ContractsPageViewColumn.CurrentAmount) }\r\n Active = Some true },\r\n Cmd.none\r\n\r\nlet requestData model =\r\n if Option.isNone model.Contracts then\r\n RSSuperUserContracts {| Active = true |}\r\n |> Bridge.Send\r\n\r\nlet updateContract model (contractChanged: ContractShort) =\r\n { model with\r\n Contracts =\r\n match model.Contracts with\r\n | None -> None\r\n | Some contracts ->\r\n contracts\r\n |>> (fun contract ->\r\n if contract.Id = contractChanged.Id then\r\n contractChanged\r\n else\r\n contract)\r\n |> Some }\r\n\r\nlet update msg model =\r\n match msg with\r\n | SearchboxValueChanged searchValue -> { model with SearchboxValue = searchValue }, Cmd.none\r\n | Contracts contracts -> { model with Contracts = Some contracts }, Cmd.none\r\n | TableMsg msg ->\r\n let newModel, newCmd, _externalMsg =\r\n NewTableNext.update msg model.TableState\r\n\r\n { model with TableState = newModel },\r\n Cmd.map TableMsg newCmd\r\n\r\n | ContractFollowChanged contract ->\r\n Bridge.Send(RSContractFollowChanged contract)\r\n updateContract model contract, Cmd.none\r\n\r\n | ContractInterestedPartiesChanged contract ->\r\n Bridge.Send(RSContractInterestedPartiesChanged contract)\r\n updateContract model contract, Cmd.none\r\n | ContractFollowMassChanged (ids, followed) ->\r\n Bridge.Send(RSContractFollowMassChanged(ids, followed))\r\n\r\n { model with\r\n Contracts =\r\n model.Contracts\r\n |>> (fun contracts ->\r\n contracts\r\n |>> (fun contract ->\r\n if List.contains contract.Id ids then\r\n { contract with Followed = followed }\r\n else\r\n contract)) },\r\n Cmd.none\r\n | ActiveChanged valueOpt ->\r\n RSSuperUserContracts {| Active = valueOpt |> Option.defaultValue false |}\r\n |> Bridge.Send\r\n\r\n { model with\r\n Active = valueOpt\r\n TableState = NewTableNext.resetModel model.TableState\r\n Contracts = None },\r\n Cmd.none\r\n\r\nlet getScrollValue () = getTableScrollPos ()\r\n\r\nlet restoreScrollPos pos = scrollTableToPos pos\r\n","module CompanyPageModel\r\n\r\nopen Elmish\r\nopen Elmish.Bridge\r\nopen Model\r\nopen Shared\r\nopen PortalLibs.Client.Util\r\nopen PortalLibs.Shared\r\nopen System\r\n\r\ntype Model =\r\n { CompanyTabData: CompanyTabRow list option\r\n Companies: Company list option\r\n SelectedCompany: Company option\r\n ExpandedSuperContracts: Map\r\n DateRange: DateTime option * DateTime option }\r\n\r\ntype Msg =\r\n | CompanyTabData of CompanyTabRow list\r\n | Companies of Company list\r\n | SelectedCompanyChanged of Company option\r\n | DateRangeChanged of DateTime option * DateTime option\r\n | ExecuteSearch\r\n | SuperContractToggled of string option\r\n\r\nlet init () =\r\n { CompanyTabData = None\r\n Companies = None\r\n SelectedCompany = None\r\n ExpandedSuperContracts = Map.empty\r\n DateRange = Some(DateTime.Now.AddDays(-30.0)), Some(DateTime.Now.AddDays(1.0))\r\n },\r\n Cmd.none\r\n\r\nlet requestData model =\r\n if Option.isNone model.CompanyTabData then\r\n RSCompanyTabQuery None |> Bridge.Send\r\n\r\n if Option.isNone model.Companies then\r\n RSCompanyTabCompanies |> Bridge.Send\r\n\r\n\r\nlet update msg model =\r\n match msg with\r\n | CompanyTabData entries ->\r\n { model with\r\n ExpandedSuperContracts = Map.empty\r\n SelectedCompany =\r\n if not entries.IsEmpty\r\n && model.SelectedCompany.IsNone then\r\n Some\r\n { Name = entries.Head.CompanyName\r\n Co = entries.Head.Co }\r\n else\r\n model.SelectedCompany\r\n CompanyTabData = Some entries },\r\n Cmd.none\r\n | Companies entries -> { model with Companies = Some entries\r\n SelectedCompany =\r\n if not entries.IsEmpty\r\n && model.SelectedCompany.IsNone then\r\n Some\r\n { Name = entries.Head.Name\r\n Co = entries.Head.Co }\r\n else\r\n model.SelectedCompany }, Cmd.none\r\n | SelectedCompanyChanged co -> { model with SelectedCompany = co }, Cmd.ofMsg ExecuteSearch\r\n | DateRangeChanged (fromOpt, toOpt) ->\r\n { model with\r\n DateRange = fromOpt, toOpt },\r\n Cmd.ofMsg ExecuteSearch\r\n | ExecuteSearch ->\r\n model.SelectedCompany\r\n |> Option.iter\r\n (fun co ->\r\n let fromOpt, toOpt = model.DateRange\r\n\r\n fromOpt\r\n |> Option.iter\r\n (fun dateFrom ->\r\n toOpt\r\n |> Option.iter\r\n (fun dateTo ->\r\n RSCompanyTabQuery(Some(co.Co, dateFrom, dateTo))\r\n |> Bridge.Send)))\r\n\r\n { model with CompanyTabData = None }, Cmd.none\r\n | SuperContractToggled super ->\r\n let contracts =\r\n if Map.containsKey super model.ExpandedSuperContracts then\r\n Map.remove super model.ExpandedSuperContracts\r\n else\r\n Map.add super () model.ExpandedSuperContracts\r\n\r\n { model with ExpandedSuperContracts = contracts },\r\n Cmd.none\r\n\r\nlet getScrollValue () = getTableScrollPos ()\r\n\r\nlet restoreScrollPos pos = scrollTableToPos pos\r\n","namespace Thoth.Json\nopen System.Text.RegularExpressions\n\ntype JsonValue = obj\n\ntype ErrorReason =\n | BadPrimitive of string * JsonValue\n | BadPrimitiveExtra of string * JsonValue * string\n | BadType of string * JsonValue\n | BadField of string * JsonValue\n | BadPath of string * JsonValue * string\n | TooSmallArray of string * JsonValue\n | FailMessage of string\n | BadOneOf of string list\n\ntype CaseStrategy =\n | PascalCase\n | CamelCase\n | SnakeCase\n\ntype DecoderError = string * ErrorReason\n\ntype Decoder<'T> = string -> JsonValue -> Result<'T, DecoderError>\n\ntype Encoder<'T> = 'T -> JsonValue\n\ntype BoxedDecoder = Decoder\n\ntype BoxedEncoder = Encoder\n\ntype ExtraCoders =\n { Hash: string\n Coders: Map }\n\nmodule internal Util =\n open System.Collections.Generic\n\n type Cache<'Value>() =\n let cache = Dictionary()\n member __.GetOrAdd(key, factory) =\n match cache.TryGetValue(key) with\n | true, x -> x\n | false, _ ->\n let x = factory()\n cache.Add(key, x)\n x\n\n // Tree shaking will remove this if not used\n // so no need to make them lazy in Fable\n let CachedEncoders = Cache()\n let CachedDecoders = Cache()\n\n module Casing =\n let lowerFirst (str : string) = str.[..0].ToLowerInvariant() + str.[1..]\n let convert caseStrategy fieldName =\n match caseStrategy with\n | CamelCase -> lowerFirst fieldName\n | SnakeCase -> Regex.Replace(lowerFirst fieldName, \"[A-Z]\",\"_$0\").ToLowerInvariant()\n | PascalCase -> fieldName","\nnamespace Thoth.Json\nopen System.Text.RegularExpressions\n\n[]\nmodule Decode =\n\n open System.Globalization\n open Fable.Core\n open Fable.Core.JsInterop\n\n module Helpers =\n []\n let jsTypeof (_ : JsonValue) : string = jsNative\n\n []\n let isSyntaxError (_ : JsonValue) : bool = jsNative\n\n let inline getField (fieldName: string) (o: JsonValue) = o?(fieldName)\n let inline isString (o: JsonValue) : bool = o :? string\n\n let inline isBoolean (o: JsonValue) : bool = o :? bool\n\n let inline isNumber (o: JsonValue) : bool = jsTypeof o = \"number\"\n\n let inline isArray (o: JsonValue) : bool = JS.Constructors.Array.isArray(o)\n\n []\n let isObject (_ : JsonValue) : bool = jsNative\n\n let inline isNaN (o: JsonValue) : bool = JS.Constructors.Number.isNaN(!!o)\n\n let inline isNullValue (o: JsonValue): bool = isNull o\n\n /// is the value an integer? This returns false for 1.1, NaN, Infinite, ...\n []\n let isIntegralValue (_: JsonValue) : bool = jsNative\n\n []\n let isBetweenInclusive(_v: JsonValue, _min: obj, _max: obj) = jsNative\n\n []\n let isIntFinite (_: JsonValue) : bool = jsNative\n\n let isUndefined (o: JsonValue): bool = jsTypeof o = \"undefined\"\n\n []\n let anyToString (_: JsonValue) : string = jsNative\n\n let inline isFunction (o: JsonValue) : bool = jsTypeof o = \"function\"\n\n let inline objectKeys (o: JsonValue) : string seq = upcast JS.Constructors.Object.keys(o)\n let inline asBool (o: JsonValue): bool = unbox o\n let inline asInt (o: JsonValue): int = unbox o\n let inline asFloat (o: JsonValue): float = unbox o\n let inline asFloat32 (o: JsonValue): float32 = unbox o\n let inline asString (o: JsonValue): string = unbox o\n let inline asArray (o: JsonValue): JsonValue[] = unbox o\n\n let private genericMsg msg value newLine =\n try\n \"Expecting \"\n + msg\n + \" but instead got:\"\n + (if newLine then \"\\n\" else \" \")\n + (Helpers.anyToString value)\n with\n | _ ->\n \"Expecting \"\n + msg\n + \" but decoder failed. Couldn't report given value due to circular structure.\"\n + (if newLine then \"\\n\" else \" \")\n\n let private errorToString (path : string, error) =\n let reason =\n match error with\n | BadPrimitive (msg, value) ->\n genericMsg msg value false\n | BadType (msg, value) ->\n genericMsg msg value true\n | BadPrimitiveExtra (msg, value, reason) ->\n genericMsg msg value false + \"\\nReason: \" + reason\n | BadField (msg, value) ->\n genericMsg msg value true\n | BadPath (msg, value, fieldName) ->\n genericMsg msg value true + (\"\\nNode `\" + fieldName + \"` is unkown.\")\n | TooSmallArray (msg, value) ->\n \"Expecting \" + msg + \".\\n\" + (Helpers.anyToString value)\n | BadOneOf messages ->\n \"The following errors were found:\\n\\n\" + String.concat \"\\n\\n\" messages\n | FailMessage msg ->\n \"The following `failure` occurred with the decoder: \" + msg\n\n match error with\n | BadOneOf _ ->\n // Don't need to show the path here because each error case will show it's own path\n reason\n | _ ->\n \"Error at: `\" + path + \"`\\n\" + reason\n\n ///////////////\n // Runners ///\n /////////////\n\n /// \n /// Runs the decoder against the given JSON value.\n ///\n /// If the decoder fails, it reports the error prefixed with the given path.\n ///\n /// \n /// \n /// \n /// module Decode =\n /// let fromRootValue (decoder : Decoder<'T>) =\n /// Decode.fromValue \"$\" decoder\n /// \n /// \n /// Path used to report the error\n /// Decoder to apply\n /// JSON value to decoder\n /// \n /// Returns Ok if the decoder succeeds, otherwise Error with the error message.\n /// \n let fromValue (path : string) (decoder : Decoder<'T>) =\n fun value ->\n match decoder path value with\n | Ok success ->\n Ok success\n | Error error ->\n Error (errorToString error)\n\n /// \n /// Parse the provided string in as JSON and then run the decoder against it.\n /// \n /// Decoder to apply\n /// JSON string to decode\n /// \n /// Returns Ok if the decoder succeeds, otherwise Error with the error message.\n /// \n let fromString (decoder : Decoder<'T>) =\n fun value ->\n try\n let json = JS.JSON.parse value\n fromValue \"$\" decoder json\n with\n | ex when Helpers.isSyntaxError ex ->\n Error(\"Given an invalid JSON: \" + ex.Message)\n\n /// \n /// Parse the provided string in as JSON and then run the decoder against it.\n /// \n /// Decoder to apply\n /// JSON string to decode\n /// \n /// Return the decoded value if the decoder succeeds, otherwise throws an exception.\n /// \n let unsafeFromString (decoder : Decoder<'T>) =\n fun value ->\n match fromString decoder value with\n | Ok x -> x\n | Error msg -> failwith msg\n\n []\n let decodeValue (path : string) (decoder : Decoder<'T>) = fromValue path decoder\n\n []\n let decodeString (decoder : Decoder<'T>) = fromString decoder\n\n //////////////////\n // Primitives ///\n ////////////////\n\n let string : Decoder =\n fun path value ->\n if Helpers.isString value then\n Ok(Helpers.asString value)\n else\n (path, BadPrimitive(\"a string\", value)) |> Error\n\n let char : Decoder =\n fun path value ->\n if Helpers.isString value then\n let str = Helpers.asString value\n if str.Length = 1 then\n Ok(str.[0])\n else\n (path, BadPrimitive(\"a single character string\", value)) |> Error\n else\n (path, BadPrimitive(\"a char\", value)) |> Error\n\n let guid : Decoder =\n fun path value ->\n if Helpers.isString value then\n match System.Guid.TryParse (Helpers.asString value) with\n | true, x -> Ok x\n | _ -> (path, BadPrimitive(\"a guid\", value)) |> Error\n else (path, BadPrimitive(\"a guid\", value)) |> Error\n\n let unit : Decoder =\n fun path value ->\n if Helpers.isNullValue value then\n Ok ()\n else\n (path, BadPrimitive(\"null\", value)) |> Error\n\n let inline private integral\n (name : string)\n (tryParse : (string -> bool * 'T))\n (min : unit->'T)\n (max : unit->'T)\n (conv : float -> 'T) : Decoder< 'T > =\n\n fun path value ->\n if Helpers.isNumber value then\n let value : float = unbox value\n if Helpers.isIntegralValue value then\n if (float(min())) <= value && value <= (float(max())) then\n Ok(conv value)\n else\n (path, BadPrimitiveExtra(name, value, \"Value was either too large or too small for \" + name)) |> Error\n else\n (path, BadPrimitiveExtra(name, value, \"Value is not an integral value\")) |> Error\n elif Helpers.isString value then\n match tryParse (Helpers.asString value) with\n | true, x -> Ok x\n | _ -> (path, BadPrimitive(name, value)) |> Error\n else\n (path, BadPrimitive(name, value)) |> Error\n\n let sbyte : Decoder =\n integral\n \"a sbyte\"\n System.SByte.TryParse\n (fun () -> System.SByte.MinValue)\n (fun () -> System.SByte.MaxValue)\n sbyte\n\n /// Alias to Decode.uint8\n let byte : Decoder =\n integral\n \"a byte\"\n System.Byte.TryParse\n (fun () -> System.Byte.MinValue)\n (fun () -> System.Byte.MaxValue)\n byte\n\n let int16 : Decoder =\n integral\n \"an int16\"\n System.Int16.TryParse\n (fun () -> System.Int16.MinValue)\n (fun () -> System.Int16.MaxValue)\n int16\n\n let uint16 : Decoder =\n integral\n \"an uint16\"\n System.UInt16.TryParse\n (fun () -> System.UInt16.MinValue)\n (fun () -> System.UInt16.MaxValue)\n uint16\n\n let int : Decoder =\n integral\n \"an int\"\n System.Int32.TryParse\n (fun () -> System.Int32.MinValue)\n (fun () -> System.Int32.MaxValue)\n int\n\n let uint32 : Decoder =\n integral\n \"an uint32\"\n System.UInt32.TryParse\n (fun () -> System.UInt32.MinValue)\n (fun () -> System.UInt32.MaxValue)\n uint32\n\n let int64 : Decoder =\n integral\n \"an int64\"\n System.Int64.TryParse\n (fun () -> System.Int64.MinValue)\n (fun () -> System.Int64.MaxValue)\n int64\n\n let uint64 : Decoder =\n integral\n \"an uint64\"\n System.UInt64.TryParse\n (fun () -> System.UInt64.MinValue)\n (fun () -> System.UInt64.MaxValue)\n uint64\n\n let bigint : Decoder =\n fun path value ->\n if Helpers.isNumber value then\n Helpers.asInt value |> bigint |> Ok\n elif Helpers.isString value then\n // TODO: BigInt.TryParse has been added in Fable 2.1.4\n // Don't use it for now to support lower Fable versions\n try\n bigint.Parse (Helpers.asString value) |> Ok\n with _ ->\n (path, BadPrimitive(\"a bigint\", value)) |> Error\n else\n (path, BadPrimitive(\"a bigint\", value)) |> Error\n\n let bool : Decoder =\n fun path value ->\n if Helpers.isBoolean value then\n Ok(Helpers.asBool value)\n else\n (path, BadPrimitive(\"a boolean\", value)) |> Error\n\n let float : Decoder =\n fun path value ->\n if Helpers.isNumber value then\n Ok(Helpers.asFloat value)\n else\n (path, BadPrimitive(\"a float\", value)) |> Error\n\n let float32 : Decoder =\n fun path value ->\n if Helpers.isNumber value then\n Ok(Helpers.asFloat32 value)\n else\n (path, BadPrimitive(\"a float32\", value)) |> Error\n\n let decimal : Decoder =\n fun path value ->\n if Helpers.isNumber value then\n Helpers.asFloat value |> decimal |> Ok\n elif Helpers.isString value then\n match System.Decimal.TryParse (Helpers.asString value) with\n | true, x -> Ok x\n | _ -> (path, BadPrimitive(\"a decimal\", value)) |> Error\n else\n (path, BadPrimitive(\"a decimal\", value)) |> Error\n\n []\n let datetime : Decoder =\n fun path value ->\n if Helpers.isString value then\n match System.DateTime.TryParse (Helpers.asString value) with\n | true, x -> x.ToUniversalTime() |> Ok\n | _ -> (path, BadPrimitive(\"a datetime\", value)) |> Error\n else\n (path, BadPrimitive(\"a datetime\", value)) |> Error\n\n /// Decode a System.DateTime value using Sytem.DateTime.TryParse, then convert it to UTC.\n let datetimeUtc : Decoder =\n fun path value ->\n if Helpers.isString value then\n match System.DateTime.TryParse (Helpers.asString value) with\n | true, x -> x.ToUniversalTime() |> Ok\n | _ -> (path, BadPrimitive(\"a datetime\", value)) |> Error\n else\n (path, BadPrimitive(\"a datetime\", value)) |> Error\n\n /// Decode a System.DateTime with DateTime.TryParse; uses default System.DateTimeStyles.\n let datetimeLocal : Decoder =\n fun path value ->\n if Helpers.isString value then\n match System.DateTime.TryParse (Helpers.asString value) with\n | true, x -> x |> Ok\n | _ -> (path, BadPrimitive(\"a datetime\", value)) |> Error\n else\n (path, BadPrimitive(\"a datetime\", value)) |> Error\n\n let datetimeOffset : Decoder =\n fun path value ->\n if Helpers.isString value then\n match System.DateTimeOffset.TryParse(Helpers.asString value) with\n | true, x -> Ok x\n | _ -> (path, BadPrimitive(\"a datetimeoffset\", value)) |> Error\n else\n (path, BadPrimitive(\"a datetime\", value)) |> Error\n\n let timespan : Decoder =\n fun path value ->\n if Helpers.isString value then\n match System.TimeSpan.TryParse(Helpers.asString value) with\n | true, x -> Ok x\n | _ -> (path, BadPrimitive(\"a timespan\", value)) |> Error\n else\n (path, BadPrimitive(\"a timespan\", value)) |> Error\n\n /////////////////////////\n // Object primitives ///\n ///////////////////////\n\n let private decodeMaybeNull path (decoder : Decoder<'T>) value =\n // The decoder may be an option decoder so give it an opportunity to check null values\n match decoder path value with\n | Ok v -> Ok(Some v)\n | Error _ when Helpers.isNullValue value -> Ok None\n | Error er -> Error er\n\n let optional (fieldName : string) (decoder : Decoder<'value>) : Decoder<'value option> =\n fun path value ->\n if Helpers.isObject value then\n let fieldValue = Helpers.getField fieldName value\n if Helpers.isUndefined fieldValue then Ok None\n else decodeMaybeNull (path + \".\" + fieldName) decoder fieldValue\n else\n Error(path, BadType(\"an object\", value))\n\n let private badPathError fieldNames currentPath value =\n let currentPath = defaultArg currentPath (\"$\"::fieldNames |> String.concat \".\")\n let msg = \"an object with path `\" + (String.concat \".\" fieldNames) + \"`\"\n Error(currentPath, BadPath (msg, value, List.tryLast fieldNames |> Option.defaultValue \"\"))\n\n let optionalAt (fieldNames : string list) (decoder : Decoder<'value>) : Decoder<'value option> =\n fun firstPath firstValue ->\n ((firstPath, firstValue, None), fieldNames)\n ||> List.fold (fun (curPath, curValue, res) field ->\n match res with\n | Some _ -> curPath, curValue, res\n | None ->\n if Helpers.isNullValue curValue then\n curPath, curValue, Some (Ok None)\n elif Helpers.isObject curValue then\n let curValue = Helpers.getField field curValue\n curPath + \".\" + field, curValue, None\n else\n let res = Error(curPath, BadType(\"an object\", curValue))\n curPath, curValue, Some res)\n |> function\n | _, _, Some res -> res\n | lastPath, lastValue, None ->\n if Helpers.isUndefined lastValue then Ok None\n else decodeMaybeNull lastPath decoder lastValue\n\n let field (fieldName: string) (decoder : Decoder<'value>) : Decoder<'value> =\n fun path value ->\n if Helpers.isObject value then\n let fieldValue = Helpers.getField fieldName value\n if Helpers.isUndefined fieldValue then\n Error(path, BadField (\"an object with a field named `\" + fieldName + \"`\", value))\n else\n decoder (path + \".\" + fieldName) fieldValue\n else\n Error(path, BadType(\"an object\", value))\n\n let at (fieldNames: string list) (decoder : Decoder<'value>) : Decoder<'value> =\n fun firstPath firstValue ->\n ((firstPath, firstValue, None), fieldNames)\n ||> List.fold (fun (curPath, curValue, res) field ->\n match res with\n | Some _ -> curPath, curValue, res\n | None ->\n if Helpers.isNullValue curValue then\n let res = badPathError fieldNames (Some curPath) firstValue\n curPath, curValue, Some res\n elif Helpers.isObject curValue then\n let curValue = Helpers.getField field curValue\n if Helpers.isUndefined curValue then\n let res = badPathError fieldNames None firstValue\n curPath, curValue, Some res\n else\n curPath + \".\" + field, curValue, None\n else\n let res = Error(curPath, BadType(\"an object\", curValue))\n curPath, curValue, Some res)\n |> function\n | _, _, Some res -> res\n | lastPath, lastValue, None ->\n decoder lastPath lastValue\n\n let index (requestedIndex: int) (decoder : Decoder<'value>) : Decoder<'value> =\n fun path value ->\n let currentPath = path + \".[\" + (Operators.string requestedIndex) + \"]\"\n if Helpers.isArray value then\n let vArray = Helpers.asArray value\n if requestedIndex < vArray.Length then\n decoder currentPath (vArray.[requestedIndex])\n else\n let msg =\n \"a longer array. Need index `\"\n + (requestedIndex.ToString())\n + \"` but there are only `\"\n + (vArray.Length.ToString())\n + \"` entries\"\n\n (currentPath, TooSmallArray(msg, value))\n |> Error\n else\n (currentPath, BadPrimitive(\"an array\", value))\n |> Error\n\n let option (decoder : Decoder<'value>) : Decoder<'value option> =\n fun path value ->\n if Helpers.isNullValue value then Ok None\n else decoder path value |> Result.map Some\n\n //////////////////////\n // Data structure ///\n ////////////////////\n\n let list (decoder : Decoder<'value>) : Decoder<'value list> =\n fun path value ->\n if Helpers.isArray value then\n let mutable i = -1\n let tokens = Helpers.asArray value\n (Ok [], tokens) ||> Array.fold (fun acc value ->\n i <- i + 1\n match acc with\n | Error _ -> acc\n | Ok acc ->\n match decoder (path + \".[\" + (i.ToString()) + \"]\") value with\n | Error er -> Error er\n | Ok value -> Ok (value::acc))\n |> Result.map List.rev\n else\n (path, BadPrimitive (\"a list\", value))\n |> Error\n\n let seq (decoder : Decoder<'value>) : Decoder<'value seq> =\n fun path value ->\n if Helpers.isArray value then\n let mutable i = -1\n let tokens = Helpers.asArray value\n (Ok (seq []), tokens) ||> Array.fold (fun acc value ->\n i <- i + 1\n match acc with\n | Error _ -> acc\n | Ok acc ->\n match decoder (path + \".[\" + (i.ToString()) + \"]\") value with\n | Error er -> Error er\n | Ok value -> Ok (Seq.append [value] acc))\n |> Result.map Seq.rev\n else\n (path, BadPrimitive (\"a seq\", value))\n |> Error\n\n let array (decoder : Decoder<'value>) : Decoder<'value array> =\n fun path value ->\n if Helpers.isArray value then\n let mutable i = -1\n let tokens = Helpers.asArray value\n let arr = Array.zeroCreate tokens.Length\n (Ok arr, tokens) ||> Array.fold (fun acc value ->\n i <- i + 1\n match acc with\n | Error _ -> acc\n | Ok acc ->\n match decoder (path + \".[\" + (i.ToString()) + \"]\") value with\n | Error er -> Error er\n | Ok value -> acc.[i] <- value; Ok acc)\n else\n (path, BadPrimitive (\"an array\", value))\n |> Error\n\n let keys: Decoder =\n fun path value ->\n if Helpers.isObject value then\n Helpers.objectKeys value |> List.ofSeq |> Ok\n else\n (path, BadPrimitive (\"an object\", value))\n |> Error\n\n let keyValuePairs (decoder : Decoder<'value>) : Decoder<(string * 'value) list> =\n fun path value ->\n match keys path value with\n | Ok objectKeys ->\n (Ok [], objectKeys) ||> List.fold (fun acc prop ->\n match acc with\n | Error _ -> acc\n | Ok acc ->\n match Helpers.getField prop value |> decoder path with\n | Error er -> Error er\n | Ok value -> (prop, value)::acc |> Ok)\n |> Result.map List.rev\n | Error e -> Error e\n\n //////////////////////////////\n // Inconsistent Structure ///\n ////////////////////////////\n\n let oneOf (decoders : Decoder<'value> list) : Decoder<'value> =\n fun path value ->\n let rec runner (decoders : Decoder<'value> list) (errors : string list) =\n match decoders with\n | head::tail ->\n match fromValue path head value with\n | Ok v ->\n Ok v\n | Error error -> runner tail (errors @ [error])\n | [] -> (path, BadOneOf errors) |> Error\n\n runner decoders []\n\n //////////////////////\n // Fancy decoding ///\n ////////////////////\n\n let nil (output : 'a) : Decoder<'a> =\n fun path value ->\n if Helpers.isNullValue value then\n Ok output\n else\n (path, BadPrimitive(\"null\", value)) |> Error\n\n let value _ v = Ok v\n\n let succeed (output : 'a) : Decoder<'a> =\n fun _ _ ->\n Ok output\n\n let fail (msg: string) : Decoder<'a> =\n fun path _ ->\n (path, FailMessage msg) |> Error\n\n let andThen (cb: 'a -> Decoder<'b>) (decoder : Decoder<'a>) : Decoder<'b> =\n fun path value ->\n match decoder path value with\n | Error error -> Error error\n | Ok result -> cb result path value\n\n let all (decoders: Decoder<'a> list): Decoder<'a list> =\n fun path value ->\n let rec runner (decoders: Decoder<'a> list) (values: 'a list) =\n match decoders with\n | decoder :: tail ->\n match decoder path value with\n | Ok value -> runner tail (values @ [ value ])\n | Error error -> Error error\n | [] -> Ok values\n\n runner decoders []\n\n /////////////////////\n // Map functions ///\n ///////////////////\n\n let map\n (ctor : 'a -> 'value)\n (d1 : Decoder<'a>) : Decoder<'value> =\n fun path value ->\n match d1 path value with\n | Ok v1 -> Ok (ctor v1)\n | Error er -> Error er\n\n let map2\n (ctor : 'a -> 'b -> 'value)\n (d1 : Decoder<'a>)\n (d2 : Decoder<'b>) : Decoder<'value> =\n fun path value ->\n match d1 path value, d2 path value with\n | Ok v1, Ok v2 -> Ok (ctor v1 v2)\n | Error er,_ -> Error er\n | _,Error er -> Error er\n\n let map3\n (ctor : 'a -> 'b -> 'c -> 'value)\n (d1 : Decoder<'a>)\n (d2 : Decoder<'b>)\n (d3 : Decoder<'c>) : Decoder<'value> =\n fun path value ->\n match d1 path value, d2 path value, d3 path value with\n | Ok v1, Ok v2, Ok v3 -> Ok (ctor v1 v2 v3)\n | Error er,_,_ -> Error er\n | _,Error er,_ -> Error er\n | _,_,Error er -> Error er\n\n let map4\n (ctor : 'a -> 'b -> 'c -> 'd -> 'value)\n (d1 : Decoder<'a>)\n (d2 : Decoder<'b>)\n (d3 : Decoder<'c>)\n (d4 : Decoder<'d>) : Decoder<'value> =\n fun path value ->\n match d1 path value, d2 path value, d3 path value, d4 path value with\n | Ok v1, Ok v2, Ok v3, Ok v4 -> Ok (ctor v1 v2 v3 v4)\n | Error er,_,_,_ -> Error er\n | _,Error er,_,_ -> Error er\n | _,_,Error er,_ -> Error er\n | _,_,_,Error er -> Error er\n\n let map5\n (ctor : 'a -> 'b -> 'c -> 'd -> 'e -> 'value)\n (d1 : Decoder<'a>)\n (d2 : Decoder<'b>)\n (d3 : Decoder<'c>)\n (d4 : Decoder<'d>)\n (d5 : Decoder<'e>) : Decoder<'value> =\n fun path value ->\n match d1 path value, d2 path value, d3 path value, d4 path value, d5 path value with\n | Ok v1, Ok v2, Ok v3, Ok v4, Ok v5 -> Ok (ctor v1 v2 v3 v4 v5)\n | Error er,_,_,_,_ -> Error er\n | _,Error er,_,_,_ -> Error er\n | _,_,Error er,_,_ -> Error er\n | _,_,_,Error er,_ -> Error er\n | _,_,_,_,Error er -> Error er\n\n let map6\n (ctor : 'a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'value)\n (d1 : Decoder<'a>)\n (d2 : Decoder<'b>)\n (d3 : Decoder<'c>)\n (d4 : Decoder<'d>)\n (d5 : Decoder<'e>)\n (d6 : Decoder<'f>) : Decoder<'value> =\n fun path value ->\n match d1 path value, d2 path value, d3 path value, d4 path value, d5 path value, d6 path value with\n | Ok v1, Ok v2, Ok v3, Ok v4, Ok v5, Ok v6 -> Ok (ctor v1 v2 v3 v4 v5 v6)\n | Error er,_,_,_,_,_ -> Error er\n | _,Error er,_,_,_,_ -> Error er\n | _,_,Error er,_,_,_ -> Error er\n | _,_,_,Error er,_,_ -> Error er\n | _,_,_,_,Error er,_ -> Error er\n | _,_,_,_,_,Error er -> Error er\n\n let map7\n (ctor : 'a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'value)\n (d1 : Decoder<'a>)\n (d2 : Decoder<'b>)\n (d3 : Decoder<'c>)\n (d4 : Decoder<'d>)\n (d5 : Decoder<'e>)\n (d6 : Decoder<'f>)\n (d7 : Decoder<'g>) : Decoder<'value> =\n fun path value ->\n match d1 path value, d2 path value, d3 path value, d4 path value, d5 path value, d6 path value, d7 path value with\n | Ok v1, Ok v2, Ok v3, Ok v4, Ok v5, Ok v6, Ok v7 -> Ok (ctor v1 v2 v3 v4 v5 v6 v7)\n | Error er,_,_,_,_,_,_ -> Error er\n | _,Error er,_,_,_,_,_ -> Error er\n | _,_,Error er,_,_,_,_ -> Error er\n | _,_,_,Error er,_,_,_ -> Error er\n | _,_,_,_,Error er,_,_ -> Error er\n | _,_,_,_,_,Error er,_ -> Error er\n | _,_,_,_,_,_,Error er -> Error er\n\n let map8\n (ctor : 'a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'value)\n (d1 : Decoder<'a>)\n (d2 : Decoder<'b>)\n (d3 : Decoder<'c>)\n (d4 : Decoder<'d>)\n (d5 : Decoder<'e>)\n (d6 : Decoder<'f>)\n (d7 : Decoder<'g>)\n (d8 : Decoder<'h>) : Decoder<'value> =\n fun path value ->\n match d1 path value, d2 path value, d3 path value, d4 path value, d5 path value, d6 path value, d7 path value, d8 path value with\n | Ok v1, Ok v2, Ok v3, Ok v4, Ok v5, Ok v6, Ok v7, Ok v8 -> Ok (ctor v1 v2 v3 v4 v5 v6 v7 v8)\n | Error er,_,_,_,_,_,_,_ -> Error er\n | _,Error er,_,_,_,_,_,_ -> Error er\n | _,_,Error er,_,_,_,_,_ -> Error er\n | _,_,_,Error er,_,_,_,_ -> Error er\n | _,_,_,_,Error er,_,_,_ -> Error er\n | _,_,_,_,_,Error er,_,_ -> Error er\n | _,_,_,_,_,_,Error er,_ -> Error er\n | _,_,_,_,_,_,_,Error er -> Error er\n\n //////////////////////\n // Object builder ///\n ////////////////////\n\n /// \n /// Allow to incrementally apply a decoder, for building large objects.\n /// \n /// \n /// \n /// type Point =\n /// {\n /// X : float\n /// Y : float\n /// }\n ///\n /// module Point =\n /// let create x y = { X = x; Y = y }\n ///\n /// let decode =\n /// Decode.succeed create\n /// |> Decode.andMap (Decode.field \"x\" Decode.float)\n /// |> Decode.andMap (Decode.field \"y\" Decode.float)\n /// \n /// \n let andMap<'a, 'b> : 'a Decoder -> ('a -> 'b) Decoder -> 'b Decoder =\n map2 (|>)\n\n type IRequiredGetter =\n abstract Field : string -> Decoder<'a> -> 'a\n abstract At : List -> Decoder<'a> -> 'a\n abstract Raw : Decoder<'a> -> 'a\n\n type IOptionalGetter =\n abstract Field : string -> Decoder<'a> -> 'a option\n abstract At : List -> Decoder<'a> -> 'a option\n abstract Raw : Decoder<'a> -> 'a option\n\n type IGetters =\n abstract Required: IRequiredGetter\n abstract Optional: IOptionalGetter\n\n let private unwrapWith (errors: ResizeArray) path (decoder: Decoder<'T>) value: 'T =\n match decoder path value with\n | Ok v -> v\n | Error er -> errors.Add(er); Unchecked.defaultof<'T>\n\n type Getters<'T>(path: string, v: 'T) =\n let mutable errors = ResizeArray()\n let required =\n { new IRequiredGetter with\n member __.Field (fieldName : string) (decoder : Decoder<_>) =\n unwrapWith errors path (field fieldName decoder) v\n member __.At (fieldNames : string list) (decoder : Decoder<_>) =\n unwrapWith errors path (at fieldNames decoder) v\n member __.Raw (decoder: Decoder<_>) =\n unwrapWith errors path decoder v }\n let optional =\n { new IOptionalGetter with\n member __.Field (fieldName : string) (decoder : Decoder<_>) =\n unwrapWith errors path (optional fieldName decoder) v\n member __.At (fieldNames : string list) (decoder : Decoder<_>) =\n unwrapWith errors path (optionalAt fieldNames decoder) v\n member __.Raw (decoder: Decoder<_>) =\n match decoder path v with\n | Ok v -> Some v\n | Error((_, reason) as error) ->\n match reason with\n | BadPrimitive(_,v)\n | BadPrimitiveExtra(_,v,_)\n | BadType(_,v) ->\n if Helpers.isNullValue v then None\n else errors.Add(error); Unchecked.defaultof<_>\n | BadField _\n | BadPath _ -> None\n | TooSmallArray _\n | FailMessage _\n | BadOneOf _ -> errors.Add(error); Unchecked.defaultof<_> }\n member __.Errors: _ list = Seq.toList errors\n interface IGetters with\n member __.Required = required\n member __.Optional = optional\n\n let object (builder: IGetters -> 'value) : Decoder<'value> =\n fun path v ->\n let getters = Getters(path, v)\n let result = builder getters\n match getters.Errors with\n | [] -> Ok result\n | fst::_ as errors ->\n if errors.Length > 1 then\n let errors = List.map errorToString errors\n (path, BadOneOf errors) |> Error\n else\n Error fst\n\n ///////////////////////\n // Tuples decoders ///\n ////////////////////\n\n let tuple2 (decoder1: Decoder<'T1>) (decoder2: Decoder<'T2>) : Decoder<'T1 * 'T2> =\n index 0 decoder1\n |> andThen (fun v1 ->\n index 1 decoder2\n |> andThen (fun v2 ->\n succeed (v1, v2)\n )\n )\n\n let tuple3 (decoder1: Decoder<'T1>)\n (decoder2: Decoder<'T2>)\n (decoder3: Decoder<'T3>) : Decoder<'T1 * 'T2 * 'T3> =\n index 0 decoder1\n |> andThen (fun v1 ->\n index 1 decoder2\n |> andThen (fun v2 ->\n index 2 decoder3\n |> andThen (fun v3 ->\n succeed (v1, v2, v3)\n )\n )\n )\n\n let tuple4 (decoder1: Decoder<'T1>)\n (decoder2: Decoder<'T2>)\n (decoder3: Decoder<'T3>)\n (decoder4: Decoder<'T4>) : Decoder<'T1 * 'T2 * 'T3 * 'T4> =\n index 0 decoder1\n |> andThen (fun v1 ->\n index 1 decoder2\n |> andThen (fun v2 ->\n index 2 decoder3\n |> andThen (fun v3 ->\n index 3 decoder4\n |> andThen (fun v4 ->\n succeed (v1, v2, v3, v4)\n )\n )\n )\n )\n\n let tuple5 (decoder1: Decoder<'T1>)\n (decoder2: Decoder<'T2>)\n (decoder3: Decoder<'T3>)\n (decoder4: Decoder<'T4>)\n (decoder5: Decoder<'T5>) : Decoder<'T1 * 'T2 * 'T3 * 'T4 * 'T5> =\n index 0 decoder1\n |> andThen (fun v1 ->\n index 1 decoder2\n |> andThen (fun v2 ->\n index 2 decoder3\n |> andThen (fun v3 ->\n index 3 decoder4\n |> andThen (fun v4 ->\n index 4 decoder5\n |> andThen (fun v5 ->\n succeed (v1, v2, v3, v4, v5)\n )\n )\n )\n )\n )\n\n let tuple6 (decoder1: Decoder<'T1>)\n (decoder2: Decoder<'T2>)\n (decoder3: Decoder<'T3>)\n (decoder4: Decoder<'T4>)\n (decoder5: Decoder<'T5>)\n (decoder6: Decoder<'T6>) : Decoder<'T1 * 'T2 * 'T3 * 'T4 * 'T5 * 'T6> =\n index 0 decoder1\n |> andThen (fun v1 ->\n index 1 decoder2\n |> andThen (fun v2 ->\n index 2 decoder3\n |> andThen (fun v3 ->\n index 3 decoder4\n |> andThen (fun v4 ->\n index 4 decoder5\n |> andThen (fun v5 ->\n index 5 decoder6\n |> andThen (fun v6 ->\n succeed (v1, v2, v3, v4, v5, v6)\n )\n )\n )\n )\n )\n )\n\n let tuple7 (decoder1: Decoder<'T1>)\n (decoder2: Decoder<'T2>)\n (decoder3: Decoder<'T3>)\n (decoder4: Decoder<'T4>)\n (decoder5: Decoder<'T5>)\n (decoder6: Decoder<'T6>)\n (decoder7: Decoder<'T7>) : Decoder<'T1 * 'T2 * 'T3 * 'T4 * 'T5 * 'T6 * 'T7> =\n index 0 decoder1\n |> andThen (fun v1 ->\n index 1 decoder2\n |> andThen (fun v2 ->\n index 2 decoder3\n |> andThen (fun v3 ->\n index 3 decoder4\n |> andThen (fun v4 ->\n index 4 decoder5\n |> andThen (fun v5 ->\n index 5 decoder6\n |> andThen (fun v6 ->\n index 6 decoder7\n |> andThen (fun v7 ->\n succeed (v1, v2, v3, v4, v5, v6, v7)\n )\n )\n )\n )\n )\n )\n )\n\n let tuple8 (decoder1: Decoder<'T1>)\n (decoder2: Decoder<'T2>)\n (decoder3: Decoder<'T3>)\n (decoder4: Decoder<'T4>)\n (decoder5: Decoder<'T5>)\n (decoder6: Decoder<'T6>)\n (decoder7: Decoder<'T7>)\n (decoder8: Decoder<'T8>) : Decoder<'T1 * 'T2 * 'T3 * 'T4 * 'T5 * 'T6 * 'T7 * 'T8> =\n index 0 decoder1\n |> andThen (fun v1 ->\n index 1 decoder2\n |> andThen (fun v2 ->\n index 2 decoder3\n |> andThen (fun v3 ->\n index 3 decoder4\n |> andThen (fun v4 ->\n index 4 decoder5\n |> andThen (fun v5 ->\n index 5 decoder6\n |> andThen (fun v6 ->\n index 6 decoder7\n |> andThen (fun v7 ->\n index 7 decoder8\n |> andThen (fun v8 ->\n succeed (v1, v2, v3, v4, v5, v6, v7, v8)\n )\n )\n )\n )\n )\n )\n )\n )\n\n ///////////\n // Map ///\n /////////\n\n let dict (decoder : Decoder<'value>) : Decoder> =\n map Map.ofList (keyValuePairs decoder)\n\n let map' (keyDecoder : Decoder<'key>) (valueDecoder : Decoder<'value>) : Decoder> =\n map Map.ofSeq (array (tuple2 keyDecoder valueDecoder))\n\n ////////////\n // Enum ///\n /////////\n\n #if !FABLE_REPL_LIB\n module Enum =\n\n let inline byte<'TEnum when 'TEnum : enum> : Decoder<'TEnum> =\n byte\n |> andThen (fun value ->\n LanguagePrimitives.EnumOfValue value\n |> succeed\n )\n\n let inline sbyte<'TEnum when 'TEnum : enum> : Decoder<'TEnum> =\n sbyte\n |> andThen (fun value ->\n LanguagePrimitives.EnumOfValue value\n |> succeed\n )\n\n let inline int16<'TEnum when 'TEnum : enum> : Decoder<'TEnum> =\n int16\n |> andThen (fun value ->\n LanguagePrimitives.EnumOfValue value\n |> succeed\n )\n\n let inline uint16<'TEnum when 'TEnum : enum> : Decoder<'TEnum> =\n uint16\n |> andThen (fun value ->\n LanguagePrimitives.EnumOfValue value\n |> succeed\n )\n\n let inline int<'TEnum when 'TEnum : enum> : Decoder<'TEnum> =\n int\n |> andThen (fun value ->\n LanguagePrimitives.EnumOfValue value\n |> succeed\n )\n\n let inline uint32<'TEnum when 'TEnum : enum> : Decoder<'TEnum> =\n uint32\n |> andThen (fun value ->\n LanguagePrimitives.EnumOfValue value\n |> succeed\n )\n #endif\n\n //////////////////\n // Reflection ///\n ////////////////\n\n open FSharp.Reflection\n\n // As generics are erased by Fable, let's just do an unsafe cast for performance\n let inline boxDecoder (d: Decoder<'T>): BoxedDecoder =\n !!d // d >> Result.map box\n\n let inline unboxDecoder (d: BoxedDecoder): Decoder<'T> =\n !!d // d >> Result.map unbox\n\n // This is used to force Fable use a generic comparer for map keys\n let private toMap<'key, 'value when 'key: comparison> (xs: ('key*'value) seq) = Map.ofSeq xs\n let private toSet<'key when 'key: comparison> (xs: 'key seq) = Set.ofSeq xs\n\n let private autoObject (decoderInfos: (string * BoxedDecoder)[]) (path : string) (value: JsonValue) =\n if not (Helpers.isObject value) then\n (path, BadPrimitive (\"an object\", value)) |> Error\n else\n (decoderInfos, Ok []) ||> Array.foldBack (fun (name, decoder) acc ->\n match acc with\n | Error _ -> acc\n | Ok result ->\n Helpers.getField name value\n |> decoder (path + \".\" + name)\n |> Result.map (fun v -> v::result))\n\n let inline private enumDecoder<'UnderlineType when 'UnderlineType : equality>\n (decoder : Decoder<'UnderlineType>)\n (toString : 'UnderlineType -> string)\n (t: System.Type) =\n\n fun path value ->\n match decoder path value with\n | Ok enumValue ->\n System.Enum.GetValues(t)\n |> Seq.cast<'UnderlineType>\n |> Seq.contains enumValue\n |> function\n | true ->\n System.Enum.Parse(t, toString enumValue)\n |> Ok\n | false ->\n (path, BadPrimitiveExtra(t.FullName, value, \"Unkown value provided for the enum\"))\n |> Error\n | Error msg ->\n Error msg\n\n let private autoObject2 (keyDecoder: BoxedDecoder) (valueDecoder: BoxedDecoder) (path : string) (value: JsonValue) =\n if not (Helpers.isObject value) then\n (path, BadPrimitive (\"an object\", value)) |> Error\n else\n (Ok [], Helpers.objectKeys(value)) ||> Seq.fold (fun acc name ->\n match acc with\n | Error _ -> acc\n | Ok acc ->\n match keyDecoder path name with\n | Error er -> Error er\n | Ok k ->\n Helpers.getField name value\n |> valueDecoder (path + \".\" + name)\n |> function\n | Error er -> Error er\n | Ok v -> (k,v)::acc |> Ok)\n\n let private mixedArray offset (decoders: BoxedDecoder[]) (path: string) (values: JsonValue[]): Result =\n let expectedLength = decoders.Length + offset\n if expectedLength <> values.Length then\n (path, sprintf \"Expected array of length %i but got %i\" expectedLength values.Length\n |> FailMessage) |> Error\n else\n let mutable result = Ok []\n for i = offset to values.Length - 1 do\n match result with\n | Error _ -> ()\n | Ok acc ->\n let path = sprintf \"%s[%i]\" path i\n let decoder = decoders.[i - offset]\n let value = values.[i]\n result <- decoder path value |> Result.map (fun v -> v::acc)\n result\n |> Result.map List.rev\n\n let rec private makeUnion extra caseStrategy t name (path : string) (values: JsonValue[]) =\n let uci =\n FSharpType.GetUnionCases(t, allowAccessToPrivateRepresentation=true)\n |> Array.tryFind (fun x -> x.Name = name)\n match uci with\n | None -> (path, FailMessage(\"Cannot find case \" + name + \" in \" + t.FullName)) |> Error\n | Some uci ->\n let decoders = uci.GetFields() |> Array.map (fun fi -> autoDecoder extra caseStrategy false fi.PropertyType)\n let values =\n if decoders.Length = 0 && values.Length <= 1 // First item is the case name\n then Ok []\n else mixedArray 1 decoders path values\n values |> Result.map (fun values -> FSharpValue.MakeUnion(uci, List.toArray values, allowAccessToPrivateRepresentation=true))\n\n and private autoDecodeRecordsAndUnions extra (caseStrategy : CaseStrategy) (isOptional : bool) (t: System.Type) : BoxedDecoder =\n // Add the decoder to extra in case one of the fields is recursive\n let decoderRef = ref Unchecked.defaultof<_>\n let extra =\n // As of 3.7.17 Fable assigns empty name to anonymous record, we shouldn't add them to the map to avoid conflicts.\n // Anonymous records cannot be recursive anyways, see #144\n match t.FullName with\n | \"\" -> extra\n | fullName -> extra |> Map.add fullName decoderRef\n let decoder =\n if FSharpType.IsRecord(t, allowAccessToPrivateRepresentation=true) then\n let decoders =\n FSharpType.GetRecordFields(t, allowAccessToPrivateRepresentation=true)\n |> Array.map (fun fi ->\n let name = Util.Casing.convert caseStrategy fi.Name\n name, autoDecoder extra caseStrategy false fi.PropertyType)\n fun path value ->\n autoObject decoders path value\n |> Result.map (fun xs -> FSharpValue.MakeRecord(t, List.toArray xs, allowAccessToPrivateRepresentation=true))\n\n elif FSharpType.IsUnion(t, allowAccessToPrivateRepresentation=true) then\n fun path (value: JsonValue) ->\n if Helpers.isString(value) then\n let name = Helpers.asString value\n makeUnion extra caseStrategy t name path [||]\n elif Helpers.isArray(value) then\n let values = Helpers.asArray value\n string (path + \"[0]\") values.[0]\n |> Result.bind (fun name -> makeUnion extra caseStrategy t name path values)\n else (path, BadPrimitive(\"a string or array\", value)) |> Error\n\n else\n if isOptional then\n // The error will only happen at runtime if the value is not null\n // See https://github.com/MangelMaxime/Thoth/pull/84#issuecomment-444837773\n boxDecoder(fun path value -> Error(path, BadType(\"an extra coder for \" + t.FullName, value)))\n else\n // Don't use failwithf here, for some reason F#/Fable compiles it as a function\n // when the return type is a function too, so it doesn't fail immediately\n sprintf \"\"\"Cannot generate auto decoder for %s. Please pass an extra decoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders\"\"\" t.FullName |> failwith\n decoderRef.Value <- decoder\n decoder\n\n and private autoDecoder (extra: Map>) caseStrategy (isOptional : bool) (t: System.Type) : BoxedDecoder =\n let fullname = t.FullName\n match Map.tryFind fullname extra with\n | Some decoderRef -> fun path value -> decoderRef.contents path value\n | None ->\n if t.IsArray then\n let decoder = t.GetElementType() |> autoDecoder extra caseStrategy false\n array decoder |> boxDecoder\n elif t.IsEnum then\n let enumType = System.Enum.GetUnderlyingType(t).FullName\n if enumType = typeof.FullName then\n enumDecoder sbyte Operators.string t |> boxDecoder\n elif enumType = typeof.FullName then\n enumDecoder byte Operators.string t |> boxDecoder\n elif enumType = typeof.FullName then\n enumDecoder int16 Operators.string t |> boxDecoder\n elif enumType = typeof.FullName then\n enumDecoder uint16 Operators.string t |> boxDecoder\n elif enumType = typeof.FullName then\n enumDecoder int Operators.string t |> boxDecoder\n elif enumType = typeof.FullName then\n enumDecoder uint32 Operators.string t |> boxDecoder\n else\n failwithf\n \"\"\"Cannot generate auto decoder for %s.\nThoth.Json.Net only support the following enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\nIf you can't use one of these types, please pass an extra decoder.\n \"\"\" t.FullName\n elif t.IsGenericType then\n if FSharpType.IsTuple(t) then\n let decoders = FSharpType.GetTupleElements(t) |> Array.map (autoDecoder extra caseStrategy false)\n fun path value ->\n if Helpers.isArray value then\n mixedArray 0 decoders path (Helpers.asArray value)\n |> Result.map (fun xs -> FSharpValue.MakeTuple(List.toArray xs, t))\n else (path, BadPrimitive (\"an array\", value)) |> Error\n else\n let fullname = t.GetGenericTypeDefinition().FullName\n if fullname = typedefof.FullName then\n t.GenericTypeArguments.[0] |> (autoDecoder extra caseStrategy true) |> option |> boxDecoder\n elif fullname = typedefof.FullName then\n t.GenericTypeArguments.[0] |> (autoDecoder extra caseStrategy false) |> list |> boxDecoder\n elif fullname = typedefof.FullName then\n t.GenericTypeArguments.[0] |> (autoDecoder extra caseStrategy false) |> seq |> boxDecoder\n elif fullname = typedefof< Map >.FullName then\n let keyDecoder = t.GenericTypeArguments.[0] |> autoDecoder extra caseStrategy false\n let valueDecoder = t.GenericTypeArguments.[1] |> autoDecoder extra caseStrategy false\n oneOf [\n autoObject2 keyDecoder valueDecoder\n list (tuple2 keyDecoder valueDecoder)\n ] |> map (fun ar -> toMap (unbox ar) |> box)\n elif fullname = typedefof< Set >.FullName then\n let decoder = t.GenericTypeArguments.[0] |> autoDecoder extra caseStrategy false\n fun path value ->\n match array decoder path value with\n | Error er -> Error er\n | Ok ar -> toSet (unbox ar) |> box |> Ok\n else\n autoDecodeRecordsAndUnions extra caseStrategy isOptional t\n else\n if fullname = typeof.FullName then\n boxDecoder bool\n elif fullname = typedefof.FullName then\n boxDecoder unit\n elif fullname = typeof.FullName then\n boxDecoder string\n elif fullname = typeof.FullName then\n boxDecoder char\n elif fullname = typeof.FullName then\n boxDecoder sbyte\n elif fullname = typeof.FullName then\n boxDecoder byte\n elif fullname = typeof.FullName then\n boxDecoder int16\n elif fullname = typeof.FullName then\n boxDecoder uint16\n elif fullname = typeof.FullName then\n boxDecoder int\n elif fullname = typeof.FullName then\n boxDecoder uint32\n elif fullname = typeof.FullName then\n boxDecoder float\n elif fullname = typeof.FullName then\n boxDecoder float32\n // These number types require extra libraries in Fable. To prevent penalizing\n // all users, extra decoders (withInt64, etc) must be passed when they're needed.\n\n // elif fullname = typeof.FullName then\n // boxDecoder int64\n // elif fullname = typeof.FullName then\n // boxDecoder uint64\n // elif fullname = typeof.FullName then\n // boxDecoder bigint\n // elif fullname = typeof.FullName then\n // boxDecoder decimal\n elif fullname = typeof.FullName then\n boxDecoder datetimeUtc\n elif fullname = typeof.FullName then\n boxDecoder datetimeOffset\n elif fullname = typeof.FullName then\n boxDecoder timespan\n elif fullname = typeof.FullName then\n boxDecoder guid\n elif fullname = typeof.FullName then\n fun _ v -> Ok v\n else autoDecodeRecordsAndUnions extra caseStrategy isOptional t\n\n let private makeExtra (extra: ExtraCoders option) =\n match extra with\n | None -> Map.empty\n | Some e -> Map.map (fun _ (_,dec) -> ref dec) e.Coders\n\n type Auto =\n static member generateBoxedDecoderCached(t: System.Type, ?caseStrategy : CaseStrategy, ?extra: ExtraCoders): BoxedDecoder =\n let caseStrategy = defaultArg caseStrategy PascalCase\n\n let key =\n t.FullName\n |> (+) (Operators.string caseStrategy)\n |> (+) (extra |> Option.map (fun e -> e.Hash) |> Option.defaultValue \"\")\n\n Util.CachedDecoders.GetOrAdd(key, fun _ -> autoDecoder (makeExtra extra) caseStrategy false t)\n\n static member inline generateDecoderCached<'T>(?caseStrategy : CaseStrategy, ?extra: ExtraCoders): Decoder<'T> =\n Auto.generateBoxedDecoderCached(typeof<'T>, ?caseStrategy=caseStrategy, ?extra=extra) |> unboxDecoder\n\n static member generateBoxedDecoder(t: System.Type, ?caseStrategy : CaseStrategy, ?extra: ExtraCoders): BoxedDecoder =\n let caseStrategy = defaultArg caseStrategy PascalCase\n autoDecoder (makeExtra extra) caseStrategy false t\n\n static member inline generateDecoder<'T>(?caseStrategy : CaseStrategy, ?extra: ExtraCoders): Decoder<'T> =\n Auto.generateBoxedDecoder(typeof<'T>, ?caseStrategy=caseStrategy, ?extra=extra) |> unboxDecoder\n\n static member inline fromString<'T>(json: string, ?caseStrategy : CaseStrategy, ?extra: ExtraCoders): Result<'T, string> =\n let decoder = Auto.generateDecoder<'T>(?caseStrategy=caseStrategy, ?extra=extra)\n fromString decoder json\n\n static member inline unsafeFromString<'T>(json: string, ?caseStrategy : CaseStrategy, ?extra: ExtraCoders): 'T =\n let decoder = Auto.generateDecoder<'T>(?caseStrategy=caseStrategy, ?extra=extra)\n match fromString decoder json with\n | Ok x -> x\n | Error msg -> failwith msg\n","namespace Thoth.Json\nopen System.Text.RegularExpressions\n\n[]\nmodule Encode =\n\n open System.Collections.Generic\n open System.Globalization\n open Fable.Core\n open Fable.Core.JsInterop\n\n []\n let private arrayFrom(x: JsonValue seq): JsonValue = jsNative\n\n ///**Description**\n /// Encode a string\n ///\n ///**Parameters**\n /// * `value` - parameter of type `string`\n ///\n ///**Output Type**\n /// * `Value`\n ///\n ///**Exceptions**\n ///\n let inline string (value : string) : JsonValue =\n box value\n\n let inline char (value : char) : JsonValue =\n box value\n\n ///**Description**\n /// Encode a GUID\n ///\n ///**Parameters**\n /// * `value` - parameter of type `System.Guid`\n ///\n ///**Output Type**\n /// * `Value`\n ///\n ///**Exceptions**\n ///\n let guid (value : System.Guid) : JsonValue =\n box (value.ToString())\n\n ///**Description**\n /// Encode a Float. `Infinity` and `NaN` are encoded as `null`.\n ///\n ///**Parameters**\n /// * `value` - parameter of type `float`\n ///\n ///**Output Type**\n /// * `Value`\n ///\n ///**Exceptions**\n ///\n let inline float (value : float) : JsonValue =\n box value\n\n let inline float32 (value : float32) : JsonValue =\n box value\n\n ///**Description**\n /// Encode a Decimal.\n ///\n ///**Parameters**\n /// * `value` - parameter of type `decimal`\n ///\n ///**Output Type**\n /// * `Value`\n ///\n ///**Exceptions**\n ///\n let decimal (value : decimal) : JsonValue =\n value.ToString() |> string\n\n ///**Description**\n /// Encode null\n ///\n ///**Parameters**\n ///\n ///**Output Type**\n /// * `Value`\n ///\n ///**Exceptions**\n ///\n let nil : JsonValue =\n box null\n\n ///**Description**\n /// Encode a bool\n ///**Parameters**\n /// * `value` - parameter of type `bool`\n ///\n ///**Output Type**\n /// * `Value`\n ///\n ///**Exceptions**\n ///\n let inline bool (value : bool) : JsonValue =\n box value\n\n ///**Description**\n /// Encode an object\n ///\n ///**Parameters**\n /// * `values` - parameter of type `(string * Value) list`\n ///\n ///**Output Type**\n /// * `Value`\n ///\n ///**Exceptions**\n ///\n let object (values : (string * JsonValue) seq) : JsonValue =\n let o = obj()\n for (key, value) in values do\n o?(key) <- value\n box o\n\n ///**Description**\n /// Encode an array\n ///\n ///**Parameters**\n /// * `values` - parameter of type `Value array`\n ///\n ///**Output Type**\n /// * `Value`\n ///\n ///**Exceptions**\n ///\n let inline array (values : JsonValue array) : JsonValue =\n box values\n\n ///**Description**\n /// Encode a list\n ///**Parameters**\n /// * `values` - parameter of type `Value list`\n ///\n ///**Output Type**\n /// * `Value`\n ///\n ///**Exceptions**\n ///\n let list (values : JsonValue list) : JsonValue =\n // Don't use List.toArray as it may create a typed array\n arrayFrom values\n\n let seq (values : JsonValue seq) : JsonValue =\n arrayFrom values\n\n ///**Description**\n /// Encode a dictionary\n ///**Parameters**\n /// * `values` - parameter of type `Map`\n ///\n ///**Output Type**\n /// * `Value`\n ///\n ///**Exceptions**\n ///\n let dict (values : Map) : JsonValue =\n values\n |> Map.toList\n |> object\n\n let bigint (value : bigint) : JsonValue =\n box (value.ToString())\n\n let datetimeOffset (value : System.DateTimeOffset) : JsonValue =\n value.ToString(\"O\", CultureInfo.InvariantCulture) |> string\n\n /// **Description**\n /// Encode a timespan\n /// **Parameters**\n /// * `value` - parameter of type `System.TimeSpan`\n ///\n /// **Output Type**\n /// * `Value`\n ///\n /// **Exceptions**\n ///\n let timespan (value : System.TimeSpan) : JsonValue =\n value.ToString() |> string\n\n let inline sbyte (value : sbyte) : JsonValue =\n box value\n\n let inline byte (value : byte) : JsonValue =\n box value\n\n let inline int16 (value : int16) : JsonValue =\n box value\n\n let inline uint16 (value : uint16) : JsonValue =\n box value\n\n let inline int (value : int) : JsonValue =\n box value\n\n let inline uint32 (value : uint32) : JsonValue =\n box value\n\n let int64 (value : int64) : JsonValue =\n box (value.ToString(CultureInfo.InvariantCulture))\n\n let uint64 (value : uint64) : JsonValue =\n box (value.ToString(CultureInfo.InvariantCulture))\n\n let unit () : JsonValue =\n box null\n\n let tuple2\n (enc1 : Encoder<'T1>)\n (enc2 : Encoder<'T2>)\n (v1, v2) : JsonValue =\n box [| enc1 v1\n enc2 v2 |]\n\n let tuple3\n (enc1 : Encoder<'T1>)\n (enc2 : Encoder<'T2>)\n (enc3 : Encoder<'T3>)\n (v1, v2, v3) : JsonValue =\n box [| enc1 v1\n enc2 v2\n enc3 v3 |]\n\n let tuple4\n (enc1 : Encoder<'T1>)\n (enc2 : Encoder<'T2>)\n (enc3 : Encoder<'T3>)\n (enc4 : Encoder<'T4>)\n (v1, v2, v3, v4) : JsonValue =\n box [| enc1 v1\n enc2 v2\n enc3 v3\n enc4 v4 |]\n\n let tuple5\n (enc1 : Encoder<'T1>)\n (enc2 : Encoder<'T2>)\n (enc3 : Encoder<'T3>)\n (enc4 : Encoder<'T4>)\n (enc5 : Encoder<'T5>)\n (v1, v2, v3, v4, v5) : JsonValue =\n box [| enc1 v1\n enc2 v2\n enc3 v3\n enc4 v4\n enc5 v5 |]\n\n let tuple6\n (enc1 : Encoder<'T1>)\n (enc2 : Encoder<'T2>)\n (enc3 : Encoder<'T3>)\n (enc4 : Encoder<'T4>)\n (enc5 : Encoder<'T5>)\n (enc6 : Encoder<'T6>)\n (v1, v2, v3, v4, v5, v6) : JsonValue =\n box [| enc1 v1\n enc2 v2\n enc3 v3\n enc4 v4\n enc5 v5\n enc6 v6 |]\n\n let tuple7\n (enc1 : Encoder<'T1>)\n (enc2 : Encoder<'T2>)\n (enc3 : Encoder<'T3>)\n (enc4 : Encoder<'T4>)\n (enc5 : Encoder<'T5>)\n (enc6 : Encoder<'T6>)\n (enc7 : Encoder<'T7>)\n (v1, v2, v3, v4, v5, v6, v7) : JsonValue =\n box [| enc1 v1\n enc2 v2\n enc3 v3\n enc4 v4\n enc5 v5\n enc6 v6\n enc7 v7 |]\n\n let tuple8\n (enc1 : Encoder<'T1>)\n (enc2 : Encoder<'T2>)\n (enc3 : Encoder<'T3>)\n (enc4 : Encoder<'T4>)\n (enc5 : Encoder<'T5>)\n (enc6 : Encoder<'T6>)\n (enc7 : Encoder<'T7>)\n (enc8 : Encoder<'T8>)\n (v1, v2, v3, v4, v5, v6, v7, v8) : JsonValue =\n box [| enc1 v1\n enc2 v2\n enc3 v3\n enc4 v4\n enc5 v5\n enc6 v6\n enc7 v7\n enc8 v8 |]\n\n let map (keyEncoder : Encoder<'key>) (valueEncoder : Encoder<'value>) (values : Map<'key, 'value>) : JsonValue =\n values\n |> Map.toList\n |> List.map (tuple2 keyEncoder valueEncoder)\n |> list\n\n ////////////\n // Enum ///\n /////////\n\n module Enum =\n\n let byte<'TEnum when 'TEnum : enum> (value : 'TEnum) : JsonValue =\n LanguagePrimitives.EnumToValue value\n |> byte\n\n let sbyte<'TEnum when 'TEnum : enum> (value : 'TEnum) : JsonValue =\n LanguagePrimitives.EnumToValue value\n |> sbyte\n\n let int16<'TEnum when 'TEnum : enum> (value : 'TEnum) : JsonValue =\n LanguagePrimitives.EnumToValue value\n |> int16\n\n let uint16<'TEnum when 'TEnum : enum> (value : 'TEnum) : JsonValue =\n LanguagePrimitives.EnumToValue value\n |> uint16\n\n let int<'TEnum when 'TEnum : enum> (value : 'TEnum) : JsonValue =\n LanguagePrimitives.EnumToValue value\n |> int\n\n let uint32<'TEnum when 'TEnum : enum> (value : 'TEnum) : JsonValue =\n LanguagePrimitives.EnumToValue value\n |> uint32\n\n /// **Description**\n ///\n /// The DateTime is always encoded using UTC representation\n ///\n /// **Parameters**\n /// * `value` - parameter of type `System.DateTime`\n ///\n /// **Output Type**\n /// * `Value`\n ///\n /// **Exceptions**\n ///\n let datetime (value : System.DateTime) : JsonValue =\n value.ToString(\"O\", CultureInfo.InvariantCulture) |> string\n\n ///**Description**\n /// Convert a `Value` into a prettified string.\n ///**Parameters**\n /// * `space` - parameter of type `int` - Amount of indentation\n /// * `value` - parameter of type `obj` - Value to convert\n ///\n ///**Output Type**\n /// * `string`\n ///\n ///**Exceptions**\n ///\n let toString (space: int) (value: JsonValue) : string =\n JS.JSON.stringify(value, !!null, space)\n\n ///**Description**\n /// Encode an option\n ///**Parameters**\n /// * `encoder` - parameter of type `'a -> Value`\n ///\n ///**Output Type**\n /// * `'a option -> Value`\n ///\n ///**Exceptions**\n ///\n let option (encoder : 'a -> JsonValue) =\n Option.map encoder >> Option.defaultWith (fun _ -> nil)\n\n //////////////////\n // Reflection ///\n ////////////////\n\n open FSharp.Reflection\n open Fable.Core.DynamicExtensions\n\n // As generics are erased by Fable, let's just do an unsafe cast for performance\n let inline boxEncoder (d: Encoder<'T>): BoxedEncoder =\n !!d\n\n let inline unboxEncoder (d: BoxedEncoder): Encoder<'T> =\n !!d\n\n let rec private autoEncodeRecordsAndUnions extra (caseStrategy : CaseStrategy) (skipNullField : bool) (t: System.Type) : BoxedEncoder =\n // Add the encoder to extra in case one of the fields is recursive\n let encoderRef = ref Unchecked.defaultof<_>\n let extra =\n // As of 3.7.17 Fable assigns empty name to anonymous record, we shouldn't add them to the map to avoid conflicts.\n // Anonymous records cannot be recursive anyways, see #144\n match t.FullName with\n | \"\" -> extra\n | fullName -> extra |> Map.add fullName encoderRef\n let encoder =\n if FSharpType.IsRecord(t, allowAccessToPrivateRepresentation=true) then\n let setters =\n FSharpType.GetRecordFields(t, allowAccessToPrivateRepresentation=true)\n |> Array.map (fun fi ->\n let targetKey = Util.Casing.convert caseStrategy fi.Name\n let encode = autoEncoder extra caseStrategy skipNullField fi.PropertyType\n fun (source: obj) (target: JsonValue) ->\n let value = FSharpValue.GetRecordField(source, fi)\n if not skipNullField || (skipNullField && not (isNull value)) then // Discard null fields\n target.[targetKey] <- encode value\n target)\n fun (source: obj) ->\n (JsonValue(), setters) ||> Seq.fold (fun target set -> set source target)\n elif FSharpType.IsUnion(t, allowAccessToPrivateRepresentation=true) then\n fun (value: obj) ->\n let info, fields = FSharpValue.GetUnionFields(value, t, allowAccessToPrivateRepresentation=true)\n match fields.Length with\n | 0 -> string info.Name\n | len ->\n let fieldTypes = info.GetFields()\n let target = Array.zeroCreate (len + 1)\n target.[0] <- string info.Name\n for i = 1 to len do\n let encode = autoEncoder extra caseStrategy skipNullField fieldTypes.[i-1].PropertyType\n target.[i] <- encode fields.[i-1]\n array target\n else\n // Don't use failwithf here, for some reason F#/Fable compiles it as a function\n // when the return type is a function too, so it doesn't fail immediately\n sprintf \"\"\"Cannot generate auto encoder for %s. Please pass an extra encoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders\"\"\" t.FullName\n |> failwith\n encoderRef.Value <- encoder\n encoder\n\n and private autoEncoder (extra: Map>) caseStrategy (skipNullField : bool) (t: System.Type) : BoxedEncoder =\n let fullname = t.FullName\n match Map.tryFind fullname extra with\n | Some encoderRef -> fun v -> encoderRef.contents v\n | None ->\n if t.IsArray then\n let encoder = t.GetElementType() |> autoEncoder extra caseStrategy skipNullField\n fun (value: obj) ->\n value :?> obj seq |> Seq.map encoder |> seq\n elif t.IsEnum then\n let enumType = System.Enum.GetUnderlyingType(t).FullName\n if enumType = typeof.FullName then\n boxEncoder sbyte\n elif enumType = typeof.FullName then\n boxEncoder byte\n elif enumType = typeof.FullName then\n boxEncoder int16\n elif enumType = typeof.FullName then\n boxEncoder uint16\n elif enumType = typeof.FullName then\n boxEncoder int\n elif enumType = typeof.FullName then\n boxEncoder uint32\n else\n failwithf\n \"\"\"Cannot generate auto encoder for %s.\nThoth.Json.Net only support the following enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\n\nIf you can't use one of these types, please pass an extra encoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders\n \"\"\" t.FullName\n elif t.IsGenericType then\n if FSharpType.IsTuple(t) then\n let encoders =\n FSharpType.GetTupleElements(t)\n |> Array.map (autoEncoder extra caseStrategy skipNullField)\n fun (value: obj) ->\n FSharpValue.GetTupleFields(value)\n |> Seq.mapi (fun i x -> encoders.[i] x) |> seq\n else\n let fullname = t.GetGenericTypeDefinition().FullName\n if fullname = typedefof.FullName then\n // Evaluate lazily so we don't need to generate the encoder for null values\n let encoder = lazy\n t.GenericTypeArguments.[0]\n |> autoEncoder extra caseStrategy skipNullField\n |> option\n |> boxEncoder\n boxEncoder(fun (value: obj) ->\n if isNull value then nil\n else encoder.Value value)\n elif fullname = typedefof.FullName\n || fullname = typedefof>.FullName\n || fullname = typedefof.FullName then\n let encoder = t.GenericTypeArguments.[0] |> autoEncoder extra caseStrategy skipNullField\n fun (value: obj) ->\n value :?> obj seq |> Seq.map encoder |> seq\n elif fullname = typedefof< Map >.FullName then\n let keyType = t.GenericTypeArguments.[0]\n let valueEncoder = t.GenericTypeArguments.[1] |> autoEncoder extra caseStrategy skipNullField\n if keyType.FullName = typeof.FullName\n || keyType.FullName = typeof.FullName then\n fun value ->\n // Fable compiles Guids as strings so this works, but maybe we should make the conversion explicit\n // (see dotnet version) in case Fable implementation of Guids change\n (JsonValue(), value :?> Map)\n ||> Seq.fold (fun target (KeyValue(k,v)) ->\n target.[k] <- valueEncoder v\n target)\n else\n let keyEncoder = keyType |> autoEncoder extra caseStrategy skipNullField\n fun value ->\n value :?> Map |> Seq.map (fun (KeyValue(k,v)) ->\n array [|keyEncoder k; valueEncoder v|]) |> seq\n else\n autoEncodeRecordsAndUnions extra caseStrategy skipNullField t\n else\n if fullname = typeof.FullName then\n boxEncoder bool\n elif fullname = typeof.FullName then\n boxEncoder unit\n elif fullname = typeof.FullName then\n boxEncoder string\n elif fullname = typeof.FullName then\n boxEncoder char\n elif fullname = typeof.FullName then\n boxEncoder sbyte\n elif fullname = typeof.FullName then\n boxEncoder byte\n elif fullname = typeof.FullName then\n boxEncoder int16\n elif fullname = typeof.FullName then\n boxEncoder uint16\n elif fullname = typeof.FullName then\n boxEncoder int\n elif fullname = typeof.FullName then\n boxEncoder uint32\n elif fullname = typeof.FullName then\n boxEncoder float\n elif fullname = typeof.FullName then\n boxEncoder float32\n // These number types require extra libraries in Fable. To prevent penalizing\n // all users, extra encoders (withInt64, etc) must be passed when they're needed.\n\n // elif fullname = typeof.FullName then\n // boxEncoder int64\n // elif fullname = typeof.FullName then\n // boxEncoder uint64\n // elif fullname = typeof.FullName then\n // boxEncoder bigint\n // elif fullname = typeof.FullName then\n // boxEncoder decimal\n elif fullname = typeof.FullName then\n boxEncoder datetime\n elif fullname = typeof.FullName then\n boxEncoder datetimeOffset\n elif fullname = typeof.FullName then\n boxEncoder timespan\n elif fullname = typeof.FullName then\n boxEncoder guid\n elif fullname = typeof.FullName then\n boxEncoder id\n else\n autoEncodeRecordsAndUnions extra caseStrategy skipNullField t\n\n let private makeExtra (extra: ExtraCoders option) =\n match extra with\n | None -> Map.empty\n | Some e -> Map.map (fun _ (enc,_) -> ref enc) e.Coders\n\n type Auto =\n static member generateBoxedEncoderCached(t: System.Type, ?caseStrategy : CaseStrategy, ?extra: ExtraCoders, ?skipNullField: bool): BoxedEncoder =\n let caseStrategy = defaultArg caseStrategy PascalCase\n let skipNullField = defaultArg skipNullField true\n\n let key =\n t.FullName\n |> (+) (Operators.string caseStrategy)\n |> (+) (extra |> Option.map (fun e -> e.Hash) |> Option.defaultValue \"\")\n\n Util.CachedEncoders.GetOrAdd(key , fun _ ->\n autoEncoder (makeExtra extra) caseStrategy skipNullField t)\n\n static member inline generateEncoderCached<'T>(?caseStrategy : CaseStrategy, ?extra: ExtraCoders, ?skipNullField: bool): Encoder<'T> =\n Auto.generateBoxedEncoderCached(typeof<'T>, ?caseStrategy=caseStrategy, ?extra=extra) |> unboxEncoder\n\n static member generateBoxedEncoder(t: System.Type, ?caseStrategy : CaseStrategy, ?extra: ExtraCoders, ?skipNullField: bool): BoxedEncoder =\n let caseStrategy = defaultArg caseStrategy PascalCase\n let skipNullField = defaultArg skipNullField true\n autoEncoder (makeExtra extra) caseStrategy skipNullField t\n\n static member inline generateEncoder<'T>(?caseStrategy : CaseStrategy, ?extra: ExtraCoders, ?skipNullField: bool): Encoder<'T> =\n Auto.generateBoxedEncoder(typeof<'T>, ?caseStrategy=caseStrategy, ?extra=extra, ?skipNullField=skipNullField) |> unboxEncoder\n\n static member inline toString(space : int, value : 'T, ?caseStrategy : CaseStrategy, ?extra: ExtraCoders, ?skipNullField: bool) : string =\n let encoder = Auto.generateEncoder(?caseStrategy=caseStrategy, ?extra=extra, ?skipNullField=skipNullField)\n encoder value |> toString space\n\n static member inline toString(value : 'T, ?caseStrategy : CaseStrategy, ?extra: ExtraCoders, ?skipNullField: bool) : string =\n Auto.toString(0, value, ?caseStrategy=caseStrategy, ?extra=extra, ?skipNullField=skipNullField)\n\n ///**Description**\n /// Convert a `Value` into a prettified string.\n ///**Parameters**\n /// * `space` - parameter of type `int` - Amount of indentation\n /// * `value` - parameter of type `obj` - Value to convert\n ///\n ///**Output Type**\n /// * `string`\n ///\n ///**Exceptions**\n ///\n []\n let encode (space: int) (value: JsonValue) : string = toString space value\n","namespace Fable.Remoting.Client \n\nopen System\n\ntype HttpMethod = GET | POST \n\ntype RequestBody = \n | Empty\n | Json of string \n | Binary of byte[] \n\ntype CustomResponseSerializer = byte[] -> Type -> obj\n\ntype HttpRequest = {\n HttpMethod: HttpMethod\n Url: string \n Headers: (string * string) list \n RequestBody : RequestBody\n WithCredentials : bool\n}\n \ntype HttpResponse = {\n StatusCode: int \n ResponseBody: string\n}\n\ntype RemoteBuilderOptions = {\n CustomHeaders : (string * string) list\n BaseUrl : string option\n Authorization : string option\n WithCredentials : bool\n RouteBuilder : (string -> string -> string)\n CustomResponseSerialization : CustomResponseSerializer option\n}\n\ntype ProxyRequestException(response: HttpResponse, errorMsg, reponseText: string) = \n inherit System.Exception(errorMsg)\n member this.Response = response \n member this.StatusCode = response.StatusCode\n member this.ResponseText = reponseText ","namespace Fable.Remoting.Client\n\nopen System.Threading\nopen Browser\nopen Browser.Types\n\nmodule Http =\n\n /// Constructs default values for HttpRequest\n let private defaultRequestConfig : HttpRequest = {\n HttpMethod = GET\n Url = \"/\"\n Headers = [ ]\n WithCredentials = false\n RequestBody = Empty\n }\n\n /// Creates a GET request to the specified url\n let get (url: string) : HttpRequest =\n { defaultRequestConfig\n with Url = url\n HttpMethod = GET }\n\n /// Creates a POST request to the specified url\n let post (url: string) : HttpRequest =\n { defaultRequestConfig\n with Url = url\n HttpMethod = POST }\n\n /// Creates a request using the given method and url\n let request method url =\n { defaultRequestConfig\n with Url = url\n HttpMethod = method }\n\n /// Appends a request with headers as key-value pairs\n let withHeaders headers (req: HttpRequest) = { req with Headers = headers }\n\n /// Sets the withCredentials option on the XHR request, useful for CORS requests\n let withCredentials withCredentials (req: HttpRequest) =\n { req with WithCredentials = withCredentials }\n\n /// Appends a request with string body content\n let withBody body (req: HttpRequest) = { req with RequestBody = body }\n\n let private sendAndRead (preparation:(XMLHttpRequest -> unit) option) resultMapper (req: HttpRequest) = async {\n let! token = Async.CancellationToken\n let request = Async.FromContinuations <| fun (resolve, _, cancel) ->\n let xhr = XMLHttpRequest.Create()\n\n match req.HttpMethod with\n | GET -> xhr.``open``(\"GET\", req.Url)\n | POST -> xhr.``open``(\"POST\", req.Url)\n\n match preparation with\n | Some f -> f xhr\n | _ -> ignore()\n\n token.Register(fun _ ->\n xhr.abort()\n cancel(System.OperationCanceledException(token))\n ) |> ignore\n\n // set the headers, must be after opening the request\n for (key, value) in req.Headers do\n xhr.setRequestHeader(key, value)\n\n xhr.withCredentials <- req.WithCredentials\n\n xhr.onreadystatechange <- fun _ ->\n match xhr.readyState with\n | ReadyState.Done when not token.IsCancellationRequested ->\n xhr |> resultMapper |> resolve\n | _ -> ignore()\n\n match req.RequestBody with\n | Empty -> xhr.send()\n | RequestBody.Json content -> xhr.send(content)\n | Binary content -> xhr.send(InternalUtilities.toUInt8Array content)\n\n return! request\n }\n\n /// Sends the request to the server and asynchronously returns a response\n let send = sendAndRead None (fun xhr -> { StatusCode = unbox xhr.status; ResponseBody = xhr.responseText })\n\n /// Sends the request to the server and asynchronously returns the response as byte array\n let sendAndReadBinary =\n sendAndRead\n (Some (fun xhr -> xhr.responseType <- \"arraybuffer\" )) // read response as byte array\n (fun xhr ->\n let bytes = InternalUtilities.createUInt8Array xhr.response\n (bytes, xhr.status))\n\n","namespace Fable.Remoting.Client\n\nopen System\nopen Browser.Types\nopen Fable.Core\nopen Fable.Core.JsInterop\nopen System.Runtime.CompilerServices\n\n/// Utilities for working with binary data types in the browser\nmodule InternalUtilities =\n /// Creates a new instance of a FileReader\n []\n let createFileReader() : FileReader = jsNative\n []\n let createUInt8Array(x: 'a) : byte[] = jsNative\n /// Creates a Blob from the given input string\n []\n let createBlobFromBytesAndMimeType (value: byte[]) (mimeType: string) : Blob = jsNative\n /// Creates an object URL (also known as data url) from a Blob\n []\n let createObjectUrl (blob: Blob) : string = jsNative\n /// Releases an existing object URL which was previously created by calling createObjectURL(). Call this method when you've finished using an object URL to let the browser know not to keep the reference to the file any longer.\n []\n let revokeObjectUrl (dataUrl: string) : unit = jsNative\n /// Returns whether the input byte array is a typed array of type Uint8Array\n []\n let isUInt8Array (data: byte[]) : bool = jsNative\n /// Creates a typed byte array of binary data if it not already typed\n let toUInt8Array(data: byte[]) : byte[] =\n if isUInt8Array data\n then data\n else createUInt8Array data\n\n[]\nmodule BrowserFileExtensions =\n\n type File with\n\n /// Asynchronously reads the File content as byte[]\n member instance.ReadAsByteArray() =\n Async.FromContinuations <| fun (resolve, _, _) ->\n let reader = InternalUtilities.createFileReader()\n reader.onload <- fun _ ->\n if reader.readyState = FileReaderState.DONE\n then resolve(InternalUtilities.createUInt8Array(reader.result))\n\n reader.readAsArrayBuffer(instance)\n\n /// Asynchronously reads the File content as a data url string\n member instance.ReadAsDataUrl() =\n Async.FromContinuations <| fun (resolve, _, _) ->\n let reader = InternalUtilities.createFileReader()\n reader.onload <- fun _ ->\n if reader.readyState = FileReaderState.DONE\n then resolve(unbox reader.result)\n\n reader.readAsDataURL(instance)\n\n /// Asynchronously reads the File contents as text\n member instance.ReadAsText() =\n Async.FromContinuations <| fun (resolve, _, _) ->\n let reader = InternalUtilities.createFileReader()\n reader.onload <- fun _ ->\n if reader.readyState = FileReaderState.DONE\n then resolve(unbox reader.result)\n\n reader.readAsText(instance)\n\n[]\ntype ByteArrayExtensions =\n /// Saves the binary content as a file using the provided file name.\n []\n static member SaveFileAs(content: byte[], fileName: string) =\n\n if String.IsNullOrWhiteSpace(fileName) then\n ()\n else\n let mimeType = \"application/octet-stream\"\n let binaryData = InternalUtilities.toUInt8Array content\n let blob = InternalUtilities.createBlobFromBytesAndMimeType binaryData mimeType\n let dataUrl = InternalUtilities.createObjectUrl blob\n let anchor = (Browser.Dom.document.createElement \"a\")\n anchor?style <- \"display: none\"\n anchor?href <- dataUrl\n anchor?download <- fileName\n anchor?rel <- \"noopener\"\n anchor.click()\n // clean up\n anchor.remove()\n // clean up the created object url because it is being kept in memory\n Browser.Dom.window.setTimeout(unbox(fun () -> InternalUtilities.revokeObjectUrl(dataUrl)), 40 * 1000)\n |> ignore\n\n /// Saves the binary content as a file using the provided file name.\n []\n static member SaveFileAs(content: byte[], fileName: string, mimeType: string) =\n\n if String.IsNullOrWhiteSpace(fileName) then\n ()\n else\n let binaryData = InternalUtilities.toUInt8Array content\n let blob = InternalUtilities.createBlobFromBytesAndMimeType binaryData mimeType\n let dataUrl = InternalUtilities.createObjectUrl blob\n let anchor = Browser.Dom.document.createElement \"a\"\n anchor?style <- \"display: none\"\n anchor?href <- dataUrl\n anchor?download <- fileName\n anchor?rel <- \"noopener\"\n anchor.click()\n // clean up element\n anchor.remove()\n // clean up the created object url because it is being kept in memory\n Browser.Dom.window.setTimeout(unbox(fun () -> InternalUtilities.revokeObjectUrl(dataUrl)), 40 * 1000)\n |> ignore\n\n \n /// Converts the binary content into a data url by first converting it to a Blob of type \"application/octet-stream\" and reading it as a data url.\n []\n static member AsDataUrl(content: byte[]) : string =\n let binaryData = InternalUtilities.toUInt8Array content\n let blob = InternalUtilities.createBlobFromBytesAndMimeType binaryData \"application/octet-stream\"\n let dataUrl = InternalUtilities.createObjectUrl blob\n dataUrl\n\n /// Converts the binary content into a data url by first converting it to a Blob of the provided mime-type and reading it as a data url.\n []\n static member AsDataUrl(content: byte[], mimeType:string) : string =\n let binaryData = InternalUtilities.toUInt8Array content\n let blob = InternalUtilities.createBlobFromBytesAndMimeType binaryData mimeType\n let dataUrl = InternalUtilities.createObjectUrl blob\n dataUrl","namespace Fable.Remoting.Client\n\nopen System\nopen Fable.Core\nopen Fable.SimpleJson\nopen Browser.Types\n\nmodule internal Blob =\n /// Creates a Blob from the given input string\n []\n let fromBinaryEncodedText (value: byte[]) : Blob = jsNative\n\n /// Asynchronously reads the blob data content as string\n let readBlobAsText (blob: Blob) : Async =\n Async.FromContinuations <| fun (resolve, _, _) ->\n let reader = InternalUtilities.createFileReader()\n reader.onload <- fun _ ->\n if reader.readyState = FileReaderState.DONE\n then resolve (unbox reader.result)\n\n reader.readAsText(blob)\n\nmodule Proxy =\n let combineRouteWithBaseUrl route (baseUrl: string option) =\n match baseUrl with\n | None -> route\n | Some url -> sprintf \"%s%s\" (url.TrimEnd('/')) route\n\n let isByteArray = function\n | TypeInfo.Array getElemType ->\n match getElemType() with\n | TypeInfo.Byte -> true\n | otherwise -> false\n | otherwise -> false\n\n let isAsyncOfByteArray = function\n | TypeInfo.Async getAsyncType ->\n match getAsyncType() with\n | TypeInfo.Array getElemType ->\n match getElemType() with\n | TypeInfo.Byte -> true\n | otherwise -> false\n | otherwise -> false\n | otherwise -> false\n\n let rec getReturnType typ =\n if Reflection.FSharpType.IsFunction typ then\n let _, res = Reflection.FSharpType.GetFunctionElements typ\n getReturnType res\n elif typ.IsGenericType then\n typ.GetGenericArguments () |> Array.head\n else\n typ\n\n let proxyFetch options typeName (func: RecordField) fieldType =\n let funcArgs : (TypeInfo [ ]) =\n match func.FieldType with\n | TypeInfo.Async inner -> [| func.FieldType |]\n | TypeInfo.Promise inner -> [| func.FieldType |]\n | TypeInfo.Func getArgs -> getArgs()\n | _ -> failwithf \"Field %s does not have a valid definiton\" func.FieldName\n\n let argumentCount = (Array.length funcArgs) - 1\n let returnTypeAsync = Array.last funcArgs\n\n let binaryInput =\n match func.FieldType with\n | TypeInfo.Func getArgs ->\n match getArgs() with\n | [| input; output |] -> isByteArray input\n | otherwise -> false\n | otherwise -> false\n\n let route = options.RouteBuilder typeName func.FieldName\n let url = combineRouteWithBaseUrl route options.BaseUrl\n let funcNeedParameters =\n match funcArgs with\n | [| TypeInfo.Async _ |] -> false\n | [| TypeInfo.Promise _ |] -> false\n | [| TypeInfo.Unit; TypeInfo.Async _ |] -> false\n | otherwise -> true\n\n let contentType =\n if binaryInput\n then \"application/octet-stream\"\n else \"application/json; charset=utf-8\"\n\n let inputArgumentTypes = Array.take argumentCount funcArgs\n\n let headers = [\n yield \"Content-Type\", contentType\n yield \"x-remoting-proxy\", \"true\"\n yield! options.CustomHeaders\n match options.Authorization with\n | Some authToken -> yield \"Authorization\", authToken\n | None -> () ]\n\n let executeRequest =\n if options.CustomResponseSerialization.IsSome || isAsyncOfByteArray returnTypeAsync then\n let onOk =\n match options.CustomResponseSerialization with\n | Some serializer ->\n let returnType = getReturnType fieldType\n fun response -> serializer response returnType\n | _ -> box\n\n fun requestBody -> async {\n // read as arraybuffer and deserialize\n let! (response, statusCode) =\n if funcNeedParameters then\n Http.post url\n |> Http.withBody requestBody\n |> Http.withHeaders headers\n |> Http.withCredentials options.WithCredentials\n |> Http.sendAndReadBinary\n else\n Http.get url\n |> Http.withHeaders headers\n |> Http.withCredentials options.WithCredentials\n |> Http.sendAndReadBinary\n\n match statusCode with\n | 200 ->\n return onOk response\n | n ->\n let responseAsBlob = Blob.fromBinaryEncodedText response\n let! responseText = Blob.readBlobAsText responseAsBlob\n let response = { StatusCode = statusCode; ResponseBody = responseText }\n let errorMsg = if n = 500 then sprintf \"Internal server error (500) while making request to %s\" url else sprintf \"Http error (%d) while making request to %s\" n url\n return! raise (ProxyRequestException(response, errorMsg, response.ResponseBody))\n }\n else\n let returnType =\n match returnTypeAsync with\n | TypeInfo.Async getAsyncTypeArgument -> getAsyncTypeArgument()\n | TypeInfo.Promise getPromiseTypeArgument -> getPromiseTypeArgument()\n | TypeInfo.Any getReturnType ->\n let t = getReturnType()\n if t.FullName.StartsWith \"System.Threading.Tasks.Task`1\" then\n t.GetGenericArguments().[0] |> createTypeInfo\n else\n failwithf \"Expected field %s to have a return type of Async<'t> or Task<'t>\" func.FieldName\n | _ -> failwithf \"Expected field %s to have a return type of Async<'t> or Task<'t>\" func.FieldName\n\n fun requestBody -> async {\n // make plain RPC request and let it go through the deserialization pipeline\n let! response =\n if funcNeedParameters then\n Http.post url\n |> Http.withBody requestBody\n |> Http.withHeaders headers\n |> Http.withCredentials options.WithCredentials\n |> Http.send\n else\n Http.get url\n |> Http.withHeaders headers\n |> Http.withCredentials options.WithCredentials\n |> Http.send\n\n match response.StatusCode with\n | 200 ->\n let parsedJson = SimpleJson.parseNative response.ResponseBody\n return Convert.fromJsonAs parsedJson returnType\n | 500 -> return! raise (ProxyRequestException(response, sprintf \"Internal server error (500) while making request to %s\" url, response.ResponseBody))\n | n -> return! raise (ProxyRequestException(response, sprintf \"Http error (%d) from server occured while making request to %s\" n url, response.ResponseBody))\n }\n\n fun arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7 ->\n let inputArguments =\n if funcNeedParameters\n then Array.take argumentCount [| box arg0;box arg1;box arg2;box arg3; box arg4; box arg5; box arg6; box arg7 |]\n else [| |]\n\n let requestBody =\n if binaryInput then\n RequestBody.Binary (unbox arg0)\n else\n match inputArgumentTypes.Length with\n | 1 when not (Convert.arrayLike inputArgumentTypes.[0]) ->\n let typeInfo = TypeInfo.Tuple(fun _ -> inputArgumentTypes)\n let requestBodyJson = Convert.serialize inputArguments.[0] typeInfo\n RequestBody.Json requestBodyJson\n | 1 ->\n // for array-like types, use an explicit array surranding the input array argument\n let requestBodyJson = Convert.serialize [| inputArguments.[0] |] (TypeInfo.Array (fun _ -> inputArgumentTypes.[0]))\n RequestBody.Json requestBodyJson\n | n ->\n let typeInfo = TypeInfo.Tuple(fun _ -> inputArgumentTypes)\n let requestBodyJson = Convert.serialize inputArguments typeInfo\n RequestBody.Json requestBodyJson\n\n executeRequest requestBody\n","namespace Elmish.Toastr\r\n\r\nopen Elmish\r\nopen Fable.Core\r\nopen Fable.Core.JsInterop\r\n\r\n[]\r\ntype ToastPosition = \r\n | [] TopRight\r\n | [] BottomRight\r\n | [] TopLeft\r\n | [] BottomLeft\r\n | [] TopFullWidth\r\n | [] BottomFullWidth\r\n | [] TopCenter\r\n | [] BottomCenter\r\n\r\n[]\r\ntype Easing = \r\n | [] Swing\r\n | [] Linear\r\n\r\ntype ToastrOptions = \r\n []\r\n abstract timeout : int with get,set\r\n abstract closeButton : bool with get,set\r\n abstract newestOnTop : bool with get,set\r\n abstract progressBar : bool with get,set\r\n abstract preventDuplicates : bool with get,set\r\n abstract showDuration : int with get, set\r\n abstract hideDuration : int with get,set\r\n []\r\n abstract extendedTimeout : int with get,set\r\n []\r\n abstract position : ToastPosition with get, set\r\n abstract escapeHtml : bool with get, set\r\n abstract closeHtml : string with get,set\r\n abstract closeDuration : int with get,set\r\n []\r\n abstract rightToLeft : bool with get,set\r\n abstract showEasing : Easing with get, set\r\n abstract hideEasing : Easing with get,set\r\n abstract closeEasing : Easing with get,set\r\n abstract closeOnHover : bool with get,set\r\n abstract tapToDismiss : bool with get,set\r\n abstract onShown : (unit -> unit) with get,set\r\n abstract onHidden : (unit -> unit) with get,set\r\n abstract onclick : (unit -> unit) with get,set\r\n abstract onCloseClick : (unit -> unit) with get,set\r\n\r\n[]\r\nmodule Toastr = \r\n\r\n importAll \"toastr/build/toastr.min.css\"\r\n\r\n type ToastrMsg<'a> = { \r\n Message : string; \r\n Title: string; \r\n Options: ToastrOptions \r\n mutable Dispatcher : Option<'a -> unit>\r\n }\r\n\r\n let defaultMsg() = { \r\n Message = \"\"; \r\n Title = \"\"; \r\n Options = createEmpty\r\n Dispatcher = None \r\n }\r\n let private successToastWithTitle (msg: string) (title: string) (options: ToastrOptions) : unit = import \"success\" \"toastr\" \r\n let private errorToastWithTitle (msg: string) (title: string) (options: ToastrOptions) : unit = import \"error\" \"toastr\" \r\n let private infoToastWithTitle (msg: string) (title: string) (options: ToastrOptions) : unit = import \"info\" \"toastr\" \r\n let private warningToastWithTitle (msg: string) (title: string) (options: ToastrOptions) : unit = import \"warning\" \"toastr\" \r\n\r\n /// Sets the message of toast\r\n let message msg = { defaultMsg() with Message = msg }\r\n \r\n /// Sets the title of the toast\r\n let title title msg = { msg with Title = title }\r\n\r\n /// Defines the duration in ms after which the toast starts to disappear\r\n let timeout timeout msg = \r\n let options = msg.Options\r\n options.timeout <- timeout\r\n msg\r\n\r\n /// Sets the position of the toastr relative to the screen\r\n let position pos msg = \r\n let options = msg.Options\r\n options.position <- pos\r\n msg\r\n\r\n let extendedTimout t msg = \r\n let options = msg.Options\r\n options.extendedTimeout <- t\r\n msg\r\n\r\n /// Configures a message to be sent to the dispatch loop when the toast is clicked\r\n let onClick (nextMsg: 'a) (msg: ToastrMsg<'a>) = \r\n let options = msg.Options\r\n options.onclick <- fun () -> \r\n match msg.Dispatcher with\r\n | Some dispatcher -> dispatcher nextMsg\r\n | None -> ()\r\n msg\r\n\r\n /// Configures a message to be sent to the dispatch loop when the toast is shown on screen\r\n let onShown (nextMsg: 'a) (msg: ToastrMsg<'a>) = \r\n let options = msg.Options\r\n options.onShown <- fun () -> \r\n match msg.Dispatcher with\r\n | Some dispatcher -> dispatcher nextMsg\r\n | None -> ()\r\n msg \r\n\r\n let tapToDismiss msg = \r\n let options = msg.Options\r\n options.tapToDismiss <- true\r\n msg\r\n\r\n /// Configures a message to be sent to the dispatch loop when the toast has disappeared\r\n\r\n let onHidden (nextMsg: 'a) (msg: ToastrMsg<'a>) = \r\n let options = msg.Options\r\n options.onHidden <- fun () -> \r\n match msg.Dispatcher with\r\n | Some dispatcher -> dispatcher nextMsg\r\n | None -> ()\r\n msg \r\n\r\n /// Configures the toast to show a close button \r\n let showCloseButton msg = \r\n let options = msg.Options\r\n options.closeButton <- true\r\n msg\r\n \r\n /// Shows the progress bar of how long the toast will take before it disappears\r\n let withProgressBar msg = \r\n let options = msg.Options\r\n options.progressBar <- true\r\n msg\r\n \r\n /// Configures a message to be sent to the dispatch loop when the close button of toast is clicked\r\n let closeButtonClicked (nextMsg: 'a) (msg: ToastrMsg<'a>) = \r\n let options = msg.Options\r\n options.onCloseClick <- fun () -> \r\n match msg.Dispatcher with\r\n | Some dispatcher -> dispatcher nextMsg\r\n | None -> ()\r\n msg \r\n\r\n let hideEasing e msg = \r\n let options = msg.Options\r\n options.hideEasing <- e\r\n msg\r\n\r\n\r\n []\r\n let private mergeObjects x y = jsNative\r\n \r\n let mutable private options : ToastrOptions = import \"options\" \"toastr\"\r\n \r\n /// Overrides global options\r\n let overrideOptions (opts: ToastrOptions) : unit = \r\n options <- mergeObjects options opts\r\n \r\n /// Immediately remove current toasts without using animation\r\n let private remove() : unit = import \"remove\" \"toastr\"\r\n \r\n /// Remove current toasts using animation\r\n let private clear() : unit = import \"clear\" \"toastr\"\r\n \r\n /// Remove current toasts using animation\r\n let clearAll : Cmd<_> = \r\n [fun _ -> clear()]\r\n\r\n /// Remove current toasts using animation\r\n let removeAll : Cmd<_> = \r\n [fun _ -> remove()]\r\n\r\n /// Shows a success toast\r\n let success (msg: ToastrMsg<'msg>) : Cmd<'msg> = \r\n [fun dispatch -> \r\n msg.Dispatcher <- Some dispatch \r\n successToastWithTitle msg.Message msg.Title msg.Options]\r\n \r\n /// Shows an error taost\r\n let error (msg: ToastrMsg<'msg>) : Cmd<'msg> = \r\n [fun dispatch -> \r\n msg.Dispatcher <- Some dispatch \r\n errorToastWithTitle msg.Message msg.Title msg.Options]\r\n \r\n /// Shows an info toast\r\n let info (msg: ToastrMsg<'msg>) : Cmd<'msg> = \r\n [fun dispatch -> \r\n msg.Dispatcher <- Some dispatch \r\n infoToastWithTitle msg.Message msg.Title msg.Options]\r\n \r\n /// Shows a warning toast\r\n let warning (msg: ToastrMsg<'msg>) : Cmd<'msg> = \r\n [fun dispatch -> \r\n msg.Dispatcher <- Some dispatch \r\n warningToastWithTitle msg.Message msg.Title msg.Options]\r\n","module PortalLibs.Client.Notifications\r\n\r\n\r\nopen Elmish.Toastr\r\nopen Fable.Import\r\nopen PortalLibs.Shared.Notifications\r\nopen Thoth.Elmish\r\nopen System\r\nopen Elmish\r\n\r\nlet success str =\r\n Toastr.message $\"%s{str} successfully\"\r\n |> Toastr.position ToastPosition.TopCenter\r\n |> Toastr.timeout 1000\r\n |> Toastr.success\r\n\r\nlet error str =\r\n Toastr.message str\r\n |> Toastr.position BottomFullWidth\r\n |> Toastr.showCloseButton\r\n |> Toastr.error\r\n\r\nlet warning str =\r\n Toastr.message str\r\n |> Toastr.position BottomFullWidth\r\n |> Toastr.showCloseButton\r\n |> Toastr.timeout 10000\r\n |> Toastr.warning\r\n\r\nlet info str =\r\n Toastr.message str\r\n |> Toastr.position ToastPosition.TopCenter\r\n |> Toastr.timeout 5000\r\n |> Toastr.info\r\n\r\nlet showNotif msg =\r\n match msg with\r\n | Success str -> success str\r\n | Error str -> error str\r\n | Exception e ->\r\n Browser.Dom.console.error e\r\n error $\"Unhandled exception: {e.Message}\"\r\n | Warning str -> warning str\r\n | Info str -> info str\r\n\r\nlet debounce debouncer notifMsg msg =\r\n match msg with\r\n | Success _ -> Debouncer.bounce (TimeSpan.FromSeconds 2.5) $\"%A{msg}\" (notifMsg msg) debouncer\r\n | Error _ | Exception _ -> Debouncer.bounce (TimeSpan.FromSeconds 0.1) $\"%A{msg}\" (notifMsg msg) debouncer\r\n | Warning _ -> Debouncer.bounce (TimeSpan.FromSeconds 0.1) $\"%A{msg}\" (notifMsg msg) debouncer\r\n | Info _ -> Debouncer.bounce (TimeSpan.FromSeconds 2.0) $\"%A{msg}\" (notifMsg msg) debouncer","module PortalLibs.Client.Cmd\r\n\r\nopen Elmish\r\n\r\nmodule OfAsyncFromTask =\r\n let either task =\r\n Cmd.OfAsync.either (task |> Async.castTask)\r\n\r\n let attempt task =\r\n Cmd.OfAsync.attempt (task |> Async.castTask)\r\n \r\n let perform task =\r\n Cmd.OfAsync.perform (task |> Async.castTask)","namespace PortalLibs.Client\r\n\r\n\r\nopen PortalLibs.Shared\r\nopen PortalLibs.Shared.Api\r\nopen Thoth.Json\r\nopen Elmish\r\nopen Browser.WebStorage\r\nopen Browser\r\nopen Elmish.Bridge\r\nopen Fable.Remoting.Client\r\nopen FSharpPlus\r\n\r\ntype User =\r\n | LoggingIn\r\n | LoggedIn of UserData\r\n | LoggedOut\r\n | AuthException of exn\r\n\r\nmodule User =\r\n let private tryLoggedIn =\r\n function\r\n | LoggedIn userData -> Some userData\r\n | _ -> None\r\n \r\n let canSwitchRoles =\r\n tryLoggedIn\r\n >> map UserData.canSwitchRoles\r\n >> Option.defaultValue false\r\n \r\n let tryUserEmail =\r\n tryLoggedIn\r\n >> map (fun u -> u.Email)\r\n >> Option.defaultValue \"Unknown\"\r\n \r\n let tryEmailsMatch email =\r\n tryLoggedIn\r\n >> map (UserData.emailsMatch email)\r\n \r\nmodule Auth =\r\n type Model = { User: User }\r\n\r\n type ExternalMsg =\r\n | NoOp\r\n | LoggedIn\r\n\r\n type Msg =\r\n | NoOp\r\n | StorageFailure of exn\r\n | LogIn\r\n | LogInResult of Result\r\n | LoggedIn\r\n | LoggedOut\r\n | LogOut\r\n \r\n let loadUser () : UserData option =\r\n match Decode.Auto.fromString (localStorage.getItem \"user\") with\r\n | Ok user -> Some user\r\n | Result.Error _ -> None\r\n\r\n\r\n let saveUserCmd user =\r\n Cmd.OfFunc.either\r\n localStorage.setItem\r\n (\"user\", (Encode.Auto.toString (2, user)))\r\n (fun _ -> LoggedIn)\r\n StorageFailure\r\n\r\n let deleteUserCmd =\r\n Cmd.OfFunc.either localStorage.removeItem \"user\" (fun _ -> LoggedOut) StorageFailure\r\n\r\n let api: IRemoteProtocol =\r\n Remoting.createApi ()\r\n |> Remoting.withRouteBuilder Route.clientBuilder\r\n |> Remoting.buildProxy\r\n\r\n\r\n let init () =\r\n let user = loadUser ()\r\n\r\n { User = LoggingIn },\r\n (match user with\r\n | Some u -> Cmd.ofMsg (LogInResult(Ok u))\r\n | None -> Cmd.ofMsg LogIn)\r\n\r\n let update msg model =\r\n match msg with\r\n | LogIn ->\r\n model,\r\n Cmd.OfAsyncFromTask.either\r\n api.getUserData\r\n ()\r\n (Ok >> LogInResult)\r\n (Result.Error >> LogInResult),\r\n ExternalMsg.NoOp\r\n | LogInResult res ->\r\n match res with\r\n | Ok userData ->\r\n { model with\r\n User = User.LoggedIn userData },\r\n saveUserCmd userData,\r\n ExternalMsg.NoOp\r\n | Result.Error error ->\r\n { model with\r\n User =\r\n if error.Message.Contains(\"Http error (401)\") then\r\n model.User\r\n else\r\n User.AuthException error },\r\n (if error.Message.Contains(\"Http error (401)\") then\r\n Cmd.OfFunc.perform (fun () -> window.location.href <- \"/login\") () (fun () -> NoOp)\r\n else\r\n Cmd.none),\r\n ExternalMsg.NoOp\r\n | LogOut ->\r\n { model with User = User.LoggedOut },\r\n Cmd.batch [\r\n deleteUserCmd\r\n Cmd.OfFunc.perform (fun () -> window.location.href <- \"/logout\") () (fun () -> NoOp)\r\n ],\r\n ExternalMsg.NoOp\r\n | LoggedIn -> model, Cmd.none, ExternalMsg.LoggedIn\r\n | StorageFailure e -> model, $\"Auth Exception: %A{e}\" |> Notifications.error, ExternalMsg.NoOp\r\n | NoOp\r\n | LoggedOut -> model, Cmd.none, ExternalMsg.NoOp\r\n","namespace Fable.Remoting.Client\n\nopen Fable.Core\nopen Fable.SimpleJson\nopen System\nopen Microsoft.FSharp.Reflection\nopen Fable.Remoting\n\nmodule Remoting =\n /// Starts with default configuration for building a proxy\n let createApi() = {\n CustomHeaders = [ ]\n BaseUrl = None\n Authorization = None\n WithCredentials = false\n RouteBuilder = sprintf (\"/%s/%s\")\n CustomResponseSerialization = None\n }\n\n /// Defines how routes are built using the type name and method name. By default, the generated routes are of the form `/typeName/methodName`.\n let withRouteBuilder builder (options: RemoteBuilderOptions) =\n { options with RouteBuilder = builder }\n\n /// Sets the base url for the request. Useful if you are making cross-domain requests\n let withBaseUrl url (options: RemoteBuilderOptions) =\n { options with BaseUrl = Some url }\n\n /// Adds custom headers to each request of the proxy\n let withCustomHeader headers (options: RemoteBuilderOptions) =\n { options with CustomHeaders = headers }\n\n /// Sets the authorization header of every request from the proxy\n let withAuthorizationHeader token (options: RemoteBuilderOptions) =\n { options with Authorization = Some token }\n\n /// Sets the withCredentials option on the XHR request, which is useful for CORS scenarios\n let withCredentials withCredentials (options: RemoteBuilderOptions) =\n { options with WithCredentials = withCredentials }\n\n /// Specifies that the API uses binary serialization for responses\n let withBinarySerialization (options: RemoteBuilderOptions) =\n let serializer response returnType = MsgPack.Read.Reader(response).Read returnType\n { options with CustomResponseSerialization = Some serializer }\n\ntype Remoting() =\n /// For internal library use only.\n static member buildProxy(options: RemoteBuilderOptions, resolvedType: Type) =\n let schemaType = createTypeInfo resolvedType\n match schemaType with\n | TypeInfo.Record getFields ->\n let (fields, recordType) = getFields()\n let fieldTypes = Reflection.FSharpType.GetRecordFields recordType |> Array.map (fun prop -> prop.Name, prop.PropertyType)\n let recordFields = [|\n for field in fields do\n let normalize n =\n let fieldType = fieldTypes |> Array.pick (fun (name, typ) -> if name = field.FieldName then Some typ else None)\n let fn = Proxy.proxyFetch options recordType.Name field fieldType\n match n with\n | 0 -> box (fn null null null null null null null null)\n | 1 -> box (fun a ->\n fn a null null null null null null null)\n | 2 ->\n let proxyF a b = fn a b null null null null null null\n unbox (System.Func<_,_,_> proxyF)\n | 3 ->\n let proxyF a b c = fn a b c null null null null null\n unbox (System.Func<_,_,_,_> proxyF)\n | 4 ->\n let proxyF a b c d = fn a b c d null null null null\n unbox (System.Func<_,_,_,_,_> proxyF)\n | 5 ->\n let proxyF a b c d e = fn a b c d e null null null\n unbox (System.Func<_,_,_,_,_,_> proxyF)\n | 6 ->\n let proxyF a b c d e f = fn a b c d e f null null\n unbox (System.Func<_,_,_,_,_,_,_> proxyF)\n | 7 ->\n let proxyF a b c d e f g = fn a b c d e f g null\n unbox (System.Func<_,_,_,_,_,_,_,_> proxyF)\n | 8 ->\n let proxyF a b c d e f g h = fn a b c d e f g h\n unbox (System.Func<_,_,_,_,_,_,_,_,_> proxyF)\n | _ ->\n failwithf \"Cannot generate proxy function for %s. Only up to 8 arguments are supported. Consider using a record type as input\" field.FieldName\n\n let argumentCount =\n match field.FieldType with\n | TypeInfo.Async _ -> 0\n | TypeInfo.Promise _ -> 0\n | TypeInfo.Func getArgs -> Array.length (getArgs()) - 1\n | _ -> 0\n\n normalize argumentCount\n |]\n\n let proxy = FSharpValue.MakeRecord(recordType, recordFields)\n unbox proxy\n | _ ->\n failwithf \"Cannot build proxy. Exepected type %s to be a valid protocol definition which is a record of functions\" resolvedType.FullName\n\n static member inline buildProxy<'t>(options: RemoteBuilderOptions) : 't =\n Remoting.buildProxy(options, typeof<'t>)\n","namespace PortalLibs.Shared\r\n\r\nopen System.Threading.Tasks\r\n\r\nmodule Api =\r\n module Route =\r\n let prefix = \"/api\"\r\n let serverBuilder typeName methodName = $\"/%s{typeName}/%s{methodName}\"\r\n\r\n let clientBuilder typeName methodName =\r\n $\"%s{prefix}%s{serverBuilder typeName methodName}\"\r\n\r\n type IRemoteProtocol =\r\n { getUserData: unit -> Task }\r\n","namespace PortalLibs.Shared\r\n\r\nopen System\r\nopen System.Text.RegularExpressions\r\n\r\n[]\r\nmodule Formatting =\r\n \r\n type FormatCurrencyRounding =\r\n | Under1\r\n | AllTwoDigits\r\n | AllZero\r\n\r\n type FormatCurrencyNegativeValues =\r\n | MinusSign\r\n | Parenthesis\r\n\r\n let formatNumber withPlus negativeValues asCurrency rounding (value: float) =\r\n let digits =\r\n match rounding with\r\n | AllZero -> 0\r\n | AllTwoDigits -> 2\r\n | Under1 ->\r\n if Math.Abs(value) <= 0.1 then 2\r\n else if Math.Abs(value) <= 1.0 then 1\r\n else 0\r\n\r\n let rounded = Math.Round(value, digits)\r\n\r\n (if rounded > 0.0 && withPlus then\r\n \"+\"\r\n else\r\n \"\")\r\n + (if rounded < 0.0 then\r\n (match negativeValues with\r\n | MinusSign -> \"-\"\r\n | Parenthesis -> \"(\")\r\n else\r\n \"\")\r\n + (if asCurrency then \"$\" else \"\")\r\n + Regex.Replace(\r\n (sprintf\r\n (match digits with\r\n | 2 -> \"%.2f\"\r\n | 1 -> \"%.2f\"\r\n | _ -> \"%.0f\")\r\n (Math.Abs(rounded))),\r\n \"\\d(?=(\\d\\d\\d)+(?!\\d))\",\r\n \"$&,\"\r\n )\r\n + (if rounded < 0.0 && negativeValues = Parenthesis then\r\n \")\"\r\n else\r\n \"\")\r\n\r\n let formatPercent negativeValues percent =\r\n\r\n (if percent < 0.0 then\r\n (match negativeValues with\r\n | MinusSign -> \"-\"\r\n | Parenthesis -> \"(\")\r\n else\r\n \"\")\r\n + sprintf \"%s%%\" (Math.Round(percent * 100.0, 1).ToString(\"0.0#\"))\r\n + (if percent < 0.0 && negativeValues = Parenthesis then\r\n \")\"\r\n else\r\n \"\")","module Client.DisplayNumber\r\n\r\nopen Fable.Core\r\nopen PortalLibs.Client.Util\r\nopen Fable.React.Helpers\r\nopen FSharpPlus\r\nopen PortalLibs.Shared\r\n\r\nlet formatFiniteOrDefVal format defaultVal x =\r\n if not <| JS.isFinite defaultVal \r\n then failwith \"Default value must be a finite number.\"\r\n let input = if JS.isFinite x then x else defaultVal \r\n format input\r\n \r\nlet formatFiniteOrDef format = formatFiniteOrDefVal format Unchecked.defaultof\r\nlet formatOptOrEmptyStr format (opt: 'a option) = opt |>> format |> Option.emptyStrIfNone\r\n\r\ntype AsCurrency () =\r\n static member std(x: float) = x |> formatNumber false MinusSign true AllZero\r\n static member std(x: decimal) = x |> float |> AsCurrency.std\r\n \r\n static member stdOrDef = formatFiniteOrDef AsCurrency.std\r\n static member stdStr (x: float) = x |> AsCurrency.std |> str\r\n \r\n static member withParenthesis = formatNumber false Parenthesis true AllZero\r\n static member stdOrEmptyString (x: decimal option) = formatOptOrEmptyStr (AsCurrency.std: decimal -> string) x\r\n\r\ntype AsNumber() =\r\n static member std(x: float) = x |> formatNumber false MinusSign false AllZero\r\n static member std(x: decimal) = x |> float |> AsNumber.std\r\n static member stdOrDef = formatFiniteOrDef AsNumber.std\r\n static member stdOrEmptyString (x: decimal option) = formatOptOrEmptyStr (AsNumber.std: decimal -> string) x\r\n \r\ntype AsPercent() =\r\n static member withParenthesis = formatPercent Parenthesis\r\n static member withParenthesisOrDef = formatFiniteOrDef AsPercent.withParenthesis ","module AI\r\n\r\nopen FSharpPlus\r\nopen Client\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Model\r\nopen Fulma\r\nopen PortalLibs.Client.Util\r\nopen ContractPageModel\r\n\r\nlet randomAiInfo (contract: Contract) =\r\n let rnd = System.Random()\r\n let succ = (rnd.Next(30, 100) |> float) / 100.0\r\n\r\n { ContractId = contract.Id\r\n SuccessRate = succ }\r\n\r\nlet chartView (histories: JobHistory seq) (aiHistories: JobHistory seq) =\r\n let costData =\r\n histories\r\n |>> (fun h -> h.Date |> prettyPrintDateDashes, h.Cost)\r\n |> Seq.toArray\r\n\r\n let billingData =\r\n histories\r\n |>> fun h -> h.Date |> prettyPrintDateDashes, h.Billing\r\n |> Seq.toArray\r\n\r\n let aiCostData =\r\n aiHistories\r\n |>> fun (h: JobHistory) -> h.Date |> prettyPrintDateDashes, h.Cost\r\n |> Seq.toArray\r\n\r\n let aiBillingData =\r\n aiHistories\r\n |>> fun h -> h.Date |> prettyPrintDateDashes, h.Billing\r\n |> Seq.toArray\r\n\r\n let inputProps =\r\n {| prefix = \"$\"\r\n thousands = \",\"\r\n height = \"400px\"\r\n data =\r\n [| {| name = \"Costs\"; data = costData |}\r\n {| name = \"Billing\"; data = billingData |}\r\n {| name = \"AI Costs\"; data = aiCostData |}\r\n {| name = \"AI Billing\"; data = aiBillingData |} |]\r\n library =\r\n {| responsive = true\r\n hover = {| mode = \"nearest\"; intersect = true |}\r\n scales =\r\n {| y =\r\n {| display = true\r\n ticks = {| display = true; maxTicksLimit = 6 |}\r\n gridLines = {| display = true |} |}\r\n x = {| display = true\r\n gridLines =\r\n {| display = true\r\n color = \"rgba(0, 0, 0, 0.1)\"\r\n lineWidth = 1\r\n drawOnChartArea = 1 |} |} |}\r\n animation = {| duration = 1500; easing = \"easeOutElastic\" |} \r\n legend = {| position = \"bottom\" |}\r\n tooltip =\r\n {| mode = \"index\"\r\n intersect = false\r\n displayColors = true\r\n xPadding = 10\r\n yPadding = 10\r\n bodySpacing = 4 |}\r\n |} |}\r\n \r\n ofImport \"LineChart\" \"react-chartkick\" inputProps []\r\n\r\nlet view model (contract: Contract) aiInfos =\r\n let jobHistoriesOpt =\r\n Map.tryFind contract.Id model.JobHistories\r\n\r\n let aiHistoriesOpt =\r\n Map.tryFind contract.Id model.AIJobHistories\r\n\r\n let aiInfoOpt = Map.tryFind contract.Id aiInfos\r\n\r\n match aiInfoOpt, jobHistoriesOpt, aiHistoriesOpt with\r\n | Some aiInfo, Some jobHistories, Some aiHistories ->\r\n div [ Style [ PaddingBottom \"50px\" ] ] [\r\n div [ Style [\r\n MaxWidth \"900px\"\r\n MarginBottom \"40px\"\r\n MarginLeft \"20px\"\r\n ] ] [\r\n Heading.h5 [] [\r\n str \"Estimated Project Outcome\"\r\n ]\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexWrap \"wrap\"\r\n MaxWidth \"870px\"\r\n AlignSelf AlignSelfOptions.FlexEnd\r\n ] ] [\r\n match jobHistories |> List.tryLast with\r\n | Some last ->\r\n yield\r\n textFieldReadOnly\r\n \"Completion Date\"\r\n (match contract.EstCompletion with\r\n | None -> \"\"\r\n | Some date -> date |> prettyPrintDateLong)\r\n\r\n yield\r\n textFieldReadOnly\r\n \"Final Costs\"\r\n (last.Cost\r\n |> DisplayNumber.AsCurrency.std)\r\n\r\n yield\r\n textFieldReadOnly\r\n \"Final Billing\"\r\n (last.Billing\r\n |> DisplayNumber.AsCurrency.std)\r\n\r\n yield\r\n textFieldReadOnly\r\n \"Final Profit\"\r\n (last.Billing - last.Cost\r\n |> DisplayNumber.AsCurrency.std)\r\n\r\n yield\r\n textFieldReadOnly\r\n \"Final GP%\"\r\n (sprintf\r\n \"%s%%\"\r\n (System\r\n .Math\r\n .Round(\r\n (((last.Billing - last.Cost) / last.Billing)\r\n * 100.0),\r\n 1\r\n )\r\n .ToString()))\r\n | None -> ()\r\n ]\r\n Heading.h5 [] [\r\n str \"AI Predicted Project Outcome\"\r\n ]\r\n textFieldReadOnly\r\n \"Success Rate\"\r\n (sprintf\r\n \"%s%%\"\r\n (System\r\n .Math\r\n .Round(aiInfo.SuccessRate * 100.0, 1)\r\n .ToString()))\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexWrap \"wrap\"\r\n MaxWidth \"870px\"\r\n AlignSelf AlignSelfOptions.FlexEnd\r\n ] ] [\r\n match aiHistories |> List.tryLast with\r\n | Some last ->\r\n yield textFieldReadOnly \"Completion Date\" (last.Date |> prettyPrintDateLong)\r\n\r\n yield\r\n textFieldReadOnly\r\n \"Final Costs\"\r\n (last.Cost\r\n |> DisplayNumber.AsCurrency.std)\r\n\r\n yield\r\n textFieldReadOnly\r\n \"Final Billing\"\r\n (last.Billing\r\n |> DisplayNumber.AsCurrency.std)\r\n\r\n yield\r\n textFieldReadOnly\r\n \"Final Profit\"\r\n (last.Billing - last.Cost\r\n |> DisplayNumber.AsCurrency.std)\r\n\r\n yield\r\n textFieldReadOnly\r\n \"Final GP%\"\r\n (sprintf\r\n \"%s%%\"\r\n (System\r\n .Math\r\n .Round(\r\n (((last.Billing - last.Cost) / last.Billing)\r\n * 100.0),\r\n 1\r\n )\r\n .ToString()))\r\n | None -> ()\r\n ]\r\n ]\r\n chartView jobHistories aiHistories\r\n ]\r\n | _, _, _ -> nothing\r\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Container =\r\n\r\n type Option =\r\n /// Add `is-fluid` class\r\n | [] IsFluid\r\n /// Add `is-widescreen` class\r\n | [] IsWideScreen\r\n /// Add `is-fullhd` class\r\n | [] IsFullHD\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate
\r\n let container (options: Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | IsFluid\r\n | IsWideScreen\r\n | IsFullHD -> result.AddCaseName option\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"container\").ToReactElement(div, children)\r\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Content =\r\n\r\n type Option =\r\n | Size of ISize\r\n | CustomClass of string\r\n | Props of IHTMLProp list\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate
\r\n let content (options : Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Size size -> ofSize size |> result.AddClass\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"content\").ToReactElement(div, children)\r\n\r\n module Ol =\r\n\r\n type Option =\r\n | [] IsLowerRoman\r\n | [] IsUpperRoman\r\n | [] IsLowerAlpha\r\n | [] IsUpperAlpha\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n | Props of IHTMLProp list\r\n\r\n /// Generate
    \r\n let ol (options : Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | IsLowerRoman\r\n | IsUpperRoman\r\n | IsLowerAlpha\r\n | IsUpperAlpha -> result.AddCaseName option\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions).ToReactElement(ol, children)\r\n","module Shared.Branding\r\n\r\ntype Branding =\r\n | ICON\r\n | TRANSASH\r\n | SV\r\n\r\nlet parse (brand: string) =\r\n match brand |> Option.ofObj |> Option.map (fun x -> x.ToUpper()) |> Option.defaultValue \"\" with\r\n | \"ICON\" -> ICON\r\n | \"TRANSASH\" -> TRANSASH\r\n | _ -> SV","module Branding\r\n\r\nopen Browser\r\nopen Fable.Core.JsInterop\r\nopen Shared.Branding\r\n\r\nlet brandingFromVar = parse (window?BRAND.ToString())\r\n\r\nlet brandedFooter =\r\n match brandingFromVar with\r\n | ICON -> \"ICON PM Dashboard\"\r\n | TRANSASH -> \"TranshAsh PM Dashboard\"\r\n | SV -> \"PM Dashboard\"\r\n\r\nlet brandedLogo =\r\n match brandingFromVar with\r\n | ICON -> \"/Images/iconlogo.png\"\r\n | TRANSASH -> \"/Images/transashlogo.png\"\r\n | SV -> \"/Images/svlogo.png\"","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Browser.Types\r\n\r\n[]\r\nmodule Navbar =\r\n\r\n type Option =\r\n | Color of IColor\r\n /// Add `has-shadow` class\r\n | [] HasShadow\r\n /// Add `is-transparent` class\r\n | [] IsTransparent\r\n /// Add `is-fixed-top` class\r\n /// You also need to add `has-navbar-fixed-top` to your html tag\r\n | [] IsFixedTop\r\n /// Add `is-fixed-bottom` class\r\n /// You also need to add `has-navbar-fixed-bottom` to your html tag\r\n | [] IsFixedBottom\r\n /// Add `is-spaced` class\r\n /// Increases horizontal and vertical padding of the navbar\r\n | [] IsSpaced\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n module Menu =\r\n\r\n type Option =\r\n /// Add `is-active` class if true\r\n | [] IsActive of bool\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n module Burger =\r\n\r\n type Option =\r\n /// Add `is-active` class if true\r\n | [] IsActive of bool\r\n | OnClick of (MouseEvent -> unit)\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n module Item =\r\n\r\n type Option =\r\n /// Add `is-tab` class\r\n | [] IsTab\r\n /// Add `is-active` class if true\r\n | [] IsActive of bool\r\n /// Add `is-hoverable` class\r\n | [] IsHoverable\r\n /// Add `has-dropdown` class\r\n | [] HasDropdown\r\n /// Add `is-expanded` class\r\n | [] IsExpanded\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n let internal item element options children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | IsActive state -> if state then result.AddCaseName option else result\r\n | IsExpanded\r\n | IsTab\r\n | IsHoverable\r\n | HasDropdown -> result.AddCaseName option\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"navbar-item\").ToReactElement(element, children)\r\n\r\n /// Generate
    \r\n let div x y = item div x y\r\n /// Generate \r\n let a x y = item a x y\r\n\r\n module Link =\r\n\r\n type Option =\r\n /// Add `is-active` class if true\r\n | [] IsActive of bool\r\n /// Add `is-arrowless`\r\n | [] IsArrowless\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n let internal link element (options : Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | IsActive state -> if state then result.AddCaseName option else result\r\n | IsArrowless -> result.AddCaseName option\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"navbar-link\").ToReactElement(element, children)\r\n\r\n /// Generate
    \r\n let div x y = link div x y\r\n /// Generate \r\n let a x y = link a x y\r\n\r\n module Dropdown =\r\n\r\n type Option =\r\n /// Add `is-active` class if true\r\n | [] IsActive of bool\r\n /// Add `is-boxed` class\r\n | [] IsBoxed\r\n /// Add `is-right` class\r\n | [] IsRight\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n let internal dropdown element (options : Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | IsActive state -> if state then result.AddCaseName option else result\r\n | IsBoxed\r\n | IsRight -> result.AddCaseName option\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"navbar-dropdown\").ToReactElement(element, children)\r\n\r\n /// Generate
    \r\n let div x y = dropdown div x y\r\n /// Generate \r\n let a x y = dropdown a x y\r\n\r\n module Brand =\r\n let internal brand element (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"navbar-brand\").ToReactElement(element, children)\r\n\r\n /// Generate
    \r\n let div x y = brand div x y\r\n /// Generate \r\n let a x y = brand a x y\r\n\r\n module Start =\r\n let internal start element (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"navbar-start\").ToReactElement(element, children)\r\n\r\n /// Generate
    \r\n let div x y = start div x y\r\n /// Generate \r\n let a x y = start a x y\r\n\r\n module End =\r\n let internal ``end`` element (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"navbar-end\").ToReactElement(element, children)\r\n\r\n /// Generate
    \r\n let div x y = ``end`` div x y\r\n /// Generate \r\n let a x y = ``end`` a x y\r\n\r\n /// Generate \r\n let navbar (options : Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | HasShadow\r\n | IsFixedTop\r\n | IsFixedBottom\r\n | IsTransparent\r\n | IsSpaced -> result.AddCaseName option\r\n | Color color -> ofColor color |> result.AddClass\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"navbar\").ToReactElement(nav, children)\r\n\r\n /// Generate
    \r\n let menu options children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Menu.IsActive state -> if state then result.AddCaseName option else result\r\n | Menu.Props props -> result.AddProps props\r\n | Menu.CustomClass customClass -> result.AddClass customClass\r\n | Menu.Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"navbar-menu\").ToReactElement(div, children)\r\n\r\n /// Generate
    \r\n let burger options children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Burger.IsActive state -> if state then result.AddCaseName option else result\r\n | Burger.OnClick cb -> DOMAttr.OnClick cb |> result.AddProp\r\n | Burger.Props props -> result.AddProps props\r\n | Burger.CustomClass customClass -> result.AddClass customClass\r\n | Burger.Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"navbar-burger\").ToReactElement(div, children)\r\n\r\n /// Generate
    \r\n let content (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"navbar-content\").ToReactElement(div, children)\r\n\r\n /// Generate
    \r\n let divider (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"navbar-divider\").ToReactElement(div, children)\r\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Tabs =\r\n\r\n type Option =\r\n | Size of ISize\r\n /// Add `is-centered` class\r\n | [] IsCentered\r\n /// Add `is-right` class\r\n | [] IsRight\r\n /// Add `is-boxed` class\r\n | [] IsBoxed\r\n /// Add `is-toggle` class\r\n | [] IsToggle\r\n /// Add `is-toggle-rounded` class\r\n | [] IsToggleRounded\r\n /// Add `is-fullwidth` class\r\n | [] IsFullWidth\r\n | CustomClass of string\r\n | Props of IHTMLProp list\r\n | Modifiers of Modifier.IModifier list\r\n\r\n module Tab =\r\n\r\n type Option =\r\n /// Add `is-active` class if true\r\n | [] IsActive of bool\r\n | CustomClass of string\r\n | Props of IHTMLProp list\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate
      \r\n let tabs (options: Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | IsCentered\r\n | IsRight\r\n | IsBoxed\r\n | IsToggle\r\n | IsToggleRounded\r\n | IsFullWidth -> result.AddCaseName option\r\n | Size size -> ofSize size |> result.AddClass\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"tabs\").ToReactElement(div, [ ul [ ] children ])\r\n\r\n /// Generate
    • \r\n let tab (options: Tab.Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Tab.IsActive state -> if state then result.AddCaseName option else result\r\n | Tab.Props props -> result.AddProps props\r\n | Tab.CustomClass customClass -> result.AddClass customClass\r\n | Tab.Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions).ToReactElement(li, children)\r\n","module CostAndBilling\r\n\r\nopen FSharpPlus\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Model\r\nopen PortalLibs.Client.Util\r\nopen Fable.Core\r\nopen Fable.Core.JsInterop\r\nopen Fulma\r\nopen ContractPageModel\r\nopen System\r\nopen Shared\r\n\r\n[]\r\nlet ReactChartkick: obj = jsNative\r\n\r\nimportAll \"chartkick/chart.js\"\r\n\r\n[]\r\nlet Chart: obj = jsNative\r\n\r\nChart?defaults?elements?point?radius <- 0\r\n\r\nReactChartkick?addAdapter Chart\r\n\r\nlet chartView contractSettings (histories: JobHistory list, forecasts: JobForecast list) isDemo =\r\n \r\n let shiftDatesForDemo data min getDate update =\r\n match (data, isDemo) with\r\n | [], _ | _, false -> data\r\n | _ ->\r\n let peak = data |> (if min then List.minBy else List.maxBy) getDate\r\n let diff: TimeSpan = DateTime.Now - (getDate peak)\r\n if diff.TotalDays > 0 then\r\n data |> List.map(fun x -> (update x ((getDate x).AddDays diff.TotalDays)))\r\n else\r\n data\r\n \r\n let histories =\r\n shiftDatesForDemo histories false (fun x -> x.Date) (fun x d -> { x with Date = d })\r\n\r\n let forecasts =\r\n shiftDatesForDemo forecasts true (fun x -> x.ForecastDate) (fun x d -> { x with ForecastDate = d })\r\n \r\n let costData =\r\n histories\r\n |> Seq.skipWhile (fun h -> h.Cost = 0.0)\r\n |>> fun h -> h.Date |> prettyPrintDateDashes, Math.Round(h.Cost)\r\n |> Seq.toArray\r\n\r\n let billingData =\r\n histories\r\n |> Seq.skipWhile (fun h -> h.Billing = 0.0)\r\n |>> fun h -> h.Date |> prettyPrintDateDashes, Math.Round(h.Billing)\r\n |> Seq.toArray\r\n\r\n let billingForecastData =\r\n forecasts\r\n |> Seq.skipWhile (fun h -> h.BillingForecast = 0m)\r\n |>> fun h -> h.ForecastDate |> prettyPrintDateDashes, Math.Round(h.BillingForecast)\r\n |> Seq.toArray\r\n\r\n let varianceData =\r\n histories\r\n |> Seq.skipWhile (fun h -> h.Billing = 0.0 && h.Cost = 0.0)\r\n |>> fun h -> h.Date |> prettyPrintDateDashes, Math.Round(h.Billing - h.Cost)\r\n |> Seq.toArray\r\n\r\n let inputProps =\r\n {| prefix = \"$\"\r\n thousands = \",\"\r\n height = \"400px\"\r\n curve = false\r\n data =\r\n [| {| name = \"Billing\"\r\n data = billingData :> obj\r\n color = \"#00cc00\"\r\n dataset = null :> obj |}\r\n {| name = \"Billing Forecast\"\r\n data = billingForecastData\r\n color = \"#0000cc\"\r\n dataset = {| showLine = contractSettings.CostAndBillingForecasting |} |}\r\n {| name = \"Costs\"\r\n data = costData\r\n color = \"#cc0000\"\r\n dataset = null |}\r\n {| name = \"Variance\"\r\n data = varianceData\r\n color = \"#327da8\"\r\n dataset = {| showLine = false; pointHitRadius = 0 |} |} |]\r\n library =\r\n {| ```type`` = \"line\"\r\n responsive = true\r\n hover = {| mode = \"nearest\"; intersect = true |}\r\n scales =\r\n {| y =\r\n {| display = true\r\n ticks = {| display = true; maxTicksLimit = 6 |}\r\n gridLines = {| display = true |} |}\r\n x =\r\n {| display = true\r\n gridLines =\r\n {| display = true; color = \"rgba(0, 0, 0, 0.1)\"; lineWidth = 1; drawOnChartArea = 1 |} |} |}\r\n\r\n animation = {| duration = 1500; easing = \"easeOutElastic\" |}\r\n plugins =\r\n {| tooltip =\r\n {| mode = \"index\"\r\n intersect = false\r\n displayColors = true\r\n xPadding = 10\r\n yPadding = 10\r\n bodySpacing = 4 |}\r\n legend =\r\n {| position = \"bottom\"\r\n labels =\r\n {| display = true\r\n generateLabels =\r\n fun _ ->\r\n let baseLegend =\r\n [|{| text = \"Billing\"; fillStyle = \"#00cc00\"; hidden = false |}\r\n {| text = \"Costs\"; fillStyle = \"#cc0000\"; hidden = false |}|]\r\n let forecastLegend =\r\n [|{| text = \"Billing Forecast\"; fillStyle = \"#0000cc\"; hidden = false |}|]\r\n if contractSettings.CostAndBillingForecasting then\r\n Array.append baseLegend forecastLegend\r\n else baseLegend\r\n |} |} |}\r\n |}\r\n |}\r\n ofImport \"LineChart\" \"react-chartkick\" inputProps []\r\n\r\nlet isOver30Days contract =\r\n let isDateOver30Days (date: DateTime) = DateTime.Now.AddDays(-30.0) > date\r\n\r\n match contract.BillingLastRequestedDate, contract.LastBillDate with\r\n | None, None -> false\r\n | Some date, None -> isDateOver30Days date\r\n | None, Some date -> isDateOver30Days date\r\n | Some requested, Some billed ->\r\n if billed >= requested then\r\n isDateOver30Days billed\r\n else\r\n isDateOver30Days requested\r\n\r\nlet View (model: ContractPageModel.Model) contractSettings isDemo (contract: Contract) dispatch =\r\n let costAndBillingView data =\r\n div [ Style [ PaddingBottom \"50px\" ] ] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"flex-end\"\r\n AlignItems AlignItemsOptions.Center\r\n ] ] [\r\n strong [ Style [\r\n yield MarginRight \"15px\"\r\n if isOver30Days contract then\r\n yield Color \"Red\"\r\n ] ] [\r\n\r\n (match contract.BillingLastRequestedDate, contract.LastBillDate with\r\n | None, None -> \"Last Billed: never\"\r\n | Some date, None ->\r\n prettyPrintDateLong date\r\n |> sprintf \"Last Requested: %s\"\r\n | None, Some date ->\r\n prettyPrintDateLong date\r\n |> sprintf \"Last Billed: %s\"\r\n | Some requested, Some billed ->\r\n if billed >= requested then\r\n prettyPrintDateLong billed\r\n |> sprintf \"Last Billed: %s\"\r\n else\r\n prettyPrintDateLong requested\r\n |> sprintf \"Last Requested: %s\")\r\n |> str\r\n ]\r\n Button.button [ Button.OnClick(fun _ -> BillingRequested |> dispatch) ] [\r\n str \"Request Billing\"\r\n ]\r\n ]\r\n chartView contractSettings data isDemo\r\n ]\r\n\r\n\r\n let getHistoriesAndForecasts model =\r\n let histories = Map.tryFind contract.Id model.JobHistories\r\n let forecasts = Map.tryFind contract.Id model.JobForecasts\r\n match histories, forecasts with\r\n | Some hs, Some fs -> Some (hs, fs)\r\n | Some hs, None when not contractSettings.CostAndBillingForecasting -> Some(hs, [])\r\n | _, _ -> None\r\n\r\n\r\n loadingMessageOrContent\r\n \"Loading Costs and Billing...\"\r\n costAndBillingView (getHistoriesAndForecasts model)","module Client.ContractPage.ChangeOrders.Rows\r\n\r\nopen Elmish\r\nopen Feliz\r\nopen PortalLibs.Shared\r\n\r\ntype RowsState = { Expanded: int64 list }\r\ntype Msg = Expand of int64 | Collapse of int64\r\nlet init() = { Expanded = [] }, Cmd.none\r\nlet update msg state =\r\n match msg with\r\n | Expand id -> { state with Expanded = id :: state.Expanded }, Cmd.none\r\n | Collapse id -> { state with Expanded = state.Expanded |> List.filter (fun x -> x <> id) }, Cmd.none\r\n \r\nlet selectedRow = style.backgroundColor \"rgb(235, 235, 235)\"\r\n\r\n","namespace Client\r\n\r\nopen Feliz\r\n\r\ntype Styles() =\r\n static member sticky (?top: int, ?zIndex: int) = \r\n [ style.position.sticky\r\n style.top (top |> Option.defaultValue 0)\r\n style.zIndex (zIndex |> Option.defaultValue 0)\r\n style.backgroundColor.white ]\r\n static member stickyTableBorder = style.borderCollapse.separate\r\n static member bottomBorderWithColor(bottom: int, color: string) =\r\n [style.borderWidth(0, 0, bottom); style.color(color)]\r\n","module Client.ContractPage.ChangeOrders.Items\r\n\r\nopen FSharpPlus\r\nopen Client\r\nopen Elmish\r\nopen Fable.FontAwesome\r\nopen Fable.React\r\nopen Feliz\r\nopen Feliz.UseElmish\r\nopen Shared\r\nopen PortalLibs.Shared\r\nopen PortalLibs.Client.Util\r\nopen Feliz.Bulma\r\nopen Shared.Models\r\nopen Client.ContractPage.ChangeOrders.Rows\r\n\r\nlet ItemRow =\r\n React.memo<{| Item: ChangeOrderItem; ChildrenLines: ItemId -> ReactElement\r\n ChangeOrderType: ChangeOrderType\r\n Expanded: bool; Expand: int64 -> unit; Collapse: int64 -> unit |}>(\r\n name = \"ItemRow\",\r\n areEqual = Helpers.equalsButFunctions,\r\n withKey = (fun props -> props.Item.Id.ToString()),\r\n render = fun props ->\r\n \r\n let expanded = props.Expanded\r\n let toggle = if expanded then props.Collapse else props.Expand\r\n let item = props.Item\r\n let changeOrderType = props.ChangeOrderType\r\n \r\n React.fragment [\r\n Html.tr [\r\n prop.onClick (fun _ -> toggle item.Id)\r\n if expanded then prop.style[selectedRow]\r\n prop.children [\r\n Html.td [\r\n prop.style [ style.textAlign.right ]\r\n prop.text item.ACOItem\r\n ]\r\n if changeOrderType = ChangeOrderType.Pending then\r\n Html.td [\r\n prop.style [ style.textAlign.left ]\r\n prop.text (item.PCOType |> Option.emptyStrIfNone)\r\n ]\r\n Html.td [\r\n Html.a [\r\n Html.div [\r\n prop.style[ style.display.flex; style.justifyContent.spaceBetween ]\r\n prop.children [\r\n Html.strong[ item.Description |> emptyStrTagIfNone ]\r\n Bulma.icon [\r\n prop.style [ style.color \"#b5b5b5\" ]\r\n prop.children [\r\n Fa.i [ if expanded then Fa.Solid.ChevronUp else Fa.Solid.ChevronDown ] []\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n Html.td [\r\n prop.style [ style.textAlign.right ]\r\n prop.text (item.UM |> Option.emptyStrIfNone)\r\n ]\r\n Html.td [\r\n prop.style [ style.textAlign.right ]\r\n prop.text (item.Units |> DisplayNumber.AsNumber.stdOrEmptyString)\r\n ]\r\n Html.td [\r\n prop.style [ style.textAlign.right ]\r\n prop.text (item.UnitPrice |> DisplayNumber.AsCurrency.stdOrEmptyString)\r\n ]\r\n Html.td [\r\n prop.style [ style.textAlign.right ]\r\n prop.text (item.Amount |> DisplayNumber.AsNumber.std)\r\n ]\r\n ]\r\n ]\r\n if expanded then\r\n Html.tr [\r\n Html.td [\r\n prop.colSpan (if changeOrderType = ChangeOrderType.Pending then 7 else 6)\r\n prop.className \"change-orders-row-expanded\"\r\n prop.children [props.ChildrenLines item.Id]\r\n ]\r\n ]\r\n ]\r\n )\r\n \r\nlet ItemsTable =\r\n React.memo<{| Items: Map; ChildrenLines: ItemId -> ReactElement\r\n Header: ChangeOrderHeader |}>(\r\n name = \"ItemsTable\",\r\n render = fun props ->\r\n \r\n let items = props.Items |> Map.tryFind props.Header.Id\r\n let changeOrderType = props.Header.Type\r\n let state, dispatch = React.useElmish(init, update, [| box items |])\r\n let isPending = changeOrderType = ChangeOrderType.Pending\r\n match items with\r\n | None -> Html.text \"Loading items...\"\r\n | Some items -> \r\n Bulma.table [\r\n prop.style [ style.alignSelf.flexEnd; Styles.stickyTableBorder ]\r\n table.isFullWidth\r\n table.isHoverable\r\n prop.children [\r\n Html.thead [\r\n Html.tr [\r\n prop.style (Styles.sticky(40, 1))\r\n prop.children [\r\n let th styles (pct: int) (txt: string) =\r\n Html.th [\r\n prop.style [\r\n yield! styles\r\n style.verticalAlign.bottom\r\n style.width(length.percent pct)\r\n yield! Styles.bottomBorderWithColor(2, \"#363636\")\r\n ]\r\n prop.text txt\r\n ]\r\n th [style.textAlign.right] 5 ((if isPending then \"PCO\" else \"ACO\") + \" Item\")\r\n if isPending then th [style.textAlign.left] 5 \"PCO Type\"\r\n th [] 65 \"Description\"\r\n \r\n th [style.textAlign.right] 5 \"UM\"\r\n th [style.textAlign.right] 5 \"Units\"\r\n th [style.textAlign.right] 5 \"Unit Price\"\r\n th [style.textAlign.right] 10 \"Amount\"\r\n ]\r\n ]\r\n ]\r\n Html.tbody [\r\n match items with\r\n | [] -> Html.tr [\r\n Html.td [\r\n prop.colSpan (if changeOrderType = ChangeOrderType.Pending then 7 else 6)\r\n prop.style [ style.textAlign.center; style.padding(length.px 30, 0)]\r\n prop.text \"No Change Order Items\"\r\n ]]\r\n | items ->\r\n yield! items |>> fun item ->\r\n ItemRow {| Item = item; Collapse = (Collapse >> dispatch)\r\n Expand = (Expand >> dispatch); Expanded = state.Expanded |> List.contains item.Id\r\n ChangeOrderType = changeOrderType\r\n ChildrenLines = props.ChildrenLines |}\r\n ]\r\n ]\r\n ]\r\n )","module Client.ContractPage.ChangeOrders.Lines\r\n\r\nopen FSharpPlus\r\nopen Client\r\nopen Elmish\r\nopen Feliz\r\nopen Shared\r\nopen PortalLibs.Shared\r\nopen Feliz.Bulma\r\nopen Shared.Models\r\n\r\nlet LineRow =\r\n React.memo<{| Line: ChangeOrderLine |}>(\r\n name = \"LineRow\",\r\n withKey = (fun props -> props.Line.Id.ToString()),\r\n render = fun props ->\r\n let line = props.Line\r\n React.fragment [\r\n Html.tr [\r\n let td styles (txt: string) =\r\n Html.td [\r\n prop.style styles\r\n prop.text txt\r\n ]\r\n \r\n prop.children [\r\n td [style.textAlign.right] (line.Phase |> Option.emptyStrIfNone)\r\n td [style.textAlign.left] (line.PhaseDescription |> Option.emptyStrIfNone)\r\n td [style.textAlign.right] (line.CostType |> Option.emptyStrIfNone)\r\n td [style.textAlign.right] (line.UM |> Option.emptyStrIfNone)\r\n td [style.textAlign.right] (line.UnitCost |> DisplayNumber.AsCurrency.stdOrEmptyString)\r\n td [style.textAlign.right] (line.EstUnits |> DisplayNumber.AsNumber.stdOrEmptyString)\r\n td [style.textAlign.right] (line.HourCost |> DisplayNumber.AsCurrency.stdOrEmptyString)\r\n td [style.textAlign.right] (line.EstHours |> DisplayNumber.AsNumber.stdOrEmptyString)\r\n td [style.textAlign.right] (line.EstCost |> DisplayNumber.AsCurrency.stdOrEmptyString)\r\n ]\r\n ]\r\n ]\r\n )\r\n\r\nlet LinesTable =\r\n React.memo<{| Lines: Map; ItemId: ItemId |}>(\r\n name = \"LinesTable\",\r\n render = fun props ->\r\n let lines = props.Lines |> Map.tryFind props.ItemId\r\n \r\n match lines with\r\n | None -> Html.text \"Loading lines...\"\r\n | Some lines ->\r\n Bulma.table [\r\n prop.style [ style.alignSelf.flexEnd; style.width(length.percent 100); Styles.stickyTableBorder ]\r\n table.isFullWidth\r\n table.isHoverable\r\n prop.children [\r\n Html.thead [\r\n Html.tr [\r\n prop.style (Styles.sticky 100)\r\n prop.children [\r\n let th styles (pct: int) (txt: string) =\r\n Html.th [\r\n prop.style [\r\n yield! styles\r\n style.verticalAlign.bottom\r\n style.width(length.percent pct)\r\n yield! Styles.bottomBorderWithColor(2, \"#363636\")\r\n ]\r\n prop.text txt\r\n ]\r\n th [style.textAlign.right] 10 \"Phase\"\r\n th [style.textAlign.left] 30 \"Description\"\r\n th [style.textAlign.right] 5 \"Cost Type\"\r\n th [style.textAlign.right] 5 \"UM\"\r\n th [style.textAlign.right] 10 \"Unit Cost\"\r\n th [style.textAlign.right] 10 \"Est Units\"\r\n th [style.textAlign.right] 10 \"Hour Cost\"\r\n th [style.textAlign.right] 10 \"Est Hours\"\r\n th [style.textAlign.right] 10 \"Est Cost\"\r\n ]\r\n ]\r\n ]\r\n Html.tbody [\r\n match lines with \r\n | [] -> Html.tr [\r\n Html.td [\r\n prop.colSpan 9\r\n prop.style [ style.textAlign.center; style.padding(length.px 30, 0)]\r\n prop.text \"No Change Order Lines\"\r\n ]]\r\n \r\n | lines -> yield! lines |>> fun line -> LineRow {| Line = line |} \r\n ]\r\n ]\r\n ]\r\n )","import { toList, toArray, map, filter, delay } from \"./Seq.js\";\r\nimport { HashSet } from \"./MutableSet.js\";\r\nimport { addToDict, getItemFromDict, tryGetValue, addToSet } from \"./MapUtil.js\";\r\nimport { Dictionary } from \"./MutableMap.js\";\r\nimport { disposeSafe, getEnumerator } from \"./Util.js\";\r\nimport { FSharpRef } from \"./Types.js\";\r\n\r\nexport function distinct(xs, comparer) {\r\n return delay(() => {\r\n const hashSet = new HashSet([], comparer);\r\n return filter((x) => addToSet(x, hashSet), xs);\r\n });\r\n}\r\n\r\nexport function distinctBy(projection, xs, comparer) {\r\n return delay(() => {\r\n const hashSet = new HashSet([], comparer);\r\n return filter((x) => addToSet(projection(x), hashSet), xs);\r\n });\r\n}\r\n\r\nexport function except(itemsToExclude, xs, comparer) {\r\n return delay(() => {\r\n const hashSet = new HashSet(itemsToExclude, comparer);\r\n return filter((x) => addToSet(x, hashSet), xs);\r\n });\r\n}\r\n\r\nexport function countBy(projection, xs, comparer) {\r\n return delay(() => {\r\n const dict = new Dictionary([], comparer);\r\n const keys = [];\r\n const enumerator = getEnumerator(xs);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const key = projection(enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n let matchValue;\r\n let outArg = 0;\r\n matchValue = [tryGetValue(dict, key, new FSharpRef(() => outArg, (v) => {\r\n outArg = (v | 0);\r\n })), outArg];\r\n if (matchValue[0]) {\r\n dict.set(key, matchValue[1] + 1);\r\n }\r\n else {\r\n dict.set(key, 1);\r\n void (keys.push(key));\r\n }\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n return map((key_1) => [key_1, getItemFromDict(dict, key_1)], keys);\r\n });\r\n}\r\n\r\nexport function groupBy(projection, xs, comparer) {\r\n return delay(() => {\r\n const dict = new Dictionary([], comparer);\r\n const keys = [];\r\n const enumerator = getEnumerator(xs);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const x = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n const key = projection(x);\r\n let matchValue;\r\n let outArg = null;\r\n matchValue = [tryGetValue(dict, key, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n if (matchValue[0]) {\r\n void (matchValue[1].push(x));\r\n }\r\n else {\r\n addToDict(dict, key, [x]);\r\n void (keys.push(key));\r\n }\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n return map((key_1) => [key_1, getItemFromDict(dict, key_1)], keys);\r\n });\r\n}\r\n\r\nexport function Array_distinct(xs, comparer) {\r\n return toArray(distinct(xs, comparer));\r\n}\r\n\r\nexport function Array_distinctBy(projection, xs, comparer) {\r\n return toArray(distinctBy(projection, xs, comparer));\r\n}\r\n\r\nexport function Array_except(itemsToExclude, xs, comparer) {\r\n return toArray(except(itemsToExclude, xs, comparer));\r\n}\r\n\r\nexport function Array_countBy(projection, xs, comparer) {\r\n return toArray(countBy(projection, xs, comparer));\r\n}\r\n\r\nexport function Array_groupBy(projection, xs, comparer) {\r\n return toArray(map((tupledArg) => [tupledArg[0], toArray(tupledArg[1])], groupBy(projection, xs, comparer)));\r\n}\r\n\r\nexport function List_distinct(xs, comparer) {\r\n return toList(distinct(xs, comparer));\r\n}\r\n\r\nexport function List_distinctBy(projection, xs, comparer) {\r\n return toList(distinctBy(projection, xs, comparer));\r\n}\r\n\r\nexport function List_except(itemsToExclude, xs, comparer) {\r\n return toList(except(itemsToExclude, xs, comparer));\r\n}\r\n\r\nexport function List_countBy(projection, xs, comparer) {\r\n return toList(countBy(projection, xs, comparer));\r\n}\r\n\r\nexport function List_groupBy(projection, xs, comparer) {\r\n return toList(map((tupledArg) => [tupledArg[0], toList(tupledArg[1])], groupBy(projection, xs, comparer)));\r\n}\r\n\r\n","module Client.ContractPage.ChangeOrders.Headers\r\n\r\nopen FSharpPlus\r\nopen Client\r\nopen Fable.FontAwesome\r\nopen Fable.React\r\nopen Feliz\r\nopen Feliz.Bulma\r\nopen Feliz.UseElmish\r\nopen PortalLibs.Client.Util\r\nopen Client.ContractPage.ChangeOrders.Rows\r\nopen Shared.Models\r\nopen PortalLibs.Shared\r\n\r\nlet TopRow =\r\n React.memo<{| Header: ChangeOrderHeader; ChildrenItems: ChangeOrderHeader -> ReactElement\r\n Expanded: bool; Expand: int64 -> unit; Collapse: int64 -> unit |}>(\r\n name = \"ChangeOrderRow\",\r\n areEqual = Helpers.equalsButFunctions,\r\n withKey = (fun props -> props.Header.Id.ToString()),\r\n render = fun props ->\r\n \r\n let expanded = props.Expanded\r\n let toggle = if expanded then props.Collapse else props.Expand\r\n let header = props.Header\r\n let isApproved = header.Type = ChangeOrderType.Approved\r\n \r\n React.fragment [\r\n Html.tr [\r\n prop.onClick (fun _ -> toggle header.Id)\r\n if expanded then prop.style[selectedRow]\r\n prop.children [\r\n Html.td [\r\n prop.style [style.textAlign.right]\r\n prop.text(header.ACO |> Option.emptyStrIfNone)\r\n ] \r\n Html.td [\r\n Html.a [\r\n Html.div [\r\n prop.style[ style.display.flex; style.justifyContent.spaceBetween ]\r\n prop.children [\r\n Html.strong[ header.Description |> emptyStrTagIfNone ]\r\n Bulma.icon [\r\n prop.style [ style.color \"#b5b5b5\" ]\r\n prop.children [\r\n Fa.i [ if expanded then Fa.Solid.ChevronUp else Fa.Solid.ChevronDown ] []\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n if isApproved then\r\n Html.td [\r\n prop.text (header.ApprovalDate |> prettyPrintDateOptionLong)\r\n ]\r\n ]\r\n ]\r\n if expanded then\r\n Html.tr [\r\n Html.td [\r\n prop.colSpan (if isApproved then 5 else 4)\r\n prop.className \"change-orders-row-expanded\"\r\n prop.children [props.ChildrenItems header]\r\n ]\r\n ] \r\n ]\r\n )\r\n\r\nlet TopRows = \r\n React.memo<{| Headers: ChangeOrderHeader list\r\n ChildrenItems: ChangeOrderHeader -> ReactElement |}, ReactElement list>(\r\n name = \"TopRows\",\r\n render = fun props ->\r\n let state, dispatch = React.useElmish(init, update, [| |])\r\n \r\n props.Headers |>> (fun header ->\r\n TopRow {| Header = header; Collapse = (Collapse >> dispatch)\r\n Expand = (Expand >> dispatch); Expanded = state.Expanded |> List.contains header.Id\r\n ChildrenItems = props.ChildrenItems\r\n |}\r\n )\r\n )\r\nlet View (headers: ChangeOrderHeader list) orderType childrenItems =\r\n let matchOrderType app pen =\r\n match orderType with\r\n | ChangeOrderType.Approved -> app\r\n | ChangeOrderType.Pending -> pen\r\n | _ -> failwith \"Invalid Change Order Type\"\r\n \r\n let title = matchOrderType \"Approved\" \"Pending\"\r\n let acoName = matchOrderType \"ACO\" \"PCO\"\r\n Html.div [\r\n prop.style [\r\n style.paddingBottom (length.px 50)\r\n style.marginLeft(length.auto); style.marginRight(length.auto);\r\n style.display.flex; style.flexDirection.column\r\n ]\r\n prop.children [\r\n Bulma.title.h5($\"{title} Change Orders\")\r\n Bulma.table [\r\n prop.style [ style.alignSelf.flexEnd; Styles.stickyTableBorder ]\r\n table.isFullWidth\r\n table.isHoverable\r\n prop.children [\r\n Html.thead [\r\n Html.tr [\r\n prop.style (Styles.sticky(zIndex = 2))\r\n prop.children [\r\n Html.th [\r\n prop.style [ style.textAlign.right; style.width(length.percent 5) ]\r\n prop.text acoName\r\n ]\r\n Html.th [\r\n prop.style [ style.width(length.percent (matchOrderType 60 95)) ]\r\n prop.text \"Description\"\r\n ]\r\n if orderType = ChangeOrderType.Approved then\r\n Html.th [\r\n prop.style [ style.width(length.percent 35) ]\r\n prop.text \"Approval Date\"\r\n ]\r\n ]\r\n ]\r\n ]\r\n Html.tbody [\r\n match headers with\r\n | [] ->\r\n yield Html.tr [\r\n Html.td [\r\n prop.colSpan (if orderType = ChangeOrderType.Approved then 3 else 2)\r\n prop.style [style.textAlign.center; style.padding(length.px 30, 0) ]\r\n prop.text \"No Pending Change Orders\"\r\n ]\r\n ]\r\n | _ -> yield TopRows {| Headers = headers; ChildrenItems = childrenItems |}\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]","module Client.ContractPage.ChangeOrders.Main\r\n\r\nopen Feliz\r\nopen PortalLibs.Client\r\nopen PortalLibs.Client.Util\r\nopen PortalLibs.Shared\r\nopen Model\r\nopen Client.ContractPage.ChangeOrders\r\nopen Shared.Models\r\nopen Lines\r\nopen Items\r\n\r\nlet View changeOrders items lines (contract: Contract) =\r\n let orderView (orders: ChangeOrderHeader list) =\r\n React.fragment [\r\n \r\n let lineFactory itemId = LinesTable {| Lines = lines; ItemId = itemId |}\r\n let itemFactory header = ItemsTable {| Items = items; Header = header; ChildrenLines = lineFactory |}\r\n \r\n let grouped = orders |> List.groupBy (fun x -> x.Type)\r\n let get expType = grouped |> List.where(fun (t,_) -> t = expType) |> List.map snd |> List.concat\r\n \r\n Headers.View (get ChangeOrderType.Approved) ChangeOrderType.Approved itemFactory\r\n Headers.View (get ChangeOrderType.Pending) ChangeOrderType.Pending itemFactory\r\n ]\r\n \r\n loadingMessageOrContent\r\n \"Loading change orders...\"\r\n orderView\r\n (Map.tryFind contract.Id changeOrders) ","module ARAndCashFlow\r\n\r\nopen Client\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen PortalLibs.Client.Util\r\nopen Fulma\r\nopen Model\r\n\r\nlet accountsReceivableView contract arBucketsOpt =\r\n div [ Style [\r\n MaxWidth \"900px\"\r\n MarginLeft \"auto\"\r\n MarginRight \"auto\"\r\n Display DisplayOptions.Flex\r\n FlexDirection \"column\"\r\n ] ] [\r\n Heading.h5 [] [\r\n str \"Accounts Receivable\"\r\n ]\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexWrap \"wrap\"\r\n MaxWidth \"870px\"\r\n ] ] [\r\n textFieldReadOnly\r\n \"Total Due\"\r\n (contract.ARTotalDue\r\n |> DisplayNumber.AsCurrency.std)\r\n textFieldReadOnly\r\n \"Unbilled\"\r\n (contract.ARUnbilled\r\n |> DisplayNumber.AsCurrency.std)\r\n match arBucketsOpt with\r\n | None -> textFieldReadOnly \"AR Buckets\" \"Loading...\"\r\n | Some buckets ->\r\n yield!\r\n buckets\r\n |> List.map\r\n (fun bucket ->\r\n textFieldReadOnly\r\n bucket.Label\r\n (bucket.Value\r\n |> DisplayNumber.AsCurrency.std))\r\n textFieldReadOnly\r\n \"Retainage\"\r\n (contract.ARRetainage\r\n |> DisplayNumber.AsCurrency.std)\r\n ]\r\n ]\r\n\r\nlet cashFlowView contract =\r\n let asCurrency (x: float) = x |> DisplayNumber.AsCurrency.std\r\n div [ Style [\r\n MarginTop \"10px\"\r\n MaxWidth \"900px\"\r\n MarginLeft \"auto\"\r\n MarginRight \"auto\"\r\n Display DisplayOptions.Flex\r\n FlexDirection \"column\"\r\n ] ] [\r\n Heading.h5 [] [ str \"Cash Flow\" ]\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexFlow \"row wrap\"] ] [\r\n textFieldReadOnly \"Contract Amount\" (contract.CFContractAmount |> asCurrency)\r\n textFieldReadOnly \"Billings To Date\" (contract.CFBillingsToDate |> asCurrency)\r\n textFieldReadOnly \"Cost To Date\" (contract.CFCostToDate |> asCurrency)\r\n textFieldReadOnlyStyles\r\n (Some 200)\r\n [ if contract.CFNetCashFlow < 0.0 then\r\n yield Feliz.style.color \"red\"\r\n yield Feliz.style.custom (\"WebkitTextFillColor\", \"red\") ]\r\n \"Net Cash Flow\" (contract.CFNetCashFlow |> asCurrency)\r\n ]\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexFlow \"row wrap\" ] ] [\r\n textFieldReadOnly \"Estimated Cost\" (contract.CFEstimatedCost|> asCurrency)\r\n textFieldReadOnly \"Contract Receivables & Retainage\" (contract.CFCRAndRetainage|> asCurrency)\r\n textFieldReadOnly \"Accounts Payable\" (contract.CFAccountsPayable|> asCurrency)\r\n ]\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexFlow \"row wrap\" ] ] [\r\n textFieldReadOnly \"Estimated Gross Profit\" (contract.CFEstimatedGrossProfit|> asCurrency)\r\n textFieldReadOnly \"Cash Collected\" (contract.CFCashCollected|> asCurrency)\r\n textFieldReadOnly \"Cash Paid\" (contract.CFCashPaid|> asCurrency)\r\n ]\r\n ]\r\n\r\nlet View (model: ContractPageModel.Model) contract =\r\n div [ Style [ PaddingBottom \"50px\" ] ] [\r\n accountsReceivableView contract (model.ContractARBuckets |> Map.tryFind contract.Id)\r\n cashFlowView contract\r\n ]","module Client.ContractPage.CostOfConstruction.Utils\r\n\r\nopen System\r\nopen Client\r\nopen Fable.Core\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Feliz\r\nopen Model\r\nopen FSharpPlus\r\nopen PortalLibs.Shared\r\nopen Shared\r\n\r\nlet alignRight = [ TextAlign TextAlignOptions.Right ]\r\nlet formatPossibleNotFinite x = if JS.isFinite x then sprintf \"%s%%\" (x.ToString()) else String.Empty \r\nlet formatMargin profit revenue =\r\n (profit / revenue) * 100.0\r\n |> fun x -> Math.Round(x, 1)\r\n |> formatPossibleNotFinite\r\n |> str\r\n \r\nlet optionalRedColor x = [if JS.isFinite x && x < 0.0 then yield style.color.red]\r\n\r\ntype Costs =\r\n { OrigEstCost: float\r\n CurrentEstCost: float\r\n ActualCostToDate: float\r\n ActualHoursToDate: float\r\n CostToComplete: float\r\n PctEstimate: float\r\n PMRevisedCost: float\r\n EarnedRevenue: float\r\n GrossProfit: float }\r\n static member (+) (a: Costs, b: Costs) =\r\n { OrigEstCost = a.OrigEstCost + b.OrigEstCost\r\n CurrentEstCost = a.CurrentEstCost + b.CurrentEstCost\r\n ActualCostToDate = a.ActualCostToDate + b.ActualCostToDate\r\n ActualHoursToDate = a.ActualHoursToDate + b.ActualHoursToDate\r\n CostToComplete = a.CostToComplete + b.CostToComplete\r\n PctEstimate = a.PctEstimate + b.PctEstimate\r\n PMRevisedCost = a.PMRevisedCost + b.PMRevisedCost\r\n EarnedRevenue = a.EarnedRevenue + b.EarnedRevenue\r\n GrossProfit = a.GrossProfit + b.GrossProfit }\r\n static member Zero =\r\n { OrigEstCost = 0.0\r\n CurrentEstCost = 0.0\r\n ActualCostToDate = 0.0\r\n ActualHoursToDate = 0.0\r\n CostToComplete = 0.0\r\n PctEstimate = 0.0\r\n PMRevisedCost = 0.0\r\n EarnedRevenue = 0.0\r\n GrossProfit = 0.0 }\r\n \r\n static member FromJobCost(jobCost: JobCost) =\r\n { OrigEstCost = jobCost.OrigEstCost\r\n CurrentEstCost = jobCost.CurrentEstCost\r\n ActualCostToDate = jobCost.ActualCostToDate\r\n ActualHoursToDate = jobCost.ActualHoursToDate\r\n CostToComplete = jobCost.CostToComplete\r\n PctEstimate = jobCost.PctEstimate\r\n PMRevisedCost = jobCost.PMRevisedCost\r\n EarnedRevenue = jobCost.EarnedRevenue\r\n GrossProfit = jobCost.GrossProfit }\r\n\r\nlet totalColumns contractSettings costs =\r\n let tdPrice x =\r\n Html.td [\r\n prop.style [style.textAlign.right]\r\n prop.children [\r\n Html.strong [\r\n prop.style <| optionalRedColor x\r\n prop.text(x |> DisplayNumber.AsCurrency.std)\r\n ]\r\n ]\r\n ]\r\n \r\n let total = costs |> Seq.map Costs.FromJobCost |> sum\r\n \r\n [ tdPrice total.EarnedRevenue\r\n tdPrice total.OrigEstCost \r\n tdPrice total.CurrentEstCost\r\n tdPrice total.ActualCostToDate\r\n tdPrice total.CostToComplete\r\n tdPrice total.GrossProfit\r\n td [ Style alignRight ] [\r\n strong [] [ formatMargin total.GrossProfit total.EarnedRevenue ] \r\n ]\r\n if contractSettings.Projections then\r\n td [ Style alignRight ] []\r\n\r\n td [ Style alignRight ] [\r\n strong [ Style [\r\n if total.ActualCostToDate > total.PMRevisedCost then\r\n yield Color \"red\"\r\n ] ] [\r\n total.PMRevisedCost |> DisplayNumber.AsCurrency.stdStr\r\n ]\r\n ] ]","namespace FSharpPlus.Internals\n\n#nowarn \"77\"\n// Warn FS0077 -> Member constraints with the name 'get_Item' are given special status by the F# compiler as certain .NET types are implicitly augmented with this member. This may result in runtime failures if you attempt to invoke the member constraint from your own code.\n// Those .NET types are string and array. String is explicitely handled here and array through the seq overload.\n\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\nopen FSharpPlus.Control\n\n\n[]\ntype _Dual<'T> =\n struct\n val Value : 'T\n new (value: 'T) = {Value = value}\n end\n static member inline get_Zero () = _Dual (Zero.Invoke ()) : _Dual<'m>\n static member inline (+) (x: _Dual<'m>, y: _Dual<'m>) = _Dual (Plus.Invoke y.Value x.Value) : _Dual<'m>\n\n[]\ntype _Endo<'T> =\n struct\n val Value : 'T -> 'T\n new (value: 'T -> 'T) = {Value = value}\n end\n static member get_Zero () = _Endo id : _Endo<'m>\n static member (+) (f: _Endo<'m>, g: _Endo<'m>) = _Endo (f.Value << g.Value) : _Endo<'m>\n\nnamespace FSharpPlus.Control\n\nopen System\nopen System.Runtime.InteropServices\nopen System.Text\nopen System.Collections.Generic\nopen FSharpPlus\nopen FSharpPlus.Data\nopen FSharpPlus.Internals\nopen FSharpPlus.Internals.Prelude\n\n\n\ntype ToSeq =\n inherit Default1\n static member ToSeq (x: seq<'T> , []_impl: ToSeq) = x\n static member ToSeq (x: Text.StringBuilder, _: ToSeq) = string x :> seq\n static member ToSeq (x: string , _: ToSeq) = String.toSeq x\n static member ToSeq (x: option<'T>, []_impl: ToSeq) = match x with Some x -> Seq.singleton x | _ -> Seq.empty\n static member ToSeq (x: Id<'T> , []_impl: ToSeq) = Seq.singleton x.getValue\n\n static member inline Invoke (source: '``Foldable<'T>``) : seq<'T> =\n let inline call_2 (a: ^a, b: ^b) = ((^a or ^b) : (static member ToSeq : _*_ -> _) b, a)\n let inline call (a: 'a, b: 'b) = call_2 (a, b)\n call (Unchecked.defaultof, source)\n\n static member inline InvokeOnInstance (source: '``Foldable<'T>``) : seq<'T> = (^``Foldable<'T>``: (static member ToSeq : _ -> _) source)\n\ntype ToSeq with\n static member inline ToSeq (x: 'S when 'S :> Collections.IEnumerable, []_impl: Default2) = let _f i x : 'T = (^S : (member get_Item : int -> 'T) x, i) in Seq.cast<'T> x : seq<'T>\n static member inline ToSeq (x: 'Foldable , []_impl: Default1) = ToSeq.InvokeOnInstance x\n static member inline ToSeq (_: 'T when 'T: null and 'T: struct , _: Default1) = ()\n\n\ntype ToList =\n inherit Default1 \n static member inline ToList (x , []_impl: Default3) = x |> ToSeq.Invoke |> Seq.toList\n static member ToList (x: seq<'a> , []_impl: Default2) = Seq.toList x\n static member inline ToList (x , []_impl: Default1) = (^Foldable : (static member ToList : 'Foldable->list<_>) x)\n static member ToList (x: Set<'a> , []_impl: ToList ) = Set.toList x\n static member ToList (x: string , []_impl: ToList ) = String.toList x\n static member ToList (x: StringBuilder , []_impl: ToList ) = x.ToString().ToCharArray() |> Array.toList\n static member ToList (x: 'a [] , []_impl: ToList ) = Array.toList x\n static member ToList (x: 'a ResizeArray, []_impl: ToList ) = Seq.toList x\n static member ToList (x: list<'a> , []_impl: ToList ) = x\n\n static member inline Invoke value : 't list = \n let inline call_2 (a: ^a, b: ^b) = ((^a or ^b) : (static member ToList : _*_ -> _) b, a)\n let inline call (a: 'a, b: 'b) = call_2 (a, b)\n call (Unchecked.defaultof, value)\n\n\ntype ToArray =\n inherit Default1\n static member inline ToArray (x , []_impl: Default3) = x |> ToSeq.Invoke |> Seq.toArray\n static member ToArray (x: seq<'a> , []_impl: Default2) = Seq.toArray x\n static member inline ToArray (x , []_impl: Default1) = (^Foldable : (static member ToArray : 'Foldable->array<_>) x)\n static member ToArray (x: Set<'a> , []_impl: ToArray ) = Set.toArray x\n static member ToArray (x: string , []_impl: ToArray ) = String.toArray x\n static member ToArray (x: StringBuilder , []_impl: ToArray ) = x.ToString().ToCharArray ()\n static member ToArray (x: 'a [] , []_impl: ToArray ) = x\n static member ToArray (x: 'a ResizeArray, []_impl: ToArray ) = Seq.toArray x\n static member ToArray (x: list<'a> , []_impl: ToArray ) = List.toArray x\n\n static member inline Invoke value : 't [] = \n let inline call_2 (a: ^a, b: ^b) = ((^a or ^b) : (static member ToArray : _*_ -> _) b, a)\n let inline call (a: 'a, b: 'b) = call_2 (a, b)\n call (Unchecked.defaultof, value)\n\n\ntype FoldBack =\n inherit Default1\n static member inline FoldBack (x: 'F , f: 'a->'b->'b, z: 'b , []_impl: Default2) = List.foldBack f (ToList.Invoke x) z\n static member inline FoldBack (x: 'F , f: 'a->'b->'b, z: 'b , []_impl: Default1) = (^F : (static member FoldBack : ^F -> _ -> _-> ^b) x, f, z)\n static member FoldBack (x: seq<_> , f , z , []_impl: FoldBack) = List.foldBack f (Seq.toList x) z\n static member FoldBack (x: option<_> , f , z , []_impl: FoldBack) = match x with Some x -> f x z | _ -> z\n static member FoldBack (x: list<_> , f , z , []_impl: FoldBack) = List.foldBack f x z\n static member FoldBack (x: _ [] , f , z , []_impl: FoldBack) = Array.foldBack f x z\n static member FoldBack (x: Set<_> , f , z , []_impl: FoldBack) = Set.foldBack f x z\n static member FoldBack (x: _ ResizeArray, f , z , []_impl: FoldBack) = Array.foldBack f (x.ToArray ()) z\n static member FoldBack (x: string , f , z , []_impl: FoldBack) = Array.foldBack f (x.ToCharArray ()) z\n static member FoldBack (x: StringBuilder, f , z , []_impl: FoldBack) = Array.foldBack f (x.ToString().ToCharArray ()) z \n static member FoldBack (x: Id<'a> , f , z , []_impl: FoldBack) = f x.getValue z\n\n static member inline Invoke (folder: 'T->'State->'State) (state: 'State) (foldable: '``Foldable'``) : 'State =\n let inline call_2 (a: ^a, b: ^b, f, z) = ((^a or ^b) : (static member FoldBack : _*_*_*_ -> _) b, f, z, a)\n let inline call (a: 'a, b: 'b, f, z) = call_2 (a, b, f, z)\n call (Unchecked.defaultof, foldable, folder, state)\n\n\ntype FoldMap =\n inherit Default1\n\n static member inline FromFoldFoldBack f x = FoldBack.Invoke (Plus.Invoke << f) (Zero.Invoke ()) x\n\n static member inline FoldMap (x: option<_>, f, []_impl: FoldMap ) = match x with Some x -> f x | _ -> Zero.Invoke ()\n static member inline FoldMap (x: list<_> , f, []_impl: FoldMap ) = List.fold (fun x y -> Plus.Invoke x (f y)) (Zero.Invoke ()) x\n static member inline FoldMap (x: Set<_> , f, []_impl: FoldMap ) = Seq.fold (fun x y -> Plus.Invoke x (f y)) (Zero.Invoke ()) x\n static member inline FoldMap (x: _ [] , f, []_impl: FoldMap ) = Array.fold (fun x y -> Plus.Invoke x (f y)) (Zero.Invoke ()) x\n\n static member inline Invoke (f: 'T->'Monoid) (x: '``Foldable'``) : 'Monoid =\n let inline call_2 (a: ^a, b: ^b, f) = ((^a or ^b) : (static member FoldMap : _*_*_ -> _) b, f, a)\n let inline call (a: 'a, b: 'b, f) = call_2 (a, b, f)\n call (Unchecked.defaultof, x, f)\n\ntype FoldMap with\n static member inline FoldMap (x: seq<_> , f, []_impl: Default2) = Seq.fold (fun x y -> Plus.Invoke x (f y)) (Zero.Invoke ()) x\n static member inline FoldMap (x , f, []_impl: Default1) = (^F : (static member FoldMap : ^F -> _ -> _) x, f)\n static member inline FoldMap (_: ^t when ^t: null and ^t: struct, _, _: Default1) = ()\n\ntype FoldBack with\n static member inline FromFoldMap f z x = let (f: _Endo<'t>) = FoldMap.Invoke (_Endo << f) x in f.Value z\n\n\ntype Fold =\n inherit Default1\n\n static member inline FromFoldMap f z t = let (f: _Dual<_Endo<'t>>) = FoldMap.Invoke (_Dual << _Endo << flip f) t in f.Value.Value z\n\n static member inline Fold (x , f, z, []_impl: Default2) = Seq.fold f z (ToSeq.Invoke x)\n static member inline Fold (x: 'F , f: 'b->'a->'b, z: 'b, []_impl: Default1) = (^F : (static member Fold : ^F -> _ -> _-> ^b) x, f, z)\n static member Fold (x: option<_>, f, z , []_impl: Fold ) = match x with Some x -> f z x | _ -> z\n static member Fold (x: Id<_> , f, z , []_impl: Fold ) = f z x.getValue\n static member Fold (x: seq<_> , f, z , []_impl: Fold ) = Seq.fold f z x\n static member Fold (x: list<_> , f, z , []_impl: Fold ) = List.fold f z x\n static member Fold (x: Set<_> , f, z , []_impl: Fold ) = Set.fold f z x\n static member Fold (x: _ [] , f, z , []_impl: Fold ) = Array.fold f z x\n\n static member inline Invoke (folder: 'State->'T->'State) (state: 'State) (foldable: '``Foldable'``) : 'State =\n let inline call_2 (a: ^a, b: ^b, f, z) = ((^a or ^b) : (static member Fold : _*_*_*_ -> _) b, f, z, a)\n let inline call (a: 'a, b: 'b, f, z) = call_2 (a, b, f, z)\n call (Unchecked.defaultof, foldable, folder, state)\n \n \ntype Exists =\n inherit Default1\n static member inline Exists (x , f , []_impl: Default2) = Seq.exists f (ToSeq.Invoke x) : bool\n static member inline Exists (x: '``Foldable<'T>``, f: 'T->bool, []_impl: Default1) = (^``Foldable<'T>`` : (static member Exists : '``Foldable<'T>``-> _ -> bool) (x, f))\n static member Exists (x: Id<'T> , f , []_impl: Exists ) = f x.getValue : bool\n static member Exists (x: list<'a> , f , []_impl: Exists ) = List.exists f x\n static member Exists (x: 'a [] , f , []_impl: Exists ) = Array.exists f x\n static member Exists (x: Set<'a> , f , []_impl: Exists ) = Set.exists f x\n static member Exists (x: 'a ResizeArray , f , []_impl: Exists ) = Seq.exists f x\n static member Exists (x: string , f , []_impl: Exists ) = String.exists f x \n static member Exists (x: StringBuilder , f , []_impl: Exists ) = x |> string |> String.exists f\n\n static member inline Invoke (predicate: 'T->bool) (source: '``Foldable'``) =\n let inline call_3 (a: ^a, b: ^b, f) = ((^a or ^b) : (static member Exists : _*_*_ -> _) b, f, a)\n let inline call (a: 'a, b: 'b, f) = call_3 (a, b, f)\n call (Unchecked.defaultof, source, predicate) : bool\n \n\ntype ForAll =\n inherit Default1\n static member inline ForAll (x , f , []_impl: Default2) = Seq.forall f (ToSeq.Invoke x) : bool\n static member inline ForAll (x: '``Foldable<'T>``, f: 'T->bool, []_impl: Default1) = (^``Foldable<'T>`` : (static member ForAll : '``Foldable<'T>``-> _ -> bool) (x, f))\n static member ForAll (x: Id<'T> , f , []_impl: ForAll ) = f x.getValue : bool\n static member ForAll (x: list<'a> , f , []_impl: ForAll ) = List.forall f x\n static member ForAll (x: 'a [] , f , []_impl: ForAll ) = Array.forall f x\n static member ForAll (x: Set<'a> , f , []_impl: ForAll ) = Set.forall f x\n static member ForAll (x: string , f , []_impl: ForAll ) = String.forall f x\n static member ForAll (x: 'a ResizeArray , f , []_impl: ForAll ) = Seq.forall f x\n static member ForAll (x: StringBuilder , f , []_impl: ForAll ) = x |> string |> String.forall f\n\n static member inline Invoke (predicate: 'T->bool) (source: '``Foldable'``) =\n let inline call_3 (a: ^a, b: ^b, f) = ((^a or ^b) : (static member ForAll : _*_*_ -> _) b, f, a)\n let inline call (a: 'a, b: 'b, f) = call_3 (a, b, f)\n call (Unchecked.defaultof, source, predicate) : bool\n\n\ntype Find =\n inherit Default1\n static member inline Find (x , f , []_impl: Default2) = Seq.find f (ToSeq.Invoke x) : 'T\n static member inline Find (x: '``Foldable<'T>``, f: 'T->bool, []_impl: Default1) = (^``Foldable<'T>`` : (static member Find : '``Foldable<'T>``-> _ -> 'T) (x, f))\n static member Find (x: Id<'T> , f , []_impl: Find ) = List.find f [x.getValue]\n static member Find (x: ResizeArray<'T> , f , []_impl: Find ) = Seq.find f x\n static member Find (x: list<'T> , f , []_impl: Find ) = List.find f x\n static member Find (x: 'T [] , f , []_impl: Find ) = Array.find f x\n\n static member inline Invoke (predicate: 'T->bool) (source: '``Foldable'``) =\n let inline call_2 (a: ^a, b: ^b, f) = ((^a or ^b) : (static member Find : _*_*_ -> _) b, f, a)\n let inline call (a: 'a, b: 'b, x: 'x) = call_2 (a, b, x)\n call (Unchecked.defaultof, source, predicate) : 'T\n\n\ntype TryFind =\n inherit Default1\n static member inline TryFind (x , f, []_impl: Default1) = Seq.tryFind f (ToSeq.Invoke x) : 'T option\n static member TryFind (x: Id<'T> , f, []_impl: TryFind ) = List.tryFind f [x.getValue]\n static member TryFind (x: seq<'T> , f, []_impl: TryFind ) = Seq.tryFind f x\n static member TryFind (x: list<'T>, f, []_impl: TryFind ) = List.tryFind f x\n static member TryFind (x: 'T [] , f, []_impl: TryFind ) = Array.tryFind f x\n\n static member inline Invoke (predicate: 'T->bool) (source: '``Foldable'``) =\n let inline call_2 (a: ^a, b: ^b, f) = ((^a or ^b) : (static member TryFind : _*_*_ -> _) b, f, a)\n let inline call (a: 'a, b: 'b, x: 'x) = call_2 (a, b, x)\n call (Unchecked.defaultof, source, predicate) : 'T option\n\n\ntype Head =\n inherit Default1\n static member inline Head (x: '``Foldable<'T>``, []_impl: Default2) = Seq.head (ToSeq.Invoke x) : 'T\n static member inline Head (x: '``Foldable<'T>``, []_impl: Default1) = (^``Foldable<'T>`` : (member Head : 'T) x)\n static member Head (x: 'T option , []_impl: Head ) = x.Value\n static member Head (x: 'T [] , []_impl: Head ) = x.[0]\n static member Head (x: NonEmptySeq<'T> , []_impl: Head ) = x.First\n static member Head (x: Id<'T> , []_impl: Head ) = x.getValue\n static member Head (x: ResizeArray<'T> , []_impl: Head ) = x.[0]\n static member Head (x: string , []_impl: Head ) = x.[0]\n static member Head (x: StringBuilder , []_impl: Head ) = x.ToString().[0]\n\n static member inline Invoke (source: '``Foldable'``) =\n let inline call_2 (a: ^a, b: ^b) = ((^a or ^b) : (static member Head : _*_ -> _) b, a)\n let inline call (a: 'a, b: 'b) = call_2 (a, b)\n call (Unchecked.defaultof, source) : 'T\n\ntype TryHead =\n inherit Default1\n static member inline TryHead (x , []_impl: Default1) = Seq.tryHead <| ToSeq.Invoke x\n static member TryHead (x: 't list , []_impl: TryHead ) = List.tryHead x\n static member TryHead (x: 't [] , []_impl: TryHead ) = Array.tryHead x\n static member TryHead (x: NonEmptySeq<'T>,[]_impl: TryHead) = Some x.First\n static member TryHead (x: Id<'T> , []_impl: TryHead ) = Some x.getValue\n static member TryHead (x: string , []_impl: TryHead ) = String.tryHead x \n static member TryHead (x: StringBuilder, []_impl: TryHead ) = if x.Length = 0 then None else Some (x.ToString().[0])\n static member TryHead (x: 't seq , []_impl: TryHead ) = Seq.tryHead x\n\n static member inline Invoke (source: '``Foldable'``) =\n let inline call_2 (a: ^a, b: ^b) = ((^a or ^b) : (static member TryHead : _*_ -> _) b, a)\n let inline call (a: 'a, b: 'b) = call_2 (a, b)\n call (Unchecked.defaultof, source) : 'T option\n\ntype TryLast =\n inherit Default1\n static member inline TryLast (x , []_impl: Default1) = Seq.tryLast <| ToSeq.Invoke x\n static member TryLast (x: 't list , []_impl: TryLast) = List.tryLast x\n static member TryLast (x: 't [] , []_impl: TryLast) = Array.tryLast x\n static member TryLast (x: NonEmptySeq<'T>, []_impl: TryLast) = Some <| Seq.last x\n static member TryLast (x: Id<'T> , []_impl: TryLast ) = Some x.getValue\n static member TryLast (x: string , []_impl: TryLast ) = String.tryLast x \n static member TryLast (x: StringBuilder , []_impl: TryLast ) = if x.Length = 0 then None else Some (x.ToString().[x.Length - 1])\n static member TryLast (x: 't seq , []_impl: TryLast ) = Seq.tryLast x\n\n static member inline Invoke (source: '``Foldable'``) =\n let inline call_2 (a: ^a, b: ^b) = ((^a or ^b) : (static member TryLast : _*_ -> _) b, a)\n let inline call (a: 'a, b: 'b) = call_2 (a, b)\n call (Unchecked.defaultof, source) : 'T option\n\ntype Pick =\n inherit Default1\n static member inline Pick (x: '``Foldable<'T>``, f: 'T->'U option, []_impl: Default2) = Seq.pick f (ToSeq.Invoke x) : 'U\n static member inline Pick (x: '``Foldable<'T>``, f: 'T->'U option, []_impl: Default1) = (^``Foldable<'T>`` : (static member Pick : '``Foldable<'T>``-> _ -> 'T) (x, f))\n static member Pick (x: Id<'T> , f: 'T->'U option, []_impl: Pick ) = List.pick f [x.getValue]\n static member Pick (x: ResizeArray<'T> , f: 'T->'U option, []_impl: Pick ) = Seq.pick f x\n static member Pick (x: list<'T> , f: 'T->'U option, []_impl: Pick ) = List.pick f x\n static member Pick (x: 'T [] , f: 'T->'U option, []_impl: Pick ) = Array.pick f x\n\n static member inline Invoke (chooser: 'T->'U option) (source: '``Foldable'``) =\n let inline call_2 (a: ^a, b: ^b, x) = ((^a or ^b ) : (static member Pick : _*_*_ -> _) b, x, a)\n let inline call (a: 'a, b: 'b, x: 'x) = call_2 (a, b, x)\n call (Unchecked.defaultof, source, chooser) : 'U\n\n\ntype TryPick =\n inherit Default1\n static member inline TryPick (x , f: _->'U option, []_impl: Default1) = Seq.tryPick f (ToSeq.Invoke x) : 'U option\n static member TryPick (_: Id<'T> , _: _->'U option, []_impl: TryPick ) = invalidOp \"TryPick on ID\" : 'U option\n static member TryPick (x: seq<'T> , f: _->'U option, []_impl: TryPick ) = Seq.tryPick f x\n static member TryPick (x: list<'T>, f: _->'U option, []_impl: TryPick ) = List.tryPick f x\n static member TryPick (x: 'T [] , f: _->'U option, []_impl: TryPick ) = Array.tryPick f x\n\n static member inline Invoke (chooser: 'T->'U option) (source: '``Foldable'``) =\n let inline call_2 (a: ^a, b: ^b, x) = ((^a or ^b) : (static member TryPick : _*_*_ -> _) b, x, a)\n let inline call (a: 'a, b: 'b, x: 'x) = call_2 (a, b, x)\n call (Unchecked.defaultof, source, chooser) : 'U option\n \n\ntype Nth =\n inherit Default1\n static member inline Nth (x: '``Foldable<'T>``, n, []_impl: Default3) = x |> ToSeq.Invoke |> Seq.skip n |> Seq.head : 'T\n static member Nth (x: IReadOnlyList<'a>, n, []_impl: Default2) = x.[n]\n static member Nth (x: IList<'a> , n, []_impl: Default1) = x.[n]\n static member Nth (x: string , n, []_impl: Nth ) = x.[n]\n static member Nth (x: StringBuilder , n, []_impl: Nth ) = x.ToString().[n]\n static member Nth (x: 'a [] , n, []_impl: Nth ) = x.[n] : 'a\n static member Nth (x: 'a ResizeArray , n, []_impl: Nth ) = x.[n]\n static member Nth (x: list<'a> , n, []_impl: Nth ) = x.[n]\n static member Nth (x: 'a Id , _, []_impl: Nth ) = x.getValue\n\n static member inline Invoke (n: int) (source: '``Foldable<'T>``) : 'T =\n let inline call_2 (a: ^a, b: ^b, n) = ((^a or ^b) : (static member Nth : _*_*_ -> _) b, n, a)\n let inline call (a: 'a, b: 'b, n) = call_2 (a, b, n)\n call (Unchecked.defaultof, source, n)\n\n\ntype Max =\n inherit Default1\n static member inline Max (x: '``Foldable<'T>``, []_impl: Default2) = x |> ToSeq.Invoke |> Seq.max : 'T when 'T : comparison\n static member inline Max (x: '``Foldable<'T>``, []_impl: Default1) = (^``Foldable<'T>`` : (static member Max : '``Foldable<'T>``-> 'T) x) : 'T when 'T : comparison\n static member Max (x: Id<'T> , []_impl: Max ) = x.getValue : 'T when 'T : comparison\n static member Max (x: ResizeArray<'T> , []_impl: Max ) = Seq.max x : 'T when 'T : comparison\n static member Max (x: list<'T> , []_impl: Max ) = List.max x : 'T when 'T : comparison\n static member Max (x: 'T [] , []_impl: Max ) = Array.max x : 'T when 'T : comparison\n\n static member inline Invoke (source: '``Foldable<'T>``) =\n let inline call_2 (a: ^a, b: ^b) = ((^a or ^b) : (static member Max : _*_ -> _) b, a)\n let inline call (a: 'a, b: 'b) = call_2 (a, b)\n call (Unchecked.defaultof, source) : 'T when 'T : comparison\n\n\ntype MaxBy =\n inherit Default1\n static member inline MaxBy (x: '``Foldable<'T>``, f: 'T->'U when 'U : comparison, []_impl: Default2) = x |> ToSeq.Invoke |> Seq.maxBy f : 'T\n static member inline MaxBy (x: '``Foldable<'T>``, f: 'T->'U when 'U : comparison, []_impl: Default1) = (^``Foldable<'T>`` : (static member MaxBy : '``Foldable<'T>``-> _ -> 'T) (x, f))\n static member MaxBy (x: Id<'T> , _: 'T->'U when 'U : comparison, []_impl: MaxBy ) = x.getValue\n static member MaxBy (x: ResizeArray<'T> , f: 'T->'U when 'U : comparison, []_impl: MaxBy ) = Seq.maxBy f x\n static member MaxBy (x: list<'T> , f: 'T->'U when 'U : comparison, []_impl: MaxBy ) = List.maxBy f x\n static member MaxBy (x: 'T [] , f: 'T->'U when 'U : comparison, []_impl: MaxBy ) = Array.maxBy f x\n\n static member inline Invoke (projection: 'T->'U when 'U : comparison) (source: '``Foldable<'T>``) =\n let inline call_2 (a: ^a, b: ^b, f) = ((^a or ^b) : (static member MaxBy : _*_*_ -> _) b, f, a)\n let inline call (a: 'a, b: 'b, f) = call_2 (a, b, f)\n call (Unchecked.defaultof, source, projection) : 'T\n\n\ntype Min =\n inherit Default1\n static member inline Min (x: '``Foldable<'T>``, []_impl: Default2) = x |> ToSeq.Invoke |> Seq.min : 'T when 'T : comparison\n static member inline Min (x: '``Foldable<'T>``, []_impl: Default1) = (^``Foldable<'T>`` : (static member Min : '``Foldable<'T>``-> 'T) x) : 'T when 'T : comparison\n static member Min (x: Id<'T> , []_impl: Min ) = x.getValue : 'T when 'T : comparison\n static member Min (x: ResizeArray<'T> , []_impl: Min ) = Seq.min x : 'T when 'T : comparison\n static member Min (x: list<'T> , []_impl: Min ) = List.min x : 'T when 'T : comparison\n static member Min (x: 'T [] , []_impl: Min ) = Array.min x : 'T when 'T : comparison\n\n static member inline Invoke (source: '``Foldable<'T>``) =\n let inline call_2 (a: ^a, b: ^b) = ((^a or ^b) : (static member Min : _*_ -> _) b, a)\n let inline call (a: 'a, b: 'b) = call_2 (a, b)\n call (Unchecked.defaultof, source) : 'T when 'T : comparison\n\n\ntype MinBy =\n inherit Default1\n static member inline MinBy (x: '``Foldable<'T>``, f , []_impl: Default2) = x |> ToSeq.Invoke |> Seq.minBy f : 'T\n static member inline MinBy (x: '``Foldable<'T>``, f: 'T->'U, []_impl: Default1) = (^``Foldable<'T>`` : (static member MinBy : '``Foldable<'T>``-> _ -> 'T) (x, f))\n static member MinBy (x: Id<'T> , _: 'T->'U, []_impl: MinBy ) = x.getValue\n static member MinBy (x: ResizeArray<'T> , f , []_impl: MinBy ) = Seq.minBy f x\n static member MinBy (x: list<'T> , f , []_impl: MinBy ) = List.minBy f x\n static member MinBy (x: 'T [] , f , []_impl: MinBy ) = Array.minBy f x\n\n static member inline Invoke (projection: 'T->'U) (source: '``Foldable<'T>``) =\n let inline call_2 (a: ^a, b: ^b, f) = ((^a or ^b) : (static member MinBy : _*_*_ -> _) b, f, a)\n let inline call (a: 'a, b: 'b, f) = call_2 (a, b, f)\n call (Unchecked.defaultof, source, projection) : 'T\n\n\ntype Length =\n inherit Default1\n static member inline Length (x: '``Foldable<'T>``, []_impl: Default2) = x |> ToSeq.Invoke |> Seq.length\n static member inline Length (x: '``Foldable<'T>``, []_impl: Default1) = (^``Foldable<'T>`` : (member Length : int) x)\n static member Length (_: Id<'T> , []_impl: Length ) = 1\n static member Length (x: ResizeArray<'T> , []_impl: Length ) = x.Count\n static member Length (x: 'T list , []_impl: Length ) = List.length x\n static member Length (x: option<'T> , []_impl: Length ) = if x.IsSome then 1 else 0\n static member Length (x: 'T [] , []_impl: Length ) = Array.length x\n []\n static member LengthLegacy (x:seq<'T> , []_impl:Length) = Seq.length x\n\n static member inline Invoke (source: '``Foldable<'T>``) =\n let inline call_2 (a: ^a, b: ^b) = ((^a or ^b) : (static member Length : _*_ -> _) b, a)\n let inline call (a: 'a, b: 'b) = call_2 (a, b)\n call (Unchecked.defaultof, source) : int\n\n\ntype Reduce = static member inline Invoke (f: 'T->'T->'T) (x: '``Reducible<'T>``) : 'T = (^``Reducible<'T>`` : (static member Reduce : _*_ -> _) x, f)\n\n#endif","module Client.ContractPage.CostOfConstruction.Expanded.Config\r\n\r\nlet smallTextSize = \"0.87rem\"\r\n","module Client.ContractPage.CostOfConstruction.Expanded.CostData\r\n\r\nopen System\r\nopen Client\r\nopen Client.ContractPage.CostOfConstruction\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen PortalLibs.Client.Util\r\nopen ContractPageModel\r\nopen Model\r\nopen Fulma\r\nopen Fable.FontAwesome\r\nopen Shared\r\nopen Feliz\r\nopen Utils\r\n\r\nlet rightMiddle = [style.textAlign.right; style.verticalAlign.middle] \r\n\r\nlet view =\r\n let tdPrice x =\r\n Html.td [\r\n prop.style [yield! rightMiddle; yield! (optionalRedColor x)]\r\n prop.text(x |> DisplayNumber.AsCurrency.std)\r\n ]\r\n React.memo (\r\n \"CostDataRow\",\r\n (fun (props: {| ContractSettings: ContractSettings\r\n Cost: JobCost\r\n Details: CostDetails\r\n Dispatch: Msg -> unit\r\n Key: string |}) ->\r\n tr [ Style [ FontSize Config.smallTextSize ] ] [\r\n td [] []\r\n td [] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n PaddingLeft \"3px\"\r\n FlexWrap \"wrap\"\r\n VerticalAlign \"middle\"\r\n ] ] [\r\n span [ Style [\r\n MarginRight \"3px\"\r\n FlexGrow \"1\"\r\n MaxWidth \"75px\"\r\n ] ] [\r\n props.Cost.PhaseCode |> emptyStrTagIfNone\r\n ]\r\n span [] [\r\n props.Cost.Description |> emptyStrTagIfNone\r\n ]\r\n ]\r\n ]\r\n tdPrice props.Cost.EarnedRevenue\r\n tdPrice props.Cost.OrigEstCost\r\n tdPrice props.Cost.CurrentEstCost\r\n Html.td [\r\n prop.style rightMiddle\r\n prop.children [\r\n let costs = props.Cost.ActualCostToDate |> DisplayNumber.AsCurrency.std |> Html.text\r\n\r\n let content faIcon color =\r\n div [ Style [ PaddingBottom \"2px\" ] ] [\r\n costs\r\n Icon.icon [ Icon.Props [ Style [ Color color ] ] ] [\r\n Fa.i faIcon []\r\n ]\r\n ]\r\n \r\n match props.Details with\r\n | NoDetails -> costs\r\n | Loading ->\r\n content [Fa.Solid.Spinner; Fa.Pulse] \"gray\"\r\n | Collapsed ->\r\n a [ OnClick (fun _ ->\r\n props.Cost.Id\r\n |> Expand\r\n |> CostOfConstructionDetailsExpansion\r\n |> props.Dispatch) ] [\r\n content [Fa.Solid.Plus] \"green\"\r\n ]\r\n | Expanded _ ->\r\n a [ OnClick (fun _ ->\r\n props.Cost.Id\r\n |> Collapse\r\n |> CostOfConstructionDetailsExpansion\r\n |> props.Dispatch) ] [\r\n content [Fa.Solid.Minus] \"black\"\r\n ]\r\n ]\r\n ]\r\n tdPrice props.Cost.CostToComplete\r\n tdPrice props.Cost.GrossProfit\r\n Html.td [\r\n prop.style rightMiddle\r\n prop.children [\r\n formatMargin props.Cost.GrossProfit props.Cost.EarnedRevenue\r\n ]\r\n ]\r\n\r\n if props.ContractSettings.Projections then\r\n Html.td [\r\n prop.style rightMiddle\r\n prop.text\r\n (sprintf \"%s%%\" (Math.Round(props.Cost.PctEstimate * 100.0, 1).ToString()))\r\n ]\r\n Html.td [\r\n prop.style [yield! rightMiddle\r\n if props.Cost.PMRevisedCost < props.Cost.ActualCostToDate then\r\n yield style.color.red]\r\n prop.text (props.Cost.PMRevisedCost |> DisplayNumber.AsCurrency.std)\r\n ]\r\n ]),\r\n (fun (props: {| ContractSettings: ContractSettings\r\n Cost: JobCost\r\n Details: CostDetails\r\n Dispatch: Msg -> unit\r\n Key: string |}) -> $\"CostDataRow-%s{props.Key}\")\r\n )","module PortalLibs.Shared.FileUtil\r\n\r\nopen System\r\n\r\nlet invalidFileNameChars =\r\n [| '#'\r\n '\"'\r\n '*'\r\n '<'\r\n '>'\r\n '?'\r\n '\\\\'\r\n '|'\r\n '/'\r\n ':' |]\r\n\r\nlet cleanupFileName (fileName: string) =\r\n String\r\n .Concat(fileName.Split(invalidFileNameChars))\r\n .Trim()\r\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Control =\r\n\r\n type Option =\r\n /// Add `has-icons-right` class\r\n | [] HasIconRight\r\n /// Add `has-icons-left` class\r\n | [] HasIconLeft\r\n /// Add `is-loading` class if true\r\n | [] IsLoading of bool\r\n /// Add `is-expanded` class\r\n | [] IsExpanded\r\n | CustomClass of string\r\n | Props of IHTMLProp list\r\n | Modifiers of Modifier.IModifier list\r\n\r\n let internal controlView element options children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | HasIconRight\r\n | HasIconLeft\r\n | IsExpanded -> result.AddCaseName option\r\n | IsLoading state -> if state then result.AddCaseName option else result\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"control\").ToReactElement(element, children)\r\n\r\n /// Generate
      \r\n let div x y = controlView div x y\r\n /// Generate

      \r\n let p x y = controlView p x y\r\n","module PortalLibs.Client.Components.SearchboxNew\r\n\r\n\r\nopen Fulma\r\nopen Fable.FontAwesome\r\nopen Fable.Core.JsInterop\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Elmish\r\nopen Feliz\r\nopen PortalLibs.Client.Util\r\nopen PortalLibs.Shared\r\n\r\n\r\nlet SearchboxNew =\r\n React.memo (\r\n \"SearchboxNew\",\r\n (fun (props: {| Key: string\r\n Value: string option\r\n IsLoading: bool\r\n IconVisible: bool\r\n ShouldFocus: bool\r\n ValueChanged: string option -> unit |}) -> \r\n DebouncedView.DebouncedView\r\n {| Key = $\"SearchboxDebouncedView-%s{props.Key}\"\r\n Value = props.Value\r\n ValueChanged = props.ValueChanged\r\n Intercept = None\r\n View =\r\n (fun valueOpt valueChanged ->\r\n let leftIconPadding = if props.IconVisible then 23 else 0\r\n let hiddenInputRef: IRefValue = createRef None\r\n\r\n React.useEffect (\r\n (fun () -> \r\n if props.ShouldFocus then\r\n hiddenInputRef.current\r\n |> Option.iter (fun r -> r.focus())),\r\n Array.singleton props.ShouldFocus)\r\n \r\n Control.div [ Control.HasIconLeft\r\n Control.HasIconRight ] [\r\n yield\r\n Html.input [\r\n prop.className \"input\"\r\n prop.type'.text\r\n prop.ref hiddenInputRef\r\n prop.onChange (fun (e: Browser.Types.Event) -> !!e.target?value |> Option.noneIfEmptyStr |> valueChanged)\r\n prop.value (valueOpt |> Option.emptyStrIfNone)\r\n prop.style [ style.paddingLeft\r\n (if props.IsLoading && props.IconVisible then\r\n leftIconPadding + 23 + 10\r\n else leftIconPadding + 10\r\n |> length.px)\r\n ]\r\n prop.maxLength 300\r\n ] \r\n\r\n if props.IconVisible then\r\n yield\r\n Icon.icon [ Icon.Size IsSmall; Icon.IsLeft ] [\r\n Fa.i [ Fa.Solid.Search ] []\r\n ]\r\n if props.IsLoading && props.IconVisible then\r\n yield\r\n Icon.icon [ Icon.Size IsSmall\r\n Icon.IsLeft\r\n Icon.Props [\r\n Style [\r\n MarginLeft $\"%i{leftIconPadding}px\"\r\n ]\r\n ]\r\n ] [\r\n Fa.i [ Fa.Solid.Spinner; Fa.Pulse ] []\r\n ]\r\n if valueOpt |> Option.noneIfEmptyStrOpt <> None then\r\n yield\r\n Icon.icon [ Icon.Size IsSmall\r\n Icon.IsRight\r\n Icon.Props [\r\n Style [ PointerEvents \"all\" ]\r\n ]\r\n ] [\r\n Html.a [\r\n prop.onClick (fun _ -> None |> valueChanged)\r\n prop.style [ style.color \"gray\" ]\r\n prop.children [\r\n Fa.i [ Fa.Solid.Times ] []\r\n ]\r\n ]\r\n ]\r\n ]) |}),\r\n (fun (props: {| Key: string\r\n Value: string option\r\n IsLoading: bool\r\n IconVisible: bool\r\n ShouldFocus: bool\r\n ValueChanged: string option -> unit |}) -> props.Key),\r\n areEqual = Helpers.equalsButFunctions\r\n )\r\n\r\nlet viewWithHeader header props =\r\n field header [ SearchboxNew props ]\r\n","module Client.ContractPage.CostOfConstruction.Expanded.CostDetailTable\r\n\r\nopen FSharpPlus\r\nopen Client\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen PortalLibs.Client.Components\r\nopen PortalLibs.Client.Util\r\nopen ContractPageModel\r\nopen Model\r\nopen Browser\r\nopen Fulma\r\nopen Fable.FontAwesome\r\nopen PortalLibs.Shared\r\nopen Shared\r\nopen PortalLibs.Client.Components.NewTableNext\r\nopen Feliz\r\n\r\nlet NewTableNextSpecific =\r\n NewTableNextGeneric\r\n\r\nlet CostDetailTableView =\r\n React.memo (\r\n \"CostDetailTableView\",\r\n (fun (props: {| details: JobCostDetail list\r\n isLoading: bool\r\n jobCostId: JobCostId\r\n attachments: Map option\r\n tableState: NewTableNext.Model\r\n isSuperUser: bool\r\n Key: string\r\n dispatch: Msg -> unit |}) ->\r\n let columns =\r\n [ { Header = Text \"Posted Date\"\r\n Id = PostedDate\r\n Align = Left\r\n Value = ValueType.Text(fun (detail: JobCostDetail) -> detail.PostedDate |> prettyPrintDateShort)\r\n Sortable = ColumnSort.ValueOrExternal\r\n Draggable = false\r\n MinWidth = None\r\n Footer = None\r\n InitiallyVisible = true }\r\n\r\n { Header = Text \"Actual Date\"\r\n Id = ActualDate\r\n Align = Left\r\n Value = ValueType.Text(fun (detail: JobCostDetail) -> detail.ActualDate |> prettyPrintDateShort)\r\n Sortable = ValueOrExternal\r\n Draggable = false\r\n MinWidth = None\r\n InitiallyVisible = true\r\n Footer = None }\r\n\r\n { Header = Text \"Description\"\r\n Id = Description\r\n Align = Left\r\n Value =\r\n ValueType.Custom (fun (costDetail: JobCostDetail) ->\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"space-between\"\r\n AlignItems AlignItemsOptions.Center\r\n Width \"100%\"\r\n ] ] [\r\n div [ Style [\r\n FlexShrink \"1\"\r\n WhiteSpace WhiteSpaceOptions.Normal\r\n ] ] [\r\n emptyStrTagIfNone costDetail.Description\r\n ]\r\n div [] [\r\n match props.attachments with\r\n | None ->\r\n Icon.icon [ Icon.Props [ Style [ Color \"gray\" ] ] ] [\r\n Fa.i [ Fa.Solid.Spinner; Fa.Pulse ] []\r\n ]\r\n | Some attachments ->\r\n let attachmentCount =\r\n Map.tryFind costDetail.Id attachments\r\n |>> (fun attachments -> attachments.Length)\r\n |> Option.defaultValue 0\r\n\r\n let content =\r\n div [] [\r\n Fa.stack [] [\r\n Fa.i [ Fa.Props [\r\n Style [\r\n Color(\r\n if attachmentCount > 0 then\r\n \"green\"\r\n else\r\n \"gainsboro\"\r\n )\r\n ]\r\n ]\r\n Fa.Stack2x\r\n Fa.Regular.File ] []\r\n Fa.i [ Fa.Props [\r\n Style [\r\n Color(\r\n if attachmentCount > 0 then\r\n \"black\"\r\n else\r\n \"gainsboro\"\r\n )\r\n PaddingTop \"3px\"\r\n PaddingRight \"1px\"\r\n FontSize \"0.75rem\"\r\n ]\r\n ]\r\n Fa.Stack1x ] [\r\n strong [ Style [\r\n Color(\r\n if attachmentCount > 0 then\r\n \"black\"\r\n else\r\n \"gainsboro\"\r\n )\r\n ] ] [\r\n attachmentCount |> string |> str\r\n ]\r\n ]\r\n ]\r\n ]\r\n\r\n if attachmentCount > 0 then\r\n a [ OnClick (fun _ ->\r\n Some(props.jobCostId, costDetail.Id)\r\n |> ShowAttachmentsModal\r\n |> props.dispatch) ] [\r\n content\r\n ]\r\n else\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"center\"\r\n Width \"100%\"\r\n Padding \"1px 0\"\r\n ] ] [\r\n content\r\n ]\r\n ]\r\n ])\r\n Sortable = ValueOrExternal\r\n Draggable = false\r\n MinWidth = None\r\n InitiallyVisible = true\r\n Footer = Some(Footer.Text \"Total:\") }\r\n { Header = Text \"Units\"\r\n Id = Units\r\n Align = Right\r\n Value = ValueType.Text(fun (detail: JobCostDetail) -> detail.Units |> sprintf \"%.3f\")\r\n Sortable = ValueOrExternal\r\n Draggable = false\r\n MinWidth = None\r\n InitiallyVisible = true\r\n Footer = Some(Total(sprintf \"%.3f\")) }\r\n { Header = Text \"Hours\"\r\n Id = Hours\r\n Align = Right\r\n Value = ValueType.Text(fun (detail: JobCostDetail) -> detail.Hours |> sprintf \"%.1f\")\r\n Sortable = ValueOrExternal\r\n Draggable = false\r\n MinWidth = None\r\n InitiallyVisible = true\r\n Footer = Some(Total(sprintf \"%.1f\")) }\r\n\r\n if props.isSuperUser then\r\n { Header = Text \"Cost\"\r\n Id = Cost\r\n Align = Right\r\n Value =\r\n ValueType.Custom (fun (detail: JobCostDetail) ->\r\n div [ Style [\r\n FlexGrow \"1\"\r\n TextAlign TextAlignOptions.Right\r\n ] ] [\r\n span [ if detail.Cost < 0.0 then\r\n Style [ Color \"red\" ] ] [\r\n str (\r\n detail.Cost\r\n |> formatNumber false Parenthesis false AllTwoDigits\r\n )\r\n ]\r\n ])\r\n Sortable = ValueOrExternal\r\n Draggable = false\r\n MinWidth = None\r\n InitiallyVisible = true\r\n Footer = Some(Total(DisplayNumber.AsCurrency.std)) }\r\n\r\n ]\r\n\r\n div [ ClassName \"costofconstruction-table\"\r\n Style [\r\n MaxWidth \"1200px\"\r\n Margin \"auto\"\r\n ] ] [\r\n NewTableNextSpecific\r\n {| Config =\r\n { Model = props.tableState\r\n Columns = columns\r\n ColumnSelection = false\r\n Items = props.details\r\n ItemKey = fun item -> item.Id.ToString()\r\n SubRows = None\r\n Selection = [], false\r\n Paging =\r\n Paged\r\n { HidePaginationUnder1Page = true\r\n PageSizeOptions = None }\r\n Key = \"CostOfConstructionCostDetailTable\"\r\n RowClick = None\r\n DataLoad = OnDemand\r\n StickyHeader = None\r\n Dispatch =\r\n (fun msg ->\r\n TableStateChanged(props.jobCostId, msg)\r\n |> props.dispatch) } |}\r\n ]),\r\n (fun (props: {| details: JobCostDetail list\r\n isLoading: bool\r\n jobCostId: JobCostId\r\n attachments: Map option\r\n tableState: NewTableNext.Model\r\n isSuperUser: bool\r\n Key: string\r\n dispatch: Msg -> unit |}) -> $\"CostDetailTableView-%s{props.Key}\")\r\n )\r\n\r\nlet View =\r\n React.memo (\r\n \"CostDetailTableAndSearchView\",\r\n (fun (props: {| details: JobCostDetail list\r\n contract: Contract\r\n jobCost: JobCost\r\n searchModels: Map\r\n attachments: Map option\r\n Key: string\r\n tableStates: Map>\r\n isSuperUser: bool\r\n dispatch: Msg -> unit |}) ->\r\n let searchViewChanged =\r\n React.useCallback (\r\n ((fun msg -> SearchValueChanged(props.jobCost.Id, msg))\r\n >> props.dispatch),\r\n [||]\r\n )\r\n\r\n let searchValue =\r\n searchValue props.searchModels props.jobCost.Id\r\n\r\n let tableState =\r\n tableState props.tableStates props.jobCost.Id\r\n\r\n tr [ Style [ FontSize Config.smallTextSize ] ] [\r\n td [ ColSpan 11 ] [\r\n div [] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n AlignItems AlignItemsOptions.Center\r\n JustifyContent \"flex-end\"\r\n Padding \"5px 0 0 0\"\r\n Margin \"0 0 -3px 0\"\r\n ] ] [\r\n a [ OnClick (fun _ ->\r\n window.location.href <-\r\n (sprintf\r\n \"/costdetailexport/%i/%s\"\r\n props.jobCost.Id\r\n (sprintf\r\n \"%s-%s-%s.xlsx\"\r\n (props.contract.Description\r\n |> Option.defaultValue \"\")\r\n (props.jobCost.PhaseItemDescription\r\n |> Option.defaultValue \"\")\r\n (props.jobCost.Description\r\n |> Option.defaultValue \"\")\r\n |> FileUtil.cleanupFileName))) ] [\r\n Icon.icon [ Icon.Size ISize.IsLarge\r\n Icon.Props [ Style [ Color \"#3273dc\" ] ] ] [\r\n Fa.i [ Fa.Solid.FileExcel\r\n Fa.Size Fa.ISize.Fa2x ] []\r\n ]\r\n ]\r\n SearchboxNew.SearchboxNew\r\n {| Value = searchValue\r\n IsLoading = false\r\n IconVisible = false\r\n ValueChanged = searchViewChanged\r\n Key = $\"CostOfConstruction-%i{props.jobCost.Id}-Searchbox\"\r\n ShouldFocus = false |}\r\n ]\r\n CostDetailTableView\r\n {| details = props.details\r\n attachments = props.attachments\r\n isLoading = false\r\n isSuperUser = props.isSuperUser\r\n jobCostId = props.jobCost.Id\r\n tableState = tableState\r\n dispatch = props.dispatch\r\n Key = $\"CostDetailTable-%s{props.jobCost.Id.ToString()}\" |}\r\n ]\r\n ]\r\n ]),\r\n (fun (props: {| details: JobCostDetail list\r\n contract: Contract\r\n jobCost: JobCost\r\n searchModels: Map\r\n attachments: Map option\r\n Key: string\r\n tableStates: Map>\r\n isSuperUser: bool\r\n dispatch: Msg -> unit |}) -> $\"CostDetailTableAndSearchView-%s{props.Key}\")\r\n )","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Table =\r\n\r\n type TableOption =\r\n /// Set `is-hovered` class\r\n | []IsBordered\r\n /// Set `is-striped` class\r\n | []IsStriped\r\n /// Add `is-fullwidth` class\r\n | []IsFullWidth\r\n /// Set `is-narrow` class\r\n | []IsNarrow\r\n /// Set `is-hoverable` class\r\n | []IsHoverable\r\n | CustomClass of string\r\n | Props of IHTMLProp list\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate
      \r\n let table options children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | IsBordered\r\n | IsStriped\r\n | IsFullWidth\r\n | IsNarrow\r\n | IsHoverable -> result.AddCaseName option\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"table\").ToReactElement(table, children)\r\n","module Client.ContractPage.CostOfConstruction.Expanded.PoSl\r\n\r\nopen FSharpPlus\r\nopen System\r\nopen Client\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen PortalLibs.Shared\r\nopen PortalLibs.Client.Util\r\nopen Client.ContractPage.CostOfConstruction.Expanded\r\nopen Model\r\nopen Fulma\r\nopen Shared\r\nopen Feliz\r\nopen Client.ContractPage.CostOfConstruction.Utils\r\n\r\nlet poSlTableView (costSubs: JobCostSub list) typeStr =\r\n tr [ Style [ FontSize Config.smallTextSize ] ] [\r\n td [ ColSpan 8 ] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"center\"\r\n OverflowY OverflowOptions.Auto\r\n Padding \"15px 0\"\r\n ] ] [\r\n Table.table [ Table.IsHoverable ] [\r\n thead [] [\r\n tr [] [\r\n th [ Style [\r\n TextAlign TextAlignOptions.Right\r\n Width \"100px\"\r\n ] ] [\r\n str typeStr\r\n ]\r\n th [ Style [ Width \"250px\" ] ] [\r\n str \"Vendor\"\r\n ]\r\n th [ Style [\r\n TextAlign TextAlignOptions.Right\r\n Width \"140px\"\r\n ] ] [\r\n $\"%s{typeStr} Amt\" |> str\r\n ]\r\n th [ Style [\r\n TextAlign TextAlignOptions.Right\r\n Width \"160px\"\r\n ] ] [\r\n str \"Actual Cost\"\r\n ]\r\n ]\r\n ]\r\n tbody [] [\r\n yield!\r\n costSubs\r\n |>> fun cost ->\r\n tr [] [\r\n td [ Style alignRight ] [\r\n cost.Number |> emptyStrTagIfNone\r\n ]\r\n td [] [\r\n cost.Vendor |> emptyStrTagIfNone\r\n ]\r\n td [ Style alignRight ] [\r\n cost.Amount\r\n |> DisplayNumber.AsCurrency.stdStr\r\n ]\r\n td [ Style alignRight ] [\r\n cost.Cost\r\n |> DisplayNumber.AsCurrency.stdStr\r\n ]\r\n ]\r\n if costSubs.Length > 1 then\r\n yield\r\n tr [] [\r\n td [] []\r\n td [ Style alignRight ] [\r\n strong [] [\r\n $\"%s{typeStr} Total:\" |> str\r\n ]\r\n ]\r\n td [ Style alignRight ] [\r\n strong [] [\r\n costSubs\r\n |> List.sumBy (fun c -> c.Amount)\r\n |> DisplayNumber.AsCurrency.stdStr\r\n ]\r\n ]\r\n td [ Style alignRight ] [\r\n strong [] [\r\n costSubs\r\n |> List.sumBy (fun c -> c.Cost)\r\n |> DisplayNumber.AsCurrency.stdStr\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\nlet View =\r\n React.memo (\r\n \"PoSlView\",\r\n (fun (props: {| costs: Map\r\n costId: JobCostId\r\n subType: JobCostSubType\r\n Key: string |}) ->\r\n match Map.tryFind props.costId props.costs with\r\n | None -> nothing\r\n | Some costs ->\r\n match costs\r\n |> List.filter (fun c -> c.Type = props.subType)\r\n with\r\n | [] -> nothing\r\n | costSubs ->\r\n poSlTableView\r\n costSubs\r\n (match props.subType with\r\n | JobCostSubType.SL -> \"SL\"\r\n | JobCostSubType.PO -> \"PO\"\r\n | _ -> ArgumentOutOfRangeException() |> raise)),\r\n (fun (props: {| costs: Map\r\n costId: JobCostId\r\n subType: JobCostSubType\r\n Key: string |}) -> $\"PoSlView-%s{props.Key}\")\r\n )\r\n\r\n\r\n ","module Client.ContractPage.CostOfConstruction.Expanded.Expanded\r\n\r\nopen FSharpPlus\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen PortalLibs.Client.Components\r\nopen ContractPageModel\r\nopen Client.ContractPage.CostOfConstruction.Expanded\r\nopen Model\r\nopen Fulma\r\nopen Fable.FontAwesome\r\nopen PortalLibs.Shared\r\nopen Shared\r\nopen Feliz\r\nopen Client.ContractPage.CostOfConstruction\r\n\r\nlet HeaderRow =\r\n React.memo (\r\n \"HeaderRow\",\r\n (fun (props: {| contractId: ContractId\r\n jobPhase: JobPhase\r\n dispatch: Msg -> unit\r\n Key: string |}) ->\r\n tr [ OnClick (fun _ ->\r\n CostOfConstructionPhaseExpansionToggled(props.contractId, props.jobPhase.Code)\r\n |> props.dispatch) ] [\r\n td [ Style [\r\n TextAlign TextAlignOptions.Right\r\n ] ] [\r\n strong [] [ props.jobPhase.Code |> str ]\r\n ]\r\n td [] [\r\n a [] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"space-between\"\r\n ] ] [\r\n strong [] [ props.jobPhase.Desc |> str ]\r\n Icon.icon [ Icon.Props [ Style [ Color \"#b5b5b5\" ] ] ] [\r\n Fa.i [ Fa.Solid.ChevronUp ] []\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]),\r\n (fun (props: {| contractId: ContractId\r\n jobPhase: JobPhase\r\n dispatch: Msg -> unit\r\n Key: string |}) -> $\"HeaderRow-%s{props.Key}\")\r\n )\r\n\r\nlet CostTotals =\r\n React.memo (\r\n \"CostTotals\",\r\n (fun (props: {| ContractSettings: ContractSettings\r\n JobPhaseCosts: JobPhaseCosts\r\n Key: string |}) ->\r\n if props.JobPhaseCosts.Costs.Length > 1 then\r\n tr [ Style [ FontSize Config.smallTextSize ] ] [\r\n yield td [] []\r\n yield\r\n td [ Style [\r\n TextAlign TextAlignOptions.Right\r\n ] ] [\r\n strong [] [\r\n span [] [\r\n $\"%s{props.JobPhaseCosts.Phase.Desc} Total:\"\r\n |> str\r\n ]\r\n ]\r\n ]\r\n yield! Utils.totalColumns props.ContractSettings props.JobPhaseCosts.Costs\r\n ]\r\n else\r\n nothing),\r\n (fun (props: {| ContractSettings: ContractSettings\r\n JobPhaseCosts: JobPhaseCosts\r\n Key: string |}) -> $\"CostTotals-%s{props.Key}\")\r\n )\r\n\r\nlet view\r\n contractSettings\r\n isSuperUser\r\n contractId\r\n contract\r\n details\r\n detailsExpanded\r\n searchModels\r\n attachments\r\n tableStates\r\n dispatch\r\n jobCostSubs\r\n jobPhaseCosts\r\n =\r\n [ yield\r\n HeaderRow\r\n {| contractId = contractId\r\n jobPhase = jobPhaseCosts.Phase\r\n dispatch = dispatch\r\n Key = $\"CostsExpandedRowHeader-%s{jobPhaseCosts.Phase.Code}\" |}\r\n yield!\r\n jobPhaseCosts.Costs\r\n >>= (fun (cost: JobCost) ->\r\n let details =\r\n if cost.ActualCostToDate = 0.0 then\r\n NoDetails\r\n else\r\n match detailsExpanded |> Map.containsKey cost.Id, details |> Map.tryFind cost.Id with\r\n | false, _ -> Collapsed\r\n | true, None -> Loading\r\n | true, Some (details: JobCostDetail list) -> Expanded details\r\n\r\n [ yield\r\n ReactTransitionGroup.AnimatedCreate\r\n {| Key = $\"CostsExpandedRowData-%i{cost.Id}\"\r\n ContentOpt =\r\n Some(\r\n CostData.view\r\n {| ContractSettings = contractSettings\r\n Cost = cost\r\n Details = details\r\n Dispatch = dispatch\r\n Key = $\"CostsExpandedRowData-%i{cost.Id}\" |}\r\n ) |}\r\n yield\r\n (ReactTransitionGroup.AnimatedCreate\r\n {| Key = $\"CostDetailTableAndSearch-%i{cost.Id}\"\r\n ContentOpt =\r\n match details with\r\n | NoDetails\r\n | Loading\r\n | Collapsed -> None\r\n | Expanded details ->\r\n Some(\r\n CostDetailTable.View\r\n {| details = details\r\n contract = contract\r\n jobCost = cost\r\n attachments = (attachments |> Map.tryFind cost.Id)\r\n searchModels = searchModels\r\n tableStates = tableStates\r\n isSuperUser = isSuperUser\r\n Key = $\"CostDetailTableAndSearch-%i{cost.Id}\"\r\n dispatch = dispatch |}\r\n ) |})\r\n yield\r\n ReactTransitionGroup.AnimatedCreate\r\n {| Key = $\"CostPoSlView-%i{cost.Id}-PO\"\r\n ContentOpt =\r\n Some(\r\n PoSl.View\r\n {| costs = jobCostSubs\r\n costId = cost.Id\r\n subType = JobCostSubType.PO\r\n Key = $\"CostPoSlView-%i{cost.Id}-PO\" |}\r\n ) |}\r\n yield\r\n ReactTransitionGroup.AnimatedCreate\r\n {| Key = $\"CostPoSlView-%i{cost.Id}-SL\"\r\n ContentOpt =\r\n Some(\r\n PoSl.View\r\n {| costs = jobCostSubs\r\n costId = cost.Id\r\n subType = JobCostSubType.SL\r\n Key = $\"CostPoSlView-%i{cost.Id}-SL\" |}\r\n ) |}\r\n ])\r\n yield\r\n ReactTransitionGroup.AnimatedCreate\r\n {| Key = $\"CostSubTotalsRow-%s{jobPhaseCosts.Phase.Code}\"\r\n ContentOpt =\r\n Some(\r\n CostTotals\r\n {| ContractSettings = contractSettings\r\n JobPhaseCosts = jobPhaseCosts\r\n Key = $\"CostSubTotalsRow-%s{jobPhaseCosts.Phase.Code}\" |}\r\n ) |} ]\r\n","module Client.ContractPage.CostOfConstruction.Collapsed\r\n\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen ContractPageModel\r\nopen Fulma\r\nopen Fable.FontAwesome\r\nopen Shared\r\nopen Feliz\r\n\r\nlet CostsCollapsed =\r\n React.memo (\r\n \"CostsCollapsed\",\r\n (fun (props: {| AppSettings: ContractSettings\r\n ContractId: ContractId\r\n JobPhaseCosts: JobPhaseCosts\r\n Dispatch: Msg -> unit\r\n Key: string |}) ->\r\n tr [ OnClick (fun _ ->\r\n CostOfConstructionPhaseExpansionToggled(props.ContractId, props.JobPhaseCosts.Phase.Code)\r\n |> props.Dispatch) ] [\r\n yield\r\n td [ Style [\r\n TextAlign TextAlignOptions.Right\r\n ] ] [\r\n strong [] [\r\n props.JobPhaseCosts.Phase.Code |> str\r\n ]\r\n ]\r\n yield\r\n td [] [\r\n a [] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"space-between\"\r\n ] ] [\r\n strong [] [\r\n props.JobPhaseCosts.Phase.Desc |> str\r\n ]\r\n Icon.icon [ Icon.Props [ Style [ Color \"#b5b5b5\" ] ] ] [\r\n Fa.i [ Fa.Solid.ChevronDown ] []\r\n ]\r\n ]\r\n ]\r\n ]\r\n yield! Utils.totalColumns props.AppSettings props.JobPhaseCosts.Costs\r\n ]),\r\n (fun (props: {| AppSettings: ContractSettings\r\n ContractId: ContractId\r\n JobPhaseCosts: JobPhaseCosts\r\n Dispatch: Msg -> unit\r\n Key: string |}) -> $\"CostsCollapsed-%s{props.Key}\")\r\n )","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Browser.Types\r\n\r\n[]\r\nmodule Modal =\r\n\r\n type Option =\r\n | Props of IHTMLProp list\r\n /// Add `is-active` class if true\r\n | [] IsActive of bool\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n module Close =\r\n type Option =\r\n | Size of ISize\r\n | OnClick of (MouseEvent -> unit)\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate
      \r\n let modal (options : Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | IsActive state -> if state then result.AddCaseName option else result\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"modal\").ToReactElement(div, children)\r\n\r\n /// Generate \r\n let close (options : Close.Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Close.Size IsSmall\r\n | Close.Size IsMedium ->\r\n Fable.Core.JS.console.warn(\"`is-small` and `is-medium` are not valid sizes for 'modal close'\")\r\n result\r\n | Close.Size size -> ofSize size |> result.AddClass\r\n | Close.OnClick cb -> DOMAttr.OnClick cb |> result.AddProp\r\n | Close.Props props -> result.AddProps props\r\n | Close.CustomClass customClass -> result.AddClass customClass\r\n | Close.Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"modal-close\").ToReactElement(button, children)\r\n\r\n /// Generate
      \r\n let background (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"modal-background\").ToReactElement(div, children)\r\n\r\n /// Generate
      \r\n let content (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"modal-content\").ToReactElement(div, children)\r\n\r\n module Card =\r\n\r\n /// Generate
      \r\n let card (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"modal-card\").ToReactElement(div, children)\r\n\r\n /// Generate
      \r\n let head (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"modal-card-head\").ToReactElement(header, children)\r\n\r\n /// Generate
      \r\n let foot (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"modal-card-foot\").ToReactElement(footer, children)\r\n\r\n /// Generate
      \r\n let title (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"modal-card-title\").ToReactElement(div, children)\r\n\r\n /// Generate
      \r\n let body (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"modal-card-body\").ToReactElement(section, children)\r\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Browser.Types\r\n\r\n[]\r\nmodule Delete =\r\n\r\n type Option =\r\n | Size of ISize\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | OnClick of (MouseEvent -> unit)\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate \r\n let delete (options : Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n // Sizes\r\n | Size size -> ofSize size |> result.AddClass\r\n // Extra\r\n | OnClick cb -> DOMAttr.OnClick cb |> result.AddProp\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"delete\").ToReactElement(a, children)\r\n","module CostOfConstructionAttachmentModal\r\n\r\nopen FSharpPlus\r\nopen Model\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen PortalLibs.Client.Util\r\nopen Fulma\r\nopen ContractPageModel\r\nopen Fable.FontAwesome\r\nopen Shared\r\nopen PortalLibs.Shared\r\n\r\nlet attachmentsModal\r\n modalOpenOpt\r\n attachments\r\n attachmentPreview\r\n attachmentDownload\r\n attachmentContents\r\n attachmentsVisited\r\n dispatch\r\n =\r\n let preview attachmentOpt attachmentIdOpt contents dispatch =\r\n match attachmentIdOpt, attachmentOpt with\r\n | Some attachmentId, Some (attachment: JobCostDetailAttachment) ->\r\n div [] [\r\n loadingMessageOrContent\r\n \"Loading file from the Vista Database...\"\r\n (fun fileContent ->\r\n let fileUrl =\r\n $\"/attachments/%s{attachment.Id.ToString()}/%s{attachment.OrigFileName |> Option.emptyStrIfNone}\"\r\n\r\n div [ Style [ PaddingBottom \"10px\" ] ] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"space-around\"\r\n OverflowY OverflowOptions.Auto\r\n MaxHeight \"600px\"\r\n MarginBottom \"15px\"\r\n ] ] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexDirection \"column\"\r\n AlignItems AlignItemsOptions.Center\r\n Width \"100%\"\r\n ] ] [\r\n strong [] [\r\n attachment.OrigFileName\r\n |> Option.emptyStrIfNone\r\n |> sprintf \"File Preview: %s\"\r\n |> str\r\n ]\r\n match fileContent with\r\n | VistaNotAvailable ->\r\n div [ Style [ Padding \"50px 0\" ] ] [\r\n str \"The connection to the Vista Database is currently unavailable.\"\r\n ]\r\n | Downloaded ->\r\n div [ Style [\r\n PaddingTop \"10px\"\r\n Width \"100%\"\r\n ] ] [\r\n //iframe [ Src (\"https://localhost:8080\"+fileUrl) ] []\r\n reactFileViewer fileUrl\r\n ]\r\n ]\r\n ]\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexDirection \"row-reverse\"\r\n Width \"100%\"\r\n ] ] [\r\n Button.button [ Button.OnClick(fun _ -> None |> PreviewAttachment |> dispatch) ] [\r\n str \"Close Preview\"\r\n ]\r\n match fileContent with\r\n | Downloaded ->\r\n a [ ClassName \"button is-primary\"\r\n Href fileUrl\r\n HTMLAttr.Download \"\"\r\n Style [ MarginRight \"15px\" ] ] [\r\n str \"Download\"\r\n ]\r\n | VistaNotAvailable -> nothing\r\n ]\r\n ])\r\n (contents |> Map.tryFind attachmentId)\r\n ]\r\n | _, _ -> nothing\r\n\r\n let downloading (attachment: JobCostDetailAttachment option) contents =\r\n match attachment with\r\n | None -> nothing\r\n | Some attachment ->\r\n match Map.tryFind attachment.Id contents with\r\n | None ->\r\n div [ Style [\r\n Position PositionOptions.Relative\r\n Top \"30%\"\r\n ] ] [\r\n loadingWithElem\r\n (span [] [\r\n str $\"File: %s{attachment.OrigFileName |> Option.emptyStrIfNone}\"\r\n br []\r\n str \"Downloading file from Vista...\"\r\n ])\r\n IconSize.Large\r\n ]\r\n | Some fileContent ->\r\n match fileContent with\r\n | VistaNotAvailable ->\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexDirection \"column\"\r\n AlignItems AlignItemsOptions.Center\r\n ] ] [\r\n div [ Style [ Padding \"50px 0\" ] ] [\r\n str \"The connection to the Vista Database is currently unavailable.\"\r\n ]\r\n ]\r\n | Downloaded -> nothing\r\n\r\n\r\n let rows items =\r\n items\r\n >>=\r\n (fun (_, attachmentsGroup) ->\r\n [ tr [ ClassName \"tr-no-border tr-no-bottom-margin\" ] [\r\n td [] [\r\n strong [] [\r\n match attachmentsGroup |> List.tryHead with\r\n | None -> nothing\r\n | Some item ->\r\n (if (item.SourceItem |> Option.emptyStrIfNone).Trim()\r\n <> \"\" then\r\n $\"%s{item.Source |> Option.emptyStrIfNone} - %s{item.SourceItem |> Option.emptyStrIfNone}\"\r\n else\r\n (item.Source |> Option.emptyStrIfNone))\r\n |> str\r\n ]\r\n ]\r\n td [] []\r\n td [] []\r\n td [] []\r\n td [] []\r\n ]\r\n yield!\r\n attachmentsGroup\r\n |> List.map\r\n (fun attachment ->\r\n tr [] [\r\n td [] []\r\n td [] [\r\n a [ OnClick\r\n (fun _ ->\r\n attachment.Id\r\n |> Some\r\n |> PreviewAttachment\r\n |> dispatch)\r\n if attachmentsVisited\r\n |> Map.containsKey attachment.Id then\r\n Style [ Color \"gray\" ] ] [\r\n attachment.OrigFileName |> emptyStrTagIfNone\r\n ]\r\n ]\r\n td [] [\r\n attachment.Description |> emptyStrTagIfNone\r\n ]\r\n td [] [\r\n attachment.AddedBy |> emptyStrTagIfNone\r\n ]\r\n td [ Style [\r\n TextAlign TextAlignOptions.Right\r\n ] ] [\r\n attachment.AddDate\r\n |> prettyPrintDateOptionLong\r\n |> str\r\n ]\r\n td [] [\r\n a [ OnClick\r\n (fun _ ->\r\n attachment\r\n |> Some\r\n |> DownloadAttachment\r\n |> dispatch) ] [\r\n div [ Style [ PaddingBottom \"2px\" ] ] [\r\n Icon.icon [ Icon.Props [\r\n Style [ Color \"deepskyblue\" ]\r\n ] ] [\r\n Fa.i [ Fa.Solid.FileDownload ] []\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]) ])\r\n\r\n let items =\r\n modalOpenOpt\r\n >>=\r\n (fun (costId, detailId) ->\r\n attachments\r\n |> Map.tryFind costId\r\n >>= (fun attachmentMap -> attachmentMap |> Map.tryFind detailId))\r\n |> Option.defaultValue []\r\n |> List.groupBy (fun (attachment: JobCostDetailAttachment) -> attachment.UniqueAttachmentId)\r\n\r\n Modal.modal [ Modal.IsActive(Option.isSome modalOpenOpt) ] [\r\n Modal.background [ Props [\r\n OnClick(fun _ -> None |> ShowAttachmentsModal |> dispatch)\r\n ] ] []\r\n Modal.Card.card [ CustomClass \"modal-card-wide\"\r\n Props [ Style [] ] ] [\r\n Modal.Card.head [] [\r\n Modal.Card.title [] [\r\n \"Job Cost Detail Attachments\" |> str\r\n ]\r\n Delete.delete [ Delete.OnClick(fun _ -> None |> ShowAttachmentsModal |> dispatch) ] []\r\n ]\r\n Modal.Card.body [] [\r\n div [ Id \"ModalCardBody\"\r\n Style [ Margin \"-20px 0 20px 0\" ] ] []\r\n div [] [\r\n preview\r\n (attachmentPreview\r\n >>=\r\n (fun attachmentId ->\r\n items\r\n |> List.tryFind\r\n (fun (_, files) ->\r\n List.exists (fun (item: JobCostDetailAttachment) -> item.Id = attachmentId) files)\r\n >>= (fun (_, files) -> List.tryFind (fun item -> item.Id = attachmentId) files)))\r\n attachmentPreview\r\n attachmentContents\r\n dispatch\r\n\r\n downloading attachmentDownload attachmentContents\r\n\r\n Table.table [ Table.IsFullWidth; Table.IsHoverable ] [\r\n thead [] [\r\n tr [] [\r\n th [ Style [ VerticalAlign \"middle\" ] ] [\r\n str \"Source\"\r\n ]\r\n th [ Style [ VerticalAlign \"middle\" ] ] [\r\n str \"File\"\r\n ]\r\n th [ Style [ VerticalAlign \"middle\" ] ] [\r\n str \"Description\"\r\n ]\r\n th [ Style [\r\n VerticalAlign \"middle\"\r\n Width \"100px\"\r\n ] ] [\r\n str \"Added By\"\r\n ]\r\n th [ Style [\r\n TextAlign TextAlignOptions.Right\r\n VerticalAlign \"middle\"\r\n Width \"135px\"\r\n ] ] [\r\n str \"Date\"\r\n ]\r\n th [] []\r\n ]\r\n ]\r\n tbody [] (rows items)\r\n ]\r\n\r\n ]\r\n ]\r\n Modal.Card.foot [] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexDirection \"row-reverse\"\r\n Width \"100%\"\r\n ] ] [\r\n Button.button [ Button.OnClick(fun _ -> None |> ShowAttachmentsModal |> dispatch) ] [\r\n str \"Close\"\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n","module Client.ContractPage.CostOfConstruction.CostOfConstruction\r\n\r\nopen FSharpPlus\r\nopen Client\r\nopen Feliz.Bulma\r\nopen PortalLibs.Shared\r\nopen PortalLibs.Client.Util\r\nopen ContractPageModel\r\nopen Model\r\nopen Shared\r\nopen CostOfConstructionAttachmentModal\r\nopen Feliz\r\nopen Client.ContractPage.CostOfConstruction.Expanded\r\n\r\nlet CostOfConstructionTotals =\r\n React.memo (\r\n \"CostOfConstructionTotals\",\r\n (fun (props: {| ApplicationSettings: ContractSettings\r\n CostsGrouped: JobPhaseCosts list |}) ->\r\n \r\n let allCosts =props.CostsGrouped >>= (fun v -> v.Costs)\r\n\r\n Html.tr [\r\n yield Html.td []\r\n yield\r\n Html.td [\r\n Html.div [\r\n prop.style [style.textAlign.right; style.marginRight(length.px 25)]\r\n prop.children [\r\n Html.strong \"TOTALS:\"\r\n ]\r\n ]\r\n ]\r\n yield! Utils.totalColumns props.ApplicationSettings allCosts\r\n ])\r\n )\r\n\r\nlet CostOfConstructionView =\r\n React.memo (\r\n \"CostOfConstructionView\",\r\n (fun (props: {| Model: Model\r\n ContractSettings: ContractSettings\r\n IsSuperUser: bool\r\n Contract: Contract\r\n Dispatch: Msg -> unit |}) ->\r\n\r\n let costView contractSettings isSuperUser contractId model dispatch costsGrouped =\r\n let costsExpanded =\r\n Expanded.view\r\n contractSettings\r\n isSuperUser\r\n contractId\r\n props.Contract\r\n model.JobCostDetails\r\n model.ExpandedCostOfConstructionDetails\r\n model.SearchValues\r\n model.JobCostDetailAttachments\r\n model.TableStates\r\n dispatch\r\n props.Model.JobCostSubs\r\n\r\n let costsCollapsed v =\r\n {| AppSettings = contractSettings\r\n ContractId = contractId\r\n JobPhaseCosts = v\r\n Dispatch = dispatch\r\n Key = v.Phase.Code |}\r\n |> Collapsed.CostsCollapsed\r\n |> List.singleton\r\n \r\n React.fragment [\r\n Html.div [\r\n prop.style [style.paddingBottom(length.px 50)]\r\n prop.children [\r\n Bulma.table [\r\n table.isFullWidth\r\n table.isHoverable\r\n prop.style [Styles.stickyTableBorder]\r\n prop.children [\r\n Html.thead [\r\n prop.children [\r\n Html.tr [\r\n prop.style (Styles.sticky(zIndex = 1))\r\n prop.children [\r\n \r\n let th styles (txt: string) (width: int option) =\r\n Html.th[\r\n prop.style [\r\n style.verticalAlign.middle\r\n if width.IsSome then style.width(length.px width.Value)\r\n yield! styles\r\n ]\r\n prop.text txt\r\n ]\r\n \r\n th [style.textAlign.right] \"Phase Code\" (Some 100)\r\n th [] \"Description\" None\r\n th [style.textAlign.right] \"Earned revenue\" (Some 100)\r\n th [style.textAlign.right] \"Orig Est Cost\" (Some 100)\r\n th [style.textAlign.right] \"Current Est Cost\" (Some 100)\r\n th [style.textAlign.right] \"Actual Costs To Date\" (Some 130)\r\n th [style.textAlign.right] \"Cost To Complete\" (Some 100)\r\n th [style.textAlign.right] \"Gross Profit\" (Some 100)\r\n th [style.textAlign.right; style.whitespace.nowrap] \"% Margin\" (Some 100)\r\n if contractSettings.Projections then\r\n th [style.textAlign.right; style.whitespace.nowrap] \"% Estimate\" (Some 110)\r\n th [style.textAlign.right] \"Project Mgr's Revised Cost\" (Some 130)\r\n ]\r\n ]\r\n ]\r\n ]\r\n Html.tbody [\r\n match costsGrouped with\r\n | [] ->\r\n yield\r\n Html.tr [\r\n Html.td [\r\n prop.colSpan 5\r\n prop.style [ style.textAlign.center; style.padding(30, 0) ]\r\n prop.text \"No Job Costs\"\r\n ]\r\n ]\r\n | _ ->\r\n\r\n let buildCostsForPhase v =\r\n let expanded =\r\n model.ExpandedCostOfConstructionPhases\r\n |> Map.tryFind contractId\r\n |>> (fun m -> m |> List.contains v.Phase.Code)\r\n |> Option.defaultValue false\r\n\r\n v |> if expanded then costsExpanded else costsCollapsed\r\n\r\n yield! costsGrouped >>= buildCostsForPhase\r\n\r\n if costsGrouped.Length > 1 then\r\n yield\r\n CostOfConstructionTotals\r\n {| ApplicationSettings = contractSettings\r\n CostsGrouped = costsGrouped |}\r\n ]\r\n ]\r\n \r\n ]\r\n ] \r\n ]\r\n attachmentsModal\r\n model.JobCostAttachmentsModalOpen\r\n model.JobCostDetailAttachments\r\n model.JobCostAttachmentPreview\r\n model.JobCostAttachmentDownload\r\n model.JobCostDetailAttachmentFiles\r\n model.JobCostDetailAttachmentFilesVisited\r\n dispatch\r\n ]\r\n\r\n props.Model.JobCosts\r\n |> Map.tryFind props.Contract.Id\r\n |> loadingMessageOrContent\r\n \"Loading Job Costs...\"\r\n (costView props.ContractSettings props.IsSuperUser props.Contract.Id props.Model props.Dispatch))\r\n )\r\n","module PortalLibs.Client.Option\r\n\r\nopen Fable.Core\r\n\r\nlet ofInfinite (value: float) =\r\n if JS.isFinite value then\r\n Some value\r\n else\r\n None","module AverageRate\r\n\r\nopen FSharpPlus\r\nopen Client\r\nopen Feliz.Bulma\r\nopen PortalLibs.Client.Util\r\nopen ContractPageModel\r\nopen Model\r\nopen Shared\r\nopen Feliz\r\nopen PortalLibs.Client\r\nopen DisplayNumber\r\n\r\ntype TotalRate =\r\n { Cost: float; Hours: float; CostToComplete: float }\r\n static member Zero = { Cost = 0.0; Hours = 0.0; CostToComplete = 0.0 }\r\n static member (+) (a: TotalRate, b: TotalRate) =\r\n { Cost = a.Cost + b.Cost\r\n Hours = a.Hours + b.Hours\r\n CostToComplete = a.CostToComplete + b.CostToComplete }\r\n \r\nlet totalColumns remainingHoursEnabled costs =\r\n let labor, equip, progress =\r\n costs\r\n |> List.fold (fun (labor, equip, progress) c ->\r\n let cost =\r\n { Cost = c.ActualCostToDate; Hours = c.ActualHoursToDate; CostToComplete = c.CostToComplete }\r\n (if c.IsLaborRateCost then labor + cost else labor),\r\n (if c.IsEquipRateCost then equip + cost else equip),\r\n progress + c.ProgressEntryQuantities)\r\n (TotalRate.Zero, TotalRate.Zero, 0.0)\r\n [\r\n let td (txt: string) =\r\n Html.td [\r\n prop.style [style.textAlign.right]\r\n prop.children [\r\n Html.strong(txt)\r\n ]\r\n ]\r\n td (progress |> AsNumber.stdOrDef)\r\n td (labor.Cost / labor.Hours |> AsCurrency.stdOrDef)\r\n\r\n if remainingHoursEnabled then\r\n td (labor.CostToComplete / (labor.Cost / labor.Hours)\r\n |> Option.ofInfinite\r\n |> Option.defaultValue 0.0\r\n |> sprintf \"%.0f\")\r\n\r\n td (equip.Cost / equip.Hours |> AsCurrency.stdOrDef)\r\n \r\n if remainingHoursEnabled then\r\n td (equip.CostToComplete / (equip.Cost / equip.Hours)\r\n |> Option.ofInfinite\r\n |> Option.defaultValue 0.0\r\n |> sprintf \"%.0f\")\r\n ]\r\n\r\n[]\r\nlet CostsRow remainingHoursEnabled (code: string) (desc: string) costs key =\r\n Html.tr [\r\n yield Html.td [ prop.style[style.textAlign.right]; prop.children[Html.strong code] ]\r\n yield Html.td [ Html.strong desc ]\r\n yield! totalColumns remainingHoursEnabled costs ]\r\n\r\n[]\r\nlet Totals applicationSettings costsGrouped =\r\n let allCosts = costsGrouped >>= fun v -> v.Costs\r\n\r\n Html.tr [\r\n yield Html.td []\r\n yield Html.td [\r\n Html.div [\r\n prop.style [ style.textAlign.right; style.marginRight(length.px 25) ]\r\n prop.children [\r\n Html.strong \"AVERAGE/TOTAL:\"\r\n ]\r\n ]\r\n ]\r\n yield! totalColumns applicationSettings allCosts ]\r\n\r\nlet View =\r\n React.memo (\r\n \"AverageRateView\",\r\n (fun\r\n (props:\r\n {| JobCosts: Map\r\n RemainingHoursEnabled: bool\r\n Contract: Contract\r\n Dispatch: Msg -> unit |}) ->\r\n \r\n let costView remainingHoursEnabled costsGrouped =\r\n Html.div [\r\n prop.style [\r\n style.paddingBottom (length.px 50); style.display.flex; style.justifyContent.spaceAround\r\n ]\r\n prop.children [\r\n Bulma.table [\r\n table.isHoverable\r\n prop.style [style.minWidth(length.px 500); Styles.stickyTableBorder]\r\n prop.children [\r\n Html.thead [\r\n prop.style (Styles.sticky())\r\n prop.children [\r\n if props.RemainingHoursEnabled then\r\n Html.tr [\r\n Html.th [\r\n prop.colSpan 3\r\n ]\r\n Html.th [\r\n prop.colSpan 2\r\n prop.style[style.backgroundColor.red\r\n style.backgroundColor \"rgb(235, 235, 235)\"; style.textAlign.center]\r\n prop.text \"Labor\"\r\n ]\r\n Html.th [\r\n prop.colSpan 2\r\n prop.style[style.backgroundColor.red\r\n style.backgroundColor \"rgb(239, 239, 227)\"; style.textAlign.center]\r\n prop.text \"Equipment\"\r\n ]\r\n ]\r\n Html.tr [\r\n prop.children [\r\n let th styles (txt: string) (width: int option) =\r\n Html.th [\r\n prop.style[style.verticalAlign.middle\r\n if width.IsSome then style.width(length.px(width.Value))\r\n yield! styles]\r\n prop.text txt\r\n ]\r\n \r\n th [style.textAlign.right] \"Phase Code\" (Some 150)\r\n th [] \"Description\" None\r\n th [style.textAlign.right] \"Progress Entry Quantities\" (Some 200) \r\n th [style.textAlign.right] (if remainingHoursEnabled then \"Rate\" else \"Labor Rate\") (Some 150)\r\n if remainingHoursEnabled then\r\n th [style.textAlign.right] \"Remaining Hours\" (Some 200)\r\n th [style.textAlign.right] (if remainingHoursEnabled then \"Rate\" else \"Equip Rate\") (Some 150)\r\n if remainingHoursEnabled then\r\n th [style.textAlign.right] \"Remaining Hours\" (Some 200)\r\n ]\r\n ]\r\n ]\r\n \r\n ]\r\n Html.tbody [\r\n match\r\n costsGrouped\r\n |>> (fun v ->\r\n { Phase = v.Phase\r\n Costs = v.Costs |> List.filter (fun x -> x.IsLaborRateCost || x.IsEquipRateCost) })\r\n |> List.filter (fun v -> not v.Costs.IsEmpty)\r\n with\r\n | [] ->\r\n yield\r\n Html.tr [\r\n Html.td [\r\n prop.colSpan(8)\r\n prop.style [style.textAlign.center; style.padding(30, 0)]\r\n prop.text \"No Job costs available.\"\r\n ]]\r\n | costs ->\r\n yield!\r\n costs\r\n |>> (fun v ->\r\n CostsRow\r\n props.RemainingHoursEnabled\r\n v.Phase.Code\r\n v.Phase.Desc\r\n v.Costs\r\n $\"Costs-%s{v.Phase.Code}\" )\r\n\r\n if costs.Length > 1 then\r\n yield Totals props.RemainingHoursEnabled costs ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n\r\n loadingMessageOrContent\r\n \"Loading Rates...\"\r\n (costView props.RemainingHoursEnabled)\r\n (Map.tryFind props.Contract.Id props.JobCosts))\r\n )","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Label =\r\n\r\n type Option =\r\n | Size of ISize\r\n /// Set `For` HTMLAttr\r\n | For of string\r\n | CustomClass of string\r\n | Props of IHTMLProp list\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate \r\n let label options children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Size size -> ofSize size |> result.AddClass\r\n | For htmlFor -> HtmlFor htmlFor |> result.AddProp\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"label\").ToReactElement(label, children)\r\n","module PortalLibs.Client.Components.Progress\r\n\r\n\r\nopen Fable.Core\r\nopen Fable.Core.JsInterop\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen PortalLibs.Client.Util\r\nopen Fulma\r\nopen System\r\nopen Feliz\r\n\r\n\r\n[]\r\nlet ReactProgress: obj = jsNative\r\n\r\nimportAll \"react-circular-progressbar/dist/styles.css\"\r\n\r\n\r\nlet CircleProgress =\r\n React.memo (\r\n \"CircleProgress\",\r\n (fun (props: {| percent: float\r\n border: float\r\n key: string |}) ->\r\n let props =\r\n createObj [\r\n //yield \"value\" => System.Math.Abs(percent)\r\n yield \"percentage\" => Math.Abs(props.percent)\r\n yield\r\n \"text\"\r\n => sprintf \"%s%%\" (Math.Round(props.percent, 2).ToString())\r\n yield \"strokeWidth\" => 50\r\n yield \"initialAnimation\" => true\r\n if (props.percent < 0.0) then\r\n yield \"counterClockwise\" => true\r\n yield\r\n \"styles\"\r\n => createObj [\r\n \"path\"\r\n => createObj [\r\n \"strokeLinecap\" => \"butt\"\r\n \"stroke\"\r\n => if (props.percent < props.border) then\r\n \"red\"\r\n else\r\n \"#00cc00\"\r\n \"transition\" => \"stroke-dashoffset 3s ease 0.5s\"\r\n ]\r\n \"trail\" => createObj []\r\n \"text\"\r\n => createObj [\r\n \"fontSize\" => \"26px\"\r\n \"fill\" => \"black\"\r\n ]\r\n ]\r\n ]\r\n\r\n div [ Style [\r\n Width \"50px\"\r\n Display DisplayOptions.Flex\r\n AlignItems AlignItemsOptions.Center\r\n FontWeight \"bold\"\r\n ] ] [\r\n ofImport \"default\" \"react-circular-progressbar\" props []\r\n ]),\r\n (fun (props: {| percent: float\r\n border: float\r\n key: string |}) -> props.key),\r\n areEqual = Helpers.equalsButFunctions\r\n )\r\n\r\n\r\nlet progressWithLabel name1 name2 value =\r\n div [ Style [\r\n MarginRight \"15px\"\r\n Width \"150px\"\r\n MarginBottom \"15px\"\r\n ] ] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexDirection \"column\"\r\n Height \"100%\"\r\n Width \"110px\"\r\n JustifyContent \"space-between\"\r\n ] ] [\r\n div [ Style [ MarginBottom \"5px\" ] ] [\r\n Label.label [] [\r\n str name1\r\n br []\r\n str name2\r\n ]\r\n ]\r\n Control.div [ Control.Props [\r\n Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"space-around\"\r\n ]\r\n ] ] [\r\n CircleProgress(\r\n {| percent = value\r\n border = 0.0\r\n key = name1 + name2 |}\r\n )\r\n ]\r\n ]\r\n ]\r\n\r\n[]\r\nlet Gauge: obj = jsNative\r\n\r\nlet calcColor percent =\r\n let getHexColor (num: float) =\r\n let string = num.ToString(\"x\")\r\n\r\n if string.Length = 1 then\r\n \"0\" + string\r\n else\r\n string\r\n\r\n let r =\r\n if percent > 0.0 then\r\n 0.0\r\n else\r\n Math.Floor(Math.Abs(percent) * 2.55)\r\n\r\n let g =\r\n if percent < 0.0 then\r\n 0.0\r\n else\r\n Math.Floor((percent + 20.0) * 2.55)\r\n\r\n let b = 0.0\r\n sprintf \"#%s%s%s\" (getHexColor r) (getHexColor g) (getHexColor b)\r\n\r\n\r\nlet GaugeProgress =\r\n React.memo (\r\n \"GaugeProgress\",\r\n (fun (props: {| percent: float; key: string |}) ->\r\n let gaugeProps =\r\n createObj [\r\n \"value\" => Math.Abs(props.percent)\r\n \"width\" => 80\r\n \"height\" => 64\r\n \"color\" => calcColor props.percent\r\n \"topLabelStyle\"\r\n => createObj [ \"display\" => \"none\" ]\r\n \"minMaxLabelStyle\"\r\n => createObj [ \"display\" => \"none\" ]\r\n \"valueFormatter\" => fun _ -> props.percent\r\n \"valueLabelStyle\"\r\n => createObj [\r\n yield \"fontSize\" => \"14px\"\r\n yield \"fontWeight\" => \"bold\"\r\n if props.percent < 0.0 then\r\n yield \"transform\" => \"scaleX(-1) translateX(-82px)\"\r\n ]\r\n ]\r\n\r\n div [ Style [\r\n yield MarginTop \"-18px\"\r\n yield MarginBottom \"-20px\"\r\n if props.percent < 0.0 then\r\n yield Transform \"scaleX(-1)\"\r\n //Width \"50px\"\r\n // Display DisplayOptions.Flex\r\n // AlignItems AlignItemsOptions.Center\r\n // FontWeight \"bold\"\r\n ] ] [\r\n ofImport \"default\" \"react-svg-gauge\" gaugeProps []\r\n ]),\r\n (fun (props: {| percent: float; key: string |}) -> props.key),\r\n areEqual = Helpers.equalsButFunctions\r\n )\r\n\r\n//[]\r\n//let ReactProgress : obj = jsNative\r\n\r\n//[]\r\n//let ReactProgressCSS : obj = jsNative\r\n\r\n//let circleProgress (percent: float) =\r\n// let props =\r\n// createObj [ \"percent\" => percent\r\n// \"status\" => \"default\"\r\n// \"theme\" => createObj [ \"default\" => createObj [\r\n// \"color\" => if percent < 0.0 then \"red\" else \"green\"\r\n// \"trailColor\" => if percent < 0.0 then \"pink\" else \"lightBlue\"\r\n// ] ]\r\n// \"type\" => \"circle\"\r\n// \"width\" => 50\r\n// \"strokeWidth\" => 8\r\n// ]\r\n\r\n// div [ ] [ ofImport \"Progress\" \"react-sweet-progress\" props [] ]\r\n","module ContractProfitFade\r\n\r\nopen FSharpPlus\r\nopen Client\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Model\r\nopen PortalLibs.Client.Util\r\nopen Fable.Core\r\nopen PortalLibs.Client.Components.Progress\r\nopen Fable.Core.JsInterop\r\nopen System\r\nopen Feliz\r\n\r\n[]\r\nlet ReactChartkick: obj = jsNative\r\n\r\nimportAll \"chartkick/chart.js\"\r\n\r\n[]\r\nlet Chart: obj = jsNative\r\n\r\nChart?defaults?elements?point?radius <- 0\r\n\r\nReactChartkick?addAdapter Chart\r\n\r\nlet ProfitFadeChart =\r\n React.memo (\r\n \"ProfitFadeChart\",\r\n (fun (props: {| profitFadeEntries: ContractProfit list\r\n Key: string |}) ->\r\n let revenueData =\r\n props.profitFadeEntries\r\n |> Seq.skipWhile (fun h -> h.Revenue = 0.0) \r\n |>> fun h -> (h.Mth |> prettyPrintDateDashes, h.Revenue)\r\n |> Seq.toArray\r\n\r\n let gpPctData =\r\n props.profitFadeEntries\r\n |>> fun h -> (h.Mth |> prettyPrintDateDashes, Math.Round(h.GPPct * 100.0, 2))\r\n |> Seq.toArray\r\n\r\n let grossProfit =\r\n props.profitFadeEntries\r\n |>> fun h -> (h.Mth |> prettyPrintDateDashes, h.Revenue - h.Cost)\r\n |> Seq.toArray\r\n\r\n let inputProps =\r\n {| thousands = \",\"\r\n height = \"400px\"\r\n curve = false\r\n data =\r\n [| {| name = \"Revenue\"\r\n data = revenueData\r\n dataset = {| yAxisID = \"y\" |}\r\n color = \"#00cc00\" |}\r\n {| name = \"GP\"\r\n data = gpPctData\r\n dataset = {| yAxisID = \"y2\" |}\r\n color = \"#1a75ff\" |}\r\n {| name = \"Gross Profit\"\r\n data = grossProfit\r\n dataset = {| yAxisID = \"y\" |}\r\n color = \"#ff6347\" |} |]\r\n library =\r\n {| responsive = true\r\n hover = {| mode = \"nearest\"; intersect = true |}\r\n scales =\r\n {| y =\r\n {| display = true\r\n ticks = {| display = true; maxTicksLimit = 6 |}\r\n title = {| display = true; text = \"Revenue & Gross Profit\" |}\r\n gridLines = {| display = true |} |}\r\n y2 =\r\n {| display = true\r\n ticks =\r\n {| display = true\r\n callback = fun value -> value + \"%\" |}\r\n title = {| display = true; text = \"GP%\" |}\r\n id = \"y-axis-2\"\r\n position = \"right\"\r\n gridLines = {| drawOnChartArea = false |} |}\r\n x =\r\n {| display = true\r\n gridLines =\r\n {| display = true\r\n color = \"rgba(0, 0, 0, 0.1)\"\r\n lineWidth = 1\r\n drawOnChartArea = 1 |} |} |}\r\n\r\n animation =\r\n {| duration = 1500\r\n easing = \"easeOutElastic\" |}\r\n plugins =\r\n {| legend = {| position = \"bottom\" |}\r\n tooltip =\r\n {| mode = \"index\"\r\n intersect = false\r\n displayColors = true\r\n padding = 10\r\n bodySpacing = 4\r\n callbacks =\r\n {| label =\r\n fun item ->\r\n let label, data =\r\n match item?datasetIndex with\r\n | 0 -> (\" Revenue\",\r\n $\"%15s{(DisplayNumber.AsCurrency.std: float -> string) item?raw}\")\r\n | 1 -> (\" GP%\", sprintf \"%17.2f%%\" item?raw)\r\n | _ ->\r\n (\"Gross profit\",\r\n $\"%15s{(DisplayNumber.AsCurrency.std: float -> string) item?raw}\")\r\n\r\n $\"%s{label}:%s{data}\"\r\n title = fun (item: obj array) -> $\"%22s{item[0]?label}\" |} |} |} |} |}\r\n\r\n ofImport \"LineChart\" \"react-chartkick\" inputProps []),\r\n (fun (props: {| profitFadeEntries: ContractProfit list\r\n Key: string |}) -> $\"ProfitFadeChart-%s{props.Key}\")\r\n )\r\n\r\nlet profitFadeValues (profitFadeOpt: ContractProfitFade option) =\r\n match profitFadeOpt with\r\n | None ->\r\n div [ Style [\r\n TextAlign TextAlignOptions.Center\r\n ] ] [\r\n str \"Profit fade details not available.\"\r\n ]\r\n | Some profitFade ->\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexWrap \"wrap\"\r\n AlignSelf AlignSelfOptions.FlexEnd\r\n TextAlign TextAlignOptions.Left\r\n PaddingBottom \"10px\"\r\n MarginLeft \"auto\"\r\n MarginRight \"auto\"\r\n JustifyContent \"space-around\"\r\n PaddingLeft \"35px\"\r\n ] ] [\r\n textFieldReadOnlyStyles\r\n (Some 150)\r\n []\r\n \"Contract Amount\"\r\n (profitFade.ContractAmount\r\n |> DisplayNumber.AsCurrency.std)\r\n textFieldReadOnlyStyles\r\n (Some 150)\r\n []\r\n \"Profit delta over life of contract\"\r\n (profitFade.ProfitLifeDelta\r\n |> DisplayNumber.AsCurrency.std)\r\n textFieldReadOnlyStyles\r\n (Some 150)\r\n []\r\n \"Profit delta over last 3 months\"\r\n (profitFade.Profit3MthDelta\r\n |> DisplayNumber.AsCurrency.std)\r\n progressWithLabel \"Current Contract GP%\" \"\" (profitFade.CurrentGP * 100.0)\r\n progressWithLabel \"GP delta\" \"life of contract\" (profitFade.GPLifeDelta * 100.0)\r\n progressWithLabel \"GP delta\" \"last 3 months\" (profitFade.GP3MthDelta * 100.0)\r\n ]\r\n\r\nlet View contractProfitFades (contract: Contract) =\r\n let profitFadeView (profitFadeOpt, jobProfits) =\r\n div [ Style [ PaddingBottom \"50px\" ] ] [\r\n div [ Style [\r\n PaddingBottom \"25px\"\r\n PaddingTop \"15px\"\r\n ] ] [\r\n profitFadeValues profitFadeOpt\r\n ]\r\n ProfitFadeChart\r\n {| profitFadeEntries = jobProfits\r\n Key = sprintf \"FadeChart-%i\" contract.Id |}\r\n ]\r\n\r\n loadingMessageOrContent\r\n \"Loading Profit Fade...\"\r\n profitFadeView\r\n (Map.tryFind contract.Id contractProfitFades)","module Client.ContractPage.PurchaseOrders.Config\r\n\r\nopen Feliz\r\n\r\nlet costColor = style.backgroundColor \"rgb(239, 239, 227)\"\r\nlet quantityColor = style.backgroundColor \"rgb(235, 235, 235)\"\r\n","module Client.ContractPage.PurchaseOrders.OrderItemReport\r\n\r\nopen FSharpPlus\r\nopen Client\r\nopen Elmish\r\nopen Fable.FontAwesome\r\nopen Feliz.Bulma\r\nopen Feliz.UseElmish\r\nopen PortalLibs.Client.Util\r\nopen ContractPageModel\r\nopen Model\r\nopen PortalLibs.Shared\r\nopen Feliz\r\nopen Shared\r\n\r\nlet middle = prop.style[style.textAlign.center]\r\nlet left = prop.style[style.textAlign.left]\r\nlet right = prop.style[style.textAlign.right]\r\n\r\nlet twoDigitsCurrency =\r\n float\r\n >> formatNumber false MinusSign false AllTwoDigits\r\n\r\ntype State = { Expanded: PurchaseOrderId Set }\r\ntype Msg = | Toggle of PurchaseOrderId\r\nlet init () = { Expanded = Set.empty }, Cmd.none\r\nlet update msg state =\r\n match msg with\r\n | Toggle id ->\r\n let updated =\r\n match Set.contains id state.Expanded with\r\n | true -> Set.remove id state.Expanded\r\n | false -> Set.add id state.Expanded\r\n { state with Expanded = updated }, Cmd.none\r\n\r\nlet TdCosts style children costs = [\r\n Html.td [ style; prop.children [ children <| twoDigitsCurrency costs.Current ] ]\r\n Html.td [ style; prop.children [ children <| twoDigitsCurrency costs.Received ] ]\r\n Html.td [ style; prop.children [ children <| twoDigitsCurrency costs.Invoiced ] ]\r\n Html.td [ style; prop.children [ children <| twoDigitsCurrency costs.Remaining ] ]\r\n]\r\n\r\nlet Row =\r\n React.memo<{| Po: PurchaseOrder; Toggle: PurchaseOrderId -> unit; Expanded: bool |}>(\r\n name = \"OrderItemReportRow\",\r\n withKey = (fun props -> (props.Po.ContractId, props.Po.Number).ToString()),\r\n areEqual = Fable.React.Helpers.equalsButFunctions,\r\n render = fun props ->\r\n let po = props.Po\r\n let toggle = props.Toggle\r\n let expanded = props.Expanded\r\n React.fragment [\r\n Html.tr [\r\n if expanded then prop.style [ Config.quantityColor ]\r\n prop.onClick(fun _ -> { ContractId = po.ContractId; Number = po.Number } |> toggle)\r\n prop.children [\r\n Html.td [ left; prop.children [ Html.a [Html.strong po.Number] ] ]\r\n Html.td [ left; prop.children [ Html.a [Html.strong po.Description] ] ]\r\n Html.td [ left; prop.children [ Html.a [\r\n Html.div [\r\n prop.style [ style.display.flex; style.justifyContent.spaceBetween ]\r\n prop.children [\r\n Html.strong po.VendorName\r\n Bulma.icon [ prop.style[ style.color \"#b5b5b5\" ]\r\n prop.children[ Fa.i [\r\n if expanded then Fa.Solid.ChevronUp else Fa.Solid.ChevronDown\r\n ] []]]\r\n ]\r\n ]\r\n ] ] ]\r\n if expanded\r\n then\r\n Html.td [prop.colSpan 10]\r\n else\r\n Html.td [prop.colSpan 6]\r\n yield! TdCosts right Html.strong po.TotalCosts\r\n ]\r\n ]\r\n if expanded then\r\n yield! po.Items |> List.map(fun poi ->\r\n Html.tr [\r\n Html.td [ right; prop.text poi.ItemNumber ]\r\n Html.td [ left; prop.text poi.Description ]\r\n Html.td []\r\n Html.td [ left; prop.text poi.UnitOfMeasure ]\r\n Html.td [ right; prop.text (twoDigitsCurrency poi.UnitCost) ]\r\n yield! TdCosts right Html.text poi.Quantity\r\n yield! TdCosts right Html.text poi.Cost\r\n ])\r\n Html.tr [\r\n Html.td []\r\n Html.td [ left; prop.children [ Html.strong \"TOTALS\"] ]\r\n Html.td [ prop.colSpan 7 ]\r\n yield! TdCosts right Html.text po.TotalCosts\r\n ]\r\n ])\r\n\r\nlet View =\r\n React.memo<{| Po: PurchaseOrder list option\r\n Model: Model\r\n Dispatch: ContractPageModel.Msg -> unit\r\n AddRequesting: bool\r\n Contract: Contract |}> (\r\n name = \"OrderItemReport\",\r\n withKey = (fun props -> props.Contract.Id.ToString()),\r\n render = fun props ->\r\n \r\n let state, toggle = React.useElmish(init, update, [| |])\r\n \r\n props.Po\r\n |> loadingMessageOrContent \"Loading Purchase Orders...\" (fun po ->\r\n let addRequesting = props.AddRequesting\r\n let contract = props.Contract\r\n let dispatch = props.Dispatch\r\n \r\n Html.div [\r\n if addRequesting then\r\n yield Html.div [\r\n prop.style [ style.display.flex; style.justifyContent.flexEnd; style.alignItems.center ]\r\n prop.children [\r\n Bulma.button.button [\r\n prop.style [ style.marginBottom(length.rem 1.5) ]\r\n prop.onClick (fun _ -> contract.Id |> Some |> RequestPurchaseOrderContractId |> dispatch)\r\n prop.text \"Request Purchase Order\" \r\n ]\r\n ]\r\n ]\r\n yield\r\n Bulma.table [\r\n table.isFullWidth\r\n table.isHoverable\r\n prop.style [Styles.stickyTableBorder]\r\n prop.children [\r\n Html.thead [\r\n prop.style (Styles.sticky())\r\n prop.children [\r\n Html.tr [\r\n prop.children [\r\n Html.th [ prop.colSpan 5; prop.style[style.backgroundColor.white] ]\r\n Html.th [\r\n prop.colSpan 4\r\n prop.style [ style.textAlign.center; Config.quantityColor ]\r\n prop.text \"Quantity (units)\"\r\n ]\r\n Html.th [\r\n prop.colSpan 4\r\n prop.style [ style.textAlign.center; Config.costColor ]\r\n prop.text \"Cost\"\r\n ]\r\n ]\r\n ]\r\n Html.tr [\r\n Html.th [\r\n prop.style [ style.textAlign.left; style.width(length.px 50) ]\r\n prop.text \"PO ITEM\"\r\n ]\r\n Html.th [left; prop.text \"Description\"]\r\n Html.th [left; prop.text \"Vendor\"]\r\n Html.th [left; prop.text \"UM\"]\r\n Html.th [right; prop.text \"Unit Cost\"]\r\n Html.th [right; prop.text \"Current\"]\r\n Html.th [right; prop.text \"Received\"]\r\n Html.th [right; prop.text \"Invoiced\"]\r\n Html.th [right; prop.text \"Remaining\"]\r\n Html.th [right; prop.text \"Current\"]\r\n Html.th [right; prop.text \"Received\"]\r\n Html.th [right; prop.text \"Invoiced\"]\r\n Html.th [right; prop.text \"Remaining\"]\r\n ]\r\n ]\r\n ]\r\n Html.tbody [\r\n yield!\r\n match po with\r\n | [] -> []\r\n | v ->\r\n v\r\n |>> fun po ->\r\n state.Expanded\r\n |> Set.contains { ContractId = po.ContractId; Number = po.Number }\r\n |> fun found -> Row {| Po = po; Toggle = (Toggle >> toggle); Expanded = found |}\r\n ]\r\n ]\r\n ]\r\n ])\r\n )\r\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Browser.Types\r\n\r\n[]\r\nmodule Input =\r\n\r\n module Classes =\r\n let [] Container = \"input\"\r\n module State =\r\n let [] IsFocused = \"is-focused\"\r\n let [] IsActive = \"is-active\"\r\n let [] IsHovered = \"is-hovered\"\r\n let [] IsLoading = \"is-loading\"\r\n let [] IsStatic = \"is-static\"\r\n module Styles =\r\n let [] IsRounded = \"is-rounded\"\r\n module Size =\r\n let [] IsSmall = \"is-small\"\r\n let [] IsMedium = \"is-medium\"\r\n let [] IsLarge = \"is-large\"\r\n let [] IsFullwidth = \"is-fullwidth\"\r\n let [] IsInline = \"is-inline\"\r\n\r\n type IInputType =\r\n | Text\r\n | Password\r\n | DatetimeLocal\r\n | Date\r\n | Month\r\n | Time\r\n | Week\r\n | Number\r\n | Email\r\n | Url\r\n | Search\r\n | Tel\r\n | ColorType\r\n\r\n type Option =\r\n | Size of ISize\r\n /// Set `Type` HTMLAttr\r\n /// Don't use if you used one of the helpers like: `Input.password`\r\n | Type of IInputType\r\n | Color of IColor\r\n /// Set `Id` HTMLAttr\r\n | Id of string\r\n /// Add `disabled` HTMLAttr if true\r\n | Disabled of bool\r\n /// Set `IsReadOnly` HTMLAttr\r\n | IsReadOnly of bool\r\n /// Add `is-static` class if true\r\n | [] IsStatic of bool\r\n /// Add `is-rounded` class\r\n | [] IsRounded\r\n /// Set `Value` HTMLAttr\r\n | Value of string\r\n | Key of string\r\n /// Set `DefaultValue` HTMLAttr\r\n | DefaultValue of string\r\n /// `Ref` callback that sets the value of an input textbox after DOM element is created.\r\n | ValueOrDefault of string\r\n /// Set `Placeholder` HTMLAttr\r\n | Placeholder of string\r\n | OnChange of (Event -> unit)\r\n | Ref of (Element->unit)\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n let private ofType (typ : IInputType) =\r\n match typ with\r\n | Text -> \"text\"\r\n | Password -> \"password\"\r\n | DatetimeLocal -> \"datetime-local\"\r\n | Date -> \"date\"\r\n | Month -> \"month\"\r\n | Time -> \"time\"\r\n | Week -> \"week\"\r\n | Number -> \"number\"\r\n | Email -> \"email\"\r\n | Url -> \"url\"\r\n | Search -> \"search\"\r\n | Tel -> \"tel\"\r\n | IInputType.ColorType -> \"color\"\r\n\r\n open Fable.Core.JsInterop\r\n\r\n /// Generate \r\n let input (options : Option list) =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | IsStatic state -> if state then result.AddCaseName option else result\r\n | IsRounded -> result.AddCaseName option\r\n | Size size -> ofSize size |> result.AddClass\r\n | Color color -> ofColor color |> result.AddClass\r\n | Type type' -> Props.Type (ofType type') |> result.AddProp\r\n | Id id -> Props.Id id |> result.AddProp\r\n | Disabled disabled -> Props.Disabled disabled |> result.AddProp\r\n | IsReadOnly state -> Props.ReadOnly state |> result.AddProp\r\n | Value value -> Props.Value value |> result.AddProp\r\n | DefaultValue defaultValue -> Props.DefaultValue defaultValue |> result.AddProp\r\n | ValueOrDefault valueOrDefault ->\r\n Props.Ref <| (fun e ->\r\n if e |> isNull |> not\r\n && !!e?value <> valueOrDefault then\r\n e?value <- valueOrDefault\r\n ) |> result.AddProp\r\n | Placeholder placeholder -> Props.Placeholder placeholder |> result.AddProp\r\n | OnChange cb -> Props.OnChange cb |> result.AddProp\r\n | Ref ref -> Props.Ref ref |> result.AddProp\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n | Key k -> Props.Prop.Key k |> result.AddProp\r\n\r\n GenericOptions.Parse(options, parseOptions, \"input\").ToReactElement(input)\r\n\r\n /// Generate \r\n let inline text options = input (Type Text :: options)\r\n /// Generate \r\n let inline password options = input (Type Password :: options)\r\n /// Generate \r\n let inline datetimeLocal options = input (Type DatetimeLocal :: options)\r\n /// Generate \r\n let inline date options = input (Type Date :: options)\r\n /// Generate \r\n let inline month options = input (Type Month :: options)\r\n /// Generate \r\n let inline time options = input (Type Time :: options)\r\n /// Generate \r\n let inline week options = input (Type Week :: options)\r\n /// Generate \r\n let inline number options = input (Type Number :: options)\r\n /// Generate \r\n let inline email options = input (Type Email :: options)\r\n /// Generate \r\n let inline url options = input (Type Url :: options)\r\n /// Generate \r\n let inline search options = input (Type Search :: options)\r\n /// Generate \r\n let inline tel options = input (Type Tel :: options)\r\n /// Generate \r\n let inline color options = input (Type IInputType.ColorType :: options)\r\n","module PortalLibs.Client.Components.Multiline\r\n\r\n\r\nopen Browser.Types\r\nopen Fable.React\r\nopen Elmish\r\nopen Thoth.Elmish\r\nopen System\r\nopen PortalLibs.Client.Util\r\nopen Feliz\r\nopen Fable.Core.JsInterop\r\nopen Feliz.UseElmish\r\n\r\ntype private Model =\r\n { BoundValue: string\r\n IsLoading: bool\r\n //Input : string\r\n Debouncer: Debouncer.State }\r\n\r\n\r\ntype ReadWriteSettings =\r\n { ValueChanged: string -> unit\r\n Spellcheck: bool }\r\n\r\ntype Mode =\r\n | Readonly\r\n | ReadWrite of ReadWriteSettings\r\n\r\ntype private Msg =\r\n | Input of string\r\n | InputChanged of string\r\n | DebouncerSelfMsg of Debouncer.SelfMessage\r\n\r\nlet private init value : Model * Cmd =\r\n {\r\n //Input = value\r\n IsLoading = false\r\n BoundValue = value\r\n Debouncer = Debouncer.create ()\r\n //IconVisible = true\r\n },\r\n Cmd.none\r\n\r\nlet private update mode msg model =\r\n match msg with\r\n | DebouncerSelfMsg debouncerMsg ->\r\n let debouncerModel, debouncerCmd =\r\n Debouncer.update debouncerMsg model.Debouncer\r\n\r\n { model with Debouncer = debouncerModel }, debouncerCmd\r\n | Input s ->\r\n let debouncerModel, debouncerCmd =\r\n if s <> \"\" then\r\n model.Debouncer\r\n |> Debouncer.bounce (TimeSpan.FromSeconds 1.0) \"MultilineChange\" (InputChanged s)\r\n else\r\n Debouncer.create (), Cmd.none\r\n\r\n { model with\r\n BoundValue = s\r\n IsLoading = true\r\n Debouncer = debouncerModel },\r\n Cmd.batch [\r\n yield Cmd.map DebouncerSelfMsg debouncerCmd\r\n if s = \"\" then\r\n yield Cmd.ofMsg (InputChanged s)\r\n ]\r\n | InputChanged s ->\r\n { model with IsLoading = false },\r\n match mode with\r\n | Readonly -> Cmd.none\r\n | ReadWrite settings -> Cmd.ofSub (fun _ -> settings.ValueChanged s)\r\n\r\nlet private MultilineInnerComp =\r\n React.memo (\r\n \"MultilineInnerComp\",\r\n (fun (props: {| Mode: Mode\r\n Key: string\r\n BoundValue: string\r\n Rows: int option\r\n MaxRows: int option\r\n Ref: IRefValue option\r\n Dispatch: Msg -> unit |}) ->\r\n let inputProps =\r\n createObj [\r\n yield\r\n \"onChange\"\r\n => (fun (e: Browser.Types.Event) -> Input(e.Value) |> props.Dispatch)\r\n match props.Ref with\r\n | Some r -> yield \"ref\" => r\r\n | None -> ()\r\n yield \"defaultValue\" => props.BoundValue\r\n // \"value\" => txtValue\r\n // \"innerRef\" => (fun e -> if e |> isNull |> not && !!e?value <> !!txtValue then e?value <- !!txtValue)\r\n yield \"key\" => props.Key\r\n yield\r\n \"className\"\r\n => match props.Mode with\r\n | Readonly -> \"textarea disabledtextarea\"\r\n | ReadWrite _ -> \"textarea\"\r\n yield\r\n \"spellCheck\"\r\n => match props.Mode with\r\n | Readonly -> false\r\n | ReadWrite settings -> settings.Spellcheck\r\n //match mode with\r\n //| Readonly -> yield \"readonly\" => \"readonly\"\r\n //| ReadWrite _ -> ()\r\n match props.Mode with\r\n | Readonly -> yield \"disabled\" => \"disabled\"\r\n | ReadWrite _ -> ()\r\n\r\n match props.Rows with\r\n | None -> ()\r\n | Some rows -> yield \"rows\" => rows\r\n\r\n match props.MaxRows with\r\n | None -> ()\r\n | Some rows -> yield \"maxRows\" => rows\r\n\r\n // todo: refactor to parameter props.MaxLength and fix all usages?\r\n // is this limit safe for all usages?\r\n yield \"maxLength\" => 1500\r\n\r\n yield\r\n \"style\"\r\n => match props.Mode with\r\n | Readonly ->\r\n createObj [\r\n \"padding\" => \"calc(0.3em - 1px) 0 0 0\"\r\n \"cursor\" => \"auto\"\r\n ]\r\n | ReadWrite _ ->\r\n createObj [\r\n \"padding\" => \"calc(0.3em - 1px)\"\r\n ]\r\n ]\r\n\r\n ofImport \"default\" \"react-autosize-textarea\" inputProps []),\r\n (fun (props: {| Mode: Mode\r\n Key: string\r\n BoundValue: string\r\n Rows: int option\r\n MaxRows: int option\r\n Ref: IRefValue option\r\n Dispatch: Msg -> unit |}) -> props.Key),\r\n areEqual = Helpers.equalsButFunctions\r\n )\r\n\r\n[]\r\nlet Multiline\r\n (props: {| Mode: Mode\r\n Value: string\r\n Key: string\r\n Rows: int option\r\n MaxRows: int option\r\n Ref: IRefValue option |})\r\n =\r\n let state, dispatch =\r\n React.useElmish (init props.Value, update props.Mode, [| box props.Value; box props.Mode |])\r\n\r\n MultilineInnerComp\r\n {| Mode = props.Mode\r\n Key = props.Key\r\n Rows = props.Rows\r\n MaxRows = props.MaxRows\r\n BoundValue = state.BoundValue\r\n Ref = props.Ref\r\n Dispatch = dispatch |}\r\n","[]\r\nmodule Fable.React.Extensions\r\n\r\ntype Browser.Types.Event with\r\n /// Access the value from target\r\n /// Equivalent to `(this.target :?> HTMLInputElement).value`\r\n member this.Value =\r\n (this.target :?> Browser.Types.HTMLInputElement).value\r\n\r\n /// Access the checked property from target\r\n /// Equivalent to `(this.target :?> HTMLInputElement).checked`\r\n member this.Checked =\r\n (this.target :?> Browser.Types.HTMLInputElement).``checked``\r\n","module Client.ContractPage.PurchaseOrders.PurchaseOrders\r\n\r\nopen Feliz\r\nopen Model\r\nopen Shared\r\n\r\nlet View model contractSettings (contract: Contract) purchaseOrders dispatch =\r\n\r\n let addRequesting = contractSettings.PurchaseOrderSettings.Requests\r\n \r\n Html.div [\r\n prop.style [\r\n style.paddingBottom(length.px 50)\r\n style.justifyContent.spaceAround\r\n ]\r\n prop.children [\r\n match contractSettings.PurchaseOrderSettings.Version with\r\n | Basic -> Basic.View addRequesting contract purchaseOrders dispatch\r\n | OrderItemReport -> OrderItemReport.View\r\n {| Po = purchaseOrders\r\n Model = model\r\n Dispatch = dispatch\r\n AddRequesting = addRequesting\r\n Contract = contract |}\r\n \r\n if contractSettings.PurchaseOrderSettings.Requests then\r\n RequestModal.View model contract dispatch\r\n ]\r\n ]","module Client.ContractPage.PurchaseOrders.Basic\r\n\r\nopen Client\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Feliz\r\nopen Feliz.Bulma\r\nopen Fulma\r\nopen PortalLibs.Client.Util\r\nopen Model\r\nopen Fable.FontAwesome\r\nopen PortalLibs.Shared\r\nopen ContractPageModel\r\n\r\nlet View addRequesting (contract: Contract) (purchaseOrders: PurchaseOrder list option) dispatch =\r\n Card.card [ Props [\r\n Style [\r\n MarginRight \"15px\"\r\n MarginTop \"10px\"\r\n BorderRadius \".5rem\"\r\n ]\r\n ] ] [\r\n yield\r\n Card.header [] [\r\n Card.Header.title [ Card.Header.Title.Props [\r\n Style [\r\n PaddingTop \"5px\"\r\n PaddingBottom \"5px\"\r\n Display DisplayOptions.Flex\r\n FlexWrap \"wrap\"\r\n AlignItems AlignItemsOptions.Center\r\n ]\r\n ] ] [\r\n yield\r\n span [ Style [ Width \"380px\" ] ] [\r\n str \"Purchase Orders\"\r\n ]\r\n match purchaseOrders with\r\n | None ->\r\n yield\r\n Icon.icon [ Icon.Size ISize.IsMedium ] [\r\n Fa.i [ Fa.Solid.Spinner\r\n Fa.Pulse\r\n (Fa.Size Fa.Fa2x) ] []\r\n ]\r\n | Some _ -> ()\r\n ]\r\n if addRequesting then\r\n Bulma.cardHeaderIcon.a [\r\n prop.style [\r\n style.paddingTop (length.px 5)\r\n style.paddingBottom (length.px 5)\r\n ]\r\n prop.children [\r\n Bulma.button.button [\r\n prop.onClick (fun _ ->\r\n contract.Id\r\n |> Some\r\n |> RequestPurchaseOrderContractId\r\n |> dispatch)\r\n prop.children [\r\n Bulma.icon [\r\n prop.style [ style.color.green ]\r\n prop.children [\r\n Fa.i [ Fa.Solid.Plus ] []\r\n ]\r\n ] \r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n match purchaseOrders with\r\n | None -> ()\r\n | Some orders ->\r\n match orders with\r\n | [] -> ()\r\n | _ ->\r\n yield\r\n Card.content [ Props [ Style [ PaddingRight \"0\" ] ] ] [\r\n Content.content\r\n [ Content.CustomClass \"purchase-orders-cont\"\r\n Content.Props [\r\n Style [\r\n Display DisplayOptions.Flex\r\n FlexWrap \"wrap\"\r\n AlignItems AlignItemsOptions.Center\r\n ]\r\n ] ]\r\n (orders\r\n |> List.map\r\n (fun order ->\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexWrap \"wrap\"\r\n AlignItems AlignItemsOptions.Center\r\n JustifyContent \"space-between\"\r\n Width \"100%\"\r\n PaddingRight \"25px\"\r\n ] ] [\r\n span [] [\r\n order.VendorName |> str\r\n ]\r\n span [\r\n ] [\r\n order.TotalCosts.TotalCost\r\n |> float\r\n |> DisplayNumber.AsCurrency.stdStr\r\n ]\r\n ]))\r\n\r\n ]\r\n ]","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Card =\r\n\r\n /// Generate
      \r\n let card (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"card\").ToReactElement(div, children)\r\n\r\n /// Generate
      \r\n let header (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"card-header\").ToReactElement(header, children)\r\n\r\n /// Generate
      \r\n let content (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"card-content\").ToReactElement(div, children)\r\n\r\n /// Generate
      \r\n let footer (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"card-footer\").ToReactElement(footer, children)\r\n\r\n /// Generate
      \r\n let image (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"card-image\").ToReactElement(div, children)\r\n module Header =\r\n\r\n module Title =\r\n\r\n type Option =\r\n /// Add `is-centered` class\r\n | [] IsCentered\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate \r\n let icon (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"card-header-icon\").ToReactElement(a, children)\r\n\r\n /// Generate

      \r\n let title (options: Title.Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Title.IsCentered as opt -> result.AddCaseName option\r\n | Title.Props props -> result.AddProps props\r\n | Title.CustomClass customClass -> result.AddClass customClass\r\n | Title.Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"card-header-title\").ToReactElement(p, children)\r\n\r\n module Footer =\r\n\r\n let internal itemView element (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"card-footer-item\").ToReactElement(element, children)\r\n\r\n /// Generate \r\n let div x y = itemView div x y\r\n /// Generate \r\n let p x y = itemView p x y\r\n /// Generate \r\n let a x y = itemView a x y\r\n","module Client.ContractPage.PurchaseOrders.RequestModal\r\n\r\nopen FSharpPlus\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Fulma\r\nopen PortalLibs.Client.Components\r\nopen PortalLibs.Client.Util\r\nopen Model\r\nopen ContractPageModel\r\nopen Fable.Core\r\nopen Fable.Core.JsInterop\r\nopen PortalLibs.Shared\r\nopen System\r\n\r\n[]\r\nlet DateFnsUtils: obj = jsNative\r\n\r\n[]\r\nlet MuiPickersUtilsProvider: obj = jsNative\r\n\r\n[]\r\nlet TimePicker: obj = jsNative\r\n\r\n[]\r\nlet DatePicker: obj = jsNative\r\n\r\nlet View model (contract: Contract) dispatch =\r\n\r\n Modal.modal [ Modal.IsActive(Option.isSome model.PurchaseOrderRequest) ] [\r\n Modal.background [ Props [\r\n OnClick(fun _ -> None |> RequestPurchaseOrderContractId |> dispatch)\r\n ] ] []\r\n Modal.Card.card [ Props [ Style [ MaxWidth \"500px\" ] ] ] [\r\n Modal.Card.head [] [\r\n Modal.Card.title [] [\r\n \"Request Purchase Order\" |> str\r\n ]\r\n Delete.delete [ Delete.OnClick(fun _ -> None |> RequestPurchaseOrderContractId |> dispatch) ] []\r\n ]\r\n Modal.Card.body [] [\r\n div [ Style [ MaxWidth \"450px\" ] ] [\r\n Heading.h5 [] [\r\n $\"%s{Option.emptyStrIfNone contract.Number} - %s{Option.emptyStrIfNone contract.Description}\"\r\n |> str\r\n ]\r\n Field.div [] [\r\n Label.label [] [ str \"Description\" ]\r\n Control.div [] [\r\n Input.text [\r\n Input.ValueOrDefault(\r\n model.PurchaseOrderRequest\r\n |>> (fun o -> o.Description)\r\n |> Option.emptyStrIfNone\r\n )\r\n Input.OnChange\r\n (fun e ->\r\n model.PurchaseOrderRequest\r\n |>> (fun r -> { (r: PurchaseOrderRequest) with Description = !!e.target?value })\r\n |> PurchaseOrderRequestChanged\r\n |> dispatch)\r\n ]\r\n ]\r\n ]\r\n Field.div [] [\r\n Label.label [] [ str \"Items needed\" ]\r\n Control.div [] [\r\n Multiline.Multiline\r\n {| Mode =\r\n Multiline.ReadWrite\r\n { ValueChanged =\r\n (fun value ->\r\n model.PurchaseOrderRequest\r\n |>> (fun r -> { (r: PurchaseOrderRequest) with Items = value })\r\n |> PurchaseOrderRequestChanged\r\n |> dispatch)\r\n Spellcheck = false }\r\n Value =\r\n (model.PurchaseOrderRequest\r\n |>> (fun o -> o.Items)\r\n |> Option.emptyStrIfNone)\r\n Key = \"PurchaseOrderItems\"\r\n Rows = Some 3\r\n MaxRows = Some 6\r\n Ref = None |}\r\n\r\n ]\r\n ]\r\n Field.div [] [\r\n Label.label [] [\r\n str \"Preferred Vendor\"\r\n ]\r\n Control.div [] [\r\n Input.text [\r\n Input.ValueOrDefault(\r\n model.PurchaseOrderRequest\r\n |>> (fun o -> o.Vendor)\r\n |> Option.emptyStrIfNone\r\n )\r\n Input.OnChange\r\n (fun e ->\r\n model.PurchaseOrderRequest\r\n |>> (fun r -> { (r: PurchaseOrderRequest) with Vendor = !!e.target?value })\r\n |> PurchaseOrderRequestChanged\r\n |> dispatch)\r\n ]\r\n ]\r\n ]\r\n Field.div [] [\r\n Label.label [] [\r\n str \"Location for Delivery\"\r\n ]\r\n Control.div [] [\r\n Input.text [\r\n Input.ValueOrDefault(\r\n model.PurchaseOrderRequest\r\n |>> (fun o -> o.Location)\r\n |> Option.emptyStrIfNone\r\n )\r\n Input.OnChange\r\n (fun e ->\r\n model.PurchaseOrderRequest\r\n |>> (fun r -> { r with Location = !!e.target?value })\r\n |> PurchaseOrderRequestChanged\r\n |> dispatch)\r\n ]\r\n ]\r\n ]\r\n Field.div [] [\r\n Label.label [] [ str \"Needed by\" ]\r\n Control.div [] [\r\n let date =\r\n match model.PurchaseOrderRequest with\r\n | None -> DateTime.Now\r\n | Some r -> r.Date\r\n\r\n let utilsProviderProps = createObj [ \"utils\" => DateFnsUtils ]\r\n\r\n let datePickerProps =\r\n createObj [\r\n \"value\" => date\r\n \"onChange\"\r\n => fun date ->\r\n model.PurchaseOrderRequest\r\n |>> (fun r -> { (r: PurchaseOrderRequest) with Date = date })\r\n |> PurchaseOrderRequestChanged\r\n |> dispatch\r\n ]\r\n\r\n yield\r\n ofImport\r\n \"MuiPickersUtilsProvider\"\r\n \"@material-ui/pickers\"\r\n utilsProviderProps\r\n [ div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"space-between\"\r\n ] ] [\r\n div [ Style [ MarginRight \"5px\" ] ] [\r\n ofImport \"DatePicker\" \"@material-ui/pickers\" datePickerProps []\r\n ]\r\n ofImport \"TimePicker\" \"@material-ui/pickers\" datePickerProps []\r\n ] ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n Modal.Card.foot [] [\r\n Button.button [ Button.Color IsSuccess\r\n Button.OnClick\r\n (fun _ ->\r\n model.PurchaseOrderRequest\r\n |> SendPurchaseOrderRequest\r\n |> dispatch) ] [\r\n str \"Send\"\r\n ]\r\n Button.button [ Button.OnClick(fun _ -> None |> RequestPurchaseOrderContractId |> dispatch) ] [\r\n str \"Cancel\"\r\n ]\r\n ]\r\n ]\r\n ]","module Scheduling\r\n\r\nopen FSharpPlus\r\nopen Client\r\nopen Feliz\r\nopen Feliz.Bulma\r\nopen PortalLibs.Client.Util\r\nopen Model\r\nopen PortalLibs.Shared\r\n\r\nlet private showDuration { Duration = duration } =\r\n duration |>> (fun d -> $\"%d{d} days\") |> Option.emptyStrIfNone\r\n \r\nlet private showSPI { SPI = spi } =\r\n spi |>> printDecimal |> Option.emptyStrIfNone\r\n\r\nlet showVariance { ScheduleVariance = variance } =\r\n variance |>> (float >> formatNumber true MinusSign true AllTwoDigits) |> Option.emptyStrIfNone\r\n \r\nlet jobScheduleView jobSchedule =\r\n Html.div [\r\n prop.style [style.custom(\"marginLeft\", \"auto\"); style.custom(\"marginRight\", \"auto\")\r\n style.maxWidth(length.px 800); style.display.flex; style.flexDirection.column]\r\n prop.children [\r\n Html.h5 \"Job Schedule\"\r\n Bulma.table [\r\n prop.style [ style.maxWidth(length.px 800); style.alignSelf.flexEnd; Styles.stickyTableBorder ]\r\n table.isFullWidth\r\n table.isHoverable\r\n prop.children [\r\n Html.thead[\r\n Html.tr [\r\n prop.style (Styles.sticky())\r\n prop.children [\r\n Html.th [\r\n prop.style[style.textAlign.center; style.width(length.px 140); style.verticalAlign.middle]\r\n prop.text \"Duration\"\r\n ]\r\n Html.th [\r\n prop.style[style.textAlign.center; style.width(length.px 140); style.verticalAlign.middle]\r\n prop.text \"Start\"\r\n ]\r\n Html.th [\r\n prop.style[style.textAlign.center; style.width(length.px 140); style.verticalAlign.middle]\r\n prop.text \"Finish\"\r\n ]\r\n Html.th [\r\n prop.style[style.textAlign.center; style.width(length.px 140); style.verticalAlign.middle]\r\n prop.text \"Schedule Performance Index\"\r\n ]\r\n Html.th [\r\n prop.style[style.textAlign.center; style.width(length.px 140); style.verticalAlign.middle]\r\n prop.text \"Schedule Variance\"\r\n ]\r\n ]\r\n ]\r\n ]\r\n Html.tbody[\r\n match jobSchedule with\r\n | None ->\r\n yield Html.tr[\r\n Html.td [\r\n prop.colSpan 5\r\n prop.style[ style.textAlign.center; style.padding(30, 0)]\r\n prop.text \"No schedule is available.\"\r\n ]\r\n ]\r\n | Some js ->\r\n yield \r\n Html.tr [\r\n Html.td [ prop.style[style.textAlign.center]; prop.text (showDuration js) ]\r\n Html.td [ prop.style[style.textAlign.center]; prop.text (prettyPrintDateOptionShort js.Start)]\r\n Html.td [ prop.style[style.textAlign.center]; prop.text (prettyPrintDateOptionShort js.Finish)]\r\n Html.td [ prop.style[style.textAlign.center]; prop.text (showSPI js)]\r\n Html.td [ prop.style[style.textAlign.center]; prop.text (showVariance js)]\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n \r\n ]\r\n\r\nlet View (model: ContractPageModel.Model) (contract: Contract)=\r\n loadingMessageOrContent\r\n \"Loading Scheduling...\"\r\n jobScheduleView\r\n (Map.tryFind contract.Id model.JobSchedules)\r\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Columns =\r\n\r\n type ISize =\r\n | [] Is1\r\n | [] Is2\r\n | [] Is3\r\n | [] Is4\r\n | [] Is5\r\n | [] Is6\r\n | [] Is7\r\n | [] Is8\r\n\r\n static member ToString (x : ISize)=\r\n Reflection.getCaseName x\r\n\r\n let inline private gapSizeGeneric (screen : Screen) (size : ISize) =\r\n ISize.ToString size + Screen.ToString screen\r\n\r\n let inline private gapSizeOnly (screen : Screen) (size : ISize) =\r\n match screen with\r\n | Screen.Tablet\r\n | Screen.Desktop\r\n | Screen.WideScreen ->\r\n ISize.ToString size + Screen.ToString screen + \"-only\"\r\n | x ->\r\n let msg = sprintf \"Screen `%s` does not support `is-%s-%s-only`.\" (Screen.ToString x) (ISize.ToString size) (Screen.ToString x)\r\n Fable.Core.JS.console.warn(msg)\r\n \"\"\r\n\r\n type Option =\r\n /// Add `is-centered` class\r\n | [] IsCentered\r\n /// Add `is-vcentered` class\r\n | [] IsVCentered\r\n /// Add `is-multiline` class\r\n | [] IsMultiline\r\n /// Add `is-gapless` class\r\n | [] IsGapless\r\n /// Add `is-mobile` class\r\n | [] IsMobile\r\n /// Add `is-desktop` class\r\n | [] IsDesktop\r\n /// Configure the gap size. You can configure the display and gap size\r\n /// Example: Columns.IsGap (Columns.Desktop, Columns.Is6)\r\n /// Becomes: `is-6-desktop`\r\n | IsGap of Screen * ISize\r\n /// Configure the gap size. You can configure the display and gap size\r\n /// Example: Columns.IsGapOnly (Columns.Tablet, Columns.Is6)\r\n /// Becomes: `is-6-tablet-only`\r\n | IsGapOnly of Screen * ISize\r\n | CustomClass of string\r\n | Props of IHTMLProp list\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate
      \r\n let columns (options: Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | IsCentered\r\n | IsVCentered\r\n | IsMultiline\r\n | IsGapless\r\n | IsMobile\r\n | IsDesktop -> result.AddCaseName option\r\n | IsGap (screen, size) ->\r\n if not (List.contains \"is-variable\" result.Classes) then\r\n result.AddClass(\"is-variable\").AddClass(gapSizeGeneric screen size)\r\n else\r\n result.AddClass(gapSizeGeneric screen size)\r\n | IsGapOnly (screen, size) ->\r\n if not (List.contains \"is-variable\" result.Classes) then\r\n result.AddClass(\"is-variable\").AddClass(gapSizeOnly screen size)\r\n else\r\n result.AddClass(gapSizeOnly screen size)\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"columns\").ToReactElement(div, children)\r\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Column =\r\n\r\n type ISize =\r\n | [] IsOneQuarter\r\n | [] IsOneThird\r\n | [] IsHalf\r\n | [] IsTwoThirds\r\n | [] IsThreeQuarters\r\n | [] Is1\r\n | [] Is2\r\n | [] Is3\r\n | [] Is4\r\n | [] Is5\r\n | [] Is6\r\n | [] Is7\r\n | [] Is8\r\n | [] Is9\r\n | [] Is10\r\n | [] Is11\r\n | [] Is12\r\n | [] IsNarrow\r\n | [] IsFull\r\n | [] IsOneFifth\r\n | [] IsTwoFifths\r\n | [] IsThreeFifths\r\n | [] IsFourFifths\r\n\r\n type Option =\r\n /// Configure the width of the column. You can configure the display and size\r\n /// Example: Column.Width (Column.Desktop, Column.Is6)\r\n /// Becomes: `is-6-desktop`\r\n | Width of Screen * ISize\r\n /// Configure the offset of the column. You can configure the display and offset size\r\n /// Example: Column.Offset (Column.Desktop, Column.Is6)\r\n /// Becomes: `is-offset-6-desktop`\r\n | Offset of Screen * ISize\r\n | CustomClass of string\r\n | Props of IHTMLProp list\r\n | Modifiers of Modifier.IModifier list\r\n\r\n let private suffix = function\r\n | Screen.All -> \"\"\r\n | Screen.Desktop -> \"-desktop\"\r\n | Screen.Tablet -> \"-tablet\"\r\n | Screen.Mobile -> \"-mobile\"\r\n | Screen.WideScreen -> \"-widescreen\"\r\n | Screen.FullHD -> \"-fullhd\"\r\n | Screen.Touch -> \"-touch\"\r\n\r\n let internal ofWidth (screen, size) =\r\n Reflection.getCaseName size + suffix screen\r\n\r\n let internal ofOffset (screen, offset) =\r\n let className = Reflection.getCaseName offset\r\n \"is-offset-\" + className.[3..] + suffix screen\r\n\r\n /// Generate
      \r\n let column (options : Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Width (screen, width) ->\r\n ofWidth (screen, width) |> result.AddClass\r\n | Offset (screen, offset) ->\r\n ofOffset (screen, offset) |> result.AddClass\r\n | CustomClass customClass ->\r\n result.AddClass customClass\r\n | Props props ->\r\n result.AddProps props\r\n | Modifiers modifiers ->\r\n result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"column\")\r\n .ToReactElement(div, children)\r\n","module PortalLibs.Client.Components.Dropdown\r\n\r\n\r\nopen Fable.Core\r\nopen FSharpPlus\r\nopen Fable.Core.JsInterop\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Fulma\r\nopen Elmish.React\r\nopen Fable.FontAwesome\r\nopen PortalLibs.Client.Util\r\nopen PortalLibs.Shared\r\nopen Feliz\r\ntype ValueWrapper<'T> = { Value: 'T }\r\n\r\n[]\r\nlet ReactSelect: obj = jsNative\r\n\r\nimportAll \"react-select/dist/react-select.css\"\r\n\r\nimportAll \"react-virtualized-select/styles.css\"\r\n\r\n[]\r\nlet ReactSelectFastFilterOptions: obj = jsNative\r\n\r\nlet createFilterOptions (_options: obj) =\r\n importDefault \"react-select-fast-filter-options\"\r\n\r\nlet calcDropdownWidth set display =\r\n calcMaxDisplayWidth 226.0 display 9.7 \"\" set\r\n\r\nlet calcDropdownWidthWithPrint printView set display =\r\n if printView then\r\n calcMaxDisplayWidth 226.0 display 6.5 \"\" set\r\n else\r\n calcDropdownWidth set display\r\n\r\ntype OptionItem<'T> =\r\n { label: string\r\n value: string\r\n orig: 'T }\r\n\r\ntype DropdownType =\r\n | Standard\r\n | Fast\r\n\r\ntype displayValue<'T> = 'T -> string\r\n\r\ntype valueChanged<'T, 'U> = 'T option -> 'U\r\n\r\ntype valueListChanged<'T, 'U> = 'T list -> 'U\r\n\r\ntype valueChangedWithSource<'T, 'U, 'Source> = 'T option * 'Source -> 'U\r\n\r\ntype UpdateModel<'T, 'U, 'Source> =\r\n | Simple of valueChanged<'T, 'U>\r\n | Source of 'Source * valueChangedWithSource<'T, 'U, 'Source>\r\n\r\ntype DropdownItems<'T> =\r\n | ItemList of 'T list\r\n | ItemListResultOption of Result<'T list, string> option\r\n | ItemListOption of 'T list option\r\n\r\ntype areEqual<'T, 'Id> = 'Id -> 'T -> bool\r\n\r\ntype urlForItem<'T> = 'T -> string\r\n\r\ntype SelectedItem<'T, 'Id> =\r\n | Item of 'T option\r\n | ItemId of 'Id option * areEqual<'T, 'Id>\r\n\r\ntype SingleSelect<'T, 'U, 'Source, 'Id> =\r\n { UpdateModel: UpdateModel<'T, 'U, 'Source>\r\n SelectedItem: SelectedItem<'T, 'Id>\r\n LinkUrl: urlForItem<'T> option }\r\n\r\ntype MultiSelect<'T, 'U, 'Id> =\r\n { ValueChanged: valueListChanged<'T, 'U>\r\n SelectedItems: 'Id list * areEqual<'T, 'Id> }\r\n\r\ntype SelectMode<'T, 'U, 'Source, 'Id> =\r\n | SingleSelect of SingleSelect<'T, 'U, 'Source, 'Id>\r\n | MultiSelect of MultiSelect<'T, 'U, 'Id>\r\n\r\ntype DropdownTitle =\r\n | Name of string\r\n | DropdownOnly\r\n\r\n\r\n//type DropdownConfig<'T, 'U, 'Source, 'Id> =\r\n// { Title : DropdownTitle\r\n// Items : DropdownItems<'T>\r\n// DisplayValue : displayValue<'T>\r\n// SelectMode : SelectMode<'T, 'U, 'Source, 'Id>\r\n// Searchable : bool\r\n// Type : DropdownType\r\n// key : string }\r\n\r\ntype WrappedItem<'T> = { Text: string; OriginalItem: 'T }\r\n\r\nlet toWrappedItem displayValue item =\r\n { Text = displayValue item\r\n OriginalItem = item }\r\n\r\nlet private wrappedItemValue item =\r\n match item with\r\n | null -> None\r\n | x -> Some !!x?OriginalItem\r\n\r\nlet private itemList<'T, 'U, 'Source, 'Id>\r\n (config: {| Title: DropdownTitle\r\n Items: DropdownItems<'T>\r\n DisplayValue: displayValue<'T>\r\n SelectMode: SelectMode<'T, 'U, 'Source, 'Id>\r\n Searchable: bool\r\n Type: DropdownType\r\n Key: string |})\r\n =\r\n match config.Items with\r\n | ItemList list -> list\r\n | ItemListResultOption option -> Result.resultOrEmptyListIfNone option\r\n | ItemListOption option -> Option.emptyListIfNone option\r\n\r\nlet private selectedItem config selectedItem =\r\n match selectedItem with\r\n | Item i -> i\r\n | ItemId (idOpt, areEqual) ->\r\n idOpt\r\n >>= (fun id -> itemList config |> List.tryFind (areEqual id))\r\n\r\n\r\nlet OnlyOneDropdownControlGeneric<'T, 'U, 'Source, 'Id> =\r\n React.memo (\r\n \"OnlyOneDropdownControl\",\r\n (fun config ->\r\n let itemList = itemList<'T, 'U, 'Source, 'Id> config\r\n\r\n let options =\r\n itemList\r\n |>> (toWrappedItem config.DisplayValue)\r\n |> List.toArray\r\n\r\n let selectedValue =\r\n match config.SelectMode with\r\n | SingleSelect single ->\r\n box (\r\n selectedItem config single.SelectedItem\r\n |>> (toWrappedItem config.DisplayValue)\r\n )\r\n | MultiSelect multi ->\r\n let ids, areEqual = multi.SelectedItems\r\n\r\n box (\r\n ids\r\n |> List.choose (fun id -> List.tryFind (areEqual id) itemList)\r\n |>> toWrappedItem config.DisplayValue\r\n |> List.toArray\r\n )\r\n\r\n let onChange =\r\n match config.SelectMode with\r\n | SingleSelect single ->\r\n box\r\n (fun value ->\r\n match single.UpdateModel with\r\n | Simple u -> value |> wrappedItemValue |> u\r\n | Source (source, u) -> u (wrappedItemValue value, source))\r\n | MultiSelect multi ->\r\n box\r\n (fun values ->\r\n values\r\n |> List.ofArray\r\n |> List.choose wrappedItemValue\r\n |> multi.ValueChanged)\r\n\r\n let props =\r\n createObj [\r\n yield \"options\" => options\r\n yield \"value\" => selectedValue\r\n yield \"searchable\" => config.Searchable\r\n match config.SelectMode with\r\n | MultiSelect _ ->\r\n yield \"removeSelected\" => true\r\n yield \"multi\" => true\r\n | _ -> ()\r\n yield \"onChange\" => onChange\r\n yield \"labelKey\" => \"Text\"\r\n yield \"valueKey\" => \"Text\"\r\n yield \"autoBlur\" => true\r\n if config.Type = Fast then\r\n let filterOptions =\r\n createFilterOptions (\r\n createObj [\r\n \"options\" => options\r\n \"labelKey\" => \"Text\"\r\n \"valueKey\" => \"Text\"\r\n ]\r\n )\r\n\r\n yield \"filterOptions\" => filterOptions\r\n ]\r\n\r\n Html.div [\r\n prop.className \"form-dropdown\"\r\n prop.children [\r\n match config.Type with\r\n | Standard -> yield ofImport \"default\" \"react-select\" props []\r\n | Fast -> yield ofImport \"default\" \"react-virtualized-select\" props []\r\n ]\r\n ]),\r\n (fun (config: {| Title: DropdownTitle\r\n Items: DropdownItems<'T>\r\n DisplayValue: displayValue<'T>\r\n SelectMode: SelectMode<'T, 'U, 'Source, 'Id>\r\n Searchable: bool\r\n Type: DropdownType\r\n Key: string |}) -> config.Key),\r\n areEqual = Fable.React.Helpers.equalsButFunctions\r\n )\r\n\r\nlet OnlyOneDropdownGeneric<'T, 'U, 'Source, 'Id when 'T: equality and 'Source: equality and 'Id: equality> =\r\n React.memo (\r\n \"OnlyOneDropdown\",\r\n (fun (config: {| Title: DropdownTitle\r\n Items: DropdownItems<'T>\r\n DisplayValue: displayValue<'T>\r\n SelectMode: SelectMode<'T, 'U, 'Source, 'Id>\r\n Searchable: bool\r\n Type: DropdownType\r\n Key: string |}) ->\r\n let OnlyOneDropdownControlSpecific =\r\n OnlyOneDropdownControlGeneric<'T, 'U, 'Source, 'Id>\r\n\r\n let dropdownView =\r\n match config.Title with\r\n | DropdownOnly ->\r\n div [ Style [ MinWidth \"250px\" ] ] [\r\n OnlyOneDropdownControlSpecific\r\n {| Title = config.Title\r\n Items = config.Items\r\n DisplayValue = config.DisplayValue\r\n SelectMode = config.SelectMode\r\n Searchable = config.Searchable\r\n Type = config.Type\r\n Key = $\"%s{config.Key}-Control\" |}\r\n ]\r\n | Name name ->\r\n field\r\n name\r\n [ Columns.columns [ Columns.IsVCentered ] [\r\n yield\r\n Column.column [] [\r\n OnlyOneDropdownControlSpecific\r\n {| Title = config.Title\r\n Items = config.Items\r\n DisplayValue = config.DisplayValue\r\n SelectMode = config.SelectMode\r\n Searchable = config.Searchable\r\n Type = config.Type\r\n Key = $\"%s{config.Key}-Control\" |}\r\n ]\r\n match config.SelectMode with\r\n | MultiSelect _ -> ()\r\n | SingleSelect single ->\r\n match single.LinkUrl, selectedItem config single.SelectedItem with\r\n | Some linkUrl, Some item ->\r\n yield\r\n Column.column [ Column.Width(Screen.Tablet, Column.IsNarrow) ] [\r\n a [ OnClick goToUrl\r\n\r\n Href(linkUrl item) ] [\r\n str \"View\"\r\n ]\r\n ]\r\n | _ -> ()\r\n ] ]\r\n\r\n let dropdownLazyView =\r\n let lazyView selected =\r\n match config.SelectMode with\r\n | SingleSelect select ->\r\n match select.UpdateModel with\r\n | Simple _ -> lazyView (fun _ -> dropdownView) (config.Items, selected)\r\n | Source (source, _) -> lazyView (fun _ -> dropdownView) (config.Items, selected, source)\r\n | MultiSelect _ -> lazyView (fun _ -> dropdownView) (config.Items, selected)\r\n\r\n match config.SelectMode with\r\n | SingleSelect single ->\r\n match single.SelectedItem with\r\n | Item i -> lazyView i\r\n | ItemId (id, _) -> lazyView id\r\n | MultiSelect multi ->\r\n let ids, _ = multi.SelectedItems\r\n lazyView ids\r\n\r\n let textValueWithSpinner txt =\r\n let dropdownCtrl =\r\n Control.div [ Control.HasIconLeft\r\n Control.Props [\r\n Style [ MinWidth \"250px\" ]\r\n ] ] [\r\n Input.text [\r\n Input.IsReadOnly true\r\n Input.Value txt\r\n ]\r\n Icon.icon [ Icon.Size IsSmall\r\n Icon.IsLeft\r\n Icon.Props [ Style [ Color \"#4a4a4a\" ] ] ] [\r\n Fa.i [ Fa.Solid.Spinner; Fa.Pulse ] []\r\n ]\r\n ]\r\n\r\n match config.Title with\r\n | DropdownOnly -> dropdownCtrl\r\n | Name name ->\r\n div [ ClassName \"report-search-text-field\" ] [\r\n field\r\n name\r\n [ Columns.columns [ Columns.IsVCentered ] [\r\n Column.column [] [ dropdownCtrl ]\r\n ] ]\r\n ]\r\n\r\n let truncatedTextValue (txt: string) =\r\n let truncatedTxt =\r\n if txt.Length > 30 then\r\n $\"%s{txt.Substring(0, 30)}...\"\r\n else\r\n txt\r\n let dropdownCtrl =\r\n Html.div\r\n [ Bulma.tooltip.text txt\r\n prop.style [ style.minWidth 250 ]\r\n prop.children [\r\n input [\r\n ClassName \"input error-input\"\r\n ReadOnly true\r\n Value truncatedTxt\r\n ] ]\r\n ]\r\n\r\n match config.Title with\r\n | DropdownOnly -> dropdownCtrl\r\n | Name name ->\r\n div [ ClassName \"report-search-text-field\" ] [\r\n field\r\n name\r\n [ Columns.columns [ Columns.IsVCentered ] [\r\n Column.column [] [ dropdownCtrl ]\r\n ] ]\r\n ]\r\n\r\n let resultLoadingView itemsOpt =\r\n match itemsOpt with\r\n | None -> textValueWithSpinner \"Loading...\"\r\n | Some itemsRes ->\r\n match itemsRes with\r\n | Error msg -> truncatedTextValue msg\r\n | Ok _ -> dropdownLazyView\r\n\r\n let optionLoadingView itemsOpt =\r\n match itemsOpt with\r\n | None -> textValueWithSpinner \"Loading...\"\r\n | Some _ -> dropdownLazyView\r\n\r\n match config.Items with\r\n | ItemList _ -> dropdownLazyView\r\n | ItemListResultOption opt -> resultLoadingView opt\r\n | ItemListOption opt -> optionLoadingView opt),\r\n (fun (config: {| Title: DropdownTitle\r\n Items: DropdownItems<'T>\r\n DisplayValue: displayValue<'T>\r\n SelectMode: SelectMode<'T, 'U, 'Source, 'Id>\r\n Searchable: bool\r\n Type: DropdownType\r\n Key: string |}) -> config.Key),\r\n areEqual = Fable.React.Helpers.equalsButFunctions\r\n )\r\n","[]\r\nmodule PortalLibs.Shared.Result\r\n\r\n\r\nlet resultOrEmptyList<'T> result : 'T list =\r\n match result with\r\n | Error _ -> []\r\n | Ok list -> list\r\n\r\nlet resultOrEmptyListIfNone<'T> (opt: Result<'T list, string> option) : 'T list =\r\n match opt with\r\n | None -> []\r\n | Some result -> resultOrEmptyList result\r\n","module Client.ContractPage.ContractPageView\r\n\r\nopen FSharpPlus\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Fulma\r\nopen PortalLibs.Client.Components.Dropdown\r\nopen Model\r\nopen Shared\r\nopen ContractPageModel\r\nopen PortalLibs.Client.Util\r\nopen Feliz\r\nopen PortalLibs.Shared\r\n\r\nlet jobDetailsView model applicationSettings contract aiInfos isSuperUser isDemo dispatch =\r\n let tab name selected tab =\r\n Tabs.tab [ Tabs.Tab.IsActive(selected = tab) ] [\r\n a [ OnClick(fun _ -> tab |> TabSelected |> dispatch) ] [\r\n str name\r\n ]\r\n ]\r\n\r\n div [ Style [\r\n MinHeight \"150px\"\r\n MarginTop \"10px\"\r\n ] ] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"space-between\"\r\n FlexWrap \"wrap\"\r\n MarginBottom \"5px\"\r\n ] ] [\r\n strong [] [\r\n $\"Est Completion: %s{contract.EstCompletion\r\n |> prettyPrintDateOptionLong}\"\r\n |> str\r\n ]\r\n strong [ Style [\r\n if CostAndBilling.isOver30Days contract then\r\n yield Color \"Red\"\r\n ] ] [\r\n $\"Last Bill Date: %s{contract.LastBillDate |> prettyPrintDateOptionLong}\"\r\n |> str\r\n ]\r\n ]\r\n Tabs.tabs [ Tabs.CustomClass \"wrap-tabs\" ] [\r\n yield tab \"Overview\" model.SelectedTab Overview\r\n yield tab \"Change Orders\" model.SelectedTab Tab.ChangeOrders\r\n yield tab \"AR and Cash Flow\" model.SelectedTab ARAndCashFlow\r\n yield tab \"Cost Of Construction\" model.SelectedTab CostOfConstruction\r\n yield tab \"Cost and Billing\" model.SelectedTab CostAndBilling\r\n yield tab \"Profit Fade\" model.SelectedTab ContractProfitFadeTab\r\n yield tab \"Average Rate\" model.SelectedTab AverageRate\r\n yield tab \"Purchase Orders\" model.SelectedTab Tab.PurchaseOrders\r\n if isDemo then\r\n yield tab \"AI\" model.SelectedTab AI\r\n if applicationSettings.ContractSettings.CostAndBillingForecasting then\r\n yield tab \"Scheduling\" model.SelectedTab Scheduling\r\n ]\r\n React.fragment [\r\n yield\r\n match model.SelectedTab with\r\n | Overview -> Overview.view applicationSettings.ContractSettings contract\r\n | Tab.ChangeOrders ->\r\n ChangeOrders.Main.View model.ChangeOrderHeaders model.ChangeOrderItems model.ChangeOrderItemLines contract\r\n | ARAndCashFlow -> ARAndCashFlow.View model contract\r\n | CostOfConstruction ->\r\n CostOfConstruction.CostOfConstruction.CostOfConstructionView\r\n {| Model = model\r\n ContractSettings = applicationSettings.ContractSettings\r\n IsSuperUser = isSuperUser\r\n Contract = contract\r\n Dispatch = dispatch |}\r\n | AverageRate ->\r\n AverageRate.View\r\n {| JobCosts = model.JobCosts\r\n RemainingHoursEnabled = applicationSettings.AverageLaborRate_RemainingHours\r\n Contract = contract\r\n Dispatch = dispatch |}\r\n | CostAndBilling -> CostAndBilling.View model applicationSettings.ContractSettings isDemo contract dispatch\r\n | ContractProfitFadeTab -> ContractProfitFade.View model.ContractProfitFades contract\r\n | Tab.PurchaseOrders ->\r\n PurchaseOrders.PurchaseOrders.View\r\n model\r\n applicationSettings.ContractSettings\r\n contract\r\n (model.PurchaseOrders |> Map.tryFind contract.Id)\r\n dispatch\r\n | AI -> AI.view model contract aiInfos\r\n | Scheduling -> Scheduling.View model contract\r\n ]\r\n ]\r\n\r\nlet OnlyOneDropDownSpecific =\r\n OnlyOneDropdownGeneric\r\n\r\nlet content model applicationSettings aiInfos isSuperUser isDemo dispatch contracts =\r\n div [] [\r\n div [ Style [ MaxWidth \"400px\" ] ] [\r\n OnlyOneDropDownSpecific(\r\n {| Title = DropdownOnly\r\n Items =\r\n contracts\r\n |> Map.toList\r\n |>> snd\r\n |> ItemList\r\n DisplayValue =\r\n (fun (j: Model.Contract) ->\r\n $\"%s{Option.emptyStrIfNone j.Number} - %s{Option.emptyStrIfNone j.Description}\")\r\n SelectMode =\r\n SingleSelect\r\n { UpdateModel =\r\n Simple (fun jobOpt ->\r\n jobOpt\r\n |>> (fun contract -> contract.Id)\r\n |> ContractSelected\r\n |> dispatch)\r\n SelectedItem = SelectedItem.ItemId(model.SelectedContractId, (fun id contract -> id = contract.Id))\r\n LinkUrl = None }\r\n Searchable = true\r\n Type = Standard\r\n Key = \"ContractPageViewContractDropdown\" |}\r\n )\r\n ]\r\n (match model.SelectedContractId\r\n >>= fun contractId -> contracts |> Map.tryFind (string contractId)\r\n with\r\n | None ->\r\n div [ Style [\r\n MinHeight \"150px\"\r\n TextAlign TextAlignOptions.Center\r\n MarginTop \"100px\"\r\n ] ] [\r\n (if Option.isSome model.SelectedContractId then\r\n \"Contract is loading...\"\r\n else\r\n \"Please select a Contract.\")\r\n |> str\r\n ]\r\n | Some contract -> jobDetailsView model applicationSettings contract aiInfos isSuperUser isDemo dispatch)\r\n ]\r\n\r\nlet ContractPageView =\r\n React.memo (\r\n \"ContractPageView\",\r\n (fun (props: {| Model: ContractPageModel.Model\r\n ApplicationSettings: ApplicationSettings\r\n Contracts: Map option\r\n AiInfos: Map\r\n IsDemo: bool\r\n IsSuperUser: bool\r\n Dispatch: Msg -> unit |}) ->\r\n div [ ClassName \"contract-page\"\r\n Style [ MarginTop \"25px\" ] ] [\r\n loadingMessageBoxOrContent\r\n \"Loading Contracts...\"\r\n (content props.Model props.ApplicationSettings props.AiInfos props.IsSuperUser props.IsDemo props.Dispatch)\r\n props.Contracts\r\n ])\r\n )","module Overview\r\n\r\nopen Client\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Fulma\r\nopen Model\r\nopen PortalLibs.Client.Components.Progress\r\nopen Shared\r\n\r\nlet view contractSettings (contract: Contract)=\r\n let formatAmount floatOpt =\r\n match floatOpt with\r\n | None -> nothing\r\n | Some float -> float |> DisplayNumber.AsCurrency.stdStr\r\n let formatPercent floatOpt =\r\n match floatOpt with\r\n | None -> nothing\r\n //| Some per -> sprintf \"%s%%\" (System.Math.Round((per*100.0), 2).ToString()) |> str\r\n | Some per -> div [ Style [ Display DisplayOptions.Flex; JustifyContent \"flex-end\"; PaddingRight \"7px\" ] ]\r\n [ CircleProgress {| percent = (per * 100.0); border = 0.0; key = contract.Id.ToString() |} ]\r\n let tabHr () =\r\n [\r\n //tr [ ] [ td [ Style [ Height \"25px\" ] ] [ ] ]\r\n tr [ ] [\r\n td [ ] [ ]\r\n td [ ColSpan 5; Style [ BorderWidth \"0 0 2px 0\" ] ] [ ] ]\r\n tr [ ] [ td [ ] [ ] ]\r\n ]\r\n let tdStyle = Style [ TextAlign TextAlignOptions.Right; Padding \".2em 0.75em\" ]\r\n let pctStyle = Style [\r\n //Display DisplayOptions.Flex; JustifyContent \"center\"\r\n TextAlign TextAlignOptions.Right\r\n VerticalAlign \"middle\"\r\n PaddingTop \"0\"\r\n PaddingBottom \"0\"\r\n ]\r\n let table =\r\n Table.table [\r\n Table.CustomClass \"overview-table\"\r\n Table.Props [ Style [ MarginLeft \"auto\"; MarginRight \"auto\"; MarginLeft \"-10px\" ] ]\r\n Table.IsHoverable ]\r\n [ thead [ ]\r\n [ tr [ ]\r\n [ th [ Style [ Width \"185px\" ] ] [ ]\r\n th [ Style [ TextAlign TextAlignOptions.Right; Width \"100px\" ] ] [ str \"Original Contract\" ]\r\n th [ Style [ TextAlign TextAlignOptions.Right; Width \"100px\" ] ] [ str \"Current Contract\" ]\r\n th [ Style [ TextAlign TextAlignOptions.Right; Width \"125px\" ] ] [ str \"Billing & Cost Actual Cost\" ]\r\n if contractSettings.Projections then\r\n th [ Style [ VerticalAlign \"middle\"; TextAlign TextAlignOptions.Right; Width \"110px\" ] ] [ str \"Projections\" ]\r\n th [ Style [ TextAlign TextAlignOptions.Right; Width \"147px\" ] ] [ str \"Project Manager Projection\" ]\r\n ] ]\r\n tbody [ ]\r\n [ yield tr [ Style [ Height \"20px\" ] ]\r\n [ td [ tdStyle ] [ strong [] [ str \"Revenue\" ] ]\r\n td [ tdStyle ] [ contract.OCRev |> formatAmount ]\r\n td [ tdStyle ] [ contract.CCRev |> formatAmount ]\r\n td [ tdStyle ] [ contract.BCRev |> formatAmount ]\r\n if contractSettings.Projections then\r\n td [ tdStyle ] [ contract.PRev |> formatAmount ]\r\n td [ tdStyle ] [ contract.PMPRev |> formatAmount ]\r\n ]\r\n yield tr [ ]\r\n [ td [ tdStyle ] [ strong [] [ str \"PCOs\" ] ]\r\n td [ tdStyle ] [ nothing ]\r\n td [ tdStyle ] [ contract.CCPCO |> formatAmount ]\r\n td [ tdStyle ] [ nothing ]\r\n if contractSettings.Projections then\r\n td [ tdStyle ] [ contract.PPCO |> formatAmount ]\r\n td [ tdStyle ] [ contract.PMPPCO |> formatAmount ]\r\n ]\r\n yield tr [ ]\r\n [ td [ tdStyle ] [ strong [] [ str \"Revenue plus all PCO\" ] ]\r\n td [ tdStyle ] [ nothing ]\r\n td [ tdStyle ] [ strong [] [\r\n match contract.CCRev, contract.CCPCO with\r\n | None, None -> yield nothing\r\n | _, _ -> yield ((contract.CCRev |> Option.defaultValue 0.0) +\r\n (contract.CCPCO |> Option.defaultValue 0.0)) |> Some |> formatAmount ] ]\r\n td [ tdStyle ] [ nothing ]\r\n if contractSettings.Projections then\r\n td [ tdStyle ] [ strong [] [\r\n match contract.PRev, contract.PPCO with\r\n | None, None -> yield nothing\r\n | _, _ -> yield ((contract.PRev |> Option.defaultValue 0.0) +\r\n (contract.PPCO |> Option.defaultValue 0.0)) |> Some |> formatAmount ] ]\r\n td [ tdStyle ] [ strong [] [ contract.PMPRevPlusAllPCO |> formatAmount ] ]\r\n ]\r\n yield! tabHr ()\r\n yield tr [ ]\r\n [ td [ tdStyle ] [ strong [] [ str contractSettings.OverviewSettings.CostsLabel ] ]\r\n td [ tdStyle ] [ contract.OCCosts |> formatAmount ]\r\n td [ tdStyle ] [ contract.CCCosts |> formatAmount ]\r\n td [ tdStyle ] [ contract.BCCosts |> formatAmount ]\r\n if contractSettings.Projections then\r\n td [ tdStyle ] [ contract.PCosts |> formatAmount ]\r\n td [ tdStyle ] [ contract.PMPCosts |> formatAmount ]\r\n ]\r\n yield tr [ ]\r\n [ td [ tdStyle ] [ strong [] [ str contractSettings.OverviewSettings.ProfitLabel ] ]\r\n td [ tdStyle ] [ contract.OCProfit |> formatAmount ]\r\n td [ tdStyle ] [ contract.CCProfit |> formatAmount ]\r\n td [ tdStyle ] [ contract.BCProfit |> formatAmount ]\r\n if contractSettings.Projections then\r\n td [ tdStyle ] [ contract.PProfit |> formatAmount ]\r\n td [ tdStyle ] [ contract.PMPProfit |> formatAmount ]\r\n ]\r\n yield! tabHr ()\r\n yield tr [ ]\r\n [ td [ pctStyle ] [ strong [] [ str contractSettings.OverviewSettings.GPPerLabel ] ]\r\n td [ pctStyle ] [ contract.OCGPPercent |> formatPercent ]\r\n td [ pctStyle ] [ contract.CCGPPercent |> formatPercent ]\r\n td [ pctStyle ] [ contract.BCGPPercent |> formatPercent ]\r\n if contractSettings.Projections then\r\n td [ pctStyle ] [ contract.PGPPercent |> formatPercent ]\r\n td [ pctStyle ] [ contract.PMPGPPercent |> formatPercent ]\r\n ]\r\n\r\n ] ]\r\n div [ Style [ PaddingBottom \"30px\"; PaddingTop \"10px\"; Display DisplayOptions.Flex; ] ] [\r\n div [ Style [ Width \"0\"; FlexGrow \"1\" ] ] []\r\n table\r\n div [ Style [ Width \"0\"; FlexGrow \"3\" ] ] []\r\n ]","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Level =\r\n\r\n module Level =\r\n\r\n type Option =\r\n | Props of IHTMLProp list\r\n /// Add `is-mobile` class\r\n | [] IsMobile\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n module Item =\r\n\r\n type Option =\r\n | Props of IHTMLProp list\r\n /// Add `has-text-centered` class\r\n | [] HasTextCentered\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate \r\n let level (options : Level.Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Level.Option.IsMobile -> result.AddCaseName option\r\n | Level.Props props -> result.AddProps props\r\n | Level.CustomClass customClass -> result.AddClass customClass\r\n | Level.Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"level\").ToReactElement(nav, children)\r\n\r\n /// Generate
      \r\n let left (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"level-left\").ToReactElement(div, children)\r\n\r\n /// Generate
      \r\n let right (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"level-right\").ToReactElement(div, children)\r\n\r\n /// Generate
      \r\n let item (options : Item.Option list) children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Item.HasTextCentered -> result.AddCaseName option\r\n | Item.Props props -> result.AddProps props\r\n | Item.CustomClass customClass -> result.AddClass customClass\r\n | Item.Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"level-item\").ToReactElement(div, children)\r\n\r\n /// Generate

      \r\n let heading (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"heading\").ToReactElement(p, children)\r\n\r\n /// Generate

      \r\n let title (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"title\").ToReactElement(p, children)\r\n","module ContractsPageView\r\n\r\nopen FSharpPlus\r\nopen Client\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen ContractsPageModel\r\nopen PortalLibs.Shared\r\nopen PortalLibs.Client.Components\r\nopen PortalLibs.Client.Util\r\nopen Fulma\r\nopen Model\r\nopen Pages\r\nopen PortalLibs.Shared.Util\r\nopen PortalLibs.Client.Components.Dropdown\r\nopen Fulma.Extensions.Wikiki\r\nopen Feliz\r\nopen PortalLibs.Client.Components.Multiline\r\nopen PortalLibs.Client.Components.NewTableNext\r\nopen PortalLibs.Client.Model\r\n\r\nlet searchBarLevel left right =\r\n Level.level [] [\r\n Level.left [] [ Level.item [] left ]\r\n Level.right [] [\r\n Level.item [ Level.Item.CustomClass \"report-search-col\" ] right\r\n ]\r\n ]\r\n\r\nlet OnlyOneDropDownSpecific =\r\n OnlyOneDropdownGeneric\r\n\r\nlet searchBar (model: ContractsPageModel.Model) dispatch =\r\n let searchViewChangedCallback =\r\n React.useCallback (SearchboxValueChanged >> dispatch, [||])\r\n\r\n let activeChangedCallback =\r\n React.useCallback (ActiveChanged >> dispatch, [||])\r\n\r\n div [ Style [ Margin \"0 auto 10px auto\" ] ] [\r\n searchBarLevel [ div [ Style [ Width \"90px\" ] ] [\r\n OnlyOneDropDownSpecific\r\n {| Title = Name \"Active\"\r\n Items = ItemList [ true; false ]\r\n SelectMode =\r\n SingleSelect(\r\n { UpdateModel = Simple activeChangedCallback\r\n SelectedItem = Item model.Active\r\n LinkUrl = None }\r\n )\r\n DisplayValue =\r\n (fun m ->\r\n match m with\r\n | true -> \"Yes\"\r\n | false -> \"No\")\r\n Searchable = false\r\n Type = Standard\r\n Key = \"ContractsPageContractActive\" |}\r\n ] ] [\r\n SearchboxNew.SearchboxNew\r\n {| Value = model.SearchboxValue\r\n IsLoading = false\r\n IconVisible = false\r\n ValueChanged = searchViewChangedCallback\r\n Key = \"ContractsPageSearchbox\"\r\n ShouldFocus = false |}\r\n ]\r\n ]\r\n\r\nlet booleanFollowedField (item: ContractShort) dispatch =\r\n NewTableCheckboxCell\r\n {| Key = $\"FollowCheckbox-%s{item.Id.ToString()}\"\r\n EditMode =\r\n ControlEditMode.Edit\r\n { OnChange =\r\n (fun value ->\r\n ContractFollowChanged\r\n { item with\r\n Followed = value |> Option.defaultValue false }\r\n |> dispatch)\r\n StopPropagation = false }\r\n Label = None\r\n Value = item.Followed |}\r\n\r\n\r\nlet NewTableNextSpecific =\r\n NewTableNextGeneric\r\n\r\nlet table (model: ContractsPageModel.Model) contracts dispatch =\r\n let tableMsgCallback =\r\n React.useCallback ((TableMsg >> dispatch), [||])\r\n\r\n let contractsFiltered =\r\n contracts\r\n |> List.filter\r\n (fun contract ->\r\n filterItemBySearchTerm\r\n [ (fun (i: ContractShort) -> i.Company)\r\n (fun (i: ContractShort) -> i.Name)\r\n (fun (i: ContractShort) -> i.ProjectManager) ]\r\n (model.SearchboxValue\r\n |> Option.noneIfEmptyStrOptTrim\r\n |> Option.defaultValue \"\")\r\n contract)\r\n\r\n let columns =\r\n [ { Header = Text \"Company\"\r\n Id = Company\r\n Align = Left\r\n Value = ValueType.Text(fun (item: ContractShort) -> item.Company)\r\n Sortable = ColumnSort.InMemory(fun item -> item.Company)\r\n Draggable = false\r\n MinWidth = Some 150\r\n Footer = None\r\n InitiallyVisible = true }\r\n { Header = Text \"Contract\"\r\n Id = ContractsPageViewColumn.Contract\r\n Align = Left\r\n Value =\r\n ValueType.CustomAligned\r\n (fun (item: ContractShort) ->\r\n a [ OnClick goToUrl\r\n Href(contractUrl item.Id) ] [\r\n str item.Name\r\n ])\r\n Sortable = ColumnSort.InMemory(fun item -> item.Name)\r\n Draggable = false\r\n MinWidth = Some 250\r\n Footer = None\r\n InitiallyVisible = true }\r\n { Header = Text \"Project Manager\"\r\n Id = ContractsPageViewColumn.ProjectManager\r\n Align = Left\r\n Value = ValueType.Text(fun (item: ContractShort) -> item.ProjectManager)\r\n Sortable = ColumnSort.InMemory(fun item -> item.ProjectManager)\r\n Draggable = false\r\n MinWidth = Some 150\r\n Footer = None\r\n InitiallyVisible = true }\r\n { Header = Text \"Current Contract Amount\"\r\n Id = ContractsPageViewColumn.CurrentAmount\r\n Align = Right\r\n Value =\r\n ValueType.Text\r\n (fun (item: ContractShort) ->\r\n item.CurrentContractAmount\r\n |> DisplayNumber.AsCurrency.std)\r\n Sortable = ColumnSort.InMemory(fun item -> $\"%30f{item.CurrentContractAmount}\")\r\n Draggable = false\r\n MinWidth = Some 200\r\n Footer = None\r\n InitiallyVisible = true }\r\n { Header = Text \"Interested Parties\"\r\n Id = ContractsPageViewColumn.InterestedParties\r\n Align = Left\r\n Value =\r\n ValueType.CustomAligned\r\n (fun (item: ContractShort) ->\r\n Html.div [\r\n prop.style [\r\n style.width (length.percent 100)\r\n ]\r\n prop.children [\r\n Tooltip.divWithTooltip\r\n \"Enter one user login per line\"\r\n (Some Tooltip.TooltipPosition.Left)\r\n (Multiline\r\n {| Mode =\r\n ReadWrite\r\n { ValueChanged =\r\n (fun value ->\r\n ContractInterestedPartiesChanged({ item with InterestedParties = value })\r\n |> dispatch)\r\n Spellcheck = false }\r\n Value = item.InterestedParties\r\n Key = $\"ContractsPageInterestedParties-%i{item.Id}\"\r\n Rows = None\r\n MaxRows = None\r\n Ref = None |})\r\n ]\r\n ])\r\n Sortable = ColumnSort.InMemory(fun item -> item.InterestedParties)\r\n Draggable = false\r\n MinWidth = Some 250\r\n Footer = None\r\n InitiallyVisible = true }\r\n { Header =\r\n CheckboxLabel(\r\n \"Follow\",\r\n (fun (item: ContractShort) -> item.Followed),\r\n (fun (changed, checked') ->\r\n (changed |>> (fun item -> item.Id), checked')\r\n |> ContractFollowMassChanged\r\n |> dispatch)\r\n )\r\n Id = ContractsPageViewColumn.Follow\r\n Align = Center\r\n Value = ValueType.CustomAligned(fun (item: ContractShort) -> booleanFollowedField item dispatch)\r\n Sortable = ColumnSort.InMemory(fun item -> Boolean.toYesNoString item.Followed)\r\n Draggable = false\r\n MinWidth = Some 1\r\n Footer = None\r\n InitiallyVisible = true } ]\r\n\r\n div [ ClassName \"contracts-page-table\"\r\n Style [ Margin \"auto\" ] ] [\r\n\r\n yield\r\n NewTableNextSpecific\r\n {| Config =\r\n { Model = model.TableState\r\n Columns = columns\r\n Items = contractsFiltered\r\n ItemKey = fun item -> item.Id.ToString()\r\n SubRows = None\r\n ColumnSelection = false\r\n Selection = [], false\r\n Paging =\r\n Paged\r\n { HidePaginationUnder1Page = true\r\n PageSizeOptions = None }\r\n Key = \"ContractsPageTable\"\r\n RowClick = None\r\n Dispatch = tableMsgCallback\r\n DataLoad = InMemory\r\n StickyHeader = None } |}\r\n ]\r\n\r\nlet content model dispatch contracts =\r\n div [ ClassName \"contracts-page\" ] [\r\n searchBar model dispatch\r\n table model contracts dispatch\r\n ]\r\n\r\n\r\nlet ContractsPageView =\r\n React.memo (\r\n \"ContractsPageView\",\r\n fun (props: {| model: Model\r\n dispatch: Msg -> unit |}) ->\r\n div [ ClassName \"contracts-page\"\r\n Style [\r\n MarginTop \"25px\"\r\n MaxWidth \"1600px\"\r\n MarginLeft \"auto\"\r\n MarginRight \"auto\"\r\n PaddingBottom \"10px\"\r\n CSSProp.OverflowY OverflowOptions.Hidden\r\n ] ] [\r\n loadingMessageBoxOrContent\r\n \"Loading Contracts...\"\r\n (content props.model props.dispatch)\r\n props.model.Contracts\r\n ]\r\n )\r\n","module PortalLibs.Shared.Util\r\n\r\n\r\nopen Elmish\r\nopen System\r\nopen PortalLibs.Shared\r\nopen FSharpPlus\r\n\r\n#if !DEBUG\r\nlet isDebug = false\r\n#endif\r\n#if DEBUG\r\nlet isDebug = true\r\n#endif\r\n\r\n\r\nlet filterItemBySearchTerm<'T> (getters: ('T -> string) list) (term: string) (item: 'T) =\r\n match term with\r\n | \"\" -> true\r\n | x ->\r\n let matcher = List.fold (fun acc getter -> (acc + (getter item) + \" \")) \"\" getters\r\n\r\n matcher.ToLower().Contains(x.ToLower())\r\n || List.fold (fun acc getter -> acc && (getter item) = \"\") true getters\r\n\r\nlet resultItemOptForEntity<'T, 'U, 'Z> result (idOpt: 'Z option) idGetter =\r\n monad {\r\n let! itemId = idOpt\r\n return!\r\n List.tryFind (fun (item: 'T) -> idGetter item = itemId.ToString()) (result |> Result.resultOrEmptyListIfNone)\r\n }\r\n\r\nlet setItemOptForEntity<'T, 'U> set (idOpt: int64 option) idGetter =\r\n monad {\r\n let! itemId = idOpt\r\n return! List.tryFind (fun (item: 'T) -> idGetter item = itemId.ToString()) set\r\n }\r\n\r\nlet resultItemForEntity<'T, 'U, 'Z> result (idOpt: 'Z option) idGetter (valueGetter: 'T -> 'U) (emptyValue: 'U) =\r\n resultItemOptForEntity result idOpt idGetter\r\n |>> valueGetter\r\n |> Option.defaultValue emptyValue\r\n\r\nlet filterByAdditionalFields (fields: string list) term =\r\n match term with\r\n | \"\" -> true\r\n | x ->\r\n let matcher = (fields |> String.concat \" \").ToLower()\r\n\r\n matcher.ToLower().Contains(x.ToLower())\r\n\r\nlet filterByExactTextField (field: string) term =\r\n match term with\r\n | \"\" -> true\r\n | x -> field = x\r\n\r\nlet filterByOptionalField field searchOption =\r\n match searchOption with\r\n | None -> true\r\n | Some id -> field.ToString() = id.ToString()\r\n\r\nlet filterByIdList (idOpt: int64 option) idList =\r\n match idList with\r\n | [] -> true\r\n | list ->\r\n match idOpt with\r\n | None -> false\r\n | Some field -> list |> List.exists (fun f -> field.ToString() = f.ToString())\r\n\r\nlet waitForDeps<'T> (deps: bool list) (msg: 'T) action =\r\n match List.forall id deps with\r\n | true -> action\r\n | false -> Cmd.OfAsync.either (fun () -> async { do! Async.Sleep(1000) }) () (fun _ -> msg) (fun _ -> msg)\r\n\r\nlet ssnIntToDashString (ssn: int) = String.Format(\"{0:000-00-0000}\", ssn)\r\n\r\nlet cleanPhoneNumber (number: String) =\r\n number\r\n .Replace(\" \", \"\")\r\n .Replace(\".\", \"\")\r\n .Replace(\"-\", \"\")\r\n .Replace(\"(\", \"\")\r\n .Replace(\")\", \"\")\r\n |> fun number ->\r\n if number.StartsWith(\"+1\") then\r\n number.Substring(2)\r\n else\r\n number\r\n\r\n\r\nlet isValidUSPhoneNumber (number: string) =\r\n let regExPattern = @\"^[01]?[- .]?(\\([2-9]\\d{2}\\)|[2-9]\\d{2})[- .]?\\d{3}[- .]?\\d{4}$\"\r\n\r\n let pattern = System.Text.RegularExpressions.Regex(regExPattern)\r\n\r\n number |> pattern.IsMatch\r\n","module PortalLibs.Client.Components.Tooltip\r\n\r\n\r\nopen Feliz\r\n\r\ntype TooltipPosition =\r\n | Left\r\n | Top\r\n | Right\r\n | Bottom\r\n\r\nlet divWithTooltip tooltip positionOpt element =\r\n Html.div [\r\n Bulma.tooltip.text tooltip\r\n match positionOpt with\r\n | Some Left -> Bulma.tooltip.hasTooltipLeft\r\n | Some Top -> Bulma.tooltip.hasTooltipTop\r\n | Some Right -> Bulma.tooltip.hasTooltipRight\r\n | Some Bottom -> Bulma.tooltip.hasTooltipBottom\r\n | _ -> ()\r\n prop.children [ element ]\r\n ]\r\n\r\n\r\nlet spanWithTooltip (text: string) tooltip =\r\n Html.span [\r\n Bulma.tooltip.text tooltip\r\n prop.text text\r\n ]\r\n","module PortalLibs.Shared.Boolean\r\n\r\n let toYesNoString bool =\r\n match bool with\r\n | false -> \"No\"\r\n | true -> \"Yes\"\r\n\r\n let toYesNoStringOpt boolOpt =\r\n match boolOpt with\r\n | None -> \"\"\r\n | Some v -> toYesNoString v","namespace PortalLibs.Client.Components\r\n\r\n\r\nopen Fable.Core\r\nopen Fable.Core.JsInterop\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen System\r\nopen Elmish\r\nopen Fulma\r\nopen Fable.FontAwesome\r\nopen Feliz\r\nopen PortalLibs.Client.Util\r\nopen PortalLibs.Client.Components.DebouncedView\r\nopen FSharpPlus\r\n\r\nmodule Datepicker =\r\n\r\n []\r\n let ReactDataPicker: obj = jsNative\r\n\r\n importAll \"react-datepicker/dist/react-datepicker.css\"\r\n\r\n let datePickerField name value dispatch =\r\n let props =\r\n createObj [\r\n \"selected\" => value\r\n \"className\" => \"input\"\r\n \"onChange\" => dispatch\r\n \"preventOpenOnFocus\" => true\r\n ]\r\n\r\n field name [ ofImport \"default\" \"react-datepicker\" props [] ]\r\n\r\n let monthPickerField value dispatch =\r\n let props =\r\n createObj [\r\n \"selected\" => value\r\n \"className\" => \"input\"\r\n \"showMonthYearPicker\" => true\r\n \"dateFormat\" => \"MM/yyyy\"\r\n \"onChange\" => dispatch\r\n ]\r\n\r\n ofImport \"default\" \"react-datepicker\" props []\r\n\r\n let datePickerInputWithPlaceholder placeHolder value dispatch =\r\n let props =\r\n createObj [\r\n \"selected\" => value\r\n \"className\" => \"input\"\r\n \"onChange\" => dispatch\r\n \"placeholderText\" => placeHolder\r\n ]\r\n\r\n ofImport \"default\" \"react-datepicker\" props []\r\n\r\nmodule DatepickerBetween =\r\n\r\n let DatepickerBetween =\r\n React.memo<{| Key: string\r\n Values: DateTime option * DateTime option\r\n ValuesChanged: DateTime option * DateTime option -> unit |}> (\r\n name = \"DatepickerBetween\",\r\n areEqual = Helpers.equalsButFunctions,\r\n render =\r\n (fun props ->\r\n let fromValue, toValue = props.Values\r\n\r\n DebouncedView\r\n {| Key = $\"DateBetweenDebouncedView-%s{props.Key}\"\r\n Value = Some(fromValue, toValue)\r\n ValueChanged = (fun valuesOpt -> valuesOpt |> Option.iter props.ValuesChanged)\r\n Intercept =\r\n Some\r\n (fun values ->\r\n let fromOpt, toOpt = values.Value\r\n\r\n let prevFromValueOpt =\r\n values.LastValue\r\n >>= fst\r\n\r\n let prevToValueOpt =\r\n values.LastValue\r\n >>= snd\r\n\r\n let from =\r\n match fromOpt, toOpt with\r\n | Some fromValue, Some toValue ->\r\n if prevToValueOpt <> toOpt && fromValue > toValue then\r\n toOpt\r\n else\r\n fromOpt\r\n | _ -> fromOpt\r\n\r\n let toValue =\r\n match fromOpt, toOpt with\r\n | Some fromValue, Some toValue ->\r\n if prevFromValueOpt <> fromOpt && fromValue > toValue then\r\n fromOpt\r\n else\r\n toOpt\r\n | _ -> toOpt\r\n\r\n Some(from, toValue))\r\n View =\r\n (fun datesOpt valueChanged ->\r\n Control.div [ Control.Props [\r\n Style [\r\n Display DisplayOptions.Flex\r\n AlignItems AlignItemsOptions.Center\r\n ]\r\n ] ] [\r\n Datepicker.datePickerInputWithPlaceholder\r\n \"From\"\r\n (datesOpt\r\n >>= fst )\r\n (fun dateFrom ->\r\n Some(\r\n dateFrom,\r\n datesOpt\r\n >>= snd\r\n )\r\n |> valueChanged)\r\n Icon.icon [ Icon.Props [\r\n Style [ Color \"gray\"; Margin \"0 5px\" ]\r\n ] ] [\r\n Fa.i [ Fa.Solid.Minus ] []\r\n ]\r\n Datepicker.datePickerInputWithPlaceholder\r\n \"To\"\r\n (datesOpt\r\n >>= snd )\r\n (fun dateTo ->\r\n Some(\r\n datesOpt\r\n >>= fst ,\r\n dateTo\r\n )\r\n |> valueChanged)\r\n ]) |})\r\n )\r\n\r\n let viewWithHeader header props =\r\n field header [ DatepickerBetween props ]\r\n\r\nmodule DatepickerMonth =\r\n\r\n let DatepickerMonth\r\n (props: {| Key: string\r\n Value: DateTime option\r\n ValueChanged: DateTime option -> unit |})\r\n =\r\n DebouncedView\r\n {| Key = $\"DatepickerDebouncedView-%s{props.Key}\"\r\n Value = props.Value\r\n ValueChanged = props.ValueChanged\r\n Intercept = None\r\n View = (fun valueOpt valueChanged -> Datepicker.monthPickerField valueOpt (fun month -> Some(month) |> valueChanged)) |}\r\n\r\n\r\n let viewWithHeader header props = field header [ DatepickerMonth props ]\r\n\r\nmodule DatepickerDay =\r\n\r\n let DatepickerDay\r\n (props: {| Key: string\r\n Name: string\r\n Value: DateTime option\r\n ValueChanged: DateTime option -> unit |})\r\n =\r\n DebouncedView\r\n {| Key = $\"DatepickerDayDebouncedView-%s{props.Key}\"\r\n Value = props.Value\r\n ValueChanged = props.ValueChanged\r\n Intercept = None\r\n View =\r\n (fun valueOpt valueChanged -> Datepicker.datePickerField props.Name valueOpt (fun dt -> Some(dt) |> valueChanged)) |}\r\n\r\n\r\n let viewWithHeader header props = field header [ DatepickerDay props ]\r\n","module PortalLibs.Shared.List\r\n\r\nlet apply fs x = List.map (fun f -> f x) fs\r\n\r\nlet replace f sub xs =\r\n let rec finish acc =\r\n function\r\n | [] -> acc\r\n | x :: xs -> finish (x :: acc) xs\r\n\r\n let rec search acc =\r\n function\r\n | [] -> None\r\n | x :: xs ->\r\n if f x then\r\n Some(finish ((sub x) :: xs) acc)\r\n else\r\n search (x :: acc) xs\r\n\r\n search [] xs\r\n\r\nlet truncateOpt limitOpt =\r\n match limitOpt with\r\n | Some count -> List.truncate count\r\n | None -> id\r\n\r\nlet optionMap map list =\r\n if List.contains None list then\r\n None\r\n else\r\n list |> List.choose id |> List.map map |> Some\r\n\r\nlet remove itemToRemove list =\r\n List.filter (fun item -> item <> itemToRemove) list\r\n\r\nlet addIfNotExists item list =\r\n if List.contains item list then list else item :: list\r\n\r\nlet appendIfNotExists item list =\r\n if List.contains item list then\r\n list\r\n else\r\n List.append list [ item ]\r\n \r\nlet sortOptionsBy noneAtTheEnd select list =\r\n list |> List.sortWith(fun a b ->\r\n match (select a, select b) with\r\n | Some v, Some v2 -> compare v v2\r\n | Some _, None -> if noneAtTheEnd then -1 else 1\r\n | None, Some _ -> if noneAtTheEnd then 1 else -1\r\n | None, None -> 0)","namespace FSharpPlus.Control\n\nopen System\nopen System.Runtime.InteropServices\nopen System.Collections.Generic\nopen System.Threading.Tasks\nopen Microsoft.FSharp.Quotations\n\nopen FSharpPlus.Internals\nopen FSharpPlus\nopen FSharpPlus.Data\n\n\ntype Apply =\n inherit Default1\n \n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\n static member inline ``<*>`` (f: '``Monad<'T->'U>`` , x: '``Monad<'T>`` , []_output: '``Monad<'U>`` , []_mthd:Default2) : '``Monad<'U>`` = Bind.InvokeOnInstance f (fun (x1: 'T->'U) -> Bind.InvokeOnInstance x (fun x2 -> Return.InvokeOnInstance (x1 x2)))\n static member inline ``<*>`` (f: '``Applicative<'T->'U>``, x: '``Applicative<'T>``, []_output: '``Applicative<'U>``, []_mthd:Default1) : '``Applicative<'U>`` = ((^``Applicative<'T->'U>`` or ^``Applicative<'T>`` or ^``Applicative<'U>``) : (static member (<*>) : _*_ -> _) f, x)\n\n static member ``<*>`` (f: Lazy<'T->'U> , x: Lazy<'T> , []_output: Lazy<'U> , []_mthd: Apply) = Lazy.apply f x : Lazy<'U>\n static member ``<*>`` (f: seq<_> , x: seq<'T> , []_output: seq<'U> , []_mthd: Apply) = Seq.apply f x : seq<'U>\n static member ``<*>`` (f: NonEmptySeq<_> , x: NonEmptySeq<'T> , []_output: NonEmptySeq<'U> , []_mthd: Apply) = NonEmptySeq.apply f x : NonEmptySeq<'U>\n static member ``<*>`` (f: IEnumerator<_> , x: IEnumerator<'T> , []_output: IEnumerator<'U> , []_mthd: Apply) = Enumerator.map2 id f x : IEnumerator<'U>\n static member ``<*>`` (f: list<_> , x: list<'T> , []_output: list<'U> , []_mthd: Apply) = List.apply f x : list<'U>\n static member ``<*>`` (f: _ [] , x: 'T [] , []_output: 'U [] , []_mthd: Apply) = Array.apply f x : 'U []\n static member ``<*>`` (f: 'r -> _ , g: _ -> 'T , []_output: 'r -> 'U , []_mthd: Apply) = fun x -> let f' = f x in f' (g x) : 'U\n static member inline ``<*>`` ((a: 'Monoid, f) , (b: 'Monoid, x: 'T) , []_output: 'Monoid * 'U , []_mthd: Apply) = (Plus.Invoke a b, f x) : 'Monoid *'U\n static member inline ``<*>`` (struct (a: 'Monoid, f), struct (b: 'Monoid, x: 'T), []_output: struct ('Monoid * 'U), []_mthd: Apply) = struct (Plus.Invoke a b, f x) : struct ('Monoid * 'U)\n #if !FABLE_COMPILER\n static member ``<*>`` (f: Task<_> , x: Task<'T> , []_output: Task<'U> , []_mthd: Apply) = Task.apply f x : Task<'U>\n #endif\n #if NETSTANDARD2_1 && !FABLE_COMPILER\n static member ``<*>`` (f: ValueTask<_> , x: ValueTask<'T> , []_output: ValueTask<'U> , []_mthd: Apply) = ValueTask.apply f x : ValueTask<'U>\n #endif\n static member ``<*>`` (f: Async<_> , x: Async<'T> , []_output: Async<'U> , []_mthd: Apply) = Async.apply f x : Async<'U>\n static member ``<*>`` (f: option<_> , x: option<'T> , []_output: option<'U> , []_mthd: Apply) = Option.apply f x : option<'U>\n static member ``<*>`` (f: voption<_> , x: voption<'T> , []_output: voption<'U> , []_mthd: Apply) = ValueOption.apply f x : voption<'U>\n static member ``<*>`` (f: Result<_,'E> , x: Result<'T,'E> , []_output: Result<'b,'E> , []_mthd: Apply) = Result.apply f x : Result<'U,'E>\n static member ``<*>`` (f: Choice<_,'E> , x: Choice<'T,'E> , []_output: Choice<'b,'E> , []_mthd: Apply) = Choice.apply f x : Choice<'U,'E>\n static member inline ``<*>`` (KeyValue(a: 'Key, f), KeyValue(b: 'Key, x: 'T), []_output: KeyValuePair<'Key,'U>, []_mthd: Apply) : KeyValuePair<'Key,'U> = KeyValuePair (Plus.Invoke a b, f x)\n\n static member ``<*>`` (f: Map<'Key,_> , x: Map<'Key,'T> , []_output: Map<'Key,'U> , []_mthd: Apply) : Map<'Key,'U> = Map (seq {\n for KeyValue(k, vf) in f do\n match Map.tryFind k x with\n | Some vx -> yield k, vf vx\n | _ -> () })\n\n static member ``<*>`` (f: Dictionary<'Key,_>, x: Dictionary<'Key,'T> , []_output: Dictionary<'Key,'U> , []_mthd: Apply) : Dictionary<'Key,'U> =\n let dct = Dictionary ()\n for KeyValue(k, vf) in f do\n match x.TryGetValue k with\n | true, vx -> dct.Add (k, vf vx)\n | _ -> ()\n dct\n #if !FABLE_COMPILER\n static member ``<*>`` (f: Expr<'T->'U>, x: Expr<'T>, []_output: Expr<'U>, []_mthd: Apply) = Expr.Cast<'U> (Expr.Application (f, x))\n #endif\n static member ``<*>`` (f: ('T->'U) ResizeArray, x: 'T ResizeArray, []_output: 'U ResizeArray, []_mthd: Apply) = ResizeArray.apply f x : 'U ResizeArray\n\n static member inline Invoke (f: '``Applicative<'T -> 'U>``) (x: '``Applicative<'T>``) : '``Applicative<'U>`` =\n let inline call (mthd : ^M, input1: ^I1, input2: ^I2, output: ^R) =\n ((^M or ^I1 or ^I2 or ^R) : (static member ``<*>`` : _*_*_*_ -> _) input1, input2, output, mthd)\n call(Unchecked.defaultof, f, x, Unchecked.defaultof<'``Applicative<'U>``>)\n\n\n#endif\n\n static member inline InvokeOnInstance (f: '``Applicative<'T->'U>``) (x: '``Applicative<'T>``) : '``Applicative<'U>`` =\n ((^``Applicative<'T->'U>`` or ^``Applicative<'T>`` or ^``Applicative<'U>``) : (static member (<*>) : _*_ -> _) (f, x))\n\n#if !FABLE_COMPILER || FABLE_COMPILER_3\n\ntype Lift2 =\n inherit Default1\n\n static member Lift2 (f, (x: Lazy<_> , y: Lazy<_> ), _mthd: Lift2) = Lazy.map2 f x y\n static member Lift2 (f, (x: seq<_> , y: seq<_> ), _mthd: Lift2) = Seq.lift2 f x y\n static member Lift2 (f, (x: NonEmptySeq<_> , y: NonEmptySeq<_> ), _mthd: Lift2) = NonEmptySeq.lift2 f x y\n static member Lift2 (f, (x: IEnumerator<_> , y: IEnumerator<_> ), _mthd: Lift2) = Enumerator.map2 f x y\n static member Lift2 (f, (x , y ), _mthd: Lift2) = List.lift2 f x y\n static member Lift2 (f, (x , y ), _mthd: Lift2) = Array.lift2 f x y\n static member Lift2 (f, (x: 'R -> 'T , y: 'R -> 'U ), _mthd: Lift2) = fun a -> f (x a) (y a)\n static member inline Lift2 (f, ((a: 'Monoid, x: 'T) , (b: 'Monoid, y: 'U) ), _mthd: Lift2) = Plus.Invoke a b, f x y\n static member inline Lift2 (f, (struct (a: 'Monoid, x: 'T), struct (b: 'Monoid, y: 'U)), _mthd: Lift2) = struct (Plus.Invoke a b, f x y)\n #if !FABLE_COMPILER\n static member Lift2 (f, (x: Task<'T> , y: Task<'U> ), _mthd: Lift2) = Task.map2 f x y\n #endif\n #if NETSTANDARD2_1 && !FABLE_COMPILER\n static member Lift2 (f, (x: ValueTask<'T> , y: ValueTask<'U> ), _mthd: Lift2) = ValueTask.map2 f x y\n #endif\n static member Lift2 (f, (x , y ), _mthd: Lift2) = Async.map2 f x y\n static member Lift2 (f, (x , y ), _mthd: Lift2) = Option.map2 f x y\n \n #if !FABLE_COMPILER\n static member Lift2 (f, (x , y ), _mthd: Lift2) = ValueOption.map2 f x y\n #endif\n static member Lift2 (f, (x: Result<'T,'Error> , y: Result<'U,'Error> ), _mthd: Lift2) = Result.map2 f x y\n static member Lift2 (f, (x: Choice<'T,'Error> , y: Choice<'U,'Error> ), _mthd: Lift2) = Choice.map2 f x y\n static member Lift2 (f, (x: Map<'Key,'T> , y : Map<'Key,'U> ), _mthd: Lift2) = Map.mapValues2 f x y\n static member Lift2 (f, (x: Dictionary<'Key,'T>, y: Dictionary<'Key,'U>), _mthd: Lift2) = Dictionary.map2 f x y\n #if !FABLE_COMPILER\n static member Lift2 (f, (x: Expr<'T> , y: Expr<'U> ), _mthd: Lift2) = <@ f %x %y @>\n #endif\n static member Lift2 (f, (x: ResizeArray<'T> , y: ResizeArray<'U> ), _mthd: Lift2) = ResizeArray.lift2 f x y\n\n static member inline Invoke (f: 'T -> 'U -> 'V) (x: '``Applicative<'T>``) (y: '``Applicative<'U>``) : '``Applicative<'V>`` =\n let inline call (mthd : ^M, input1: ^I1, input2: ^I2, _output: ^R) =\n ((^M or ^I1 or ^I2 or ^R) : (static member Lift2 : _*(_*_)*_ -> _) f, (input1, input2), mthd)\n call (Unchecked.defaultof, x, y, Unchecked.defaultof<'``Applicative<'V>``>)\n\n static member inline InvokeOnInstance (f: 'T -> 'U -> 'V) (x: '``Applicative<'T>``) (y: '``Applicative<'U>``) =\n ((^``Applicative<'T>`` or ^``Applicative<'U>``) : (static member Lift2 : _*_*_ -> _) f, x, y)\n\ntype Lift2 with\n static member inline Lift2 (f, (x, y), _mthd: Default2) = (((Return.InvokeOnInstance f, x) ||> Apply.InvokeOnInstance), y) ||> Apply.InvokeOnInstance\n\n static member inline Lift2 (_, (_:'t when 't: null and 't: struct, _: ^u when ^u : null and ^u: struct), _mthd: Default1) = id\n static member inline Lift2 (f: 'T -> 'U -> 'V, (x: '``Applicative<'T>``, y: '``Applicative<'U>``) , _mthd: Default1) = ((^``Applicative<'T>`` or ^``Applicative<'U>`` ) : (static member Lift2 : _*_*_ -> _) f, x, y)\n\ntype Lift3 =\n inherit Default1\n\n static member Lift3 (f, (x: Lazy<_> , y: Lazy<_> , z: Lazy<_> ), _mthd: Lift3) = Lazy.map3 f x y z\n static member Lift3 (f, (x: seq<_> , y: seq<_> , z: seq<_> ), _mthd: Lift3) = Seq.lift3 f x y z\n static member Lift3 (f, (x: NonEmptySeq<_> , y: NonEmptySeq<_> , z: NonEmptySeq<_> ), _mthd: Lift3) = NonEmptySeq.lift3 f x y z\n static member Lift3 (f, (x: IEnumerator<_> , y: IEnumerator<_> , z: IEnumerator<_> ), _mthd: Lift3) = Enumerator.map3 f x y z\n static member Lift3 (f, (x , y , z ), _mthd: Lift3) = List.lift3 f x y z\n static member Lift3 (f, (x , y , z ), _mthd: Lift3) = Array.lift3 f x y z\n static member Lift3 (f, (x: 'R -> 'T , y: 'R -> 'U , z: 'R -> 'V ), _mthd: Lift3) = fun a -> f (x a) (y a) (z a)\n static member inline Lift3 (f, ((a: 'Monoid, x: 'T) , (b: 'Monoid, y: 'U) , (c: 'Monoid, z: 'U) ), _mthd: Lift3) = Plus.Invoke (Plus.Invoke a b) c, f x y z\n static member inline Lift3 (f, (struct (a: 'Monoid, x: 'T), struct (b: 'Monoid, y: 'U), struct (c: 'Monoid, z: 'U)), _mthd: Lift3) = struct (Plus.Invoke (Plus.Invoke a b) c, f x y z)\n #if !FABLE_COMPILER\n static member Lift3 (f, (x: Task<'T> , y: Task<'U> , z: Task<'V> ), _mthd: Lift3) = Task.map3 f x y z\n #endif\n #if NETSTANDARD2_1 && !FABLE_COMPILER\n static member Lift3 (f, (x: ValueTask<'T> , y: ValueTask<'U> , z: ValueTask<'V> ), _mthd: Lift3) = ValueTask.map3 f x y z\n #endif\n static member Lift3 (f, (x , y , z ), _mthd: Lift3) = Async.map3 f x y z\n static member Lift3 (f, (x , y , z ), _mthd: Lift3) = Option.map3 f x y z\n \n #if !FABLE_COMPILER\n static member Lift3 (f, (x , y , z ), _mthd: Lift3) = ValueOption.map3 f x y z\n #endif\n static member Lift3 (f, (x: Result<'T,'Error> , y: Result<'U,'Error> , z: Result<'V, 'Error> ), _mthd: Lift3) = Result.map3 f x y z\n static member Lift3 (f, (x: Choice<'T,'Error> , y: Choice<'U,'Error> , z: Choice<'V, 'Error> ), _mthd: Lift3) = Choice.map3 f x y z\n static member Lift3 (f, (x: Map<'Key,'T> , y: Map<'Key,'U> , z: Map<'Key, 'V> ), _mthd: Lift3) = Map.mapValues3 f x y z\n static member Lift3 (f, (x: Dictionary<'Key,'T>, y: Dictionary<'Key,'U>, z: Dictionary<'Key, 'V>), _mthd: Lift3) = Dictionary.map3 f x y z\n #if !FABLE_COMPILER\n static member Lift3 (f, (x: Expr<'T> , y: Expr<'U> , z: Expr<'V> ), _mthd: Lift3) = <@ f %x %y %z @>\n #endif\n static member Lift3 (f, (x: ResizeArray<'T> , y: ResizeArray<'U> , z: ResizeArray<'V> ), _mthd: Lift3) = ResizeArray.lift3 f x y z\n\n static member inline Invoke (f: 'T -> 'U -> 'V -> 'W) (x: '``Applicative<'T>``) (y: '``Applicative<'U>``) (z: '``Applicative<'V>``): '``Applicative<'W>`` =\n let inline call (mthd : ^M, input1: ^I1, input2: ^I2, input3: ^I3, _output: ^R) =\n ((^M or ^I1 or ^I2 or ^I3 or ^R) : (static member Lift3 : _*(_*_*_)*_ -> _) f, (input1, input2, input3), mthd)\n call (Unchecked.defaultof, x, y, z, Unchecked.defaultof<'``Applicative<'W>``>)\n\n static member inline InvokeOnInstance (f: 'T -> 'U -> 'V -> 'W) (x: '``Applicative<'T>``) (y: '``Applicative<'U>``) (z: '``Applicative<'V>``)=\n ((^``Applicative<'T>`` or ^``Applicative<'U>`` or ^``Applicative<'V>``) : (static member Lift3 : _*_*_*_ -> _) f, x, y, z)\n\ntype Lift3 with\n static member inline Lift3 (f, (x, y, z), _mthd: Default3) = ((((Return.InvokeOnInstance f, x) ||> Apply.InvokeOnInstance), y) ||> Apply.InvokeOnInstance, z) ||> Apply.InvokeOnInstance\n static member inline Lift3 (_, (_:'t when 't: null and 't: struct, _: ^u when ^u : null and ^u: struct, _: ^v when ^v : null and ^v: struct), _mthd: Default1) = id\n static member inline Lift3 (f: 'T -> 'U -> 'V -> 'W, (x: '``Applicative<'T>``, y: '``Applicative<'U>``, z: '``Applicative<'V>``) , _mthd: Default1) = ((^``Applicative<'T>`` or ^``Applicative<'U>`` or ^``Applicative<'V>`` ) : (static member Lift3 : _*_*_*_ -> _) f, x, y, z)\n\ntype IsLeftZero =\n inherit Default1\n\n static member IsLeftZero (t: ref> , _mthd: IsLeftZero) = Seq.isEmpty t.Value\n static member IsLeftZero (_: ref>, _mthd: IsLeftZero) = false\n static member IsLeftZero (t: ref> , _mthd: IsLeftZero) = List.isEmpty t.Value\n static member IsLeftZero (t: ref> , _mthd: IsLeftZero) = Array.isEmpty t.Value\n static member IsLeftZero (t: ref> , _mthd: IsLeftZero) = Option.isNone t.Value\n #if !FABLE_COMPILER\n static member IsLeftZero (t: ref> , _mthd: IsLeftZero) = ValueOption.isNone t.Value\n #endif\n static member IsLeftZero (t: ref> , _mthd: IsLeftZero) = match t.Value with Error _ -> true | _ -> false\n static member IsLeftZero (t: ref> , _mthd: IsLeftZero) = match t.Value with Choice2Of2 _ -> true | _ -> false\n\n static member inline Invoke (x: '``Applicative<'T>``) : bool =\n let inline call (mthd : ^M, input: ^I) =\n ((^M or ^I) : (static member IsLeftZero : _*_ -> _) ref input, mthd)\n call(Unchecked.defaultof, x)\n\n static member inline InvokeOnInstance (x: '``Applicative<'T>``) : bool =\n ((^``Applicative<'T>``) : (static member IsLeftZero : _ -> _) x)\n\ntype IsLeftZero with\n\n static member inline IsLeftZero (_: ref<'T> when 'T : struct , _mthd: Default4) = false\n static member inline IsLeftZero (_: ref<'T> when 'T : not struct, _mthd: Default3) = false\n\n // empty <*> f = empty ==> empty is left zero for <*>\n static member inline IsLeftZero (t: ref<'``Alternative<'T>``> , _mthd: Default2) = (t.Value = Empty.InvokeOnInstance ())\n\n static member inline IsLeftZero (t: ref<'``Applicative<'T>``> , _mthd: Default1) = (^``Applicative<'T>`` : (static member IsLeftZero : _ -> _) t.Value)\n static member inline IsLeftZero (_: ref< ^t> when ^t: null and ^t: struct, _: Default1) = ()\n\n#endif","namespace FSharpPlus\n\n/// Additional operations on Option\n[]\nmodule Option =\n /// Applies an option value to an option function.\n /// The option function.\n /// The option value.\n /// An option of the function applied to the value, or None if either the function or the value is None.\n let apply f (x: option<'T>) : option<'U> =\n match f, x with\n | Some f, Some x -> Some (f x)\n | _ -> None\n\n /// If value is Some, returns both of them tupled. Otherwise it returns None tupled.\n /// The value.\n /// The resulting tuple.\n let unzip (v: option<'T * 'U>) =\n match v with\n | Some (x, y) -> Some x, Some y\n | _ -> None , None\n\n /// If both value are Some, returns both of them tupled. Otherwise it returns None.\n /// The first value.\n /// The second value.\n /// The resulting option.\n let zip x y : option<'T * 'U> =\n match x, y with\n | Some x, Some y -> Some (x, y)\n | _ -> None\n\n /// If all 3 value are Some, returns them tupled. Otherwise it returns None.\n /// The first value.\n /// The second value.\n /// The third value.\n /// The resulting option.\n let zip3 x y z : option<'T * 'U * 'V> =\n match x, y, z with\n | Some x, Some y, Some z -> Some (x, y, z)\n | _ -> None\n\n /// Converts an option to a Result.\n /// The option value.\n /// The resulting Result value.\n let toResult (source: option<'T>) = match source with Some x -> Ok x | None -> Error ()\n\n /// Converts an option to a Result.\n /// The error value to be used in case of None.\n /// The option value.\n /// The resulting Result value.\n let toResultWith (errorValue: 'Error) (source: 'T option) = match source with Some x -> Ok x | None -> Error errorValue\n\n /// Converts a Result to an option.\n /// The error value (if any) is lost.\n /// The Result value.\n /// The resulting option value.\n let ofResult (source: Result<'T,'Error>) = match source with Ok x -> Some x | Error _ -> None\n\n /// Creates a safe version of the supplied function, which returns an option<'U> instead of throwing exceptions.\n let protect (f: 'T->'U) x =\n try\n Some (f x)\n with _ -> None\n\n /// Converts pair of bool and value to Option.\n /// Useful for handling C# try pattern with `out` parameter. E.g. `Int.TryParse` or `Dictionary.TryGetValue`.\n /// Pair of bool and value.\n /// Some if bool is `true`, None otherwise.\n let ofPair (pair: (bool * 'T)) =\n match pair with\n | (true, x) -> Some x\n | (false, _) -> None\n","module CompanyPageView\r\nopen FSharpPlus\r\nopen Client\r\nopen CompanyPageModel\r\nopen Fable.Core\r\nopen Feliz.Bulma\r\nopen PortalLibs.Client.Components\r\nopen PortalLibs.Client.Util\r\nopen Model\r\nopen PortalLibs.Client.Components.Dropdown\r\nopen Feliz\r\nopen Fable.FontAwesome\r\nopen DisplayNumber\r\nopen PortalLibs.Shared\r\n\r\nlet searchBarLevel (left: ReactElement list) (right: ReactElement list) =\r\n Bulma.level [\r\n Bulma.levelLeft [Bulma.levelItem[prop.children left]]\r\n Bulma.levelRight [\r\n Bulma.levelItem[prop.className \"report-search-col\"; prop.children right]\r\n ]\r\n ]\r\n\r\nlet OnlyOneDropdownSpecific =\r\n OnlyOneDropdownGeneric\r\n\r\nlet searchBar (model: CompanyPageModel.Model) dispatch =\r\n let companyUpdateCallback =\r\n React.useCallback (SelectedCompanyChanged >> dispatch, [||])\r\n\r\n let dateUpdateCallback =\r\n React.useCallback (DateRangeChanged >> dispatch, [||])\r\n\r\n Html.div [\r\n prop.className \"company-tab-filters\"\r\n prop.style [style.margin(length.px 0, length.auto, length.px(10), length.auto)]\r\n prop.children (\r\n searchBarLevel\r\n [\r\n Html.div [\r\n prop.style [style.width(length.px 300)]\r\n prop.children [\r\n OnlyOneDropdownSpecific\r\n {|\r\n Title = Name \"Company\"\r\n Items = DropdownItems.ItemListOption model.Companies\r\n SelectMode =\r\n SingleSelect(\r\n { UpdateModel = Simple companyUpdateCallback\r\n SelectedItem = Item model.SelectedCompany\r\n LinkUrl = None }\r\n )\r\n DisplayValue = (fun m -> $\"%i{m.Co} %s{(m.Name |> Option.emptyStrIfNone)}\" )\r\n Searchable = false\r\n Type = Standard\r\n Key = \"CompanyPageCompanyDropdown\" |}\r\n ]\r\n ]\r\n Html.div [\r\n prop.className \"company-tab-daterange-filter-cont\"\r\n prop.children [\r\n fieldWithHeader\r\n None\r\n []\r\n \"Date Range\"\r\n (Html.div [\r\n prop.className \"company-tab-daterange-filter\"\r\n prop.children [\r\n (DatepickerBetween.DatepickerBetween\r\n {| Key = \"DateRange\"\r\n Values = model.DateRange\r\n ValuesChanged = dateUpdateCallback |})\r\n ]\r\n ])\r\n ]\r\n ]\r\n ] []\r\n )\r\n ]\r\n\r\nlet totalColor = \"#3273dc\"\r\n\r\nlet totalColumns isTotal rows =\r\n let td value (format: float -> string) =\r\n Html.td [\r\n prop.style [ style.textAlign.right ]\r\n prop.children [\r\n Html.strong [\r\n prop.style [if JS.isFinite value && value < 0.0\r\n then style.color.red\r\n else if isTotal then style.color totalColor]\r\n prop.text(value |> format)\r\n ]\r\n ]\r\n ]\r\n [\r\n td (rows |> List.sumBy(fun cost -> cost.SumOfBilling)) AsCurrency.withParenthesis\r\n td (rows |> List.sumBy(fun cost -> cost.DirectJobCost)) AsCurrency.withParenthesis\r\n td (rows |> List.sumBy(fun cost -> cost.GrossMarginDollar)) AsCurrency.withParenthesis\r\n \r\n td (\r\n rows\r\n |> List.fold (fun (s, g) n -> s + n.SumOfBilling, g + n.GrossMarginDollar) (0.0, 0.0)\r\n |> fun (s, g) -> s / g) AsPercent.withParenthesisOrDef\r\n\r\n td (\r\n rows\r\n |> List.fold (fun (rev, cos) n -> rev + n.OCRev, cos + n.OCCosts) (0.0, 0.0)\r\n |> fun (rev, cos) -> (rev - cos) / rev) AsPercent.withParenthesisOrDef\r\n ]\r\n\r\nlet expandedColor = \"#e6e6e6\"\r\n\r\nlet TotalsRow =\r\n React.memo (\r\n \"TotalsRow\",\r\n (fun (props: {| SuperContractName: string option\r\n RowExpanded: bool\r\n Rows: CompanyTabRow list\r\n Dispatch: Msg -> unit\r\n Key: string |}) ->\r\n Html.tr [\r\n prop.className \"company-page-table\"\r\n prop.style [if props.RowExpanded then style.backgroundColor expandedColor]\r\n prop.onClick (fun _ -> SuperContractToggled(props.SuperContractName) |> props.Dispatch)\r\n prop.children [\r\n Html.td [\r\n let title =\r\n Html.strong (\r\n sprintf\r\n \"%s%s\"\r\n (props.SuperContractName |> Option.defaultValue \"(No super contract details)\")\r\n (if props.RowExpanded then \" Total\" else \"\"))\r\n\r\n Html.a [\r\n Html.div [\r\n prop.style [ style.display.flex; style.justifyContent.spaceBetween ]\r\n prop.children [\r\n title\r\n Bulma.icon[\r\n prop.style [ style.color \"#b5b5b5\" ]\r\n prop.children [\r\n Fa.i [ if props.RowExpanded then\r\n Fa.Solid.ChevronUp\r\n else\r\n Fa.Solid.ChevronDown ] []\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n yield! totalColumns false props.Rows\r\n ]\r\n ]),\r\n (fun (props: {| SuperContractName: string option\r\n RowExpanded: bool\r\n Rows: CompanyTabRow list\r\n Dispatch: Msg -> unit\r\n Key: string |}) -> $\"TotalsRow-%s{props.Key}\")\r\n )\r\n\r\nlet table (model: CompanyPageModel.Model) dispatch (companyData: CompanyTabRow list) =\r\n let companyDataGrouped =\r\n companyData\r\n |> List.filter (fun item -> item.ContractNumber <> Some \"Overhead\")\r\n |> List.groupBy (fun item -> item.SuperContractName)\r\n |> List.sortOptionsBy true fst \r\n |>> (fun (super, rows) -> super, rows |> List.sortOptionsBy true (fun item -> item.ContractNumber))\r\n\r\n let allRows = companyDataGrouped >>= snd\r\n\r\n let overheadRows =\r\n companyData\r\n |> List.filter (fun item -> item.ContractNumber = Some \"Overhead\")\r\n\r\n Html.div [\r\n prop.children [\r\n Bulma.table [\r\n table.isFullWidth; table.isHoverable\r\n prop.style[style.borderCollapse.separate]\r\n prop.children [\r\n Html.thead [\r\n Html.tr [\r\n prop.style(Styles.sticky())\r\n prop.children [\r\n let th (txt: string) (width: int option) = Html.th [\r\n prop.style [ style.textAlign.right; style.verticalAlign.middle\r\n if width.IsSome then style.width(length.px width.Value) ]\r\n prop.text txt\r\n ]\r\n th \"Job\" None\r\n th \"Revenue\" (Some 100)\r\n th \"Direct Job Cost\" (Some 100)\r\n th \"Gross Margin ($)\" (Some 100)\r\n th \"Gross Margin (%)\" (Some 100)\r\n th \"Original Contracts GP%\" (Some 100)\r\n ]\r\n ]\r\n ]\r\n Html.tbody [\r\n match companyDataGrouped with\r\n | [] ->\r\n yield\r\n Html.tr [\r\n Html.td [\r\n prop.colSpan 5\r\n prop.style [style.textAlign.center; style.padding(length.px 30, length.px 0)]\r\n prop.text \"No entries for selected date range\"\r\n ]\r\n ]\r\n | _ ->\r\n yield!\r\n companyDataGrouped\r\n >>= (fun (superContractName, rows) ->\r\n [ match model.ExpandedSuperContracts\r\n |> Map.tryFind superContractName\r\n with\r\n | None -> ()\r\n | Some _ ->\r\n yield!\r\n rows\r\n |>> (fun row ->\r\n Html.tr [\r\n prop.style [ style.backgroundColor expandedColor ]\r\n prop.children [\r\n Html.td [\r\n Html.div [ \r\n prop.style [style.paddingLeft(length.px 10)\r\n style.display.flex; style.justifyContent.spaceBetween]\r\n prop.children [\r\n Html.a [\r\n prop.onClick(goToUrl)\r\n prop.href(Pages.contractUrl row.ContractId)\r\n \r\n (sprintf \"%s %s\") row.ContractNumber <*> row.ContractDesc\r\n |> Option.defaultValue \"(No contract details)\"\r\n |> prop.text\r\n ] \r\n ]\r\n ]\r\n ]\r\n let td value (format: float -> string) =\r\n Html.td [\r\n prop.style [ style.textAlign.right\r\n if JS.isFinite value && value < 0.0 then style.color.red ]\r\n prop.text(value |> format)\r\n ]\r\n td row.SumOfBilling AsCurrency.withParenthesis\r\n td row.DirectJobCost AsCurrency.withParenthesis\r\n td row.GrossMarginDollar AsCurrency.withParenthesis\r\n td (row.GrossMarginDollar / row.SumOfBilling) AsPercent.withParenthesisOrDef\r\n td ((row.OCRev - row.OCCosts) / row.OCRev) AsPercent.withParenthesisOrDef\r\n ]\r\n ])\r\n\r\n TotalsRow\r\n {| SuperContractName = superContractName\r\n RowExpanded = Map.containsKey superContractName model.ExpandedSuperContracts\r\n Rows = rows\r\n Dispatch = dispatch\r\n Key = sprintf \"CompanyTabTableTotalRow-%s\" (superContractName |> Option.defaultValue \"\") |}\r\n\r\n ])\r\n\r\n if companyDataGrouped.Length > 1 then\r\n yield\r\n Html.tr [\r\n prop.className \"company-tab-total-first-total-row company-tab-total-row\"\r\n prop.children [\r\n Html.td [\r\n Html.strong [\r\n prop.style [ style.color totalColor ]\r\n prop.text \"Company Total\"\r\n ]\r\n ]\r\n yield! totalColumns true allRows\r\n ]\r\n ]\r\n\r\n if not overheadRows.IsEmpty then\r\n let totalGrossMargin =\r\n allRows\r\n |> List.sumBy (fun cost -> cost.GrossMarginDollar)\r\n\r\n let totalOverhead =\r\n overheadRows\r\n |> List.sumBy (fun cost -> cost.DirectJobCost)\r\n\r\n let td value (format: float -> string) =\r\n Html.td [\r\n prop.style[style.textAlign.right]\r\n prop.children [\r\n Html.strong [\r\n prop.style [if totalOverhead < 0.0 then style.color.red else style.color totalColor]\r\n prop.text(value |> format)\r\n ]\r\n ]\r\n ]\r\n \r\n yield\r\n Html.tr [\r\n prop.className \"company-tab-total-row\"\r\n prop.children [\r\n Html.td [\r\n Html.strong [ \r\n prop.style [ style.color totalColor ]\r\n prop.text \"Overhead\"\r\n ]\r\n ]\r\n Html.td [ prop.style[style.textAlign.right] ]\r\n Html.td [ prop.style[style.textAlign.right] ]\r\n \r\n td totalOverhead AsCurrency.withParenthesis\r\n Html.td [ prop.style[style.textAlign.right] ]\r\n Html.td [ prop.style[style.textAlign.right] ]\r\n ]\r\n ]\r\n\r\n yield\r\n Html.tr [\r\n prop.className \"company-tab-total-row\"\r\n prop.children [\r\n Html.td [\r\n Html.strong [\r\n prop.style [ style.color totalColor ]\r\n prop.text \"Net Income/Loss\"\r\n ]\r\n ]\r\n Html.td [ prop.style[style.textAlign.right] ]\r\n Html.td [ prop.style[style.textAlign.right] ]\r\n td (totalGrossMargin - totalOverhead) AsCurrency.withParenthesis\r\n Html.td [ prop.style[style.textAlign.right] ]\r\n Html.td [ prop.style[style.textAlign.right] ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n\r\n\r\nlet content model dispatch =\r\n Html.div [\r\n prop.className \"company-page\"\r\n prop.style [ style.minHeight(length.px 350) ]\r\n prop.children [\r\n searchBar model dispatch\r\n match model.Companies, model.SelectedCompany, model.CompanyTabData with\r\n | Some _, None, Some []\r\n | Some _, None, None ->\r\n Html.text \"Please select a Company\"\r\n |> centeredElem\r\n |> elemInBox\r\n | _ -> loadingMessageInBoxOrContent model.CompanyTabData \"Loading Company data..\" (table model dispatch)\r\n ]\r\n ]\r\n\r\n\r\nlet CompanyPageView =\r\n React.memo (\r\n \"CompanyPageView\",\r\n (fun (props: {| model: Model\r\n dispatch: Msg -> unit |}) ->\r\n Html.div [ \r\n prop.className \"company-page\"\r\n prop.style [\r\n style.marginTop(length.px 25)\r\n style.maxWidth(length.px 1600)\r\n style.marginLeft(length.auto)\r\n style.marginRight(length.auto)\r\n style.paddingBottom(length.px 10)\r\n ]\r\n prop.children [\r\n content props.model props.dispatch\r\n ]\r\n ])\r\n )","module BusinessLogic\r\n\r\nlet getHexColor (r, g, b) =\r\n let get (num: float) =\r\n match num.ToString(\"x\") with\r\n | v when v.Length = 1 -> \"0\" + v\r\n | v -> v\r\n\r\n $\"#%s{get r}%s{get g}%s{get b}\"\r\n\r\nlet getColor (minColorR, minColorG, minColorB) (maxColorR, maxColorG, maxColorB) minNum maxNum (num: float) =\r\n\r\n let percentage = (num - minNum) / (maxNum - minNum)\r\n\r\n let getColorValue minColor maxColor =\r\n minColor + (maxColor - minColor) * percentage\r\n\r\n let r = getColorValue minColorR maxColorR\r\n let g = getColorValue minColorG maxColorG\r\n let b = getColorValue minColorB maxColorB\r\n getHexColor (r, g, b)\r\n\r\nlet gpPercentColor value =\r\n let at8 = 5.0, 156.0, 33.0\r\n let at3 = 89.0, 179.0, 66.0\r\n let at0 = 255.0, 255.0, 0.0\r\n let atMin3 = 255.0, 183.0, 0.0\r\n let atMin8 = 255.0, 0.0, 0.0\r\n let atMin15 = 122.0, 2.0, 2.0\r\n\r\n match value * 100.0 with\r\n | v when v >= 8.0 -> getHexColor at8\r\n | v when v >= 3.0 -> getColor at3 at8 3.0 8.0 v\r\n | v when v >= 0.0 -> getColor at0 at3 0.0 3.0 v\r\n | v when v >= -3.0 -> getColor atMin3 at0 -3.0 0.0 v\r\n | v when v >= -8.0 -> getColor atMin8 atMin3 -8.0 -3.0 v\r\n | v when v >= -15.0 -> getColor atMin15 atMin8 -15.0 -8.0 v\r\n | v when v < -15.0 -> getHexColor atMin15\r\n | _ -> invalidOp \"Should never happen\"","module ContractProfitFadePageView\r\n\r\nopen FSharpPlus\r\nopen Client\r\nopen Fable.React.Props\r\nopen ContractProfitFadePageModel\r\nopen Fulma\r\nopen System\r\nopen Fable.React\r\nopen Model\r\nopen PortalLibs.Client.Components\r\nopen PortalLibs.Client.Util\r\nopen Fable.FontAwesome\r\nopen Shared\r\nopen Fulma.Extensions.Wikiki\r\nopen Fable.Helpers.Moment\r\nopen PortalLibs.Client.Components.Dropdown\r\nopen PortalLibs.Client.Components.NewTableNext\r\nopen Feliz\r\n\r\nlet toContractProfitFade contractWithProfitFade =\r\n { Id = contractWithProfitFade.ContractProfitFadeId\r\n ContractId = contractWithProfitFade.ContractId\r\n ContractAmount = contractWithProfitFade.ContractAmount\r\n CurrentGP = contractWithProfitFade.CurrentGP\r\n GPMinus1 = contractWithProfitFade.GPMinus1\r\n GPMinus2 = contractWithProfitFade.GPMinus2\r\n GPMinus3 = contractWithProfitFade.GPMinus3\r\n GPMinus4 = contractWithProfitFade.GPMinus4\r\n GPLifeDelta = contractWithProfitFade.GPLifeDelta\r\n GP3MthDelta = contractWithProfitFade.GP3MthDelta\r\n ProfitLifeDelta = contractWithProfitFade.ProfitLifeDelta\r\n Profit3MthDelta = contractWithProfitFade.Profit3MthDelta }\r\n\r\n\r\nlet searchBarLevel left right =\r\n Level.level [ Level.Level.Props [\r\n Style [ MarginBottom \"0.5rem\" ]\r\n ] ] [\r\n Level.left [] [ Level.item [] left ]\r\n Level.right [] [\r\n Level.item [ Level.Item.CustomClass \"report-search-col\" ] right\r\n ]\r\n ]\r\n\r\nlet OnlyOneDropdownSpecific =\r\n OnlyOneDropdownGeneric\r\n\r\nlet searchBar model dispatch =\r\n let searchViewChangedCallback =\r\n React.useCallback (SearchboxChanged >> dispatch, [||])\r\n\r\n let activeChangedCallback =\r\n React.useCallback (ActiveChanged >> dispatch, [||])\r\n\r\n searchBarLevel [ div [ Style [ Width \"90px\" ] ] [\r\n OnlyOneDropdownSpecific\r\n {| Title = Name \"Active\"\r\n Items = ItemList [ true; false ]\r\n SelectMode =\r\n SingleSelect(\r\n { UpdateModel = Simple activeChangedCallback\r\n SelectedItem = Item model.Active\r\n LinkUrl = None }\r\n )\r\n DisplayValue =\r\n (fun m ->\r\n match m with\r\n | true -> \"Yes\"\r\n | false -> \"No\")\r\n Searchable = false\r\n Type = Standard\r\n Key = \"ContractProfitFadeContractActive\" |}\r\n ] ] [\r\n SearchboxNew.SearchboxNew\r\n {| Value = model.SearchboxValue\r\n IsLoading = false\r\n IconVisible = false\r\n ValueChanged = searchViewChangedCallback\r\n Key = \"ContractProfitFadePageSearch\"\r\n ShouldFocus = false |}\r\n ]\r\n\r\nlet formatMonth (month: DateTime) = (month |> moment.Invoke).format \"MMM\"\r\n\r\nlet profitFadePartTop percentage color month value =\r\n let positive = percentage > 0.0\r\n let absPercentage = Math.Abs(percentage)\r\n\r\n div [ ClassName(Tooltip.ClassName + \" \" + \"has-tooltip-left\")\r\n Tooltip.dataTooltip (sprintf \"%s: %.1f%%\" (formatMonth month) value)\r\n Style [\r\n Height \"100%\"\r\n FlexGrow \"1\"\r\n Margin \"0 1px\"\r\n ] ] [\r\n div [ Style [\r\n Height(\r\n sprintf\r\n \"%.1f%%\"\r\n (if positive then\r\n 100.0 - absPercentage + 0.1\r\n else\r\n 100.0)\r\n )\r\n ] ] []\r\n div [ Style [\r\n yield BorderRadius \"6px 6px 0 0\"\r\n yield\r\n Height(\r\n if positive then\r\n sprintf \"%.1f%%\" absPercentage\r\n else\r\n \"0\"\r\n )\r\n if positive then\r\n yield BackgroundColor color\r\n ] ] []\r\n ]\r\n\r\nlet profitFadePartBottom percentage color month value =\r\n let positive = percentage > 0.0\r\n let absPercentage = Math.Abs(percentage)\r\n\r\n div [ ClassName(Tooltip.ClassName + \" \" + \"has-tooltip-left\")\r\n Tooltip.dataTooltip (sprintf \"%s: %.1f%%\" (formatMonth month) value)\r\n Style [\r\n Height \"100%\"\r\n FlexGrow \"1\"\r\n Margin \"0 1px\"\r\n\r\n ] ] [\r\n div [ Style [\r\n if not positive then\r\n yield BackgroundColor color\r\n yield BorderRadius \"0 0 6px 6px\"\r\n yield\r\n Height(\r\n if not positive then\r\n sprintf \"%.1f%%\" absPercentage\r\n else\r\n \"0\"\r\n )\r\n ] ] []\r\n div [ Style [\r\n Height(\r\n sprintf\r\n \"%.1f%%\"\r\n (if not positive then\r\n (100.0 - absPercentage)\r\n else\r\n 100.0)\r\n )\r\n ] ] []\r\n ]\r\n\r\nlet profitFade (profitFadeOpt: ContractProfitFade option) =\r\n match profitFadeOpt with\r\n | None -> str \"No profit fade data\"\r\n | Some profitFade ->\r\n let percentage (min: float) max value =\r\n if value = 0.0 then\r\n 0.0\r\n else\r\n let border =\r\n if value < 0.0 then\r\n Math.Abs(min)\r\n else\r\n max\r\n\r\n let roundedBorder =\r\n if border < 15.0 then 15.0\r\n else if border = 0.0 then 0.0\r\n else border\r\n\r\n ((value / roundedBorder) * 100.0)\r\n\r\n let values =\r\n [ profitFade.GPMinus4 * 100.0\r\n profitFade.GPMinus3 * 100.0\r\n profitFade.GPMinus2 * 100.0\r\n profitFade.GPMinus1 * 100.0\r\n profitFade.CurrentGP * 100.0 ]\r\n\r\n let min =\r\n values\r\n |>> fun f -> Math.Round(f, 3)\r\n |> List.min\r\n\r\n let max =\r\n values\r\n |>> fun f -> Math.Round(f, 3)\r\n |> List.max\r\n\r\n let allPos =\r\n values\r\n |> List.exists (fun item -> item < 0.0)\r\n |> not\r\n\r\n let allNeg =\r\n values\r\n |> List.exists (fun item -> item > 0.0)\r\n |> not\r\n\r\n let topPercentage =\r\n if allPos then\r\n 0.9\r\n else if allNeg then\r\n 0.1\r\n else\r\n let minRounded = if min > -15.0 then -15.0 else min\r\n let maxRounded = if max < 15.0 then 15.0 else max\r\n maxRounded / (Math.Abs(minRounded) + maxRounded)\r\n\r\n let topHeight = 100.0 * topPercentage\r\n\r\n\r\n div [ Style [ Height \"35px\" ] ] [\r\n div [ Style [\r\n Height(sprintf \"%.1f%%\" topHeight)\r\n Display DisplayOptions.Flex\r\n ] ] [\r\n profitFadePartTop\r\n (percentage min max profitFade.GPMinus4 * 100.0)\r\n (BusinessLogic.gpPercentColor profitFade.GPMinus4)\r\n (DateTime.Now.AddMonths(-4))\r\n (profitFade.GPMinus4 * 100.0)\r\n profitFadePartTop\r\n (percentage min max profitFade.GPMinus3 * 100.0)\r\n (BusinessLogic.gpPercentColor profitFade.GPMinus3)\r\n (DateTime.Now.AddMonths(-3))\r\n (profitFade.GPMinus3 * 100.0)\r\n profitFadePartTop\r\n (percentage min max profitFade.GPMinus2 * 100.0)\r\n (BusinessLogic.gpPercentColor profitFade.GPMinus2)\r\n (DateTime.Now.AddMonths(-2))\r\n (profitFade.GPMinus2 * 100.0)\r\n profitFadePartTop\r\n (percentage min max profitFade.GPMinus1 * 100.0)\r\n (BusinessLogic.gpPercentColor profitFade.GPMinus1)\r\n (DateTime.Now.AddMonths(-1))\r\n (profitFade.GPMinus1 * 100.0)\r\n profitFadePartTop\r\n (percentage min max profitFade.CurrentGP * 100.0)\r\n (BusinessLogic.gpPercentColor profitFade.CurrentGP)\r\n DateTime.Now\r\n (profitFade.CurrentGP * 100.0)\r\n ]\r\n div [ Style [\r\n Height(sprintf \"%.1f%%\" (100.0 - topHeight))\r\n Display DisplayOptions.Flex\r\n ] ] [\r\n profitFadePartBottom\r\n (percentage min max profitFade.GPMinus4 * 100.0)\r\n (BusinessLogic.gpPercentColor profitFade.GPMinus4)\r\n (DateTime.Now.AddMonths(-4))\r\n (profitFade.GPMinus4 * 100.0)\r\n profitFadePartBottom\r\n (percentage min max profitFade.GPMinus3 * 100.0)\r\n (BusinessLogic.gpPercentColor profitFade.GPMinus3)\r\n (DateTime.Now.AddMonths(-3))\r\n (profitFade.GPMinus3 * 100.0)\r\n profitFadePartBottom\r\n (percentage min max profitFade.GPMinus2 * 100.0)\r\n (BusinessLogic.gpPercentColor profitFade.GPMinus2)\r\n (DateTime.Now.AddMonths(-2))\r\n (profitFade.GPMinus2 * 100.0)\r\n profitFadePartBottom\r\n (percentage min max profitFade.GPMinus1 * 100.0)\r\n (BusinessLogic.gpPercentColor profitFade.GPMinus1)\r\n (DateTime.Now.AddMonths(-1))\r\n (profitFade.GPMinus1 * 100.0)\r\n profitFadePartBottom\r\n (percentage min max profitFade.CurrentGP * 100.0)\r\n (BusinessLogic.gpPercentColor profitFade.CurrentGP)\r\n DateTime.Now\r\n (profitFade.CurrentGP * 100.0)\r\n ]\r\n ]\r\n\r\nlet ProfitFadeGraph =\r\n React.memo (\r\n \"ProfitFadeGraph\",\r\n (fun (props: {| contractWithProfitFade: ContractWithProfitFade\r\n profitFades: Map\r\n Key: string |}) ->\r\n tr [ Style [] ] [\r\n td [ ColSpan 8\r\n Style [\r\n TextAlign TextAlignOptions.Center\r\n Padding \"30px 0\"\r\n ] ] [\r\n loadingMessageOrContent\r\n \"Loading Data...\"\r\n (fun jobProfits ->\r\n div [] [\r\n ContractProfitFade.profitFadeValues (\r\n toContractProfitFade props.contractWithProfitFade\r\n |> Some\r\n )\r\n\r\n ContractProfitFade.ProfitFadeChart\r\n {| profitFadeEntries = jobProfits\r\n Key = $\"FadeChart-%i{props.contractWithProfitFade.ContractId}\" |}\r\n ])\r\n (props.profitFades\r\n |> Map.tryFind props.contractWithProfitFade.ContractId)\r\n ]\r\n ]),\r\n (fun (props: {| contractWithProfitFade: ContractWithProfitFade\r\n profitFades: Map\r\n Key: string |}) -> $\"ProfitFadeGraph-%s{props.Key}\")\r\n )\r\n\r\nlet NewTableNextSpecific =\r\n NewTableNextGeneric\r\n\r\nlet ContractProfitFadeTable =\r\n React.memo (\r\n \"ContractProfitFadeTable\",\r\n (fun (props: {| tableState: NewTableNext.Model\r\n expandedContractProfitFades: ContractId list\r\n profitFades: Map\r\n contracts: ContractWithProfitFade list\r\n dispatch: Msg -> unit |}) ->\r\n let columns =\r\n [ { Header = Text \"Contract\"\r\n Id = Contract\r\n Align = Right\r\n Value = ValueType.Text(fun (fade: ContractWithProfitFade) -> fade.Contract |> Option.defaultValue \"\")\r\n Sortable = ValueOrExternal\r\n Draggable = false\r\n MinWidth = None\r\n Footer = None\r\n InitiallyVisible = true }\r\n { Header = Text \"Name\"\r\n Id = ContractWithProfitFadeField.Name\r\n Align = Left\r\n Value =\r\n ValueType.Custom (fun (fade: ContractWithProfitFade) ->\r\n let expanded =\r\n props.expandedContractProfitFades\r\n |> List.contains fade.ContractId\r\n\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"space-between\"\r\n Width \"100%\"\r\n AlignItems AlignItemsOptions.Center\r\n ] ] [\r\n a [ OnClick goToUrl\r\n Href(Pages.contractUrl fade.ContractId) ] [\r\n fade.Name |> emptyStrTagIfNone\r\n ]\r\n Icon.icon [ Icon.Props [ Style [ Color \"#b5b5b5\" ] ] ] [\r\n Fa.i [ if expanded then\r\n yield Fa.Solid.ChevronUp\r\n else\r\n yield Fa.Solid.ChevronDown ] []\r\n ]\r\n ])\r\n Sortable = ValueOrExternal\r\n Draggable = false\r\n MinWidth = None\r\n Footer = None\r\n InitiallyVisible = true }\r\n { Header = Text \"Profit History\"\r\n Id = ContractWithProfitFadeField.ProfitHistory\r\n Align = Center\r\n Value =\r\n ValueType.Custom (fun (fade: ContractWithProfitFade) ->\r\n div [ Style [\r\n Width \"100%\"\r\n Padding \"3px 5px\"\r\n ] ] [\r\n profitFade (fade |> toContractProfitFade |> Some)\r\n ])\r\n Sortable = ValueOrExternal\r\n Draggable = false\r\n MinWidth = Some 170\r\n Footer = None\r\n InitiallyVisible = true }\r\n { Header = Text \"GP %\"\r\n Id = CurrentGP\r\n Align = Right\r\n Value =\r\n ValueType.Custom (fun (fade: ContractWithProfitFade) ->\r\n div [ Style [\r\n FlexGrow 1\r\n TextAlign TextAlignOptions.Right\r\n Padding \"0.5em 0.75em\"\r\n ] ] [\r\n strong [ Style [\r\n Color(BusinessLogic.gpPercentColor fade.CurrentGP)\r\n ] ] [\r\n sprintf \"%.1f%%\" (fade.CurrentGP * 100.0) |> str\r\n ]\r\n ])\r\n Sortable = ValueOrExternal\r\n Draggable = false\r\n MinWidth = Some 80\r\n Footer = None\r\n InitiallyVisible = true }\r\n { Header = Text \"Contract Amount\"\r\n Id = ContractAmount\r\n Align = Right\r\n Value =\r\n ValueType.Text (fun (fade: ContractWithProfitFade) ->\r\n fade.ContractAmount\r\n |> DisplayNumber.AsCurrency.std)\r\n Sortable = ValueOrExternal\r\n Draggable = false\r\n MinWidth = Some 50\r\n Footer = None\r\n InitiallyVisible = true }\r\n { Header = Text \"Profit delta last 3 months\"\r\n Id = Profit3MthDelta\r\n Align = Right\r\n Value =\r\n ValueType.Text (fun (fade: ContractWithProfitFade) ->\r\n fade.Profit3MthDelta\r\n |> DisplayNumber.AsCurrency.std)\r\n Sortable = ValueOrExternal\r\n Draggable = false\r\n MinWidth = Some 140\r\n Footer = None\r\n InitiallyVisible = true } ]\r\n\r\n div [ ClassName \"profit-fade-page-table\"\r\n Style [ FontSize \"0.9rem\" ] ] [\r\n NewTableNextSpecific\r\n {| Config =\r\n { Model = props.tableState\r\n Columns = columns\r\n Items = props.contracts\r\n ItemKey = fun item -> item.ContractId.ToString()\r\n SubRows =\r\n Some (fun item ->\r\n let expanded =\r\n props.expandedContractProfitFades\r\n |> List.contains item.ContractId\r\n\r\n [ if expanded then\r\n ProfitFadeGraph\r\n {| contractWithProfitFade = item\r\n profitFades = props.profitFades\r\n Key = $\"ProfitGraphRow-%i{item.ContractId}\" |} ])\r\n ColumnSelection = false\r\n Selection = [], false\r\n Paging =\r\n Paged\r\n { HidePaginationUnder1Page = true\r\n PageSizeOptions = None }\r\n Key = \"ContractProfitFadePageTable\"\r\n Dispatch = TableStateChanged >> props.dispatch\r\n DataLoad = OnDemand\r\n StickyHeader = None\r\n RowClick =\r\n Some (fun fade ->\r\n ContractProfitFadeExpansionToggled fade.ContractId\r\n |> props.dispatch) } |}\r\n ])\r\n )\r\n\r\nlet content model dispatch (contracts: ContractWithProfitFade list) =\r\n div [ ClassName \"profit-fade-page\" ] [\r\n searchBar model dispatch\r\n ContractProfitFadeTable\r\n {| tableState = model.TableState\r\n expandedContractProfitFades = model.ExpandedContractProfitFades\r\n profitFades = model.ContractProfitFades\r\n contracts = contracts\r\n dispatch = dispatch |}\r\n ]\r\n\r\nlet ContractProfitFadePageView =\r\n React.memo (\r\n \"ContractProfitFadePageView\",\r\n fun (props: {| model: ContractProfitFadePageModel.Model\r\n dispatch: Msg -> unit |}) ->\r\n div [ ClassName \"profit-fade-page\"\r\n Style [\r\n MarginTop \"25px\"\r\n MaxWidth \"1200px\"\r\n MarginLeft \"auto\"\r\n MarginRight \"auto\"\r\n PaddingBottom \"10px\"\r\n ] ] [\r\n loadingMessageBoxOrContent \"Loading Report...\" (content props.model props.dispatch) props.model.Contracts\r\n ]\r\n )\r\n","namespace Fulma\r\n\r\nopen Fulma\r\nopen Fable.React\r\nopen Fable.React.Props\r\n\r\n[]\r\nmodule Message =\r\n\r\n type Option =\r\n | Color of IColor\r\n | Size of ISize\r\n | Props of IHTMLProp list\r\n | CustomClass of string\r\n | Modifiers of Modifier.IModifier list\r\n\r\n /// Generate
      \r\n let message options children =\r\n let parseOptions (result : GenericOptions) option =\r\n match option with\r\n | Color color -> ofColor color |> result.AddClass\r\n | Size size -> ofSize size |> result.AddClass\r\n | Props props -> result.AddProps props\r\n | CustomClass customClass -> result.AddClass customClass\r\n | Modifiers modifiers -> result.AddModifiers modifiers\r\n\r\n GenericOptions.Parse(options, parseOptions, \"message\").ToReactElement(article, children)\r\n\r\n /// Generate
      \r\n let header (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"message-header\").ToReactElement(div, children)\r\n\r\n /// Generate
      \r\n let body (options: GenericOption list) children =\r\n GenericOptions.Parse(options, parseOptions, \"message-body\").ToReactElement(div, children)\r\n","module HomePageView\r\n\r\nopen FSharpPlus\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen PortalLibs.Shared\r\nopen Fulma\r\nopen Model\r\nopen PortalLibs.Client.Components\r\nopen PortalLibs.Client.Components.Progress\r\nopen Shared\r\nopen Fable.FontAwesome\r\nopen PortalLibs.Client.Util\r\nopen System\r\nopen ContractPageModel\r\nopen HomePageModel\r\nopen Feliz\r\n\r\nlet primaryColor = \"black\"\r\n\r\nlet searchView value dispatch =\r\n let searchViewChanged =\r\n React.useCallback (SearchboxChanged >> dispatch, [||])\r\n\r\n div [ Style [ PaddingTop \"10px\" ] ] [\r\n SearchboxNew.SearchboxNew\r\n {| Value = value\r\n IsLoading = false\r\n IconVisible = false\r\n ValueChanged = searchViewChanged\r\n Key = \"HomePageSearch\"\r\n ShouldFocus = false |}\r\n ]\r\n\r\nlet card icon text value =\r\n div [ Class \"contract-card\"\r\n Style [\r\n Display DisplayOptions.Flex\r\n BoxShadow \"0 0.25rem 0.125rem 0 rgba(0,0,0,0.1)\"\r\n BorderRadius \".5rem\"\r\n BackgroundColor \"white\"\r\n AlignItems AlignItemsOptions.Stretch\r\n MarginRight \"15px\"\r\n MarginBottom \"10px\"\r\n Width \"100%\"\r\n MaxWidth \"373px\"\r\n ] ] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n AlignItems AlignItemsOptions.Center\r\n ] ] [\r\n Icon.icon [ Icon.Size ISize.IsLarge\r\n Icon.Props [\r\n Style [ Color primaryColor ]\r\n ] ] [\r\n Fa.i [ icon; (Fa.Size Fa.FaLarge) ] []\r\n ]\r\n ]\r\n div [ Class \"contract-card-text\"\r\n Style [\r\n BorderColor primaryColor\r\n BorderWidth \"2px\"\r\n Padding \"0\"\r\n Display DisplayOptions.Flex\r\n AlignItems AlignItemsOptions.Center\r\n //Width \"230px\"\r\n FlexGrow \"1\"\r\n ] ] [\r\n text\r\n ]\r\n div [ Style [\r\n Padding \"0 15px\"\r\n Display DisplayOptions.Flex\r\n AlignItems AlignItemsOptions.Center\r\n JustifyContent \"center\"\r\n ]\r\n ] [\r\n value\r\n ]\r\n ]\r\n\r\nlet loadingCard icon text valueOpt =\r\n card\r\n icon\r\n text\r\n (match valueOpt with\r\n | None ->\r\n Icon.icon [ Icon.Size ISize.IsLarge ] [\r\n Fa.i [ Fa.Solid.Spinner\r\n Fa.Pulse\r\n (Fa.Size Fa.Fa2x) ] []\r\n ]\r\n | Some value -> value)\r\n\r\n\r\n\r\n\r\nlet jobView model appSettings aiInfos isDemo dispatch (contract: Contract) =\r\n div [ Style [\r\n MarginTop \"10px\"\r\n MaxWidth \"810px\"\r\n MarginLeft \"auto\"\r\n MarginRight \"auto\"\r\n ] ] [\r\n Fulma.Message.message [ Message.Color(\r\n if List.contains contract.Id model.VisitedContracts then\r\n IColor.IsGreyLighter\r\n else\r\n IColor.IsLink\r\n ) ] [\r\n Message.header [] [\r\n a [ OnClick (fun _ ->\r\n (contract.Id, Tab.Overview)\r\n |> ContractClicked\r\n |> dispatch) ] [\r\n $\"%s{contract.Number |> Option.emptyStrIfNone} - %s{contract.Description |> Option.emptyStrIfNone}\"\r\n |> str\r\n ]\r\n ]\r\n Message.body [ Props [\r\n Style [\r\n PaddingRight \"10px\"\r\n BackgroundColor \"#f0f0f5\"\r\n ]\r\n ] ] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexWrap \"wrap\"\r\n AlignItems AlignItemsOptions.Center\r\n Color \"black\"\r\n PaddingRight \"0\"\r\n ] ] [\r\n if isDemo then\r\n match Map.tryFind contract.Id aiInfos with\r\n | None -> ()\r\n | Some aiInfo ->\r\n yield\r\n card\r\n Fa.Solid.Robot\r\n (a [ OnClick (fun _ ->\r\n (contract.Id, Tab.AI)\r\n |> ContractClicked\r\n |> dispatch) ] [\r\n str \"AI Success Rate\"\r\n ])\r\n (CircleProgress(\r\n {| percent = (aiInfo.SuccessRate * 100.0)\r\n border = 50.0\r\n key = $\"AI-%i{contract.Id}\" |}\r\n ))\r\n yield\r\n card\r\n Fa.Solid.Percentage\r\n (a [ OnClick (fun _ ->\r\n (contract.Id, Tab.Overview)\r\n |> ContractClicked\r\n |> dispatch) ] [\r\n str \"Gross Profit Pct\"\r\n ])\r\n (CircleProgress(\r\n {| percent = contract.GrossProfitPct * 100.0\r\n border = 0.0\r\n key = $\"GP-%i{contract.Id}\" |}\r\n ))\r\n\r\n if appSettings.HomeSettings.BillingAndCostGPPercent\r\n && Option.isSome contract.BCGPPercent then\r\n yield\r\n card\r\n Fa.Solid.Percentage\r\n (a [ OnClick (fun _ ->\r\n (contract.Id, Tab.Overview)\r\n |> ContractClicked\r\n |> dispatch) ] [\r\n str \"Billing & Cost GP Pct\"\r\n ])\r\n (CircleProgress(\r\n {| percent =\r\n (contract.BCGPPercent |> Option.defaultValue 0.0)\r\n * 100.0\r\n border = 0.0\r\n key = $\"BCGP-%i{contract.Id}\" |}\r\n ))\r\n yield\r\n loadingCard\r\n Fa.Solid.Percentage\r\n (a [ OnClick (fun _ ->\r\n (contract.Id, Tab.ContractProfitFadeTab)\r\n |> ContractClicked\r\n |> dispatch) ] [\r\n str \"Profit History\"\r\n ])\r\n (Map.tryFind contract.Id model.ContractProfitFades\r\n |>> (fun profitFade ->\r\n div [ Style [ Width \"140px\" ] ] [\r\n ContractProfitFadePageView.profitFade profitFade\r\n ]))\r\n if contract.UnapprovedInvoices > 0 then\r\n yield\r\n card\r\n Fa.Solid.FileInvoiceDollar\r\n (a [ OnClick (fun _ ->\r\n (contract.Id, Tab.Overview)\r\n |> ContractClicked\r\n |> dispatch) ] [\r\n str \"Unapproved invoices\"\r\n ])\r\n (span [ Style [ Color \"red\"; FontWeight \"bold\" ] ] [\r\n contract.UnapprovedInvoices |> string |> str\r\n ])\r\n match model.ContractHomePageBuckets\r\n |> Map.tryFind contract.Id\r\n with\r\n | None -> ()\r\n | Some bucket ->\r\n if bucket.Value > 0.0 then\r\n yield\r\n card\r\n Fa.Solid.HandHoldingUsd\r\n (a [ OnClick (fun _ ->\r\n (contract.Id, Tab.ARAndCashFlow)\r\n |> ContractClicked\r\n |> dispatch) ] [\r\n str bucket.Label\r\n ])\r\n (span [ Style [ FontWeight \"bold\" ] ] [\r\n bucket.Value\r\n |> formatNumber\r\n false\r\n FormatCurrencyNegativeValues.MinusSign\r\n true\r\n FormatCurrencyRounding.AllZero\r\n |> string\r\n |> str\r\n ])\r\n if contract.PendingChangeOrders > 0 then\r\n yield\r\n card\r\n Fa.Solid.Clock\r\n (a [ OnClick (fun _ ->\r\n (contract.Id, Tab.ChangeOrders)\r\n |> ContractClicked\r\n |> dispatch) ] [\r\n str \"Pending Change Orders\"\r\n ])\r\n (span [ Style [ Color \"red\"; FontWeight \"bold\" ] ] [\r\n contract.PendingChangeOrders |> string |> str\r\n ])\r\n yield\r\n card\r\n Fa.Solid.DollarSign\r\n (a [ OnClick (fun _ ->\r\n (contract.Id, Tab.CostAndBilling)\r\n |> ContractClicked\r\n |> dispatch) ] [\r\n str \"Overall contract cash flow\"\r\n ])\r\n (span [ Style [\r\n if contract.CFNetCashFlow < 0.0 then\r\n yield Color \"red\"\r\n if contract.CFNetCashFlow > 0.0 then\r\n yield Color \"green\"\r\n yield FontWeight \"bold\"\r\n ] ] [\r\n contract.CFNetCashFlow\r\n |> formatNumber true MinusSign true AllZero\r\n |> str\r\n ])\r\n if CostAndBilling.isOver30Days contract then\r\n let dateToDays (date: DateTime) = (DateTime.Now - date).TotalDays |> int\r\n\r\n let title, days =\r\n match contract.BillingLastRequestedDate, contract.LastBillDate with\r\n | None, None -> \"\", 0\r\n | Some date, None -> \"Last Requested\", dateToDays date\r\n | None, Some date -> \"Last Billed\", dateToDays date\r\n | Some requested, Some billed ->\r\n if billed >= requested then\r\n \"Last Billed\", dateToDays billed\r\n else\r\n \"Last Requested\", dateToDays requested\r\n\r\n yield\r\n card\r\n Fa.Solid.CalendarAlt\r\n (a [ OnClick (fun _ ->\r\n (contract.Id, Tab.CostAndBilling)\r\n |> ContractClicked\r\n |> dispatch) ] [\r\n str title\r\n ])\r\n (span [ Style [\r\n Color \"red\"\r\n FontWeight \"bold\"\r\n TextAlign TextAlignOptions.Center\r\n ] ] [\r\n $\"%i{days} days\" |> str\r\n ])\r\n if contract.ActualLaborHoursToDate <> 0.0 then\r\n if appSettings.HomeSettings.AverageLaborRate then\r\n yield\r\n card\r\n Fa.Solid.HardHat\r\n (a [ OnClick (fun _ ->\r\n (contract.Id, Tab.AverageRate)\r\n |> ContractClicked\r\n |> dispatch) ] [\r\n str \"Average Labor Rate\"\r\n ])\r\n (span [ Style [ yield FontWeight \"bold\" ] ] [\r\n contract.ActualLaborCostToDate\r\n / contract.ActualLaborHoursToDate\r\n |> formatNumber false MinusSign true FormatCurrencyRounding.Under1\r\n |> str\r\n ])\r\n\r\n if appSettings.AverageLaborRate_RemainingHours\r\n && contract.ActualLaborCostToDate\r\n / contract.ActualLaborHoursToDate\r\n <> 0.0 then\r\n yield\r\n card\r\n Fa.Solid.Clock\r\n (a [ OnClick (fun _ ->\r\n (contract.Id, Tab.AverageRate)\r\n |> ContractClicked\r\n |> dispatch) ] [\r\n str \"Remaining Hours\"\r\n ])\r\n (span [ Style [ yield FontWeight \"bold\" ] ] [\r\n (contract.LaborCostToComplete\r\n / (contract.ActualLaborCostToDate\r\n / contract.ActualLaborHoursToDate))\r\n |> sprintf \"%.0f\"\r\n |> str\r\n ])\r\n ]\r\n ]\r\n ]\r\n ]\r\n\r\nlet companyView\r\n model\r\n featureFlags\r\n aiInfos\r\n isDemo\r\n isSuperUser\r\n (coName, contracts: Contract list)\r\n isFirst\r\n dispatch\r\n =\r\n let heading =\r\n Heading.h5 [ Heading.Props [\r\n Style [\r\n MarginBottom \"0\"\r\n Color \"gray\"\r\n MarginLeft \"-10px\"\r\n ]\r\n ] ] [\r\n Icon.icon [ Icon.Size ISize.IsLarge ] [\r\n Fa.i [ Fa.Solid.Building\r\n (Fa.Size Fa.FaLarge) ] []\r\n ]\r\n str coName\r\n ]\r\n\r\n let contractsView contracts =\r\n contracts\r\n |> List.sortBy (fun (contract: Contract) -> contract.Number |> Option.emptyStrIfNone)\r\n |>> jobView model featureFlags aiInfos isDemo dispatch\r\n\r\n div [] [\r\n if not isFirst then yield hr []\r\n yield\r\n (if isFirst then\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n FlexDirection \"row-reverse\"\r\n FlexWrap \"wrap\"\r\n JustifyContent \"center\"\r\n AlignItems AlignItemsOptions.Center\r\n ] ] [\r\n searchView model.SearchValue dispatch\r\n div [ Style [\r\n FlexGrow \"1\"\r\n PaddingTop \"10px\"\r\n ] ] [\r\n heading\r\n ]\r\n ]\r\n else\r\n heading)\r\n if isSuperUser then\r\n yield!\r\n (contracts\r\n |> List.groupBy (fun contract -> contract.ProjectManager)\r\n |> List.sortBy fst\r\n |>> (fun (pm, pmContracts: Contract list) ->\r\n div [ Style [ PaddingBottom \"15px\" ] ] [\r\n yield\r\n Heading.h6 [ Heading.Props [\r\n Style [\r\n MarginBottom \"-10px\"\r\n Color \"blue\"\r\n MarginLeft \"0px\"\r\n MarginTop \"5px\"\r\n ]\r\n ] ] [\r\n Icon.icon [ Icon.Size ISize.IsLarge ] [\r\n Fa.i [ Fa.Solid.User ] []\r\n ]\r\n pm |> emptyStrTagIfNone\r\n ]\r\n yield! contractsView pmContracts\r\n ]))\r\n else\r\n yield! contractsView contracts\r\n ]\r\n\r\nlet content model featureFlags aiInfos isDemo isSuperUser dispatch contracts =\r\n let contractsByCompany =\r\n contracts\r\n |> Map.toList\r\n |>> snd\r\n |> List.filter (fun (contract: Contract) ->\r\n (match model.SearchValue |> Option.noneIfEmptyStrOptTrim with\r\n | None -> true\r\n | Some txt ->\r\n (sprintf\r\n \"%s %s %s\"\r\n (contract.Number |> Option.emptyStrIfNone)\r\n (contract.Description |> Option.emptyStrIfNone)\r\n (if isSuperUser then\r\n (contract.ProjectManager |> Option.emptyStrIfNone)\r\n else\r\n \"\"))\r\n .ToLower()\r\n .Contains(txt.ToLower().Trim()))\r\n && contract.IsActive)\r\n |> List.groupBy (fun j -> $\"%i{j.Co} - %s{j.CompanyName |> Option.emptyStrIfNone}\")\r\n |> Seq.sortBy fst\r\n\r\n div [] [\r\n if (Seq.isEmpty contractsByCompany) then\r\n yield\r\n div [] [\r\n div [ Style [\r\n Display DisplayOptions.Flex\r\n JustifyContent \"flex-end\"\r\n PaddingTop \"6px\"\r\n ] ] [\r\n searchView model.SearchValue dispatch\r\n ]\r\n div [ Style [\r\n TextAlign TextAlignOptions.Center\r\n Padding \"50px 0\"\r\n ] ] [\r\n str (\r\n if isSuperUser then\r\n \"You are not following any active contracts yet, please go to the Contracts tab and select some!\"\r\n else\r\n \"There are no active contracts assigned to your user, please contact the administrator.\"\r\n )\r\n ]\r\n ]\r\n else\r\n yield!\r\n (contractsByCompany\r\n |> Seq.mapi (fun i m -> companyView model featureFlags aiInfos isDemo isSuperUser m (i = 0) dispatch))\r\n ]\r\n\r\n\r\nlet HomePageView =\r\n React.memo (\r\n \"HomePageView\",\r\n fun (props: {| Model: HomePageModel.Model\r\n ApplicationSettings: ApplicationSettings\r\n Contracts: Map option\r\n AiInfos: Map\r\n IsDemo: bool\r\n IsSuperUser: bool\r\n Dispatch: Msg -> unit |}) ->\r\n div [ Style [\r\n MarginTop \"25px\"\r\n MaxWidth \"900px\"\r\n MarginLeft \"auto\"\r\n MarginRight \"auto\"\r\n ] ] [\r\n loadingMessageBoxOrContent\r\n \"Loading Contracts...\"\r\n (content props.Model props.ApplicationSettings props.AiInfos props.IsDemo props.IsSuperUser props.Dispatch)\r\n props.Contracts\r\n ]\r\n )","module Client.Client\r\n\r\nopen FSharpPlus\r\nopen Elmish\r\nopen Fable.React\r\nopen Fable.React.Props\r\nopen Elmish.Bridge\r\nopen PortalLibs.Client.Auth\r\nopen Shared\r\nopen Fulma\r\nopen PortalLibs.Client.Util\r\nopen Thoth.Elmish\r\nopen Pages\r\nopen Fable.FontAwesome\r\nopen PortalLibs.Client\r\nopen Branding\r\nopen PortalLibs.Shared.NewTable\r\nopen PortalLibs.Shared\r\nopen Model\r\nopen ClientModel\r\nopen Elmish.Navigation\r\nopen AI\r\nopen System\r\nopen Feliz\r\nopen Client.ContractPage\r\n\r\nlet restoreScrollCmd scroll page =\r\n Cmd.OfFunc.perform\r\n scrollTo\r\n (scroll\r\n |> Map.tryFind page\r\n |> Option.defaultValue 0.0)\r\n (fun _ -> NoOp)\r\n\r\nlet urlUpdate (result: Page option) (oldModel: Model) : Model * Cmd =\r\n bodyScrollEnable ()\r\n\r\n let model =\r\n { oldModel with\r\n Scroll =\r\n Map.add\r\n oldModel.Page\r\n (match oldModel.Page with\r\n | Page.Home -> getWindowScrollValue ()\r\n | Page.Contracts ->\r\n ContractsPageModel.getScrollValue ()\r\n |> Option.defaultValue 0.0\r\n | Page.Contract _ -> getWindowScrollValue ()\r\n | Page.Company -> getWindowScrollValue ()\r\n | Page.ContractProfitFadeReport ->\r\n ContractProfitFadePageModel.getScrollValue ()\r\n |> Option.defaultValue 0.0)\r\n oldModel.Scroll }\r\n\r\n let newModel, cmd =\r\n match result with\r\n | None\r\n | Some Page.Home -> { model with Page = Page.Home }, restoreScrollCmd model.Scroll Page.Home\r\n | Some (Page.Contract id) ->\r\n let contractIdParsed =\r\n match Int64.TryParse(id) with\r\n | true, parsed ->\r\n match model.Connection with\r\n | Authed -> parsed |> RSContractDetails |> Bridge.Send\r\n | _ -> ()\r\n\r\n Some parsed\r\n | _ -> None\r\n\r\n match model.Contracts, contractIdParsed with\r\n | Some contracts, Some parsedId ->\r\n if not <| Map.containsKey id contracts then\r\n parsedId |> RSContractInfo |> Bridge.Send\r\n | _ -> ()\r\n\r\n { model with\r\n Page = Page.Contract id\r\n ContractPageModel = { model.ContractPageModel with SelectedContractId = contractIdParsed } },\r\n Cmd.none\r\n | Some Page.Contracts ->\r\n ContractsPageModel.requestData model.ContractsPageModel\r\n\r\n { model with Page = Page.Contracts },\r\n Cmd.OfFunc.perform\r\n ContractsPageModel.restoreScrollPos\r\n (model.Scroll\r\n |> Map.tryFind Page.Contracts\r\n |> Option.defaultValue 0.0)\r\n (fun _ -> NoOp)\r\n | Some Page.Company ->\r\n CompanyPageModel.requestData model.CompanyPageModel\r\n\r\n { model with Page = Page.Company },\r\n Cmd.OfFunc.perform\r\n CompanyPageModel.restoreScrollPos\r\n (model.Scroll\r\n |> Map.tryFind Page.Company\r\n |> Option.defaultValue 0.0)\r\n (fun _ -> NoOp)\r\n | Some Page.ContractProfitFadeReport ->\r\n { model with Page = Page.ContractProfitFadeReport },\r\n Cmd.batch [\r\n Cmd.OfFunc.perform\r\n ContractProfitFadePageModel.restoreScrollPos\r\n (model.Scroll\r\n |> Map.tryFind Page.ContractProfitFadeReport\r\n |> Option.defaultValue 0.0)\r\n (fun _ -> NoOp)\r\n if Option.isNone model.ContractProfitFadePageModel.Contracts then\r\n Cmd.ofMsg (ContractProfitFadePageMsg(ContractProfitFadePageModel.Msg.ExecuteSearch Search))\r\n ]\r\n\r\n { newModel with BurgerOpen = false }, cmd\r\n\r\nlet isDemo settings =\r\n match settings with\r\n | None -> false\r\n | Some s -> s.IsDemo\r\n\r\nlet isSuperUser settings =\r\n match settings with\r\n | None -> false\r\n | Some s -> s.IsSuperUser\r\n\r\nlet init result : Model * Cmd =\r\n let authModel, authCmd = init ()\r\n let homePageModel, _homeCmd = HomePageModel.init ()\r\n let jobPageModel, _jobCmd = ContractPageModel.init ()\r\n let contractsPageModel, contractsCmd = ContractsPageModel.init ()\r\n let profitFadePageModel, _profitFadePageCmd = ContractProfitFadePageModel.init ()\r\n let companyPageModel, companyCmd = CompanyPageModel.init ()\r\n\r\n let initialModel =\r\n { Connection = Connection.Initial\r\n BurgerOpen = false\r\n HomePageModel = homePageModel\r\n ContractPageModel = jobPageModel\r\n ContractsPageModel = contractsPageModel\r\n ContractProfitFadePageModel = profitFadePageModel\r\n CompanyPageModel = companyPageModel\r\n Auth = authModel\r\n Contracts = None\r\n ContractAiInfos = Map.empty\r\n Debouncer = Debouncer.create ()\r\n Page = Page.Home\r\n Scroll = Map.empty\r\n Settings = None }\r\n\r\n let model, cmd = urlUpdate result initialModel\r\n\r\n model,\r\n Cmd.batch [\r\n cmd\r\n Cmd.map AuthMsg authCmd\r\n Cmd.map ContractsPageMsg contractsCmd\r\n Cmd.map CompanyPageMsg companyCmd\r\n ]\r\n\r\nlet update (msg: ClientMsg) (model: Model) : Model * Cmd =\r\n match msg, model.Page with\r\n | DebouncerSelfMsg debouncerMsg, _ ->\r\n let debouncerModel, debouncerCmd =\r\n Debouncer.update debouncerMsg model.Debouncer\r\n\r\n { model with Debouncer = debouncerModel }, debouncerCmd\r\n | ConnectionLost, _ -> { model with Connection = Disconnected }, Cmd.none\r\n | ToggleBurger, _ -> { model with BurgerOpen = not model.BurgerOpen }, Cmd.none\r\n | HomePageMsg homePageMsg, _ ->\r\n match homePageMsg with\r\n | HomePageModel.Msg.ContractClicked (contractId, tab) ->\r\n let debouncerModel, debouncerCmd =\r\n model.Debouncer\r\n |> Debouncer.bounce\r\n (TimeSpan.FromMinutes 30.0)\r\n $\"ContractVisited_%i{contractId}\"\r\n (HomePageMsg(HomePageModel.Msg.RemoveVisitedContract contractId))\r\n\r\n { model with\r\n ContractPageModel = { model.ContractPageModel with SelectedTab = tab }\r\n HomePageModel =\r\n { model.HomePageModel with VisitedContracts = contractId :: model.HomePageModel.VisitedContracts }\r\n Debouncer = debouncerModel },\r\n Cmd.batch [\r\n Cmd.map DebouncerSelfMsg debouncerCmd\r\n contractId\r\n |> string\r\n |> Page.Contract\r\n |> toPath\r\n |> Navigation.newUrl\r\n ]\r\n | _ ->\r\n let newModel, cmd =\r\n HomePageModel.update homePageMsg model.HomePageModel\r\n\r\n { model with HomePageModel = newModel }, Cmd.map HomePageMsg cmd\r\n | ContractPageMsg jobPageMsg, Page.Contract _ ->\r\n let newModel, cmd =\r\n ContractPageModel.update jobPageMsg model.ContractPageModel model.Contracts model.ContractAiInfos\r\n\r\n { model with ContractPageModel = newModel }, Cmd.map ContractPageMsg cmd\r\n | ContractsPageMsg contractsPageMsg, Page.Contracts ->\r\n let newModel, cmd =\r\n ContractsPageModel.update contractsPageMsg model.ContractsPageModel\r\n\r\n { model with ContractsPageModel = newModel }, Cmd.map ContractsPageMsg cmd\r\n | CompanyPageMsg contractsPageMsg, Page.Company ->\r\n let newModel, cmd =\r\n CompanyPageModel.update contractsPageMsg model.CompanyPageModel\r\n\r\n { model with CompanyPageModel = newModel }, Cmd.map CompanyPageMsg cmd\r\n | ContractProfitFadePageMsg profitFadePageMsg, Page.ContractProfitFadeReport ->\r\n let newModel, cmd =\r\n ContractProfitFadePageModel.update profitFadePageMsg model.ContractProfitFadePageModel\r\n\r\n { model with ContractProfitFadePageModel = newModel }, Cmd.map ContractProfitFadePageMsg cmd\r\n | AuthMsg authMsg, _ ->\r\n let authModel, cmd, externalMsg = update authMsg model.Auth\r\n\r\n let newModel, newCmd =\r\n match externalMsg with\r\n | ExternalMsg.NoOp -> model, Cmd.none\r\n | ExternalMsg.LoggedIn ->\r\n model,\r\n (if model.Connection = Connected\r\n || model.Connection = ReConnected then\r\n match authModel.User with\r\n | User.LoggedIn user -> Cmd.bridgeSend (RSAuth(user, Initial))\r\n | _ -> Cmd.none\r\n else\r\n Cmd.none)\r\n\r\n { newModel with Auth = authModel },\r\n Cmd.batch [\r\n Cmd.map AuthMsg cmd\r\n newCmd\r\n ]\r\n | RC rc, _ ->\r\n match rc with\r\n | RCBridgeConnected ->\r\n match model.Connection with\r\n | Connection.Initial ->\r\n match model.Auth.User with\r\n | User.LoggedIn user -> RSAuth(user, Initial) |> Bridge.Send\r\n | _ -> ()\r\n\r\n { model with Connection = Connected }, Cmd.none\r\n | Disconnected\r\n | ConnectionIssuesDetected\r\n | Authed\r\n | ReConnected\r\n | Connected ->\r\n match model.Auth.User with\r\n | User.LoggedIn user -> RSAuth(user, ReAuthentication) |> Bridge.Send\r\n | _ -> ()\r\n\r\n { model with Connection = ReConnected }, Cmd.none\r\n | RCNotAuthedReq -> model, Msg.LogIn |> AuthMsg |> Cmd.ofMsg\r\n | RCAuthed settings ->\r\n Bridge.Send RemoteServerMsg.RSInitializationData\r\n\r\n match model.ContractPageModel.SelectedContractId with\r\n | Some id ->\r\n id |> RSContractInfo |> Bridge.Send\r\n id |> RSContractDetails |> Bridge.Send\r\n | None -> ()\r\n\r\n match model.Page with\r\n | Page.Contracts -> ContractsPageModel.requestData model.ContractsPageModel\r\n | Page.Company -> CompanyPageModel.requestData model.CompanyPageModel\r\n | _ -> ()\r\n\r\n { model with\r\n Connection = Authed\r\n Settings = Some settings },\r\n match model.Page with\r\n | Page.ContractProfitFadeReport ->\r\n if Option.isNone model.ContractProfitFadePageModel.Contracts then\r\n Cmd.ofMsg (ContractProfitFadePageMsg(ContractProfitFadePageModel.Msg.ExecuteSearch Search))\r\n else\r\n Cmd.none\r\n | _ -> Cmd.none\r\n\r\n | RCAuthFailed -> model, Msg.LogIn |> AuthMsg |> Cmd.ofMsg\r\n | RCContract contract ->\r\n { model with\r\n Contracts =\r\n match model.Contracts with\r\n | None ->\r\n [ contract.Id.ToString(), contract ]\r\n |> Map.ofList\r\n |> Some\r\n | Some contracts ->\r\n Map.add (contract.Id.ToString()) contract contracts\r\n |> Some\r\n ContractAiInfos =\r\n if isDemo model.Settings then\r\n let aiInfo = randomAiInfo contract\r\n Map.add aiInfo.ContractId aiInfo model.ContractAiInfos\r\n else\r\n Map.empty },\r\n Cmd.none\r\n | RCContracts contracts ->\r\n { model with\r\n Contracts =\r\n contracts\r\n |>> fun contract -> contract.Id.ToString(), contract\r\n |> Map.ofList\r\n |> Some\r\n ContractAiInfos =\r\n if isDemo model.Settings then\r\n contracts\r\n |>> randomAiInfo\r\n |>> fun (info: ContractAiInfo) -> (info.ContractId, info)\r\n |> Map.ofList\r\n else\r\n Map.empty },\r\n Cmd.none\r\n | RCPurchaseOrders (contractId, orders) ->\r\n model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.PurchaseOrders(contractId, orders)))\r\n | RCARBuckets (contractId, buckets) ->\r\n model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.ARBuckets(contractId, buckets)))\r\n | RCMassPurchaseOrders orders ->\r\n model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.MassPurchaseOrders(orders)))\r\n | RCContractProfitFade (contractId, profitFade) ->\r\n model, Cmd.ofMsg (HomePageMsg(HomePageModel.Msg.ContractProfitFade(contractId, profitFade)))\r\n | RCContractProfitFades profitFades ->\r\n model, Cmd.ofMsg (HomePageMsg(HomePageModel.Msg.ContractProfitFades(profitFades)))\r\n | RCContractHomePageBuckets buckets ->\r\n model, Cmd.ofMsg (HomePageMsg(HomePageModel.Msg.ContractHomePageBuckets(buckets)))\r\n | RCChangeOrdersLoaded (contractId, orders) ->\r\n model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.ChangeOrderHeadersLoaded(contractId, orders)))\r\n | RCChangeOrderItemsLoaded (orderId, items) ->\r\n model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.ChangeOrderItemsLoaded(orderId, items)))\r\n | RCChangeOrderLinesLoaded (itemId, lines) ->\r\n model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.ChangeOrderItemLinesLoaded(itemId, lines)))\r\n | RCJobHistories (contractId, histories) ->\r\n model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.JobHistories(contractId, histories)))\r\n | RCJobForecasts (contractId, forecasts) ->\r\n model, Cmd.ofMsg(ContractPageMsg(ContractPageModel.Msg.JobForecasts(contractId, forecasts)))\r\n | RCJobSchedule (contractId, schedule) ->\r\n model, Cmd.ofMsg(ContractPageMsg(ContractPageModel.Msg.JobSchedule(contractId, schedule)))\r\n | RCJobCosts (contractId, costs) ->\r\n model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.JobCosts({| ContractId = contractId; Jobs = costs |})))\r\n | RCContractProfitFadeAndProfits (contractId, fade, profitList) ->\r\n model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.ContractProfitFade(contractId, fade, profitList)))\r\n | RCContractProfits (contractId, profitList) ->\r\n model,\r\n Cmd.ofMsg (\r\n ContractProfitFadePageMsg(ContractProfitFadePageModel.Msg.ContractProfitFades(contractId, profitList))\r\n )\r\n | RCJobCostSubs costs -> model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.JobCostSubs costs))\r\n | RCJobCostDetails (costId, details) ->\r\n model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.JobCostDetails(costId, details)))\r\n | RCJobCostDetailsCount (costId, count) ->\r\n model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.JobCostDetailsCount(costId, count)))\r\n | RCJobCostDetailsTotal (costId, field, count) ->\r\n model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.JobCostDetailsTotal(costId, field, count)))\r\n | RCJobCostDetailAttachments (costId, attachments) ->\r\n model, Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.JobCostDetailAttachments(costId, attachments)))\r\n | RCJobCostDetailAttachmentContent (attachmentId, content) ->\r\n model,\r\n Cmd.ofMsg (ContractPageMsg(ContractPageModel.Msg.JobCostDetailAttachmentContent(attachmentId, content)))\r\n | RCSuperUserContracts contracts ->\r\n model, Cmd.ofMsg (ContractsPageMsg(ContractsPageModel.Msg.Contracts contracts))\r\n | RCContractWithProfitFades contracts ->\r\n model, Cmd.ofMsg (ContractProfitFadePageMsg(ContractProfitFadePageModel.Msg.Contracts contracts))\r\n | RCContractWithProfitFadesCount count ->\r\n model, Cmd.ofMsg (ContractProfitFadePageMsg(ContractProfitFadePageModel.Msg.ContractsCount(count)))\r\n | RCCompanyTabData data -> model, Cmd.ofMsg (CompanyPageMsg(CompanyPageModel.Msg.CompanyTabData(data)))\r\n | RCCompanyTabCompanies data -> model, Cmd.ofMsg (CompanyPageMsg(CompanyPageModel.Msg.Companies(data)))\r\n | RCNotification notification -> model, Notifications.showNotif notification\r\n | _, _ -> model, Cmd.none\r\n\r\n\r\nlet isPageActive model page = page = model.Page\r\n\r\nlet widerContainerClass page =\r\n match page with\r\n | Page.Contracts\r\n | Page.Contract _\r\n | Page.ContractProfitFadeReport -> \"wider-container \"\r\n | _ -> \" \"\r\n\r\nlet fullHeightContainer page =\r\n match page with\r\n | Page.Contracts\r\n | Page.ContractProfitFadeReport -> \"fullheight-container \"\r\n | _ -> \" \"\r\n\r\nlet footerContainer =\r\n Container.container [] [\r\n Content.content [ Content.Props [\r\n Style [\r\n TextAlign TextAlignOptions.Center\r\n ]\r\n ] ] [\r\n p [] [\r\n strong [] [ str brandedFooter ]\r\n $\" %i{DateTime.Now.Year} created by SelectView \"\r\n |> str\r\n ]\r\n ]\r\n ]\r\n\r\nlet navMenu model isBurgerOpen authModel dispatch =\r\n Navbar.menu [ Navbar.Menu.IsActive isBurgerOpen ] [\r\n Navbar.Start.div [] [\r\n if isSuperUser model.Settings then\r\n yield\r\n Navbar.Item.a [ Navbar.Item.Option.IsTab\r\n Navbar.Item.Option.IsActive(isPageActive model Page.Contracts)\r\n Navbar.Item.Props [\r\n OnClick goToUrl\r\n Href(toPath Page.Contracts)\r\n ] ] [\r\n str \"Contracts\"\r\n ]\r\n\r\n yield\r\n Navbar.Item.a [ Navbar.Item.Option.IsTab\r\n Navbar.Item.Option.IsActive(isPageActive model Page.ContractProfitFadeReport)\r\n Navbar.Item.Props [\r\n OnClick goToUrl\r\n Href(toPath Page.ContractProfitFadeReport)\r\n ] ] [\r\n str \"Profit\"\r\n ]\r\n\r\n if isSuperUser model.Settings\r\n && model.Settings\r\n |>> fun s -> s.ApplicationSettings.CompanyTab\r\n |> Option.defaultValue ApplicationSettings.Default.CompanyTab\r\n && model.Settings\r\n |>> fun settings -> settings.CanViewCompanyTab\r\n |> Option.defaultValue false then\r\n yield\r\n Navbar.Item.a [ Navbar.Item.Option.IsTab\r\n Navbar.Item.Option.IsActive(isPageActive model Page.Company)\r\n Navbar.Item.Props [\r\n OnClick goToUrl\r\n Href(toPath Page.Company)\r\n ] ] [\r\n str \"Company\"\r\n ]\r\n\r\n ]\r\n Navbar.End.div [] [\r\n Navbar.Item.div [ Navbar.Item.HasDropdown\r\n Navbar.Item.IsHoverable ] [\r\n Navbar.Link.div [] [\r\n yield\r\n Icon.icon [ Icon.Size ISize.IsLarge ] [\r\n Fa.i [ Fa.Solid.User\r\n //Pulse Animation\r\n //Icon 2x times larger\r\n (Fa.Size Fa.FaLarge) ] []\r\n ]\r\n match authModel.User with\r\n | User.LoggedIn (user: UserData) -> yield str user.Username\r\n | _ ->\r\n yield\r\n Icon.icon [] [\r\n Fa.i [ Fa.Solid.Spinner\r\n //Pulse Animation\r\n Fa.Pulse ] []\r\n ]\r\n ]\r\n Navbar.Dropdown.div [] [\r\n Navbar.Item.a [ Navbar.Item.Props [\r\n OnClick(fun _ -> Msg.LogOut |> AuthMsg |> dispatch)\r\n ] ] [\r\n str \"Logout\"\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]\r\n\r\nlet navBrand isBurgerOpen dispatch =\r\n Navbar.Brand.div [] [\r\n Navbar.Item.a [ Navbar.Item.Props [\r\n Style [\r\n MarginLeft \"20px\"\r\n MarginRight \"20px\"\r\n Padding \"0\"\r\n ]\r\n ] ] [\r\n img [\r\n Src brandedLogo\r\n Alt \"Logo\"\r\n Style [ MaxHeight \"3.5rem\" ]\r\n ]\r\n ]\r\n Navbar.Item.a [ Navbar.Item.Props [\r\n OnClick goToUrl\r\n Href(toPath Page.Home)\r\n ] ] [\r\n str \"Home\"\r\n ]\r\n\r\n Navbar.burger [ Navbar.Burger.CustomClass(if isBurgerOpen then \"is-active\" else \"\")\r\n Navbar.Burger.Props [\r\n OnClick(fun _ -> dispatch ToggleBurger)\r\n ] ] [\r\n span [] []\r\n span [] []\r\n span [] []\r\n ]\r\n ]\r\n\r\n[]\r\nlet LoggedInContent (props: {| Model: Model; Dispatch: ClientMsg -> unit |}) =\r\n let homeDispatchCallback =\r\n Feliz.React.useCallback ((HomePageMsg >> props.Dispatch), [||])\r\n\r\n let contractPageDispatchCallback =\r\n Feliz.React.useCallback ((ContractPageMsg >> props.Dispatch), [||])\r\n\r\n let contractsPageDispatchCallback =\r\n Feliz.React.useCallback ((ContractsPageMsg >> props.Dispatch), [||])\r\n\r\n let companyPageDispatchCallback =\r\n Feliz.React.useCallback ((CompanyPageMsg >> props.Dispatch), [||])\r\n\r\n let contractProfitFadePageDispatchCallback =\r\n Feliz.React.useCallback ((ContractProfitFadePageMsg >> props.Dispatch), [||])\r\n\r\n match props.Model.Page with\r\n | Page.Home ->\r\n HomePageView.HomePageView(\r\n {| Model = props.Model.HomePageModel\r\n ApplicationSettings =\r\n props.Model.Settings\r\n |>> fun s -> s.ApplicationSettings\r\n |> Option.defaultValue ApplicationSettings.Default\r\n Contracts = props.Model.Contracts\r\n AiInfos = props.Model.ContractAiInfos\r\n IsDemo = isDemo props.Model.Settings\r\n IsSuperUser = isSuperUser props.Model.Settings\r\n Dispatch = homeDispatchCallback |}\r\n )\r\n | Page.Contract _ ->\r\n ContractPageView.ContractPageView(\r\n {| Model = props.Model.ContractPageModel\r\n ApplicationSettings =\r\n props.Model.Settings\r\n |>> fun s -> s.ApplicationSettings\r\n |> Option.defaultValue ApplicationSettings.Default\r\n Contracts = props.Model.Contracts\r\n AiInfos = props.Model.ContractAiInfos\r\n IsDemo = isDemo props.Model.Settings\r\n IsSuperUser = isSuperUser props.Model.Settings\r\n Dispatch = contractPageDispatchCallback |}\r\n )\r\n | Page.Contracts ->\r\n ContractsPageView.ContractsPageView\r\n {| model = props.Model.ContractsPageModel\r\n dispatch = contractsPageDispatchCallback |}\r\n | Page.Company ->\r\n CompanyPageView.CompanyPageView\r\n {| model = props.Model.CompanyPageModel\r\n dispatch = companyPageDispatchCallback |}\r\n | Page.ContractProfitFadeReport ->\r\n ContractProfitFadePageView.ContractProfitFadePageView(\r\n {| model = props.Model.ContractProfitFadePageModel\r\n dispatch = contractProfitFadePageDispatchCallback |}\r\n )\r\n\r\n[]\r\nlet ViewComponent\r\n (props: {| Model: Model\r\n Dispatch: ClientMsg -> unit |})\r\n =\r\n let dispatch =\r\n Feliz.React.useCallback (props.Dispatch, [||])\r\n\r\n let isBurgerOpen = props.Model.BurgerOpen\r\n\r\n div [ Style [\r\n Background \"#EFF3F4\"\r\n FontFamily \"'Open Sans', serif\"\r\n ] ] [\r\n Navbar.navbar [] [\r\n Container.container [ Container.Option.CustomClass(widerContainerClass props.Model.Page) ] [\r\n navBrand isBurgerOpen dispatch\r\n navMenu props.Model isBurgerOpen props.Model.Auth dispatch\r\n ]\r\n ]\r\n Container.container [ Container.Option.IsFluid; Container.Option.CustomClass(\r\n widerContainerClass props.Model.Page\r\n + fullHeightContainer props.Model.Page) ] [\r\n div [ ClassName \"main-container\" ] [\r\n match props.Model.Auth.User with\r\n | User.LoggedIn _ ->\r\n yield\r\n LoggedInContent\r\n {| Model = props.Model\r\n Dispatch = dispatch |}\r\n | User.LoggedOut ->\r\n yield\r\n div [ Style [ MarginTop \"50px\" ] ] [\r\n loadingWithMessage \"Logging out...\"\r\n ]\r\n | User.LoggingIn ->\r\n yield\r\n div [ Style [ MarginTop \"50px\" ] ] [\r\n loadingWithMessage \"Authenticating...\"\r\n ]\r\n | User.AuthException exn ->\r\n yield\r\n centeredElem (\r\n div [ Style [ MarginTop \"50px\" ] ] [\r\n str \"Authentication exception occured:\"\r\n br []\r\n $\"{exn}\" |> str\r\n ]\r\n )\r\n ]\r\n ]\r\n footer [ ClassName \"footer\"\r\n Style [ BackgroundColor \"#f5f5f5\" ] ] [\r\n footerContainer\r\n ]\r\n ]\r\n\r\nlet view model dispatch =\r\n ViewComponent {| Model = model; Dispatch = dispatch |}","module ContractProfitFadePageModel\r\n\r\nopen Elmish\r\nopen Elmish.Bridge\r\nopen Model\r\nopen PortalLibs.Client.Components\r\nopen Shared\r\nopen PortalLibs.Client.Util\r\nopen PortalLibs.Shared.NewTable\r\nopen PortalLibs.Shared\r\n\r\ntype Model =\r\n { SearchboxValue: string option\r\n Contracts: ContractWithProfitFade list option\r\n TableState: NewTableNext.Model\r\n ExpandedContractProfitFades: ContractId list\r\n ContractProfitFades: Map\r\n Active: bool option }\r\n\r\ntype Msg =\r\n | Contracts of ContractWithProfitFade list\r\n | ContractsCount of int64\r\n | SearchboxChanged of string option\r\n | TableStateChanged of NewTableNext.Msg\r\n | ContractProfitFadeExpansionToggled of ContractId\r\n | ContractProfitFades of ContractId * ContractProfit list\r\n | ActiveChanged of bool option\r\n | ExecuteSearch of SearchType\r\n\r\nlet init () =\r\n { SearchboxValue = None\r\n Contracts = None\r\n TableState = { NewTableNext.init None with Sort = (Profit3MthDelta |> Desc |> Some) }\r\n ExpandedContractProfitFades = []\r\n ContractProfitFades = Map.empty\r\n Active = Some true },\r\n Cmd.none\r\n\r\n\r\nlet update msg model =\r\n match msg with\r\n | ExecuteSearch searchType ->\r\n let tableState = model.TableState\r\n\r\n let searchParams =\r\n { Query =\r\n [ match model.SearchboxValue\r\n |> Option.noneIfEmptyStrOptTrim\r\n with\r\n | None -> ()\r\n | Some text -> { Field = Name; Query = Wildcard(text) }\r\n match model.Active with\r\n | None -> ()\r\n | Some boolVal ->\r\n { Field = IsActive\r\n Query = Equals(boolVal |> string) } ]\r\n Page = tableState.Page\r\n PageSize = tableState.PageSize\r\n Sort = tableState.Sort\r\n PageCount = false\r\n Totals = [] }\r\n\r\n match searchType with\r\n | Search ->\r\n let searchParamsPageReset =\r\n { searchParams with\r\n Page = 0\r\n PageCount = true }\r\n\r\n searchParamsPageReset\r\n |> RSContractWithProfitFades\r\n |> Bridge.Send\r\n\r\n { model with TableState = (tableState |> NewTableNext.resetModel) }, Cmd.none\r\n | TableStateChange ->\r\n searchParams\r\n |> RSContractWithProfitFades\r\n |> Bridge.Send\r\n\r\n model, Cmd.none\r\n | ContractsCount count -> { model with TableState = { model.TableState with TotalItems = count } }, Cmd.none\r\n | SearchboxChanged searchValue -> { model with SearchboxValue = searchValue }, Cmd.ofMsg (ExecuteSearch Search)\r\n | Contracts contracts ->\r\n { model with\r\n Contracts = Some contracts\r\n TableState = { model.TableState with IsLoading = false } },\r\n Cmd.none\r\n | TableStateChanged msg ->\r\n let newModel, newCmd, externalMsg =\r\n NewTableNext.update msg model.TableState\r\n\r\n { model with TableState = newModel },\r\n Cmd.batch [\r\n Cmd.map TableStateChanged newCmd\r\n match externalMsg with\r\n | NewTableNext.PagingOrSortChanged _ -> Cmd.ofMsg (ExecuteSearch TableStateChange)\r\n | _ -> Cmd.none\r\n ]\r\n | ContractProfitFadeExpansionToggled jobId ->\r\n let contracts =\r\n if List.contains jobId model.ExpandedContractProfitFades then\r\n model.ExpandedContractProfitFades\r\n |> List.filter (fun j -> j <> jobId)\r\n else\r\n if not (Map.containsKey jobId model.ContractProfitFades) then\r\n RSContractProfits jobId |> Bridge.Send\r\n\r\n scrollIntoView (sprintf \"NewTable-ContractProfitFadePage-Row-%i\" jobId)\r\n jobId :: model.ExpandedContractProfitFades\r\n\r\n { model with ExpandedContractProfitFades = contracts }, Cmd.none\r\n | ContractProfitFades (jobId, contracts) ->\r\n scrollIntoView (sprintf \"NewTable-ContractProfitFadePage-Row-%i\" jobId)\r\n\r\n { model with ContractProfitFades = Map.add jobId contracts model.ContractProfitFades }, Cmd.none\r\n | ActiveChanged v -> { model with Active = v }, Cmd.ofMsg (ExecuteSearch Search)\r\n\r\nlet getScrollValue () = getTableScrollPos ()\r\n\r\nlet restoreScrollPos pos = scrollTableToPos pos\r\n","module HomePageModel\r\n\r\nopen Shared\r\nopen Model\r\nopen Elmish\r\nopen Elmish.Bridge\r\nopen ContractPageModel\r\n\r\ntype Model =\r\n { SearchValue: string option\r\n ContractProfitFades: Map\r\n ContractHomePageBuckets: Map\r\n VisitedContracts: ContractId list }\r\n\r\ntype Msg =\r\n | SearchboxChanged of string option\r\n | ContractProfitFade of ContractId * ContractProfitFade option\r\n | ContractProfitFades of (ContractId * ContractProfitFade option) list\r\n | ContractHomePageBuckets of (ContractId * ContractARBucket) list\r\n | ContractClicked of ContractId * Tab\r\n | RemoveVisitedContract of ContractId\r\n\r\nlet init () =\r\n { SearchValue = None\r\n ContractProfitFades = Map.empty\r\n ContractHomePageBuckets = Map.empty\r\n VisitedContracts = [] },\r\n Cmd.none\r\n\r\nlet update msg model =\r\n match msg with\r\n | SearchboxChanged value -> { model with SearchValue = value }, Cmd.none\r\n | ContractProfitFade (contractId, profitFade) ->\r\n { model with ContractProfitFades = Map.add contractId profitFade model.ContractProfitFades }, Cmd.none\r\n | ContractProfitFades profitFades ->\r\n { model with\r\n ContractProfitFades =\r\n List.fold\r\n (fun fades (contractId, fade) -> Map.add contractId fade fades)\r\n model.ContractProfitFades\r\n profitFades },\r\n Cmd.none\r\n | ContractHomePageBuckets buckets ->\r\n { model with\r\n ContractHomePageBuckets =\r\n List.fold\r\n (fun buckets (contractId, bucket) -> Map.add contractId bucket buckets)\r\n model.ContractHomePageBuckets\r\n buckets },\r\n Cmd.none\r\n | ContractClicked _ -> model, Cmd.none\r\n | RemoveVisitedContract contractId ->\r\n { model with\r\n VisitedContracts =\r\n model.VisitedContracts\r\n |> List.filter (fun id -> id <> contractId) },\r\n Cmd.none\r\n","namespace Elmish.React\n\n[]\nmodule Helpers =\n open Fable.React.Props\n open Fable.Core.JsInterop\n\n /// `Ref` callback that sets the value of an input textbox after DOM element is created.\n /// Can be used instead of `DefaultValue` and `Value` props to override input box value.\n let inline valueOrDefault value =\n Ref <| (fun e -> if e |> isNull |> not && !!e?value <> !!value then e?value <- !!value)\n\n[]\nmodule Program =\n\n module Internal =\n\n open Fable.React\n open Browser\n open Elmish\n\n let withReactBatchedUsing lazyView2With placeholderId (program:Program<_,_,_,_>) =\n let mutable lastRequest = None\n let setState model dispatch =\n match lastRequest with\n | Some r -> window.cancelAnimationFrame r\n | _ -> ()\n\n lastRequest <- Some (window.requestAnimationFrame (fun _ ->\n ReactDom.render(\n lazyView2With (fun x y -> obj.ReferenceEquals(x,y)) (Program.view program) model dispatch,\n document.getElementById placeholderId\n )))\n\n program\n |> Program.withSetState setState\n\n let withReactSynchronousUsing lazyView2With placeholderId (program:Elmish.Program<_,_,_,_>) =\n let setState model dispatch =\n ReactDom.render(\n lazyView2With (fun x y -> obj.ReferenceEquals(x,y)) (Program.view program) model dispatch,\n document.getElementById placeholderId\n )\n\n program\n |> Program.withSetState setState\n\n let withReactHydrateUsing lazyView2With placeholderId (program:Elmish.Program<_,_,_,_>) =\n let setState model dispatch =\n ReactDom.hydrate(\n lazyView2With (fun x y -> obj.ReferenceEquals(x,y)) (Program.view program) model dispatch,\n document.getElementById placeholderId\n )\n\n program\n |> Program.withSetState setState\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 let withReactBatched placeholderId (program:Elmish.Program<_,_,_,_>) =\n Internal.withReactBatchedUsing lazyView2With placeholderId program\n\n /// Renders React root component inside html element identified by placeholderId.\n /// New renders are triggered immediately after an update.\n let withReactSynchronous placeholderId (program:Elmish.Program<_,_,_,_>) =\n Internal.withReactSynchronousUsing lazyView2With placeholderId program\n\n []\n let withReact placeholderId (program:Elmish.Program<_,_,_,_>) =\n Internal.withReactBatchedUsing lazyView2With placeholderId program\n\n []\n let withReactUnoptimized placeholderId (program:Elmish.Program<_,_,_,_>) =\n Internal.withReactSynchronousUsing lazyView2With placeholderId program\n\n /// Renders React root component inside html element identified by placeholderId using `React.hydrate`.\n let withReactHydrate placeholderId (program:Elmish.Program<_,_,_,_>) =\n Internal.withReactHydrateUsing lazyView2With placeholderId program\n","module Client.App\r\n\r\nopen Elmish\r\nopen Elmish.React\r\nopen Elmish.Bridge\r\nopen ClientModel\r\nopen Shared\r\nopen Client\r\nopen Elmish.Navigation\r\n\r\n#if DEBUG\r\nopen Elmish.Debug\r\nopen Elmish.HMR\r\n#endif\r\n\r\n\r\nProgram.mkProgram init update view\r\n|> Program.withBridgeConfig (\r\n Bridge.endpoint Remote.socketPath\r\n |> Bridge.withMapping RC\r\n |> Bridge.withWhenDown ConnectionLost\r\n)\r\n|> Program.toNavigable Pages.urlParser urlUpdate\r\n#if DEBUG\r\n|> Program.withConsoleTrace\r\n#endif\r\n|> Program.withReactBatched \"elmish-app\"\r\n#if DEBUG\r\n|> Program.withDebugger\r\n#endif\r\n|> Program.run\r\n","namespace Shared\r\n\r\nopen Model\r\nopen PortalLibs.Shared.NewTable\r\nopen PortalLibs.Shared\r\nopen PortalLibs.Shared.Notifications\r\nopen System\r\nopen Shared.Models\r\n\r\n\r\ntype ContractId = int64\r\ntype HeaderId = int64\r\ntype ItemId = int64\r\ntype JobCostId = int64\r\ntype JobCostDetailId = int64\r\ntype JobCostAttachmentId = int64\r\ntype UserId = System.Guid\r\ntype AttachmentId = int64\r\ntype VistaAttachmentId = int64\r\ntype PurchaseOrderId = { ContractId: int64; Number: string }\r\n\r\ntype Settings =\r\n { IsDemo: bool\r\n IsSuperUser: bool\r\n CanViewCompanyTab: bool\r\n ApplicationSettings: ApplicationSettings }\r\n\r\ntype Query =\r\n | Wildcard of string\r\n | Equals of string\r\n\r\ntype FieldQuery<'T> = { Field: 'T; Query: Query }\r\n\r\ntype PagedQuery<'T> =\r\n { Query: FieldQuery<'T> list\r\n Page: int\r\n PageSize: int\r\n Sort: Sort<'T> option\r\n PageCount: bool\r\n Totals: 'T list }\r\n\r\ntype JobCostAttachmentContent =\r\n | VistaNotAvailable\r\n | Downloaded\r\n\r\ntype JobPhase = { Code: string; Desc: string }\r\ntype JobPhaseCosts = {\r\n Phase: JobPhase\r\n Costs: JobCost list \r\n}\r\n\r\ntype RemoteClientMsg =\r\n | RCBridgeConnected\r\n | RCAuthed of Settings\r\n | RCNotAuthedReq\r\n | RCAuthFailed\r\n | RCContracts of List\r\n | RCContract of Contract\r\n | RCPurchaseOrders of ContractId * PurchaseOrder list\r\n | RCARBuckets of ContractId * ContractARBucket list\r\n | RCMassPurchaseOrders of (ContractId * PurchaseOrder list) list\r\n | RCChangeOrdersLoaded of ContractId * ChangeOrderHeader list\r\n | RCChangeOrderItemsLoaded of HeaderId * ChangeOrderItem list\r\n | RCChangeOrderLinesLoaded of ItemId * ChangeOrderLine list\r\n | RCJobHistories of ContractId * JobHistory list\r\n | RCJobForecasts of ContractId * JobForecast list\r\n | RCJobSchedule of ContractId * JobSchedule option\r\n | RCJobCosts of ContractId * JobPhaseCosts list\r\n | RCContractProfitFade of ContractId * ContractProfitFade option\r\n | RCContractProfitFades of (ContractId * ContractProfitFade option) list\r\n | RCContractHomePageBuckets of (ContractId * ContractARBucket) list\r\n | RCContractProfitFadeAndProfits of ContractId * ContractProfitFade option * ContractProfit list\r\n | RCContractProfits of ContractId * ContractProfit list\r\n | RCJobCostSubs of List\r\n | RCJobCostDetails of JobCostId * JobCostDetail list\r\n | RCJobCostDetailsCount of JobCostId * int64\r\n | RCJobCostDetailsTotal of JobCostId * JobCostDetailField * float\r\n | RCSuperUserContracts of ContractShort list\r\n | RCContractWithProfitFades of ContractWithProfitFade list\r\n | RCContractWithProfitFadesCount of int64\r\n | RCJobCostDetailAttachments of JobCostId * Map\r\n | RCJobCostDetailAttachmentContent of JobCostAttachmentId * JobCostAttachmentContent\r\n | RCCompanyTabData of List\r\n | RCCompanyTabCompanies of List\r\n | RCNotification of NotificationMsg\r\n\r\ntype RemoteServerMsg =\r\n | RSAuth of UserData * AuthenticationType\r\n | RSInitializationData\r\n | RSContractDetails of ContractId\r\n | RSContractInfo of ContractId\r\n | RSContractBillingRequested of ContractId\r\n | RSSendPurchaseOrderRequest of PurchaseOrderRequest\r\n | RSSuperUserContracts of {| Active: bool |}\r\n | RSContractWithProfitFades of PagedQuery\r\n | RSContractProfits of ContractId\r\n | RSJobCostDetails of JobCostId * PagedQuery\r\n | RSContractFollowChanged of ContractShort\r\n | RSContractInterestedPartiesChanged of ContractShort\r\n | RSJobCostAttachment of JobCostAttachmentId\r\n | RSContractFollowMassChanged of (ContractId list * bool)\r\n | RSCompanyTabQuery of (int * DateTime * DateTime) option\r\n | RSCompanyTabCompanies\r\n\r\n\r\nmodule Remote =\r\n let socketPath = \"/socket/appBridge\"","var map = {\n\t\"./af\": 7801,\n\t\"./af.js\": 7801,\n\t\"./ar\": 4055,\n\t\"./ar-dz\": 843,\n\t\"./ar-dz.js\": 843,\n\t\"./ar-kw\": 1678,\n\t\"./ar-kw.js\": 1678,\n\t\"./ar-ly\": 2312,\n\t\"./ar-ly.js\": 2312,\n\t\"./ar-ma\": 5257,\n\t\"./ar-ma.js\": 5257,\n\t\"./ar-sa\": 7884,\n\t\"./ar-sa.js\": 7884,\n\t\"./ar-tn\": 7596,\n\t\"./ar-tn.js\": 7596,\n\t\"./ar.js\": 4055,\n\t\"./az\": 3023,\n\t\"./az.js\": 3023,\n\t\"./be\": 8008,\n\t\"./be.js\": 8008,\n\t\"./bg\": 8659,\n\t\"./bg.js\": 8659,\n\t\"./bm\": 1130,\n\t\"./bm.js\": 1130,\n\t\"./bn\": 1214,\n\t\"./bn-bd\": 7242,\n\t\"./bn-bd.js\": 7242,\n\t\"./bn.js\": 1214,\n\t\"./bo\": 5419,\n\t\"./bo.js\": 5419,\n\t\"./br\": 6198,\n\t\"./br.js\": 6198,\n\t\"./bs\": 7822,\n\t\"./bs.js\": 7822,\n\t\"./ca\": 5673,\n\t\"./ca.js\": 5673,\n\t\"./cs\": 8363,\n\t\"./cs.js\": 8363,\n\t\"./cv\": 3862,\n\t\"./cv.js\": 3862,\n\t\"./cy\": 5552,\n\t\"./cy.js\": 5552,\n\t\"./da\": 4814,\n\t\"./da.js\": 4814,\n\t\"./de\": 6656,\n\t\"./de-at\": 8040,\n\t\"./de-at.js\": 8040,\n\t\"./de-ch\": 2241,\n\t\"./de-ch.js\": 2241,\n\t\"./de.js\": 6656,\n\t\"./dv\": 7246,\n\t\"./dv.js\": 7246,\n\t\"./el\": 688,\n\t\"./el.js\": 688,\n\t\"./en-au\": 234,\n\t\"./en-au.js\": 234,\n\t\"./en-ca\": 2190,\n\t\"./en-ca.js\": 2190,\n\t\"./en-gb\": 1613,\n\t\"./en-gb.js\": 1613,\n\t\"./en-ie\": 8514,\n\t\"./en-ie.js\": 8514,\n\t\"./en-il\": 6387,\n\t\"./en-il.js\": 6387,\n\t\"./en-in\": 5712,\n\t\"./en-in.js\": 5712,\n\t\"./en-nz\": 3947,\n\t\"./en-nz.js\": 3947,\n\t\"./en-sg\": 9612,\n\t\"./en-sg.js\": 9612,\n\t\"./eo\": 9595,\n\t\"./eo.js\": 9595,\n\t\"./es\": 4664,\n\t\"./es-do\": 1800,\n\t\"./es-do.js\": 1800,\n\t\"./es-mx\": 1747,\n\t\"./es-mx.js\": 1747,\n\t\"./es-us\": 6287,\n\t\"./es-us.js\": 6287,\n\t\"./es.js\": 4664,\n\t\"./et\": 6460,\n\t\"./et.js\": 6460,\n\t\"./eu\": 4772,\n\t\"./eu.js\": 4772,\n\t\"./fa\": 6073,\n\t\"./fa.js\": 6073,\n\t\"./fi\": 3186,\n\t\"./fi.js\": 3186,\n\t\"./fil\": 7660,\n\t\"./fil.js\": 7660,\n\t\"./fo\": 9469,\n\t\"./fo.js\": 9469,\n\t\"./fr\": 7142,\n\t\"./fr-ca\": 3881,\n\t\"./fr-ca.js\": 3881,\n\t\"./fr-ch\": 7138,\n\t\"./fr-ch.js\": 7138,\n\t\"./fr.js\": 7142,\n\t\"./fy\": 2789,\n\t\"./fy.js\": 2789,\n\t\"./ga\": 6121,\n\t\"./ga.js\": 6121,\n\t\"./gd\": 4884,\n\t\"./gd.js\": 4884,\n\t\"./gl\": 3297,\n\t\"./gl.js\": 3297,\n\t\"./gom-deva\": 1498,\n\t\"./gom-deva.js\": 1498,\n\t\"./gom-latn\": 8528,\n\t\"./gom-latn.js\": 8528,\n\t\"./gu\": 5167,\n\t\"./gu.js\": 5167,\n\t\"./he\": 4658,\n\t\"./he.js\": 4658,\n\t\"./hi\": 8784,\n\t\"./hi.js\": 8784,\n\t\"./hr\": 842,\n\t\"./hr.js\": 842,\n\t\"./hu\": 2977,\n\t\"./hu.js\": 2977,\n\t\"./hy-am\": 7199,\n\t\"./hy-am.js\": 7199,\n\t\"./id\": 8818,\n\t\"./id.js\": 8818,\n\t\"./is\": 8010,\n\t\"./is.js\": 8010,\n\t\"./it\": 4966,\n\t\"./it-ch\": 5217,\n\t\"./it-ch.js\": 5217,\n\t\"./it.js\": 4966,\n\t\"./ja\": 5426,\n\t\"./ja.js\": 5426,\n\t\"./jv\": 308,\n\t\"./jv.js\": 308,\n\t\"./ka\": 703,\n\t\"./ka.js\": 703,\n\t\"./kk\": 4157,\n\t\"./kk.js\": 4157,\n\t\"./km\": 3981,\n\t\"./km.js\": 3981,\n\t\"./kn\": 8829,\n\t\"./kn.js\": 8829,\n\t\"./ko\": 9794,\n\t\"./ko.js\": 9794,\n\t\"./ku\": 1542,\n\t\"./ku.js\": 1542,\n\t\"./ky\": 5595,\n\t\"./ky.js\": 5595,\n\t\"./lb\": 6865,\n\t\"./lb.js\": 6865,\n\t\"./lo\": 2773,\n\t\"./lo.js\": 2773,\n\t\"./lt\": 3552,\n\t\"./lt.js\": 3552,\n\t\"./lv\": 5235,\n\t\"./lv.js\": 5235,\n\t\"./me\": 2144,\n\t\"./me.js\": 2144,\n\t\"./mi\": 2182,\n\t\"./mi.js\": 2182,\n\t\"./mk\": 4425,\n\t\"./mk.js\": 4425,\n\t\"./ml\": 178,\n\t\"./ml.js\": 178,\n\t\"./mn\": 9558,\n\t\"./mn.js\": 9558,\n\t\"./mr\": 6085,\n\t\"./mr.js\": 6085,\n\t\"./ms\": 3249,\n\t\"./ms-my\": 4921,\n\t\"./ms-my.js\": 4921,\n\t\"./ms.js\": 3249,\n\t\"./mt\": 5838,\n\t\"./mt.js\": 5838,\n\t\"./my\": 4697,\n\t\"./my.js\": 4697,\n\t\"./nb\": 8466,\n\t\"./nb.js\": 8466,\n\t\"./ne\": 8314,\n\t\"./ne.js\": 8314,\n\t\"./nl\": 957,\n\t\"./nl-be\": 353,\n\t\"./nl-be.js\": 353,\n\t\"./nl.js\": 957,\n\t\"./nn\": 7607,\n\t\"./nn.js\": 7607,\n\t\"./oc-lnc\": 3047,\n\t\"./oc-lnc.js\": 3047,\n\t\"./pa-in\": 3345,\n\t\"./pa-in.js\": 3345,\n\t\"./pl\": 6171,\n\t\"./pl.js\": 6171,\n\t\"./pt\": 5398,\n\t\"./pt-br\": 31,\n\t\"./pt-br.js\": 31,\n\t\"./pt.js\": 5398,\n\t\"./ro\": 4224,\n\t\"./ro.js\": 4224,\n\t\"./ru\": 3018,\n\t\"./ru.js\": 3018,\n\t\"./sd\": 6134,\n\t\"./sd.js\": 6134,\n\t\"./se\": 3326,\n\t\"./se.js\": 3326,\n\t\"./si\": 3358,\n\t\"./si.js\": 3358,\n\t\"./sk\": 2028,\n\t\"./sk.js\": 2028,\n\t\"./sl\": 6866,\n\t\"./sl.js\": 6866,\n\t\"./sq\": 5099,\n\t\"./sq.js\": 5099,\n\t\"./sr\": 9500,\n\t\"./sr-cyrl\": 7623,\n\t\"./sr-cyrl.js\": 7623,\n\t\"./sr.js\": 9500,\n\t\"./ss\": 2384,\n\t\"./ss.js\": 2384,\n\t\"./sv\": 5110,\n\t\"./sv.js\": 5110,\n\t\"./sw\": 7257,\n\t\"./sw.js\": 7257,\n\t\"./ta\": 706,\n\t\"./ta.js\": 706,\n\t\"./te\": 4065,\n\t\"./te.js\": 4065,\n\t\"./tet\": 3036,\n\t\"./tet.js\": 3036,\n\t\"./tg\": 3217,\n\t\"./tg.js\": 3217,\n\t\"./th\": 215,\n\t\"./th.js\": 215,\n\t\"./tk\": 1739,\n\t\"./tk.js\": 1739,\n\t\"./tl-ph\": 9856,\n\t\"./tl-ph.js\": 9856,\n\t\"./tlh\": 7072,\n\t\"./tlh.js\": 7072,\n\t\"./tr\": 713,\n\t\"./tr.js\": 713,\n\t\"./tzl\": 5867,\n\t\"./tzl.js\": 5867,\n\t\"./tzm\": 8912,\n\t\"./tzm-latn\": 2421,\n\t\"./tzm-latn.js\": 2421,\n\t\"./tzm.js\": 8912,\n\t\"./ug-cn\": 2970,\n\t\"./ug-cn.js\": 2970,\n\t\"./uk\": 927,\n\t\"./uk.js\": 927,\n\t\"./ur\": 4428,\n\t\"./ur.js\": 4428,\n\t\"./uz\": 7197,\n\t\"./uz-latn\": 4450,\n\t\"./uz-latn.js\": 4450,\n\t\"./uz.js\": 7197,\n\t\"./vi\": 6834,\n\t\"./vi.js\": 6834,\n\t\"./x-pseudo\": 7969,\n\t\"./x-pseudo.js\": 7969,\n\t\"./yo\": 7457,\n\t\"./yo.js\": 7457,\n\t\"./zh-cn\": 7227,\n\t\"./zh-cn.js\": 7227,\n\t\"./zh-hk\": 4617,\n\t\"./zh-hk.js\": 4617,\n\t\"./zh-mo\": 2361,\n\t\"./zh-mo.js\": 2361,\n\t\"./zh-tw\": 5541,\n\t\"./zh-tw.js\": 5541\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 5962;"],"names":["x","Array","isArray","ArrayBuffer","isView","isHashable","GetHashCode","Dispose","sameConstructor","y","_a","_b","Object","getPrototypeOf","constructor","Enumerator","iter","this","current","cur","next","value","done","Error","o","GetEnumerator","Symbol","iterator","en","hasNext","undefined","factory","isValueCreated","createdValue","i","length","str","toString","date","date1","offset","kind","getTimezoneOffset","int32ToString","radix","ObjectRef","idMap","has","set","count","get","s","h","len","charCodeAt","numberHash","combineHashCodes","hashes","reduce","h1","h2","arrayHash","Date","getTime","dateHash","values","map","v","id","fastStructuralHash","String","equalArraysWith","eq","Equals","isEquatable","xKeys","keys","yKeys","sort","equalObjects","xtime","ytime","compareArrays","comp","j","compareArraysWith","CompareTo","isComparable","key","compareObjects","comparer","createObj","fields","obj","kv","round","digits","m","Math","pow","n","toFixed","floor","f","r","WeakMap","CURRIED","arity","uncurried","args","res","_curry","arg","concat","callStack","self","seqToString","cons","entries","k","join","name","cases","tag","toJSON","fieldStr","withParens","indexOf","unionToString","splice","other","recordToJSON","recordToString","recordGetHashCode","thisNames","recordEquals","result","recordCompareTo","contentsOrGetter","setter","getter","Exception","message","ensureErrorOrException","e","NumberStyles","getRange","unsigned","bitsize","isValid","style","exec","replace","prefix","getInvalidDigits","AllowHexSpecifier","getRadix","test","regexMatch","sign","validResponse","Number","parseInt","isNaN","umin","umax","min","max","defValue","contents","symbol","isNumeric","multiply","dp","toPrecision","sd","toExponential","toHex","wasm","WebAssembly","Instance","Module","Uint8Array","exports","Long","low","high","isLong","prototype","substr","bytes","le","fromBytesLE","fromBytesBE","fromBytes","$this","hi","lo","toBytesLE","toBytesBE","__isLong__","defineProperty","INT_CACHE","UINT_CACHE","cachedObj","cache","UZERO","ZERO","TWO_PWR_64_DBL","MAX_UNSIGNED_VALUE","TWO_PWR_63_DBL","MIN_VALUE","MAX_VALUE","negate","TWO_PWR_32_DBL","lowBits","highBits","pow_dbl","fromString","RangeError","p","substring","radixToPower","size","val","TWO_PWR_16_DBL","TWO_PWR_24","ONE","UONE","NEG_ONE","isZero","isNegative","radixLong","div","divide","rem1","subtract","rem","remDiv","isOdd","lessThan","greaterThan","greaterThanOrEqual","thisNeg","otherNeg","not","addend","a48","a32","a16","a00","b48","b32","b16","c48","c32","c16","c00","subtrahend","multiplier","mul","get_high","b00","divisor","approx","div_u","div_s","toUnsigned","numBits","shiftRightUnsigned","shiftLeft","shiftRight","log2","ceil","log","LN2","delta","approxRes","approxRem","op_UnaryNegation","xh","_bitsize","lessOrEqual","padStart","maxValue","getMaxValue","toUpperCase","isMinus","minutes","abs","dateToHalfUTCString","half","toISOString","dateToStringWithCustomFormat","format","utc","match","rep","NaN","getUTCFullYear","getFullYear","getUTCMonth","getMonth","getUTCDate","getDate","getUTCHours","getHours","getUTCMinutes","getMinutes","getUTCSeconds","getSeconds","getUTCMilliseconds","getMilliseconds","_provider","_c","d","dateWithOffset","dateToISOStringWithOffset","dateToStringWithOffset","toUTCString","toLocaleString","toLocaleDateString","toLocaleTimeString","printOffset","dateToISOString","dateToStringWithKind","parseRaw","input","fail","trim","baseDate","timeInSeconds","timeParts","split","parseFloat","offsetInMinutes","detectUTC","_err","now","year","ts","newDate","oldTzOffset","newTzOffset","addDays","addMonths","newMonth","month","newMonth_","yearOffset","newYear","_daysInMonth","day","ms","dateValue","UTC","setFullYear","hour","minute","second","millisecond","that","matches","reg","startAt","global","lastIndex","lastMatchIndex","index","push","replacement","limit","tmp","pattern","options","flags","RegExp","arguments","withGroups","pLast","groups","_s","sub1","_matches","sub2","fsFormatRegExp","interpolateRegExp","formatRegExp","isLessThan","cont","fsFormat","valIdx","strIdx","matchIndex","padLength","precision","formatReplacement","continuePrint","toFail","toLowerCase","zeroFlag","minusFlag","ch","pad","createPrinter","_strParts","_result","padArg","strParts","slice","_padLength","shift","_","idx","padLeft","intPart","decimalPart","repInt","repDecimal","rightZeros","padRight","thousandGroups","thousands","endsWith","search","lastIndexOf","delimiter","xs","from","notSupported","toBase64String","inArray","fromCharCode","btoa","fromBase64String","b64Encoded","binary","atob","isRight","splitters","removeEmpty","filter","splits","findSplits","candidate","trimEnd","chars","startIndex","Some","opt","defaultValue","mapping","binder","Helpers_allocateArrayFromCons","indexNotFound","target","targetIndex","start","fill","source","arrays","arrays_1","totalIdx","totalLength","idx_1","arr_2","ar","initializer","take","array","predicate","find","folder","state","array1","array2","differentLengths","equals","length1","length2","head","tail","super","xs_1_mut","ys_1_mut","loop","xs_1","ys_1","matchValue","xt","yt","i_mut","h_mut","t","_key","c","ListEnumerator$1","it","__","FSharpList_get_Empty","FSharpList_Cons_305B8EAC","FSharpList__get_IsEmpty","FSharpList__get_Length","FSharpList__get_Head","FSharpList__get_Tail","xs_mut","tryLast","acc","action","unitVar","tail_1","lists","root","node","forEach","enumerator","xs_6","t_2","ys","zs","xs_3","FSharpList__get_Item_Z524259A4","arr","projection","Compare","adder","Add","GetZero","setPrototypeOf","Trampoline","callCount","incrementAndCheck","maxTrampolineCallCount","hijack","setTimeout","ctx","cancelToken","isCancelled","onCancel","trampoline","err","onError","Bind","computation","onSuccess","Combine","computation1","computation2","Delay","generator","For","sequence","body","While","Return","ReturnFrom","TryFinally","compensation","TryWith","catchHandler","ex","Using","resource","guard","Zero","emptyContinuation","_x","defaultCancellationToken","cancelled","_id","_cancelled","_listeners","Map","cancel","listener","addListener","removeListener","delete","register","$","cancellationToken","continuation","exceptionContinuation","cancellationContinuation","startWithContinuations","delegates","_addHandler","Trigger","senderOrValue","valueOrUndefined","sender","AddHandler","handler","RemoveHandler","_removeHandler","Subscribe","callback","OnNext","onNext","onCompleted","OnError","_e","OnCompleted","interval","returnVal","_enabled","_isDisposed","_intervalId","_timeoutId","Interval","AutoReset","_elapsed","Elapsed","setInterval","Enabled","clearTimeout","clearInterval","Close","Start","Stop","dispatch","cmd","call","g","cmds","task","ofSuccess","ofError","msg","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","matchValue_1","mkSeq","Enumerator_Seq_$ctor_673A07F2","argName","sources","outerOpt","innerOpt","finished","inner","outer","copyOfStruct","inner_1","outer_1","Enumerator_concat","xs_5","generate","create","generateIndexed","chooser","e_1","found","reverse","Enumerator_enumerateThenFinally","skipped","integralRangeStep","step","stop","zero","add","stepFn","stepComparedWithZero","stepGreaterThanZero","comparedWithLast","makeRangeStepFunction","st_1","Enumerator_unfold","wix","rix","items","rix'","init","update","view","_arg1","model","tupledArg","text","console","setState","program","patternInput","rb","reentered","syncDispatch","item","wix'","ix","nextMsg","model'","subscribe","props","nextProps","_nextState","equal","newUrl","history","ev","CustomEvent","window","parser","urlUpdate","onLocationChange","arg0","mapInit","mapUpdate","mapView","mapSetState","mapSubscribe","userInit","unitVar1","location","userUpdate","userView","userSetState","userSubscribe","MapTreeLeaf$2","MapTreeLeaf$2_$ctor_5BDDA1","MapTreeLeaf$2__get_Key","MapTreeLeaf$2__get_Value","MapTreeNode$2","left","right","MapTreeNode$2_$ctor_499A11FD","MapTreeNode$2__get_Left","MapTreeNode$2__get_Right","MapTreeNode$2__get_Height","MapTreeModule_sizeAux","acc_mut","m_mut","m2","MapTreeModule_size","MapTreeModule_mk","l","hl","hr","m2_1","m_2","MapTreeModule_rebalance","t1","t2","m2_2","m_3","m2_3","t1h","t2h","matchValue_2","matchValue_3","MapTreeModule_add","MapTreeModule_empty","MapTreeModule_tryFind","comparer_mut","k_mut","MapTreeModule_spliceOutSuccessor","MapTreeModule_remove","MapTreeModule_iterOpt","f_mut","MapTreeModule_iter","MapTreeModule_mapiOpt","l2","v2","r2","MapTreeModule_mapi","MapTreeModule_copyToArray","MapTreeModule_ofSeq","forLoopVar","MapTreeModule_ofArray","MapTreeModule_ofList","ie","e_mut","MapTreeModule_mkFromEnumerator","MapTreeModule_MapIterator$2","stack","MapTreeModule_collapseLHS","stack_mut","rest","MapTreeModule_mkIterator","MapTreeModule_current","MapTreeModule_alreadyFinished","MapTreeModule_notStarted","MapTreeModule_mkIEnumerator","MapTreeModule_moveNext","FSharpMap","tree","this$","combineHash","activePatternResult","FSharpMap__ComputeHashCode","e1","e2","m1","e1c","e2c","toStringTag","b1","b2","kvp1","kvp2","FSharpMap__ContainsKey","FSharpMap__get_Item","FSharpMap__get_Count","clear","_arg","thisArg","FSharpMap_$ctor","FSharpMap_Create","FSharpMap__get_IsEmpty","MapTreeModule_find","MapTreeModule_mem","table","FSharpMap__Add","FSharpMap__Remove","containsKey","kvp","elements","m_1_mut","m_1","MapTreeModule_toList","MapTreeModule_toArray","empty","visited","unvisited","stringToSomething","subValue","parse","``arg10@``","segment","a","b","parseBefore","parsers","Page","oneOf","toPath","_arg2","_mthd","_arg3","P","cmp","_this","MAX_DP","NAME","INVALID","INVALID_DP","DIV_BY_ZERO","UNDEFINED","NUMERIC","nl","charAt","Big","DP","RM","rm","more","xc","findIndex","xci","unshift","pop","stringify","doExponential","isNonzero","isneg","yc","bl","bt","ri","bz","ai","al","rl","q","qc","qi","gt","gte","lt","lte","minus","sub","xlty","plus","xe","ye","mod","ygtx","times","one","prec","sqrt","NE","PE","toNumber","strict","valueOf","_Big_","normalize","TypeError","setInt32Bits","hexDigits","bits","strOpt","noneIfEmptyStrTrim","cn","classes","dashify","separator","caseRule","definedCaseRule","kvPair","assign","changeCase","dict","std","booleans","complete","faOptions","children","baseElement","baseClass","opts","Icon","Size","Border","Pull","Rotation","Flip","CustomClass","StackSize","FixedWidth","IsLi","HavePulse","HaveSpin","IsInverse","Props","option","prettyPrintDateLong","prettyPrintDateShort","num","controls","styles","elems","fieldWithControlStyles","document","getElementsByClassName","pos","getElementById","elem","loadingWithElem","content","loadingWithMessage","loadingMessageOrContent","url","inputProps","widthOpt","_styles","field","elms","fieldWithHeader","IconSize","textFieldReadOnlyStyles","delay","msgToSend","currentState","PendingMessages","Promise","er","reject","catch","selfMessage","remainingMessages","CaseInfo","declaringType","TypeInfo","fullname","generics","construct","parent","enumCases","getHashCode","getGenerics","getRecordElements","k1","v1","k2","caseNames","generic","enum_type","underlyingType","info","elemType","getElementType","isGenericType","isEnum","getGenericTypeDefinition","getEnumUnderlyingType","getEnumValues","parseEnum","getEnumCase","getUnionCases","getTupleElements","isTuple","getFunctionElements","isFunction","gen","isUnion","isRecord","startsWith","getUnionFields","case_","getUnionCaseFields","uci","getRecordField","makeUnion","expectedLength","makeRecord","_t","assertUnion","guidRegex","guidRegexNoHyphen","guidRegexHex","hyphenateGuid","wsTrimAndLowered","random","tuple","_impl","getDisposable","deps","useEffect","disposable","renderElement","areEqual","withKey","memoElementType","callbackFunction","dependencies","arg10","render","signedRound","ticks","Long_toNumber","Long_op_Division","totalDays","firstDot","firstColon","obs","unitVar3","arg00","dispatcher","``.ctor``","runProgram","effect","hasDisposedOnce","_arg4","_arg6","_arg5","initVal","Value","interceptOpt","valueChanged","inputOpt","Debouncer","interceptedValue","intercept","Intercept","ValueChanged","View","xValue","case","screen","level","baseProps","prop","cl","modifiers","display","typ","amount","direction","cls","el","element","inputType","hasId","inputElement","parseOptionsForInput","labelElement","parseOptionsForLabel","parseOptions","genericElement","checkboxInline","condition","boundaryOpt","Max","Min","Key","EditMode","valueOpt","Ref","floatVal","DecimalPlaces","Step","ifEnter","event","css","Label","StopPropagation","OnChange","btnView","transitionGroup","TransitionGroupProp","ContentOpt","child","CSSTransitionProp","title","columnsOpt","selection","newOrderTemp","Selection","ColumnMoving","newModel","droppedCol","previousOrder","ColumnOrder","col","Id","InitiallyVisible","colId","vis","page","scrollIntoView","Sort","config","Columns","Model","HoveringOver","column","Header","getVal","allUnchecked","NewTableCheckboxCell","checked'","ActiveColumns","pageSize","PageSizeOptions","pageSizeOptions","item_1","start_1","end$0027","ColumnSelectionSpecific","ColumnSelectionGeneric","RowSpecific","dropDestCol","RowClick","click","Item","isSelected","SortedColumns","Align","movingCol","anythingSelected","Config","sel","sortedColumns","sortColumns","selectionList","Tooltip","selectionConfig","selectionButton","Dispatch","ColumnSelection","StickyHeader","DataLoad","IsLoading","allSelected","Items","Draggable","MinWidth","customStyles","PageSize","sortDiv","subRows","SubRows","reactElement","ItemKey","sortOpt","columns","columnOpt","sortFun","sortItems","Paging","count_mut","Totals","totalItems","paginationConfig","HidePaginationUnder1Page","properties","availablePageSizes","delegateArg0","delegateArg1","kvs","setProperty","sepIdx","topKey","nestedKey","TotalItems","Native_randomNext","NonSeeded","Next0","Next1","Next2","minValue","NextDouble","NextBytes","buffer","rhi","Native_randomBytes","nonSeeded","ok","error","Uri","uri","URL","isAbsoluteUri","original","baseUri","relativeUri","kindOrUri","tryCreateWithKind","tryCreateWithBase","tryCreateImpl","out","decodeURIComponent","asUrl","href","protocol","host","pathname","hash","Parsimmon","seed","isParser","isBuffer","Buffer","makeSuccess","status","furthest","expected","makeFailure","mergeReplies","last","hasOwnProperty","union","makeLineColumnIndex","line","lines","assertParser","assertNumber","assertRegexp","assertFunction","assertString","repeat","string","leftPad","char","rangeFromIndexAndOffsets","before","after","to","formatGot","lineWithErrorIndex","lineRange","lastLineNumberLabelLength","verticalMarkerLength","byteLineWithErrorIndex","columnByteIndex","byteRange","bytesPerLine","bytesAfter","byteLines","byteRow","byteValue","chunkSize","chunks","chunkIndex","toChunks","data","byteRangeToRange","byteLine","inputLines","lineWithErrorCurrentIndex","lineSource","lineNumberLabel","isLineWithError","re","anchoredRegexp","numParsers","accum","seqMap","mapper","apply","results","alt","sepBy1","then","many","rs","regexp","group","anchored","fullMatch","groupMatch","skip","tryParse","formatError","type","or","alternative","wrap","leftParser","rightParser","middle","thru","wrapper","tieWith","assertArray","tie","prevResult","atMost","atLeast","fn","contramap","promap","mark","end","sepBy","lookahead","notFollowedBy","desc","reply","fallback","ap","chain","of","digit","optWhitespace","cr","lf","newline","others","ps","strings","jint","jfloat","negJint","escape","anyCharSnippet","otherParser","withWhitespace","jnull","jbool","jnumber","stringLiteral","jvalue","comma","BigNat","bound","BigNatModule_FFT_pow32","x_mut","n_mut","BigNatModule_bound","BigNatModule_coeff","BigNatModule_coeff64","BigNatModule_setCoeff","BigNatModule_pow64","BigNatModule_pow32","BigNatModule_FFT_maxTwoPower","Int32Array","BigNatModule_baseBits","BigNatModule_baseN","BigNatModule_baseNi64","BigNatModule_baseMaski64","BigNatModule_divbase","BigNatModule_modbase","BigNatModule_createN","BigNatModule_normN","na_mut","na","findLeastBound","BigNatModule_embed","r_1","BigNatModule_eval32","BigNatModule_one","BigNatModule_zero","BigNatModule_degree","rbound","c_mut","p_mut","q_mut","r_mut","z","i_1","z_1","i_2","BigNatModule_addP","BigNatModule_lt","pa_mut","qa_mut","pa","qa","check","BigNatModule_compare","BigNatModule_mulSchoolBookCarry","rak","BigNatModule_mulSchoolBookOneSmall","bp","q_1","BigNatModule_encoding","bigL","twoToBigL","bigK","bigN","BigNatModule_mkEncoding","BigNatModule_table","pSmall","qSmall","BigNatModule_mulSchoolBookBothSmall","ra","pai","qaj","BigNatModule_mulSchoolBookNeitherSmall","BigNatModule_mulSchoolBook","BigNatModule_scaleSubInPlace","patternInput_1","ad","a_1","f_1","zLo","zHi","BigNatModule_scaleAddInPlace","BigNatModule_removeFactor","degx","dega","xa","aa","pn","qai","copy","BigNatModule_copyN","Invariant","BigNatModule_toFloat","evalFloat","BigNatModule_ofInt32","BigNatModule_ofInt64","rem_u","rem_s","BigNatModule_embed64","BigNatModule_toString","degn","collect","isLeading_mut","digits_mut","n_1_mut","_arg_mut","isLeading","n_1","n_2","prior_1","nL","nH","digits_4","prior_mut","ten2k_mut","prior","ten2k","route","BigNatModule_ofString","ten","build","BigNatModule_getSmall","signInt","BigInteger__get_SignInt","BigInteger__get_V","BigNatModule_hash","pattern_matching_result","nn","BigInteger_$ctor_Z2BE94A1","BigInteger_nat_Z67CCE57D","smallLim","smallPosTab","BigInteger_posn_Z67CCE57D","text_1","toDecimal","BigInteger__get_ToDecimal","number","arg20","jsObject","jsonValue","activePatternResult8082","activePatternResult8083","activePatternResult8084","activePatternResult8086","parseNative'","activePatternResult8087","object","DateTimeOffset","checkOffsetInRange","offsetMatch","fromDayNumber","dayNumber","Long_op_Multiply","two","littleEndian","getBytesInt32","DataView","byteOffset","byteLength","setInt32","getInt32","SetTreeLeaf$1","SetTreeLeaf$1_$ctor_2B595","SetTreeLeaf$1__get_Key","SetTreeNode$1","SetTreeNode$1_$ctor_Z6E7BE5F7","SetTreeNode$1__get_Left","SetTreeNode$1__get_Right","SetTreeNode$1__get_Height","SetTreeModule_countAux","t_mut","SetTreeModule_count","SetTreeModule_mk","t2_1","SetTreeModule_rebalance","t2_3","t_3","t2_4","t2_2","SetTreeModule_add","c_1","SetTreeModule_empty","SetTreeModule_spliceOutSuccessor","SetTreeModule_remove","SetTreeModule_mem","SetTreeModule_iter","SetTreeModule_SetIterator$1","SetTreeModule_collapseLHS","x2","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","t1_6","x1_4","t2_6","x2_4","matchValue_4","pattern_matching_result_1","t1_7","x1_5","t2_7","x2_5","c_3","c_2","matchValue_5","pattern_matching_result_2","t1_8","x1_6","t2_8","x2_6","pattern_matching_result_3","t1_2","x1","x2_1","pattern_matching_result_4","t1_4","x1_2","x2_2","SetTreeModule_copyToArray","SetTreeModule_ofSeq","SetTreeModule_ofArray","SetTreeModule_ofList","SetTreeModule_mkFromEnumerator","FSharpSet","FSharpSet__ComputeHashCode","FSharpSet__get_Comparer","FSharpSet__get_Tree","FSharpSet__get_Count","FSharpSet__Contains","FSharpSet_$ctor","set$","FSharpSet_Empty","FSharpSet__Add","pairs","hashMap","pair","Dictionary__Add_5BDDA1","Dictionary__Clear","Dictionary__TryFind_2B595","arrayIndex","Dictionary__get_Count","Dictionary__Remove_2B595","Dictionary__ContainsKey_2B595","Dictionary__get_Item_2B595","Dictionary__set_Item_5BDDA1","Dictionary__TryFindIndex_2B595","outArg","HashSet__Add_2B595","HashSet__Clear","HashSet__Contains_2B595","HashSet__get_Count","HashSet__Remove_2B595","HashSet__TryFindIndex_2B595","v_1","typeDef","flattenFuncTypes","unitVar0","resolvedType","typeInfoCache","ti","activePatternResult7693","primType","activePatternResult7694","types","createTypeInfo","lazyToDelayed","activePatternResult7695","activePatternResult7696","activePatternResult7697","activePatternResult7698","activePatternResult7699","activePatternResult7700","activePatternResult7701","activePatternResult7702","activePatternResult7703","activePatternResult7704","activePatternResult7705","activePatternResult7706","genArgs","keyType","valueType","activePatternResult7707","activePatternResult7708","activePatternResult7709","activePatternResult7710","_createTypeInfo","json","activePatternResult8174","activePatternResult8169","activePatternResult8175","activePatternResult8171","leftMap","rightMap","linkedList","foundCase","testExpr","typeInfo","getlElemType","getElemType","genericJson","getTypes","optionalTypeDelayed","caseName","getFields","serializedRecord","caseValue","elementTypeDelayed","tupleTypesDelayed","tuples","getType","originalType","insideBrowser","unionType","activePatternResult8283","CaseTypes","arg30","expectedCases","caseInfo","caseType","foundDiscriminatorKey","keyword","discriminatorValueJson","discriminatorValue","foundUnionCase","unexpectedJson","expectedType","caseIndex","fieldValues","caseTypes","otherwise","_arg7","foundCaseName","elementType","recordType","list","clo1","fieldType","fieldName","_arg8","dictKeys","recordFields","keyValuePair","output","hashset","inputJson","inputText","escapable","meta","Long_fromNumber","PropertyInfo","FieldType","FieldName","usedCase","enumUnion","serializedFields","serializedValues","serializedKey","serializedValue","isPrimitive","tupleTypes","cell","socket","server","bridgeName","sentType","sentTypeName","contractsOpt","contractId","jobHistories","aiInfos","rnd","aiInfo","contract","lastHistory","EstCompletion","weeks","week","SuccessRate","Cost","Billing","searchModels","costId","tableStates","inputRecord","JobCostDetailField","contractChanged","Contracts","caseStrategy","newLine","path","decoder","reason","genericMsg","errorToString","requestedIndex","currentPath","vArray","tokens","cb","decoder1","decoder2","andThen","``arg20@``","decoders","extra","fi","autoDecoder","mixedArray","isOptional","decoderRef","decoderInfos","reduceRight","delegateArg","delegateArg_1","autoObject","enumType","enumValue","clo2","keyDecoder","valueDecoder","d1","autoObject2","tuple2","runner","errors","ctor","toMap","autoDecodeRecordsAndUnions","bool","unit","sbyte","byte","int16","uint16","int","uint32","float32","datetimeUtc","datetimeOffset","timespan","guid","days","lengthLeft","lengthRight","padLeftAndRightWithZeros","skipNullField","encoderRef","encoder","setters","targetKey","encode","autoEncoder","fieldTypes","encoders","valueEncoder","activePatternResult72823","keyEncoder","clo4","activePatternResult72827","autoEncodeRecordsAndUnions","datetime","response","errorMsg","reponseText","headers","req","withCredentials","preparation","resultMapper","token","request","xhr","XMLHttpRequest","Url","WithCredentials","readyState","RequestBody","typeName","func","funcArgs","argumentCount","returnTypeAsync","binaryInput","baseUrl","RouteBuilder","BaseUrl","funcNeedParameters","contentType","inputArgumentTypes","CustomHeaders","Authorization","executeRequest","onOk","CustomResponseSerialization","serializer","returnType","requestBody","sendAndRead","statusCode","responseAsBlob","Blob","blob","reader","responseText","parsedJson","arg1","arg2","arg3","arg4","arg5","arg6","arg7","inputArguments","timeout","Message","Title","Options","warning","success","work","Choice_makeChoice1Of2","localStorage","getItem","makeExtra","schemaType","delegateArg2","delegateArg3","delegateArg4","delegateArg5","delegateArg6","delegateArg7","methodName","argType","withPlus","negativeValues","asCurrency","rounding","rounded","defaultVal","formatFiniteOrDefVal","formatNumber","formatFiniteOrDef","formatOptOrEmptyStr","percent","formatPercent","histories","aiHistories","prettyPrintDateDashes","brand","brandingFromVar","contractSettings","forecasts","isDemo","shiftDatesForDemo","peak","diff","costData","mid","scale","bitSize","decDigits","hex","dec","decCount","carry","hexToDecimal","big","CostAndBillingForecasting","baseLegend","len1","len2","newArray","isDateOver30Days","BillingLastRequestedDate","LastBillDate","billed","requested","Expanded","top","zIndex","bottom","color","expanded","toggle","Collapse","Expand","changeOrderType","ChangeOrderType","ACOItem","PCOType","emptyStrTagIfNone","Description","UM","Units","UnitPrice","Amount","ChildrenLines","Type","isPending","th","pct","txt","ItemRow","Line","td","Phase","PhaseDescription","CostType","UnitCost","EstUnits","HourCost","EstHours","EstCost","ItemId","Lines","LineRow","List_groupBy","key_1","groupBy","header","isApproved","ACO","prettyPrintDateOptionLong","ApprovalDate","ChildrenItems","Headers","TopRow","orderType","childrenItems","matchOrderType","app","pen","acoName","TopRows","changeOrders","orders","itemFactory","ItemsTable","itemId","LinesTable","grouped","expType","arBucketsOpt","ARTotalDue","ARUnbilled","bucket","textFieldReadOnly","ARRetainage","CFNetCashFlow","profit","revenue","formatPossibleNotFinite","jobCost","OrigEstCost","CurrentEstCost","ActualCostToDate","ActualHoursToDate","CostToComplete","PctEstimate","PMRevisedCost","EarnedRevenue","GrossProfit","costs","tdPrice","optionalRedColor","total","FromJobCost","alignRight","formatMargin","rightMiddle","faIcon","controlView","leftIconPadding","hiddenInputRef","ShouldFocus","IconVisible","noneIfEmptyStr","NewTableNextGeneric","NewTableNextSpecific","tableState","detail","PostedDate","costDetail","attachments","attachmentCount","jobCostId","details","searchViewChanged","searchValue","PhaseItemDescription","invalidFileNameChars","SearchboxNew","CostDetailTableView","isSuperUser","exn","subType","costSubs","typeStr","cost","Vendor","poSlTableView","jobPhase","Code","Desc","JobPhaseCosts","ContractSettings","Costs","AppSettings","ContractId","modalOpenOpt","attachmentPreview","attachmentDownload","attachmentContents","attachmentsVisited","attachment","attachmentId","fileContent","attachmentMap","fileUrl","OrigFileName","reactFileViewer","attachmentsGroup","SourceItem","Source","_arg9","allCosts","CostsGrouped","ApplicationSettings","Contract","costsGrouped","width","ExpandedCostOfConstructionPhases","jobPhaseCosts","detailsExpanded","jobCostSubs","HeaderRow","CostTotals","IsSuperUser","JobCostDetails","ExpandedCostOfConstructionDetails","SearchValues","JobCostDetailAttachments","TableStates","JobCostSubs","CostOfConstructionTotals","attachmentsModal","JobCostAttachmentsModalOpen","JobCostAttachmentPreview","JobCostAttachmentDownload","JobCostDetailAttachmentFiles","JobCostDetailAttachmentFilesVisited","JobCosts","Hours","remainingHoursEnabled","labor","equip","ProgressEntryQuantities","code","applicationSettings","RemainingHoursEnabled","IsEquipRateCost","CostsRow","border","name1","name2","CircleProgress","getHexColor","gaugeProps","calcColor","Revenue","profitFadeEntries","profitFadeOpt","profitFade","ContractAmount","ProfitLifeDelta","Profit3MthDelta","progressWithLabel","CurrentGP","GPLifeDelta","GP3MthDelta","FSharpSet__Remove","twoDigitsCurrency","Current","Received","Invoiced","Remaining","po","Po","VendorName","TdCosts","TotalCosts","poi","ItemNumber","UnitOfMeasure","Quantity","Row","ofType","valueOrDefault","Prop","BoundValue","Mode","Rows","MaxRows","mode","MultilineInnerComp","purchaseOrders","addRequesting","PurchaseOrderSettings","Requests","order","TotalCost","PurchaseOrderRequest","utilsProviderProps","datePickerProps","jobSchedule","js","showDuration","prettyPrintDateOptionShort","Finish","showSPI","showVariance","Classes","className","suffix","ofOffset","displayValue","selectedItem","itemList","OnlyOneDropdownControlSpecific","toWrappedItem","DisplayValue","selectedValue","SelectMode","onChange","wrappedItemValue","Searchable","createFilterOptions","dropdownView","single","LinkUrl","SelectedItem","linkUrl","Screen","goToUrl","dropdownLazyView","lazyView","selected","textValueWithSpinner","dropdownCtrl","itemsOpt","itemsRes","truncatedTxt","tab","SelectedTab","Tab","ChangeOrderHeaders","ChangeOrderItems","ChangeOrderItemLines","accountsReceivableView","ContractARBuckets","cashFlowView","AverageLaborRate_RemainingHours","hs","fs","contractProfitFades","profitFadeValues","ProfitFadeChart","ContractProfitFades","PurchaseOrders","jobHistoriesOpt","JobHistories","aiHistoriesOpt","AIJobHistories","chartView","jobScheduleView","JobSchedules","formatAmount","floatOpt","tabHr","tdStyle","pctStyle","CCRev","CCPCO","PRev","PPCO","OverviewSettings","CostsLabel","ProfitLabel","GPPerLabel","OnlyOneDropdownGeneric","loadingMessageBoxOrContent","contracts","OnlyOneDropDownSpecific","jobOpt","SelectedContractId","jobDetailsView","AiInfos","IsDemo","searchViewChangedCallback","searchBarLevel","Active","SearchboxValue","tableMsgCallback","contractsFiltered","getters","Company","term","contractUrl","ContractsPageViewColumn","positionOpt","Followed","booleanFollowedField","TableState","searchBar","placeHolder","Values","fromValue","toValue","toOpt","fromOpt","prevFromValueOpt","LastValue","prevToValueOpt","valuesOpt","ValuesChanged","datesOpt","dateFrom","dateTo","noneAtTheEnd","select","_output","elm","isTotal","rows","rev","totalColor","SumOfBilling","GrossMarginDollar","expandedColor","SuperContractName","companyUpdateCallback","dateUpdateCallback","OnlyOneDropdownSpecific","Co","Name","Companies","SelectedCompany","DateRange","CompanyTabData","elemInBox","centeredElem","companyData","companyDataGrouped","allRows","overheadRows","superContractName","ExpandedSuperContracts","row","ContractNumber","ContractDesc","DirectJobCost","OCRev","OCCosts","RowExpanded","totalGrossMargin","totalOverhead","minColorR","minColorG","minColorB","maxColorR","maxColorG","maxColorB","minNum","maxNum","percentage","getColorValue","minColor","maxColor","at8","at3","at0","atMin3","atMin8","atMin15","getColor","contractWithProfitFade","ContractProfitFadeId","GPMinus1","GPMinus2","GPMinus3","GPMinus4","positive","absPercentage","formatMonth","minRounded","maxRounded","topHeight","profitFadePartTop","profitFadePartBottom","jobProfits","toContractProfitFade","profitFades","fade","expandedContractProfitFades","ContractWithProfitFadeField","ContractProfitFadeTable","ExpandedContractProfitFades","icon","primaryColor","featureFlags","contractsByCompany","CompanyName","SearchValue","ProjectManager","IsActive","searchView","coName","isFirst","heading","contractsView","appSettings","VisitedContracts","GrossProfitPct","HomeSettings","BillingAndCostGPPercent","BCGPPercent","UnapprovedInvoices","ContractHomePageBuckets","FormatCurrencyNegativeValues","FormatCurrencyRounding","PendingChangeOrders","dateToDays","_arg10","ActualLaborHoursToDate","_arg11","ActualLaborCostToDate","_arg12","LaborCostToComplete","jobView","companyView","oldModel","bodyScrollEnable","getWindowScrollValue","Scroll","scroll","contractIdParsed","parsed","parsedId","ContractPageModel","ContractsPageModel","scrollTableToPos","CompanyPageModel","settings","ContractAiInfos","user","JobForecasts","Connection","debouncerMsg","homePageMsg","jobPageMsg","contractsPageMsg","profitFadePageMsg","authMsg","rc","BurgerOpen","HomePageModel","fades","buckets","phases","randomAiJobHistories","Jobs","ids","attachmentIdOpt","phaseId","contractIdOpt","purchaseOrderRequestOpt","searchParams","updateContract","followed","co","jobId","ContractProfitFadePageModel","User","userData","space","deleteUserCmd","Auth","authModel","RemoteServerMsg","Settings","randomAiInfo","isBurgerOpen","isPageActive","CanViewCompanyTab","homeDispatchCallback","contractPageDispatchCallback","contractsPageDispatchCallback","companyPageDispatchCallback","contractProfitFadePageDispatchCallback","ContractPageView","ContractsPageView","CompanyPageView","ContractProfitFadePageView","HomePageView","widerContainerClass","navBrand","navMenu","fullHeightContainer","LoggedInContent","footerContainer","ViewComponent","states","parseHelp","segments","splitUrl","querystring","toKeyValuePair","parsePath","pageParser","lastLocation","onChangeRef","wsref","websocket","closed","lazyView2With","placeholderId","lastRequest","requestAnimationFrame","webpackContext","webpackContextResolve","__webpack_require__","resolve","module"],"sourceRoot":""}