@synnaxlabs/pluto 0.40.1 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Center-CFEPOi_x.js → Center-CNcAEDgS.js} +3 -3
- package/dist/Center-Map6aflE.cjs +1 -0
- package/dist/ContextMenu-DmRPxhnI.cjs +1 -0
- package/dist/ContextMenu-fLU0wr9S.js +95 -0
- package/dist/DateTime-CP3OmEGY.cjs +1 -0
- package/dist/{DateTime-Djw6pb3W.js → DateTime-CWAcEwXO.js} +2 -2
- package/dist/{Divider-CMyzWvRC.js → Divider-BTLn5ucU.js} +597 -512
- package/dist/Divider-Dvb6dsgX.cjs +22 -0
- package/dist/Dropdown-CaGzfZRa.cjs +1 -0
- package/dist/Dropdown-nw8kRSbl.js +327 -0
- package/dist/Haul-B8zGWk0I.cjs +1 -0
- package/dist/{Haul-CaLW9ULm.js → Haul-Cnuzk7Z-.js} +34 -35
- package/dist/Item-BzrQqxRC.cjs +1 -0
- package/dist/Item-FmwC-twg.js +109 -0
- package/dist/Keyboard-BfvjkBgh.cjs +1 -0
- package/dist/{Keyboard--YA9DHRz.js → Keyboard-Cevv7vrQ.js} +11 -9
- package/dist/{Link-Bhto2KVL.cjs → Link-DI7BZ5dL.cjs} +1 -1
- package/dist/{Link-BT_Kwmlr.js → Link-Dljdu4e9.js} +1 -1
- package/dist/Pack-lJqoOmHx.cjs +1 -0
- package/dist/Pack-to0DG2iP.js +48 -0
- package/dist/Provider-BlM1x1cF.cjs +1 -0
- package/dist/Provider-C_B463cg.js +461 -0
- package/dist/Space-C2oZDkE1.js +100 -0
- package/dist/Space-DfcVsxz8.cjs +1 -0
- package/dist/Text-BXADoWYY.js +137 -0
- package/dist/Text-BiYpGaEZ.js +35 -0
- package/dist/Text-BjHlLKsp.cjs +1 -0
- package/dist/{Text-B7AC8Z1e.js → Text-CWiPrDI1.js} +320 -308
- package/dist/Text-DrIBbnml.cjs +1 -0
- package/dist/Text-ZJqK1cI3.cjs +4 -0
- package/dist/Toggle-CeUVv58o.js +377 -0
- package/dist/Toggle-CfwYy9fe.cjs +1 -0
- package/dist/{Video-TjJf_tXI.js → Video-BZ1XTEez.js} +1 -1
- package/dist/{Video-hdvNT3La.cjs → Video-C7YoF37-.cjs} +1 -1
- package/dist/WithIcon-DG7VJxsE.cjs +1 -0
- package/dist/WithIcon-pBZ7H9Lq.js +98 -0
- package/dist/align.cjs +1 -1
- package/dist/align.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/css-B7c7_G5h.js +4746 -0
- package/dist/css-hg3QdDDt.cjs +15 -0
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/deep-B1etRzze.cjs +1 -0
- package/dist/deep-BytImVW-.js +102 -0
- package/dist/dimensions-Cz-q0Mok.cjs +1 -0
- package/dist/dimensions-DcjW7X3n.js +19 -0
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/eraser-BOx6Xhwn.cjs +11 -0
- package/dist/eraser-Bsb4kKS3.js +1148 -0
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +68 -75
- package/dist/{external-DTjOTICM.js → external-1KJXZcr9.js} +2 -2
- package/dist/{external-dLVcM8tt.cjs → external-BHHC7TQ_.cjs} +1 -1
- package/dist/external-BLEs2AYM.cjs +46 -0
- package/dist/external-BdVuZd3H.cjs +1 -0
- package/dist/external-BiBhgCdz.cjs +1 -0
- package/dist/external-C75Z9Zbn.cjs +1 -0
- package/dist/external-CEfSeJMr.js +432 -0
- package/dist/external-CLTPcWrI.cjs +1 -0
- package/dist/{external-C3e9emVy.js → external-CRNR1bD0.js} +29 -28
- package/dist/{external-D_21zZAf.cjs → external-Cfj1plcw.cjs} +1 -1
- package/dist/{external-B9nbHICv.js → external-Ck1rVwUu.js} +3263 -3285
- package/dist/external-Cni9ftkW.cjs +1 -0
- package/dist/external-DCcp3sQD.js +28 -0
- package/dist/{external-Cs8oKwvw.cjs → external-DCfs7IFi.cjs} +1 -1
- package/dist/external-DDD_nc3x.js +400 -0
- package/dist/external-DNT-gmZx.cjs +1 -0
- package/dist/{external-CcIx4j5m.js → external-DeCeUbqe.js} +18 -17
- package/dist/{external-DCflyFdb.js → external-DgSaeiBz.js} +3 -3
- package/dist/{external-ClyfPgqG.cjs → external-DhfASB4W.cjs} +37 -37
- package/dist/{external-upiAayc4.js → external-bkwgRzLc.js} +29 -29
- package/dist/{external-_b4lTCfZ.js → external-hgzjVlDR.js} +2171 -2184
- package/dist/external-pUEPQrp_.cjs +1 -0
- package/dist/{external-D12g_huj.js → external-qwaFowDe.js} +14 -14
- package/dist/{external-JNlv7kxI.js → external-sUHGRdqd.js} +2 -2
- package/dist/{font-Bas26Jn-.cjs → font-BFTKtIQk.cjs} +1 -1
- package/dist/{font-CcRdsA3n.js → font-Crn-D_ua.js} +2 -2
- package/dist/fontString-DQLaRHQV.cjs +1 -0
- package/dist/fontString-DjnDxFrE.js +28 -0
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/hooks-CM9HWxYc.js +296 -0
- package/dist/hooks-CTKCi-OE.cjs +1 -0
- package/dist/index.cjs +7 -7
- package/dist/index.js +10618 -9594
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/pluto.css +1 -1
- package/dist/provider-BDFfcHVT.js +12851 -0
- package/dist/provider-XPRFhwnl.cjs +58 -0
- package/dist/src/aether/aether/aether.d.ts +17 -18
- package/dist/src/aether/aether/aether.d.ts.map +1 -1
- package/dist/src/aether/aether/aether.spec.spec.d.ts +1 -5
- package/dist/src/aether/aether/aether.spec.spec.d.ts.map +1 -1
- package/dist/src/aether/main.d.ts +48 -0
- package/dist/src/aether/main.d.ts.map +1 -1
- package/dist/src/aether/main.spec.d.ts +1 -5
- package/dist/src/aether/main.spec.d.ts.map +1 -1
- package/dist/src/aether/message.d.ts +11 -1
- package/dist/src/aether/message.d.ts.map +1 -1
- package/dist/src/alamos/aether/alamos.d.ts +19 -25
- package/dist/src/alamos/aether/alamos.d.ts.map +1 -1
- package/dist/src/align/Center.d.ts +2 -2
- package/dist/src/align/Center.d.ts.map +1 -1
- package/dist/src/align/Pack.d.ts +3 -3
- package/dist/src/align/Pack.d.ts.map +1 -1
- package/dist/src/align/Space.d.ts +25 -10
- package/dist/src/align/Space.d.ts.map +1 -1
- package/dist/src/align/Stack.d.ts +7 -0
- package/dist/src/align/Stack.d.ts.map +1 -0
- package/dist/src/align/external.d.ts +1 -0
- package/dist/src/align/external.d.ts.map +1 -1
- package/dist/src/breadcrumb/Breadcrumb.d.ts +2 -2
- package/dist/src/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/src/button/Button.d.ts +4 -6
- package/dist/src/button/Button.d.ts.map +1 -1
- package/dist/src/button/Icon.d.ts +4 -1
- package/dist/src/button/Icon.d.ts.map +1 -1
- package/dist/src/button/Toggle.d.ts +0 -1
- package/dist/src/button/Toggle.d.ts.map +1 -1
- package/dist/src/button/color.d.ts +2 -2
- package/dist/src/button/color.d.ts.map +1 -1
- package/dist/src/caret/Animated.d.ts +3 -2
- package/dist/src/caret/Animated.d.ts.map +1 -1
- package/dist/src/channel/LinePlot.d.ts +5 -5
- package/dist/src/channel/LinePlot.d.ts.map +1 -1
- package/dist/src/channel/Select.d.ts +3 -3
- package/dist/src/channel/Select.d.ts.map +1 -1
- package/dist/src/color/BaseSwatch.d.ts +3 -3
- package/dist/src/color/BaseSwatch.d.ts.map +1 -1
- package/dist/src/color/GradientPicker.d.ts +1 -2
- package/dist/src/color/GradientPicker.d.ts.map +1 -1
- package/dist/src/color/Picker.d.ts +1 -1
- package/dist/src/color/Picker.d.ts.map +1 -1
- package/dist/src/color/Provider.d.ts +8 -100
- package/dist/src/color/Provider.d.ts.map +1 -1
- package/dist/src/color/external.d.ts +0 -4
- package/dist/src/color/external.d.ts.map +1 -1
- package/dist/src/css/color.d.ts +2 -2
- package/dist/src/css/color.d.ts.map +1 -1
- package/dist/src/css/css.d.ts +2 -1
- package/dist/src/css/css.d.ts.map +1 -1
- package/dist/src/divider/Divider.d.ts +6 -5
- package/dist/src/divider/Divider.d.ts.map +1 -1
- package/dist/src/dropdown/Dropdown.d.ts +2 -1
- package/dist/src/dropdown/Dropdown.d.ts.map +1 -1
- package/dist/src/ether.d.ts +0 -1
- package/dist/src/ether.d.ts.map +1 -1
- package/dist/src/form/Form.d.ts +1 -1
- package/dist/src/form/Form.d.ts.map +1 -1
- package/dist/src/generic/Generic.d.ts +4 -5
- package/dist/src/generic/Generic.d.ts.map +1 -1
- package/dist/src/hardware/device/Select.d.ts.map +1 -1
- package/dist/src/haul/Haul.d.ts +7 -63
- package/dist/src/haul/Haul.d.ts.map +1 -1
- package/dist/src/hooks/useResize.d.ts.map +1 -1
- package/dist/src/icon/Icon.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/input/DateTime.d.ts.map +1 -1
- package/dist/src/input/Item.d.ts +1 -1
- package/dist/src/input/Item.d.ts.map +1 -1
- package/dist/src/input/Text.d.ts +4 -4
- package/dist/src/input/Text.d.ts.map +1 -1
- package/dist/src/input/types.d.ts +0 -1
- package/dist/src/input/types.d.ts.map +1 -1
- package/dist/src/list/Column.d.ts +3 -3
- package/dist/src/list/Column.d.ts.map +1 -1
- package/dist/src/list/Core.d.ts +1 -1
- package/dist/src/list/Core.d.ts.map +1 -1
- package/dist/src/list/Hover.d.ts +3 -2
- package/dist/src/list/Hover.d.ts.map +1 -1
- package/dist/src/list/Item.d.ts +1 -1
- package/dist/src/list/Item.d.ts.map +1 -1
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/menu/ContextMenu.d.ts +5 -3
- package/dist/src/menu/ContextMenu.d.ts.map +1 -1
- package/dist/src/menu/Item.d.ts.map +1 -1
- package/dist/src/menu/Menu.d.ts +3 -2
- package/dist/src/menu/Menu.d.ts.map +1 -1
- package/dist/src/modal/Modal.d.ts +7 -3
- package/dist/src/modal/Modal.d.ts.map +1 -1
- package/dist/src/mosaic/Mosaic.d.ts +5 -3
- package/dist/src/mosaic/Mosaic.d.ts.map +1 -1
- package/dist/src/mosaic/tree.d.ts +4 -3
- package/dist/src/mosaic/tree.d.ts.map +1 -1
- package/dist/src/mosaic/types.d.ts +6 -66
- package/dist/src/mosaic/types.d.ts.map +1 -1
- package/dist/src/nav/Bar.d.ts +2 -1
- package/dist/src/nav/Bar.d.ts.map +1 -1
- package/dist/src/nav/Drawer.d.ts +3 -2
- package/dist/src/nav/Drawer.d.ts.map +1 -1
- package/dist/src/notation/Select.d.ts +2 -3
- package/dist/src/notation/Select.d.ts.map +1 -1
- package/dist/src/notation/index.d.ts +1 -1
- package/dist/src/notation/index.d.ts.map +1 -1
- package/dist/src/os/Controls/Windows.d.ts +1 -1
- package/dist/src/os/Controls/Windows.d.ts.map +1 -1
- package/dist/src/os/Controls/types.d.ts +2 -0
- package/dist/src/os/Controls/types.d.ts.map +1 -1
- package/dist/src/pluto/Pluto.d.ts.map +1 -1
- package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
- package/dist/src/ranger/TimeRangeChip.d.ts +2 -1
- package/dist/src/ranger/TimeRangeChip.d.ts.map +1 -1
- package/dist/src/resize/Core.d.ts +5 -4
- package/dist/src/resize/Core.d.ts.map +1 -1
- package/dist/src/resize/Multiple.d.ts.map +1 -1
- package/dist/src/resize/Single.d.ts.map +1 -1
- package/dist/src/select/Button.d.ts.map +1 -1
- package/dist/src/select/List.d.ts.map +1 -1
- package/dist/src/select/Multiple.d.ts +2 -3
- package/dist/src/select/Multiple.d.ts.map +1 -1
- package/dist/src/state/state.d.ts +1 -2
- package/dist/src/state/state.d.ts.map +1 -1
- package/dist/src/status/Circle.d.ts.map +1 -1
- package/dist/src/status/Notification.d.ts.map +1 -1
- package/dist/src/status/aether/aggregator.d.ts +34 -96
- package/dist/src/status/aether/aggregator.d.ts.map +1 -1
- package/dist/src/status/aether/types.d.ts +23 -27
- package/dist/src/status/aether/types.d.ts.map +1 -1
- package/dist/src/status/colors.d.ts +1 -1
- package/dist/src/status/colors.d.ts.map +1 -1
- package/dist/src/synnax/Provider.d.ts +4 -0
- package/dist/src/synnax/Provider.d.ts.map +1 -1
- package/dist/src/synnax/aether/provider.d.ts +54 -388
- package/dist/src/synnax/aether/provider.d.ts.map +1 -1
- package/dist/src/table/aether/Table.d.ts +58 -418
- package/dist/src/table/aether/Table.d.ts.map +1 -1
- package/dist/src/table/cells/Cells.d.ts +38 -153
- package/dist/src/table/cells/Cells.d.ts.map +1 -1
- package/dist/src/table/cells/Forms.d.ts.map +1 -1
- package/dist/src/table/cells/registry.d.ts +6 -3
- package/dist/src/table/cells/registry.d.ts.map +1 -1
- package/dist/src/tabs/Selector.d.ts +5 -2
- package/dist/src/tabs/Selector.d.ts.map +1 -1
- package/dist/src/tabs/Tabs.d.ts +2 -3
- package/dist/src/tabs/Tabs.d.ts.map +1 -1
- package/dist/src/tabs/types.d.ts +5 -38
- package/dist/src/tabs/types.d.ts.map +1 -1
- package/dist/src/tag/Tag.d.ts +3 -4
- package/dist/src/tag/Tag.d.ts.map +1 -1
- package/dist/src/telem/aether/context.d.ts +8 -8
- package/dist/src/telem/aether/context.d.ts.map +1 -1
- package/dist/src/telem/aether/factory.d.ts +6 -2
- package/dist/src/telem/aether/factory.d.ts.map +1 -1
- package/dist/src/telem/aether/noop.d.ts.map +1 -1
- package/dist/src/telem/aether/pipeline.d.ts +25 -215
- package/dist/src/telem/aether/pipeline.d.ts.map +1 -1
- package/dist/src/telem/aether/provider.d.ts +7 -5
- package/dist/src/telem/aether/provider.d.ts.map +1 -1
- package/dist/src/telem/aether/remote.d.ts +62 -183
- package/dist/src/telem/aether/remote.d.ts.map +1 -1
- package/dist/src/telem/aether/static.d.ts +21 -74
- package/dist/src/telem/aether/static.d.ts.map +1 -1
- package/dist/src/telem/aether/telem.d.ts +60 -284
- package/dist/src/telem/aether/telem.d.ts.map +1 -1
- package/dist/src/telem/aether/transformers.d.ts +79 -321
- package/dist/src/telem/aether/transformers.d.ts.map +1 -1
- package/dist/src/telem/client/cache/cache.d.ts +1 -1
- package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
- package/dist/src/telem/client/cache/dynamic.d.ts +5 -5
- package/dist/src/telem/client/cache/dynamic.d.ts.map +1 -1
- package/dist/src/telem/client/cache/static.d.ts +3 -3
- package/dist/src/telem/client/cache/static.d.ts.map +1 -1
- package/dist/src/telem/client/cache/unary.d.ts +3 -3
- package/dist/src/telem/client/cache/unary.d.ts.map +1 -1
- package/dist/src/telem/client/client.d.ts +8 -12
- package/dist/src/telem/client/client.d.ts.map +1 -1
- package/dist/src/telem/client/external.d.ts +0 -1
- package/dist/src/telem/client/external.d.ts.map +1 -1
- package/dist/src/telem/client/reader.d.ts +28 -10
- package/dist/src/telem/client/reader.d.ts.map +1 -1
- package/dist/src/telem/client/reader.spec.d.ts +6 -1
- package/dist/src/telem/client/reader.spec.d.ts.map +1 -1
- package/dist/src/telem/client/streamer.d.ts +6 -6
- package/dist/src/telem/client/streamer.d.ts.map +1 -1
- package/dist/src/telem/client/streamer.spec.d.ts +2 -0
- package/dist/src/telem/client/streamer.spec.d.ts.map +1 -0
- package/dist/src/telem/control/Indicator.d.ts.map +1 -1
- package/dist/src/telem/control/aether/chip.d.ts +44 -232
- package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
- package/dist/src/telem/control/aether/controller.d.ts +36 -73
- package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
- package/dist/src/telem/control/aether/indicator.d.ts +49 -257
- package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
- package/dist/src/telem/control/aether/legend.d.ts +18 -132
- package/dist/src/telem/control/aether/legend.d.ts.map +1 -1
- package/dist/src/telem/control/aether/state.d.ts +10 -44
- package/dist/src/telem/control/aether/state.d.ts.map +1 -1
- package/dist/src/text/Editable.d.ts.map +1 -1
- package/dist/src/text/Keyboard.d.ts +1 -1
- package/dist/src/text/Keyboard.d.ts.map +1 -1
- package/dist/src/text/Text.d.ts +5 -4
- package/dist/src/text/Text.d.ts.map +1 -1
- package/dist/src/text/WithIcon.d.ts +3 -2
- package/dist/src/text/WithIcon.d.ts.map +1 -1
- package/dist/src/text/core/types.d.ts +17 -14
- package/dist/src/text/core/types.d.ts.map +1 -1
- package/dist/src/text/dimensions.d.ts +1 -0
- package/dist/src/text/dimensions.d.ts.map +1 -1
- package/dist/src/theming/Provider.d.ts.map +1 -1
- package/dist/src/theming/aether/provider.d.ts +899 -5915
- package/dist/src/theming/aether/provider.d.ts.map +1 -1
- package/dist/src/theming/core/fontString.d.ts.map +1 -1
- package/dist/src/theming/core/theme.d.ts +368 -1860
- package/dist/src/theming/core/theme.d.ts.map +1 -1
- package/dist/src/theming/css.d.ts +1 -1
- package/dist/src/theming/css.d.ts.map +1 -1
- package/dist/src/theming/static/generate.d.ts +2 -0
- package/dist/src/theming/static/generate.d.ts.map +1 -0
- package/dist/src/tooltip/Dialog.d.ts.map +1 -1
- package/dist/src/tree/Tree.d.ts +1 -1
- package/dist/src/tree/Tree.d.ts.map +1 -1
- package/dist/src/tree/core.d.ts +2 -2
- package/dist/src/tree/core.d.ts.map +1 -1
- package/dist/src/triggers/Provider.d.ts.map +1 -1
- package/dist/src/triggers/Text.d.ts.map +1 -1
- package/dist/src/triggers/hooks.d.ts +1 -0
- package/dist/src/triggers/hooks.d.ts.map +1 -1
- package/dist/src/triggers/triggers.d.ts +248 -9
- package/dist/src/triggers/triggers.d.ts.map +1 -1
- package/dist/src/util/component.d.ts +8 -2
- package/dist/src/util/component.d.ts.map +1 -1
- package/dist/src/viewport/use.d.ts +8 -1
- package/dist/src/viewport/use.d.ts.map +1 -1
- package/dist/src/vis/axis/axis.d.ts +17 -48
- package/dist/src/vis/axis/axis.d.ts.map +1 -1
- package/dist/src/vis/axis/canvas.d.ts +17 -20
- package/dist/src/vis/axis/canvas.d.ts.map +1 -1
- package/dist/src/vis/axis/preciseTimeScale.d.ts +1 -2
- package/dist/src/vis/axis/preciseTimeScale.d.ts.map +1 -1
- package/dist/src/vis/axis/ticks.d.ts +11 -11
- package/dist/src/vis/axis/ticks.d.ts.map +1 -1
- package/dist/src/vis/button/aether/button.d.ts +10 -80
- package/dist/src/vis/button/aether/button.d.ts.map +1 -1
- package/dist/src/vis/canvas/Canvas.d.ts +2 -2
- package/dist/src/vis/canvas/Canvas.d.ts.map +1 -1
- package/dist/src/vis/canvas/aether/canvas.d.ts +45 -193
- package/dist/src/vis/canvas/aether/canvas.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/Diagram.d.ts +62 -469
- package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/types.d.ts +29 -249
- package/dist/src/vis/diagram/aether/types.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/Edge.d.ts +2 -3
- package/dist/src/vis/diagram/edge/Edge.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/connector/connector.d.ts +5 -8
- package/dist/src/vis/diagram/edge/connector/connector.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/paths.d.ts +3 -4
- package/dist/src/vis/diagram/edge/paths.d.ts.map +1 -1
- package/dist/src/vis/draw2d/canvas.d.ts +21 -3
- package/dist/src/vis/draw2d/canvas.d.ts.map +1 -1
- package/dist/src/vis/draw2d/index.d.ts +18 -4
- package/dist/src/vis/draw2d/index.d.ts.map +1 -1
- package/dist/src/vis/eraser/aether/eraser.d.ts +30 -170
- package/dist/src/vis/eraser/aether/eraser.d.ts.map +1 -1
- package/dist/src/vis/eraser/use.d.ts +2 -2
- package/dist/src/vis/eraser/use.d.ts.map +1 -1
- package/dist/src/vis/grid/grid.d.ts +14 -24
- package/dist/src/vis/grid/grid.d.ts.map +1 -1
- package/dist/src/vis/legend/Container.d.ts +41 -85
- package/dist/src/vis/legend/Container.d.ts.map +1 -1
- package/dist/src/vis/legend/Simple.d.ts +11 -4
- package/dist/src/vis/legend/Simple.d.ts.map +1 -1
- package/dist/src/vis/light/aether/light.d.ts +10 -80
- package/dist/src/vis/light/aether/light.d.ts.map +1 -1
- package/dist/src/vis/line/aether/line.d.ts +19 -101
- package/dist/src/vis/line/aether/line.d.ts.map +1 -1
- package/dist/src/vis/lineplot/Axis.d.ts.map +1 -1
- package/dist/src/vis/lineplot/Legend.d.ts.map +1 -1
- package/dist/src/vis/lineplot/LinePlot.d.ts +2 -3
- package/dist/src/vis/lineplot/LinePlot.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/BoundQuerier.d.ts +35 -0
- package/dist/src/vis/lineplot/aether/BoundQuerier.d.ts.map +1 -0
- package/dist/src/vis/lineplot/aether/LinePlot.d.ts +82 -489
- package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/XAxis.d.ts +51 -191
- package/dist/src/vis/lineplot/aether/XAxis.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/YAxis.d.ts +49 -194
- package/dist/src/vis/lineplot/aether/YAxis.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/axis.d.ts +27 -98
- package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/external.d.ts +1 -0
- package/dist/src/vis/lineplot/aether/external.d.ts.map +1 -1
- package/dist/src/vis/lineplot/external.d.ts +1 -0
- package/dist/src/vis/lineplot/external.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/Provider.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/aether/annotation.d.ts +15 -52
- package/dist/src/vis/lineplot/range/aether/annotation.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/aether/provider.d.ts +43 -294
- package/dist/src/vis/lineplot/range/aether/provider.d.ts.map +1 -1
- package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts +17 -154
- package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts.map +1 -1
- package/dist/src/vis/lineplot/useBoundQuerier.d.ts +11 -0
- package/dist/src/vis/lineplot/useBoundQuerier.d.ts.map +1 -0
- package/dist/src/vis/log/Log.d.ts.map +1 -1
- package/dist/src/vis/log/aether/Log.d.ts +82 -461
- package/dist/src/vis/log/aether/Log.d.ts.map +1 -1
- package/dist/src/vis/measure/aether/measure.d.ts +24 -249
- package/dist/src/vis/measure/aether/measure.d.ts.map +1 -1
- package/dist/src/vis/performance/Performance.d.ts +2 -0
- package/dist/src/vis/performance/Performance.d.ts.map +1 -0
- package/dist/src/vis/performance/aether/index.d.ts +2 -0
- package/dist/src/vis/performance/aether/index.d.ts.map +1 -0
- package/dist/src/vis/performance/aether/performance.d.ts +15 -0
- package/dist/src/vis/performance/aether/performance.d.ts.map +1 -0
- package/dist/src/vis/performance/index.d.ts +2 -0
- package/dist/src/vis/performance/index.d.ts.map +1 -0
- package/dist/src/vis/render/GLProgram.d.ts +1 -2
- package/dist/src/vis/render/GLProgram.d.ts.map +1 -1
- package/dist/src/vis/render/context.d.ts +1 -0
- package/dist/src/vis/render/context.d.ts.map +1 -1
- package/dist/src/vis/render/controller.d.ts +7 -12
- package/dist/src/vis/render/controller.d.ts.map +1 -1
- package/dist/src/vis/render/loop.d.ts +15 -5
- package/dist/src/vis/render/loop.d.ts.map +1 -1
- package/dist/src/vis/rule/Rule.d.ts +1 -1
- package/dist/src/vis/rule/Rule.d.ts.map +1 -1
- package/dist/src/vis/rule/aether/aether.d.ts +8 -57
- package/dist/src/vis/rule/aether/aether.d.ts.map +1 -1
- package/dist/src/vis/schematic/Forms.d.ts +7 -1
- package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
- package/dist/src/vis/schematic/Symbols.d.ts +57 -9
- package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
- package/dist/src/vis/schematic/primitives/Primitives.d.ts +68 -29
- package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
- package/dist/src/vis/schematic/registry.d.ts +96 -1
- package/dist/src/vis/schematic/registry.d.ts.map +1 -1
- package/dist/src/vis/setpoint/aether/setpoint.d.ts +16 -155
- package/dist/src/vis/setpoint/aether/setpoint.d.ts.map +1 -1
- package/dist/src/vis/text/atlas.d.ts +32 -0
- package/dist/src/vis/text/atlas.d.ts.map +1 -0
- package/dist/src/vis/text/index.d.ts +2 -0
- package/dist/src/vis/text/index.d.ts.map +1 -0
- package/dist/src/vis/toggle/aether/toggle.d.ts +16 -150
- package/dist/src/vis/toggle/aether/toggle.d.ts.map +1 -1
- package/dist/src/vis/value/Form.d.ts.map +1 -1
- package/dist/src/vis/value/aether/value.d.ts +144 -569
- package/dist/src/vis/value/aether/value.d.ts.map +1 -1
- package/dist/src/vis/value/use.d.ts +55 -199
- package/dist/src/vis/value/use.d.ts.map +1 -1
- package/dist/state-CjGemC7S.js +88 -0
- package/dist/state-_FFrG5nH.cjs +1 -0
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -2
- package/dist/theme.css +1600 -0
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/{toArray-Dvn9FA_3.js → toArray-B7nD2CTw.js} +1 -1
- package/dist/{toArray-DRKOku1s.cjs → toArray-BvVYuN_b.cjs} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/units-CKKNRQlP.cjs +1 -0
- package/dist/units-a8CggrTe.js +11 -0
- package/dist/{useClickOutside-N6MHxbOe.js → useClickOutside-CKMnqdvH.js} +20 -21
- package/dist/useClickOutside-CPAEkvf8.cjs +1 -0
- package/dist/{useDebouncedCallback-D4Ec7whQ.js → useDebouncedCallback-Cyd6pZ59.js} +1 -1
- package/dist/useDebouncedCallback-DsKlBI86.cjs +1 -0
- package/dist/{useMemoCompare-Cq_C2ddc.js → useMemoCompare-B930TM0g.js} +2 -2
- package/dist/useMemoCompare-DprA41gC.cjs +1 -0
- package/dist/{useVirtualCursorDragWebKit-BBTGd7Xe.js → useVirtualCursorDragWebKit-BrSOJpYY.js} +5 -5
- package/dist/useVirtualCursorDragWebKit-Cvp93Pya.cjs +1 -0
- package/dist/value-B7u8K1CW.cjs +57 -0
- package/dist/value-BdZLWVof.js +5974 -0
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +22 -19
- package/dist/Center-bD2cOjI8.cjs +0 -1
- package/dist/ContextMenu-BXNN2_7t.js +0 -101
- package/dist/ContextMenu-CNSewKSD.cjs +0 -1
- package/dist/DateTime-BfnGq6C2.cjs +0 -1
- package/dist/Divider-CJNDIsD4.cjs +0 -22
- package/dist/Dropdown-CL7BefC8.cjs +0 -1
- package/dist/Dropdown-D-aMufnM.js +0 -261
- package/dist/Haul-4OcHX8__.cjs +0 -1
- package/dist/Item-CW2A2nuL.js +0 -108
- package/dist/Item-CpAZC-dF.cjs +0 -1
- package/dist/Keyboard-DHGtnfsf.cjs +0 -1
- package/dist/Pack-C4NdZWyf.cjs +0 -1
- package/dist/Pack-UzJJ9OhY.js +0 -46
- package/dist/Provider-BH1uv6QX.js +0 -436
- package/dist/Provider-lJARiq5i.cjs +0 -1
- package/dist/Space-BrQoodma.cjs +0 -1
- package/dist/Space-I_hidXYi.js +0 -76
- package/dist/Text-C-o1z9sP.js +0 -124
- package/dist/Text-C_j_F67Q.cjs +0 -1
- package/dist/Text-ClTuQXMF.cjs +0 -4
- package/dist/Text-DEbr1cmH.cjs +0 -1
- package/dist/Text-DVv04lTs.js +0 -32
- package/dist/Toggle-CYB9Vt6b.cjs +0 -1
- package/dist/Toggle-v77mEVLE.js +0 -356
- package/dist/WithIcon-BnDZ-Qu7.js +0 -92
- package/dist/WithIcon-tr8ELI3W.cjs +0 -1
- package/dist/aggregator-AgOKLWHz.js +0 -83
- package/dist/aggregator-QqWwGnYH.cjs +0 -1
- package/dist/css-CU7tous7.cjs +0 -1
- package/dist/css-rxwBYwM1.js +0 -1194
- package/dist/deep-DsH2ji6Z.cjs +0 -1
- package/dist/deep-T1-57GfG.js +0 -105
- package/dist/dimensions-C9PXLcE0.js +0 -18
- package/dist/dimensions-e5IPRZhn.cjs +0 -1
- package/dist/eraser-D2I1qgOg.cjs +0 -11
- package/dist/eraser-Dmishn8h.js +0 -823
- package/dist/external-B1ttDWzy.cjs +0 -1
- package/dist/external-BWb18P9x.cjs +0 -46
- package/dist/external-BdxbwUpI.js +0 -343
- package/dist/external-BpvGU0dZ.cjs +0 -1
- package/dist/external-C7Hy9XdI.js +0 -418
- package/dist/external-CqhOyYDl.cjs +0 -1
- package/dist/external-Csg4_wkz.js +0 -15
- package/dist/external-CwvJvXL5.cjs +0 -1
- package/dist/external-Cztvb3-K.cjs +0 -1
- package/dist/external-DMEzx_kb.cjs +0 -1
- package/dist/external-DkQnAvKo.cjs +0 -1
- package/dist/fontString-C7H8Imxd.cjs +0 -1
- package/dist/fontString-DdV9bi9l.js +0 -12
- package/dist/hooks-B7ZV7Hz6.js +0 -293
- package/dist/hooks-CJnV8Pt4.cjs +0 -1
- package/dist/provider-BrBEjlx5.cjs +0 -53
- package/dist/provider-Dq9t3iAH.js +0 -10312
- package/dist/src/color/core/color.d.ts +0 -143
- package/dist/src/color/core/color.d.ts.map +0 -1
- package/dist/src/color/core/color.spec.d.ts +0 -2
- package/dist/src/color/core/color.spec.d.ts.map +0 -1
- package/dist/src/color/core/external.d.ts +0 -5
- package/dist/src/color/core/external.d.ts.map +0 -1
- package/dist/src/color/core/gradient.d.ts +0 -58
- package/dist/src/color/core/gradient.d.ts.map +0 -1
- package/dist/src/color/core/index.d.ts +0 -2
- package/dist/src/color/core/index.d.ts.map +0 -1
- package/dist/src/color/core/palette.d.ts +0 -74
- package/dist/src/color/core/palette.d.ts.map +0 -1
- package/dist/src/color/core/transformColorsToHex.d.ts +0 -6
- package/dist/src/color/core/transformColorsToHex.d.ts.map +0 -1
- package/dist/src/notation/external.d.ts +0 -3
- package/dist/src/notation/external.d.ts.map +0 -1
- package/dist/src/notation/notation.d.ts +0 -33
- package/dist/src/notation/notation.d.ts.map +0 -1
- package/dist/src/notation/notation.spec.d.ts +0 -2
- package/dist/src/notation/notation.spec.d.ts.map +0 -1
- package/dist/src/telem/client/types.d.ts +0 -20
- package/dist/src/telem/client/types.d.ts.map +0 -1
- package/dist/state-CUPEHHgf.js +0 -2405
- package/dist/state-LaBGf4_k.cjs +0 -15
- package/dist/transformColorsToHex-B2Bui-Wf.cjs +0 -1
- package/dist/transformColorsToHex-B6dG2LA6.js +0 -14
- package/dist/units-CvIf5nF_.cjs +0 -1
- package/dist/units-D7qkgH-s.js +0 -8
- package/dist/useClickOutside-PFl3AvPU.cjs +0 -1
- package/dist/useDebouncedCallback-vg2DKTH7.cjs +0 -1
- package/dist/useMemoCompare-BGEWpAJU.cjs +0 -1
- package/dist/useVirtualCursorDragWebKit-Rnok8Nft.cjs +0 -1
- package/dist/value-C6JZdCF2.cjs +0 -57
- package/dist/value-Dk2DJbst.js +0 -5911
- /package/dist/{Pack-BbwDtaE6.cjs → Stack-BbwDtaE6.cjs} +0 -0
- /package/dist/{Pack-D50qN0Vu.js → Stack-D50qN0Vu.js} +0 -0
package/dist/state-CUPEHHgf.js
DELETED
|
@@ -1,2405 +0,0 @@
|
|
|
1
|
-
import { z as ve, A as Ge, E as D, F as z, H as he, I as Z, U as Ye, V as Ze } from "./css-rxwBYwM1.js";
|
|
2
|
-
import { z as u } from "zod";
|
|
3
|
-
import { useState as ue } from "react";
|
|
4
|
-
const Se = (r) => r != null && typeof r == "object" && !Array.isArray(r);
|
|
5
|
-
var Je = Object.defineProperty, We = (r, e, t) => e in r ? Je(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, V = (r, e, t) => We(r, typeof e != "symbol" ? e + "" : e, t);
|
|
6
|
-
let He = class {
|
|
7
|
-
constructor() {
|
|
8
|
-
V(this, "contentType", "application/json"), V(this, "decoder"), V(this, "encoder"), this.decoder = new TextDecoder(), this.encoder = new TextEncoder();
|
|
9
|
-
}
|
|
10
|
-
encode(e) {
|
|
11
|
-
return this.encoder.encode(this.encodeString(e)).buffer;
|
|
12
|
-
}
|
|
13
|
-
decode(e, t) {
|
|
14
|
-
return this.decodeString(this.decoder.decode(e), t);
|
|
15
|
-
}
|
|
16
|
-
decodeString(e, t) {
|
|
17
|
-
const n = JSON.parse(e), s = ve(n);
|
|
18
|
-
return t != null ? t.parse(s) : s;
|
|
19
|
-
}
|
|
20
|
-
encodeString(e) {
|
|
21
|
-
const t = Ge(e);
|
|
22
|
-
return JSON.stringify(t, (n, s) => ArrayBuffer.isView(s) ? Array.from(s) : Se(s) && "encode_value" in s ? typeof s.value == "bigint" ? s.value.toString() : s.value : typeof s == "bigint" ? s.toString() : s);
|
|
23
|
-
}
|
|
24
|
-
static registerCustomType() {
|
|
25
|
-
}
|
|
26
|
-
}, Ke = class {
|
|
27
|
-
constructor() {
|
|
28
|
-
V(this, "contentType", "text/csv");
|
|
29
|
-
}
|
|
30
|
-
encode(e) {
|
|
31
|
-
const t = this.encodeString(e);
|
|
32
|
-
return new TextEncoder().encode(t).buffer;
|
|
33
|
-
}
|
|
34
|
-
decode(e, t) {
|
|
35
|
-
const n = new TextDecoder().decode(e);
|
|
36
|
-
return this.decodeString(n, t);
|
|
37
|
-
}
|
|
38
|
-
encodeString(e) {
|
|
39
|
-
if (!Array.isArray(e) || e.length === 0 || !Se(e[0]))
|
|
40
|
-
throw new Error("Payload must be an array of objects");
|
|
41
|
-
const t = Object.keys(e[0]), n = [t.join(",")];
|
|
42
|
-
return e.forEach((s) => {
|
|
43
|
-
const a = t.map((l) => JSON.stringify(s[l] ?? ""));
|
|
44
|
-
n.push(a.join(","));
|
|
45
|
-
}), n.join(`
|
|
46
|
-
`);
|
|
47
|
-
}
|
|
48
|
-
decodeString(e, t) {
|
|
49
|
-
const [n, ...s] = e.trim().split(`
|
|
50
|
-
`).map((m) => m.trim());
|
|
51
|
-
if (n.length === 0)
|
|
52
|
-
return t != null ? t.parse({}) : {};
|
|
53
|
-
const a = n.split(",").map((m) => m.trim()), l = {};
|
|
54
|
-
return a.forEach((m) => {
|
|
55
|
-
l[m] = [];
|
|
56
|
-
}), s.forEach((m) => {
|
|
57
|
-
const f = m.split(",").map((g) => g.trim());
|
|
58
|
-
a.forEach((g, v) => {
|
|
59
|
-
const c = this.parseValue(f[v]);
|
|
60
|
-
c != null && l[g].push(c);
|
|
61
|
-
});
|
|
62
|
-
}), t != null ? t.parse(l) : l;
|
|
63
|
-
}
|
|
64
|
-
parseValue(e) {
|
|
65
|
-
if (e == null || e.length === 0) return null;
|
|
66
|
-
const t = Number(e);
|
|
67
|
-
return isNaN(t) ? e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e : t;
|
|
68
|
-
}
|
|
69
|
-
static registerCustomType() {
|
|
70
|
-
}
|
|
71
|
-
}, Xe = class {
|
|
72
|
-
constructor() {
|
|
73
|
-
V(this, "contentType", "text/plain");
|
|
74
|
-
}
|
|
75
|
-
encode(e) {
|
|
76
|
-
return new TextEncoder().encode(e).buffer;
|
|
77
|
-
}
|
|
78
|
-
decode(e, t) {
|
|
79
|
-
const n = new TextDecoder().decode(e);
|
|
80
|
-
return t != null ? t.parse(n) : n;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
const J = new He();
|
|
84
|
-
new Ke();
|
|
85
|
-
new Xe();
|
|
86
|
-
const ne = (r) => [...new Set(r)], Qe = (r, e, t = !0) => {
|
|
87
|
-
const n = /* @__PURE__ */ new Map();
|
|
88
|
-
return r.forEach((s) => {
|
|
89
|
-
const a = e(s);
|
|
90
|
-
if (n.has(a)) {
|
|
91
|
-
if (t) return;
|
|
92
|
-
n.delete(a);
|
|
93
|
-
}
|
|
94
|
-
n.set(a, s);
|
|
95
|
-
}), Array.from(n.values());
|
|
96
|
-
}, Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
97
|
-
__proto__: null,
|
|
98
|
-
by: Qe,
|
|
99
|
-
unique: ne
|
|
100
|
-
}, Symbol.toStringTag, { value: "Module" })), Ne = (r) => r != null && typeof r == "object" && "toString" in r, vr = (r) => {
|
|
101
|
-
if (Ne(r)) return (r == null ? void 0 : r.toString().length) === 0;
|
|
102
|
-
switch (typeof r) {
|
|
103
|
-
case "string":
|
|
104
|
-
return r.length === 0;
|
|
105
|
-
case "number":
|
|
106
|
-
return r === 0;
|
|
107
|
-
case "bigint":
|
|
108
|
-
return r === 0n;
|
|
109
|
-
case "boolean":
|
|
110
|
-
return !r;
|
|
111
|
-
case "undefined":
|
|
112
|
-
return !0;
|
|
113
|
-
case "object":
|
|
114
|
-
return r === null;
|
|
115
|
-
}
|
|
116
|
-
}, _ = (r, e = !1) => {
|
|
117
|
-
const t = Ne(r) ? "stringer" : typeof r;
|
|
118
|
-
let n;
|
|
119
|
-
switch (t) {
|
|
120
|
-
case "string":
|
|
121
|
-
n = (s, a) => s.localeCompare(a);
|
|
122
|
-
break;
|
|
123
|
-
case "stringer":
|
|
124
|
-
n = (s, a) => s.toString().localeCompare(a.toString());
|
|
125
|
-
break;
|
|
126
|
-
case "number":
|
|
127
|
-
n = (s, a) => Number(s) - Number(a);
|
|
128
|
-
break;
|
|
129
|
-
case "bigint":
|
|
130
|
-
n = (s, a) => BigInt(s) - BigInt(a) > 0n ? 1 : -1;
|
|
131
|
-
break;
|
|
132
|
-
case "boolean":
|
|
133
|
-
n = (s, a) => Number(s) - Number(a);
|
|
134
|
-
break;
|
|
135
|
-
case "undefined":
|
|
136
|
-
n = () => 0;
|
|
137
|
-
break;
|
|
138
|
-
default:
|
|
139
|
-
return console.warn(`sortFunc: unknown type ${t}`), () => -1;
|
|
140
|
-
}
|
|
141
|
-
return e ? Ae(n) : n;
|
|
142
|
-
}, _e = (r, e, t) => {
|
|
143
|
-
const n = _(e[r], t);
|
|
144
|
-
return (s, a) => n(s[r], a[r]);
|
|
145
|
-
}, et = (r, e) => r.length !== e.length ? r.length - e.length : r.every((t, n) => t === e[n]) ? 0 : -1, Ie = (r, e) => {
|
|
146
|
-
if (r.length !== e.length) return r.length - e.length;
|
|
147
|
-
if (r.length === 0) return 0;
|
|
148
|
-
const t = _(r[0]), n = [...r].sort(t), s = [...e].sort(t);
|
|
149
|
-
return n.every((a, l) => a === s[l]) ? 0 : -1;
|
|
150
|
-
}, tt = (r, e) => {
|
|
151
|
-
const t = ne(r), n = ne(e);
|
|
152
|
-
return Ie(t, n);
|
|
153
|
-
}, rt = (r, e) => r === e ? 0 : r === "first" && e === "last" ? 1 : -1, Ae = (r) => (e, t) => r(t, e), L = 0, W = -1, H = 1, Ee = (r) => r < L, $e = (r) => r > L, nt = (r) => r >= L, Me = (r) => r === L, st = (r, e) => {
|
|
154
|
-
const t = /([a-zA-Z]+)|(\d+)/g, n = r.replace(/[\s_.-]+/g, "").match(t), s = e.replace(/[\s_.-]+/g, "").match(t);
|
|
155
|
-
if (!n || !s) return 0;
|
|
156
|
-
for (let a = 0; a < Math.min(n.length, s.length); a++) {
|
|
157
|
-
const l = n[a], m = s[a];
|
|
158
|
-
if (isNaN(Number(l)) && isNaN(Number(m))) {
|
|
159
|
-
const f = l.localeCompare(m);
|
|
160
|
-
if (f !== 0) return f;
|
|
161
|
-
} else if (!isNaN(Number(l)) && !isNaN(Number(m))) {
|
|
162
|
-
const f = Number(l) - Number(m);
|
|
163
|
-
if (f !== 0) return f;
|
|
164
|
-
} else return isNaN(Number(l)) ? -1 : 1;
|
|
165
|
-
}
|
|
166
|
-
return n.length - s.length;
|
|
167
|
-
}, Sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
168
|
-
__proto__: null,
|
|
169
|
-
EQUAL: L,
|
|
170
|
-
GREATER_THAN: H,
|
|
171
|
-
LESS_THAN: W,
|
|
172
|
-
isEqualTo: Me,
|
|
173
|
-
isGreaterThan: $e,
|
|
174
|
-
isGreaterThanEqual: nt,
|
|
175
|
-
isLessThan: Ee,
|
|
176
|
-
newF: _,
|
|
177
|
-
newFieldF: _e,
|
|
178
|
-
order: rt,
|
|
179
|
-
primitiveArrays: et,
|
|
180
|
-
reverseF: Ae,
|
|
181
|
-
stringsWithNumbers: st,
|
|
182
|
-
uniqueUnorderedPrimitiveArrays: tt,
|
|
183
|
-
unorderedPrimitiveArrays: Ie
|
|
184
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
185
|
-
var it = Object.defineProperty, at = (r, e, t) => e in r ? it(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, i = (r, e, t) => at(r, typeof e != "symbol" ? e + "" : e, t);
|
|
186
|
-
let ot = (r, e = 21) => (t = e) => {
|
|
187
|
-
let n = "", s = t | 0;
|
|
188
|
-
for (; s--; )
|
|
189
|
-
n += r[Math.random() * r.length | 0];
|
|
190
|
-
return n;
|
|
191
|
-
};
|
|
192
|
-
const ut = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", lt = ot(ut, 11), Be = () => lt(), Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
193
|
-
__proto__: null,
|
|
194
|
-
create: Be
|
|
195
|
-
}, Symbol.toStringTag, { value: "Module" })), ht = u.enum(["static", "dynamic"]), Ue = (r, e) => {
|
|
196
|
-
const t = new w(e);
|
|
197
|
-
if (![
|
|
198
|
-
O.DAY,
|
|
199
|
-
O.HOUR,
|
|
200
|
-
O.MINUTE,
|
|
201
|
-
O.SECOND,
|
|
202
|
-
O.MILLISECOND,
|
|
203
|
-
O.MICROSECOND,
|
|
204
|
-
O.NANOSECOND
|
|
205
|
-
].some((s) => s.equals(t)))
|
|
206
|
-
throw new Error(
|
|
207
|
-
"Invalid argument for remainder. Must be an even TimeSpan or Timestamp"
|
|
208
|
-
);
|
|
209
|
-
const n = r.valueOf() % t.valueOf();
|
|
210
|
-
return r instanceof w ? new w(n) : new O(n);
|
|
211
|
-
}, y = class h {
|
|
212
|
-
constructor(e, t = "UTC") {
|
|
213
|
-
if (i(this, "value"), i(this, "encodeValue", !0), e == null) this.value = h.now().valueOf();
|
|
214
|
-
else if (e instanceof Date)
|
|
215
|
-
this.value = BigInt(e.getTime()) * h.MILLISECOND.valueOf();
|
|
216
|
-
else if (typeof e == "string")
|
|
217
|
-
this.value = h.parseDateTimeString(e, t).valueOf();
|
|
218
|
-
else if (Array.isArray(e)) this.value = h.parseDate(e);
|
|
219
|
-
else {
|
|
220
|
-
let n = BigInt(0);
|
|
221
|
-
e instanceof Number && (e = e.valueOf()), t === "local" && (n = h.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e = Math.trunc(e) : (isNaN(e) && (e = 0), e === 1 / 0 ? e = h.MAX : e = h.MIN)), this.value = BigInt(e.valueOf()) + n;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
static parseDate([e = 1970, t = 1, n = 1]) {
|
|
225
|
-
const s = new Date(e, t - 1, n, 0, 0, 0, 0);
|
|
226
|
-
return new h(BigInt(s.getTime()) * h.MILLISECOND.valueOf()).truncate(h.DAY).valueOf();
|
|
227
|
-
}
|
|
228
|
-
encode() {
|
|
229
|
-
return this.value.toString();
|
|
230
|
-
}
|
|
231
|
-
valueOf() {
|
|
232
|
-
return this.value;
|
|
233
|
-
}
|
|
234
|
-
static parseTimeString(e, t = "UTC") {
|
|
235
|
-
const [n, s, a] = e.split(":");
|
|
236
|
-
let l = "00", m = "00";
|
|
237
|
-
a != null && ([l, m] = a.split("."));
|
|
238
|
-
let f = h.hours(parseInt(n ?? "00")).add(h.minutes(parseInt(s ?? "00"))).add(h.seconds(parseInt(l ?? "00"))).add(h.milliseconds(parseInt(m ?? "00")));
|
|
239
|
-
return t === "local" && (f = f.add(h.utcOffset)), f.valueOf();
|
|
240
|
-
}
|
|
241
|
-
static parseDateTimeString(e, t = "UTC") {
|
|
242
|
-
if (!e.includes("/") && !e.includes("-"))
|
|
243
|
-
return h.parseTimeString(e, t);
|
|
244
|
-
const n = new Date(e);
|
|
245
|
-
return e.includes(":") || n.setUTCHours(0, 0, 0, 0), new h(
|
|
246
|
-
BigInt(n.getTime()) * h.MILLISECOND.valueOf(),
|
|
247
|
-
t
|
|
248
|
-
).valueOf();
|
|
249
|
-
}
|
|
250
|
-
fString(e = "ISO", t = "UTC") {
|
|
251
|
-
switch (e) {
|
|
252
|
-
case "ISODate":
|
|
253
|
-
return this.toISOString(t).slice(0, 10);
|
|
254
|
-
case "ISOTime":
|
|
255
|
-
return this.toISOString(t).slice(11, 23);
|
|
256
|
-
case "time":
|
|
257
|
-
return this.timeString(!1, t);
|
|
258
|
-
case "preciseTime":
|
|
259
|
-
return this.timeString(!0, t);
|
|
260
|
-
case "date":
|
|
261
|
-
return this.dateString();
|
|
262
|
-
case "preciseDate":
|
|
263
|
-
return `${this.dateString()} ${this.timeString(!0, t)}`;
|
|
264
|
-
case "dateTime":
|
|
265
|
-
return `${this.dateString()} ${this.timeString(!1, t)}`;
|
|
266
|
-
default:
|
|
267
|
-
return this.toISOString(t);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
toISOString(e = "UTC") {
|
|
271
|
-
return e === "UTC" ? this.date().toISOString() : this.sub(h.utcOffset).date().toISOString();
|
|
272
|
-
}
|
|
273
|
-
timeString(e = !1, t = "UTC") {
|
|
274
|
-
const n = this.toISOString(t);
|
|
275
|
-
return e ? n.slice(11, 23) : n.slice(11, 19);
|
|
276
|
-
}
|
|
277
|
-
dateString() {
|
|
278
|
-
const e = this.date(), t = e.toLocaleString("default", { month: "short" }), n = e.toLocaleString("default", { day: "numeric" });
|
|
279
|
-
return `${t} ${n}`;
|
|
280
|
-
}
|
|
281
|
-
static get utcOffset() {
|
|
282
|
-
return new O(
|
|
283
|
-
BigInt((/* @__PURE__ */ new Date()).getTimezoneOffset()) * h.MINUTE.valueOf()
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* @returns a TimeSpan representing the amount time elapsed since
|
|
288
|
-
* the other timestamp.
|
|
289
|
-
* @param other - The other timestamp.
|
|
290
|
-
*/
|
|
291
|
-
static since(e) {
|
|
292
|
-
return new h().span(e);
|
|
293
|
-
}
|
|
294
|
-
/** @returns A JavaScript Date object representing the TimeStamp. */
|
|
295
|
-
date() {
|
|
296
|
-
return new Date(this.milliseconds);
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Checks if the TimeStamp is equal to another TimeStamp.
|
|
300
|
-
*
|
|
301
|
-
* @param other - The other TimeStamp to compare to.
|
|
302
|
-
* @returns True if the TimeStamps are equal, false otherwise.
|
|
303
|
-
*/
|
|
304
|
-
equals(e) {
|
|
305
|
-
return this.valueOf() === new h(e).valueOf();
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* Creates a TimeSpan representing the duration between the two timestamps.
|
|
309
|
-
*
|
|
310
|
-
* @param other - The other TimeStamp to compare to.
|
|
311
|
-
* @returns A TimeSpan representing the duration between the two timestamps.
|
|
312
|
-
* The span is guaranteed to be positive.
|
|
313
|
-
*/
|
|
314
|
-
span(e) {
|
|
315
|
-
return this.range(e).span;
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Creates a TimeRange spanning the given TimeStamp.
|
|
319
|
-
*
|
|
320
|
-
* @param other - The other TimeStamp to compare to.
|
|
321
|
-
* @returns A TimeRange spanning the given TimeStamp that is guaranteed to be
|
|
322
|
-
* valid, regardless of the TimeStamp order.
|
|
323
|
-
*/
|
|
324
|
-
range(e) {
|
|
325
|
-
return new G(this, e).makeValid();
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Creates a TimeRange starting at the TimeStamp and spanning the given
|
|
329
|
-
* TimeSpan.
|
|
330
|
-
*
|
|
331
|
-
* @param other - The TimeSpan to span.
|
|
332
|
-
* @returns A TimeRange starting at the TimeStamp and spanning the given
|
|
333
|
-
* TimeSpan. The TimeRange is guaranteed to be valid.
|
|
334
|
-
*/
|
|
335
|
-
spanRange(e) {
|
|
336
|
-
return this.range(this.add(e)).makeValid();
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Checks if the TimeStamp represents the unix epoch.
|
|
340
|
-
*
|
|
341
|
-
* @returns True if the TimeStamp represents the unix epoch, false otherwise.
|
|
342
|
-
*/
|
|
343
|
-
get isZero() {
|
|
344
|
-
return this.valueOf() === BigInt(0);
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Checks if the TimeStamp is after the given TimeStamp.
|
|
348
|
-
*
|
|
349
|
-
* @param other - The other TimeStamp to compare to.
|
|
350
|
-
* @returns True if the TimeStamp is after the given TimeStamp, false
|
|
351
|
-
* otherwise.
|
|
352
|
-
*/
|
|
353
|
-
after(e) {
|
|
354
|
-
return this.valueOf() > new h(e).valueOf();
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Checks if the TimeStamp is after or equal to the given TimeStamp.
|
|
358
|
-
*
|
|
359
|
-
* @param other - The other TimeStamp to compare to.
|
|
360
|
-
* @returns True if the TimeStamp is after or equal to the given TimeStamp,
|
|
361
|
-
* false otherwise.
|
|
362
|
-
*/
|
|
363
|
-
afterEq(e) {
|
|
364
|
-
return this.valueOf() >= new h(e).valueOf();
|
|
365
|
-
}
|
|
366
|
-
/**
|
|
367
|
-
* Checks if the TimeStamp is before the given TimeStamp.
|
|
368
|
-
*
|
|
369
|
-
* @param other - The other TimeStamp to compare to.
|
|
370
|
-
* @returns True if the TimeStamp is before the given TimeStamp, false
|
|
371
|
-
* otherwise.
|
|
372
|
-
*/
|
|
373
|
-
before(e) {
|
|
374
|
-
return this.valueOf() < new h(e).valueOf();
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Checks if TimeStamp is before or equal to the current timestamp.
|
|
378
|
-
*
|
|
379
|
-
* @param other - The other TimeStamp to compare to.
|
|
380
|
-
* @returns True if TimeStamp is before or equal to the current timestamp,
|
|
381
|
-
* false otherwise.
|
|
382
|
-
*/
|
|
383
|
-
beforeEq(e) {
|
|
384
|
-
return this.valueOf() <= new h(e).valueOf();
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* Adds a TimeSpan to the TimeStamp.
|
|
388
|
-
*
|
|
389
|
-
* @param span - The TimeSpan to add.
|
|
390
|
-
* @returns A new TimeStamp representing the sum of the TimeStamp and
|
|
391
|
-
* TimeSpan.
|
|
392
|
-
*/
|
|
393
|
-
add(e) {
|
|
394
|
-
return new h(this.valueOf() + BigInt(e.valueOf()));
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* Subtracts a TimeSpan from the TimeStamp.
|
|
398
|
-
*
|
|
399
|
-
* @param span - The TimeSpan to subtract.
|
|
400
|
-
* @returns A new TimeStamp representing the difference of the TimeStamp and
|
|
401
|
-
* TimeSpan.
|
|
402
|
-
*/
|
|
403
|
-
sub(e) {
|
|
404
|
-
return new h(this.valueOf() - BigInt(e.valueOf()));
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* @returns the floating point number of hours since the unix epoch to the timestamp
|
|
408
|
-
* value.
|
|
409
|
-
*/
|
|
410
|
-
get hours() {
|
|
411
|
-
return Number(this.valueOf()) / Number(O.HOUR.valueOf());
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* @returns the floating point number of minutes since the unix epoch to the timestamp
|
|
415
|
-
* value.
|
|
416
|
-
*/
|
|
417
|
-
get minutes() {
|
|
418
|
-
return Number(this.valueOf()) / Number(O.MINUTE.valueOf());
|
|
419
|
-
}
|
|
420
|
-
/**
|
|
421
|
-
* @returns the floating point number of days since the unix epoch to the timestamp
|
|
422
|
-
* value.
|
|
423
|
-
*/
|
|
424
|
-
get days() {
|
|
425
|
-
return Number(this.valueOf()) / Number(O.DAY.valueOf());
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* @returns the floating point number of seconds since the unix epoch to the timestamp
|
|
429
|
-
* value.
|
|
430
|
-
*/
|
|
431
|
-
get seconds() {
|
|
432
|
-
return Number(this.valueOf()) / Number(O.SECOND.valueOf());
|
|
433
|
-
}
|
|
434
|
-
/**
|
|
435
|
-
* @returns The number of milliseconds since the unix epoch.
|
|
436
|
-
*/
|
|
437
|
-
get milliseconds() {
|
|
438
|
-
return Number(this.valueOf()) / Number(h.MILLISECOND.valueOf());
|
|
439
|
-
}
|
|
440
|
-
get microseconds() {
|
|
441
|
-
return Number(this.valueOf()) / Number(h.MICROSECOND.valueOf());
|
|
442
|
-
}
|
|
443
|
-
get nanoseconds() {
|
|
444
|
-
return Number(this.valueOf());
|
|
445
|
-
}
|
|
446
|
-
/** @returns the integer year that the timestamp corresponds to. */
|
|
447
|
-
get year() {
|
|
448
|
-
return this.date().getFullYear();
|
|
449
|
-
}
|
|
450
|
-
setYear(e) {
|
|
451
|
-
const t = this.date();
|
|
452
|
-
return t.setFullYear(e), new h(t);
|
|
453
|
-
}
|
|
454
|
-
/** @returns the integer month that the timestamp corresponds to with its year. */
|
|
455
|
-
get month() {
|
|
456
|
-
return this.date().getMonth();
|
|
457
|
-
}
|
|
458
|
-
setMonth(e) {
|
|
459
|
-
const t = this.date();
|
|
460
|
-
return t.setMonth(e), new h(t);
|
|
461
|
-
}
|
|
462
|
-
/** @returns the integer day that the timestamp corresponds to within its month. */
|
|
463
|
-
get day() {
|
|
464
|
-
return this.date().getDate();
|
|
465
|
-
}
|
|
466
|
-
setDay(e) {
|
|
467
|
-
const t = this.date();
|
|
468
|
-
return t.setDate(e), new h(t);
|
|
469
|
-
}
|
|
470
|
-
/** @returns the integer hour that the timestamp corresponds to within its day. */
|
|
471
|
-
get hour() {
|
|
472
|
-
return this.date().getHours();
|
|
473
|
-
}
|
|
474
|
-
setHour(e) {
|
|
475
|
-
const t = this.date();
|
|
476
|
-
return t.setHours(e), new h(t);
|
|
477
|
-
}
|
|
478
|
-
/** @returns the integer minute that the timestamp corresponds to within its hour. */
|
|
479
|
-
get minute() {
|
|
480
|
-
return this.date().getMinutes();
|
|
481
|
-
}
|
|
482
|
-
setMinute(e) {
|
|
483
|
-
const t = this.date();
|
|
484
|
-
return t.setMinutes(e), new h(t);
|
|
485
|
-
}
|
|
486
|
-
get second() {
|
|
487
|
-
return this.date().getSeconds();
|
|
488
|
-
}
|
|
489
|
-
setSecond(e) {
|
|
490
|
-
const t = this.date();
|
|
491
|
-
return t.setSeconds(e), new h(t);
|
|
492
|
-
}
|
|
493
|
-
get millisecond() {
|
|
494
|
-
return this.date().getMilliseconds();
|
|
495
|
-
}
|
|
496
|
-
setMillisecond(e) {
|
|
497
|
-
const t = this.date();
|
|
498
|
-
return t.setMilliseconds(e), new h(t);
|
|
499
|
-
}
|
|
500
|
-
toString() {
|
|
501
|
-
return this.date().toISOString();
|
|
502
|
-
}
|
|
503
|
-
/**
|
|
504
|
-
* @returns A new TimeStamp that is the remainder of the TimeStamp divided by the
|
|
505
|
-
* given span. This is useful in cases where you want only part of a TimeStamp's value
|
|
506
|
-
* i.e. the hours, minutes, seconds, milliseconds, microseconds, and nanoseconds but
|
|
507
|
-
* not the days, years, etc.
|
|
508
|
-
*
|
|
509
|
-
* @param divisor - The TimeSpan to divide by. Must be an even TimeSpan or TimeStamp. Even
|
|
510
|
-
* means it must be a day, hour, minute, second, millisecond, or microsecond, etc.
|
|
511
|
-
*
|
|
512
|
-
* @example TimeStamp.now().remainder(TimeStamp.DAY) // => TimeStamp representing the current day
|
|
513
|
-
*/
|
|
514
|
-
remainder(e) {
|
|
515
|
-
return Ue(this, e);
|
|
516
|
-
}
|
|
517
|
-
/** @returns true if the day portion TimeStamp is today, false otherwise. */
|
|
518
|
-
get isToday() {
|
|
519
|
-
return this.truncate(O.DAY).equals(h.now().truncate(O.DAY));
|
|
520
|
-
}
|
|
521
|
-
truncate(e) {
|
|
522
|
-
return this.sub(this.remainder(e));
|
|
523
|
-
}
|
|
524
|
-
/**
|
|
525
|
-
* @returns A new TimeStamp representing the current time in UTC. It's important to
|
|
526
|
-
* note that this TimeStamp is only accurate to the millisecond level (that's the best
|
|
527
|
-
* JavaScript can do).
|
|
528
|
-
*/
|
|
529
|
-
static now() {
|
|
530
|
-
return new h(/* @__PURE__ */ new Date());
|
|
531
|
-
}
|
|
532
|
-
static max(...e) {
|
|
533
|
-
let t = h.MIN;
|
|
534
|
-
for (const n of e) {
|
|
535
|
-
const s = new h(n);
|
|
536
|
-
s.after(t) && (t = s);
|
|
537
|
-
}
|
|
538
|
-
return t;
|
|
539
|
-
}
|
|
540
|
-
static min(...e) {
|
|
541
|
-
let t = h.MAX;
|
|
542
|
-
for (const n of e) {
|
|
543
|
-
const s = new h(n);
|
|
544
|
-
s.before(t) && (t = s);
|
|
545
|
-
}
|
|
546
|
-
return t;
|
|
547
|
-
}
|
|
548
|
-
/** @returns a new TimeStamp n nanoseconds after the unix epoch */
|
|
549
|
-
static nanoseconds(e) {
|
|
550
|
-
return new h(e);
|
|
551
|
-
}
|
|
552
|
-
/** @returns a new TimeStamp n microseconds after the unix epoch */
|
|
553
|
-
static microseconds(e) {
|
|
554
|
-
return h.nanoseconds(e * 1e3);
|
|
555
|
-
}
|
|
556
|
-
/** @returns a new TimeStamp n milliseconds after the unix epoch */
|
|
557
|
-
static milliseconds(e) {
|
|
558
|
-
return h.microseconds(e * 1e3);
|
|
559
|
-
}
|
|
560
|
-
/** @returns a new TimeStamp n seconds after the unix epoch */
|
|
561
|
-
static seconds(e) {
|
|
562
|
-
return h.milliseconds(e * 1e3);
|
|
563
|
-
}
|
|
564
|
-
/** @returns a new TimeStamp n minutes after the unix epoch */
|
|
565
|
-
static minutes(e) {
|
|
566
|
-
return h.seconds(e * 60);
|
|
567
|
-
}
|
|
568
|
-
/** @returns a new TimeStamp n hours after the unix epoch */
|
|
569
|
-
static hours(e) {
|
|
570
|
-
return h.minutes(e * 60);
|
|
571
|
-
}
|
|
572
|
-
/** @returns a new TimeStamp n days after the unix epoch */
|
|
573
|
-
static days(e) {
|
|
574
|
-
return h.hours(e * 24);
|
|
575
|
-
}
|
|
576
|
-
};
|
|
577
|
-
i(y, "NANOSECOND", y.nanoseconds(1)), /** One microsecond after the unix epoch */
|
|
578
|
-
i(y, "MICROSECOND", y.microseconds(1)), /** One millisecond after the unix epoch */
|
|
579
|
-
i(y, "MILLISECOND", y.milliseconds(1)), /** One second after the unix epoch */
|
|
580
|
-
i(y, "SECOND", y.seconds(1)), /** One minute after the unix epoch */
|
|
581
|
-
i(y, "MINUTE", y.minutes(1)), /** One hour after the unix epoch */
|
|
582
|
-
i(y, "HOUR", y.hours(1)), /** One day after the unix epoch */
|
|
583
|
-
i(y, "DAY", y.days(1)), /** The maximum possible value for a timestamp */
|
|
584
|
-
i(y, "MAX", new y((1n << 63n) - 1n)), /** The minimum possible value for a timestamp */
|
|
585
|
-
i(y, "MIN", new y(0)), /** The unix epoch */
|
|
586
|
-
i(y, "ZERO", new y(0)), /** A zod schema for validating timestamps */
|
|
587
|
-
i(y, "z", u.union([
|
|
588
|
-
u.object({ value: u.bigint() }).transform((r) => new y(r.value)),
|
|
589
|
-
u.string().transform((r) => new y(BigInt(r))),
|
|
590
|
-
u.instanceof(Number).transform((r) => new y(r)),
|
|
591
|
-
u.number().transform((r) => new y(r)),
|
|
592
|
-
u.instanceof(y)
|
|
593
|
-
]));
|
|
594
|
-
let w = y;
|
|
595
|
-
const b = class d {
|
|
596
|
-
constructor(e) {
|
|
597
|
-
i(this, "value"), i(this, "encodeValue", !0), typeof e == "number" && (e = Math.trunc(e.valueOf())), this.value = BigInt(e.valueOf());
|
|
598
|
-
}
|
|
599
|
-
static fromSeconds(e) {
|
|
600
|
-
return e instanceof d ? e : e instanceof ce ? e.period : e instanceof w ? new d(e) : ["number", "bigint"].includes(typeof e) ? d.seconds(e) : new d(e);
|
|
601
|
-
}
|
|
602
|
-
static fromMilliseconds(e) {
|
|
603
|
-
return e instanceof d ? e : e instanceof ce ? e.period : e instanceof w ? new d(e) : ["number", "bigint"].includes(typeof e) ? d.milliseconds(e) : new d(e);
|
|
604
|
-
}
|
|
605
|
-
encode() {
|
|
606
|
-
return this.value.toString();
|
|
607
|
-
}
|
|
608
|
-
valueOf() {
|
|
609
|
-
return this.value;
|
|
610
|
-
}
|
|
611
|
-
lessThan(e) {
|
|
612
|
-
return this.valueOf() < new d(e).valueOf();
|
|
613
|
-
}
|
|
614
|
-
greaterThan(e) {
|
|
615
|
-
return this.valueOf() > new d(e).valueOf();
|
|
616
|
-
}
|
|
617
|
-
lessThanOrEqual(e) {
|
|
618
|
-
return this.valueOf() <= new d(e).valueOf();
|
|
619
|
-
}
|
|
620
|
-
greaterThanOrEqual(e) {
|
|
621
|
-
return this.valueOf() >= new d(e).valueOf();
|
|
622
|
-
}
|
|
623
|
-
remainder(e) {
|
|
624
|
-
return Ue(this, e);
|
|
625
|
-
}
|
|
626
|
-
truncate(e) {
|
|
627
|
-
return new d(
|
|
628
|
-
BigInt(Math.trunc(Number(this.valueOf() / e.valueOf()))) * e.valueOf()
|
|
629
|
-
);
|
|
630
|
-
}
|
|
631
|
-
toString() {
|
|
632
|
-
const e = this.truncate(d.DAY), t = this.truncate(d.HOUR), n = this.truncate(d.MINUTE), s = this.truncate(d.SECOND), a = this.truncate(d.MILLISECOND), l = this.truncate(d.MICROSECOND), m = this.truncate(d.NANOSECOND), f = e, g = t.sub(e), v = n.sub(t), c = s.sub(n), E = a.sub(s), $ = l.sub(a), le = m.sub(l);
|
|
633
|
-
let x = "";
|
|
634
|
-
return f.isZero || (x += `${f.days}d `), g.isZero || (x += `${g.hours}h `), v.isZero || (x += `${v.minutes}m `), c.isZero || (x += `${c.seconds}s `), E.isZero || (x += `${E.milliseconds}ms `), $.isZero || (x += `${$.microseconds}µs `), le.isZero || (x += `${le.nanoseconds}ns`), x.trim();
|
|
635
|
-
}
|
|
636
|
-
mult(e) {
|
|
637
|
-
return new d(this.valueOf() * BigInt(e));
|
|
638
|
-
}
|
|
639
|
-
/** @returns the decimal number of days in the timespan */
|
|
640
|
-
get days() {
|
|
641
|
-
return Number(this.valueOf()) / Number(d.DAY.valueOf());
|
|
642
|
-
}
|
|
643
|
-
/** @returns the decimal number of hours in the timespan */
|
|
644
|
-
get hours() {
|
|
645
|
-
return Number(this.valueOf()) / Number(d.HOUR.valueOf());
|
|
646
|
-
}
|
|
647
|
-
/** @returns the decimal number of minutes in the timespan */
|
|
648
|
-
get minutes() {
|
|
649
|
-
return Number(this.valueOf()) / Number(d.MINUTE.valueOf());
|
|
650
|
-
}
|
|
651
|
-
/** @returns The number of seconds in the TimeSpan. */
|
|
652
|
-
get seconds() {
|
|
653
|
-
return Number(this.valueOf()) / Number(d.SECOND.valueOf());
|
|
654
|
-
}
|
|
655
|
-
/** @returns The number of milliseconds in the TimeSpan. */
|
|
656
|
-
get milliseconds() {
|
|
657
|
-
return Number(this.valueOf()) / Number(d.MILLISECOND.valueOf());
|
|
658
|
-
}
|
|
659
|
-
get microseconds() {
|
|
660
|
-
return Number(this.valueOf()) / Number(d.MICROSECOND.valueOf());
|
|
661
|
-
}
|
|
662
|
-
get nanoseconds() {
|
|
663
|
-
return Number(this.valueOf());
|
|
664
|
-
}
|
|
665
|
-
/**
|
|
666
|
-
* Checks if the TimeSpan represents a zero duration.
|
|
667
|
-
*
|
|
668
|
-
* @returns True if the TimeSpan represents a zero duration, false otherwise.
|
|
669
|
-
*/
|
|
670
|
-
get isZero() {
|
|
671
|
-
return this.valueOf() === BigInt(0);
|
|
672
|
-
}
|
|
673
|
-
/**
|
|
674
|
-
* Checks if the TimeSpan is equal to another TimeSpan.
|
|
675
|
-
*
|
|
676
|
-
* @returns True if the TimeSpans are equal, false otherwise.
|
|
677
|
-
*/
|
|
678
|
-
equals(e) {
|
|
679
|
-
return this.valueOf() === new d(e).valueOf();
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
* Adds a TimeSpan to the TimeSpan.
|
|
683
|
-
*
|
|
684
|
-
* @returns A new TimeSpan representing the sum of the two TimeSpans.
|
|
685
|
-
*/
|
|
686
|
-
add(e) {
|
|
687
|
-
return new d(this.valueOf() + new d(e).valueOf());
|
|
688
|
-
}
|
|
689
|
-
/**
|
|
690
|
-
* Creates a TimeSpan representing the duration between the two timestamps.
|
|
691
|
-
*
|
|
692
|
-
* @param other
|
|
693
|
-
*/
|
|
694
|
-
sub(e) {
|
|
695
|
-
return new d(this.valueOf() - new d(e).valueOf());
|
|
696
|
-
}
|
|
697
|
-
/**
|
|
698
|
-
* Creates a TimeSpan representing the given number of nanoseconds.
|
|
699
|
-
*
|
|
700
|
-
* @param value - The number of nanoseconds.
|
|
701
|
-
* @returns A TimeSpan representing the given number of nanoseconds.
|
|
702
|
-
*/
|
|
703
|
-
static nanoseconds(e = 1) {
|
|
704
|
-
return new d(e);
|
|
705
|
-
}
|
|
706
|
-
/**
|
|
707
|
-
* Creates a TimeSpan representing the given number of microseconds.
|
|
708
|
-
*
|
|
709
|
-
* @param value - The number of microseconds.
|
|
710
|
-
* @returns A TimeSpan representing the given number of microseconds.
|
|
711
|
-
*/
|
|
712
|
-
static microseconds(e = 1) {
|
|
713
|
-
return d.nanoseconds(D(e, 1e3));
|
|
714
|
-
}
|
|
715
|
-
/**
|
|
716
|
-
* Creates a TimeSpan representing the given number of milliseconds.
|
|
717
|
-
*
|
|
718
|
-
* @param value - The number of milliseconds.
|
|
719
|
-
* @returns A TimeSpan representing the given number of milliseconds.
|
|
720
|
-
*/
|
|
721
|
-
static milliseconds(e = 1) {
|
|
722
|
-
return d.microseconds(D(e, 1e3));
|
|
723
|
-
}
|
|
724
|
-
/**
|
|
725
|
-
* Creates a TimeSpan representing the given number of seconds.
|
|
726
|
-
*
|
|
727
|
-
* @param value - The number of seconds.
|
|
728
|
-
* @returns A TimeSpan representing the given number of seconds.
|
|
729
|
-
*/
|
|
730
|
-
static seconds(e = 1) {
|
|
731
|
-
return d.milliseconds(D(e, 1e3));
|
|
732
|
-
}
|
|
733
|
-
/**
|
|
734
|
-
* Creates a TimeSpan representing the given number of minutes.
|
|
735
|
-
*
|
|
736
|
-
* @param value - The number of minutes.
|
|
737
|
-
* @returns A TimeSpan representing the given number of minutes.
|
|
738
|
-
*/
|
|
739
|
-
static minutes(e = 1) {
|
|
740
|
-
return d.seconds(D(e, 60));
|
|
741
|
-
}
|
|
742
|
-
/**
|
|
743
|
-
* Creates a TimeSpan representing the given number of hours.
|
|
744
|
-
*
|
|
745
|
-
* @param value - The number of hours.
|
|
746
|
-
* @returns A TimeSpan representing the given number of hours.
|
|
747
|
-
*/
|
|
748
|
-
static hours(e) {
|
|
749
|
-
return d.minutes(D(e, 60));
|
|
750
|
-
}
|
|
751
|
-
/**
|
|
752
|
-
* Creates a TimeSpan representing the given number of days.
|
|
753
|
-
*
|
|
754
|
-
* @param value - The number of days.
|
|
755
|
-
* @returns A TimeSpan representing the given number of days.
|
|
756
|
-
*/
|
|
757
|
-
static days(e) {
|
|
758
|
-
return d.hours(D(e, 24));
|
|
759
|
-
}
|
|
760
|
-
};
|
|
761
|
-
i(b, "NANOSECOND", b.nanoseconds(1)), /** A microsecond. */
|
|
762
|
-
i(b, "MICROSECOND", b.microseconds(1)), /** A millisecond. */
|
|
763
|
-
i(b, "MILLISECOND", b.milliseconds(1)), /** A second. */
|
|
764
|
-
i(b, "SECOND", b.seconds(1)), /** A minute. */
|
|
765
|
-
i(b, "MINUTE", b.minutes(1)), /** Represents an hour. */
|
|
766
|
-
i(b, "HOUR", b.hours(1)), /** Represents a day. */
|
|
767
|
-
i(b, "DAY", b.days(1)), /** The maximum possible value for a TimeSpan. */
|
|
768
|
-
i(b, "MAX", new b((1n << 63n) - 1n)), /** The minimum possible value for a TimeSpan. */
|
|
769
|
-
i(b, "MIN", new b(0)), /** The zero value for a TimeSpan. */
|
|
770
|
-
i(b, "ZERO", new b(0)), /** A zod schema for validating and transforming timespans */
|
|
771
|
-
i(b, "z", u.union([
|
|
772
|
-
u.object({ value: u.bigint() }).transform((r) => new b(r.value)),
|
|
773
|
-
u.string().transform((r) => new b(BigInt(r))),
|
|
774
|
-
u.instanceof(Number).transform((r) => new b(r)),
|
|
775
|
-
u.number().transform((r) => new b(r)),
|
|
776
|
-
u.instanceof(b)
|
|
777
|
-
]));
|
|
778
|
-
let O = b;
|
|
779
|
-
const C = class K extends Number {
|
|
780
|
-
constructor(e) {
|
|
781
|
-
e instanceof Number ? super(e.valueOf()) : super(e);
|
|
782
|
-
}
|
|
783
|
-
/** @returns a pretty string representation of the rate in the format "X Hz". */
|
|
784
|
-
toString() {
|
|
785
|
-
return `${this.valueOf()} Hz`;
|
|
786
|
-
}
|
|
787
|
-
/** @returns The number of seconds in the Rate. */
|
|
788
|
-
equals(e) {
|
|
789
|
-
return this.valueOf() === new K(e).valueOf();
|
|
790
|
-
}
|
|
791
|
-
/**
|
|
792
|
-
* Calculates the period of the Rate as a TimeSpan.
|
|
793
|
-
*
|
|
794
|
-
* @returns A TimeSpan representing the period of the Rate.
|
|
795
|
-
*/
|
|
796
|
-
get period() {
|
|
797
|
-
return O.seconds(1 / this.valueOf());
|
|
798
|
-
}
|
|
799
|
-
/**
|
|
800
|
-
* Calculates the number of samples in the given TimeSpan at this rate.
|
|
801
|
-
*
|
|
802
|
-
* @param duration - The duration to calculate the sample count from.
|
|
803
|
-
* @returns The number of samples in the given TimeSpan at this rate.
|
|
804
|
-
*/
|
|
805
|
-
sampleCount(e) {
|
|
806
|
-
return new O(e).seconds * this.valueOf();
|
|
807
|
-
}
|
|
808
|
-
/**
|
|
809
|
-
* Calculates the number of bytes in the given TimeSpan at this rate.
|
|
810
|
-
*
|
|
811
|
-
* @param span - The duration to calculate the byte count from.
|
|
812
|
-
* @param density - The density of the data in bytes per sample.
|
|
813
|
-
* @returns The number of bytes in the given TimeSpan at this rate.
|
|
814
|
-
*/
|
|
815
|
-
byteCount(e, t) {
|
|
816
|
-
return this.sampleCount(e) * new A(t).valueOf();
|
|
817
|
-
}
|
|
818
|
-
/**
|
|
819
|
-
* Calculates a TimeSpan given the number of samples at this rate.
|
|
820
|
-
*
|
|
821
|
-
* @param sampleCount - The number of samples in the span.
|
|
822
|
-
* @returns A TimeSpan that corresponds to the given number of samples.
|
|
823
|
-
*/
|
|
824
|
-
span(e) {
|
|
825
|
-
return O.seconds(e / this.valueOf());
|
|
826
|
-
}
|
|
827
|
-
/**
|
|
828
|
-
* Calculates a TimeSpan given the number of bytes at this rate.
|
|
829
|
-
*
|
|
830
|
-
* @param size - The number of bytes in the span.
|
|
831
|
-
* @param density - The density of the data in bytes per sample.
|
|
832
|
-
* @returns A TimeSpan that corresponds to the given number of bytes.
|
|
833
|
-
*/
|
|
834
|
-
byteSpan(e, t) {
|
|
835
|
-
return this.span(e.valueOf() / t.valueOf());
|
|
836
|
-
}
|
|
837
|
-
/**
|
|
838
|
-
* Creates a Rate representing the given number of Hz.
|
|
839
|
-
*
|
|
840
|
-
* @param value - The number of Hz.
|
|
841
|
-
* @returns A Rate representing the given number of Hz.
|
|
842
|
-
*/
|
|
843
|
-
static hz(e) {
|
|
844
|
-
return new K(e);
|
|
845
|
-
}
|
|
846
|
-
/**
|
|
847
|
-
* Creates a Rate representing the given number of kHz.
|
|
848
|
-
*
|
|
849
|
-
* @param value - The number of kHz.
|
|
850
|
-
* @returns A Rate representing the given number of kHz.
|
|
851
|
-
*/
|
|
852
|
-
static khz(e) {
|
|
853
|
-
return K.hz(e * 1e3);
|
|
854
|
-
}
|
|
855
|
-
};
|
|
856
|
-
i(C, "z", u.union([
|
|
857
|
-
u.number().transform((r) => new C(r)),
|
|
858
|
-
u.instanceof(Number).transform((r) => new C(r)),
|
|
859
|
-
u.instanceof(C)
|
|
860
|
-
]));
|
|
861
|
-
let ce = C;
|
|
862
|
-
const N = class extends Number {
|
|
863
|
-
/**
|
|
864
|
-
* Creates a Density representing the given number of bytes per value.
|
|
865
|
-
*
|
|
866
|
-
* @class
|
|
867
|
-
* @param value - The number of bytes per value.
|
|
868
|
-
* @returns A Density representing the given number of bytes per value.
|
|
869
|
-
*/
|
|
870
|
-
constructor(e) {
|
|
871
|
-
e instanceof Number ? super(e.valueOf()) : super(e);
|
|
872
|
-
}
|
|
873
|
-
length(e) {
|
|
874
|
-
return e.valueOf() / this.valueOf();
|
|
875
|
-
}
|
|
876
|
-
size(e) {
|
|
877
|
-
return new Q(e * this.valueOf());
|
|
878
|
-
}
|
|
879
|
-
};
|
|
880
|
-
i(N, "UNKNOWN", new N(0)), /** 128 bits per value. */
|
|
881
|
-
i(N, "BIT128", new N(16)), /** 64 bits per value. */
|
|
882
|
-
i(N, "BIT64", new N(8)), /** 32 bits per value. */
|
|
883
|
-
i(N, "BIT32", new N(4)), /** 16 bits per value. */
|
|
884
|
-
i(N, "BIT16", new N(2)), /** 8 bits per value. */
|
|
885
|
-
i(N, "BIT8", new N(1)), /** A zod schema for validating and transforming densities */
|
|
886
|
-
i(N, "z", u.union([
|
|
887
|
-
u.number().transform((r) => new N(r)),
|
|
888
|
-
u.instanceof(Number).transform((r) => new N(r)),
|
|
889
|
-
u.instanceof(N)
|
|
890
|
-
]));
|
|
891
|
-
let A = N;
|
|
892
|
-
const M = class X {
|
|
893
|
-
/**
|
|
894
|
-
* Creates a TimeRange from the given start and end TimeStamps.
|
|
895
|
-
*
|
|
896
|
-
* @param start - A TimeStamp representing the start of the range.
|
|
897
|
-
* @param end - A TimeStamp representing the end of the range.
|
|
898
|
-
*/
|
|
899
|
-
constructor(e, t) {
|
|
900
|
-
i(this, "start"), i(this, "end"), typeof e == "object" && "start" in e ? (this.start = new w(e.start), this.end = new w(e.end)) : (this.start = new w(e), this.end = new w(t));
|
|
901
|
-
}
|
|
902
|
-
/** @returns The TimeSpan occupied by the TimeRange. */
|
|
903
|
-
get span() {
|
|
904
|
-
return new O(this.end.valueOf() - this.start.valueOf());
|
|
905
|
-
}
|
|
906
|
-
/**
|
|
907
|
-
* Checks if the timestamp is valid i.e. the start is before the end.
|
|
908
|
-
*
|
|
909
|
-
* @returns True if the TimeRange is valid.
|
|
910
|
-
*/
|
|
911
|
-
get isValid() {
|
|
912
|
-
return this.start.valueOf() <= this.end.valueOf();
|
|
913
|
-
}
|
|
914
|
-
/**
|
|
915
|
-
* Makes sure the TimeRange is valid i.e. the start is before the end.
|
|
916
|
-
*
|
|
917
|
-
* @returns A TimeRange that is valid.
|
|
918
|
-
*/
|
|
919
|
-
makeValid() {
|
|
920
|
-
return this.isValid ? this : this.swap();
|
|
921
|
-
}
|
|
922
|
-
/**
|
|
923
|
-
* Checks if the TimeRange has a zero span.
|
|
924
|
-
*
|
|
925
|
-
* @returns True if the TimeRange has a zero span.
|
|
926
|
-
*/
|
|
927
|
-
get isZero() {
|
|
928
|
-
return this.span.isZero;
|
|
929
|
-
}
|
|
930
|
-
/**
|
|
931
|
-
* @returns the TimeRange as a numeric object with start and end properties.
|
|
932
|
-
*/
|
|
933
|
-
get numeric() {
|
|
934
|
-
return { start: Number(this.start.valueOf()), end: Number(this.end.valueOf()) };
|
|
935
|
-
}
|
|
936
|
-
/**
|
|
937
|
-
* Creates a new TimeRange with the start and end swapped.
|
|
938
|
-
*
|
|
939
|
-
* @returns A TimeRange with the start and end swapped.
|
|
940
|
-
*/
|
|
941
|
-
swap() {
|
|
942
|
-
return new X(this.end, this.start);
|
|
943
|
-
}
|
|
944
|
-
/**
|
|
945
|
-
* Checks if the TimeRange is equal to the given TimeRange.
|
|
946
|
-
*
|
|
947
|
-
* @param other - The TimeRange to compare to.
|
|
948
|
-
* @returns True if the TimeRange is equal to the given TimeRange.
|
|
949
|
-
*/
|
|
950
|
-
equals(e) {
|
|
951
|
-
return this.start.equals(e.start) && this.end.equals(e.end);
|
|
952
|
-
}
|
|
953
|
-
toString() {
|
|
954
|
-
return `${this.start.toString()} - ${this.end.toString()}`;
|
|
955
|
-
}
|
|
956
|
-
toPrettyString() {
|
|
957
|
-
return `${this.start.fString("preciseDate")} - ${this.span.toString()}`;
|
|
958
|
-
}
|
|
959
|
-
/**
|
|
960
|
-
* Checks if if the two time ranges overlap. If the two time ranges are equal, returns
|
|
961
|
-
* true. If the start of one range is equal to the end of the other, returns false.
|
|
962
|
-
* Just follow the rule [start, end) i.e. start is inclusive and end is exclusive.
|
|
963
|
-
*
|
|
964
|
-
* @param other - The other TimeRange to compare to.
|
|
965
|
-
* @returns True if the two TimeRanges overlap, false otherwise.
|
|
966
|
-
*/
|
|
967
|
-
overlapsWith(e, t = O.ZERO) {
|
|
968
|
-
e = e.makeValid();
|
|
969
|
-
const n = this.makeValid();
|
|
970
|
-
if (this.equals(e)) return !0;
|
|
971
|
-
if (e.end.equals(n.start) || n.end.equals(e.start)) return !1;
|
|
972
|
-
const s = w.max(n.start, e.start), a = w.min(n.end, e.end);
|
|
973
|
-
return a.before(s) ? !1 : new O(a.sub(s)).greaterThanOrEqual(t);
|
|
974
|
-
}
|
|
975
|
-
roughlyEquals(e, t) {
|
|
976
|
-
let n = this.start.sub(e.start).valueOf(), s = this.end.sub(e.end).valueOf();
|
|
977
|
-
return n < 0 && (n = -n), s < 0 && (s = -s), n <= t.valueOf() && s <= t.valueOf();
|
|
978
|
-
}
|
|
979
|
-
contains(e) {
|
|
980
|
-
return e instanceof X ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
|
|
981
|
-
}
|
|
982
|
-
boundBy(e) {
|
|
983
|
-
const t = new X(this.start, this.end);
|
|
984
|
-
return e.start.after(this.start) && (t.start = e.start), e.start.after(this.end) && (t.end = e.start), e.end.before(this.end) && (t.end = e.end), e.end.before(this.start) && (t.start = e.end), t;
|
|
985
|
-
}
|
|
986
|
-
};
|
|
987
|
-
i(M, "MAX", new M(w.MIN, w.MAX)), /** The minimum possible time range. */
|
|
988
|
-
i(M, "MIN", new M(w.MAX, w.MIN)), /** A zero time range. */
|
|
989
|
-
i(M, "ZERO", new M(w.ZERO, w.ZERO)), /** A zod schema for validating and transforming time ranges */
|
|
990
|
-
i(M, "z", u.union([
|
|
991
|
-
u.object({ start: w.z, end: w.z }).transform((r) => new M(r.start, r.end)),
|
|
992
|
-
u.instanceof(M)
|
|
993
|
-
]));
|
|
994
|
-
let G = M;
|
|
995
|
-
const o = class T extends String {
|
|
996
|
-
constructor(e) {
|
|
997
|
-
if (e instanceof T || typeof e == "string" || typeof e.valueOf() == "string") {
|
|
998
|
-
super(e.valueOf());
|
|
999
|
-
return;
|
|
1000
|
-
}
|
|
1001
|
-
const t = T.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);
|
|
1002
|
-
if (t != null) {
|
|
1003
|
-
super(t.valueOf());
|
|
1004
|
-
return;
|
|
1005
|
-
}
|
|
1006
|
-
throw super(T.UNKNOWN.valueOf()), new Error(`unable to find data type for ${e.toString()}`);
|
|
1007
|
-
}
|
|
1008
|
-
/**
|
|
1009
|
-
* @returns the TypedArray constructor for the DataType.
|
|
1010
|
-
*/
|
|
1011
|
-
get Array() {
|
|
1012
|
-
const e = T.ARRAY_CONSTRUCTORS.get(this.toString());
|
|
1013
|
-
if (e == null)
|
|
1014
|
-
throw new Error(`unable to find array constructor for ${this.valueOf()}`);
|
|
1015
|
-
return e;
|
|
1016
|
-
}
|
|
1017
|
-
/**
|
|
1018
|
-
* @returns true if the DataType is equal to the given DataType.
|
|
1019
|
-
*/
|
|
1020
|
-
equals(e) {
|
|
1021
|
-
return this.valueOf() === e.valueOf();
|
|
1022
|
-
}
|
|
1023
|
-
/**
|
|
1024
|
-
* @returns true if the DataType is equal to any of the given DataTypes.
|
|
1025
|
-
*/
|
|
1026
|
-
matches(...e) {
|
|
1027
|
-
return e.some((t) => this.equals(t));
|
|
1028
|
-
}
|
|
1029
|
-
/** @returns a string representation of the DataType. */
|
|
1030
|
-
toString() {
|
|
1031
|
-
return this.valueOf();
|
|
1032
|
-
}
|
|
1033
|
-
get isVariable() {
|
|
1034
|
-
return this.equals(T.JSON) || this.equals(T.STRING);
|
|
1035
|
-
}
|
|
1036
|
-
get isNumeric() {
|
|
1037
|
-
return !this.isVariable && !this.equals(T.UUID);
|
|
1038
|
-
}
|
|
1039
|
-
get isInteger() {
|
|
1040
|
-
const e = this.toString();
|
|
1041
|
-
return e.startsWith("int") || e.startsWith("uint");
|
|
1042
|
-
}
|
|
1043
|
-
get isFloat() {
|
|
1044
|
-
return this.toString().startsWith("float");
|
|
1045
|
-
}
|
|
1046
|
-
get density() {
|
|
1047
|
-
const e = T.DENSITIES.get(this.toString());
|
|
1048
|
-
if (e == null) throw new Error(`unable to find density for ${this.valueOf()}`);
|
|
1049
|
-
return e;
|
|
1050
|
-
}
|
|
1051
|
-
get isUnsigned() {
|
|
1052
|
-
return this.equals(T.UINT8) || this.equals(T.UINT16) || this.equals(T.UINT32) || this.equals(T.UINT64);
|
|
1053
|
-
}
|
|
1054
|
-
get isSigned() {
|
|
1055
|
-
return this.equals(T.INT8) || this.equals(T.INT16) || this.equals(T.INT32) || this.equals(T.INT64);
|
|
1056
|
-
}
|
|
1057
|
-
/** @returns true if the data type can be cast to the other data type without loss of precision. */
|
|
1058
|
-
canSafelyCastTo(e) {
|
|
1059
|
-
return this.equals(e) ? !0 : !this.isNumeric || !e.isNumeric || this.isVariable || e.isVariable || this.isUnsigned && e.isSigned ? !1 : this.isFloat ? e.isFloat && this.density.valueOf() <= e.density.valueOf() : this.equals(T.INT32) && e.equals(T.FLOAT64) || this.equals(T.INT8) && e.equals(T.FLOAT32) ? !0 : this.isInteger && e.isInteger ? this.density.valueOf() <= e.density.valueOf() && this.isUnsigned === e.isUnsigned : !1;
|
|
1060
|
-
}
|
|
1061
|
-
/** @returns true if the data type can be cast to the other data type, even if there is a loss of precision. */
|
|
1062
|
-
canCastTo(e) {
|
|
1063
|
-
return this.isNumeric && e.isNumeric ? !0 : this.equals(e);
|
|
1064
|
-
}
|
|
1065
|
-
/**
|
|
1066
|
-
* Checks whether the given TypedArray is of the same type as the DataType.
|
|
1067
|
-
*
|
|
1068
|
-
* @param array - The TypedArray to check.
|
|
1069
|
-
* @returns True if the TypedArray is of the same type as the DataType.
|
|
1070
|
-
*/
|
|
1071
|
-
checkArray(e) {
|
|
1072
|
-
return e.constructor === this.Array;
|
|
1073
|
-
}
|
|
1074
|
-
toJSON() {
|
|
1075
|
-
return this.toString();
|
|
1076
|
-
}
|
|
1077
|
-
get usesBigInt() {
|
|
1078
|
-
return T.BIG_INT_TYPES.some((e) => e.equals(this));
|
|
1079
|
-
}
|
|
1080
|
-
};
|
|
1081
|
-
i(o, "UNKNOWN", new o("unknown")), /** Represents a 64-bit floating point value. */
|
|
1082
|
-
i(o, "FLOAT64", new o("float64")), /** Represents a 32-bit floating point value. */
|
|
1083
|
-
i(o, "FLOAT32", new o("float32")), /** Represents a 64-bit signed integer value. */
|
|
1084
|
-
i(o, "INT64", new o("int64")), /** Represents a 32-bit signed integer value. */
|
|
1085
|
-
i(o, "INT32", new o("int32")), /** Represents a 16-bit signed integer value. */
|
|
1086
|
-
i(o, "INT16", new o("int16")), /** Represents a 8-bit signed integer value. */
|
|
1087
|
-
i(o, "INT8", new o("int8")), /** Represents a 64-bit unsigned integer value. */
|
|
1088
|
-
i(o, "UINT64", new o("uint64")), /** Represents a 32-bit unsigned integer value. */
|
|
1089
|
-
i(o, "UINT32", new o("uint32")), /** Represents a 16-bit unsigned integer value. */
|
|
1090
|
-
i(o, "UINT16", new o("uint16")), /** Represents a 8-bit unsigned integer value. */
|
|
1091
|
-
i(o, "UINT8", new o("uint8")), /** Represents a boolean value. Alias for UINT8. */
|
|
1092
|
-
i(o, "BOOLEAN", o.UINT8), /** Represents a 64-bit unix epoch. */
|
|
1093
|
-
i(o, "TIMESTAMP", new o("timestamp")), /** Represents a UUID data type */
|
|
1094
|
-
i(o, "UUID", new o("uuid")), /** Represents a string data type. Strings have an unknown density, and are separate
|
|
1095
|
-
* by a newline character. */
|
|
1096
|
-
i(o, "STRING", new o("string")), /** Represents a JSON data type. JSON has an unknown density, and is separated by a
|
|
1097
|
-
* newline character. */
|
|
1098
|
-
i(o, "JSON", new o("json")), i(o, "ARRAY_CONSTRUCTORS", /* @__PURE__ */ new Map([
|
|
1099
|
-
[o.UINT8.toString(), Uint8Array],
|
|
1100
|
-
[o.UINT16.toString(), Uint16Array],
|
|
1101
|
-
[o.UINT32.toString(), Uint32Array],
|
|
1102
|
-
[o.UINT64.toString(), BigUint64Array],
|
|
1103
|
-
[o.FLOAT32.toString(), Float32Array],
|
|
1104
|
-
[o.FLOAT64.toString(), Float64Array],
|
|
1105
|
-
[o.INT8.toString(), Int8Array],
|
|
1106
|
-
[o.INT16.toString(), Int16Array],
|
|
1107
|
-
[o.INT32.toString(), Int32Array],
|
|
1108
|
-
[o.INT64.toString(), BigInt64Array],
|
|
1109
|
-
[o.TIMESTAMP.toString(), BigInt64Array],
|
|
1110
|
-
[o.STRING.toString(), Uint8Array],
|
|
1111
|
-
[o.JSON.toString(), Uint8Array],
|
|
1112
|
-
[o.UUID.toString(), Uint8Array]
|
|
1113
|
-
])), i(o, "ARRAY_CONSTRUCTOR_DATA_TYPES", /* @__PURE__ */ new Map([
|
|
1114
|
-
[Uint8Array.name, o.UINT8],
|
|
1115
|
-
[Uint16Array.name, o.UINT16],
|
|
1116
|
-
[Uint32Array.name, o.UINT32],
|
|
1117
|
-
[BigUint64Array.name, o.UINT64],
|
|
1118
|
-
[Float32Array.name, o.FLOAT32],
|
|
1119
|
-
[Float64Array.name, o.FLOAT64],
|
|
1120
|
-
[Int8Array.name, o.INT8],
|
|
1121
|
-
[Int16Array.name, o.INT16],
|
|
1122
|
-
[Int32Array.name, o.INT32],
|
|
1123
|
-
[BigInt64Array.name, o.INT64]
|
|
1124
|
-
])), i(o, "DENSITIES", /* @__PURE__ */ new Map([
|
|
1125
|
-
[o.UINT8.toString(), A.BIT8],
|
|
1126
|
-
[o.UINT16.toString(), A.BIT16],
|
|
1127
|
-
[o.UINT32.toString(), A.BIT32],
|
|
1128
|
-
[o.UINT64.toString(), A.BIT64],
|
|
1129
|
-
[o.FLOAT32.toString(), A.BIT32],
|
|
1130
|
-
[o.FLOAT64.toString(), A.BIT64],
|
|
1131
|
-
[o.INT8.toString(), A.BIT8],
|
|
1132
|
-
[o.INT16.toString(), A.BIT16],
|
|
1133
|
-
[o.INT32.toString(), A.BIT32],
|
|
1134
|
-
[o.INT64.toString(), A.BIT64],
|
|
1135
|
-
[o.TIMESTAMP.toString(), A.BIT64],
|
|
1136
|
-
[o.STRING.toString(), A.UNKNOWN],
|
|
1137
|
-
[o.JSON.toString(), A.UNKNOWN],
|
|
1138
|
-
[o.UUID.toString(), A.BIT128]
|
|
1139
|
-
])), /** All the data types. */
|
|
1140
|
-
i(o, "ALL", [
|
|
1141
|
-
o.UNKNOWN,
|
|
1142
|
-
o.FLOAT64,
|
|
1143
|
-
o.FLOAT32,
|
|
1144
|
-
o.INT64,
|
|
1145
|
-
o.INT32,
|
|
1146
|
-
o.INT16,
|
|
1147
|
-
o.INT8,
|
|
1148
|
-
o.UINT64,
|
|
1149
|
-
o.UINT32,
|
|
1150
|
-
o.UINT16,
|
|
1151
|
-
o.UINT8,
|
|
1152
|
-
o.TIMESTAMP,
|
|
1153
|
-
o.UUID,
|
|
1154
|
-
o.STRING,
|
|
1155
|
-
o.JSON
|
|
1156
|
-
]), i(o, "BIG_INT_TYPES", [o.INT64, o.UINT64, o.TIMESTAMP]), /** A zod schema for a DataType. */
|
|
1157
|
-
i(o, "z", u.union([
|
|
1158
|
-
u.string().transform((r) => new o(r)),
|
|
1159
|
-
u.instanceof(o)
|
|
1160
|
-
]));
|
|
1161
|
-
let p = o;
|
|
1162
|
-
const I = class S extends Number {
|
|
1163
|
-
constructor(e) {
|
|
1164
|
-
super(e.valueOf());
|
|
1165
|
-
}
|
|
1166
|
-
/** @returns true if the Size is larger than the other size. */
|
|
1167
|
-
largerThan(e) {
|
|
1168
|
-
return this.valueOf() > e.valueOf();
|
|
1169
|
-
}
|
|
1170
|
-
/** @returns true if the Size is smaller than the other sisze. */
|
|
1171
|
-
smallerThan(e) {
|
|
1172
|
-
return this.valueOf() < e.valueOf();
|
|
1173
|
-
}
|
|
1174
|
-
add(e) {
|
|
1175
|
-
return S.bytes(this.valueOf() + e.valueOf());
|
|
1176
|
-
}
|
|
1177
|
-
sub(e) {
|
|
1178
|
-
return S.bytes(this.valueOf() - e.valueOf());
|
|
1179
|
-
}
|
|
1180
|
-
truncate(e) {
|
|
1181
|
-
return new S(Math.trunc(this.valueOf() / e.valueOf()) * e.valueOf());
|
|
1182
|
-
}
|
|
1183
|
-
remainder(e) {
|
|
1184
|
-
return S.bytes(this.valueOf() % e.valueOf());
|
|
1185
|
-
}
|
|
1186
|
-
get gigabytes() {
|
|
1187
|
-
return this.valueOf() / S.GIGABYTE.valueOf();
|
|
1188
|
-
}
|
|
1189
|
-
get megabytes() {
|
|
1190
|
-
return this.valueOf() / S.MEGABYTE.valueOf();
|
|
1191
|
-
}
|
|
1192
|
-
get kilobytes() {
|
|
1193
|
-
return this.valueOf() / S.KILOBYTE.valueOf();
|
|
1194
|
-
}
|
|
1195
|
-
get terabytes() {
|
|
1196
|
-
return this.valueOf() / S.TERABYTE.valueOf();
|
|
1197
|
-
}
|
|
1198
|
-
toString() {
|
|
1199
|
-
const e = this.truncate(S.TERABYTE), t = this.truncate(S.GIGABYTE), n = this.truncate(S.MEGABYTE), s = this.truncate(S.KILOBYTE), a = this.truncate(S.BYTE), l = e, m = t.sub(e), f = n.sub(t), g = s.sub(n), v = a.sub(s);
|
|
1200
|
-
let c = "";
|
|
1201
|
-
return l.isZero || (c += `${l.terabytes}TB `), m.isZero || (c += `${m.gigabytes}GB `), f.isZero || (c += `${f.megabytes}MB `), g.isZero || (c += `${g.kilobytes}KB `), (!v.isZero || c === "") && (c += `${v.valueOf()}B`), c.trim();
|
|
1202
|
-
}
|
|
1203
|
-
/**
|
|
1204
|
-
* Creates a Size from the given number of bytes.
|
|
1205
|
-
*
|
|
1206
|
-
* @param value - The number of bytes.
|
|
1207
|
-
* @returns A Size representing the given number of bytes.
|
|
1208
|
-
*/
|
|
1209
|
-
static bytes(e = 1) {
|
|
1210
|
-
return new S(e);
|
|
1211
|
-
}
|
|
1212
|
-
/**
|
|
1213
|
-
* Creates a Size from the given number if kilobytes.
|
|
1214
|
-
*
|
|
1215
|
-
* @param value - The number of kilobytes.
|
|
1216
|
-
* @returns A Size representing the given number of kilobytes.
|
|
1217
|
-
*/
|
|
1218
|
-
static kilobytes(e = 1) {
|
|
1219
|
-
return S.bytes(e.valueOf() * 1e3);
|
|
1220
|
-
}
|
|
1221
|
-
/**
|
|
1222
|
-
* Creates a Size from the given number of megabytes.
|
|
1223
|
-
*
|
|
1224
|
-
* @param value - The number of megabytes.
|
|
1225
|
-
* @returns A Size representing the given number of megabytes.
|
|
1226
|
-
*/
|
|
1227
|
-
static megabytes(e = 1) {
|
|
1228
|
-
return S.kilobytes(e.valueOf() * 1e3);
|
|
1229
|
-
}
|
|
1230
|
-
/**
|
|
1231
|
-
* Creates a Size from the given number of gigabytes.
|
|
1232
|
-
*
|
|
1233
|
-
* @param value - The number of gigabytes.
|
|
1234
|
-
* @returns A Size representing the given number of gigabytes.
|
|
1235
|
-
*/
|
|
1236
|
-
static gigabytes(e = 1) {
|
|
1237
|
-
return S.megabytes(e.valueOf() * 1e3);
|
|
1238
|
-
}
|
|
1239
|
-
/**
|
|
1240
|
-
* Creates a Size from the given number of terabytes.
|
|
1241
|
-
*
|
|
1242
|
-
* @param value - The number of terabytes.
|
|
1243
|
-
* @returns A Size representing the given number of terabytes.
|
|
1244
|
-
*/
|
|
1245
|
-
static terabytes(e) {
|
|
1246
|
-
return S.gigabytes(e.valueOf() * 1e3);
|
|
1247
|
-
}
|
|
1248
|
-
get isZero() {
|
|
1249
|
-
return this.valueOf() === 0;
|
|
1250
|
-
}
|
|
1251
|
-
};
|
|
1252
|
-
i(I, "BYTE", new I(1)), /** A kilobyte */
|
|
1253
|
-
i(I, "KILOBYTE", I.kilobytes(1)), /** A megabyte */
|
|
1254
|
-
i(I, "MEGABYTE", I.megabytes(1)), /** A gigabyte */
|
|
1255
|
-
i(I, "GIGABYTE", I.gigabytes(1)), /** A terabyte. */
|
|
1256
|
-
i(I, "TERABYTE", I.terabytes(1)), /** The zero value for Size */
|
|
1257
|
-
i(I, "ZERO", new I(0)), /** A zod schema for a Size. */
|
|
1258
|
-
i(I, "z", u.union([
|
|
1259
|
-
u.number().transform((r) => new I(r)),
|
|
1260
|
-
u.instanceof(I)
|
|
1261
|
-
]));
|
|
1262
|
-
let Q = I;
|
|
1263
|
-
const Ar = u.union([
|
|
1264
|
-
u.instanceof(Uint8Array),
|
|
1265
|
-
u.instanceof(Uint16Array),
|
|
1266
|
-
u.instanceof(Uint32Array),
|
|
1267
|
-
u.instanceof(BigUint64Array),
|
|
1268
|
-
u.instanceof(Float32Array),
|
|
1269
|
-
u.instanceof(Float64Array),
|
|
1270
|
-
u.instanceof(Int8Array),
|
|
1271
|
-
u.instanceof(Int16Array),
|
|
1272
|
-
u.instanceof(Int32Array),
|
|
1273
|
-
u.instanceof(BigInt64Array)
|
|
1274
|
-
]), xe = (r) => {
|
|
1275
|
-
const e = typeof r;
|
|
1276
|
-
return e === "string" || e === "number" || e === "boolean" || e === "bigint" || r instanceof w || r instanceof O || r instanceof Date;
|
|
1277
|
-
}, ct = (r, e, t, n = 0) => r.usesBigInt && !e.usesBigInt ? Number(t) - Number(n) : !r.usesBigInt && e.usesBigInt ? BigInt(t.valueOf()) - BigInt(n.valueOf()) : P(t, -n).valueOf(), P = (r, e) => typeof r == "bigint" && typeof e == "bigint" || typeof r == "number" && typeof e == "number" ? r + e : e === 0 ? r : r === 0 ? e : Number(r) + Number(e), ft = (r) => r == null ? !1 : Array.isArray(r) || r instanceof ArrayBuffer || ArrayBuffer.isView(r) && !(r instanceof DataView) || r instanceof mt ? !0 : xe(r), R = -1, se = {
|
|
1278
|
-
[Symbol.iterator]: () => se,
|
|
1279
|
-
next: () => ({ done: !0, value: void 0 })
|
|
1280
|
-
}, dt = u.string().transform(
|
|
1281
|
-
(r) => new Uint8Array(
|
|
1282
|
-
atob(r).split("").map((e) => e.charCodeAt(0))
|
|
1283
|
-
).buffer
|
|
1284
|
-
), gt = u.union([u.null(), u.undefined()]).transform(() => new Uint8Array().buffer), ie = 10, j = class B {
|
|
1285
|
-
constructor(e) {
|
|
1286
|
-
i(this, "key", ""), i(this, "isSynnaxSeries", !0), i(this, "dataType"), i(this, "sampleOffset"), i(this, "gl"), i(this, "_data"), i(this, "_timeRange"), i(this, "alignment", 0n), i(this, "_cachedMin"), i(this, "_cachedMax"), i(this, "writePos", R), i(this, "_refCount", 0), i(this, "_cachedLength"), i(this, "_cachedIndexes"), ft(e) && (e = { data: e });
|
|
1287
|
-
const {
|
|
1288
|
-
dataType: t,
|
|
1289
|
-
timeRange: n,
|
|
1290
|
-
sampleOffset: s = 0,
|
|
1291
|
-
glBufferUsage: a = "static",
|
|
1292
|
-
alignment: l = 0n,
|
|
1293
|
-
key: m = Be()
|
|
1294
|
-
} = e, f = e.data ?? [];
|
|
1295
|
-
if (f instanceof B || typeof f == "object" && "isSynnaxSeries" in f && f.isSynnaxSeries === !0) {
|
|
1296
|
-
const c = f;
|
|
1297
|
-
this.key = c.key, this.dataType = c.dataType, this.sampleOffset = c.sampleOffset, this.gl = c.gl, this._data = c._data, this._timeRange = c._timeRange, this.alignment = c.alignment, this._cachedMin = c._cachedMin, this._cachedMax = c._cachedMax, this.writePos = c.writePos, this._refCount = c._refCount, this._cachedLength = c._cachedLength;
|
|
1298
|
-
return;
|
|
1299
|
-
}
|
|
1300
|
-
const g = xe(f), v = Array.isArray(f);
|
|
1301
|
-
if (t != null) this.dataType = new p(t);
|
|
1302
|
-
else {
|
|
1303
|
-
if (f instanceof ArrayBuffer)
|
|
1304
|
-
throw new Error(
|
|
1305
|
-
"cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type."
|
|
1306
|
-
);
|
|
1307
|
-
if (v || g) {
|
|
1308
|
-
let c = f;
|
|
1309
|
-
if (!g) {
|
|
1310
|
-
if (f.length === 0)
|
|
1311
|
-
throw new Error(
|
|
1312
|
-
"cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type."
|
|
1313
|
-
);
|
|
1314
|
-
c = f[0];
|
|
1315
|
-
}
|
|
1316
|
-
if (typeof c == "string") this.dataType = p.STRING;
|
|
1317
|
-
else if (typeof c == "number") this.dataType = p.FLOAT64;
|
|
1318
|
-
else if (typeof c == "bigint") this.dataType = p.INT64;
|
|
1319
|
-
else if (typeof c == "boolean") this.dataType = p.BOOLEAN;
|
|
1320
|
-
else if (c instanceof w || c instanceof Date || c instanceof w)
|
|
1321
|
-
this.dataType = p.TIMESTAMP;
|
|
1322
|
-
else if (typeof c == "object") this.dataType = p.JSON;
|
|
1323
|
-
else
|
|
1324
|
-
throw new Error(
|
|
1325
|
-
`cannot infer data type of ${typeof c} when constructing a Series from a JS array`
|
|
1326
|
-
);
|
|
1327
|
-
} else this.dataType = new p(f);
|
|
1328
|
-
}
|
|
1329
|
-
if (!v && !g) this._data = f;
|
|
1330
|
-
else {
|
|
1331
|
-
let c = g ? [f] : f;
|
|
1332
|
-
const E = c[0];
|
|
1333
|
-
(E instanceof w || E instanceof Date || E instanceof O) && (c = c.map(($) => new w($).valueOf())), this.dataType.equals(p.STRING) ? (this._cachedLength = c.length, this._data = new TextEncoder().encode(`${c.join(`
|
|
1334
|
-
`)}
|
|
1335
|
-
`).buffer) : this.dataType.equals(p.JSON) ? (this._cachedLength = c.length, this._data = new TextEncoder().encode(
|
|
1336
|
-
`${c.map(($) => J.encodeString($)).join(`
|
|
1337
|
-
`)}
|
|
1338
|
-
`
|
|
1339
|
-
).buffer) : this.dataType.usesBigInt && typeof E == "number" ? this._data = new this.dataType.Array(
|
|
1340
|
-
c.map(($) => BigInt(Math.round($)))
|
|
1341
|
-
).buffer : !this.dataType.usesBigInt && typeof E == "bigint" ? this._data = new this.dataType.Array(
|
|
1342
|
-
c.map(($) => Number($))
|
|
1343
|
-
).buffer : this._data = new this.dataType.Array(c).buffer;
|
|
1344
|
-
}
|
|
1345
|
-
this.key = m, this.alignment = l, this.sampleOffset = s ?? 0, this._timeRange = n, this.gl = {
|
|
1346
|
-
control: null,
|
|
1347
|
-
buffer: null,
|
|
1348
|
-
prevBuffer: 0,
|
|
1349
|
-
bufferUsage: a
|
|
1350
|
-
};
|
|
1351
|
-
}
|
|
1352
|
-
static alloc({ capacity: e, dataType: t, ...n }) {
|
|
1353
|
-
if (e === 0)
|
|
1354
|
-
throw new Error("[Series] - cannot allocate an array of length 0");
|
|
1355
|
-
const s = new new p(t).Array(e), a = new B({
|
|
1356
|
-
data: s.buffer,
|
|
1357
|
-
dataType: t,
|
|
1358
|
-
...n
|
|
1359
|
-
});
|
|
1360
|
-
return a.writePos = 0, a;
|
|
1361
|
-
}
|
|
1362
|
-
static createTimestamps(e, t, n) {
|
|
1363
|
-
const s = n.spanRange(t.span(e)), a = new BigInt64Array(e);
|
|
1364
|
-
for (let l = 0; l < e; l++)
|
|
1365
|
-
a[l] = BigInt(n.add(t.span(l)).valueOf());
|
|
1366
|
-
return new B({ data: a, dataType: p.TIMESTAMP, timeRange: s });
|
|
1367
|
-
}
|
|
1368
|
-
get refCount() {
|
|
1369
|
-
return this._refCount;
|
|
1370
|
-
}
|
|
1371
|
-
static fromStrings(e, t) {
|
|
1372
|
-
const n = new TextEncoder().encode(
|
|
1373
|
-
`${e.join(`
|
|
1374
|
-
`)}
|
|
1375
|
-
`
|
|
1376
|
-
);
|
|
1377
|
-
return new B({ data: n, dataType: p.STRING, timeRange: t });
|
|
1378
|
-
}
|
|
1379
|
-
static fromJSON(e, t) {
|
|
1380
|
-
const n = new TextEncoder().encode(
|
|
1381
|
-
`${e.map((s) => J.encodeString(s)).join(`
|
|
1382
|
-
`)}
|
|
1383
|
-
`
|
|
1384
|
-
);
|
|
1385
|
-
return new B({ data: n, dataType: p.JSON, timeRange: t });
|
|
1386
|
-
}
|
|
1387
|
-
acquire(e) {
|
|
1388
|
-
this._refCount++, e != null && this.updateGLBuffer(e);
|
|
1389
|
-
}
|
|
1390
|
-
release() {
|
|
1391
|
-
if (this._refCount--, this._refCount === 0 && this.gl.control != null)
|
|
1392
|
-
this.maybeGarbageCollectGLBuffer(this.gl.control);
|
|
1393
|
-
else if (this._refCount < 0)
|
|
1394
|
-
throw new Error("cannot release an array with a negative reference count");
|
|
1395
|
-
}
|
|
1396
|
-
/**
|
|
1397
|
-
* Writes the given series to this series. If the series being written exceeds the
|
|
1398
|
-
* remaining of series being written to, only the portion that fits will be written.
|
|
1399
|
-
* @param other the series to write to this series. The data type of the series written
|
|
1400
|
-
* must be the same as the data type of the series being written to.
|
|
1401
|
-
* @returns the number of samples written. If the entire series fits, this value is
|
|
1402
|
-
* equal to the length of the series being written.
|
|
1403
|
-
*/
|
|
1404
|
-
write(e) {
|
|
1405
|
-
if (!e.dataType.equals(this.dataType))
|
|
1406
|
-
throw new Error("buffer must be of the same type as this array");
|
|
1407
|
-
return this.dataType.isVariable ? this.writeVariable(e) : this.writeFixed(e);
|
|
1408
|
-
}
|
|
1409
|
-
writeVariable(e) {
|
|
1410
|
-
if (this.writePos === R) return 0;
|
|
1411
|
-
const t = this.byteCapacity.valueOf() - this.writePos, n = e.subBytes(0, t);
|
|
1412
|
-
return this.writeToUnderlyingData(n), this.writePos += n.byteLength.valueOf(), this._cachedLength != null && (this._cachedLength += n.length, this.calculateCachedLength()), n.length;
|
|
1413
|
-
}
|
|
1414
|
-
writeFixed(e) {
|
|
1415
|
-
if (this.writePos === R) return 0;
|
|
1416
|
-
const t = this.capacity - this.writePos, n = e.sub(0, t);
|
|
1417
|
-
return this.writeToUnderlyingData(n), this._cachedLength = void 0, this.maybeRecomputeMinMax(n), this.writePos += n.length, n.length;
|
|
1418
|
-
}
|
|
1419
|
-
writeToUnderlyingData(e) {
|
|
1420
|
-
this.underlyingData.set(
|
|
1421
|
-
e.data,
|
|
1422
|
-
this.writePos
|
|
1423
|
-
);
|
|
1424
|
-
}
|
|
1425
|
-
/** @returns the underlying buffer backing this array. */
|
|
1426
|
-
get buffer() {
|
|
1427
|
-
return typeof this._data == "object" && "buffer" in this._data ? this._data.buffer : this._data;
|
|
1428
|
-
}
|
|
1429
|
-
get underlyingData() {
|
|
1430
|
-
return new this.dataType.Array(this._data);
|
|
1431
|
-
}
|
|
1432
|
-
/** @returns a native typed array with the proper data type. */
|
|
1433
|
-
get data() {
|
|
1434
|
-
return this.writePos === R ? this.underlyingData : new this.dataType.Array(this._data, 0, this.writePos);
|
|
1435
|
-
}
|
|
1436
|
-
toStrings() {
|
|
1437
|
-
if (!this.dataType.matches(p.STRING, p.UUID))
|
|
1438
|
-
throw new Error("cannot convert non-string series to strings");
|
|
1439
|
-
return new TextDecoder().decode(this.underlyingData).split(`
|
|
1440
|
-
`).slice(0, -1);
|
|
1441
|
-
}
|
|
1442
|
-
toUUIDs() {
|
|
1443
|
-
if (!this.dataType.equals(p.UUID))
|
|
1444
|
-
throw new Error("cannot convert non-uuid series to uuids");
|
|
1445
|
-
const e = p.UUID.density.valueOf(), t = Array(this.length);
|
|
1446
|
-
for (let n = 0; n < this.length; n++) {
|
|
1447
|
-
const s = this.underlyingData.slice(n * e, (n + 1) * e), a = Array.from(
|
|
1448
|
-
new Uint8Array(s.buffer),
|
|
1449
|
-
(l) => l.toString(16).padStart(2, "0")
|
|
1450
|
-
).join("").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, "$1-$2-$3-$4-$5");
|
|
1451
|
-
t[n] = a;
|
|
1452
|
-
}
|
|
1453
|
-
return t;
|
|
1454
|
-
}
|
|
1455
|
-
parseJSON(e) {
|
|
1456
|
-
if (!this.dataType.equals(p.JSON))
|
|
1457
|
-
throw new Error("cannot parse non-JSON series as JSON");
|
|
1458
|
-
return new TextDecoder().decode(this.underlyingData).split(`
|
|
1459
|
-
`).slice(0, -1).map((t) => e.parse(J.decodeString(t)));
|
|
1460
|
-
}
|
|
1461
|
-
/** @returns the time range of this array. */
|
|
1462
|
-
get timeRange() {
|
|
1463
|
-
if (this._timeRange == null) throw new Error("time range not set on series");
|
|
1464
|
-
return this._timeRange;
|
|
1465
|
-
}
|
|
1466
|
-
/** @returns the capacity of the series in bytes. */
|
|
1467
|
-
get byteCapacity() {
|
|
1468
|
-
return new Q(this.underlyingData.byteLength);
|
|
1469
|
-
}
|
|
1470
|
-
/** @returns the capacity of the series in samples. */
|
|
1471
|
-
get capacity() {
|
|
1472
|
-
return this.dataType.isVariable ? this.byteCapacity.valueOf() : this.dataType.density.length(this.byteCapacity);
|
|
1473
|
-
}
|
|
1474
|
-
/** @returns the length of the series in bytes. */
|
|
1475
|
-
get byteLength() {
|
|
1476
|
-
return this.writePos === R ? this.byteCapacity : this.dataType.isVariable ? new Q(this.writePos) : this.dataType.density.size(this.writePos);
|
|
1477
|
-
}
|
|
1478
|
-
/** @returns the number of samples in this array. */
|
|
1479
|
-
get length() {
|
|
1480
|
-
return this._cachedLength != null ? this._cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos === R ? this.data.length : this.writePos;
|
|
1481
|
-
}
|
|
1482
|
-
calculateCachedLength() {
|
|
1483
|
-
if (!this.dataType.isVariable)
|
|
1484
|
-
throw new Error("cannot calculate length of a non-variable length data type");
|
|
1485
|
-
let e = 0;
|
|
1486
|
-
const t = [0];
|
|
1487
|
-
return this.data.forEach((n, s) => {
|
|
1488
|
-
n === ie && (e++, t.push(s + 1));
|
|
1489
|
-
}), this._cachedIndexes = t, this._cachedLength = e, e;
|
|
1490
|
-
}
|
|
1491
|
-
/**
|
|
1492
|
-
* Creates a new array with a different data type.
|
|
1493
|
-
* @param target the data type to convert to.
|
|
1494
|
-
* @param sampleOffset an offset to apply to each sample. This can help with precision
|
|
1495
|
-
* issues when converting between data types.
|
|
1496
|
-
*
|
|
1497
|
-
* WARNING: This method is expensive and copies the entire underlying array. There
|
|
1498
|
-
* also may be untimely precision issues when converting between data types.
|
|
1499
|
-
*/
|
|
1500
|
-
convert(e, t = 0) {
|
|
1501
|
-
if (this.dataType.equals(e)) return this;
|
|
1502
|
-
const n = new e.Array(this.length);
|
|
1503
|
-
for (let s = 0; s < this.length; s++)
|
|
1504
|
-
n[s] = ct(this.dataType, e, this.data[s], t);
|
|
1505
|
-
return new B({
|
|
1506
|
-
data: n.buffer,
|
|
1507
|
-
dataType: e,
|
|
1508
|
-
timeRange: this._timeRange,
|
|
1509
|
-
sampleOffset: t,
|
|
1510
|
-
glBufferUsage: this.gl.bufferUsage,
|
|
1511
|
-
alignment: this.alignment
|
|
1512
|
-
});
|
|
1513
|
-
}
|
|
1514
|
-
calcRawMax() {
|
|
1515
|
-
if (this.length === 0) return -1 / 0;
|
|
1516
|
-
if (this.dataType.equals(p.TIMESTAMP))
|
|
1517
|
-
this._cachedMax = this.data[this.data.length - 1];
|
|
1518
|
-
else if (this.dataType.usesBigInt) {
|
|
1519
|
-
const e = this.data;
|
|
1520
|
-
this._cachedMax = e.reduce((t, n) => t > n ? t : n);
|
|
1521
|
-
} else {
|
|
1522
|
-
const e = this.data;
|
|
1523
|
-
this._cachedMax = e.reduce((t, n) => t > n ? t : n);
|
|
1524
|
-
}
|
|
1525
|
-
return this._cachedMax;
|
|
1526
|
-
}
|
|
1527
|
-
/** @returns the maximum value in the array */
|
|
1528
|
-
get max() {
|
|
1529
|
-
if (this.dataType.isVariable)
|
|
1530
|
-
throw new Error("cannot calculate maximum on a variable length data type");
|
|
1531
|
-
return this.writePos === 0 ? -1 / 0 : (this._cachedMax ?? (this._cachedMax = this.calcRawMax()), P(this._cachedMax, this.sampleOffset));
|
|
1532
|
-
}
|
|
1533
|
-
calcRawMin() {
|
|
1534
|
-
if (this.length === 0) return 1 / 0;
|
|
1535
|
-
if (this.dataType.equals(p.TIMESTAMP)) this._cachedMin = this.data[0];
|
|
1536
|
-
else if (this.dataType.usesBigInt) {
|
|
1537
|
-
const e = this.data;
|
|
1538
|
-
this._cachedMin = e.reduce((t, n) => t < n ? t : n);
|
|
1539
|
-
} else {
|
|
1540
|
-
const e = this.data;
|
|
1541
|
-
this._cachedMin = e.reduce((t, n) => t < n ? t : n);
|
|
1542
|
-
}
|
|
1543
|
-
return this._cachedMin;
|
|
1544
|
-
}
|
|
1545
|
-
/** @returns the minimum value in the array */
|
|
1546
|
-
get min() {
|
|
1547
|
-
if (this.dataType.isVariable)
|
|
1548
|
-
throw new Error("cannot calculate minimum on a variable length data type");
|
|
1549
|
-
return this.writePos === 0 ? 1 / 0 : (this._cachedMin ?? (this._cachedMin = this.calcRawMin()), P(this._cachedMin, this.sampleOffset));
|
|
1550
|
-
}
|
|
1551
|
-
/** @returns the bounds of this array. */
|
|
1552
|
-
get bounds() {
|
|
1553
|
-
return z(Number(this.min), Number(this.max));
|
|
1554
|
-
}
|
|
1555
|
-
maybeRecomputeMinMax(e) {
|
|
1556
|
-
if (this._cachedMin != null) {
|
|
1557
|
-
const t = e._cachedMin ?? e.calcRawMin();
|
|
1558
|
-
t < this._cachedMin && (this._cachedMin = t);
|
|
1559
|
-
}
|
|
1560
|
-
if (this._cachedMax != null) {
|
|
1561
|
-
const t = e._cachedMax ?? e.calcRawMax();
|
|
1562
|
-
t > this._cachedMax && (this._cachedMax = t);
|
|
1563
|
-
}
|
|
1564
|
-
}
|
|
1565
|
-
enrich() {
|
|
1566
|
-
this.max, this.min;
|
|
1567
|
-
}
|
|
1568
|
-
get range() {
|
|
1569
|
-
return P(this.max, -this.min);
|
|
1570
|
-
}
|
|
1571
|
-
atAlignment(e, t) {
|
|
1572
|
-
const n = Number(e - this.alignment);
|
|
1573
|
-
if (n < 0 || n >= this.length) {
|
|
1574
|
-
if (t === !0) throw new Error(`[series] - no value at index ${n}`);
|
|
1575
|
-
return;
|
|
1576
|
-
}
|
|
1577
|
-
return this.at(n, t);
|
|
1578
|
-
}
|
|
1579
|
-
at(e, t) {
|
|
1580
|
-
if (this.dataType.isVariable) return this.atVariable(e, t ?? !1);
|
|
1581
|
-
e < 0 && (e = this.length + e);
|
|
1582
|
-
const n = this.data[e];
|
|
1583
|
-
if (n == null) {
|
|
1584
|
-
if (t === !0) throw new Error(`[series] - no value at index ${e}`);
|
|
1585
|
-
return;
|
|
1586
|
-
}
|
|
1587
|
-
return P(n, this.sampleOffset);
|
|
1588
|
-
}
|
|
1589
|
-
atVariable(e, t) {
|
|
1590
|
-
let n = 0, s = 0;
|
|
1591
|
-
if (this._cachedIndexes != null)
|
|
1592
|
-
n = this._cachedIndexes[e], s = this._cachedIndexes[e + 1] - 1;
|
|
1593
|
-
else {
|
|
1594
|
-
e < 0 && (e = this.length + e);
|
|
1595
|
-
for (let l = 0; l < this.data.length; l++)
|
|
1596
|
-
if (this.data[l] === ie) {
|
|
1597
|
-
if (e === 0) {
|
|
1598
|
-
s = l;
|
|
1599
|
-
break;
|
|
1600
|
-
}
|
|
1601
|
-
n = l + 1, e--;
|
|
1602
|
-
}
|
|
1603
|
-
if (s === 0 && (s = this.data.length), n >= s || e > 0) {
|
|
1604
|
-
if (t) throw new Error(`[series] - no value at index ${e}`);
|
|
1605
|
-
return;
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
const a = this.data.slice(n, s);
|
|
1609
|
-
return this.dataType.equals(p.STRING) ? new TextDecoder().decode(a) : ve(JSON.parse(new TextDecoder().decode(a)));
|
|
1610
|
-
}
|
|
1611
|
-
/**
|
|
1612
|
-
* @returns the index of the first sample that is greater than or equal to the given value.
|
|
1613
|
-
* The underlying array must be sorted. If it is not, the behavior of this method is undefined.
|
|
1614
|
-
* @param value the value to search for.
|
|
1615
|
-
*/
|
|
1616
|
-
binarySearch(e) {
|
|
1617
|
-
let t = 0, n = this.length - 1;
|
|
1618
|
-
const s = _(e);
|
|
1619
|
-
for (; t <= n; ) {
|
|
1620
|
-
const a = Math.floor((t + n) / 2), l = s(this.at(a, !0), e);
|
|
1621
|
-
if (l === 0) return a;
|
|
1622
|
-
l < 0 ? t = a + 1 : n = a - 1;
|
|
1623
|
-
}
|
|
1624
|
-
return t;
|
|
1625
|
-
}
|
|
1626
|
-
updateGLBuffer(e) {
|
|
1627
|
-
if (this.gl.control = e, !this.dataType.equals(p.FLOAT32) && !this.dataType.equals(p.UINT8))
|
|
1628
|
-
throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");
|
|
1629
|
-
const { buffer: t, bufferUsage: n, prevBuffer: s } = this.gl;
|
|
1630
|
-
if (t == null && (this.gl.buffer = e.createBuffer()), this.writePos !== s)
|
|
1631
|
-
if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !== R) {
|
|
1632
|
-
s === 0 && e.bufferData(e.ARRAY_BUFFER, this.byteCapacity.valueOf(), e.STATIC_DRAW);
|
|
1633
|
-
const a = this.dataType.density.size(s).valueOf(), l = this.underlyingData.slice(this.gl.prevBuffer, this.writePos);
|
|
1634
|
-
e.bufferSubData(e.ARRAY_BUFFER, a, l.buffer), this.gl.prevBuffer = this.writePos;
|
|
1635
|
-
} else
|
|
1636
|
-
e.bufferData(
|
|
1637
|
-
e.ARRAY_BUFFER,
|
|
1638
|
-
this.buffer,
|
|
1639
|
-
n === "static" ? e.STATIC_DRAW : e.DYNAMIC_DRAW
|
|
1640
|
-
), this.gl.prevBuffer = R;
|
|
1641
|
-
}
|
|
1642
|
-
as(e) {
|
|
1643
|
-
if (e === "string") {
|
|
1644
|
-
if (!this.dataType.equals(p.STRING))
|
|
1645
|
-
throw new Error(
|
|
1646
|
-
`cannot convert series of type ${this.dataType.toString()} to string`
|
|
1647
|
-
);
|
|
1648
|
-
return this;
|
|
1649
|
-
}
|
|
1650
|
-
if (e === "number") {
|
|
1651
|
-
if (!this.dataType.isNumeric)
|
|
1652
|
-
throw new Error(
|
|
1653
|
-
`cannot convert series of type ${this.dataType.toString()} to number`
|
|
1654
|
-
);
|
|
1655
|
-
return this;
|
|
1656
|
-
}
|
|
1657
|
-
if (e === "bigint") {
|
|
1658
|
-
if (!this.dataType.equals(p.INT64))
|
|
1659
|
-
throw new Error(
|
|
1660
|
-
`cannot convert series of type ${this.dataType.toString()} to bigint`
|
|
1661
|
-
);
|
|
1662
|
-
return this;
|
|
1663
|
-
}
|
|
1664
|
-
throw new Error(`cannot convert series to ${e}`);
|
|
1665
|
-
}
|
|
1666
|
-
get digest() {
|
|
1667
|
-
var e;
|
|
1668
|
-
return {
|
|
1669
|
-
key: this.key,
|
|
1670
|
-
dataType: this.dataType.toString(),
|
|
1671
|
-
sampleOffset: this.sampleOffset,
|
|
1672
|
-
alignment: {
|
|
1673
|
-
lower: we(this.alignmentBounds.lower),
|
|
1674
|
-
upper: we(this.alignmentBounds.upper)
|
|
1675
|
-
},
|
|
1676
|
-
timeRange: (e = this._timeRange) == null ? void 0 : e.toString(),
|
|
1677
|
-
length: this.length,
|
|
1678
|
-
capacity: this.capacity
|
|
1679
|
-
};
|
|
1680
|
-
}
|
|
1681
|
-
get memInfo() {
|
|
1682
|
-
return {
|
|
1683
|
-
key: this.key,
|
|
1684
|
-
length: this.length,
|
|
1685
|
-
byteLength: this.byteLength,
|
|
1686
|
-
glBuffer: this.gl.buffer != null
|
|
1687
|
-
};
|
|
1688
|
-
}
|
|
1689
|
-
get alignmentBounds() {
|
|
1690
|
-
return z(this.alignment, this.alignment + BigInt(this.length));
|
|
1691
|
-
}
|
|
1692
|
-
maybeGarbageCollectGLBuffer(e) {
|
|
1693
|
-
this.gl.buffer != null && (e.deleteBuffer(this.gl.buffer), this.gl.buffer = null, this.gl.prevBuffer = 0, this.gl.control = null);
|
|
1694
|
-
}
|
|
1695
|
-
get glBuffer() {
|
|
1696
|
-
if (this.gl.buffer == null) throw new Error("gl buffer not initialized");
|
|
1697
|
-
return this.gl.prevBuffer !== this.writePos && console.warn("buffer not updated"), this.gl.buffer;
|
|
1698
|
-
}
|
|
1699
|
-
[Symbol.iterator]() {
|
|
1700
|
-
if (this.dataType.isVariable) {
|
|
1701
|
-
const e = new pt(this);
|
|
1702
|
-
return this.dataType.equals(p.JSON) ? new yt(e) : e;
|
|
1703
|
-
}
|
|
1704
|
-
return new bt(this);
|
|
1705
|
-
}
|
|
1706
|
-
slice(e, t) {
|
|
1707
|
-
return this.sliceSub(!1, e, t);
|
|
1708
|
-
}
|
|
1709
|
-
sub(e, t) {
|
|
1710
|
-
return this.sliceSub(!0, e, t);
|
|
1711
|
-
}
|
|
1712
|
-
subIterator(e, t) {
|
|
1713
|
-
return new fe(this, e, t ?? this.length);
|
|
1714
|
-
}
|
|
1715
|
-
subAlignmentIterator(e, t) {
|
|
1716
|
-
return new fe(
|
|
1717
|
-
this,
|
|
1718
|
-
Number(e - this.alignment),
|
|
1719
|
-
Number(t - this.alignment)
|
|
1720
|
-
);
|
|
1721
|
-
}
|
|
1722
|
-
subBytes(e, t) {
|
|
1723
|
-
if (e >= 0 && (t == null || t >= this.byteLength.valueOf())) return this;
|
|
1724
|
-
const n = this.data.subarray(e, t);
|
|
1725
|
-
return new B({
|
|
1726
|
-
data: n,
|
|
1727
|
-
dataType: this.dataType,
|
|
1728
|
-
timeRange: this._timeRange,
|
|
1729
|
-
sampleOffset: this.sampleOffset,
|
|
1730
|
-
glBufferUsage: this.gl.bufferUsage,
|
|
1731
|
-
alignment: this.alignment + BigInt(e)
|
|
1732
|
-
});
|
|
1733
|
-
}
|
|
1734
|
-
sliceSub(e, t, n) {
|
|
1735
|
-
if (t <= 0 && (n == null || n >= this.length)) return this;
|
|
1736
|
-
let s;
|
|
1737
|
-
return e ? s = this.data.subarray(t, n) : s = this.data.slice(t, n), new B({
|
|
1738
|
-
data: s,
|
|
1739
|
-
dataType: this.dataType,
|
|
1740
|
-
timeRange: this._timeRange,
|
|
1741
|
-
sampleOffset: this.sampleOffset,
|
|
1742
|
-
glBufferUsage: this.gl.bufferUsage,
|
|
1743
|
-
alignment: this.alignment + BigInt(t)
|
|
1744
|
-
});
|
|
1745
|
-
}
|
|
1746
|
-
reAlign(e) {
|
|
1747
|
-
return new B({
|
|
1748
|
-
data: this.buffer,
|
|
1749
|
-
dataType: this.dataType,
|
|
1750
|
-
timeRange: G.ZERO,
|
|
1751
|
-
sampleOffset: this.sampleOffset,
|
|
1752
|
-
glBufferUsage: "static",
|
|
1753
|
-
alignment: e
|
|
1754
|
-
});
|
|
1755
|
-
}
|
|
1756
|
-
};
|
|
1757
|
-
i(j, "crudeZ", u.object({
|
|
1758
|
-
timeRange: G.z.optional(),
|
|
1759
|
-
dataType: p.z,
|
|
1760
|
-
alignment: u.coerce.bigint().optional(),
|
|
1761
|
-
data: u.union([
|
|
1762
|
-
dt,
|
|
1763
|
-
gt,
|
|
1764
|
-
u.instanceof(ArrayBuffer),
|
|
1765
|
-
u.instanceof(Uint8Array)
|
|
1766
|
-
]),
|
|
1767
|
-
glBufferUsage: ht.optional().default("static").optional()
|
|
1768
|
-
})), i(j, "z", j.crudeZ.transform((r) => new j(r)));
|
|
1769
|
-
let mt = j, fe = class {
|
|
1770
|
-
constructor(e, t, n) {
|
|
1771
|
-
i(this, "series"), i(this, "end"), i(this, "index"), this.series = e;
|
|
1772
|
-
const s = z(0, e.length);
|
|
1773
|
-
this.end = he(s, n), this.index = he(s, t);
|
|
1774
|
-
}
|
|
1775
|
-
next() {
|
|
1776
|
-
return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
|
|
1777
|
-
}
|
|
1778
|
-
[Symbol.iterator]() {
|
|
1779
|
-
return this;
|
|
1780
|
-
}
|
|
1781
|
-
};
|
|
1782
|
-
class pt {
|
|
1783
|
-
constructor(e) {
|
|
1784
|
-
if (i(this, "series"), i(this, "index"), i(this, "decoder"), !e.dataType.isVariable)
|
|
1785
|
-
throw new Error(
|
|
1786
|
-
"cannot create a variable series iterator for a non-variable series"
|
|
1787
|
-
);
|
|
1788
|
-
this.series = e, this.index = 0, this.decoder = new TextDecoder();
|
|
1789
|
-
}
|
|
1790
|
-
next() {
|
|
1791
|
-
const e = this.index, t = this.series.data;
|
|
1792
|
-
for (; this.index < t.length && t[this.index] !== ie; ) this.index++;
|
|
1793
|
-
const n = this.index;
|
|
1794
|
-
return e === n ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(e, n)) });
|
|
1795
|
-
}
|
|
1796
|
-
[Symbol.iterator]() {
|
|
1797
|
-
return this;
|
|
1798
|
-
}
|
|
1799
|
-
}
|
|
1800
|
-
var de, ge;
|
|
1801
|
-
class yt {
|
|
1802
|
-
constructor(e) {
|
|
1803
|
-
i(this, "wrapped"), i(this, de, "JSONSeriesIterator"), this.wrapped = e;
|
|
1804
|
-
}
|
|
1805
|
-
next() {
|
|
1806
|
-
const e = this.wrapped.next();
|
|
1807
|
-
return e.done === !0 ? { done: !0, value: void 0 } : {
|
|
1808
|
-
done: !1,
|
|
1809
|
-
value: J.decodeString(e.value)
|
|
1810
|
-
};
|
|
1811
|
-
}
|
|
1812
|
-
[(ge = Symbol.iterator, de = Symbol.toStringTag, ge)]() {
|
|
1813
|
-
return this;
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1816
|
-
var me, pe;
|
|
1817
|
-
class bt {
|
|
1818
|
-
constructor(e) {
|
|
1819
|
-
i(this, "series"), i(this, "index"), i(this, me, "SeriesIterator"), this.series = e, this.index = 0;
|
|
1820
|
-
}
|
|
1821
|
-
next() {
|
|
1822
|
-
return this.index >= this.series.length ? { done: !0, value: void 0 } : {
|
|
1823
|
-
done: !1,
|
|
1824
|
-
value: this.series.at(this.index++, !0)
|
|
1825
|
-
};
|
|
1826
|
-
}
|
|
1827
|
-
[(pe = Symbol.iterator, me = Symbol.toStringTag, pe)]() {
|
|
1828
|
-
return this;
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
class $r {
|
|
1832
|
-
constructor(e) {
|
|
1833
|
-
if (i(this, "series"), e.length !== 0) {
|
|
1834
|
-
const t = e[0].dataType;
|
|
1835
|
-
for (let n = 1; n < e.length; n++)
|
|
1836
|
-
if (!e[n].dataType.equals(t))
|
|
1837
|
-
throw new Error("[multi-series] - series must have the same data type");
|
|
1838
|
-
}
|
|
1839
|
-
this.series = e;
|
|
1840
|
-
}
|
|
1841
|
-
as(e) {
|
|
1842
|
-
if (!new p(e).equals(this.dataType))
|
|
1843
|
-
throw new Error(
|
|
1844
|
-
`cannot convert series of type ${this.dataType.toString()} to ${e.toString()}`
|
|
1845
|
-
);
|
|
1846
|
-
return this;
|
|
1847
|
-
}
|
|
1848
|
-
get dataType() {
|
|
1849
|
-
return this.series.length === 0 ? p.UNKNOWN : this.series[0].dataType;
|
|
1850
|
-
}
|
|
1851
|
-
get timeRange() {
|
|
1852
|
-
return this.series.length === 0 ? G.ZERO : new G(
|
|
1853
|
-
this.series[0].timeRange.start,
|
|
1854
|
-
this.series[this.series.length - 1].timeRange.end
|
|
1855
|
-
);
|
|
1856
|
-
}
|
|
1857
|
-
get alignment() {
|
|
1858
|
-
return this.series.length === 0 ? 0n : this.series[0].alignment;
|
|
1859
|
-
}
|
|
1860
|
-
get alignmentBounds() {
|
|
1861
|
-
return this.series.length === 0 ? z(0n, 0n) : z(
|
|
1862
|
-
this.series[0].alignmentBounds.lower,
|
|
1863
|
-
this.series[this.series.length - 1].alignmentBounds.upper
|
|
1864
|
-
);
|
|
1865
|
-
}
|
|
1866
|
-
push(e) {
|
|
1867
|
-
this.series.push(e);
|
|
1868
|
-
}
|
|
1869
|
-
get length() {
|
|
1870
|
-
return this.series.reduce((e, t) => e + t.length, 0);
|
|
1871
|
-
}
|
|
1872
|
-
atAlignment(e, t) {
|
|
1873
|
-
if (this.series.length === 0) {
|
|
1874
|
-
if (t) throw new Error(`[series] - no value at alignment ${e}`);
|
|
1875
|
-
return;
|
|
1876
|
-
}
|
|
1877
|
-
for (const n of this.series)
|
|
1878
|
-
if (Z(n.alignmentBounds, e))
|
|
1879
|
-
return n.atAlignment(e, t);
|
|
1880
|
-
if (t) throw new Error(`[series] - no value at alignment ${e}`);
|
|
1881
|
-
}
|
|
1882
|
-
at(e, t = !1) {
|
|
1883
|
-
e < 0 && (e = this.length + e);
|
|
1884
|
-
for (const n of this.series) {
|
|
1885
|
-
if (e < n.length) return n.at(e, t);
|
|
1886
|
-
e -= n.length;
|
|
1887
|
-
}
|
|
1888
|
-
if (t) throw new Error(`[series] - no value at index ${e}`);
|
|
1889
|
-
}
|
|
1890
|
-
subIterator(e, t) {
|
|
1891
|
-
return new te(this, e, t ?? this.length);
|
|
1892
|
-
}
|
|
1893
|
-
subAlignmentIterator(e, t) {
|
|
1894
|
-
if (e >= this.alignmentBounds.upper || t <= this.alignmentBounds.lower)
|
|
1895
|
-
return se;
|
|
1896
|
-
let n = 0;
|
|
1897
|
-
for (let a = 0; a < this.series.length; a++) {
|
|
1898
|
-
const l = this.series[a];
|
|
1899
|
-
if (e < l.alignment) break;
|
|
1900
|
-
if (e >= l.alignmentBounds.upper) n += l.length;
|
|
1901
|
-
else if (Z(l.alignmentBounds, e)) {
|
|
1902
|
-
n += Number(e - l.alignment);
|
|
1903
|
-
break;
|
|
1904
|
-
}
|
|
1905
|
-
}
|
|
1906
|
-
let s = 0;
|
|
1907
|
-
for (let a = 0; a < this.series.length; a++) {
|
|
1908
|
-
const l = this.series[a];
|
|
1909
|
-
if (t < l.alignment) break;
|
|
1910
|
-
if (t >= l.alignmentBounds.upper) s += l.length;
|
|
1911
|
-
else if (Z(l.alignmentBounds, t)) {
|
|
1912
|
-
s += Number(t - l.alignment);
|
|
1913
|
-
break;
|
|
1914
|
-
}
|
|
1915
|
-
}
|
|
1916
|
-
return new te(this, n, s);
|
|
1917
|
-
}
|
|
1918
|
-
subAlignmentSpanIterator(e, t) {
|
|
1919
|
-
if (e >= this.alignmentBounds.upper) return se;
|
|
1920
|
-
let n = 0;
|
|
1921
|
-
for (let s = 0; s < this.series.length; s++) {
|
|
1922
|
-
const a = this.series[s];
|
|
1923
|
-
if (e < a.alignment) break;
|
|
1924
|
-
if (e >= a.alignmentBounds.upper) n += a.length;
|
|
1925
|
-
else if (Z(a.alignmentBounds, e)) {
|
|
1926
|
-
n += Number(e - a.alignment);
|
|
1927
|
-
break;
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
return new te(this, n, n + t);
|
|
1931
|
-
}
|
|
1932
|
-
get byteLength() {
|
|
1933
|
-
return new Q(this.series.reduce((e, t) => e + t.byteLength.valueOf(), 0));
|
|
1934
|
-
}
|
|
1935
|
-
get data() {
|
|
1936
|
-
const e = new this.dataType.Array(this.length);
|
|
1937
|
-
let t = 0;
|
|
1938
|
-
for (const n of this.series)
|
|
1939
|
-
e.set(n.data, t), t += n.length;
|
|
1940
|
-
return new this.dataType.Array(e.buffer);
|
|
1941
|
-
}
|
|
1942
|
-
traverseAlignment(e, t) {
|
|
1943
|
-
const n = this.series.map((s) => s.alignmentBounds);
|
|
1944
|
-
return Ye(n, e, t);
|
|
1945
|
-
}
|
|
1946
|
-
distance(e, t) {
|
|
1947
|
-
const n = this.series.map((s) => s.alignmentBounds);
|
|
1948
|
-
return Ze(n, e, t);
|
|
1949
|
-
}
|
|
1950
|
-
parseJSON(e) {
|
|
1951
|
-
if (!this.dataType.equals(p.JSON))
|
|
1952
|
-
throw new Error("cannot parse non-JSON series as JSON");
|
|
1953
|
-
return this.series.flatMap((t) => t.parseJSON(e));
|
|
1954
|
-
}
|
|
1955
|
-
[Symbol.iterator]() {
|
|
1956
|
-
return this.series.length === 0 ? {
|
|
1957
|
-
next() {
|
|
1958
|
-
return { done: !0, value: void 0 };
|
|
1959
|
-
}
|
|
1960
|
-
} : new wt(this.series);
|
|
1961
|
-
}
|
|
1962
|
-
}
|
|
1963
|
-
var ye, be;
|
|
1964
|
-
class wt {
|
|
1965
|
-
constructor(e) {
|
|
1966
|
-
i(this, "series"), i(this, "seriesIndex"), i(this, "internal"), i(this, ye, "MultiSeriesIterator"), this.series = e, this.seriesIndex = 0, this.internal = e[0][Symbol.iterator]();
|
|
1967
|
-
}
|
|
1968
|
-
next() {
|
|
1969
|
-
const e = this.internal.next();
|
|
1970
|
-
return e.done === !1 ? e : this.seriesIndex === this.series.length - 1 ? { done: !0, value: void 0 } : (this.internal = this.series[++this.seriesIndex][Symbol.iterator](), this.next());
|
|
1971
|
-
}
|
|
1972
|
-
[(be = Symbol.iterator, ye = Symbol.toStringTag, be)]() {
|
|
1973
|
-
return this;
|
|
1974
|
-
}
|
|
1975
|
-
}
|
|
1976
|
-
let te = class {
|
|
1977
|
-
constructor(e, t, n) {
|
|
1978
|
-
i(this, "series"), i(this, "index"), i(this, "end"), this.series = e, this.end = n, this.index = t;
|
|
1979
|
-
}
|
|
1980
|
-
next() {
|
|
1981
|
-
return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
|
|
1982
|
-
}
|
|
1983
|
-
[Symbol.iterator]() {
|
|
1984
|
-
return this;
|
|
1985
|
-
}
|
|
1986
|
-
};
|
|
1987
|
-
const we = (r) => {
|
|
1988
|
-
const e = r >> 32n, t = r & 0xffffffffn;
|
|
1989
|
-
return { domain: e, sample: t };
|
|
1990
|
-
}, Ot = (r, e, t = ".") => {
|
|
1991
|
-
const n = r.split(t);
|
|
1992
|
-
return n.map((s, a) => {
|
|
1993
|
-
const l = e(s, a, n);
|
|
1994
|
-
return l == null ? null : typeof l == "string" ? l : l.join(t);
|
|
1995
|
-
}).filter((s) => s != null).join(t);
|
|
1996
|
-
}, Re = (r, e, t = { optional: !1, separator: "." }) => {
|
|
1997
|
-
t.separator ?? (t.separator = ".");
|
|
1998
|
-
const { optional: n, getter: s = (m, f) => m[f] } = t, a = e.split(t.separator);
|
|
1999
|
-
if (a.length === 1 && a[0] === "") return r;
|
|
2000
|
-
let l = r;
|
|
2001
|
-
for (const m of a) {
|
|
2002
|
-
const f = s(l, m);
|
|
2003
|
-
if (f == null) {
|
|
2004
|
-
if (n) return null;
|
|
2005
|
-
throw new Error(`Path ${e} does not exist. ${m} is null`);
|
|
2006
|
-
}
|
|
2007
|
-
l = f;
|
|
2008
|
-
}
|
|
2009
|
-
return l;
|
|
2010
|
-
}, Br = (r, e, t) => {
|
|
2011
|
-
const n = e.split(".");
|
|
2012
|
-
let s = r;
|
|
2013
|
-
for (let a = 0; a < n.length - 1; a++) {
|
|
2014
|
-
const l = n[a];
|
|
2015
|
-
s[l] ?? (s[l] = {}), s = s[l];
|
|
2016
|
-
}
|
|
2017
|
-
try {
|
|
2018
|
-
s[n[n.length - 1]] = t;
|
|
2019
|
-
} catch (a) {
|
|
2020
|
-
throw console.error("failed to set value", t, "at path", e, "on object", r), a;
|
|
2021
|
-
}
|
|
2022
|
-
}, Ur = (r, e) => {
|
|
2023
|
-
const t = e.split(".");
|
|
2024
|
-
let n = r;
|
|
2025
|
-
for (let s = 0; s < t.length - 1; s++) {
|
|
2026
|
-
const a = t[s];
|
|
2027
|
-
if (n[a] == null) return;
|
|
2028
|
-
n = n[a];
|
|
2029
|
-
}
|
|
2030
|
-
if (Array.isArray(n)) {
|
|
2031
|
-
const s = parseInt(t[t.length - 1]);
|
|
2032
|
-
if (isNaN(s)) return;
|
|
2033
|
-
n.splice(s, 1);
|
|
2034
|
-
return;
|
|
2035
|
-
}
|
|
2036
|
-
delete n[t[t.length - 1]];
|
|
2037
|
-
}, xr = (r, e) => {
|
|
2038
|
-
const t = r.split(".");
|
|
2039
|
-
return e < 0 ? t[t.length + e] : t[e];
|
|
2040
|
-
}, Rr = (r, e) => {
|
|
2041
|
-
try {
|
|
2042
|
-
return Re(r, e), !0;
|
|
2043
|
-
} catch {
|
|
2044
|
-
return !1;
|
|
2045
|
-
}
|
|
2046
|
-
}, Dr = (r, e) => {
|
|
2047
|
-
if (e.length === 0) return !0;
|
|
2048
|
-
const t = r.split("."), n = e.split(".");
|
|
2049
|
-
if (n.length > t.length) return !1;
|
|
2050
|
-
for (let s = 0; s < n.length; s++) {
|
|
2051
|
-
const a = t[s], l = n[s];
|
|
2052
|
-
if (l !== "*" && a !== l)
|
|
2053
|
-
return !1;
|
|
2054
|
-
}
|
|
2055
|
-
return !0;
|
|
2056
|
-
};
|
|
2057
|
-
u.object({ key: u.string(), value: u.string() });
|
|
2058
|
-
u.record(
|
|
2059
|
-
u.union([u.number(), u.string(), u.symbol()]),
|
|
2060
|
-
u.unknown()
|
|
2061
|
-
);
|
|
2062
|
-
const De = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Tt = De(), Le = ["macOS", "Windows", "Linux"], vt = ["macos", "windows", "linux"], St = {
|
|
2063
|
-
macos: "macOS",
|
|
2064
|
-
windows: "Windows",
|
|
2065
|
-
linux: "Linux"
|
|
2066
|
-
}, Nt = u.enum(Le).or(
|
|
2067
|
-
u.enum(vt).transform((r) => St[r])
|
|
2068
|
-
), It = () => {
|
|
2069
|
-
if (typeof window > "u") return;
|
|
2070
|
-
const r = window.navigator.userAgent.toLowerCase();
|
|
2071
|
-
if (r.includes("mac")) return "macOS";
|
|
2072
|
-
if (r.includes("win")) return "Windows";
|
|
2073
|
-
if (r.includes("linux")) return "Linux";
|
|
2074
|
-
};
|
|
2075
|
-
let re;
|
|
2076
|
-
const At = (r = {}) => {
|
|
2077
|
-
const { force: e, default: t } = r;
|
|
2078
|
-
return e ?? re ?? (re = It(), re ?? t);
|
|
2079
|
-
}, Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2080
|
-
__proto__: null,
|
|
2081
|
-
OPERATING_SYSTEMS: Le,
|
|
2082
|
-
RUNTIME: Tt,
|
|
2083
|
-
detect: De,
|
|
2084
|
-
getOS: At,
|
|
2085
|
-
osZ: Nt
|
|
2086
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2087
|
-
var Et = Object.defineProperty, $t = (r, e, t) => e in r ? Et(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, q = (r, e, t) => $t(r, typeof e != "symbol" ? e + "" : e, t);
|
|
2088
|
-
const Mt = (...r) => r.map(Ce).join(""), Ce = (r) => (r.endsWith("/") || (r += "/"), r.startsWith("/") && (r = r.slice(1)), r), Bt = (r) => r.endsWith("/") ? r.slice(0, -1) : r, Oe = class ae {
|
|
2089
|
-
/**
|
|
2090
|
-
* @param host - The hostname or IP address of the server.
|
|
2091
|
-
* @param port - The port number of the server.
|
|
2092
|
-
* @param protocol - The protocol to use for all requests. Defaults to "".
|
|
2093
|
-
* @param pathPrefix - A path prefix to use for all requests. Defaults to "".
|
|
2094
|
-
*/
|
|
2095
|
-
constructor({ host: e, port: t, protocol: n = "", pathPrefix: s = "" }) {
|
|
2096
|
-
q(this, "protocol"), q(this, "host"), q(this, "port"), q(this, "path"), this.protocol = n, this.host = e, this.port = t, this.path = Ce(s);
|
|
2097
|
-
}
|
|
2098
|
-
/**
|
|
2099
|
-
* Replaces creates a new URL with the specified properties replaced.
|
|
2100
|
-
* @param props - The properties to replace.
|
|
2101
|
-
* @returns a new URL.
|
|
2102
|
-
*/
|
|
2103
|
-
replace(e) {
|
|
2104
|
-
return new ae({
|
|
2105
|
-
host: e.host ?? this.host,
|
|
2106
|
-
port: e.port ?? this.port,
|
|
2107
|
-
protocol: e.protocol ?? this.protocol,
|
|
2108
|
-
pathPrefix: e.pathPrefix ?? this.path
|
|
2109
|
-
});
|
|
2110
|
-
}
|
|
2111
|
-
/**
|
|
2112
|
-
* Creates a new url with the given path appended to the current path.
|
|
2113
|
-
* @param path - the path to append to the URL.
|
|
2114
|
-
* @returns a new URL.
|
|
2115
|
-
*/
|
|
2116
|
-
child(e) {
|
|
2117
|
-
return new ae({
|
|
2118
|
-
...this,
|
|
2119
|
-
pathPrefix: Mt(this.path, e)
|
|
2120
|
-
});
|
|
2121
|
-
}
|
|
2122
|
-
/** @returns a string representation of the url */
|
|
2123
|
-
toString() {
|
|
2124
|
-
return Bt(
|
|
2125
|
-
`${this.protocol}://${this.host}:${this.port}/${this.path}`
|
|
2126
|
-
);
|
|
2127
|
-
}
|
|
2128
|
-
};
|
|
2129
|
-
q(Oe, "UNKNOWN", new Oe({ host: "unknown", port: 0 }));
|
|
2130
|
-
const Ut = -128, xt = 127, Rt = u.number().int().min(Ut).max(xt), Dt = -32768, Lt = 32767, Ct = u.number().int().min(Dt).max(Lt), Pt = -2147483648, jt = 2147483647, qt = u.number().int().min(Pt).max(jt), kt = -9223372036854775808n, Ft = 9223372036854775807n, Vt = u.bigint().min(kt).max(Ft), zt = 255, Gt = u.number().int().min(0).max(zt), Yt = 65535, Zt = u.number().int().min(0).max(Yt), Jt = 4294967295, Wt = u.number().int().min(0).max(Jt), Ht = 18446744073709551615n, Kt = u.bigint().min(0n).max(Ht), Pe = (r) => Ot(r, (e, t, n) => {
|
|
2131
|
-
const s = t === n.length - 1, a = !isNaN(parseInt(e)), l = !isNaN(parseInt(n[t + 1]));
|
|
2132
|
-
return a && (e = "element"), s || l ? e : [e, "shape"];
|
|
2133
|
-
}), Te = (r, e) => {
|
|
2134
|
-
if (r == null) return null;
|
|
2135
|
-
const t = r[e];
|
|
2136
|
-
return t == null && typeof r == "object" && "sourceType" in r ? r.sourceType()[e] : t;
|
|
2137
|
-
}, Xt = (r, e, t) => Re(
|
|
2138
|
-
Te(r, "shape"),
|
|
2139
|
-
Pe(e),
|
|
2140
|
-
{ ...t, getter: Te }
|
|
2141
|
-
), Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2142
|
-
__proto__: null,
|
|
2143
|
-
getFieldSchema: Xt,
|
|
2144
|
-
getFieldSchemaPath: Pe,
|
|
2145
|
-
int16: Ct,
|
|
2146
|
-
int32: qt,
|
|
2147
|
-
int64: Vt,
|
|
2148
|
-
int8: Rt,
|
|
2149
|
-
uint16: Zt,
|
|
2150
|
-
uint32: Wt,
|
|
2151
|
-
uint64: Kt,
|
|
2152
|
-
uint8: Gt
|
|
2153
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2154
|
-
var Qt = Object.defineProperty, _t = (r, e, t) => e in r ? Qt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, k = (r, e, t) => _t(r, typeof e != "symbol" ? e + "" : e, t);
|
|
2155
|
-
u.object({
|
|
2156
|
-
interval: O.z.optional(),
|
|
2157
|
-
maxRetries: u.number().optional(),
|
|
2158
|
-
scale: u.number().optional()
|
|
2159
|
-
});
|
|
2160
|
-
const U = class extends Number {
|
|
2161
|
-
};
|
|
2162
|
-
k(U, "ABSOLUTE", 255), k(U, "MINIMUM", 0), k(U, "BOUNDS", {
|
|
2163
|
-
lower: U.MINIMUM,
|
|
2164
|
-
// upper bound is exclusive, so we add 1
|
|
2165
|
-
upper: U.ABSOLUTE + 1
|
|
2166
|
-
}), k(U, "z", u.union([
|
|
2167
|
-
u.instanceof(U),
|
|
2168
|
-
u.number().int().min(0).max(255).transform((r) => new U(r)),
|
|
2169
|
-
u.instanceof(Number).transform((r) => new U(r))
|
|
2170
|
-
]));
|
|
2171
|
-
let je = U;
|
|
2172
|
-
const qe = u.object({
|
|
2173
|
-
name: u.string(),
|
|
2174
|
-
key: u.string()
|
|
2175
|
-
}), er = (r) => u.object({
|
|
2176
|
-
subject: qe,
|
|
2177
|
-
resource: r,
|
|
2178
|
-
authority: je.z
|
|
2179
|
-
}), tr = (...r) => (e) => e.filter((t) => {
|
|
2180
|
-
let n = !1;
|
|
2181
|
-
return t.to != null && (n = r.includes(t.to.resource)), t.from != null && !n && (n = r.includes(t.from.resource)), n;
|
|
2182
|
-
}), jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2183
|
-
__proto__: null,
|
|
2184
|
-
Authority: je,
|
|
2185
|
-
filterTransfersByChannelKey: tr,
|
|
2186
|
-
stateZ: er,
|
|
2187
|
-
subjectZ: qe
|
|
2188
|
-
}, Symbol.toStringTag, { value: "Module" })), ke = class F extends Error {
|
|
2189
|
-
constructor() {
|
|
2190
|
-
super(F.MESSAGE);
|
|
2191
|
-
}
|
|
2192
|
-
/** Returns true if the error or message is a cancellation error" */
|
|
2193
|
-
matches(e) {
|
|
2194
|
-
return typeof e == "string" ? e.includes(F.MESSAGE) : e instanceof F || e.message.includes(F.MESSAGE);
|
|
2195
|
-
}
|
|
2196
|
-
};
|
|
2197
|
-
k(ke, "MESSAGE", "canceled");
|
|
2198
|
-
let rr = ke;
|
|
2199
|
-
new rr();
|
|
2200
|
-
const qr = (r) => r ? -1 : 1, oe = u.string().regex(/^\d+\.\d+\.\d+$/), Y = (r, e, t = {}) => {
|
|
2201
|
-
t.checkMajor ?? (t.checkMajor = !0), t.checkMinor ?? (t.checkMinor = !0), t.checkPatch ?? (t.checkPatch = !0);
|
|
2202
|
-
const n = oe.parse(r), s = oe.parse(e), [a, l, m] = n.split(".").map(Number), [f, g, v] = s.split(".").map(Number);
|
|
2203
|
-
if (t.checkMajor) {
|
|
2204
|
-
if (a < f) return W;
|
|
2205
|
-
if (a > f) return H;
|
|
2206
|
-
}
|
|
2207
|
-
if (t.checkMinor) {
|
|
2208
|
-
if (l < g) return W;
|
|
2209
|
-
if (l > g) return H;
|
|
2210
|
-
}
|
|
2211
|
-
if (t.checkPatch) {
|
|
2212
|
-
if (m < v) return W;
|
|
2213
|
-
if (m > v) return H;
|
|
2214
|
-
}
|
|
2215
|
-
return L;
|
|
2216
|
-
}, nr = (r, e, t = {}) => Me(Y(r, e, t)), Fe = (r, e, t = {}) => $e(Y(r, e, t)), sr = (r, e, t = {}) => Ee(Y(r, e, t)), ir = ({
|
|
2217
|
-
name: r,
|
|
2218
|
-
migrate: e
|
|
2219
|
-
}) => (t) => {
|
|
2220
|
-
try {
|
|
2221
|
-
const n = e(t);
|
|
2222
|
-
return console.log(`${r} migrated: ${t.version} -> ${n.version}`), n;
|
|
2223
|
-
} catch (n) {
|
|
2224
|
-
throw console.log(`${r} failed to migrate from ${t.version}`), console.error(n), n;
|
|
2225
|
-
}
|
|
2226
|
-
}, ar = ({
|
|
2227
|
-
name: r,
|
|
2228
|
-
migrations: e,
|
|
2229
|
-
targetSchema: t,
|
|
2230
|
-
defaultVersion: n,
|
|
2231
|
-
def: s
|
|
2232
|
-
}) => {
|
|
2233
|
-
const a = Object.keys(e).sort(Y).pop();
|
|
2234
|
-
if (a == null)
|
|
2235
|
-
return (g) => {
|
|
2236
|
-
if (g.version ?? (g.version = n), g.version !== s.version)
|
|
2237
|
-
return console.log(
|
|
2238
|
-
`${r} version ${g.version} is newer than latest version of ${s.version}.
|
|
2239
|
-
Returning default instead.
|
|
2240
|
-
`
|
|
2241
|
-
), s;
|
|
2242
|
-
try {
|
|
2243
|
-
return t != null ? t.parse(g) : g;
|
|
2244
|
-
} catch (v) {
|
|
2245
|
-
return console.log(`${r} failed to parse default. Exiting with default`), console.error(v), s;
|
|
2246
|
-
}
|
|
2247
|
-
};
|
|
2248
|
-
const l = Object.keys(e).length;
|
|
2249
|
-
let m = !1;
|
|
2250
|
-
const f = (g) => {
|
|
2251
|
-
try {
|
|
2252
|
-
if (l === 0 || Fe(g.version, a))
|
|
2253
|
-
return console.log(m ? `${r} ${g.version} now up to date` : `${r} version ${g.version} is up to date with target version ${s.version}`), g;
|
|
2254
|
-
const v = g.version, c = e[v], E = c(g);
|
|
2255
|
-
return m = !0, f(E);
|
|
2256
|
-
} catch (v) {
|
|
2257
|
-
return console.log(
|
|
2258
|
-
`${r} failed to migrate from ${g.version} to ${a}`
|
|
2259
|
-
), console.error(v), s;
|
|
2260
|
-
}
|
|
2261
|
-
};
|
|
2262
|
-
return (g) => {
|
|
2263
|
-
try {
|
|
2264
|
-
if (g.version == null)
|
|
2265
|
-
if (n != null)
|
|
2266
|
-
console.log(
|
|
2267
|
-
`${r} version is null. Setting version to default of ${n}`
|
|
2268
|
-
), g.version = n;
|
|
2269
|
-
else
|
|
2270
|
-
return console.log(
|
|
2271
|
-
`${r} version is null and no default version set. Exiting with default`
|
|
2272
|
-
), s;
|
|
2273
|
-
return f(g);
|
|
2274
|
-
} catch (v) {
|
|
2275
|
-
return console.log(`${r} failed to parse final result. Exiting with default`), console.error(v), s;
|
|
2276
|
-
}
|
|
2277
|
-
};
|
|
2278
|
-
}, kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2279
|
-
__proto__: null,
|
|
2280
|
-
compareSemVer: Y,
|
|
2281
|
-
createMigration: ir,
|
|
2282
|
-
migrator: ar,
|
|
2283
|
-
semVerNewer: Fe,
|
|
2284
|
-
semVerOlder: sr,
|
|
2285
|
-
semVerZ: oe,
|
|
2286
|
-
versionsEqual: nr
|
|
2287
|
-
}, Symbol.toStringTag, { value: "Module" })), Fr = (r) => {
|
|
2288
|
-
if (r === void 0 || typeof r == "string" || typeof r == "number")
|
|
2289
|
-
return r;
|
|
2290
|
-
if (r.toString === void 0) throw new Error("invalid renderer");
|
|
2291
|
-
return r.toString();
|
|
2292
|
-
}, Vr = (r) => Array.isArray(r) ? [...r] : typeof r == "object" && r !== null ? { ...r } : r, or = ["h1", "h2", "h3", "h4", "h5", "p", "small"], zr = u.enum(or), ur = {
|
|
2293
|
-
h1: "h2",
|
|
2294
|
-
h2: "h3",
|
|
2295
|
-
h3: "h4",
|
|
2296
|
-
h4: "h5",
|
|
2297
|
-
h5: "p",
|
|
2298
|
-
p: "small",
|
|
2299
|
-
small: "small"
|
|
2300
|
-
}, Gr = (r) => ur[r], lr = {
|
|
2301
|
-
h1: "h1",
|
|
2302
|
-
h2: "h1",
|
|
2303
|
-
h3: "h2",
|
|
2304
|
-
h4: "h3",
|
|
2305
|
-
h5: "h4",
|
|
2306
|
-
p: "h5",
|
|
2307
|
-
small: "p"
|
|
2308
|
-
}, Yr = (r) => lr[r], hr = ["normal", "bold", "bolder", "lighter"], Zr = u.union([u.number(), u.enum(hr)]), Jr = u.object({
|
|
2309
|
-
size: u.number(),
|
|
2310
|
-
weight: u.union([u.number(), u.string()]),
|
|
2311
|
-
lineHeight: u.number(),
|
|
2312
|
-
textTransform: u.string().optional()
|
|
2313
|
-
}), Wr = {
|
|
2314
|
-
small: "small",
|
|
2315
|
-
medium: "p",
|
|
2316
|
-
large: "h5",
|
|
2317
|
-
huge: "h2"
|
|
2318
|
-
}, Hr = {
|
|
2319
|
-
h1: "huge",
|
|
2320
|
-
h2: "huge",
|
|
2321
|
-
h3: "huge",
|
|
2322
|
-
h4: "large",
|
|
2323
|
-
h5: "small",
|
|
2324
|
-
p: "medium",
|
|
2325
|
-
small: "small"
|
|
2326
|
-
}, Ve = (r) => typeof r == "function", cr = (r, e) => Ve(r) ? r(e) : r, ee = (r) => ze(r) ? r() : r, ze = (r) => typeof r == "function", fr = ({
|
|
2327
|
-
initial: r,
|
|
2328
|
-
value: e,
|
|
2329
|
-
onChange: t
|
|
2330
|
-
}) => {
|
|
2331
|
-
const [n, s] = ue(ee(e ?? r));
|
|
2332
|
-
return e != null && t != null ? [e, t] : [n, s];
|
|
2333
|
-
}, dr = ({
|
|
2334
|
-
initial: r,
|
|
2335
|
-
value: e,
|
|
2336
|
-
onChange: t
|
|
2337
|
-
}) => {
|
|
2338
|
-
const [n, s] = ue(ee(e ?? r));
|
|
2339
|
-
return e != null && t != null ? [e, t] : [n, s];
|
|
2340
|
-
}, gr = (r, e) => {
|
|
2341
|
-
const [t, n] = ue(() => {
|
|
2342
|
-
const s = localStorage.getItem(e);
|
|
2343
|
-
return s == null ? ee(r) : JSON.parse(s);
|
|
2344
|
-
});
|
|
2345
|
-
return [
|
|
2346
|
-
t,
|
|
2347
|
-
(s) => {
|
|
2348
|
-
n(s), localStorage.setItem(e, JSON.stringify(s));
|
|
2349
|
-
}
|
|
2350
|
-
];
|
|
2351
|
-
}, Kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2352
|
-
__proto__: null,
|
|
2353
|
-
executeInitialSetter: ee,
|
|
2354
|
-
executeSetter: cr,
|
|
2355
|
-
isInitialSetter: ze,
|
|
2356
|
-
isSetter: Ve,
|
|
2357
|
-
usePassthrough: fr,
|
|
2358
|
-
usePersisted: gr,
|
|
2359
|
-
usePurePassthrough: dr
|
|
2360
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2361
|
-
export {
|
|
2362
|
-
ce as $,
|
|
2363
|
-
Ar as A,
|
|
2364
|
-
Q as B,
|
|
2365
|
-
Wr as C,
|
|
2366
|
-
$r as D,
|
|
2367
|
-
kr as E,
|
|
2368
|
-
Sr as F,
|
|
2369
|
-
Vr as G,
|
|
2370
|
-
Cr as H,
|
|
2371
|
-
Kr as I,
|
|
2372
|
-
A as J,
|
|
2373
|
-
or as L,
|
|
2374
|
-
Nr as R,
|
|
2375
|
-
Lr as S,
|
|
2376
|
-
G as U,
|
|
2377
|
-
jr as Y,
|
|
2378
|
-
mt as Z,
|
|
2379
|
-
Hr as a,
|
|
2380
|
-
Yr as b,
|
|
2381
|
-
Re as c,
|
|
2382
|
-
Gr as d,
|
|
2383
|
-
Tr as e,
|
|
2384
|
-
Br as f,
|
|
2385
|
-
Rr as g,
|
|
2386
|
-
Ur as h,
|
|
2387
|
-
O as i,
|
|
2388
|
-
fr as j,
|
|
2389
|
-
dr as k,
|
|
2390
|
-
zr as l,
|
|
2391
|
-
w as m,
|
|
2392
|
-
cr as n,
|
|
2393
|
-
Se as o,
|
|
2394
|
-
xr as p,
|
|
2395
|
-
Ve as q,
|
|
2396
|
-
qr as r,
|
|
2397
|
-
Jr as s,
|
|
2398
|
-
ee as t,
|
|
2399
|
-
Ot as u,
|
|
2400
|
-
Fr as v,
|
|
2401
|
-
Zr as w,
|
|
2402
|
-
vr as x,
|
|
2403
|
-
Dr as y,
|
|
2404
|
-
p as z
|
|
2405
|
-
};
|