@synnaxlabs/x 0.16.1 → 0.24.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/.turbo/turbo-build.log +99 -7
- package/.vscode/settings.json +5 -1
- package/dist/base-B48bPNx5.cjs +1 -0
- package/dist/base-DnZzEvvz.js +38 -0
- package/dist/binary.cjs +3 -0
- package/dist/binary.js +100 -0
- package/dist/bounds-Bh_QBZZK.cjs +1 -0
- package/dist/bounds-Dmn-hd_-.js +129 -0
- package/dist/bounds.cjs +1 -0
- package/dist/bounds.js +4 -0
- package/dist/box-C92jYSNY.js +205 -0
- package/dist/box-m3dlc1kR.cjs +1 -0
- package/dist/box.cjs +1 -0
- package/dist/box.js +4 -0
- package/dist/caseconv.cjs +1 -0
- package/dist/caseconv.js +4 -0
- package/dist/change-C-YELKx6.cjs +1 -0
- package/dist/change-DLl6DccR.js +12 -0
- package/dist/change.cjs +1 -0
- package/dist/change.js +4 -0
- package/dist/compare.cjs +1 -0
- package/dist/compare.js +4 -0
- package/dist/debounce.cjs +1 -0
- package/dist/debounce.js +17 -0
- package/dist/deep.cjs +1 -0
- package/dist/deep.js +121 -0
- package/dist/destructor.cjs +1 -0
- package/dist/destructor.js +1 -0
- package/dist/dimensions-BAuHfd-b.js +44 -0
- package/dist/dimensions-zMcb9pMk.cjs +1 -0
- package/dist/dimensions.cjs +1 -0
- package/dist/dimensions.js +4 -0
- package/dist/direction-CScbfCdT.js +16 -0
- package/dist/direction-DZbN47uL.cjs +1 -0
- package/dist/direction.cjs +1 -0
- package/dist/direction.js +4 -0
- package/dist/external-B-DoBvh7.cjs +1 -0
- package/dist/external-DI9122wF.js +27 -0
- package/dist/identity.cjs +1 -0
- package/dist/identity.js +4 -0
- package/dist/index-BpCPHf78.cjs +1 -0
- package/dist/index-Bt5ivtN9.js +95 -0
- package/dist/index-BwkQTA-j.js +360 -0
- package/dist/index-CuG8fceO.cjs +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.js +178 -0
- package/dist/kv.cjs +1 -0
- package/dist/kv.js +6 -0
- package/dist/location-CfP9TAnW.js +94 -0
- package/dist/location-c3g6WKs-.cjs +1 -0
- package/dist/location.cjs +1 -0
- package/dist/location.js +4 -0
- package/dist/observe.cjs +1 -0
- package/dist/observe.js +43 -0
- package/dist/path-BO4pyGZf.cjs +1 -0
- package/dist/path-nTHmt_4i.js +65 -0
- package/dist/position-BBnkwGX1.cjs +1 -0
- package/dist/position-B_aphAR0.js +87 -0
- package/dist/position.cjs +1 -0
- package/dist/position.js +4 -0
- package/dist/record.cjs +1 -0
- package/dist/record.js +9 -0
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.js +4 -0
- package/dist/scale-C8axypQ2.cjs +1 -0
- package/dist/scale-CgtgqlYU.js +205 -0
- package/dist/scale.cjs +1 -0
- package/dist/scale.js +4 -0
- package/dist/search.cjs +1 -0
- package/dist/search.js +15 -0
- package/dist/series-8E6FnWBU.cjs +11 -0
- package/dist/series-DCJSrg1P.js +1629 -0
- package/dist/spatial-BOhaO8xN.cjs +1 -0
- package/dist/spatial-DozyssiN.js +11 -0
- package/dist/spatial.cjs +1 -0
- package/dist/spatial.js +20 -0
- package/dist/{binary → src/binary}/encoder.d.ts +26 -2
- package/dist/src/binary/encoder.d.ts.map +1 -0
- package/dist/src/binary/encoder.spec.d.ts.map +1 -0
- package/dist/src/binary/index.d.ts.map +1 -0
- package/dist/src/caseconv/caseconv.d.ts +6 -0
- package/dist/src/caseconv/caseconv.d.ts.map +1 -0
- package/dist/src/caseconv/index.d.ts +2 -0
- package/dist/src/caseconv/index.d.ts.map +1 -0
- package/dist/{change → src/change}/change.d.ts +10 -9
- package/dist/src/change/change.d.ts.map +1 -0
- package/dist/src/change/index.d.ts.map +1 -0
- package/dist/src/clamp/clamp.d.ts.map +1 -0
- package/dist/src/clamp/index.d.ts +2 -0
- package/dist/src/clamp/index.d.ts.map +1 -0
- package/dist/{compare → src/compare}/compare.d.ts +6 -4
- package/dist/src/compare/compare.d.ts.map +1 -0
- package/dist/src/compare/compare.spec.d.ts +2 -0
- package/dist/src/compare/compare.spec.d.ts.map +1 -0
- package/dist/src/compare/index.d.ts.map +1 -0
- package/dist/src/control/control.d.ts +107 -0
- package/dist/src/control/control.d.ts.map +1 -0
- package/dist/src/control/index.d.ts +2 -0
- package/dist/src/control/index.d.ts.map +1 -0
- package/dist/src/debounce/debounce.d.ts.map +1 -0
- package/dist/src/debounce/debounce.spec.d.ts +2 -0
- package/dist/src/debounce/debounce.spec.d.ts.map +1 -0
- package/dist/src/debounce/index.d.ts +2 -0
- package/dist/src/debounce/index.d.ts.map +1 -0
- package/dist/src/deep/copy.d.ts.map +1 -0
- package/dist/{deep → src/deep}/delete.d.ts +2 -1
- package/dist/src/deep/delete.d.ts.map +1 -0
- package/dist/{deep → src/deep}/delete.spec.d.ts.map +1 -1
- package/dist/src/deep/difference.d.ts.map +1 -0
- package/dist/src/deep/difference.spec.d.ts.map +1 -0
- package/dist/src/deep/equal.d.ts.map +1 -0
- package/dist/{deep → src/deep}/equal.spec.d.ts.map +1 -1
- package/dist/{deep → src/deep}/external.d.ts +3 -4
- package/dist/src/deep/external.d.ts.map +1 -0
- package/dist/src/deep/index.d.ts.map +1 -0
- package/dist/src/deep/merge.d.ts +12 -0
- package/dist/src/deep/merge.d.ts.map +1 -0
- package/dist/{deep → src/deep}/merge.spec.d.ts.map +1 -1
- package/dist/src/deep/partial.d.ts.map +1 -0
- package/dist/src/deep/path.d.ts +54 -0
- package/dist/src/deep/path.d.ts.map +1 -0
- package/dist/{deep → src/deep}/path.spec.d.ts.map +1 -1
- package/dist/src/destructor.d.ts.map +1 -0
- package/dist/{identity.d.ts → src/identity.d.ts} +2 -1
- package/dist/src/identity.d.ts.map +1 -0
- package/dist/{index.d.ts → src/index.d.ts} +22 -20
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/invert.d.ts.map +1 -0
- package/dist/src/join.d.ts.map +1 -0
- package/dist/src/kv/index.d.ts.map +1 -0
- package/dist/src/kv/types.d.ts.map +1 -0
- package/dist/src/math/index.d.ts +2 -0
- package/dist/src/math/index.d.ts.map +1 -0
- package/dist/src/math/math.d.ts +11 -0
- package/dist/src/math/math.d.ts.map +1 -0
- package/dist/src/migrate/index.d.ts.map +1 -0
- package/dist/src/migrate/migrate.d.ts +29 -0
- package/dist/src/migrate/migrate.d.ts.map +1 -0
- package/dist/src/migrate/migrate.spec.d.ts.map +1 -0
- package/dist/{mock → src/mock}/MockGLBufferController.d.ts +2 -1
- package/dist/src/mock/MockGLBufferController.d.ts.map +1 -0
- package/dist/src/mock/index.d.ts.map +1 -0
- package/dist/src/observe/index.d.ts.map +1 -0
- package/dist/src/observe/observe.d.ts +24 -0
- package/dist/src/observe/observe.d.ts.map +1 -0
- package/dist/src/observe/obsever.spec.d.ts +2 -0
- package/dist/src/observe/obsever.spec.d.ts.map +1 -0
- package/dist/src/optional.d.ts.map +1 -0
- package/dist/{primitive.d.ts → src/primitive.d.ts} +2 -1
- package/dist/src/primitive.d.ts.map +1 -0
- package/dist/{record.d.ts → src/record.d.ts} +7 -8
- package/dist/src/record.d.ts.map +1 -0
- package/dist/{renderable.d.ts → src/renderable.d.ts} +2 -1
- package/dist/src/renderable.d.ts.map +1 -0
- package/dist/src/runtime/detect.d.ts.map +1 -0
- package/dist/src/runtime/external.d.ts.map +1 -0
- package/dist/src/runtime/index.d.ts.map +1 -0
- package/dist/src/runtime/os.d.ts +20 -0
- package/dist/src/runtime/os.d.ts.map +1 -0
- package/dist/{search.d.ts → src/search.d.ts} +5 -2
- package/dist/src/search.d.ts.map +1 -0
- package/dist/src/shallowCopy.d.ts +2 -0
- package/dist/src/shallowCopy.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/base.d.ts +30 -5
- package/dist/src/spatial/base.d.ts.map +1 -0
- package/dist/src/spatial/bounds/bounds.d.ts +148 -0
- package/dist/src/spatial/bounds/bounds.d.ts.map +1 -0
- package/dist/src/spatial/bounds/bounds.spec.d.ts.map +1 -0
- package/dist/src/spatial/bounds/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/box/box.d.ts +73 -24
- package/dist/src/spatial/box/box.d.ts.map +1 -0
- package/dist/src/spatial/box/box.spec.d.ts.map +1 -0
- package/dist/src/spatial/box/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/dimensions/dimensions.d.ts +4 -3
- package/dist/src/spatial/dimensions/dimensions.d.ts.map +1 -0
- package/dist/src/spatial/dimensions/dimensions.spec.d.ts.map +1 -0
- package/dist/src/spatial/dimensions/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/direction/direction.d.ts +4 -3
- package/dist/src/spatial/direction/direction.d.ts.map +1 -0
- package/dist/src/spatial/direction/direction.spec.d.ts.map +1 -0
- package/dist/src/spatial/direction/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/external.d.ts +2 -2
- package/dist/src/spatial/external.d.ts.map +1 -0
- package/dist/src/spatial/index.d.ts.map +1 -0
- package/dist/src/spatial/location/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/location/location.d.ts +4 -3
- package/dist/src/spatial/location/location.d.ts.map +1 -0
- package/dist/src/spatial/location/location.spec.d.ts.map +1 -0
- package/dist/src/spatial/position/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/position/position.d.ts +4 -4
- package/dist/src/spatial/position/position.d.ts.map +1 -0
- package/dist/src/spatial/position/position.spec.d.ts.map +1 -0
- package/dist/src/spatial/scale/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/scale/scale.d.ts +15 -62
- package/dist/src/spatial/scale/scale.d.ts.map +1 -0
- package/dist/src/spatial/scale/scale.spec.d.ts.map +1 -0
- package/dist/src/spatial/spatial.d.ts +2 -0
- package/dist/src/spatial/spatial.d.ts.map +1 -0
- package/dist/src/spatial/xy/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/xy/xy.d.ts +16 -25
- package/dist/src/spatial/xy/xy.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/xy/xy.spec.d.ts.map +1 -1
- package/dist/src/telem/generate.d.ts +4 -0
- package/dist/src/telem/generate.d.ts.map +1 -0
- package/dist/src/telem/gl.d.ts.map +1 -0
- package/dist/{telem → src/telem}/index.d.ts +1 -1
- package/dist/src/telem/index.d.ts.map +1 -0
- package/dist/{telem → src/telem}/series.d.ts +10 -8
- package/dist/src/telem/series.d.ts.map +1 -0
- package/dist/{telem → src/telem}/series.spec.d.ts.map +1 -1
- package/dist/{telem → src/telem}/telem.d.ts +19 -21
- package/dist/src/telem/telem.d.ts.map +1 -0
- package/dist/{telem → src/telem}/telem.spec.d.ts.map +1 -1
- package/dist/src/toArray.d.ts.map +1 -0
- package/dist/src/transform.d.ts +6 -0
- package/dist/src/transform.d.ts.map +1 -0
- package/dist/src/unique.d.ts.map +1 -0
- package/dist/src/url/index.d.ts +2 -0
- package/dist/src/url/index.d.ts.map +1 -0
- package/dist/src/url/url.d.ts.map +1 -0
- package/dist/{url → src/url}/url.spec.d.ts.map +1 -1
- package/dist/src/worker/index.d.ts +2 -0
- package/dist/src/worker/index.d.ts.map +1 -0
- package/dist/{worker → src/worker}/worker.d.ts +4 -4
- package/dist/src/worker/worker.d.ts.map +1 -0
- package/dist/src/worker/worker.spec.d.ts.map +1 -0
- package/dist/src/zodutil/index.d.ts +2 -0
- package/dist/src/zodutil/index.d.ts.map +1 -0
- package/dist/src/zodutil/zodutil.d.ts +6 -0
- package/dist/src/zodutil/zodutil.d.ts.map +1 -0
- package/dist/src/zodutil/zodutil.spec.d.ts +2 -0
- package/dist/src/zodutil/zodutil.spec.d.ts.map +1 -0
- package/dist/telem.cjs +1 -0
- package/dist/telem.js +17 -0
- package/dist/toArray.cjs +1 -0
- package/dist/toArray.js +5 -0
- package/dist/unique.cjs +1 -0
- package/dist/unique.js +4 -0
- package/dist/url.cjs +1 -0
- package/dist/url.js +54 -0
- package/dist/worker.cjs +1 -0
- package/dist/worker.js +47 -0
- package/dist/xy-D1ZbIqpT.js +90 -0
- package/dist/xy-cP-FXJtR.cjs +1 -0
- package/dist/xy.cjs +1 -0
- package/dist/xy.js +4 -0
- package/dist/zodutil.cjs +1 -0
- package/dist/zodutil.js +21 -0
- package/eslint.config.js +12 -0
- package/package.json +157 -13
- package/src/binary/encoder.spec.ts +150 -7
- package/src/binary/encoder.ts +110 -9
- package/src/binary/index.ts +1 -1
- package/src/caseconv/caseconv.ts +31 -0
- package/src/caseconv/index.ts +10 -0
- package/src/change/change.ts +7 -6
- package/src/change/index.ts +1 -1
- package/src/{clamp.ts → clamp/clamp.ts} +1 -1
- package/src/clamp/index.ts +10 -0
- package/src/compare/compare.spec.ts +49 -0
- package/src/compare/compare.ts +37 -10
- package/src/compare/index.ts +1 -1
- package/src/control/control.ts +77 -0
- package/src/control/index.ts +1 -0
- package/src/debounce/debounce.spec.ts +52 -0
- package/src/{debounce.ts → debounce/debounce.ts} +4 -4
- package/src/debounce/index.ts +10 -0
- package/src/deep/copy.ts +2 -3
- package/src/deep/delete.spec.ts +2 -2
- package/src/deep/delete.ts +3 -2
- package/src/deep/difference.spec.ts +28 -27
- package/src/deep/difference.ts +13 -11
- package/src/deep/equal.spec.ts +4 -4
- package/src/deep/equal.ts +5 -5
- package/src/deep/external.ts +4 -5
- package/src/deep/index.ts +1 -1
- package/src/deep/merge.spec.ts +120 -4
- package/src/deep/merge.ts +50 -6
- package/src/deep/partial.ts +1 -1
- package/src/deep/path.spec.ts +91 -39
- package/src/deep/path.ts +111 -46
- package/src/destructor.ts +2 -2
- package/src/identity.ts +1 -1
- package/src/index.ts +23 -21
- package/src/invert.ts +9 -0
- package/src/join.ts +1 -1
- package/src/kv/index.ts +1 -1
- package/src/kv/types.ts +1 -1
- package/src/math/index.ts +10 -0
- package/src/math/math.ts +33 -0
- package/src/migrate/index.ts +9 -0
- package/src/migrate/migrate.spec.ts +65 -54
- package/src/migrate/migrate.ts +126 -17
- package/src/mock/MockGLBufferController.ts +6 -6
- package/src/mock/index.ts +1 -1
- package/src/observe/index.ts +1 -1
- package/src/observe/observe.ts +37 -6
- package/src/observe/obsever.spec.ts +56 -0
- package/src/optional.ts +3 -4
- package/src/primitive.ts +1 -1
- package/src/record.ts +10 -6
- package/src/renderable.ts +1 -1
- package/src/runtime/detect.ts +3 -3
- package/src/runtime/external.ts +1 -1
- package/src/runtime/index.ts +1 -1
- package/src/runtime/os.ts +17 -5
- package/src/search.ts +3 -1
- package/src/shallowCopy.ts +5 -6
- package/src/spatial/base.ts +13 -5
- package/src/spatial/bounds/bounds.spec.ts +259 -180
- package/src/spatial/bounds/bounds.ts +200 -85
- package/src/spatial/bounds/index.ts +2 -2
- package/src/spatial/box/box.spec.ts +211 -2
- package/src/spatial/box/box.ts +97 -49
- package/src/spatial/box/index.ts +2 -2
- package/src/spatial/dimensions/dimensions.spec.ts +1 -1
- package/src/spatial/dimensions/dimensions.ts +4 -4
- package/src/spatial/dimensions/index.ts +2 -2
- package/src/spatial/direction/direction.spec.ts +1 -1
- package/src/spatial/direction/direction.ts +7 -7
- package/src/spatial/direction/index.ts +2 -2
- package/src/spatial/external.ts +3 -3
- package/src/spatial/index.ts +1 -1
- package/src/spatial/location/index.ts +2 -2
- package/src/spatial/location/location.spec.ts +1 -1
- package/src/spatial/location/location.ts +21 -21
- package/src/spatial/position/index.ts +1 -1
- package/src/spatial/position/position.spec.ts +1 -1
- package/src/spatial/position/position.ts +3 -20
- package/src/spatial/scale/index.ts +2 -2
- package/src/spatial/scale/scale.spec.ts +3 -3
- package/src/spatial/scale/scale.ts +3 -3
- package/src/spatial/spatial.ts +5 -5
- package/src/spatial/xy/index.ts +2 -2
- package/src/spatial/xy/xy.spec.ts +93 -44
- package/src/spatial/xy/xy.ts +20 -27
- package/src/telem/generate.ts +1 -1
- package/src/telem/gl.ts +1 -1
- package/src/telem/index.ts +2 -2
- package/src/telem/series.spec.ts +64 -5
- package/src/telem/series.ts +47 -35
- package/src/telem/telem.spec.ts +130 -2
- package/src/telem/telem.ts +63 -23
- package/src/toArray.ts +2 -2
- package/src/transform.ts +9 -2
- package/src/unique.ts +1 -1
- package/src/url/index.ts +2 -2
- package/src/url/url.spec.ts +2 -2
- package/src/url/url.ts +4 -4
- package/src/worker/index.ts +10 -0
- package/src/worker/worker.spec.ts +2 -2
- package/src/worker/worker.ts +13 -13
- package/src/zodutil/index.ts +10 -0
- package/src/zodutil/zodutil.spec.ts +103 -0
- package/src/zodutil/zodutil.ts +44 -0
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vite.config.ts +39 -3
- package/.eslintrc.cjs +0 -18
- package/dist/binary/encoder.d.ts.map +0 -1
- package/dist/binary/encoder.spec.d.ts.map +0 -1
- package/dist/binary/index.d.ts.map +0 -1
- package/dist/case.d.ts +0 -6
- package/dist/case.d.ts.map +0 -1
- package/dist/change/change.d.ts.map +0 -1
- package/dist/change/index.d.ts.map +0 -1
- package/dist/clamp.d.ts.map +0 -1
- package/dist/compare/compare.d.ts.map +0 -1
- package/dist/compare/index.d.ts.map +0 -1
- package/dist/debounce.d.ts.map +0 -1
- package/dist/deep/copy.d.ts.map +0 -1
- package/dist/deep/delete.d.ts.map +0 -1
- package/dist/deep/difference.d.ts.map +0 -1
- package/dist/deep/difference.spec.d.ts.map +0 -1
- package/dist/deep/equal.d.ts.map +0 -1
- package/dist/deep/external.d.ts.map +0 -1
- package/dist/deep/index.d.ts.map +0 -1
- package/dist/deep/memo.d.ts +0 -2
- package/dist/deep/memo.d.ts.map +0 -1
- package/dist/deep/merge.d.ts +0 -3
- package/dist/deep/merge.d.ts.map +0 -1
- package/dist/deep/partial.d.ts.map +0 -1
- package/dist/deep/path.d.ts +0 -37
- package/dist/deep/path.d.ts.map +0 -1
- package/dist/destructor.d.ts.map +0 -1
- package/dist/identity.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/invert.d.ts.map +0 -1
- package/dist/join.d.ts.map +0 -1
- package/dist/kv/index.d.ts.map +0 -1
- package/dist/kv/types.d.ts.map +0 -1
- package/dist/migrate/index.d.ts.map +0 -1
- package/dist/migrate/migrate.d.ts +0 -16
- package/dist/migrate/migrate.d.ts.map +0 -1
- package/dist/migrate/migrate.spec.d.ts.map +0 -1
- package/dist/mock/MockGLBufferController.d.ts.map +0 -1
- package/dist/mock/index.d.ts.map +0 -1
- package/dist/observe/index.d.ts.map +0 -1
- package/dist/observe/observe.d.ts +0 -12
- package/dist/observe/observe.d.ts.map +0 -1
- package/dist/optional.d.ts.map +0 -1
- package/dist/primitive.d.ts.map +0 -1
- package/dist/record.d.ts.map +0 -1
- package/dist/renderable.d.ts.map +0 -1
- package/dist/runtime/detect.d.ts.map +0 -1
- package/dist/runtime/external.d.ts.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/os.d.ts +0 -10
- package/dist/runtime/os.d.ts.map +0 -1
- package/dist/search.d.ts.map +0 -1
- package/dist/shallowCopy.d.ts +0 -2
- package/dist/shallowCopy.d.ts.map +0 -1
- package/dist/spatial/base.d.ts.map +0 -1
- package/dist/spatial/bounds/bounds.d.ts +0 -71
- package/dist/spatial/bounds/bounds.d.ts.map +0 -1
- package/dist/spatial/bounds/bounds.spec.d.ts.map +0 -1
- package/dist/spatial/bounds/index.d.ts.map +0 -1
- package/dist/spatial/box/box.d.ts.map +0 -1
- package/dist/spatial/box/box.spec.d.ts.map +0 -1
- package/dist/spatial/box/index.d.ts.map +0 -1
- package/dist/spatial/dimensions/dimensions.d.ts.map +0 -1
- package/dist/spatial/dimensions/dimensions.spec.d.ts.map +0 -1
- package/dist/spatial/dimensions/index.d.ts.map +0 -1
- package/dist/spatial/direction/direction.d.ts.map +0 -1
- package/dist/spatial/direction/direction.spec.d.ts.map +0 -1
- package/dist/spatial/direction/index.d.ts.map +0 -1
- package/dist/spatial/external.d.ts.map +0 -1
- package/dist/spatial/index.d.ts.map +0 -1
- package/dist/spatial/location/index.d.ts.map +0 -1
- package/dist/spatial/location/location.d.ts.map +0 -1
- package/dist/spatial/location/location.spec.d.ts.map +0 -1
- package/dist/spatial/position/index.d.ts.map +0 -1
- package/dist/spatial/position/position.d.ts.map +0 -1
- package/dist/spatial/position/position.spec.d.ts.map +0 -1
- package/dist/spatial/scale/index.d.ts.map +0 -1
- package/dist/spatial/scale/scale.d.ts.map +0 -1
- package/dist/spatial/scale/scale.spec.d.ts.map +0 -1
- package/dist/spatial/spatial.d.ts +0 -2
- package/dist/spatial/spatial.d.ts.map +0 -1
- package/dist/spatial/xy/index.d.ts.map +0 -1
- package/dist/spatial/xy/xy.d.ts.map +0 -1
- package/dist/telem/generate.d.ts +0 -3
- package/dist/telem/generate.d.ts.map +0 -1
- package/dist/telem/gl.d.ts.map +0 -1
- package/dist/telem/index.d.ts.map +0 -1
- package/dist/telem/series.d.ts.map +0 -1
- package/dist/telem/telem.d.ts.map +0 -1
- package/dist/toArray.d.ts.map +0 -1
- package/dist/transform.d.ts +0 -2
- package/dist/transform.d.ts.map +0 -1
- package/dist/unique.d.ts.map +0 -1
- package/dist/url/index.d.ts +0 -2
- package/dist/url/index.d.ts.map +0 -1
- package/dist/url/url.d.ts.map +0 -1
- package/dist/worker/worker.d.ts.map +0 -1
- package/dist/worker/worker.spec.d.ts.map +0 -1
- package/dist/x.cjs +0 -12
- package/dist/x.cjs.map +0 -1
- package/dist/x.js +0 -5935
- package/dist/x.js.map +0 -1
- package/src/case.ts +0 -27
- package/src/deep/memo.ts +0 -24
- /package/dist/{binary → src/binary}/encoder.spec.d.ts +0 -0
- /package/dist/{binary → src/binary}/index.d.ts +0 -0
- /package/dist/{change → src/change}/index.d.ts +0 -0
- /package/dist/{clamp.d.ts → src/clamp/clamp.d.ts} +0 -0
- /package/dist/{compare → src/compare}/index.d.ts +0 -0
- /package/dist/{debounce.d.ts → src/debounce/debounce.d.ts} +0 -0
- /package/dist/{deep → src/deep}/copy.d.ts +0 -0
- /package/dist/{deep → src/deep}/delete.spec.d.ts +0 -0
- /package/dist/{deep → src/deep}/difference.d.ts +0 -0
- /package/dist/{deep → src/deep}/difference.spec.d.ts +0 -0
- /package/dist/{deep → src/deep}/equal.d.ts +0 -0
- /package/dist/{deep → src/deep}/equal.spec.d.ts +0 -0
- /package/dist/{deep → src/deep}/index.d.ts +0 -0
- /package/dist/{deep → src/deep}/merge.spec.d.ts +0 -0
- /package/dist/{deep → src/deep}/partial.d.ts +0 -0
- /package/dist/{deep → src/deep}/path.spec.d.ts +0 -0
- /package/dist/{destructor.d.ts → src/destructor.d.ts} +0 -0
- /package/dist/{invert.d.ts → src/invert.d.ts} +0 -0
- /package/dist/{join.d.ts → src/join.d.ts} +0 -0
- /package/dist/{kv → src/kv}/index.d.ts +0 -0
- /package/dist/{kv → src/kv}/types.d.ts +0 -0
- /package/dist/{migrate → src/migrate}/index.d.ts +0 -0
- /package/dist/{migrate → src/migrate}/migrate.spec.d.ts +0 -0
- /package/dist/{mock → src/mock}/index.d.ts +0 -0
- /package/dist/{observe → src/observe}/index.d.ts +0 -0
- /package/dist/{optional.d.ts → src/optional.d.ts} +0 -0
- /package/dist/{runtime → src/runtime}/detect.d.ts +0 -0
- /package/dist/{runtime → src/runtime}/external.d.ts +0 -0
- /package/dist/{runtime → src/runtime}/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/bounds/bounds.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/bounds/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/box/box.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/box/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/dimensions/dimensions.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/dimensions/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/direction/direction.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/direction/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/location/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/location/location.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/position/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/position/position.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/scale/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/scale/scale.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/xy/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/xy/xy.spec.d.ts +0 -0
- /package/dist/{telem → src/telem}/gl.d.ts +0 -0
- /package/dist/{telem → src/telem}/series.spec.d.ts +0 -0
- /package/dist/{telem → src/telem}/telem.spec.d.ts +0 -0
- /package/dist/{toArray.d.ts → src/toArray.d.ts} +0 -0
- /package/dist/{unique.d.ts → src/unique.d.ts} +0 -0
- /package/dist/{url → src/url}/url.d.ts +0 -0
- /package/dist/{url → src/url}/url.spec.d.ts +0 -0
- /package/dist/{worker → src/worker}/worker.spec.d.ts +0 -0
package/dist/x.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";var ss=Object.defineProperty;var is=(t,e,r)=>e in t?ss(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var u=(t,e,r)=>(is(t,typeof e!="symbol"?e+"":e,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let as="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",os=(t=21)=>{let e="",r=t;for(;r--;)e+=as[Math.random()*64|0];return e};const hr=t=>t!=null&&typeof t=="object"&&"toString"in t,cs=t=>{if(hr(t))return(t==null?void 0:t.toString().length)===0;switch(typeof t){case"string":return t.length===0;case"number":return t===0;case"bigint":return t===0n;case"boolean":return!t;case"undefined":return!0;case"object":return t===null}},Lt=(t,e=!1)=>{const r=hr(t)?"stringer":typeof t;let n;switch(r){case"string":n=(s,i)=>s.localeCompare(i);break;case"stringer":n=(s,i)=>s.toString().localeCompare(i.toString());break;case"number":n=(s,i)=>s-i;break;case"bigint":n=(s,i)=>s-i>BigInt(0)?1:-1;break;case"boolean":n=(s,i)=>Number(s)-Number(i);break;default:return console.warn("sortFunc: unknown type"),()=>-1}return e?zr(n):n},us=(t,e,r)=>{const n=Lt(e[t],r);return(s,i)=>n(s[t],i[t])},ls=(t,e)=>t.length!==e.length?t.length-e.length:t.every((r,n)=>r===e[n])?0:-1,ds=(t,e)=>{if(t.length!==e.length)return t.length-e.length;if(t.length===0)return 0;const r=Lt(t[0]),n=[...t].sort(r),s=[...e].sort(r);return n.every((i,a)=>i===s[a])?0:-1},fs=(t,e)=>t===e?0:t==="first"&&e==="last"?1:-1,zr=t=>(e,r)=>t(r,e),Bt=0,hs=-1,ps=1,ys=t=>t<Bt,qr=t=>t>Bt,ms=t=>t>=Bt,gs=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:Bt,GREATER_THAN:ps,LESS_THAN:hs,isGreaterThan:qr,isGreaterThanEqual:ms,isLessThan:ys,newF:Lt,newFieldF:us,order:fs,primitiveArrays:ls,reverseF:zr,unorderedPrimitiveArrays:ds},Symbol.toStringTag,{value:"Module"}));var I;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{const i={};for(const a of s)i[a]=a;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),a={};for(const o of i)a[o]=s[o];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&i.push(a);return i},t.find=(s,i)=>{for(const a of s)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(I||(I={}));var rr;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(rr||(rr={}));const y=I.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pe=t=>{switch(typeof t){case"undefined":return y.undefined;case"string":return y.string;case"number":return isNaN(t)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(t)?y.array:t===null?y.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?y.promise:typeof Map<"u"&&t instanceof Map?y.map:typeof Set<"u"&&t instanceof Set?y.set:typeof Date<"u"&&t instanceof Date?y.date:y.object;default:return y.unknown}},h=I.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),vs=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Y extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const r=e||function(i){return i.message},n={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let o=n,c=0;for(;c<a.path.length;){const f=a.path[c];c===a.path.length-1?(o[f]=o[f]||{_errors:[]},o[f]._errors.push(r(a))):o[f]=o[f]||{_errors:[]},o=o[f],c++}}};return s(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,I.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Y.create=t=>new Y(t);const qe=(t,e)=>{let r;switch(t.code){case h.invalid_type:t.received===y.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case h.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,I.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:r=`Unrecognized key(s) in object: ${I.joinValues(t.keys,", ")}`;break;case h.invalid_union:r="Invalid input";break;case h.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${I.joinValues(t.options)}`;break;case h.invalid_enum_value:r=`Invalid enum value. Expected ${I.joinValues(t.options)}, received '${t.received}'`;break;case h.invalid_arguments:r="Invalid function arguments";break;case h.invalid_return_type:r="Invalid function return type";break;case h.invalid_date:r="Invalid date";break;case h.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:I.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case h.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case h.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case h.custom:r="Invalid input";break;case h.invalid_intersection_types:r="Intersection results could not be merged";break;case h.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case h.not_finite:r="Number must be finite";break;default:r=e.defaultError,I.assertNever(t)}return{message:r}};let Wr=qe;function bs(t){Wr=t}function Tt(){return Wr}const St=t=>{const{data:e,path:r,errorMaps:n,issueData:s}=t,i=[...r,...s.path||[]],a={...s,path:i};let o="";const c=n.filter(f=>!!f).slice().reverse();for(const f of c)o=f(a,{data:e,defaultError:o}).message;return{...s,path:i,message:s.message||o}},ws=[];function m(t,e){const r=St({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Tt(),qe].filter(n=>!!n)});t.common.issues.push(r)}class B{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const s of r){if(s.status==="aborted")return O;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const s of r)n.push({key:await s.key,value:await s.value});return B.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const s of r){const{key:i,value:a}=s;if(i.status==="aborted"||a.status==="aborted")return O;i.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(n[i.value]=a.value)}return{status:e.value,value:n}}}const O=Object.freeze({status:"aborted"}),Yr=t=>({status:"dirty",value:t}),P=t=>({status:"valid",value:t}),nr=t=>t.status==="aborted",sr=t=>t.status==="dirty",We=t=>t.status==="valid",At=t=>typeof Promise<"u"&&t instanceof Promise;var v;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(v||(v={}));class X{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Pr=(t,e)=>{if(We(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Y(t.common.issues);return this._error=r,this._error}}};function _(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,o)=>a.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:n??o.defaultError}:{message:r??o.defaultError},description:s}}class T{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return pe(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:pe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new B,ctx:{common:e.parent.common,data:e.data,parsedType:pe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(At(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;const s={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pe(e)},i=this._parseSync({data:e,path:s.path,parent:s});return Pr(s,i)}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pe(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await(At(s)?s:Promise.resolve(s));return Pr(n,i)}refine(e,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{const a=e(s),o=()=>i.addIssue({code:h.custom,...n(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new G({schema:this,typeName:w.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ue.create(this,this._def)}nullable(){return Ee.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return K.create(this,this._def)}promise(){return Pe.create(this,this._def)}or(e){return Fe.create([this,e],this._def)}and(e){return Je.create(this,e,this._def)}transform(e){return new G({..._(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new tt({..._(this._def),innerType:this,defaultValue:r,typeName:w.ZodDefault})}brand(){return new Gr({typeName:w.ZodBranded,type:this,..._(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Et({..._(this._def),innerType:this,catchValue:r,typeName:w.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ut.create(this,e)}readonly(){return Mt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const xs=/^c[^\s-]{8,}$/i,Os=/^[a-z][a-z0-9]*$/,_s=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ts=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ss=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,As="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let er;const Is=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,ks=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ns=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Es(t,e){return!!((e==="v4"||!e)&&Is.test(t)||(e==="v6"||!e)&&ks.test(t))}class W extends T{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==y.string){const i=this._getOrReturnCtx(e);return m(i,{code:h.invalid_type,expected:y.string,received:i.parsedType}),O}const n=new B;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),m(s,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),m(s,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const a=e.data.length>i.value,o=e.data.length<i.value;(a||o)&&(s=this._getOrReturnCtx(e,s),a?m(s,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&m(s,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")Ss.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"email",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")er||(er=new RegExp(As,"u")),er.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"emoji",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Ts.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"uuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")xs.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"cuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Os.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"cuid2",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")_s.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"ulid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),m(s,{validation:"url",code:h.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"regex",code:h.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),m(s,{code:h.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),m(s,{code:h.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),m(s,{code:h.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Ns(i).test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{code:h.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="ip"?Es(e.data,i.version)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"ip",code:h.invalid_string,message:i.message}),n.dirty()):I.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:h.invalid_string,...v.errToObj(n)})}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...v.errToObj(e)})}url(e){return this._addCheck({kind:"url",...v.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...v.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...v.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...v.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...v.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...v.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...v.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...v.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...v.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...v.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...v.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...v.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...v.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...v.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...v.errToObj(r)})}nonempty(e){return this.min(1,v.errToObj(e))}trim(){return new W({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new W({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new W({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}W.create=t=>{var e;return new W({checks:[],typeName:w.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,..._(t)})};function Cs(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,i=parseInt(t.toFixed(s).replace(".","")),a=parseInt(e.toFixed(s).replace(".",""));return i%a/Math.pow(10,s)}class be extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==y.number){const i=this._getOrReturnCtx(e);return m(i,{code:h.invalid_type,expected:y.number,received:i.parsedType}),O}let n;const s=new B;for(const i of this._def.checks)i.kind==="int"?I.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:h.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?Cs(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:h.not_finite,message:i.message}),s.dirty()):I.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,v.toString(r))}gt(e,r){return this.setLimit("min",e,!1,v.toString(r))}lte(e,r){return this.setLimit("max",e,!0,v.toString(r))}lt(e,r){return this.setLimit("max",e,!1,v.toString(r))}setLimit(e,r,n,s){return new be({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:v.toString(s)}]})}_addCheck(e){return new be({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:v.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:v.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&I.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}be.create=t=>new be({checks:[],typeName:w.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,..._(t)});class we extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==y.bigint){const i=this._getOrReturnCtx(e);return m(i,{code:h.invalid_type,expected:y.bigint,received:i.parsedType}),O}let n;const s=new B;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):I.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,v.toString(r))}gt(e,r){return this.setLimit("min",e,!1,v.toString(r))}lte(e,r){return this.setLimit("max",e,!0,v.toString(r))}lt(e,r){return this.setLimit("max",e,!1,v.toString(r))}setLimit(e,r,n,s){return new we({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:v.toString(s)}]})}_addCheck(e){return new we({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}we.create=t=>{var e;return new we({checks:[],typeName:w.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,..._(t)})};class Ye extends T{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==y.boolean){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:y.boolean,received:n.parsedType}),O}return P(e.data)}}Ye.create=t=>new Ye({typeName:w.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,..._(t)});class ke extends T{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==y.date){const i=this._getOrReturnCtx(e);return m(i,{code:h.invalid_type,expected:y.date,received:i.parsedType}),O}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return m(i,{code:h.invalid_date}),O}const n=new B;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),m(s,{code:h.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),m(s,{code:h.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):I.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ke({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:v.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:v.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}ke.create=t=>new ke({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:w.ZodDate,..._(t)});class It extends T{_parse(e){if(this._getType(e)!==y.symbol){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:y.symbol,received:n.parsedType}),O}return P(e.data)}}It.create=t=>new It({typeName:w.ZodSymbol,..._(t)});class Ke extends T{_parse(e){if(this._getType(e)!==y.undefined){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:y.undefined,received:n.parsedType}),O}return P(e.data)}}Ke.create=t=>new Ke({typeName:w.ZodUndefined,..._(t)});class Ge extends T{_parse(e){if(this._getType(e)!==y.null){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:y.null,received:n.parsedType}),O}return P(e.data)}}Ge.create=t=>new Ge({typeName:w.ZodNull,..._(t)});class Be extends T{constructor(){super(...arguments),this._any=!0}_parse(e){return P(e.data)}}Be.create=t=>new Be({typeName:w.ZodAny,..._(t)});class Ae extends T{constructor(){super(...arguments),this._unknown=!0}_parse(e){return P(e.data)}}Ae.create=t=>new Ae({typeName:w.ZodUnknown,..._(t)});class le extends T{_parse(e){const r=this._getOrReturnCtx(e);return m(r,{code:h.invalid_type,expected:y.never,received:r.parsedType}),O}}le.create=t=>new le({typeName:w.ZodNever,..._(t)});class kt extends T{_parse(e){if(this._getType(e)!==y.undefined){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:y.void,received:n.parsedType}),O}return P(e.data)}}kt.create=t=>new kt({typeName:w.ZodVoid,..._(t)});class K extends T{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==y.array)return m(r,{code:h.invalid_type,expected:y.array,received:r.parsedType}),O;if(s.exactLength!==null){const a=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(a||o)&&(m(r,{code:a?h.too_big:h.too_small,minimum:o?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(m(r,{code:h.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(m(r,{code:h.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>s.type._parseAsync(new X(r,a,r.path,o)))).then(a=>B.mergeArray(n,a));const i=[...r.data].map((a,o)=>s.type._parseSync(new X(r,a,r.path,o)));return B.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new K({...this._def,minLength:{value:e,message:v.toString(r)}})}max(e,r){return new K({...this._def,maxLength:{value:e,message:v.toString(r)}})}length(e,r){return new K({...this._def,exactLength:{value:e,message:v.toString(r)}})}nonempty(e){return this.min(1,e)}}K.create=(t,e)=>new K({type:t,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,..._(e)});function Ze(t){if(t instanceof j){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=ue.create(Ze(n))}return new j({...t._def,shape:()=>e})}else return t instanceof K?new K({...t._def,type:Ze(t.element)}):t instanceof ue?ue.create(Ze(t.unwrap())):t instanceof Ee?Ee.create(Ze(t.unwrap())):t instanceof Q?Q.create(t.items.map(e=>Ze(e))):t}class j extends T{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=I.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==y.object){const f=this._getOrReturnCtx(e);return m(f,{code:h.invalid_type,expected:y.object,received:f.parsedType}),O}const{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof le&&this._def.unknownKeys==="strip"))for(const f in s.data)a.includes(f)||o.push(f);const c=[];for(const f of a){const b=i[f],x=s.data[f];c.push({key:{status:"valid",value:f},value:b._parse(new X(s,x,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof le){const f=this._def.unknownKeys;if(f==="passthrough")for(const b of o)c.push({key:{status:"valid",value:b},value:{status:"valid",value:s.data[b]}});else if(f==="strict")o.length>0&&(m(s,{code:h.unrecognized_keys,keys:o}),n.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const b of o){const x=s.data[b];c.push({key:{status:"valid",value:b},value:f._parse(new X(s,x,s.path,b)),alwaysSet:b in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const b of c){const x=await b.key;f.push({key:x,value:await b.value,alwaysSet:b.alwaysSet})}return f}).then(f=>B.mergeObjectSync(n,f)):B.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return v.errToObj,new j({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var s,i,a,o;const c=(a=(i=(s=this._def).errorMap)===null||i===void 0?void 0:i.call(s,r,n).message)!==null&&a!==void 0?a:n.defaultError;return r.code==="unrecognized_keys"?{message:(o=v.errToObj(e).message)!==null&&o!==void 0?o:c}:{message:c}}}:{}})}strip(){return new j({...this._def,unknownKeys:"strip"})}passthrough(){return new j({...this._def,unknownKeys:"passthrough"})}extend(e){return new j({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new j({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new j({...this._def,catchall:e})}pick(e){const r={};return I.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new j({...this._def,shape:()=>r})}omit(e){const r={};return I.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new j({...this._def,shape:()=>r})}deepPartial(){return Ze(this)}partial(e){const r={};return I.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}),new j({...this._def,shape:()=>r})}required(e){const r={};return I.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ue;)i=i._def.innerType;r[n]=i}}),new j({...this._def,shape:()=>r})}keyof(){return Kr(I.objectKeys(this.shape))}}j.create=(t,e)=>new j({shape:()=>t,unknownKeys:"strip",catchall:le.create(),typeName:w.ZodObject,..._(e)});j.strictCreate=(t,e)=>new j({shape:()=>t,unknownKeys:"strict",catchall:le.create(),typeName:w.ZodObject,..._(e)});j.lazycreate=(t,e)=>new j({shape:t,unknownKeys:"strip",catchall:le.create(),typeName:w.ZodObject,..._(e)});class Fe extends T{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function s(i){for(const o of i)if(o.result.status==="valid")return o.result;for(const o of i)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(o=>new Y(o.ctx.common.issues));return m(r,{code:h.invalid_union,unionErrors:a}),O}if(r.common.async)return Promise.all(n.map(async i=>{const a={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(s);{let i;const a=[];for(const c of n){const f={...r,common:{...r.common,issues:[]},parent:null},b=c._parseSync({data:r.data,path:r.path,parent:f});if(b.status==="valid")return b;b.status==="dirty"&&!i&&(i={result:b,ctx:f}),f.common.issues.length&&a.push(f.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const o=a.map(c=>new Y(c));return m(r,{code:h.invalid_union,unionErrors:o}),O}}get options(){return this._def.options}}Fe.create=(t,e)=>new Fe({options:t,typeName:w.ZodUnion,..._(e)});const ft=t=>t instanceof Xe?ft(t.schema):t instanceof G?ft(t.innerType()):t instanceof Qe?[t.value]:t instanceof xe?t.options:t instanceof et?Object.keys(t.enum):t instanceof tt?ft(t._def.innerType):t instanceof Ke?[void 0]:t instanceof Ge?[null]:null;class Pt extends T{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==y.object)return m(r,{code:h.invalid_type,expected:y.object,received:r.parsedType}),O;const n=this.discriminator,s=r.data[n],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(m(r,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),O)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const s=new Map;for(const i of r){const a=ft(i.shape[e]);if(!a)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of a){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,i)}}return new Pt({typeName:w.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,..._(n)})}}function ir(t,e){const r=pe(t),n=pe(e);if(t===e)return{valid:!0,data:t};if(r===y.object&&n===y.object){const s=I.objectKeys(e),i=I.objectKeys(t).filter(o=>s.indexOf(o)!==-1),a={...t,...e};for(const o of i){const c=ir(t[o],e[o]);if(!c.valid)return{valid:!1};a[o]=c.data}return{valid:!0,data:a}}else if(r===y.array&&n===y.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const a=t[i],o=e[i],c=ir(a,o);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===y.date&&n===y.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Je extends T{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=(i,a)=>{if(nr(i)||nr(a))return O;const o=ir(i.value,a.value);return o.valid?((sr(i)||sr(a))&&r.dirty(),{status:r.value,value:o.data}):(m(n,{code:h.invalid_intersection_types}),O)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,a])=>s(i,a)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Je.create=(t,e,r)=>new Je({left:t,right:e,typeName:w.ZodIntersection,..._(r)});class Q extends T{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.array)return m(n,{code:h.invalid_type,expected:y.array,received:n.parsedType}),O;if(n.data.length<this._def.items.length)return m(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),O;!this._def.rest&&n.data.length>this._def.items.length&&(m(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((a,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new X(n,a,n.path,o)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>B.mergeArray(r,a)):B.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Q({...this._def,rest:e})}}Q.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Q({items:t,typeName:w.ZodTuple,rest:null,..._(e)})};class He extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.object)return m(n,{code:h.invalid_type,expected:y.object,received:n.parsedType}),O;const s=[],i=this._def.keyType,a=this._def.valueType;for(const o in n.data)s.push({key:i._parse(new X(n,o,n.path,o)),value:a._parse(new X(n,n.data[o],n.path,o))});return n.common.async?B.mergeObjectAsync(r,s):B.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof T?new He({keyType:e,valueType:r,typeName:w.ZodRecord,..._(n)}):new He({keyType:W.create(),valueType:e,typeName:w.ZodRecord,..._(r)})}}class Nt extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.map)return m(n,{code:h.invalid_type,expected:y.map,received:n.parsedType}),O;const s=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([o,c],f)=>({key:s._parse(new X(n,o,n.path,[f,"key"])),value:i._parse(new X(n,c,n.path,[f,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of a){const f=await c.key,b=await c.value;if(f.status==="aborted"||b.status==="aborted")return O;(f.status==="dirty"||b.status==="dirty")&&r.dirty(),o.set(f.value,b.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const c of a){const f=c.key,b=c.value;if(f.status==="aborted"||b.status==="aborted")return O;(f.status==="dirty"||b.status==="dirty")&&r.dirty(),o.set(f.value,b.value)}return{status:r.value,value:o}}}}Nt.create=(t,e,r)=>new Nt({valueType:e,keyType:t,typeName:w.ZodMap,..._(r)});class Ne extends T{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.set)return m(n,{code:h.invalid_type,expected:y.set,received:n.parsedType}),O;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(m(n,{code:h.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(m(n,{code:h.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const i=this._def.valueType;function a(c){const f=new Set;for(const b of c){if(b.status==="aborted")return O;b.status==="dirty"&&r.dirty(),f.add(b.value)}return{status:r.value,value:f}}const o=[...n.data.values()].map((c,f)=>i._parse(new X(n,c,n.path,f)));return n.common.async?Promise.all(o).then(c=>a(c)):a(o)}min(e,r){return new Ne({...this._def,minSize:{value:e,message:v.toString(r)}})}max(e,r){return new Ne({...this._def,maxSize:{value:e,message:v.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Ne.create=(t,e)=>new Ne({valueType:t,minSize:null,maxSize:null,typeName:w.ZodSet,..._(e)});class Le extends T{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==y.function)return m(r,{code:h.invalid_type,expected:y.function,received:r.parsedType}),O;function n(o,c){return St({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Tt(),qe].filter(f=>!!f),issueData:{code:h.invalid_arguments,argumentsError:c}})}function s(o,c){return St({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Tt(),qe].filter(f=>!!f),issueData:{code:h.invalid_return_type,returnTypeError:c}})}const i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Pe){const o=this;return P(async function(...c){const f=new Y([]),b=await o._def.args.parseAsync(c,i).catch(D=>{throw f.addIssue(n(c,D)),f}),x=await Reflect.apply(a,this,b);return await o._def.returns._def.type.parseAsync(x,i).catch(D=>{throw f.addIssue(s(x,D)),f})})}else{const o=this;return P(function(...c){const f=o._def.args.safeParse(c,i);if(!f.success)throw new Y([n(c,f.error)]);const b=Reflect.apply(a,this,f.data),x=o._def.returns.safeParse(b,i);if(!x.success)throw new Y([s(b,x.error)]);return x.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Le({...this._def,args:Q.create(e).rest(Ae.create())})}returns(e){return new Le({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Le({args:e||Q.create([]).rest(Ae.create()),returns:r||Ae.create(),typeName:w.ZodFunction,..._(n)})}}class Xe extends T{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Xe.create=(t,e)=>new Xe({getter:t,typeName:w.ZodLazy,..._(e)});class Qe extends T{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return m(r,{received:r.data,code:h.invalid_literal,expected:this._def.value}),O}return{status:"valid",value:e.data}}get value(){return this._def.value}}Qe.create=(t,e)=>new Qe({value:t,typeName:w.ZodLiteral,..._(e)});function Kr(t,e){return new xe({values:t,typeName:w.ZodEnum,..._(e)})}class xe extends T{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return m(r,{expected:I.joinValues(n),received:r.parsedType,code:h.invalid_type}),O}if(this._def.values.indexOf(e.data)===-1){const r=this._getOrReturnCtx(e),n=this._def.values;return m(r,{received:r.data,code:h.invalid_enum_value,options:n}),O}return P(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e){return xe.create(e)}exclude(e){return xe.create(this.options.filter(r=>!e.includes(r)))}}xe.create=Kr;class et extends T{_parse(e){const r=I.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==y.string&&n.parsedType!==y.number){const s=I.objectValues(r);return m(n,{expected:I.joinValues(s),received:n.parsedType,code:h.invalid_type}),O}if(r.indexOf(e.data)===-1){const s=I.objectValues(r);return m(n,{received:n.data,code:h.invalid_enum_value,options:s}),O}return P(e.data)}get enum(){return this._def.values}}et.create=(t,e)=>new et({values:t,typeName:w.ZodNativeEnum,..._(e)});class Pe extends T{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==y.promise&&r.common.async===!1)return m(r,{code:h.invalid_type,expected:y.promise,received:r.parsedType}),O;const n=r.parsedType===y.promise?r.data:Promise.resolve(r.data);return P(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Pe.create=(t,e)=>new Pe({type:t,typeName:w.ZodPromise,..._(e)});class G extends T{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:a=>{m(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const a=s.transform(n.data,i);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(a).then(o=>this._def.schema._parseAsync({data:o,path:n.path,parent:n})):this._def.schema._parseSync({data:a,path:n.path,parent:n})}if(s.type==="refinement"){const a=o=>{const c=s.refinement(o,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?O:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?O:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!We(a))return a;const o=s.transform(a.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>We(a)?Promise.resolve(s.transform(a.value,i)).then(o=>({status:r.value,value:o})):a);I.assertNever(s)}}G.create=(t,e,r)=>new G({schema:t,typeName:w.ZodEffects,effect:e,..._(r)});G.createWithPreprocess=(t,e,r)=>new G({schema:e,effect:{type:"preprocess",transform:t},typeName:w.ZodEffects,..._(r)});class ue extends T{_parse(e){return this._getType(e)===y.undefined?P(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ue.create=(t,e)=>new ue({innerType:t,typeName:w.ZodOptional,..._(e)});class Ee extends T{_parse(e){return this._getType(e)===y.null?P(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ee.create=(t,e)=>new Ee({innerType:t,typeName:w.ZodNullable,..._(e)});class tt extends T{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===y.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}tt.create=(t,e)=>new tt({innerType:t,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class Et extends T{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return At(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Y(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Y(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Et.create=(t,e)=>new Et({innerType:t,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class Ct extends T{_parse(e){if(this._getType(e)!==y.nan){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:y.nan,received:n.parsedType}),O}return{status:"valid",value:e.data}}}Ct.create=t=>new Ct({typeName:w.ZodNaN,..._(t)});const Ms=Symbol("zod_brand");class Gr extends T{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class ut extends T{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?O:i.status==="dirty"?(r.dirty(),Yr(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?O:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new ut({in:e,out:r,typeName:w.ZodPipeline})}}class Mt extends T{_parse(e){const r=this._def.innerType._parse(e);return We(r)&&(r.value=Object.freeze(r.value)),r}}Mt.create=(t,e)=>new Mt({innerType:t,typeName:w.ZodReadonly,..._(e)});const Fr=(t,e={},r)=>t?Be.create().superRefine((n,s)=>{var i,a;if(!t(n)){const o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(a=(i=o.fatal)!==null&&i!==void 0?i:r)!==null&&a!==void 0?a:!0,f=typeof o=="string"?{message:o}:o;s.addIssue({code:"custom",...f,fatal:c})}}):Be.create(),js={object:j.lazycreate};var w;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(w||(w={}));const Rs=(t,e={message:`Input not instance of ${t.name}`})=>Fr(r=>r instanceof t,e),Jr=W.create,Hr=be.create,Zs=Ct.create,$s=we.create,Xr=Ye.create,Ls=ke.create,Bs=It.create,Ps=Ke.create,Us=Ge.create,Ds=Be.create,Vs=Ae.create,zs=le.create,qs=kt.create,Ws=K.create,Ys=j.create,Ks=j.strictCreate,Gs=Fe.create,Fs=Pt.create,Js=Je.create,Hs=Q.create,Xs=He.create,Qs=Nt.create,ei=Ne.create,ti=Le.create,ri=Xe.create,ni=Qe.create,si=xe.create,ii=et.create,ai=Pe.create,Ur=G.create,oi=ue.create,ci=Ee.create,ui=G.createWithPreprocess,li=ut.create,di=()=>Jr().optional(),fi=()=>Hr().optional(),hi=()=>Xr().optional(),pi={string:t=>W.create({...t,coerce:!0}),number:t=>be.create({...t,coerce:!0}),boolean:t=>Ye.create({...t,coerce:!0}),bigint:t=>we.create({...t,coerce:!0}),date:t=>ke.create({...t,coerce:!0})},yi=O;var d=Object.freeze({__proto__:null,defaultErrorMap:qe,setErrorMap:bs,getErrorMap:Tt,makeIssue:St,EMPTY_PATH:ws,addIssueToContext:m,ParseStatus:B,INVALID:O,DIRTY:Yr,OK:P,isAborted:nr,isDirty:sr,isValid:We,isAsync:At,get util(){return I},get objectUtil(){return rr},ZodParsedType:y,getParsedType:pe,ZodType:T,ZodString:W,ZodNumber:be,ZodBigInt:we,ZodBoolean:Ye,ZodDate:ke,ZodSymbol:It,ZodUndefined:Ke,ZodNull:Ge,ZodAny:Be,ZodUnknown:Ae,ZodNever:le,ZodVoid:kt,ZodArray:K,ZodObject:j,ZodUnion:Fe,ZodDiscriminatedUnion:Pt,ZodIntersection:Je,ZodTuple:Q,ZodRecord:He,ZodMap:Nt,ZodSet:Ne,ZodFunction:Le,ZodLazy:Xe,ZodLiteral:Qe,ZodEnum:xe,ZodNativeEnum:et,ZodPromise:Pe,ZodEffects:G,ZodTransformer:G,ZodOptional:ue,ZodNullable:Ee,ZodDefault:tt,ZodCatch:Et,ZodNaN:Ct,BRAND:Ms,ZodBranded:Gr,ZodPipeline:ut,ZodReadonly:Mt,custom:Fr,Schema:T,ZodSchema:T,late:js,get ZodFirstPartyTypeKind(){return w},coerce:pi,any:Ds,array:Ws,bigint:$s,boolean:Xr,date:Ls,discriminatedUnion:Fs,effect:Ur,enum:si,function:ti,instanceof:Rs,intersection:Js,lazy:ri,literal:ni,map:Qs,nan:Zs,nativeEnum:ii,never:zs,null:Us,nullable:ci,number:Hr,object:Ys,oboolean:hi,onumber:fi,optional:oi,ostring:di,pipeline:li,preprocess:ui,promise:ai,record:Xs,set:ei,strictObject:Ks,string:Jr,symbol:Bs,transformer:Ur,tuple:Hs,undefined:Ps,union:Gs,unknown:Vs,void:qs,NEVER:yi,ZodIssueCode:h,quotelessJson:vs,ZodError:Y});const pr=d.tuple([d.number(),d.number()]),yr=d.object({width:d.number(),height:d.number()}),mi=d.object({signedWidth:d.number(),signedHeight:d.number()}),gi=["width","height"];d.enum(gi);const Qr=["start","center","end"],vi=["signedWidth","signedHeight"];d.enum(vi);const rt=d.object({x:d.number(),y:d.number()}),en=d.object({clientX:d.number(),clientY:d.number()}),mr=["x","y"],tn=d.enum(mr),rn=["top","right","bottom","left"],bi=d.enum(rn),Ut=["left","right"],gr=d.enum(Ut),vr=["top","bottom"],br=d.enum(vr),wr=["center"],Dr=d.enum(wr),wi=[...rn,...wr],Dt=d.enum(wi),xi=d.enum(Qr),nn=["first","last"],Oi=d.enum(nn),sn=d.object({lower:d.number(),upper:d.number()});d.union([sn,pr]);const _i=d.union([tn,Dt]),Ti=d.union([tn,Dt,d.instanceof(String)]),E=(t,e)=>{const r={lower:0,upper:0};return typeof t=="number"?e!=null?(r.lower=t,r.upper=e):(r.lower=0,r.upper=t):Array.isArray(t)?[r.lower,r.upper]=t:(r.lower=t.lower,r.upper=t.upper),an(r)},Si={lower:0,upper:0},Ai={lower:-1/0,upper:1/0},Ii={lower:0,upper:1},ki={lower:-1,upper:1},Ni=(t,e)=>{if(t==null&&e==null)return!0;if(t==null||e==null)return!1;const r=E(t),n=E(e);return(r==null?void 0:r.lower)===(n==null?void 0:n.lower)&&(r==null?void 0:r.upper)===(n==null?void 0:n.upper)},an=t=>t.lower>t.upper?{lower:t.upper,upper:t.lower}:t,Ei=(t,e)=>{const r=E(t);return e<r.lower?r.lower:e>=r.upper?r.upper-1:e},Se=(t,e)=>{const r=E(t);if(typeof e=="number")return e>=r.lower&&e<r.upper;const n=E(e);return n.lower>=r.lower&&n.upper<=r.upper},Ci=(t,e)=>{const r=E(t),n=E(e);return r.lower==n.lower?!0:n.upper==r.lower||n.lower==r.upper?!1:Se(r,n.upper)||Se(r,n.lower)||Se(n,r.upper)||Se(n,r.lower)},Vt=t=>{const e=E(t);return e.upper-e.lower},Mi=t=>{const e=E(t);return e.lower===0&&e.upper===0},ji=t=>Vt(t)===0,Ri=t=>{const e=E(t);return Number.isFinite(e.lower)&&Number.isFinite(e.upper)},Zi=t=>({lower:Math.min(...t.map(e=>E(e).lower)),upper:Math.max(...t.map(e=>E(e).upper))}),$i=t=>({lower:Math.max(...t.map(e=>E(e).lower)),upper:Math.min(...t.map(e=>E(e).upper))}),Li=t=>{const e=E(t);return Array.from({length:Vt(t)},(r,n)=>n+e.lower)},ar=(t,e)=>{const r=t.map(E),n=r.findIndex((i,a)=>Se(i,e)||e<r[a].lower);if(n===-1)return{index:t.length,position:0};const s=r[n];return Se(s,e)?{index:n,position:e-s.lower}:{index:n,position:0}},tr={removeBefore:0,removeAfter:0,insertInto:0,deleteInBetween:0},on=(t,e)=>{const r=t.map(E),n=E(e);if(r.length===0)return tr;const s=ar(t,n.lower),i=ar(t,n.upper);if(s.index==t.length)return{...tr,insertInto:t.length};if(i.index==0)return{...tr,removeAfter:i.position};if(s.index===i.index)return s.position!==0&&i.position!==0?null:{removeAfter:i.position,removeBefore:s.position,insertInto:s.index,deleteInBetween:0};let a=i.index-s.index,o=s.index,c=Vt(r[s.index])-s.position;return s.position!=0?(a-=1,o+=1):c=0,{removeBefore:c,removeAfter:i.position,insertInto:o,deleteInBetween:a}},Bi=(t,e)=>{const r=on(t,e);if(r==null)return t;const n=E(e);return n.lower+=r.removeBefore,n.upper-=r.removeAfter,t.splice(r.insertInto,r.deleteInBetween,n),t.map(E)},Pi=Object.freeze(Object.defineProperty({__proto__:null,CLIP:ki,DECIMAL:Ii,INFINITE:Ai,ZERO:Si,bounds:sn,buildInsertionPlan:on,clamp:Ei,construct:E,constructArray:Li,contains:Se,equals:Ni,findInsertPosition:ar,insert:Bi,isFinite:Ri,isZero:Mi,makeValid:an,max:Zi,min:$i,overlapsWith:Ci,span:Vt,spanIsZero:ji},Symbol.toStringTag,{value:"Module"})),cn=_i,fe=t=>mr.includes(t)?t:vr.includes(t)?"y":"x",Ui=t=>fe(t)==="x"?"y":"x",Di=t=>fe(t)==="x"?"width":"height",Vi=t=>fe(t)==="x"?"left":"top",zi=t=>cn.safeParse(t).success,qi=t=>fe(t)==="x"?"signedWidth":"signedHeight",Wi=Object.freeze(Object.defineProperty({__proto__:null,construct:fe,crude:cn,dimension:Di,isDirection:zi,location:Vi,signedDimension:qi,swap:Ui},Symbol.toStringTag,{value:"Module"}));var z=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},S={},zt={};Object.defineProperty(zt,"__esModule",{value:!0});function Yi(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/[^A-Za-z0-9]+/g,"$").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"$"+n}).toLowerCase().replace(/(\$)(\w)/g,function(e,r,n){return n.toUpperCase()}):""}zt.default=Yi;var qt={};Object.defineProperty(qt,"__esModule",{value:!0});function Ki(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"_").toLowerCase():""}qt.default=Ki;var Wt={};Object.defineProperty(Wt,"__esModule",{value:!0});function Gi(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"$").replace(/[^A-Za-z0-9]+/g,"$").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"$"+n}).toLowerCase().replace(/(\$)(\w?)/g,function(e,r,n){return n.toUpperCase()}):""}Wt.default=Gi;var xr={};Object.defineProperty(xr,"__esModule",{value:!0});function Fi(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,".").toLowerCase():""}xr.default=Fi;var Or={};Object.defineProperty(Or,"__esModule",{value:!0});function Ji(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"/").toLowerCase():""}Or.default=Ji;var _r={};Object.defineProperty(_r,"__esModule",{value:!0});function Hi(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase():""}_r.default=Hi;var Tr={};Object.defineProperty(Tr,"__esModule",{value:!0});function Xi(t){if(t===void 0&&(t=""),!t)return"";var e=String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(r,n,s){return n+"_"+s.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase();return e.charAt(0).toUpperCase()+e.slice(1)}Tr.default=Xi;var Sr={};Object.defineProperty(Sr,"__esModule",{value:!0});function Qi(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase().replace(/( ?)(\w+)( ?)/g,function(e,r,n,s){return r+n.charAt(0).toUpperCase()+n.slice(1)+s}):""}Sr.default=Qi;var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});function ea(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"-").toLowerCase():""}Yt.default=ea;var Ar={},Me={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.belongToTypes=t.isValidObject=t.isArrayObject=t.validateOptions=t.DefaultOption=void 0,t.DefaultOption={recursive:!1,recursiveInArray:!1,keepTypesOnRecursion:[]},t.validateOptions=function(e){return e===void 0&&(e=t.DefaultOption),e.recursive==null?e=t.DefaultOption:e.recursiveInArray==null&&(e.recursiveInArray=!1),e},t.isArrayObject=function(e){return e!=null&&Array.isArray(e)},t.isValidObject=function(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)},t.belongToTypes=function(e,r){return(r||[]).some(function(n){return e instanceof n})}})(Me);var ta=z&&z.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var i=arguments[e],a=0,o=i.length;a<o;a++,s++)n[s]=i[a];return n};Object.defineProperty(Ar,"__esModule",{value:!0});var re=Me;function ht(t,e){if(e===void 0&&(e=re.DefaultOption),!re.isValidObject(t))return null;e=re.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var s=t[n],i=n.toLowerCase();e.recursive&&(re.isValidObject(s)?re.belongToTypes(s,e.keepTypesOnRecursion)||(s=ht(s,e)):e.recursiveInArray&&re.isArrayObject(s)&&(s=ta(s).map(function(a){var o=a;if(re.isValidObject(a))re.belongToTypes(o,e.keepTypesOnRecursion)||(o=ht(a,e));else if(re.isArrayObject(a)){var c=ht({key:a},e);o=c.key}return o}))),r[i]=s}),r}Ar.default=ht;var Ir={},ra=z&&z.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var i=arguments[e],a=0,o=i.length;a<o;a++,s++)n[s]=i[a];return n};Object.defineProperty(Ir,"__esModule",{value:!0});var ne=Me;function pt(t,e){if(e===void 0&&(e=ne.DefaultOption),!ne.isValidObject(t))return null;e=ne.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var s=t[n],i=n.toUpperCase();e.recursive&&(ne.isValidObject(s)?ne.belongToTypes(s,e.keepTypesOnRecursion)||(s=pt(s,e)):e.recursiveInArray&&ne.isArrayObject(s)&&(s=ra(s).map(function(a){var o=a;if(ne.isValidObject(a))ne.belongToTypes(o,e.keepTypesOnRecursion)||(o=pt(a,e));else if(ne.isArrayObject(a)){var c=pt({key:a},e);o=c.key}return o}))),r[i]=s}),r}Ir.default=pt;var kr={},na=z&&z.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var i=arguments[e],a=0,o=i.length;a<o;a++,s++)n[s]=i[a];return n};Object.defineProperty(kr,"__esModule",{value:!0});var se=Me,sa=zt;function yt(t,e){if(e===void 0&&(e=se.DefaultOption),!se.isValidObject(t))return null;e=se.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var s=t[n],i=sa.default(n);e.recursive&&(se.isValidObject(s)?se.belongToTypes(s,e.keepTypesOnRecursion)||(s=yt(s,e)):e.recursiveInArray&&se.isArrayObject(s)&&(s=na(s).map(function(a){var o=a;if(se.isValidObject(a))se.belongToTypes(o,e.keepTypesOnRecursion)||(o=yt(a,e));else if(se.isArrayObject(a)){var c=yt({key:a},e);o=c.key}return o}))),r[i]=s}),r}kr.default=yt;var Nr={},ia=z&&z.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var i=arguments[e],a=0,o=i.length;a<o;a++,s++)n[s]=i[a];return n};Object.defineProperty(Nr,"__esModule",{value:!0});var ie=Me,aa=qt;function mt(t,e){if(e===void 0&&(e=ie.DefaultOption),!ie.isValidObject(t))return null;e=ie.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var s=t[n],i=aa.default(n);e.recursive&&(ie.isValidObject(s)?ie.belongToTypes(s,e.keepTypesOnRecursion)||(s=mt(s,e)):e.recursiveInArray&&ie.isArrayObject(s)&&(s=ia(s).map(function(a){var o=a;if(ie.isValidObject(a))ie.belongToTypes(o,e.keepTypesOnRecursion)||(o=mt(a,e));else if(ie.isArrayObject(a)){var c=mt({key:a},e);o=c.key}return o}))),r[i]=s}),r}Nr.default=mt;var Er={},oa=z&&z.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var i=arguments[e],a=0,o=i.length;a<o;a++,s++)n[s]=i[a];return n};Object.defineProperty(Er,"__esModule",{value:!0});var ae=Me,ca=Wt;function gt(t,e){if(e===void 0&&(e=ae.DefaultOption),!ae.isValidObject(t))return null;e=ae.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var s=t[n],i=ca.default(n);e.recursive&&(ae.isValidObject(s)?ae.belongToTypes(s,e.keepTypesOnRecursion)||(s=gt(s,e)):e.recursiveInArray&&ae.isArrayObject(s)&&(s=oa(s).map(function(a){var o=a;if(ae.isValidObject(a))ae.belongToTypes(o,e.keepTypesOnRecursion)||(o=gt(a,e));else if(ae.isArrayObject(a)){var c=gt({key:a},e);o=c.key}return o}))),r[i]=s}),r}Er.default=gt;var Cr={},ua=z&&z.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var i=arguments[e],a=0,o=i.length;a<o;a++,s++)n[s]=i[a];return n};Object.defineProperty(Cr,"__esModule",{value:!0});var oe=Me,la=Yt;function vt(t,e){if(e===void 0&&(e=oe.DefaultOption),!oe.isValidObject(t))return null;e=oe.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var s=t[n],i=la.default(n);e.recursive&&(oe.isValidObject(s)?oe.belongToTypes(s,e.keepTypesOnRecursion)||(s=vt(s,e)):e.recursiveInArray&&oe.isArrayObject(s)&&(s=ua(s).map(function(a){var o=a;if(oe.isValidObject(a))oe.belongToTypes(o,e.keepTypesOnRecursion)||(o=vt(a,e));else if(oe.isArrayObject(a)){var c=vt({key:a},e);o=c.key}return o}))),r[i]=s}),r}Cr.default=vt;Object.defineProperty(S,"__esModule",{value:!0});S.kebabKeys=S.pascalKeys=S.snakeKeys=S.camelKeys=S.upperKeys=S.lowerKeys=S.toLowerCase=S.toUpperCase=S.toKebabCase=S.toHeaderCase=S.toSentenceCase=S.toTextCase=S.toPathCase=S.toDotCase=S.toPascalCase=S.toSnakeCase=S.toCamelCase=void 0;var un=zt;S.toCamelCase=un.default;var ln=qt;S.toSnakeCase=ln.default;var dn=Wt;S.toPascalCase=dn.default;var fn=xr;S.toDotCase=fn.default;var hn=Or;S.toPathCase=hn.default;var pn=_r;S.toTextCase=pn.default;var yn=Tr;S.toSentenceCase=yn.default;var mn=Sr;S.toHeaderCase=mn.default;var gn=Yt;S.toKebabCase=gn.default;var vn=Ar;S.lowerKeys=vn.default;var bn=Ir;S.upperKeys=bn.default;var wn=kr;S.camelKeys=wn.default;var xn=Nr;S.snakeKeys=xn.default;var On=Er;S.pascalKeys=On.default;var _n=Cr;S.kebabKeys=_n.default;var Tn=function(t){return String(t||"").toLowerCase()};S.toLowerCase=Tn;var Sn=function(t){return String(t||"").toUpperCase()};S.toUpperCase=Sn;var da={toCamelCase:un.default,toSnakeCase:ln.default,toPascalCase:dn.default,toDotCase:fn.default,toPathCase:hn.default,toTextCase:pn.default,toSentenceCase:yn.default,toHeaderCase:mn.default,toKebabCase:gn.default,toUpperCase:Sn,toLowerCase:Tn,lowerKeys:vn.default,upperKeys:bn.default,camelKeys:wn.default,snakeKeys:xn.default,pascalKeys:On.default,kebabKeys:_n.default};S.default=da;var An=S;const In={recursive:!0,recursiveInArray:!0,keepTypesOnRecursion:[Number,String,Uint8Array]},fa=t=>An.snakeKeys(t,In),ha=t=>An.camelKeys(t,In);exports.Case=void 0;(t=>{t.toSnake=fa,t.toCamel=ha,t.capitalize=e=>e[0].toUpperCase()+e.slice(1)})(exports.Case||(exports.Case={}));const pa=gr,ya=br,ma={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},ga={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},va=Ti,Oe=t=>t instanceof String?t:mr.includes(t)?t==="x"?"left":"top":t,bt=t=>ma[Oe(t)],ba=t=>ga[Oe(t)],nt=t=>{const e=Oe(t);return e==="top"||e==="bottom"?"y":"x"},kn=d.object({x:gr.or(Dr),y:br.or(Dr)}),Nn=d.object({x:gr,y:br}),De=Object.freeze({x:"left",y:"top"}),Mr=Object.freeze({x:"right",y:"top"}),Kt=Object.freeze({x:"left",y:"bottom"}),jr=Object.freeze({x:"right",y:"bottom"}),st=Object.freeze({x:"center",y:"center"}),En=Object.freeze({x:"center",y:"top"}),Cn=Object.freeze({x:"center",y:"bottom"}),Mn=Object.freeze({x:"right",y:"center"}),jn=Object.freeze({x:"left",y:"center"}),Rn=Object.freeze([jn,Mn,En,Cn,De,Mr,Kt,jr,st]),Gt=(t,e)=>t.x===e.x&&t.y===e.y,wt=(t,e)=>{if(typeof e=="object"){let r=!0;return"x"in e&&(t.x===e.x||(r=!1)),"y"in e&&(t.y===e.y||(r=!1)),r}return t.x===e||t.y===e},Zn=t=>[t.x,t.y],xt=t=>nt(Oe(t))==="x",wa=t=>nt(Oe(t))==="y",xa=t=>`${t.x}${exports.Case.capitalize(t.y)}`,Oa=(t,e)=>{let r,n;if(typeof t=="object"&&"x"in t?(r=t.x,n=t.y):(r=Oe(t),n=Oe(e??t)),nt(r)===nt(n)&&r!=="center"&&n!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`);const s={...st};return r==="center"?xt(n)?[s.x,s.y]=[n,r]:[s.x,s.y]=[r,n]:n==="center"?xt(r)?[s.x,s.y]=[r,n]:[s.x,s.y]=[n,r]:xt(r)?[s.x,s.y]=[r,n]:[s.x,s.y]=[n,r],s},_a=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:Cn,BOTTOM_LEFT:Kt,BOTTOM_RIGHT:jr,CENTER:st,CENTER_LOCATIONS:wr,LEFT_CENTER:jn,RIGHT_CENTER:Mn,TOP_CENTER:En,TOP_LEFT:De,TOP_RIGHT:Mr,XY_LOCATIONS:Rn,X_LOCATIONS:Ut,Y_LOCATIONS:vr,construct:Oe,constructXY:Oa,corner:Nn,crude:va,direction:nt,isX:xt,isY:wa,location:Dt,outer:bi,rotate90:ba,swap:bt,x:pa,xy:kn,xyCouple:Zn,xyEquals:Gt,xyMatches:wt,xyToString:xa,y:ya},Symbol.toStringTag,{value:"Module"})),or=d.union([d.number(),rt,pr,yr,mi,en]),C=(t,e)=>{if(typeof t=="string"){if(e===void 0)throw new Error("The y coordinate must be given.");return t==="x"?{x:e,y:0}:{x:0,y:e}}return typeof t=="number"?{x:t,y:e??t}:Array.isArray(t)?{x:t[0],y:t[1]}:"signedWidth"in t?{x:t.signedWidth,y:t.signedHeight}:"clientX"in t?{x:t.clientX,y:t.clientY}:"width"in t?{x:t.width,y:t.height}:{x:t.x,y:t.y}},de={x:0,y:0},$n={x:1,y:1},Ta={x:1/0,y:1/0},Sa={x:NaN,y:NaN},jt=(t,e,r=0)=>{const n=C(t),s=C(e);return r===0?n.x===s.x&&n.y===s.y:Math.abs(n.x-s.x)<=r&&Math.abs(n.y-s.y)<=r},Aa=t=>jt(t,de),Ia=(t,e,r=e)=>{const n=C(t);return{x:n.x*e,y:n.y*r}},Rr=(t,e)=>{const r=C(t);return{x:r.x+e,y:r.y}},Zr=(t,e)=>{const r=C(t);return{x:r.x,y:r.y+e}},Rt=(t,e,r,...n)=>typeof e=="string"&&typeof r=="number"?e==="x"?Rr(t,r):Zr(t,r):[t,e,r??de,...n].reduce((s,i)=>{const a=C(i);return{x:s.x+a.x,y:s.y+a.y}},de),ka=(t,e,r)=>{const n=C(t);return e==="x"?{x:r,y:n.y}:{x:n.x,y:r}},Na=(t,e)=>{const r=C(t),n=C(e);return Math.sqrt((r.x-n.x)**2+(r.y-n.y)**2)},Ea=(t,e)=>{const r=C(t),n=C(e);return Math.abs(r.x-n.x)},Ca=(t,e)=>{const r=C(t),n=C(e);return Math.abs(r.y-n.y)},Ma=(t,e)=>{const r=C(t),n=C(e);return{x:n.x-r.x,y:n.y-r.y}},ja=t=>{const e=C(t);return Number.isNaN(e.x)||Number.isNaN(e.y)},Ra=t=>{const e=C(t);return Number.isFinite(e.x)&&Number.isFinite(e.y)},Za=t=>{const e=C(t);return[e.x,e.y]},$a=t=>{const e=C(t);return{left:e.x,top:e.y}},cr=(t,e=0)=>{const r=C(t);return{x:Number(r.x.toFixed(e)),y:Number(r.y.toFixed(e))}},La=Object.freeze(Object.defineProperty({__proto__:null,INFINITY:Ta,NAN:Sa,ONE:$n,ZERO:de,clientXY:en,construct:C,couple:Za,crudeZ:or,css:$a,distance:Na,equals:jt,isFinite:Ra,isNan:ja,isZero:Aa,scale:Ia,set:ka,translate:Rt,translateX:Rr,translateY:Zr,translation:Ma,truncate:cr,xDistance:Ea,xy:rt,yDistance:Ca},Symbol.toStringTag,{value:"Module"})),lt=d.union([d.number(),d.string()]);d.object({top:lt,left:lt,width:lt,height:lt});d.object({left:d.number(),top:d.number(),right:d.number(),bottom:d.number()});const Ba=d.object({one:rt,two:rt,root:Nn}),Pa={one:de,two:de,root:De},Ua={one:de,two:$n,root:Kt},Ln=(t,e)=>({one:t.one,two:t.two,root:e??t.root}),N=(t,e,r=0,n=0,s)=>{const i={one:{...de},two:{...de},root:s??De};if(typeof t=="number"){if(typeof e!="number")throw new Error("Box constructor called with invalid arguments");return i.one={x:t,y:e},i.two={x:i.one.x+r,y:i.one.y+n},i}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(i.one={x:t.left,y:t.top},i.two={x:t.right,y:t.bottom},i):(i.one=t,e==null?i.two={x:i.one.x+r,y:i.one.y+n}:typeof e=="number"?i.two={x:i.one.x+e,y:i.one.y+r}:"width"in e?i.two={x:i.one.x+e.width,y:i.one.y+e.height}:"signedWidth"in e?i.two={x:i.one.x+e.signedWidth,y:i.one.y+e.signedHeight}:i.two=e,i))},Da=(t,e,r)=>{const n=N(t);if(typeof e=="string"){if(r==null)throw new Error("Invalid arguments for resize");const s=fe(e);return N(n.one,void 0,s==="x"?r:F(n),s==="y"?r:ee(n),n.root)}return N(n.one,e,void 0,void 0,n.root)},Bn=(t,e)=>{const r=N(t);return"one"in e?me(e)>=me(r)&&ye(e)<=ye(r)&&ge(e)>=ge(r)&&Ie(e)<=Ie(r):e.x>=me(r)&&e.x<=ye(r)&&e.y>=ge(r)&&e.y<=Ie(r)},Va=(t,e)=>jt(t.one,e.one)&&jt(t.two,e.two)&&Gt(t.root,e.root),$r=t=>({width:F(t),height:ee(t)}),za=t=>({signedWidth:Ft(t),signedHeight:Jt(t)}),qa=t=>({top:ge(t),left:me(t),width:F(t),height:ee(t)}),Lr=(t,e,r=!1)=>{const n=fe(e)==="y"?Jt(t):Ft(t);return r?n:Math.abs(n)},Ve=(t,e)=>{const r=N(t);return{x:e.x==="center"?it(r).x:_e(r,e.x),y:e.y==="center"?it(r).y:_e(r,e.y)}},_e=(t,e)=>{const r=N(t),n=Zn(r.root).includes(e)?Math.min:Math.max;return Ut.includes(e)?n(r.one.x,r.two.x):n(r.one.y,r.two.y)},Wa=(t,e)=>{const r=_e(t,e);return Ut.includes(e)?{x:r,y:it(t).y}:{x:it(t).x,y:r}},Ya=t=>t.one.x===t.two.x&&t.one.y===t.two.y,F=t=>Lr(t,"x"),ee=t=>Lr(t,"y"),Ft=t=>{const e=N(t);return e.two.x-e.one.x},Jt=t=>{const e=N(t);return e.two.y-e.one.y},Pn=t=>Ve(t,De),Ka=t=>Ve(t,Mr),Ga=t=>Ve(t,Kt),Fa=t=>Ve(t,jr),ye=t=>_e(t,"right"),Ie=t=>_e(t,"bottom"),me=t=>_e(t,"left"),ge=t=>_e(t,"top"),it=t=>Rt(Pn(t),{x:Ft(t)/2,y:Jt(t)/2}),at=t=>{const e=N(t);return e.root.x==="left"?me(e):ye(e)},ot=t=>{const e=N(t);return e.root.y==="top"?ge(e):Ie(e)},Ja=t=>({x:at(t),y:ot(t)}),Ot=t=>{const e=N(t);return{lower:e.one.x,upper:e.two.x}},_t=t=>{const e=N(t);return{lower:e.one.y,upper:e.two.y}},Ha=(t,e)=>Ln(t,e),Xa=(t,e)=>{const r=N(t),n=N(e);if(Bn(n,r))return[r,!1];let s;return ye(r)>F(r)?s=C({x:at(r)-F(r),y:ot(r)}):s=C({x:at(r),y:ot(r)-ee(r)}),[N(s,$r(r)),!0]},Qa=(t,e)=>{const r=N(t),n=N(e),s=at(n)+(F(n)-F(r))/2,i=ot(n)+(ee(n)-ee(r))/2;return N({x:s,y:i},$r(r))},Un=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,eo=t=>F(t)/ee(t),to=(t,e,r)=>{if(typeof e=="string"){if(r==null)throw new Error("Undefined amount passed into box.translate");const s=fe(e);e=C(s,r)}const n=N(t);return N(Rt(n.one,e),Rt(n.two,e),void 0,void 0,n.root)},Dn=(t,e)=>{const r=Math.max(me(t),me(e)),n=Math.max(ge(t),ge(e)),s=Math.min(ye(t),ye(e)),i=Math.min(Ie(t),Ie(e));return N({x:r,y:n},{x:s,y:i},void 0,void 0,t.root)},Vn=t=>F(t)*ee(t),ro=(t,e=0)=>{const r=N(t);return N(cr(r.one,e),cr(r.two,e),void 0,void 0,r.root)},zn=(t,e,r,n,s,i)=>{const a={x:t,y:e},o={x:t+r,y:e+n};return s.x!==i.x&&(s.x==="center"?(a.x-=r/2,o.x-=r/2):(a.x-=r,o.x-=r)),s.y!==i.y&&(s.y==="center"?(a.y-=n/2,o.y-=n/2):(a.y-=n,o.y-=n)),N(a,o,void 0,void 0,i)},no=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:Ua,ZERO:Pa,area:Vn,aspect:eo,bottom:Ie,bottomLeft:Ga,bottomRight:Fa,box:Ba,center:it,construct:N,constructWithAlternateRoot:zn,contains:Bn,copy:Ln,css:qa,dim:Lr,dims:$r,equals:Va,height:ee,intersect:Dn,isBox:Un,isZero:Ya,left:me,loc:_e,locPoint:Wa,positionInCenter:Qa,positionSoVisible:Xa,reRoot:Ha,resize:Da,right:ye,root:Ja,signedDims:za,signedHeight:Jt,signedWidth:Ft,top:ge,topLeft:Pn,topRight:Ka,translate:to,truncate:ro,width:F,x:at,xBounds:Ot,xyLoc:Ve,y:ot,yBounds:_t},Symbol.toStringTag,{value:"Module"})),qn=d.object({signedWidth:d.number(),signedHeight:d.number()}),so=d.union([yr,qn,rt,pr]),io={width:0,height:0},ao={width:1,height:1},J=(t,e)=>typeof t=="number"?{width:t,height:e??t}:Array.isArray(t)?{width:t[0],height:t[1]}:"x"in t?{width:t.x,height:t.y}:"signedWidth"in t?{width:t.signedWidth,height:t.signedHeight}:{...t},oo=(t,e)=>{if(e==null)return!1;const r=J(t),n=J(e);return r.width===n.width&&r.height===n.height},co=t=>{const e=J(t);return{width:e.height,height:e.width}},uo=t=>{const e=J(t);return`0 0 ${e.width} ${e.height}`},lo=t=>{const e=J(t);return[e.width,e.height]},fo=t=>({width:Math.max(...t.map(e=>J(e).width)),height:Math.max(...t.map(e=>J(e).height))}),ho=t=>({width:Math.min(...t.map(e=>J(e).width)),height:Math.min(...t.map(e=>J(e).height))}),po=(t,e)=>{const r=J(t);return{width:r.width*e,height:r.height*e}},yo=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:ao,ZERO:io,construct:J,couple:lo,crude:so,dimensions:yr,equals:oo,max:fo,min:ho,scale:po,signed:qn,svgViewBox:uo,swap:co},Symbol.toStringTag,{value:"Module"})),Wn=(t,e,r)=>(e!=null&&(t=Math.max(t,e)),r!=null&&(t=Math.min(t,r)),t),mo=d.object({offset:or,scale:or}),go=t=>(e,r,n,s)=>r==="dimension"?[e,n]:[e,s?n-t:n+t],vo=t=>(e,r,n,s)=>[e,s?n/t:n*t],bo=t=>(e,r,n)=>{if(e===null)return[t,n];const{lower:s,upper:i}=e,{lower:a,upper:o}=t,c=i-s,f=o-a;if(r==="dimension")return[t,n*(f/c)];const b=(n-s)*(f/c)+a;return[t,b]},wo=t=>(e,r,n)=>[t,n],xo=()=>(t,e,r)=>{if(t===null)throw new Error("cannot invert without bounds");if(e==="dimension")return[t,r];const{lower:n,upper:s}=t;return[t,s-(r-n)]},Oo=t=>(e,r,n)=>{const{lower:s,upper:i}=t;return n=Wn(n,s,i),[e,n]},he=class he{constructor(){u(this,"ops",[]);u(this,"currBounds",null);u(this,"currType",null);u(this,"reversed",!1);this.ops=[]}static translate(e){return new he().translate(e)}static magnify(e){return new he().magnify(e)}static scale(e,r){return new he().scale(e,r)}translate(e){const r=this.new(),n=go(e);return n.type="translate",r.ops.push(n),r}magnify(e){const r=this.new(),n=vo(e);return n.type="magnify",r.ops.push(n),r}scale(e,r){const n=E(e,r),s=this.new(),i=bo(n);return i.type="scale",s.ops.push(i),s}clamp(e,r){const n=E(e,r),s=this.new(),i=Oo(n);return i.type="clamp",s.ops.push(i),s}reBound(e,r){const n=E(e,r),s=this.new(),i=wo(n);return i.type="re-bound",s.ops.push(i),s}invert(){const e=xo();e.type="invert";const r=this.new();return r.ops.push(e),r}pos(e){return this.exec("position",e)}dim(e){return this.exec("dimension",e)}new(){const e=new he;return e.ops=this.ops.slice(),e.reversed=this.reversed,e}exec(e,r){return this.currBounds=null,this.ops.reduce(([n,s],i)=>i(n,e,s,this.reversed),[null,r])[1]}reverse(){const e=this.new();e.ops.reverse();const r=[];return e.ops.forEach((n,s)=>{if(n.type==="scale"||r.some(([a,o])=>s>=a&&s<=o))return;const i=e.ops.findIndex((a,o)=>a.type==="scale"&&o>s);i!==-1&&r.push([s,i])}),r.forEach(([n,s])=>{const i=e.ops.slice(n,s);i.unshift(e.ops[s]),e.ops.splice(n,s-n+1,...i)}),e.reversed=!e.reversed,e}};u(he,"IDENTITY",new he);let ct=he;const _o=t=>({scale:{x:t.x.dim(1),y:t.y.dim(1)},offset:{x:t.x.pos(0),y:t.y.pos(0)}}),V=class V{constructor(e=new ct,r=new ct,n=null){u(this,"x");u(this,"y");u(this,"currRoot");this.x=e,this.y=r,this.currRoot=n}static translate(e,r){return new V().translate(e,r)}static translateX(e){return new V().translateX(e)}static translateY(e){return new V().translateY(e)}static clamp(e){return new V().clamp(e)}static magnify(e){return new V().magnify(e)}static scale(e){return new V().scale(e)}static reBound(e){return new V().reBound(e)}translate(e,r){const n=C(e,r),s=this.copy();return s.x=this.x.translate(n.x),s.y=this.y.translate(n.y),s}translateX(e){const r=this.copy();return r.x=this.x.translate(e),r}translateY(e){const r=this.copy();return r.y=this.y.translate(e),r}magnify(e){const r=this.copy();return r.x=this.x.magnify(e.x),r.y=this.y.magnify(e.y),r}scale(e){const r=this.copy();if(Un(e)){const n=this.currRoot;return r.currRoot=e.root,n!=null&&!Gt(n,e.root)&&(n.x!==e.root.x&&(r.x=r.x.invert()),n.y!==e.root.y&&(r.y=r.y.invert())),r.x=r.x.scale(Ot(e)),r.y=r.y.scale(_t(e)),r}return r.x=r.x.scale(e.width),r.y=r.y.scale(e.height),r}reBound(e){const r=this.copy();return r.x=this.x.reBound(Ot(e)),r.y=this.y.reBound(_t(e)),r}clamp(e){const r=this.copy();return r.x=this.x.clamp(Ot(e)),r.y=this.y.clamp(_t(e)),r}copy(){const e=new V;return e.currRoot=this.currRoot,e.x=this.x,e.y=this.y,e}reverse(){const e=this.copy();return e.x=this.x.reverse(),e.y=this.y.reverse(),e}pos(e){return{x:this.x.pos(e.x),y:this.y.pos(e.y)}}box(e){return N(this.pos(e.one),this.pos(e.two),0,0,this.currRoot??e.root)}};u(V,"IDENTITY",new V);let ur=V;const To=Object.freeze(Object.defineProperty({__proto__:null,Scale:ct,XY:ur,crudeXYTransform:mo,xyScaleToTransform:_o},Symbol.toStringTag,{value:"Module"})),So=(t,e)=>{const{width:r,height:n}=t.getBoundingClientRect(),{innerWidth:s,innerHeight:i}=window;let a=!1,o=C(e);return e.x+r>s&&(o=Rr(o,-r),a=!0),e.y+n>i&&(o=Zr(o,-n),a=!0),[o,a]},Vr=t=>{if(t==null)return{x:void 0,y:void 0};const e=kn.safeParse(t);if(e.success)return e.data;const r=Dt.safeParse(t);return r.success?fe(r.data)==="x"?{x:r.data,y:void 0}:{x:void 0,y:r.data}:t},Ao=({container:t,target:e,dialog:r,initial:n,prefer:s,alignments:i=["start"],disable:a=[]})=>{const o=Vr(n);let c=Rn;if(s!=null){const R=s.map(te=>Vr(te));c=c.slice().sort((te,Ht)=>{const Re=R.findIndex(Qt=>wt(te,Qt)),Xt=R.findIndex(Qt=>wt(Ht,Qt));return Re>-1&&Xt>-1?Re-Xt:Re>-1?-1:Xt>-1?1:0})}const f=c.filter(R=>!Gt(R,st)&&(o.x==null||R.x===o.x)&&(o.y==null||R.y===o.y)&&!a.some(te=>wt(R,te))).map(R=>i==null?void 0:i.map(te=>[R,te])).flat(),b=N(t),x=N(e),H=N(r);let D=-1/0;const je={location:st,adjustedDialog:H};return f.forEach(([R,te])=>{const[Ht,Re]=Io({option:R,alignment:te,container:b,target:x,dialog:H});Re>D&&(D=Re,je.location=R,je.adjustedDialog=Ht)}),je},Io=({option:t,alignment:e,container:r,target:n,dialog:s})=>{const i=Yn(t,e),a=Ve(n,t),o=zn(a.x,a.y,F(s),ee(s),i,De),c=Vn(Dn(o,r));return[o,c]},ko={start:"left",center:"center",end:"right"},No={start:"bottom",center:"center",end:"top"},Yn=(t,e)=>{const r={x:"center",y:"center"};if(t.y!=="center"){r.y=bt(t.y);const n=t.x==="left"?bt:s=>s;r.x=n(ko[e])}else r.x=bt(t.x),r.y=No[e];return r},Eo=Object.freeze(Object.defineProperty({__proto__:null,dialog:Ao,getRoot:Yn,posititonSoVisible:So},Symbol.toStringTag,{value:"Module"})),Co=Object.freeze(Object.defineProperty({__proto__:null,ALIGNMENTS:Qr,ORDERS:nn,alignment:xi,order:Oi},Symbol.toStringTag,{value:"Module"})),Kn=(t,e)=>{const r=new M(e);if(![Z.DAY,Z.HOUR,Z.MINUTE,Z.SECOND,Z.MILLISECOND,Z.MICROSECOND,Z.NANOSECOND].some(s=>s.equals(r)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const n=t.valueOf()%r.valueOf();return t instanceof M?new M(n):new Z(n)},p=class p{constructor(e,r="UTC"){u(this,"value");u(this,"encodeValue",!0);if(e==null)this.value=p.now().valueOf();else if(e instanceof Date)this.value=BigInt(e.getTime())*p.MILLISECOND.valueOf();else if(typeof e=="string")this.value=p.parseDateTimeString(e,r).valueOf();else if(Array.isArray(e))this.value=p.parseDate(e);else{let n=BigInt(0);e instanceof Number&&(e=e.valueOf()),r==="local"&&(n=p.utcOffset.valueOf()),typeof e=="number"&&(isFinite(e)?e=Math.trunc(e):(isNaN(e)&&(e=0),e===1/0?e=p.MAX:e=p.MIN)),this.value=BigInt(e.valueOf())+n}}static parseDate([e=1970,r=1,n=1]){const s=new Date(e,r-1,n,0,0,0,0);return new p(BigInt(s.getTime())*p.MILLISECOND.valueOf()).truncate(p.DAY).valueOf()}encode(){return this.value.toString()}valueOf(){return this.value}static parseTimeString(e,r="UTC"){const[n,s,i]=e.split(":");let a="00",o="00";i!=null&&([a,o]=i.split("."));let c=p.hours(parseInt(n??"00",10)).add(p.minutes(parseInt(s??"00",10))).add(p.seconds(parseInt(a??"00",10))).add(p.milliseconds(parseInt(o??"00",10)));return r==="local"&&(c=c.add(p.utcOffset)),c.valueOf()}static parseDateTimeString(e,r="UTC"){if(!e.includes("/")&&!e.includes("-"))return p.parseTimeString(e,r);const n=new Date(e);return e.includes(":")||n.setUTCHours(0,0,0,0),new p(BigInt(n.getTime())*p.MILLISECOND.valueOf(),r).valueOf()}fString(e="ISO",r="UTC"){switch(e){case"ISODate":return this.toISOString(r).slice(0,10);case"ISOTime":return this.toISOString(r).slice(11,23);case"time":return this.timeString(!1,r);case"preciseTime":return this.timeString(!0,r);case"date":return this.dateString(r);case"preciseDate":return`${this.dateString(r)} ${this.timeString(!0,r)}`;case"dateTime":return`${this.dateString(r)} ${this.timeString(!1,r)}`;default:return this.toISOString(r)}}toISOString(e="UTC"){return e==="UTC"?this.date().toISOString():this.sub(p.utcOffset).date().toISOString()}timeString(e=!1,r="UTC"){const n=this.toISOString(r);return e?n.slice(11,23):n.slice(11,19)}dateString(e="UTC"){const r=this.date(),n=r.toLocaleString("default",{month:"short"}),s=r.toLocaleString("default",{day:"numeric"});return`${n} ${s}`}static get utcOffset(){return new Z(BigInt(new Date().getTimezoneOffset())*p.MINUTE.valueOf())}static since(e){return new p().span(e)}date(){return new Date(this.milliseconds())}equals(e){return this.valueOf()===new p(e).valueOf()}span(e){return this.range(e).span}range(e){return new Ce(this,e).makeValid()}spanRange(e){return this.range(this.add(e)).makeValid()}get isZero(){return this.valueOf()===BigInt(0)}after(e){return this.valueOf()>new p(e).valueOf()}afterEq(e){return this.valueOf()>=new p(e).valueOf()}before(e){return this.valueOf()<new p(e).valueOf()}beforeEq(e){return this.valueOf()<=new p(e).valueOf()}add(e){return new p(this.valueOf()+BigInt(e.valueOf()))}sub(e){return new p(this.valueOf()-BigInt(e.valueOf()))}milliseconds(){return Number(this.valueOf()/p.MILLISECOND.valueOf())}toString(){return this.date().toISOString()}remainder(e){return Kn(this,e)}get isToday(){return this.truncate(Z.DAY).equals(p.now().truncate(Z.DAY))}truncate(e){return this.sub(this.remainder(e))}static now(){return new p(new Date)}static max(...e){let r=p.MIN;for(const n of e){const s=new p(n);s.after(r)&&(r=s)}return r}static min(...e){let r=p.MAX;for(const n of e){const s=new p(n);s.before(r)&&(r=s)}return r}static nanoseconds(e){return new p(e)}static microseconds(e){return p.nanoseconds(e*1e3)}static milliseconds(e){return p.microseconds(e*1e3)}static seconds(e){return p.milliseconds(e*1e3)}static minutes(e){return p.seconds(e*60)}static hours(e){return p.minutes(e*60)}static days(e){return p.hours(e*24)}};u(p,"NANOSECOND",p.nanoseconds(1)),u(p,"MICROSECOND",p.microseconds(1)),u(p,"MILLISECOND",p.milliseconds(1)),u(p,"SECOND",p.seconds(1)),u(p,"MINUTE",p.minutes(1)),u(p,"HOUR",p.hours(1)),u(p,"DAY",p.days(1)),u(p,"MAX",new p((1n<<63n)-1n)),u(p,"MIN",new p(0)),u(p,"ZERO",new p(0)),u(p,"z",d.union([d.object({value:d.bigint()}).transform(e=>new p(e.value)),d.string().transform(e=>new p(BigInt(e))),d.instanceof(Number).transform(e=>new p(e)),d.number().transform(e=>new p(e)),d.instanceof(p)]));let M=p;const g=class g{constructor(e){u(this,"value");u(this,"encodeValue",!0);typeof e=="number"&&(e=Math.trunc(e.valueOf())),this.value=BigInt(e.valueOf())}encode(){return this.value.toString()}valueOf(){return this.value}lessThan(e){return this.valueOf()<new g(e).valueOf()}greaterThan(e){return this.valueOf()>new g(e).valueOf()}lessThanOrEqual(e){return this.valueOf()<=new g(e).valueOf()}greaterThanOrEqual(e){return this.valueOf()>=new g(e).valueOf()}remainder(e){return Kn(this,e)}truncate(e){return new g(BigInt(Math.trunc(Number(this.valueOf()/e.valueOf())))*e.valueOf())}toString(){const e=this.truncate(g.DAY),r=this.truncate(g.HOUR),n=this.truncate(g.MINUTE),s=this.truncate(g.SECOND),i=this.truncate(g.MILLISECOND),a=this.truncate(g.MICROSECOND),o=this.truncate(g.NANOSECOND),c=e,f=r.sub(e),b=n.sub(r),x=s.sub(n),H=i.sub(s),D=a.sub(i),je=o.sub(a);let R="";return c.isZero||(R+=`${c.days}d `),f.isZero||(R+=`${f.hours}h `),b.isZero||(R+=`${b.minutes}m `),x.isZero||(R+=`${x.seconds}s `),H.isZero||(R+=`${H.milliseconds}ms `),D.isZero||(R+=`${D.microseconds}µs `),je.isZero||(R+=`${je.nanoseconds}ns`),R.trim()}get days(){return Number(this.valueOf()/g.DAY.valueOf())}get hours(){return Number(this.valueOf()/g.HOUR.valueOf())}get minutes(){return Number(this.valueOf()/g.MINUTE.valueOf())}get seconds(){return Number(this.valueOf()/g.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf()/g.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf()/g.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===BigInt(0)}equals(e){return this.valueOf()===new g(e).valueOf()}add(e){return new g(this.valueOf()+new g(e).valueOf())}sub(e){return new g(this.valueOf()-new g(e).valueOf())}static nanoseconds(e=1){return new g(e)}static microseconds(e=1){return g.nanoseconds(e*1e3)}static milliseconds(e=1){return g.microseconds(e*1e3)}static seconds(e=1){return g.milliseconds(e*1e3)}static minutes(e){return g.seconds(e.valueOf()*60)}static hours(e){return g.minutes(e*60)}static days(e){return g.hours(e*24)}};u(g,"NANOSECOND",g.nanoseconds(1)),u(g,"MICROSECOND",g.microseconds(1)),u(g,"MILLISECOND",g.milliseconds(1)),u(g,"SECOND",g.seconds(1)),u(g,"MINUTE",g.minutes(1)),u(g,"HOUR",g.hours(1)),u(g,"DAY",g.days(1)),u(g,"MAX",new g((1n<<63n)-1n)),u(g,"MIN",new g(0)),u(g,"ZERO",new g(0)),u(g,"z",d.union([d.object({value:d.bigint()}).transform(e=>new g(e.value)),d.string().transform(e=>new g(BigInt(e))),d.instanceof(Number).transform(e=>new g(e)),d.number().transform(e=>new g(e)),d.instanceof(g)]));let Z=g;const ce=class ce extends Number{constructor(e){e instanceof Number?super(e.valueOf()):super(e)}toString(){return`${this.valueOf()} Hz`}equals(e){return this.valueOf()===new ce(e).valueOf()}get period(){return Z.seconds(1/this.valueOf())}sampleCount(e){return new Z(e).seconds*this.valueOf()}byteCount(e,r){return this.sampleCount(e)*new L(r).valueOf()}span(e){return Z.seconds(e/this.valueOf())}byteSpan(e,r){return this.span(e.valueOf()/r.valueOf())}static hz(e){return new ce(e)}static khz(e){return ce.hz(e*1e3)}};u(ce,"z",d.union([d.number().transform(e=>new ce(e)),d.instanceof(Number).transform(e=>new ce(e)),d.instanceof(ce)]));let lr=ce;const $=class $ extends Number{constructor(e){e instanceof Number?super(e.valueOf()):super(e)}length(e){return e.valueOf()/this.valueOf()}size(e){return new Ue(e*this.valueOf())}};u($,"UNKNOWN",new $(0)),u($,"BIT128",new $(16)),u($,"BIT64",new $(8)),u($,"BIT32",new $(4)),u($,"BIT16",new $(2)),u($,"BIT8",new $(1)),u($,"z",d.union([d.number().transform(e=>new $(e)),d.instanceof(Number).transform(e=>new $(e)),d.instanceof($)]));let L=$;const U=class U{constructor(e,r){u(this,"start");u(this,"end");typeof e=="object"&&"start"in e?(this.start=new M(e.start),this.end=new M(e.end)):(this.start=new M(e),this.end=new M(r))}get span(){return new Z(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}swap(){return new U(this.end,this.start)}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(e){e=e.makeValid();const r=this.makeValid();return e.start.equals(r.start)?!0:e.end.equals(this.start)||e.start.equals(this.end)?!1:this.contains(e.end)||this.contains(e.start)||e.contains(this.start)||e.contains(this.end)}contains(e){return e instanceof U?this.contains(e.start)&&this.contains(e.end):this.start.beforeEq(e)&&this.end.after(e)}boundBy(e){const r=new U(this.start,this.end);return e.start.after(this.start)&&(r.start=e.start),e.start.after(this.end)&&(r.end=e.start),e.end.before(this.end)&&(r.end=e.end),e.end.before(this.start)&&(r.start=e.end),r}};u(U,"MAX",new U(M.MIN,M.MAX)),u(U,"MIN",new U(M.MAX,M.MIN)),u(U,"ZERO",new U(M.ZERO,M.ZERO)),u(U,"z",d.union([d.object({start:M.z,end:M.z}).transform(e=>new U(e.start,e.end)),d.instanceof(U)]));let Ce=U;const l=class l extends String{constructor(e){if(e instanceof l||typeof e=="string"||typeof e.valueOf()=="string"){super(e.valueOf());return}else{const r=l.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);if(r!=null){super(r.valueOf());return}}throw super(l.UNKNOWN.valueOf()),new Error(`unable to find data type for ${e.toString()}`)}get Array(){const e=l.ARRAY_CONSTRUCTORS.get(this.toString());if(e==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return e}equals(e){return this.valueOf()===e.valueOf()}toString(){return this.valueOf()}get isVariable(){return this.equals(l.JSON)||this.equals(l.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(l.UUID)}get isInteger(){return this.toString().startsWith("int")}get isFloat(){return this.toString().startsWith("float")}get density(){const e=l.DENSITIES.get(this.toString());if(e==null)throw new Error(`unable to find density for ${this.valueOf()}`);return e}checkArray(e){return e.constructor===this.Array}toJSON(){return this.toString()}get usesBigInt(){return l.BIG_INT_TYPES.some(e=>e.equals(this))}};u(l,"UNKNOWN",new l("unknown")),u(l,"FLOAT64",new l("float64")),u(l,"FLOAT32",new l("float32")),u(l,"INT64",new l("int64")),u(l,"INT32",new l("int32")),u(l,"INT16",new l("int16")),u(l,"INT8",new l("int8")),u(l,"UINT64",new l("uint64")),u(l,"UINT32",new l("uint32")),u(l,"UINT16",new l("uint16")),u(l,"UINT8",new l("uint8")),u(l,"BOOLEAN",l.UINT8),u(l,"TIMESTAMP",new l("timestamp")),u(l,"UUID",new l("uuid")),u(l,"STRING",new l("string")),u(l,"JSON",new l("json")),u(l,"ARRAY_CONSTRUCTORS",new Map([[l.UINT8.toString(),Uint8Array],[l.UINT16.toString(),Uint16Array],[l.UINT32.toString(),Uint32Array],[l.UINT64.toString(),BigUint64Array],[l.FLOAT32.toString(),Float32Array],[l.FLOAT64.toString(),Float64Array],[l.INT8.toString(),Int8Array],[l.INT16.toString(),Int16Array],[l.INT32.toString(),Int32Array],[l.INT64.toString(),BigInt64Array],[l.TIMESTAMP.toString(),BigInt64Array],[l.STRING.toString(),Uint8Array],[l.JSON.toString(),Uint8Array],[l.UUID.toString(),Uint8Array]])),u(l,"ARRAY_CONSTRUCTOR_DATA_TYPES",new Map([[Uint8Array.name,l.UINT8],[Uint16Array.name,l.UINT16],[Uint32Array.name,l.UINT32],[BigUint64Array.name,l.UINT64],[Float32Array.name,l.FLOAT32],[Float64Array.name,l.FLOAT64],[Int8Array.name,l.INT8],[Int16Array.name,l.INT16],[Int32Array.name,l.INT32],[BigInt64Array.name,l.INT64]])),u(l,"DENSITIES",new Map([[l.UINT8.toString(),L.BIT8],[l.UINT16.toString(),L.BIT16],[l.UINT32.toString(),L.BIT32],[l.UINT64.toString(),L.BIT64],[l.FLOAT32.toString(),L.BIT32],[l.FLOAT64.toString(),L.BIT64],[l.INT8.toString(),L.BIT8],[l.INT16.toString(),L.BIT16],[l.INT32.toString(),L.BIT32],[l.INT64.toString(),L.BIT64],[l.TIMESTAMP.toString(),L.BIT64],[l.STRING.toString(),L.UNKNOWN],[l.JSON.toString(),L.UNKNOWN],[l.UUID.toString(),L.BIT128]])),u(l,"ALL",[l.UNKNOWN,l.FLOAT64,l.FLOAT32,l.INT64,l.INT32,l.INT16,l.INT8,l.UINT64,l.UINT32,l.UINT16,l.UINT8,l.TIMESTAMP,l.UUID,l.STRING,l.JSON]),u(l,"BIG_INT_TYPES",[l.INT64,l.UINT64,l.TIMESTAMP]),u(l,"z",d.union([d.string().transform(e=>new l(e)),d.instanceof(l)]));let k=l;const A=class A extends Number{constructor(e){super(e.valueOf())}largerThan(e){return this.valueOf()>e.valueOf()}smallerThan(e){return this.valueOf()<e.valueOf()}add(e){return A.bytes(this.valueOf()+e.valueOf())}sub(e){return A.bytes(this.valueOf()-e.valueOf())}truncate(e){return new A(Math.trunc(this.valueOf()/e.valueOf())*e.valueOf())}remainder(e){return A.bytes(this.valueOf()%e.valueOf())}get gigabytes(){return this.valueOf()/A.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/A.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/A.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/A.TERABYTE.valueOf()}toString(){const e=this.truncate(A.TERABYTE),r=this.truncate(A.GIGABYTE),n=this.truncate(A.MEGABYTE),s=this.truncate(A.KILOBYTE),i=this.truncate(A.BYTE),a=e,o=r.sub(e),c=n.sub(r),f=s.sub(n),b=i.sub(s);let x="";return a.isZero||(x+=`${a.terabytes}TB `),o.isZero||(x+=`${o.gigabytes}GB `),c.isZero||(x+=`${c.megabytes}MB `),f.isZero||(x+=`${f.kilobytes}KB `),(!b.isZero||x==="")&&(x+=`${b.valueOf()}B`),x.trim()}static bytes(e=1){return new A(e)}static kilobytes(e=1){return A.bytes(e.valueOf()*1e3)}static megabytes(e=1){return A.kilobytes(e.valueOf()*1e3)}static gigabytes(e=1){return A.megabytes(e.valueOf()*1e3)}static terabytes(e){return A.gigabytes(e.valueOf()*1e3)}get isZero(){return this.valueOf()===0}};u(A,"BYTE",new A(1)),u(A,"KILOBYTE",A.kilobytes(1)),u(A,"MEGABYTE",A.megabytes(1)),u(A,"GIGABYTE",A.gigabytes(1)),u(A,"TERABYTE",A.terabytes(1)),u(A,"ZERO",new A(0)),u(A,"z",d.union([d.number().transform(e=>new A(e)),d.instanceof(A)]));let Ue=A;const Mo=d.union([d.instanceof(Uint8Array),d.instanceof(Uint16Array),d.instanceof(Uint32Array),d.instanceof(BigUint64Array),d.instanceof(Float32Array),d.instanceof(Float64Array),d.instanceof(Int8Array),d.instanceof(Int16Array),d.instanceof(Int32Array),d.instanceof(BigInt64Array)]),Br=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"||t instanceof M||t instanceof Z||t instanceof Date},Gn=(t,e,r,n=0)=>t.usesBigInt&&!e.usesBigInt?Number(r)-Number(n):!t.usesBigInt&&e.usesBigInt?BigInt(r)-BigInt(n):$e(r,-n),Fn=t=>t==null?!1:Array.isArray(t)||t instanceof ArrayBuffer||ArrayBuffer.isView(t)&&!(t instanceof DataView)||t instanceof q?!0:Br(t),Te=-1;class q{constructor(e){u(this,"key","");u(this,"dataType");u(this,"sampleOffset");u(this,"gl");u(this,"_data");u(this,"_timeRange");u(this,"alignment",0);u(this,"_cachedMin");u(this,"_cachedMax");u(this,"writePos",Te);u(this,"_refCount",0);u(this,"_cachedLength");Fn(e)&&(e={data:e});const{dataType:r,timeRange:n,sampleOffset:s=0,glBufferUsage:i="static",alignment:a=0,key:o=os()}=e,{data:c}=e;if(c instanceof q){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;return}const f=Br(c),b=Array.isArray(c);if(r!=null)this.dataType=new k(r);else{if(c instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(b||f){let x=c;if(!f){if(c.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");x=c[0]}if(typeof x=="string")this.dataType=k.STRING;else if(typeof x=="number")this.dataType=k.FLOAT64;else if(typeof x=="bigint")this.dataType=k.INT64;else if(typeof x=="boolean")this.dataType=k.BOOLEAN;else if(x instanceof M||x instanceof Date||x instanceof M)this.dataType=k.TIMESTAMP;else if(typeof x=="object")this.dataType=k.JSON;else throw new Error(`cannot infer data type of ${typeof x} when constructing a Series from a JS array`)}else this.dataType=new k(c)}if(!b&&!f)this._data=c;else{let x=f?[c]:c;const H=x[0];(H instanceof M||H instanceof Date||H instanceof Z)&&(x=x.map(D=>new M(D).valueOf())),this.dataType.equals(k.STRING)?(this._cachedLength=x.length,this._data=new TextEncoder().encode(x.join(`
|
|
2
|
-
`)+`
|
|
3
|
-
`)):this.dataType.equals(k.JSON)?(this._cachedLength=x.length,this._data=new TextEncoder().encode(x.map(D=>JSON.stringify(D)).join(`
|
|
4
|
-
`)+`
|
|
5
|
-
`)):this._data=new this.dataType.Array(x).buffer}this.key=o,this.alignment=a,this.sampleOffset=s??0,this._timeRange=n,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:i}}static alloc({capacity:e,dataType:r,...n}){if(e===0)throw new Error("[Series] - cannot allocate an array of length 0");const s=new new k(r).Array(e),i=new q({data:s.buffer,dataType:r,...n});return i.writePos=0,i}static generateTimestamps(e,r,n){const s=n.spanRange(r.span(e)),i=new BigInt64Array(e);for(let a=0;a<e;a++)i[a]=BigInt(n.add(r.span(a)).valueOf());return new q({data:i,dataType:k.TIMESTAMP,timeRange:s})}get refCount(){return this._refCount}static fromStrings(e,r){const n=new TextEncoder().encode(e.join(`
|
|
6
|
-
`)+`
|
|
7
|
-
`);return new q({data:n,dataType:k.STRING,timeRange:r})}static fromJSON(e,r){const n=new TextEncoder().encode(e.map(s=>JSON.stringify(s)).join(`
|
|
8
|
-
`)+`
|
|
9
|
-
`);return new q({data:n,dataType:k.JSON,timeRange:r})}acquire(e){this._refCount++,e!=null&&this.updateGLBuffer(e)}release(){if(this._refCount--,this._refCount===0&&this.gl.control!=null)this.maybeGarbageCollectGLBuffer(this.gl.control);else if(this._refCount<0)throw new Error("cannot release an array with a negative reference count")}write(e){if(!e.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");if(this.writePos===Te)return 0;const r=this.capacity-this.writePos,n=r<e.length?e.slice(0,r):e;return this.underlyingData.set(n.data,this.writePos),this.maybeRecomputeMinMax(n),this._cachedLength=void 0,this.writePos+=n.length,n.length}get buffer(){return this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===Te?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){if(!this.dataType.equals(k.STRING))throw new Error("cannot convert non-string series to strings");return new TextDecoder().decode(this.buffer).split(`
|
|
10
|
-
`).slice(0,-1)}toUUIDs(){if(!this.dataType.equals(k.UUID))throw new Error("cannot convert non-uuid series to uuids");const e=k.UUID.density.valueOf(),r=Array(this.length);for(let n=0;n<this.length;n++){const s=this.buffer.slice(n*e,(n+1)*e),i=Array.from(new Uint8Array(s),a=>a.toString(16).padStart(2,"0")).join("").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5");r[n]=i}return r}parseJSON(e){if(!this.dataType.equals(k.JSON))throw new Error("cannot convert non-string series to strings");return new TextDecoder().decode(this.buffer).split(`
|
|
11
|
-
`).slice(0,-1).map(r=>e.parse(JSON.parse(r)))}get timeRange(){if(this._timeRange==null)throw new Error("time range not set on series");return this._timeRange}get byteCapacity(){return new Ue(this.buffer.byteLength)}get capacity(){return this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===Te?this.byteCapacity:this.dataType.density.size(this.writePos)}get length(){return this._cachedLength!=null?this._cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===Te?this.data.length:this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let e=0;return this.data.forEach(r=>{r===10&&e++}),this._cachedLength=e,e}convert(e,r=0){if(this.dataType.equals(e))return this;const n=new e.Array(this.length);for(let s=0;s<this.length;s++)n[s]=Gn(this.dataType,e,this.data[s],r);return new q({data:n.buffer,dataType:e,timeRange:this._timeRange,sampleOffset:r,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(k.TIMESTAMP))this._cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const e=this.data;this._cachedMax=e.reduce((r,n)=>r>n?r:n)}else{const e=this.data;this._cachedMax=e.reduce((r,n)=>r>n?r:n)}return this._cachedMax}get max(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this._cachedMax==null&&(this._cachedMax=this.calcRawMax()),$e(this._cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(k.TIMESTAMP))this._cachedMin=this.data[0];else if(this.dataType.usesBigInt){const e=this.data;this._cachedMin=e.reduce((r,n)=>r<n?r:n)}else{const e=this.data;this._cachedMin=e.reduce((r,n)=>r<n?r:n)}return this._cachedMin}get min(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this._cachedMin==null&&(this._cachedMin=this.calcRawMin()),$e(this._cachedMin,this.sampleOffset))}get bounds(){return E(Number(this.min),Number(this.max))}maybeRecomputeMinMax(e){if(this._cachedMin!=null){const r=e._cachedMin??e.calcRawMin();r<this._cachedMin&&(this._cachedMin=r)}if(this._cachedMax!=null){const r=e._cachedMax??e.calcRawMax();r>this._cachedMax&&(this._cachedMax=r)}}enrich(){this.max,this.min}get range(){return $e(this.max,-this.min)}at(e,r){if(this.dataType.isVariable)return this.atVariable(e,r??!1);e<0&&(e=this.length+e);const n=this.data[e];if(n==null){if(r===!0)throw new Error(`[series] - no value at index ${e}`);return}return $e(n,this.sampleOffset)}atVariable(e,r){e<0&&(e=this.length+e);let n=0,s=0;for(let a=0;a<this.data.length;a++)if(this.data[a]===10){if(e===0){s=a;break}n=a+1,e--}if(s===0&&(s=this.data.length),n>=s||e>0){if(r)throw new Error(`[series] - no value at index ${e}`);return}const i=this.data.slice(n,s);return this.dataType.equals(k.STRING)?new TextDecoder().decode(i):JSON.parse(new TextDecoder().decode(i))}binarySearch(e){let r=0,n=this.length-1;const s=Lt(e);for(;r<=n;){const i=Math.floor((r+n)/2),a=s(this.at(i,!0),e);if(a===0)return i;a<0?r=i+1:n=i-1}return r}updateGLBuffer(e){if(this.gl.control=e,!this.dataType.equals(k.FLOAT32))throw new Error("Only FLOAT32 arrays can be used in WebGL");const{buffer:r,bufferUsage:n,prevBuffer:s}=this.gl;if(r==null&&(this.gl.buffer=e.createBuffer()),this.writePos!==s)if(e.bindBuffer(e.ARRAY_BUFFER,this.gl.buffer),this.writePos!==Te){s===0&&e.bufferData(e.ARRAY_BUFFER,this.byteCapacity.valueOf(),e.STATIC_DRAW);const i=this.dataType.density.size(s).valueOf(),a=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);e.bufferSubData(e.ARRAY_BUFFER,i,a.buffer),this.gl.prevBuffer=this.writePos}else e.bufferData(e.ARRAY_BUFFER,this.buffer,n==="static"?e.STATIC_DRAW:e.DYNAMIC_DRAW),this.gl.prevBuffer=Te}as(e){if(e==="string"){if(!this.dataType.equals(k.STRING))throw new Error(`cannot convert series of type ${this.dataType.toString()} to string`);return this}if(e==="number"){if(!this.dataType.isNumeric)throw new Error(`cannot convert series of type ${this.dataType.toString()} to number`);return this}if(e==="bigint"){if(!this.dataType.equals(k.INT64))throw new Error(`cannot convert series of type ${this.dataType.toString()} to bigint`);return this}throw new Error(`cannot convert series to ${e}`)}get digest(){var e;return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:this.alignmentBounds,timeRange:(e=this._timeRange)==null?void 0:e.toString(),length:this.length,capacity:this.capacity}}get memInfo(){return{key:this.key,length:this.length,byteLength:this.byteLength,glBuffer:this.gl.buffer!=null}}get alignmentBounds(){return E(this.alignment,this.alignment+this.length)}maybeGarbageCollectGLBuffer(e){this.gl.buffer!=null&&(e.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const e=new jo(this);return this.dataType.equals(k.JSON)?new Ro(e):e}return new Zo(this)}slice(e,r){if(e<=0&&(r==null||r>=this.length))return this;const n=this.data.slice(e,r);return new q({data:n,dataType:this.dataType,timeRange:this._timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+e})}reAlign(e){return new q({data:this.buffer,dataType:this.dataType,timeRange:Ce.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:e})}}class jo{constructor(e){u(this,"series");u(this,"index");u(this,"decoder");if(!e.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=e,this.index=0,this.decoder=new TextDecoder}next(){const e=this.index,r=this.series.data;for(;this.index<r.length&&r[this.index]!==10;)this.index++;const n=this.index;return e===n?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(e,n))})}[Symbol.iterator](){return this}}var Ic;class Ro{constructor(e){u(this,"wrapped");u(this,Ic,"JSONSeriesIterator");this.wrapped=e}next(){const e=this.wrapped.next();return e.done===!0?{done:!0,value:void 0}:{done:!1,value:JSON.parse(e.value)}}[Symbol.iterator](){return this}}Ic=Symbol.toStringTag;var kc;class Zo{constructor(e){u(this,"series");u(this,"index");u(this,kc,"SeriesIterator");this.series=e,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}}kc=Symbol.toStringTag;const $e=(t,e)=>typeof t=="bigint"&&typeof e=="bigint"||typeof t=="number"&&typeof e=="number"?t+e:e===0?t:t===0?e:Number(t)+Number(e);class $o{constructor(e){u(this,"series");if(e.length!==0){const r=e[0].dataType;for(let n=1;n<e.length;n++)if(!e[n].dataType.equals(r))throw new Error("[multi-series] - series must have the same data type")}this.series=e}as(e){if(!new k(e).equals(this.dataType))throw new Error(`cannot convert series of type ${this.dataType.toString()} to ${e.toString()}`);return this}get dataType(){return this.series.length===0?k.UNKNOWN:this.series[0].dataType}get timeRange(){return this.series.length===0?Ce.ZERO:new Ce(this.series[0].timeRange.start,this.series[this.series.length-1].timeRange.end)}push(e){this.series.push(e)}get length(){return this.series.reduce((e,r)=>e+r.length,0)}at(e,r=!1){e<0&&(e=this.length+e);for(const n of this.series){if(e<n.length)return n.at(e,r);e-=n.length}if(r)throw new Error(`[series] - no value at index ${e}`)}get byteLength(){return new Ue(this.series.reduce((e,r)=>e+r.byteLength.valueOf(),0))}get data(){const e=new this.dataType.Array(this.length);let r=0;for(const n of this.series)e.set(n.data,r),r+=n.length;return new this.dataType.Array(e)}[Symbol.iterator](){return this.series.length===0?{next(){return{done:!0,value:void 0}}}:new Lo(this.series)}}var Nc;class Lo{constructor(e){u(this,"series");u(this,"seriesIndex");u(this,"internal");u(this,Nc,"MultiSeriesIterator");this.series=e,this.seriesIndex=0,this.internal=e[0][Symbol.iterator]()}next(){const e=this.internal.next();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())}[Symbol.iterator](){return this}}Nc=Symbol.toStringTag;const Bo=d.record(d.union([d.number(),d.string(),d.symbol()]),d.unknown()),Po=t=>Object.entries(t),Uo=t=>{if(t===void 0||typeof t=="string"||typeof t=="number")return t;if(t.toString===void 0)throw new Error("invalid renderer");return t.toString()},ze=t=>t!=null&&typeof t=="object"&&!Array.isArray(t),Jn=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser",Do=Jn(),Hn=["MacOS","Windows","Linux","Docker"],Vo=d.enum(Hn);let dt;const zo=()=>{if(typeof window>"u")return;const t=window.navigator.userAgent.toLowerCase();if(t.includes("mac"))return"MacOS";if(t.includes("win"))return"Windows";if(t.includes("linux"))return"Linux"},qo=(t={})=>{const{force:e,default:r}=t;return e??dt??(dt=zo(),dt??r)},Wo=Object.freeze(Object.defineProperty({__proto__:null,OPERATING_SYSTEMS:Hn,RUNTIME:Do,detect:Jn,getOS:qo,osZ:Vo},Symbol.toStringTag,{value:"Module"})),Yo=t=>JSON.parse(JSON.stringify(t)),Ko=(t,...e)=>(e.forEach(r=>{let n=t;const s=r.split(".");s.forEach((i,a)=>{a===s.length-1?delete n[i]:n=n[i]})}),t),Xn=(t,e,r=!1)=>{const n=e.split(".");if(n.length===1&&n[0]==="")return t;let s=t;for(const i of n){const a=s[i];if(a==null){if(r)return null;throw new Error(`Path ${e} does not exist. ${i} is null`)}s=a}return s},Go=(t,e,r)=>{const n=e.split(".");let s=t;for(let i=0;i<n.length-1;i++){const a=n[i];if(s[a]==null)throw new Error(`Path ${e} does not exist`);s=s[a]}s[n[n.length-1]]=r},Fo=(t,e)=>{const r=t.split(".");return e<0?r[r.length+e]:r[e]},Jo=t=>t.join("."),Ho=(t,e)=>{try{return Xn(t,e),!0}catch{return!1}},dr=(t,...e)=>{if(e.length===0)return t;const r=e.shift();if(ze(t)&&ze(r))for(const n in r)try{ze(r[n])?(n in t||Object.assign(t,{[n]:{}}),dr(t[n],r[n])):Object.assign(t,{[n]:r[n]})}catch(s){throw s instanceof TypeError?new TypeError(`.${n}: ${s.message}`):s}return dr(t,...e)},Zt=(t,e)=>{const r=Array.isArray(t),n=Array.isArray(e);if(r!==n)return!1;if(r&&n){const a=t,o=e;if(a.length!==o.length)return!1;for(let c=0;c<a.length;c++)if(!Zt(a[c],o[c]))return!1;return!0}if(t==null||e==null||typeof t!="object"||typeof e!="object")return t===e;if("equals"in t)return t.equals(e);const s=Object.keys(t),i=Object.keys(e);if(s.length!==i.length)return!1;for(const a of s){const o=t[a],c=e[a];if(typeof o=="object"&&typeof c=="object"){if(!Zt(o,c))return!1}else if(o!==c)return!1}return!0},Qn=(t,e)=>{if(typeof t!="object"||t==null)return t===e;const r=Object.keys(t),n=Object.keys(e);if(n.length>r.length)return!1;for(const s of n){const i=t[s],a=e[s];if(typeof i=="object"&&typeof a=="object"){if(!Qn(i,a))return!1}else if(i!==a)return!1}return!0},Xo=t=>{let e,r;return(...s)=>{if(Zt(e,s))return r;const i=t(...s);return e=s,r=i,i}},Qo=(t,e,r="")=>{const n={},s=(i,a,o)=>{if(typeof i!=typeof a||i===null||a===null){n[o]=[i,a];return}if(typeof i=="object"&&typeof a=="object")if(Array.isArray(i)&&Array.isArray(a)){if(i.length!==a.length){n[o]=[i,a];return}for(let c=0;c<i.length;c++)s(i[c],a[c],`${o}[${c}]`)}else new Set([...Object.keys(i),...Object.keys(a)]).forEach(f=>{s(i[f],a[f],o?`${o}.${f}`:f)});else i!==a&&(n[o]=[i,a])};return s(t,e,r),n},ec=Object.freeze(Object.defineProperty({__proto__:null,copy:Yo,deleteD:Ko,difference:Qo,element:Fo,equal:Zt,get:Xn,has:Ho,join:Jo,memo:Xo,merge:dr,partialEqual:Qn,set:Go},Symbol.toStringTag,{value:"Module"})),tc=(t,e)=>{let r=null;return e===0?t:(...s)=>{r!==null&&(clearTimeout(r),r=null),r=setTimeout(()=>t(...s),e)}},rc=(t,e)=>{let r=null;return e===0?t:(...s)=>{r===null&&(r=setTimeout(()=>{t(...s),r=null},e))}},nc=t=>[...new Set(t)],sc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),ic=(...t)=>t.map(es).join(""),es=t=>(t.endsWith("/")||(t+="/"),t.startsWith("/")&&(t=t.slice(1)),t),ac=t=>t.endsWith("/")?t.slice(0,-1):t,oc=(t,e="")=>t===null?"":"?"+Object.entries(t).filter(([,r])=>r==null?!1:Array.isArray(r)?r.length>0:!0).map(([r,n])=>`${e}${r}=${n}`).join("&");var ve;let cc=(ve=class{constructor({host:e,port:r,protocol:n="",pathPrefix:s=""}){u(this,"protocol");u(this,"host");u(this,"port");u(this,"path");this.protocol=n,this.host=e,this.port=r,this.path=es(s)}replace(e){return new ve({host:e.host??this.host,port:e.port??this.port,protocol:e.protocol??this.protocol,pathPrefix:e.pathPrefix??this.path})}child(e){return new ve({...this,pathPrefix:ic(this.path,e)})}toString(){return ac(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}},u(ve,"UNKNOWN",new ve({host:"unknown",port:0})),ve);const uc=t=>Array.isArray(t)?t:[t],lc=t=>Array.isArray(t)?t:t===null?[]:[t],dc=(t,e,r)=>{let n=0,s=t.length-1;for(;n<=s;){const i=Math.floor((n+s)/2),a=r(t[i],e);if(a===0)return i;a<0?n=i+1:s=i-1}return-1},fc={binary:dc};class fr{constructor(e){u(this,"sender");u(this,"handlers");this.sender=e,this.handlers=new Map}handle({data:e}){var n;const r=(n=this.handlers.get(e.type))==null?void 0:n.handler;r==null?console.warn(`No handler for ${e.type}`):r(e.payload)}route(e){const r=hc(e,this.sender),n=new ts(r);return this.handlers.set(e,n),n}}const hc=(t,e)=>(r,n)=>e({type:t,payload:r},n);class ts{constructor(e){u(this,"_send");u(this,"handler");this._send=e,this.handler=null}send(e,r=[]){this._send(e,r)}handle(e){this.handler=e}}const pc=()=>{let t,e;const r=(s,i)=>{e.handle({data:s})},n=(s,i)=>{t.handle({data:s})};return t=new fr(r),e=new fr(n),[t,e]};class rs{constructor(){u(this,"contentType","application/json");u(this,"decoder");this.decoder=new TextDecoder}encode(e){const r=JSON.stringify(exports.Case.toSnake(e),(n,s)=>ArrayBuffer.isView(s)?Array.from(s):ze(s)&&"encode_value"in s?typeof s.value=="bigint"?s.value.toString():s.value:typeof s=="bigint"?s.toString():s);return new TextEncoder().encode(r)}decode(e,r){const n=exports.Case.toCamel(JSON.parse(this.decoder.decode(e)));return r!=null?r.parse(n):n}static registerCustomType(){}}const yc=[new rs],mc=Object.freeze(Object.defineProperty({__proto__:null,ENCODERS:yc,JSONEncoderDecoder:rs},Symbol.toStringTag,{value:"Module"}));class gc{constructor(e){u(this,"handlers");this.handlers=e??new Map}onChange(e){return this.handlers.set(e,null),()=>this.handlers.delete(e)}notify(e){this.handlers.forEach((r,n)=>n(e))}}const vc=Object.freeze(Object.defineProperty({__proto__:null,Observer:gc},Symbol.toStringTag,{value:"Module"})),bc=t=>d.object({variant:d.enum(["set","delete"]),key:d.string(),value:t}),wc=Object.freeze(Object.defineProperty({__proto__:null,Z:bc},Symbol.toStringTag,{value:"Module"})),xc=t=>Array.isArray(t)?[...t]:typeof t=="object"&&t!==null?{...t}:t,Oc=t=>t?-1:1,$t=d.string().regex(/^\d+\.\d+\.\d+$/),ns=(t,e)=>{const r=$t.parse(t),n=$t.parse(e),[s,i,a]=r.split(".").map(Number),[o,c,f]=n.split(".").map(Number);return s!==o?s-o:i!==c?i-c:a-f},_c=(t,e)=>qr(ns(t,e)),Tc=d.object({version:$t}),Sc=t=>{const e=Object.keys(t).sort(ns).pop()??"",r=Object.keys(t).length,n=s=>{if(r===0||_c(s.version,e))return s;const i=s.version,a=t[i],o=a(s);return n(o)};return n},Ac=Object.freeze(Object.defineProperty({__proto__:null,migratable:Tc,migrator:Sc,semVerZ:$t},Symbol.toStringTag,{value:"Module"}));exports.DataType=k;exports.Density=L;exports.MultiSeries=$o;exports.Rate=lr;exports.RoutedWorker=fr;exports.Search=fc;exports.Series=q;exports.Size=Ue;exports.TimeRange=Ce;exports.TimeSpan=Z;exports.TimeStamp=M;exports.TypedWorker=ts;exports.URL=cc;exports.addSamples=$e;exports.binary=mc;exports.bounds=Pi;exports.box=no;exports.buildQueryString=oc;exports.change=wc;exports.clamp=Wn;exports.compare=gs;exports.convertDataType=Gn;exports.convertRenderV=Uo;exports.createMockWorkers=pc;exports.debounce=tc;exports.deep=ec;exports.dimensions=yo;exports.direction=Wi;exports.getEntries=Po;exports.invert=Oc;exports.isCrudeSeries=Fn;exports.isObject=ze;exports.isStringer=hr;exports.isTelemValue=Br;exports.kv=sc;exports.location=_a;exports.migrate=Ac;exports.nullToArr=lc;exports.observe=vc;exports.position=Eo;exports.primitiveIsZero=cs;exports.runtime=Wo;exports.scale=To;exports.shallowCopy=xc;exports.spatial=Co;exports.throttle=rc;exports.toArray=uc;exports.typedArrayZ=Mo;exports.unique=nc;exports.unknownRecordZ=Bo;exports.xy=La;
|
|
12
|
-
//# sourceMappingURL=x.cjs.map
|