typetify 2.1.0 → 2.4.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.
Files changed (225) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/README.md +108 -0
  3. package/dist/async/index.js +1 -49
  4. package/dist/async/index.mjs +1 -4
  5. package/dist/chunk-272Z3AXV.js +1 -0
  6. package/dist/chunk-2YRFWQ6M.mjs +1 -0
  7. package/dist/chunk-35CB7HNN.js +1 -0
  8. package/dist/chunk-4JG7CFRK.js +1 -0
  9. package/dist/chunk-5FBZYPQM.mjs +1 -0
  10. package/dist/chunk-5XQRYI2Q.mjs +1 -0
  11. package/dist/chunk-6HA2SN23.js +1 -0
  12. package/dist/chunk-6NWIIOHH.js +1 -0
  13. package/dist/chunk-6WGRWYAD.js +1 -0
  14. package/dist/chunk-7LBL6CYT.js +1 -0
  15. package/dist/chunk-7UMXGQE4.mjs +1 -0
  16. package/dist/chunk-7XHBEA63.js +1 -0
  17. package/dist/chunk-B3R73UK5.mjs +1 -0
  18. package/dist/chunk-BLUG7TSP.js +1 -0
  19. package/dist/chunk-EAHFED6V.mjs +1 -0
  20. package/dist/chunk-EKSHS4DL.mjs +1 -0
  21. package/dist/chunk-F76ECQKE.js +1 -0
  22. package/dist/chunk-FHCBXSNA.js +1 -0
  23. package/dist/chunk-GKOA3XGQ.js +1 -0
  24. package/dist/chunk-GQIJLGEZ.mjs +1 -0
  25. package/dist/chunk-I4YSQ4HB.js +1 -0
  26. package/dist/chunk-JZXLCA2E.mjs +1 -0
  27. package/dist/chunk-M5OMYDI7.mjs +1 -0
  28. package/dist/chunk-MB77QAOC.mjs +1 -0
  29. package/dist/chunk-MPY3WRLG.mjs +1 -0
  30. package/dist/chunk-NENRAPOL.mjs +1 -0
  31. package/dist/chunk-NOW4Q26G.mjs +1 -0
  32. package/dist/chunk-P4UNM7SF.js +1 -0
  33. package/dist/chunk-P5E2JDCX.mjs +1 -0
  34. package/dist/chunk-Q7SUL7MD.js +1 -0
  35. package/dist/chunk-QKNZICUO.mjs +1 -0
  36. package/dist/chunk-RHMANSTA.mjs +1 -0
  37. package/dist/chunk-SF64HETW.js +1 -0
  38. package/dist/chunk-T66YO63J.js +1 -0
  39. package/dist/chunk-TNK6EVQK.mjs +1 -0
  40. package/dist/chunk-TSJFKV3R.js +1 -0
  41. package/dist/chunk-TVCWWECJ.mjs +1 -0
  42. package/dist/chunk-U7MK5AR5.mjs +1 -0
  43. package/dist/chunk-W5I352FJ.js +1 -0
  44. package/dist/chunk-WAT4QJB2.js +1 -0
  45. package/dist/chunk-WCG5ODRX.mjs +1 -0
  46. package/dist/chunk-WDFIRO2J.js +1 -0
  47. package/dist/chunk-WOT6VMZA.js +1 -0
  48. package/dist/chunk-WS743BFA.js +1 -0
  49. package/dist/chunk-WWU7P2L2.mjs +1 -0
  50. package/dist/chunk-XPY5CWKZ.mjs +1 -0
  51. package/dist/collection/index.d.mts +125 -1
  52. package/dist/collection/index.d.ts +125 -1
  53. package/dist/collection/index.js +1 -125
  54. package/dist/collection/index.mjs +1 -4
  55. package/dist/color/index.d.mts +274 -0
  56. package/dist/color/index.d.ts +274 -0
  57. package/dist/color/index.js +1 -0
  58. package/dist/color/index.mjs +1 -0
  59. package/dist/core/index.js +1 -41
  60. package/dist/core/index.mjs +1 -4
  61. package/dist/decorator/index.js +1 -57
  62. package/dist/decorator/index.mjs +1 -4
  63. package/dist/dom/index.d.mts +353 -0
  64. package/dist/dom/index.d.ts +353 -0
  65. package/dist/dom/index.js +1 -0
  66. package/dist/dom/index.mjs +1 -0
  67. package/dist/dx/index.js +1 -53
  68. package/dist/dx/index.mjs +1 -4
  69. package/dist/flow/index.js +1 -50
  70. package/dist/flow/index.mjs +1 -5
  71. package/dist/fn/index.js +1 -37
  72. package/dist/fn/index.mjs +1 -4
  73. package/dist/guards/index.js +1 -233
  74. package/dist/guards/index.mjs +1 -4
  75. package/dist/index.d.mts +482 -410
  76. package/dist/index.d.ts +482 -410
  77. package/dist/index.js +3 -2507
  78. package/dist/index.mjs +3 -1546
  79. package/dist/input/index.js +1 -74
  80. package/dist/input/index.mjs +1 -5
  81. package/dist/iterator/index.js +1 -85
  82. package/dist/iterator/index.mjs +1 -4
  83. package/dist/logic/index.js +1 -201
  84. package/dist/logic/index.mjs +1 -4
  85. package/dist/math/index.js +1 -45
  86. package/dist/math/index.mjs +1 -4
  87. package/dist/narrowing/index.js +1 -141
  88. package/dist/narrowing/index.mjs +1 -4
  89. package/dist/object/index.d.mts +137 -1
  90. package/dist/object/index.d.ts +137 -1
  91. package/dist/object/index.js +1 -113
  92. package/dist/object/index.mjs +1 -4
  93. package/dist/result/index.js +1 -86
  94. package/dist/result/index.mjs +1 -5
  95. package/dist/schema/index.js +1 -110
  96. package/dist/schema/index.mjs +1 -5
  97. package/dist/storage/index.d.mts +197 -0
  98. package/dist/storage/index.d.ts +197 -0
  99. package/dist/storage/index.js +1 -0
  100. package/dist/storage/index.mjs +1 -0
  101. package/dist/string/index.d.mts +201 -1
  102. package/dist/string/index.d.ts +201 -1
  103. package/dist/string/index.js +1 -49
  104. package/dist/string/index.mjs +1 -4
  105. package/dist/typed/index.js +1 -193
  106. package/dist/typed/index.mjs +1 -4
  107. package/package.json +23 -3
  108. package/dist/async/index.js.map +0 -1
  109. package/dist/async/index.mjs.map +0 -1
  110. package/dist/chunk-2LJ6NZ6K.js +0 -108
  111. package/dist/chunk-2LJ6NZ6K.js.map +0 -1
  112. package/dist/chunk-4NXETABV.mjs +0 -116
  113. package/dist/chunk-4NXETABV.mjs.map +0 -1
  114. package/dist/chunk-6ZBTL74K.js +0 -129
  115. package/dist/chunk-6ZBTL74K.js.map +0 -1
  116. package/dist/chunk-7G4ZSMQX.js +0 -470
  117. package/dist/chunk-7G4ZSMQX.js.map +0 -1
  118. package/dist/chunk-CN3GYRJN.mjs +0 -137
  119. package/dist/chunk-CN3GYRJN.mjs.map +0 -1
  120. package/dist/chunk-CNTE6ZVH.js +0 -359
  121. package/dist/chunk-CNTE6ZVH.js.map +0 -1
  122. package/dist/chunk-CWHYQWNU.mjs +0 -224
  123. package/dist/chunk-CWHYQWNU.mjs.map +0 -1
  124. package/dist/chunk-DBENOSTA.js +0 -156
  125. package/dist/chunk-DBENOSTA.js.map +0 -1
  126. package/dist/chunk-DWIG5GF2.js +0 -135
  127. package/dist/chunk-DWIG5GF2.js.map +0 -1
  128. package/dist/chunk-EAUTTWTQ.mjs +0 -231
  129. package/dist/chunk-EAUTTWTQ.mjs.map +0 -1
  130. package/dist/chunk-FEX5C4OH.mjs +0 -1007
  131. package/dist/chunk-FEX5C4OH.mjs.map +0 -1
  132. package/dist/chunk-FN553YPU.js +0 -441
  133. package/dist/chunk-FN553YPU.js.map +0 -1
  134. package/dist/chunk-FT2EK4AM.mjs +0 -420
  135. package/dist/chunk-FT2EK4AM.mjs.map +0 -1
  136. package/dist/chunk-FXWYPHA3.mjs +0 -13
  137. package/dist/chunk-FXWYPHA3.mjs.map +0 -1
  138. package/dist/chunk-GS3PP67B.js +0 -200
  139. package/dist/chunk-GS3PP67B.js.map +0 -1
  140. package/dist/chunk-IGA3VEZM.mjs +0 -503
  141. package/dist/chunk-IGA3VEZM.mjs.map +0 -1
  142. package/dist/chunk-J5LGTIGS.mjs +0 -9
  143. package/dist/chunk-J5LGTIGS.mjs.map +0 -1
  144. package/dist/chunk-JB6UXRKD.mjs +0 -97
  145. package/dist/chunk-JB6UXRKD.mjs.map +0 -1
  146. package/dist/chunk-JQAQV75V.js +0 -561
  147. package/dist/chunk-JQAQV75V.js.map +0 -1
  148. package/dist/chunk-JQHUBZ4M.js +0 -88
  149. package/dist/chunk-JQHUBZ4M.js.map +0 -1
  150. package/dist/chunk-LT7JK7RJ.js +0 -87
  151. package/dist/chunk-LT7JK7RJ.js.map +0 -1
  152. package/dist/chunk-N6IUADIP.mjs +0 -414
  153. package/dist/chunk-N6IUADIP.mjs.map +0 -1
  154. package/dist/chunk-OEJK37LO.mjs +0 -328
  155. package/dist/chunk-OEJK37LO.mjs.map +0 -1
  156. package/dist/chunk-OKB3MS5F.js +0 -547
  157. package/dist/chunk-OKB3MS5F.js.map +0 -1
  158. package/dist/chunk-OPVES6W2.js +0 -16
  159. package/dist/chunk-OPVES6W2.js.map +0 -1
  160. package/dist/chunk-OWNUKWXV.js +0 -291
  161. package/dist/chunk-OWNUKWXV.js.map +0 -1
  162. package/dist/chunk-POD52NJ3.mjs +0 -526
  163. package/dist/chunk-POD52NJ3.mjs.map +0 -1
  164. package/dist/chunk-PQTXSQ4P.js +0 -369
  165. package/dist/chunk-PQTXSQ4P.js.map +0 -1
  166. package/dist/chunk-PZ5AY32C.js +0 -11
  167. package/dist/chunk-PZ5AY32C.js.map +0 -1
  168. package/dist/chunk-QFR7DVAJ.mjs +0 -63
  169. package/dist/chunk-QFR7DVAJ.mjs.map +0 -1
  170. package/dist/chunk-S535LAXW.js +0 -1054
  171. package/dist/chunk-S535LAXW.js.map +0 -1
  172. package/dist/chunk-SGQNLTRK.js +0 -73
  173. package/dist/chunk-SGQNLTRK.js.map +0 -1
  174. package/dist/chunk-SRDWUHDY.mjs +0 -188
  175. package/dist/chunk-SRDWUHDY.mjs.map +0 -1
  176. package/dist/chunk-TXU7NTT4.js +0 -249
  177. package/dist/chunk-TXU7NTT4.js.map +0 -1
  178. package/dist/chunk-TZEWREAC.mjs +0 -277
  179. package/dist/chunk-TZEWREAC.mjs.map +0 -1
  180. package/dist/chunk-V6CWFDIJ.mjs +0 -123
  181. package/dist/chunk-V6CWFDIJ.mjs.map +0 -1
  182. package/dist/chunk-X55EORNF.js +0 -259
  183. package/dist/chunk-X55EORNF.js.map +0 -1
  184. package/dist/chunk-YBJC5WMX.mjs +0 -341
  185. package/dist/chunk-YBJC5WMX.mjs.map +0 -1
  186. package/dist/chunk-YOPAXITF.mjs +0 -75
  187. package/dist/chunk-YOPAXITF.mjs.map +0 -1
  188. package/dist/chunk-ZE4FDBRI.mjs +0 -79
  189. package/dist/chunk-ZE4FDBRI.mjs.map +0 -1
  190. package/dist/collection/index.js.map +0 -1
  191. package/dist/collection/index.mjs.map +0 -1
  192. package/dist/core/index.js.map +0 -1
  193. package/dist/core/index.mjs.map +0 -1
  194. package/dist/decorator/index.js.map +0 -1
  195. package/dist/decorator/index.mjs.map +0 -1
  196. package/dist/dx/index.js.map +0 -1
  197. package/dist/dx/index.mjs.map +0 -1
  198. package/dist/flow/index.js.map +0 -1
  199. package/dist/flow/index.mjs.map +0 -1
  200. package/dist/fn/index.js.map +0 -1
  201. package/dist/fn/index.mjs.map +0 -1
  202. package/dist/guards/index.js.map +0 -1
  203. package/dist/guards/index.mjs.map +0 -1
  204. package/dist/index.js.map +0 -1
  205. package/dist/index.mjs.map +0 -1
  206. package/dist/input/index.js.map +0 -1
  207. package/dist/input/index.mjs.map +0 -1
  208. package/dist/iterator/index.js.map +0 -1
  209. package/dist/iterator/index.mjs.map +0 -1
  210. package/dist/logic/index.js.map +0 -1
  211. package/dist/logic/index.mjs.map +0 -1
  212. package/dist/math/index.js.map +0 -1
  213. package/dist/math/index.mjs.map +0 -1
  214. package/dist/narrowing/index.js.map +0 -1
  215. package/dist/narrowing/index.mjs.map +0 -1
  216. package/dist/object/index.js.map +0 -1
  217. package/dist/object/index.mjs.map +0 -1
  218. package/dist/result/index.js.map +0 -1
  219. package/dist/result/index.mjs.map +0 -1
  220. package/dist/schema/index.js.map +0 -1
  221. package/dist/schema/index.mjs.map +0 -1
  222. package/dist/string/index.js.map +0 -1
  223. package/dist/string/index.mjs.map +0 -1
  224. package/dist/typed/index.js.map +0 -1
  225. package/dist/typed/index.mjs.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,131 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [2.4.0] - 2026-02-07
9
+
10
+ ### Added
11
+ - **DOM Module** (Frontend Focus): 23 functions for type-safe DOM manipulation
12
+ - `querySelector`, `querySelectorAll` - Type-safe element selection
13
+ - `classNames`, `addClass`, `removeClass`, `toggleClass`, `hasClass` - Class management
14
+ - `addEventListener`, `once`, `delegate` - Event handling with cleanup
15
+ - `isInViewport`, `getRect`, `scrollIntoView`, `scrollTo`, `getScrollPosition` - Viewport utilities
16
+ - `setStyle`, `setStyles`, `getComputedStyleValue`, `show`, `hide`, `toggle` - Style manipulation
17
+
18
+ - **Storage Module** (Frontend Focus): 9 functions for type-safe storage
19
+ - `createStorage`, `localStorageTyped`, `sessionStorageTyped` - Type-safe storage wrappers
20
+ - `withExpiry` - Storage with automatic expiration
21
+ - `createMemoryStorage` - In-memory storage for SSR/testing
22
+ - `getCookie`, `setCookie`, `removeCookie`, `hasCookie` - Cookie management
23
+
24
+ - **Color Module** (Frontend Focus): 22 functions for color manipulation
25
+ - `hexToRgb`, `rgbToHex`, `rgbToHsl`, `hslToRgb` - Color format conversion
26
+ - `parseColor`, `formatRgb`, `formatHsl` - Color parsing and formatting
27
+ - `lighten`, `darken`, `saturate`, `desaturate`, `opacity`, `mix` - Color manipulation
28
+ - `invert`, `grayscale` - Color transformations
29
+ - `luminance`, `contrast`, `isLight`, `isDark`, `getContrastColor` - Color analysis
30
+ - `isSimilar`, `getDominant`, `getTemperature` - Advanced color utilities
31
+
32
+ ### Changed
33
+ - Added DOM, Storage, and Color modules to namespace `_`
34
+ - Updated documentation with all new frontend-focused utilities
35
+ - Renamed `invert` from color module to `invertColor` to avoid conflict with object module
36
+
37
+ ## [2.3.0] - 2026-02-07
38
+
39
+ ### Added
40
+ - **Collection**: 4 new functions
41
+ - `reject` - Returns elements that do NOT match the predicate (opposite of filter)
42
+ - `size` - Returns the size of any collection (array, object, string, Map, Set)
43
+ - `keyBy` - Creates an object indexed by a key function
44
+ - `sampleSize` - Returns N random elements from an array
45
+
46
+ - **String**: 7 new functions
47
+ - `deburr` - Removes diacritical marks (accents) from strings
48
+ - `escape` - Escapes HTML special characters to prevent XSS
49
+ - `unescape` - Converts HTML entities back to characters
50
+ - `escapeRegExp` - Escapes special RegExp characters
51
+ - `pad` - Pads a string on both sides
52
+ - `padStart` - Pads a string on the left
53
+ - `padEnd` - Pads a string on the right
54
+
55
+ - **Object**: 4 new functions
56
+ - `findKey` - Finds the first key where predicate returns true
57
+ - `findLastKey` - Finds the last key where predicate returns true
58
+ - `at` - Gets values at multiple paths from an object
59
+ - `invertBy` - Inverts object keys/values with grouping
60
+
61
+ ### Changed
62
+ - Updated documentation with all new functions and examples
63
+
64
+ ## [2.2.0] - 2026-02-07
65
+
66
+ ### Changed
67
+ - Version bump for documentation updates
68
+
69
+ ## [2.1.0] - 2026-02-07
70
+
71
+ ### Added
72
+ - **Namespace Export Fix**: All categories now properly exported in `_` namespace
73
+ - Added `logic` module (28 functions: `when`, `unless`, `ifElse`, `cond`, etc.)
74
+ - Added `iterator` module (24 functions: `lazyRange`, `lazyMap`, `lazyFilter`, etc.)
75
+ - Added `narrowing` module (34 functions: `filterDefined`, `assertType`, `refine`, etc.)
76
+ - Added `schema` module (27 functions: `string`, `number`, `parse`, `validate`, etc.)
77
+ - Added `array` module (49 functions: `unionWith`, `without`, `union`, etc.)
78
+
79
+ ### Fixed
80
+ - Fixed `_.unionWith is not a function` error
81
+ - Fixed missing Array category functions in namespace
82
+ - Fixed TypeScript unique symbol export limitations for `typed` module
83
+
84
+ ### Changed
85
+ - Optimized bundle: enabled minification, removed sourcemaps
86
+ - Improved README with comparison table, real-world examples, and migration guide
87
+
88
+ ## [2.0.0] - 2026-02-06
89
+
90
+ ### Added
91
+ - 15 new utility modules across 9 new categories:
92
+ - **Reactive**: `signal`, `computed`, `effect`, `batch`, `createUndoableState`
93
+ - **Cache**: `smartCache`, `memoize`
94
+ - **Event**: `createEventBus`, `createTypedEmitter`
95
+ - **Pipeline**: `pipe`, `pipeAsync`, `flow`, `createMiddleware`, `compose`
96
+ - **DI**: `createContainer`, `createTypedContainer`
97
+ - **Env**: `env`, `createEnv`
98
+ - **Router**: `route`, `createRouter`
99
+ - **Form**: `createForm`, `field`
100
+ - **Feature**: `createFeatureFlags`, `flag`
101
+
102
+ ### Changed
103
+ - Updated documentation with all new categories
104
+ - Enhanced homepage example with type-safe event bus showcase
105
+
106
+ ## [1.0.0] - 2026-02-04
107
+
108
+ ### Added
109
+ - Initial public release
110
+ - 18 utility modules:
111
+ - **Core**: `isDefined`, `isNil`, `assert`, `assertDefined`, `fail`, `noop`, `identity`, `unreachable`
112
+ - **Guards**: `isObject`, `isString`, `isNumber`, `hasKey`, `hasKeys`, `isEmpty`, and 50+ type guards
113
+ - **Object**: `pick`, `omit`, `keysTyped`, `mapObject`, `get`, `set`, `merge`, `clone`
114
+ - **Async**: `awaitTo`, `retry`, `sleep`, `withTimeout`, `debounce`, `throttle`, `parallel`
115
+ - **Collection**: `unique`, `groupBy`, `partition`, `chunk`, `compact`, `sortBy`, `range`
116
+ - **Input**: `safeJsonParse`, `parseNumber`, `parseBoolean`, `parseDate`, `coerceArray`, `defaults`
117
+ - **Flow**: `pipe`, `tap`, `when`, `match`, `tryCatch`, `ifElse`
118
+ - **DX**: `debug`, `invariant`, `assertNever`, `todo`, `measure`
119
+ - **Typed**: `defineConst`, `defineEnum`, `brand`, `narrow`, `model`, `v`
120
+ - **String**: `capitalize`, `camelCase`, `kebabCase`, `snakeCase`, `truncate`
121
+ - **Fn**: `partial`, `curry`, `once`, `memoize`, `negate`
122
+ - **Math**: `clamp`, `round`, `sum`, `average`, `random`
123
+ - **Result**: `ok`, `err`, `Result`, `fromPromise`, `map`, `flatMap`
124
+ - **Iterator**: `createIterator`, `lazyRange`, `lazyMap`, `lazyFilter`
125
+ - **Decorator**: `memoize`, `debounce`, `throttle`, `log`, `deprecated`
126
+ - **Logic**: `when`, `unless`, `cond`, `match`, `coalesce`, `defaultTo`
127
+ - **Narrowing**: `filterDefined`, `assertType`, `refine`, `narrow`
128
+ - **Schema**: `string`, `number`, `object`, `array`, `parse`, `validate`
129
+ - Complete TypeScript support with full type inference
130
+ - Zero dependencies
131
+ - Tree-shakable ESM and CJS builds
package/README.md CHANGED
@@ -52,12 +52,38 @@ Boring, predictable API. No config, no setup, just functions that work.
52
52
  </tr>
53
53
  </table>
54
54
 
55
+ ## Why Typetify?
56
+
57
+ | Feature | Lodash | Ramda | Typetify |
58
+ |---------|--------|-------|----------|
59
+ | TypeScript-first | ❌ | ❌ | ✅ |
60
+ | Runtime safety | ❌ | ❌ | ✅ |
61
+ | Type narrowing | ❌ | ❌ | ✅ |
62
+ | Zero dependencies | ❌ | ✅ | ✅ |
63
+ | Tree-shakable | ⚠️ | ✅ | ✅ |
64
+ | Bundle size | 72KB | 51KB | **~15KB** |
65
+ | Modern syntax | ❌ | ⚠️ | ✅ |
66
+
55
67
  ## Installation
56
68
 
57
69
  ```bash
70
+ # npm
58
71
  npm install typetify
72
+
73
+ # pnpm (faster)
74
+ pnpm add typetify
75
+
76
+ # yarn
77
+ yarn add typetify
78
+
79
+ # bun (fastest)
80
+ bun add typetify
59
81
  ```
60
82
 
83
+ **Requirements:**
84
+ - Node.js >= 18
85
+ - TypeScript >= 5.0 (recommended)
86
+
61
87
  ## Quick Start
62
88
 
63
89
  ```typescript
@@ -88,6 +114,29 @@ if (result.ok) {
88
114
  }
89
115
  ```
90
116
 
117
+ ## Migrating from Lodash
118
+
119
+ Typetify is designed to be a drop-in replacement for common Lodash patterns:
120
+
121
+ | Lodash | Typetify | Benefit |
122
+ |--------|----------|--------|
123
+ | `_.isNil(x)` | `isNil(x)` | Same API, better types |
124
+ | `_.pick(obj, keys)` | `pick(obj, keys)` | Type-safe keys |
125
+ | `_.omit(obj, keys)` | `omit(obj, keys)` | Type-safe keys |
126
+ | `_.uniq(arr)` | `unique(arr)` | Same behavior |
127
+ | `_.groupBy(arr, fn)` | `groupBy(arr, fn)` | Better inference |
128
+ | `_.chunk(arr, n)` | `chunk(arr, n)` | Same API |
129
+ | `_.debounce(fn, ms)` | `debounce(fn, ms)` | Simpler API |
130
+
131
+ **Bonus:** Use the `_` namespace to avoid migration conflicts:
132
+
133
+ ```typescript
134
+ import { _ } from 'typetify'
135
+
136
+ // Works exactly like Lodash
137
+ const result = _.pick(user, ['id', 'name'])
138
+ ```
139
+
91
140
  ### Using Underscore `_` (Lodash-style)
92
141
 
93
142
  If you have naming conflicts with existing functions, use the underscore `_` namespace:
@@ -353,6 +402,65 @@ type PartialUser = DeepPartial<User>
353
402
  type MergedConfig = Merge<DefaultConfig, UserConfig>
354
403
  ```
355
404
 
405
+ ## Real-World Examples
406
+
407
+ ### API Response Validation
408
+
409
+ ```typescript
410
+ import { hasKeys, isDefined, awaitTo } from 'typetify'
411
+
412
+ async function fetchUser(id: string) {
413
+ const [error, response] = await awaitTo(fetch(`/api/users/${id}`))
414
+ if (error) return { error: 'Network error' }
415
+
416
+ const data = await response.json()
417
+
418
+ // Runtime validation
419
+ if (!hasKeys(data, ['id', 'name', 'email'])) {
420
+ return { error: 'Invalid response format' }
421
+ }
422
+
423
+ return { data }
424
+ }
425
+ ```
426
+
427
+ ### Form Data Processing
428
+
429
+ ```typescript
430
+ import { parseNumber, parseBoolean, compact, defaults } from 'typetify'
431
+
432
+ function processFormData(formData: FormData) {
433
+ return {
434
+ age: parseNumber(formData.get('age')),
435
+ newsletter: parseBoolean(formData.get('newsletter')),
436
+ tags: compact(formData.getAll('tags')),
437
+ bio: defaults(formData.get('bio'), 'No bio provided'),
438
+ }
439
+ }
440
+ ```
441
+
442
+ ### Safe Error Handling
443
+
444
+ ```typescript
445
+ import { awaitTo, retry, withTimeout } from 'typetify'
446
+
447
+ async function fetchWithRetry(url: string) {
448
+ const [error, data] = await awaitTo(
449
+ retry(
450
+ () => withTimeout(fetch(url), 5000),
451
+ { attempts: 3, delay: 1000 }
452
+ )
453
+ )
454
+
455
+ if (error) {
456
+ console.error('Failed after retries:', error)
457
+ return null
458
+ }
459
+
460
+ return data
461
+ }
462
+ ```
463
+
356
464
  ## Tree Shaking
357
465
 
358
466
  Import only what you need:
@@ -1,49 +1 @@
1
- 'use strict';
2
-
3
- var chunkGS3PP67B_js = require('../chunk-GS3PP67B.js');
4
- require('../chunk-PZ5AY32C.js');
5
-
6
-
7
-
8
- Object.defineProperty(exports, "awaitTo", {
9
- enumerable: true,
10
- get: function () { return chunkGS3PP67B_js.awaitTo; }
11
- });
12
- Object.defineProperty(exports, "debounce", {
13
- enumerable: true,
14
- get: function () { return chunkGS3PP67B_js.debounce; }
15
- });
16
- Object.defineProperty(exports, "defer", {
17
- enumerable: true,
18
- get: function () { return chunkGS3PP67B_js.defer; }
19
- });
20
- Object.defineProperty(exports, "once", {
21
- enumerable: true,
22
- get: function () { return chunkGS3PP67B_js.once; }
23
- });
24
- Object.defineProperty(exports, "onceAsync", {
25
- enumerable: true,
26
- get: function () { return chunkGS3PP67B_js.onceAsync; }
27
- });
28
- Object.defineProperty(exports, "parallel", {
29
- enumerable: true,
30
- get: function () { return chunkGS3PP67B_js.parallel; }
31
- });
32
- Object.defineProperty(exports, "retry", {
33
- enumerable: true,
34
- get: function () { return chunkGS3PP67B_js.retry; }
35
- });
36
- Object.defineProperty(exports, "sleep", {
37
- enumerable: true,
38
- get: function () { return chunkGS3PP67B_js.sleep; }
39
- });
40
- Object.defineProperty(exports, "throttle", {
41
- enumerable: true,
42
- get: function () { return chunkGS3PP67B_js.throttle; }
43
- });
44
- Object.defineProperty(exports, "withTimeout", {
45
- enumerable: true,
46
- get: function () { return chunkGS3PP67B_js.withTimeout; }
47
- });
48
- //# sourceMappingURL=index.js.map
49
- //# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkWAT4QJB2_js=require('../chunk-WAT4QJB2.js');require('../chunk-WOT6VMZA.js');Object.defineProperty(exports,"awaitTo",{enumerable:true,get:function(){return chunkWAT4QJB2_js.a}});Object.defineProperty(exports,"debounce",{enumerable:true,get:function(){return chunkWAT4QJB2_js.e}});Object.defineProperty(exports,"defer",{enumerable:true,get:function(){return chunkWAT4QJB2_js.i}});Object.defineProperty(exports,"once",{enumerable:true,get:function(){return chunkWAT4QJB2_js.g}});Object.defineProperty(exports,"onceAsync",{enumerable:true,get:function(){return chunkWAT4QJB2_js.h}});Object.defineProperty(exports,"parallel",{enumerable:true,get:function(){return chunkWAT4QJB2_js.j}});Object.defineProperty(exports,"retry",{enumerable:true,get:function(){return chunkWAT4QJB2_js.d}});Object.defineProperty(exports,"sleep",{enumerable:true,get:function(){return chunkWAT4QJB2_js.b}});Object.defineProperty(exports,"throttle",{enumerable:true,get:function(){return chunkWAT4QJB2_js.f}});Object.defineProperty(exports,"withTimeout",{enumerable:true,get:function(){return chunkWAT4QJB2_js.c}});
@@ -1,4 +1 @@
1
- export { awaitTo, debounce, defer, once, onceAsync, parallel, retry, sleep, throttle, withTimeout } from '../chunk-SRDWUHDY.mjs';
2
- import '../chunk-J5LGTIGS.mjs';
3
- //# sourceMappingURL=index.mjs.map
4
- //# sourceMappingURL=index.mjs.map
1
+ export{a as awaitTo,e as debounce,i as defer,g as once,h as onceAsync,j as parallel,d as retry,b as sleep,f as throttle,c as withTimeout}from'../chunk-QKNZICUO.mjs';import'../chunk-JZXLCA2E.mjs';
@@ -0,0 +1 @@
1
+ 'use strict';var chunkP4UNM7SF_js=require('./chunk-P4UNM7SF.js'),chunkWOT6VMZA_js=require('./chunk-WOT6VMZA.js');var x={};chunkWOT6VMZA_js.a(x,{compose:()=>c,constant:()=>B,ifElse:()=>C,match:()=>s,pipe:()=>p,tap:()=>a,tryCatch:()=>l,tryCatchAsync:()=>A,unless:()=>T,when:()=>i});function p(r,...n){return n.reduce((e,t)=>t(e),r)}function c(...r){return n=>r.reduceRight((e,t)=>t(e),n)}function a(r){return n=>(r(n),n)}function i(r,n){return e=>r(e)?n(e):e}function T(r,n){return e=>r(e)?e:n(e)}function s(){let r=[],n={with(e,t){return r.push({when:e,then:t}),n},otherwise(e){return t=>{for(let u of r)if(u.when(t))return u.then(t);return e(t)}},run(e){for(let t of r)if(t.when(e))return t.then(e)}};return n}function l(r){try{return chunkP4UNM7SF_js.a(r())}catch(n){return chunkP4UNM7SF_js.b(n instanceof Error?n:new Error(String(n)))}}async function A(r){try{let n=await r();return chunkP4UNM7SF_js.a(n)}catch(n){return chunkP4UNM7SF_js.b(n instanceof Error?n:new Error(String(n)))}}function C(r,n,e){return t=>r(t)?n(t):e(t)}function B(r){return ()=>r}exports.a=p;exports.b=c;exports.c=a;exports.d=i;exports.e=T;exports.f=s;exports.g=l;exports.h=A;exports.i=C;exports.j=B;exports.k=x;
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-JZXLCA2E.mjs';var U={};a$1(U,{camelCase:()=>g,capitalize:()=>p,deburr:()=>d,escape:()=>z,escapeRegExp:()=>L,kebabCase:()=>c,pad:()=>T,padEnd:()=>$,padStart:()=>_,pascalCase:()=>l,slugify:()=>x,snakeCase:()=>u,template:()=>m,truncate:()=>f,uncapitalize:()=>s,unescape:()=>b,words:()=>C});function p(e){return e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1)}function s(e){return e.length===0?"":e.charAt(0).toLowerCase()+e.slice(1)}function g(e){return e.replace(/[-_\s]+(.)?/g,(r,t)=>t?t.toUpperCase():"").replace(/^[A-Z]/,r=>r.toLowerCase())}function c(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function u(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase()}function l(e){return e.replace(/[-_\s]+(.)?/g,(r,t)=>t?t.toUpperCase():"").replace(/^[a-z]/,r=>r.toUpperCase())}function f(e,r,t="..."){return e.length<=r?e:e.slice(0,r)+t}function x(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/[\s_]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function m(e,r){return e.replace(/\{\{(\w+)\}\}/g,(t,n)=>n in r?String(r[n]):`{{${n}}}`)}function C(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim().split(/\s+/).filter(Boolean)}function d(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function z(e){let r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return e.replace(/[&<>"']/g,t=>r[t]??t)}function b(e){let r={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#x27;":"'","&#x2F;":"/"};return e.replace(/&(?:amp|lt|gt|quot|#39|#x27|#x2F);/g,t=>r[t]??t)}function L(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function T(e,r,t=" "){let n=e.length;if(n>=r||t.length===0)return e;let i=r-n,o=Math.floor(i/2),w=i-o;return a(t,o)+e+a(t,w)}function _(e,r,t=" "){let n=e.length;return n>=r||t.length===0?e:a(t,r-n)+e}function $(e,r,t=" "){let n=e.length;return n>=r||t.length===0?e:e+a(t,r-n)}function a(e,r){if(r<=0)return "";let t=Math.ceil(r/e.length);return e.repeat(t).slice(0,r)}export{p as a,s as b,g as c,c as d,u as e,l as f,f as g,x as h,m as i,C as j,d as k,z as l,b as m,L as n,T as o,_ as p,$ as q,U as r};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkWOT6VMZA_js=require('./chunk-WOT6VMZA.js');var R={};chunkWOT6VMZA_js.a(R,{addClass:()=>g,addEventListener:()=>v,classNames:()=>s,delegate:()=>w,getComputedStyleValue:()=>u,getComputedStyles:()=>C,getRect:()=>L,getScrollPosition:()=>h,hasClass:()=>E,hide:()=>d,isInViewport:()=>x,once:()=>y,querySelector:()=>a,querySelectorAll:()=>f,removeClass:()=>p,scrollIntoView:()=>T,scrollTo:()=>S,setStyle:()=>H,setStyles:()=>M,show:()=>c,toggle:()=>b,toggleClass:()=>m});function a(e,t=document){return t.querySelector(e)}function f(e,t=document){return Array.from(t.querySelectorAll(e))}function s(...e){let t=[];for(let n of e)if(n){if(typeof n=="string"||typeof n=="number")t.push(String(n));else if(Array.isArray(n)){let o=s(...n);o&&t.push(o);}else if(typeof n=="object")for(let[o,r]of Object.entries(n))r&&t.push(o);}return t.join(" ")}function g(e,...t){e&&e.classList.add(...t);}function p(e,...t){e&&e.classList.remove(...t);}function m(e,t,n){return e?e.classList.toggle(t,n):false}function E(e,t){return e?e.classList.contains(t):false}function v(e,t,n,o){return e?(e.addEventListener(t,n,o),()=>{e.removeEventListener(t,n,o);}):()=>{}}function y(e,t,n){if(!e)return ()=>{};let o=r=>{n(r),e.removeEventListener(t,o);};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o);}}function w(e,t,n,o){let r=l=>{let i=l.target.closest(t);i&&e.contains(i)&&o(l,i);};return e.addEventListener(n,r),()=>{e.removeEventListener(n,r);}}function x(e,t=0){if(!e)return false;let n=e.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth,l=n.top<=o&&n.top+n.height*t>=0,i=n.left<=r&&n.left+n.width*t>=0;return l&&i}function L(e){return e?e.getBoundingClientRect():null}function T(e,t="start",n="smooth"){e&&e.scrollIntoView({behavior:n,block:t});}function S(e,t,n="smooth"){window.scrollTo({left:e,top:t,behavior:n});}function h(){return {x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}}function H(e,t,n){e&&e.style.setProperty(t,n);}function M(e,t){e&&Object.entries(t).forEach(([n,o])=>{o!==void 0&&e.style.setProperty(n,String(o));});}function u(e,t){return e?window.getComputedStyle(e).getPropertyValue(t):""}function C(e,t){if(!e)return {};let n=window.getComputedStyle(e),o={};return t.forEach(r=>{o[r]=n.getPropertyValue(r);}),o}function c(e,t="block"){e&&(e.style.display=t);}function d(e){e&&(e.style.display="none");}function b(e,t){if(!e)return;let n=e.style.display==="none"||u(e,"display")==="none";(t!==void 0?t:n)?c(e):d(e);}exports.a=a;exports.b=f;exports.c=s;exports.d=g;exports.e=p;exports.f=m;exports.g=E;exports.h=v;exports.i=y;exports.j=w;exports.k=x;exports.l=L;exports.m=T;exports.n=S;exports.o=h;exports.p=H;exports.q=M;exports.r=u;exports.s=C;exports.t=c;exports.u=d;exports.v=b;exports.w=R;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkWOT6VMZA_js=require('./chunk-WOT6VMZA.js');var x={};chunkWOT6VMZA_js.a(x,{ary:()=>c,curry:()=>p,flip:()=>s,memoize:()=>y,negate:()=>T,partial:()=>i,unary:()=>f});function y(n,e){let r=new Map;return function(...t){let o=e?e(...t):t[0];if(r.has(o))return r.get(o);let u=n.apply(this,t);return r.set(o,u),u}}function T(n){return function(...e){return !n(...e)}}function s(n){return function(e,r){return n(r,e)}}function i(n,...e){return function(...r){return n(...e,...r)}}function p(n){let e=n.length;function r(...a){return a.length>=e?n(...a):(...t)=>r(...a,...t)}return r}function c(n,e){return function(...r){return n(...r.slice(0,e))}}function f(n){return function(e){return n(e)}}exports.a=y;exports.b=T;exports.c=s;exports.d=i;exports.e=p;exports.f=c;exports.g=f;exports.h=x;
@@ -0,0 +1 @@
1
+ function t(r){return {ok:true,value:r}}function o(r){return {ok:false,error:r}}export{t as a,o as b};
@@ -0,0 +1 @@
1
+ import {a as a$2,b}from'./chunk-5FBZYPQM.mjs';import {a as a$1}from'./chunk-JZXLCA2E.mjs';var U={};a$1(U,{andThen:()=>f,err:()=>b,fromNullable:()=>c,isErr:()=>E,isOk:()=>a,mapErr:()=>i,mapOption:()=>m,mapResult:()=>u,matchOption:()=>s,matchResult:()=>T,none:()=>p,ok:()=>a$2,orElse:()=>l,some:()=>o,toNullable:()=>k,unwrap:()=>x,unwrapOption:()=>O,unwrapOptionOr:()=>R,unwrapOr:()=>y});function o(r){return {some:true,value:r}}function p(){return {some:false}}function u(r,e){return r.ok?a$2(e(r.value)):r}function m(r,e){return r.some?o(e(r.value)):r}function i(r,e){return r.ok?r:b(e(r.error))}function f(r,e){return r.ok?e(r.value):r}function l(r,e){return r.ok?r:e(r.error)}function T(r,e){return r.ok?e.ok(r.value):e.err(r.error)}function s(r,e){return r.some?e.some(r.value):e.none()}function a(r){return r.ok}function E(r){return !r.ok}function x(r){if(r.ok)return r.value;throw r.error instanceof Error?r.error:new Error(String(r.error))}function O(r){if(r.some)return r.value;throw new Error("Called unwrapOption on None")}function y(r,e){return r.ok?r.value:e}function R(r,e){return r.some?r.value:e}function c(r){return r==null?p():o(r)}function k(r){return r.some?r.value:null}export{o as a,p as b,u as c,m as d,i as e,f,l as g,T as h,s as i,a as j,E as k,x as l,O as m,y as n,R as o,c as p,k as q,U as r};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkWOT6VMZA_js=require('./chunk-WOT6VMZA.js');var a={};chunkWOT6VMZA_js.a(a,{assert:()=>t,assertDefined:()=>i,fail:()=>f,identity:()=>u,isDefined:()=>r,isNil:()=>o,noop:()=>s,unreachable:()=>d});function r(e){return e!=null}function o(e){return e==null}function t(e,n="Assertion failed"){if(!e)throw new Error(n)}function i(e,n="Value is not defined"){if(e==null)throw new Error(n)}function f(e){throw new Error(e)}function s(){}function u(e){return e}function d(e,n){throw new Error(n??`Unreachable code reached with value: ${JSON.stringify(e)}`)}exports.a=r;exports.b=o;exports.c=t;exports.d=i;exports.e=f;exports.f=s;exports.g=u;exports.h=d;exports.i=a;
@@ -0,0 +1 @@
1
+ 'use strict';function b(e){return Object.freeze(e)}function K(e){let t={};for(let n of e)t[n]=n;return Object.freeze(t)}function h(...e){return e}function w(e){return new Map(e)}function S(e){return new Set(e)}function v(e){return e}function R(e,t){return t(e)?e:void 0}function x(e={}){return {set(t,n){return x({...e,[t]:n})},build(){return e},current(){return e}}}function E(e){return {config:e,getInitialState:()=>e.initial,transition:(t,n)=>{let r=e.states[t];return r&&"on"in r?r.on[n]??t:t}}}function M(){return new Proxy({},{get:(e,t)=>n=>({type:t,...n})})}function V(){let e=new Map;return {on(t,n){return e.has(t)||e.set(t,new Set),e.get(t).add(n),()=>{e.get(t)?.delete(n);}},emit(t,n){e.get(t)?.forEach(r=>r(n));},off(t,n){e.get(t)?.delete(n);},clear(){e.clear();}}}function _(e,t){return {initialState:e,reduce:(n,r)=>{let o=t[r.type];return o?o(n,r):n}}}var A=Symbol("string"),U=Symbol("number"),O=Symbol("boolean"),I=Symbol("date"),D=Symbol("bigint"),B=Symbol("symbol"),P=Symbol("any"),j=Symbol("unknown"),N=Symbol("null"),C=Symbol("undefined"),q={string:{[A]:true},number:{[U]:true},boolean:{[O]:true},date:{[I]:true},bigint:{[D]:true},symbol:{[B]:true},any:{[P]:true},unknown:{[j]:true},null:{[N]:true},undefined:{[C]:true},array:e=>({__array:e}),optional:e=>({__optional:e}),nullable:e=>({__nullable:e}),literal:e=>({__literal:e}),enum:(...e)=>({__enum:e}),union:(...e)=>({__union:e}),record:e=>({__record:e}),tuple:(...e)=>({__tuple:e}),ref:()=>({__ref:null})};function d(e){return {__schema:null,__definition:e,create(n){return n},partial(n){return n},is(n){if(typeof n!="object"||n===null)return false;for(let r of Object.keys(e))if(!(r in n)){let o=e[r];if(o&&typeof o=="object"&&"__optional"in o)continue;return false}return true},extend(n){return d({...e,...n})},pick(...n){let r={};for(let o of n)r[o]=e[o];return d(r)},omit(...n){let r={...e};for(let o of n)delete r[o];return d(r)},asPartial(){let n={};for(let r of Object.keys(e))n[r]={__optional:e[r]};return d(n)},asRequired(){let n={};for(let r of Object.keys(e)){let o=e[r];o&&typeof o=="object"&&"__optional"in o?n[r]=o.__optional:n[r]=o;}return d(n)}}}function F(e){return d(e)}function W(e,t){return d({...e.__definition,...t.__definition})}function $(e,...t){return e.pick(...t)}function H(e,...t){return e.omit(...t)}function i(e,t){return {parse:e,safeParse(r){try{return {ok:!0,value:e(r)}}catch(o){return {ok:false,error:o instanceof Error?o:new Error(String(o))}}},is(r){if(t)return t(r);try{return e(r),!0}catch{return false}},T:void 0,optional(){return i(r=>r===void 0?void 0:e(r),r=>r===void 0||(t?t(r):true))},nullable(){return i(r=>r===null?null:e(r),r=>r===null||(t?t(r):true))},default(r){return i(o=>o==null?r:e(o))},transform(r){return i(o=>r(e(o)))},refine(r,o="Validation failed"){return i(s=>{let a=e(s);if(!r(a))throw new Error(o);return a})}}}function T(){return i(e=>{if(typeof e!="string")throw new Error(`Expected string, got ${typeof e}`);return e},e=>typeof e=="string")}function L(){return i(e=>{if(typeof e!="number"||Number.isNaN(e))throw new Error(`Expected number, got ${typeof e}`);return e},e=>typeof e=="number"&&!Number.isNaN(e))}function J(){return i(e=>{if(typeof e!="boolean")throw new Error(`Expected boolean, got ${typeof e}`);return e},e=>typeof e=="boolean")}function G(){return i(e=>{if(e instanceof Date)return e;if(typeof e=="string"||typeof e=="number"){let t=new Date(e);if(Number.isNaN(t.getTime()))throw new Error("Invalid date");return t}throw new Error(`Expected date, got ${typeof e}`)},e=>e instanceof Date&&!Number.isNaN(e.getTime()))}function z(e){return i(t=>{if(t!==e)throw new Error(`Expected ${String(e)}, got ${String(t)}`);return e},t=>t===e)}function Y(...e){return i(t=>{if(!e.includes(t))throw new Error(`Expected one of [${e.join(", ")}], got ${String(t)}`);return t},t=>e.includes(t))}function Z(){let e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return T().refine(t=>e.test(t),"Invalid email")}function Q(){return T().refine(e=>{try{return new URL(e),!0}catch{return false}},"Invalid URL")}function X(){let e=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;return T().refine(t=>e.test(t),"Invalid UUID")}function u(e){let n=i(r=>{if(typeof r!="object"||r===null)throw new Error(`Expected object, got ${typeof r}`);let o={},s=e;for(let a of Object.keys(s)){let p=s[a];p&&(o[a]=p.parse(r[a]));}return o},r=>{if(typeof r!="object"||r===null)return false;let o=e;for(let s of Object.keys(o)){let a=o[s];if(a&&!a.is(r[s]))return false}return true});return n.schema=e,n.pick=(...r)=>{let o={};for(let s of r)o[s]=e[s];return u(o)},n.omit=(...r)=>{let o={...e};for(let s of r)delete o[s];return u(o)},n.extend=r=>u({...e,...r}),n.partial=()=>{let r={},o=e;for(let s of Object.keys(o)){let a=o[s];a&&(r[s]=a.optional());}return u(r)},n.merge=r=>u({...e,...r.schema}),n}function ee(e){return i(t=>{if(!Array.isArray(t))throw new Error(`Expected array, got ${typeof t}`);return t.map((n,r)=>{try{return e.parse(n)}catch(o){throw new Error(`[${r}]: ${o instanceof Error?o.message:String(o)}`)}})},t=>Array.isArray(t)&&t.every(n=>e.is(n)))}function te(...e){return i(t=>{if(!Array.isArray(t))throw new Error(`Expected tuple, got ${typeof t}`);if(t.length!==e.length)throw new Error(`Expected ${e.length} elements, got ${t.length}`);return e.map((n,r)=>n.parse(t[r]))},t=>Array.isArray(t)&&t.length===e.length&&e.every((n,r)=>n.is(t[r])))}function ne(e){return i(t=>{if(typeof t!="object"||t===null||Array.isArray(t))throw new Error(`Expected record, got ${typeof t}`);let n={};for(let[r,o]of Object.entries(t))n[r]=e.parse(o);return n},t=>typeof t!="object"||t===null||Array.isArray(t)?false:Object.values(t).every(n=>e.is(n)))}function re(...e){return i(t=>{for(let n of e){let r=n.safeParse(t);if(r.ok)return r.value}throw new Error("Value does not match any union member")},t=>e.some(n=>n.is(t)))}function oe(e,t){return i(n=>{let r=e.parse(n),o=t.parse(n);return {...r,...o}},n=>e.is(n)&&t.is(n))}var se={string:T,number:L,boolean:J,date:G,email:Z,url:Q,uuid:X,literal:z,enum:Y,object:u,array:ee,tuple:te,record:ne,union:re,intersection:oe,any:()=>i(e=>e),unknown:()=>i(e=>e),null:()=>i(e=>{if(e!==null)throw new Error("Expected null");return null}),undefined:()=>i(e=>{if(e!==void 0)throw new Error("Expected undefined")})};var l=class{_items=[];_listeners=new Set;get items(){return this._items}get length(){return this._items.length}notify(){for(let t of this._listeners)t(this._items);}add(t){return this._items.push(t),this.notify(),t}addMany(t){return this._items.push(...t),this.notify(),t}update(t,n){let r=this._items.findIndex(t);if(r!==-1)return this._items[r]={...this._items[r],...n},this.notify(),this._items[r]}updateWhere(t,n,r){return this.update(o=>o[t]===n,r)}remove(t){let n=[];return this._items=this._items.filter(r=>t(r)?(n.push(r),false):true),n.length>0&&this.notify(),n}removeWhere(t,n){return this.remove(o=>o[t]===n)[0]}clear(){this._items=[],this.notify();}findOne(t){return this._items.find(t)}find(t,n){return this._items.find(r=>r[t]===n)}findMany(t){return this._items.filter(t)}where(t){return this.findMany(t)}whereEquals(t,n){return this._items.filter(r=>r[t]===n)}some(t){return this._items.some(t)}every(t){return this._items.every(t)}has(t,n){return this._items.some(r=>r[t]===n)}first(){return this._items[0]}last(){return this._items[this._items.length-1]}at(t){return this._items.at(t)}map(t){return this._items.map(t)}pluck(t){return this._items.map(n=>n[t])}pick(...t){return this._items.map(n=>{let r={};for(let o of t)r[o]=n[o];return r})}omit(...t){return this._items.map(n=>{let r={...n};for(let o of t)delete r[o];return r})}sortBy(t,n="asc"){return [...this._items].sort((r,o)=>{let s=r[t],a=o[t];return s<a?n==="asc"?-1:1:s>a?n==="asc"?1:-1:0})}groupBy(t){let n=new Map;for(let r of this._items){let o=r[t],s=n.get(o)||[];s.push(r),n.set(o,s);}return n}unique(t){return [...new Set(this._items.map(n=>n[t]))]}count(t){return t?this._items.filter(t).length:this._items.length}subscribe(t){return this._listeners.add(t),()=>this._listeners.delete(t)}toArray(){return [...this._items]}toJSON(){return JSON.stringify(this._items)}fromJSON(t){this._items=JSON.parse(t),this.notify();}},c=class extends l{constructor(n){super();this.idKey=n;}byId(n){return this.find(this.idKey,n)}updateById(n,r){return this.updateWhere(this.idKey,n,r)}removeById(n){return this.removeWhere(this.idKey,n)}hasId(n){return this.has(this.idKey,n)}},ie={async get(e){return typeof localStorage>"u"?null:localStorage.getItem(e)},async set(e,t){typeof localStorage>"u"||localStorage.setItem(e,t);},async remove(e){typeof localStorage>"u"||localStorage.removeItem(e);}},f=class extends l{constructor(n,r=ie){super();this.storageKey=n;this.storage=r;}autoSaveEnabled=false;unsubscribe;async save(){await this.storage.set(this.storageKey,this.toJSON());}async load(){let n=await this.storage.get(this.storageKey);n&&this.fromJSON(n);}enableAutoSave(){this.autoSaveEnabled||(this.autoSaveEnabled=true,this.unsubscribe=this.subscribe(()=>{this.save();}));}disableAutoSave(){this.autoSaveEnabled=false,this.unsubscribe?.();}};function ae(e){return new l}function de(e,t){return new c(t)}function ue(e,t,n){return new f(t,n)}function le(e,t){if(t?.persist){let n=new f(t.persist,t.storage);return t.autoSave&&n.enableAutoSave(),n}return t?.idKey?new c(t.idKey):new l}function Te(){return {idle:()=>({status:"idle"}),loading:()=>({status:"loading"}),success:e=>({status:"success",data:e}),error:e=>({status:"error",error:e}),isIdle:e=>e.status==="idle",isLoading:e=>e.status==="loading",isSuccess:e=>e.status==="success",isError:e=>e.status==="error",map:(e,t)=>e.status==="success"?{status:"success",data:t(e.data)}:e,getOrElse:(e,t)=>e.status==="success"?e.data:t}}function ce(e){return {pristine:()=>({status:"pristine",values:e}),dirty:(t,n)=>({status:"dirty",values:t,touched:n}),validating:t=>({status:"validating",values:t}),invalid:(t,n)=>({status:"invalid",values:t,errors:n}),submitting:t=>({status:"submitting",values:t}),submitted:t=>({status:"submitted",values:t}),error:(t,n)=>({status:"error",values:t,error:n}),canSubmit:t=>t.status==="dirty"||t.status==="pristine",isSubmitting:t=>t.status==="submitting",hasErrors:t=>t.status==="invalid"}}function fe(){return {closed:()=>({isOpen:false}),open:e=>({isOpen:true,data:e}),isOpen:e=>e.isOpen}}function ye(e){return {init:()=>({current:e,past:[],future:[],canUndo:false,canRedo:false}),push:(t,n)=>({current:n,past:[...t.past,t.current],future:[],canUndo:true,canRedo:false}),undo:t=>t.past.length===0?t:{current:t.past[t.past.length-1],past:t.past.slice(0,-1),future:[t.current,...t.future],canUndo:t.past.length>1,canRedo:true},redo:t=>t.future.length===0?t:{current:t.future[0],past:[...t.past,t.current],future:t.future.slice(1),canUndo:true,canRedo:t.future.length>1}}}function pe(e,t){return new y(e,t,{})}var y=class e{value;discriminant;handlers;result=void 0;matched=false;constructor(t,n,r){this.value=t,this.discriminant=n,this.handlers=r;}with(t,n){let r={...this.handlers,[t]:n},o=new e(this.value,this.discriminant,r),s=this.value[this.discriminant];return !this.matched&&s===t?(o.result=n(this.value),o.matched=true):(o.result=this.result,o.matched=this.matched),o}exhaustive(){if(this.matched)return this.result;throw new Error(`No handler matched for discriminant value: ${String(this.value[this.discriminant])}`)}otherwise(t){return this.matched?this.result:t(this.value)}run(){return this.exhaustive()}};function xe(e,t){let n=t[e];if(!n)throw new Error(`No handler for value: ${String(e)}`);return n()}function m(e,t,n){let r=e[t],o=n[r];return o(e)}function me(){return e=>(t,n)=>m(t,e,n)}function ge(e){return e}function ke(e){}function be(e){throw new Error(`Unexpected value: ${JSON.stringify(e)}`)}function Ke(e){return e}function he(e){return e}function we(e,t){return {...e,...t}}function Se(...e){return Object.assign({},...e)}function k(e,t){let n={...e};for(let r of Object.keys(t)){let o=t[r],s=e[r];g(o)&&g(s)?n[r]=k(s,o):n[r]=o;}return n}function g(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}function ve(e,t,n){let r={...e,...t};for(let o of Object.keys(n)){let s=n[o];s&&o in e&&o in t&&(r[o]=s(e[o],t[o]));}return r}function Re(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Ee(e,t){let n={...e};for(let r of t)delete n[r];return n}function Me(e,t){let n={};for(let r of Object.keys(e)){let o=t[r];o!==void 0?n[o]=e[r]:n[r]=e[r];}return n}function Ve(e){return Object.fromEntries(e)}function _e(e,t){let n={};for(let r of Object.keys(e))n[r]=t(e[r],r);return n}function Ae(e,t){let n={};for(let r of Object.keys(e)){let o=t(r);n[o]=e[r];}return n}exports.A=ye;exports.B=pe;exports.C=xe;exports.D=m;exports.E=me;exports.F=ge;exports.G=ke;exports.H=be;exports.I=Ke;exports.J=he;exports.K=we;exports.L=Se;exports.M=k;exports.N=ve;exports.O=Re;exports.P=Ee;exports.Q=Me;exports.R=Ve;exports.S=_e;exports.T=Ae;exports.a=b;exports.b=K;exports.c=h;exports.d=w;exports.e=S;exports.f=v;exports.g=R;exports.h=x;exports.i=E;exports.j=M;exports.k=V;exports.l=_;exports.m=q;exports.n=d;exports.o=F;exports.p=W;exports.q=$;exports.r=H;exports.s=se;exports.t=ae;exports.u=de;exports.v=ue;exports.w=le;exports.x=Te;exports.y=ce;exports.z=fe;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkWOT6VMZA_js=require('./chunk-WOT6VMZA.js');var U={};chunkWOT6VMZA_js.a(U,{camelCase:()=>g,capitalize:()=>p,deburr:()=>d,escape:()=>z,escapeRegExp:()=>L,kebabCase:()=>c,pad:()=>T,padEnd:()=>$,padStart:()=>_,pascalCase:()=>l,slugify:()=>x,snakeCase:()=>u,template:()=>m,truncate:()=>f,uncapitalize:()=>s,unescape:()=>b,words:()=>C});function p(e){return e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1)}function s(e){return e.length===0?"":e.charAt(0).toLowerCase()+e.slice(1)}function g(e){return e.replace(/[-_\s]+(.)?/g,(r,t)=>t?t.toUpperCase():"").replace(/^[A-Z]/,r=>r.toLowerCase())}function c(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function u(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase()}function l(e){return e.replace(/[-_\s]+(.)?/g,(r,t)=>t?t.toUpperCase():"").replace(/^[a-z]/,r=>r.toUpperCase())}function f(e,r,t="..."){return e.length<=r?e:e.slice(0,r)+t}function x(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/[\s_]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function m(e,r){return e.replace(/\{\{(\w+)\}\}/g,(t,n)=>n in r?String(r[n]):`{{${n}}}`)}function C(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim().split(/\s+/).filter(Boolean)}function d(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function z(e){let r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return e.replace(/[&<>"']/g,t=>r[t]??t)}function b(e){let r={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#x27;":"'","&#x2F;":"/"};return e.replace(/&(?:amp|lt|gt|quot|#39|#x27|#x2F);/g,t=>r[t]??t)}function L(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function T(e,r,t=" "){let n=e.length;if(n>=r||t.length===0)return e;let i=r-n,o=Math.floor(i/2),w=i-o;return a(t,o)+e+a(t,w)}function _(e,r,t=" "){let n=e.length;return n>=r||t.length===0?e:a(t,r-n)+e}function $(e,r,t=" "){let n=e.length;return n>=r||t.length===0?e:e+a(t,r-n)}function a(e,r){if(r<=0)return "";let t=Math.ceil(r/e.length);return e.repeat(t).slice(0,r)}exports.a=p;exports.b=s;exports.c=g;exports.d=c;exports.e=u;exports.f=l;exports.g=f;exports.h=x;exports.i=m;exports.j=C;exports.k=d;exports.l=z;exports.m=b;exports.n=L;exports.o=T;exports.p=_;exports.q=$;exports.r=U;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkWOT6VMZA_js=require('./chunk-WOT6VMZA.js');var T={};chunkWOT6VMZA_js.a(T,{assertNever:()=>a,debug:()=>s,deprecated:()=>g,exhaustive:()=>c,getLogLevel:()=>w,invariant:()=>u,log:()=>L,measure:()=>p,measureAsync:()=>v,setLogLevel:()=>x,todo:()=>f});function s(e){return r=>(console.log(`[${e}]`,r),r)}function u(e,r){if(!e)throw new Error(`Invariant violation: ${r}`)}function a(e,r){throw new Error(r??`Unexpected value: ${JSON.stringify(e)}`)}function c(e){throw new Error(`Exhaustive check failed: ${JSON.stringify(e)}`)}function f(e="Not implemented"){throw new Error(`TODO: ${e}`)}var l=new Set;function g(e){l.has(e)||(l.add(e),console.warn(`[DEPRECATED] ${e}`));}function p(e){let r=performance.now(),n=e(),t=performance.now()-r;return {result:n,duration:t}}async function v(e){let r=performance.now(),n=await e(),t=performance.now()-r;return {result:n,duration:t}}var d={debug:0,info:1,warn:2,error:3},i="info";function x(e){i=e;}function w(){return i}function o(e){return d[e]>=d[i]}var L={debug(e,...r){o("debug")&&console.debug(`[DEBUG] ${e}`,...r);},info(e,...r){o("info")&&console.info(`[INFO] ${e}`,...r);},warn(e,...r){o("warn")&&console.warn(`[WARN] ${e}`,...r);},error(e,...r){o("error")&&console.error(`[ERROR] ${e}`,...r);}};exports.a=s;exports.b=u;exports.c=a;exports.d=c;exports.e=f;exports.f=g;exports.g=p;exports.h=v;exports.i=x;exports.j=w;exports.k=L;exports.l=T;
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-JZXLCA2E.mjs';var G={};a$1(G,{chunk:()=>m,compact:()=>c,countBy:()=>S,difference:()=>K,drop:()=>M,dropWhile:()=>P,findLast:()=>R,first:()=>y,flatten:()=>d,groupBy:()=>l,head:()=>v,indexBy:()=>T,init:()=>E,intersection:()=>w,keyBy:()=>C,last:()=>x,maxBy:()=>j,minBy:()=>q,partition:()=>p,range:()=>h,reject:()=>L,sample:()=>g,sampleSize:()=>O,shuffle:()=>b,size:()=>V,sortBy:()=>a,sumBy:()=>W,tail:()=>I,take:()=>A,takeWhile:()=>z,unique:()=>s,unzip:()=>k,zip:()=>B});function s(e,n){if(!n)return [...new Set(e)];let t=new Set,r=[];for(let o of e){let u=n(o);t.has(u)||(t.add(u),r.push(o));}return r}function l(e,n){let t={};for(let r of e){let o=n(r);o in t||(t[o]=[]),t[o].push(r);}return t}function T(e,n){let t={};for(let r of e){let o=n(r);t[o]=r;}return t}function p(e,n){let t=[],r=[];for(let o of e)n(o)?t.push(o):r.push(o);return [t,r]}function m(e,n){if(n<=0)throw new Error("Chunk size must be greater than 0");let t=[];for(let r=0;r<e.length;r+=n)t.push(e.slice(r,r+n));return t}function c(e){return e.filter(n=>n!=null)}function d(e){let n=[];for(let t of e)Array.isArray(t)?n.push(...t):n.push(t);return n}function a(e,n,t="asc"){let r=[...e].sort((o,u)=>{let i=n(o),f=n(u);return i<f?-1:i>f?1:0});return t==="desc"?r.reverse():r}function y(e){return e[0]}function x(e){return e[e.length-1]}function h(e,n,t=1){if(t===0)throw new Error("Step cannot be 0");let r=[];if(t>0)for(let o=e;o<n;o+=t)r.push(o);else for(let o=e;o>n;o+=t)r.push(o);return r}function b(e){let n=[...e];for(let t=n.length-1;t>0;t--){let r=Math.floor(Math.random()*(t+1)),o=n[t];n[t]=n[r],n[r]=o;}return n}function g(e){if(e.length===0)return;let n=Math.floor(Math.random()*e.length);return e[n]}function B(e,n){let t=Math.min(e.length,n.length),r=[];for(let o=0;o<t;o++)r.push([e[o],n[o]]);return r}function k(e){let n=[],t=[];for(let[r,o]of e)n.push(r),t.push(o);return [n,t]}function K(e,n){let t=new Set(n);return e.filter(r=>!t.has(r))}function w(e,n){let t=new Set(n);return e.filter(r=>t.has(r))}function A(e,n){return n<=0?[]:e.slice(0,n)}function M(e,n){return n<=0?[...e]:e.slice(n)}function z(e,n){let t=[];for(let r=0;r<e.length;r++){let o=e[r];if(!n(o,r))break;t.push(o);}return t}function P(e,n){let t=0;for(let r=0;r<e.length;r++){if(!n(e[r],r)){t=r;break}t=e.length;}return e.slice(t)}function R(e,n){for(let t=e.length-1;t>=0;t--){let r=e[t];if(n(r,t))return r}}function S(e,n){let t={};for(let r of e){let o=n(r);t[o]=(t[o]??0)+1;}return t}function j(e,n){if(e.length===0)return;let t=e[0],r=n(t);for(let o=1;o<e.length;o++){let u=e[o],i=n(u);i>r&&(r=i,t=u);}return t}function q(e,n){if(e.length===0)return;let t=e[0],r=n(t);for(let o=1;o<e.length;o++){let u=e[o],i=n(u);i<r&&(r=i,t=u);}return t}function W(e,n){let t=0;for(let r of e)t+=n(r);return t}function v(e){return e[0]}function I(e){return e.slice(1)}function E(e){return e.slice(0,-1)}function L(e,n){return e.filter((t,r,o)=>!n(t,r,o))}function V(e){return e==null?0:typeof e=="string"||Array.isArray(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length}function C(e,n){let t={};for(let r of e){let o=n(r);t[o]=r;}return t}function O(e,n){if(n<=0||e.length===0)return [];let t=Math.min(n,e.length),r=[...e];for(let o=0;o<t;o++){let u=o+Math.floor(Math.random()*(r.length-o)),i=r[o];r[o]=r[u],r[u]=i;}return r.slice(0,t)}export{v as A,I as B,E as C,L as D,V as E,C as F,O as G,G as H,s as a,l as b,T as c,p as d,m as e,c as f,d as g,a as h,y as i,x as j,h as k,b as l,g as m,B as n,k as o,K as p,w as q,A as r,M as s,z as t,P as u,R as v,S as w,j as x,q as y,W as z};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkWOT6VMZA_js=require('./chunk-WOT6VMZA.js');var G={};chunkWOT6VMZA_js.a(G,{chunk:()=>m,compact:()=>c,countBy:()=>S,difference:()=>K,drop:()=>M,dropWhile:()=>P,findLast:()=>R,first:()=>y,flatten:()=>d,groupBy:()=>l,head:()=>v,indexBy:()=>T,init:()=>E,intersection:()=>w,keyBy:()=>C,last:()=>x,maxBy:()=>j,minBy:()=>q,partition:()=>p,range:()=>h,reject:()=>L,sample:()=>g,sampleSize:()=>O,shuffle:()=>b,size:()=>V,sortBy:()=>a,sumBy:()=>W,tail:()=>I,take:()=>A,takeWhile:()=>z,unique:()=>s,unzip:()=>k,zip:()=>B});function s(e,n){if(!n)return [...new Set(e)];let t=new Set,r=[];for(let o of e){let u=n(o);t.has(u)||(t.add(u),r.push(o));}return r}function l(e,n){let t={};for(let r of e){let o=n(r);o in t||(t[o]=[]),t[o].push(r);}return t}function T(e,n){let t={};for(let r of e){let o=n(r);t[o]=r;}return t}function p(e,n){let t=[],r=[];for(let o of e)n(o)?t.push(o):r.push(o);return [t,r]}function m(e,n){if(n<=0)throw new Error("Chunk size must be greater than 0");let t=[];for(let r=0;r<e.length;r+=n)t.push(e.slice(r,r+n));return t}function c(e){return e.filter(n=>n!=null)}function d(e){let n=[];for(let t of e)Array.isArray(t)?n.push(...t):n.push(t);return n}function a(e,n,t="asc"){let r=[...e].sort((o,u)=>{let i=n(o),f=n(u);return i<f?-1:i>f?1:0});return t==="desc"?r.reverse():r}function y(e){return e[0]}function x(e){return e[e.length-1]}function h(e,n,t=1){if(t===0)throw new Error("Step cannot be 0");let r=[];if(t>0)for(let o=e;o<n;o+=t)r.push(o);else for(let o=e;o>n;o+=t)r.push(o);return r}function b(e){let n=[...e];for(let t=n.length-1;t>0;t--){let r=Math.floor(Math.random()*(t+1)),o=n[t];n[t]=n[r],n[r]=o;}return n}function g(e){if(e.length===0)return;let n=Math.floor(Math.random()*e.length);return e[n]}function B(e,n){let t=Math.min(e.length,n.length),r=[];for(let o=0;o<t;o++)r.push([e[o],n[o]]);return r}function k(e){let n=[],t=[];for(let[r,o]of e)n.push(r),t.push(o);return [n,t]}function K(e,n){let t=new Set(n);return e.filter(r=>!t.has(r))}function w(e,n){let t=new Set(n);return e.filter(r=>t.has(r))}function A(e,n){return n<=0?[]:e.slice(0,n)}function M(e,n){return n<=0?[...e]:e.slice(n)}function z(e,n){let t=[];for(let r=0;r<e.length;r++){let o=e[r];if(!n(o,r))break;t.push(o);}return t}function P(e,n){let t=0;for(let r=0;r<e.length;r++){if(!n(e[r],r)){t=r;break}t=e.length;}return e.slice(t)}function R(e,n){for(let t=e.length-1;t>=0;t--){let r=e[t];if(n(r,t))return r}}function S(e,n){let t={};for(let r of e){let o=n(r);t[o]=(t[o]??0)+1;}return t}function j(e,n){if(e.length===0)return;let t=e[0],r=n(t);for(let o=1;o<e.length;o++){let u=e[o],i=n(u);i>r&&(r=i,t=u);}return t}function q(e,n){if(e.length===0)return;let t=e[0],r=n(t);for(let o=1;o<e.length;o++){let u=e[o],i=n(u);i<r&&(r=i,t=u);}return t}function W(e,n){let t=0;for(let r of e)t+=n(r);return t}function v(e){return e[0]}function I(e){return e.slice(1)}function E(e){return e.slice(0,-1)}function L(e,n){return e.filter((t,r,o)=>!n(t,r,o))}function V(e){return e==null?0:typeof e=="string"||Array.isArray(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length}function C(e,n){let t={};for(let r of e){let o=n(r);t[o]=r;}return t}function O(e,n){if(n<=0||e.length===0)return [];let t=Math.min(n,e.length),r=[...e];for(let o=0;o<t;o++){let u=o+Math.floor(Math.random()*(r.length-o)),i=r[o];r[o]=r[u],r[u]=i;}return r.slice(0,t)}exports.A=v;exports.B=I;exports.C=E;exports.D=L;exports.E=V;exports.F=C;exports.G=O;exports.H=G;exports.a=s;exports.b=l;exports.c=T;exports.d=p;exports.e=m;exports.f=c;exports.g=d;exports.h=a;exports.i=y;exports.j=x;exports.k=h;exports.l=b;exports.m=g;exports.n=B;exports.o=k;exports.p=K;exports.q=w;exports.r=A;exports.s=M;exports.t=z;exports.u=P;exports.v=R;exports.w=S;exports.x=j;exports.y=q;exports.z=W;
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-JZXLCA2E.mjs';var T={};a$1(T,{assertNever:()=>a,debug:()=>s,deprecated:()=>g,exhaustive:()=>c,getLogLevel:()=>w,invariant:()=>u,log:()=>L,measure:()=>p,measureAsync:()=>v,setLogLevel:()=>x,todo:()=>f});function s(e){return r=>(console.log(`[${e}]`,r),r)}function u(e,r){if(!e)throw new Error(`Invariant violation: ${r}`)}function a(e,r){throw new Error(r??`Unexpected value: ${JSON.stringify(e)}`)}function c(e){throw new Error(`Exhaustive check failed: ${JSON.stringify(e)}`)}function f(e="Not implemented"){throw new Error(`TODO: ${e}`)}var l=new Set;function g(e){l.has(e)||(l.add(e),console.warn(`[DEPRECATED] ${e}`));}function p(e){let r=performance.now(),n=e(),t=performance.now()-r;return {result:n,duration:t}}async function v(e){let r=performance.now(),n=await e(),t=performance.now()-r;return {result:n,duration:t}}var d={debug:0,info:1,warn:2,error:3},i="info";function x(e){i=e;}function w(){return i}function o(e){return d[e]>=d[i]}var L={debug(e,...r){o("debug")&&console.debug(`[DEBUG] ${e}`,...r);},info(e,...r){o("info")&&console.info(`[INFO] ${e}`,...r);},warn(e,...r){o("warn")&&console.warn(`[WARN] ${e}`,...r);},error(e,...r){o("error")&&console.error(`[ERROR] ${e}`,...r);}};export{s as a,u as b,a as c,c as d,f as e,g as f,p as g,v as h,x as i,w as j,L as k,T as l};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkWOT6VMZA_js=require('./chunk-WOT6VMZA.js');var q={};chunkWOT6VMZA_js.a(q,{contrast:()=>y,darken:()=>$,desaturate:()=>G,formatHsl:()=>T,formatRgb:()=>R,getContrastColor:()=>C,getDominant:()=>D,getTemperature:()=>W,grayscale:()=>S,hexToRgb:()=>i,hslToRgb:()=>m,invert:()=>w,isDark:()=>L,isLight:()=>x,isSimilar:()=>v,lighten:()=>H,luminance:()=>p,mix:()=>k,opacity:()=>I,parseColor:()=>d,rgbToHex:()=>a,rgbToHsl:()=>c,saturate:()=>B});function i(t){let r=t.replace(/^#/,"");if(r.length===3){let n=parseInt(r[0]+r[0],16),e=parseInt(r[1]+r[1],16),o=parseInt(r[2]+r[2],16);return {r:n,g:e,b:o}}if(r.length===6){let n=parseInt(r.substring(0,2),16),e=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16);return {r:n,g:e,b:o}}return null}function a(t){let r=n=>{let e=Math.round(Math.max(0,Math.min(255,n))).toString(16);return e.length===1?"0"+e:e};return `#${r(t.r)}${r(t.g)}${r(t.b)}`}function c(t){let r=t.r/255,n=t.g/255,e=t.b/255,o=Math.max(r,n,e),s=Math.min(r,n,e),u=o-s,b=0,f=0,h=(o+s)/2;if(u!==0)switch(f=h>.5?u/(2-o-s):u/(o+s),o){case r:b=((n-e)/u+(n<e?6:0))/6;break;case n:b=((e-r)/u+2)/6;break;case e:b=((r-n)/u+4)/6;break}return {h:Math.round(b*360),s:Math.round(f*100),l:Math.round(h*100)}}function m(t){let r=t.h/360,n=t.s/100,e=t.l/100,o,s,u;if(n===0)o=s=u=e;else {let b=(l,M,g)=>(g<0&&(g+=1),g>1&&(g-=1),g<.16666666666666666?l+(M-l)*6*g:g<.5?M:g<.6666666666666666?l+(M-l)*(.6666666666666666-g)*6:l),f=e<.5?e*(1+n):e+n-e*n,h=2*e-f;o=b(h,f,r+1/3),s=b(h,f,r),u=b(h,f,r-1/3);}return {r:Math.round(o*255),g:Math.round(s*255),b:Math.round(u*255)}}function d(t){if(t.startsWith("#"))return i(t);let r=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);return r?{r:parseInt(r[1],10),g:parseInt(r[2],10),b:parseInt(r[3],10)}:null}function R(t){return `rgb(${t.r}, ${t.g}, ${t.b})`}function T(t){return `hsl(${t.h}, ${t.s}%, ${t.l}%)`}function H(t,r){let n=i(t);if(!n)return t;let e=c(n);return e.l=Math.min(100,e.l+r),a(m(e))}function $(t,r){let n=i(t);if(!n)return t;let e=c(n);return e.l=Math.max(0,e.l-r),a(m(e))}function B(t,r){let n=i(t);if(!n)return t;let e=c(n);return e.s=Math.min(100,e.s+r),a(m(e))}function G(t,r){let n=i(t);if(!n)return t;let e=c(n);return e.s=Math.max(0,e.s-r),a(m(e))}function I(t,r){let n=i(t);if(!n)return t;let e=Math.max(0,Math.min(1,r));return `rgba(${n.r}, ${n.g}, ${n.b}, ${e})`}function k(t,r,n=.5){let e=i(t),o=i(r);if(!e||!o)return t;let s=Math.max(0,Math.min(1,n)),u={r:Math.round(e.r*s+o.r*(1-s)),g:Math.round(e.g*s+o.g*(1-s)),b:Math.round(e.b*s+o.b*(1-s))};return a(u)}function w(t){let r=i(t);return r?a({r:255-r.r,g:255-r.g,b:255-r.b}):t}function S(t){let r=i(t);if(!r)return t;let n=Math.round(.299*r.r+.587*r.g+.114*r.b);return a({r:n,g:n,b:n})}function p(t){let r=i(t);if(!r)return 0;let[n,e,o]=[r.r,r.g,r.b].map(s=>{let u=s/255;return u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4)});return .2126*n+.7152*e+.0722*o}function y(t,r){let n=p(t),e=p(r),o=Math.max(n,e),s=Math.min(n,e);return (o+.05)/(s+.05)}function x(t){return p(t)>.5}function L(t){return !x(t)}function C(t){return x(t)?"#000000":"#ffffff"}function v(t,r,n=10){let e=i(t),o=i(r);return !e||!o?false:Math.sqrt(Math.pow(e.r-o.r,2)+Math.pow(e.g-o.g,2)+Math.pow(e.b-o.b,2))<=n}function D(t){let r=i(t);if(!r)return null;let n=Math.max(r.r,r.g,r.b);return r.r===n?"red":r.g===n?"green":"blue"}function W(t){let r=i(t);if(!r)return "neutral";let n=c(r);return n.h>=0&&n.h<=60?"warm":n.h>=180&&n.h<=300?"cool":"neutral"}exports.a=i;exports.b=a;exports.c=c;exports.d=m;exports.e=d;exports.f=R;exports.g=T;exports.h=H;exports.i=$;exports.j=B;exports.k=G;exports.l=I;exports.m=k;exports.n=w;exports.o=S;exports.p=p;exports.q=y;exports.r=x;exports.s=L;exports.t=C;exports.u=v;exports.v=D;exports.w=W;exports.x=q;
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-JZXLCA2E.mjs';var P={};a$1(P,{createIterator:()=>a,cycle:()=>v,enumerate:()=>p,fromAsync:()=>u,iterEvery:()=>w,iterFind:()=>L,iterForEach:()=>x,iterReduce:()=>h,iterSome:()=>k,lazyChunk:()=>m,lazyFilter:()=>y,lazyFlatten:()=>I,lazyMap:()=>s,lazyRange:()=>c,lazySkip:()=>d,lazyTake:()=>T,lazyZip:()=>b,repeat:()=>z,toArray:()=>U});function a(o){let n=()=>typeof o=="function"?o():o[Symbol.iterator]();return {[Symbol.iterator](){return n()},map(e){let t=this;return a(function*(){let r=0;for(let i of t)yield e(i,r++);})},filter(e){let t=this;return a(function*(){let r=0;for(let i of t)e(i,r++)&&(yield i);})},take(e){let t=this;return a(function*(){let r=0;for(let i of t){if(r>=e)break;yield i,r++;}})},skip(e){let t=this;return a(function*(){let r=0;for(let i of t)r>=e&&(yield i),r++;})},takeWhile(e){let t=this;return a(function*(){for(let r of t){if(!e(r))break;yield r;}})},skipWhile(e){let t=this;return a(function*(){let r=true;for(let i of t)r&&e(i)||(r=false,yield i);})},flatMap(e){let t=this;return a(function*(){for(let r of t)yield*e(r);})},flatten(){let e=this;return a(function*(){for(let t of e)yield*t;})},chunk(e){let t=this;return a(function*(){let r=[];for(let i of t)r.push(i),r.length===e&&(yield r,r=[]);r.length>0&&(yield r);})},enumerate(){let e=this;return a(function*(){let t=0;for(let r of e)yield [t++,r];})},zip(e){let t=this;return a(function*(){let r=t[Symbol.iterator](),i=e[Symbol.iterator]();for(;;){let l=r.next(),f=i.next();if(l.done||f.done)break;yield [l.value,f.value];}})},concat(...e){let t=this;return a(function*(){yield*t;for(let r of e)yield*r;})},unique(e){let t=this;return a(function*(){let r=new Set;for(let i of t){let l=e?e(i):i;r.has(l)||(r.add(l),yield i);}})},toArray(){return [...this]},reduce(e,t){let r=t;for(let i of this)r=e(r,i);return r},forEach(e){let t=0;for(let r of this)e(r,t++);},find(e){for(let t of this)if(e(t))return t},some(e){for(let t of this)if(e(t))return true;return false},every(e){for(let t of this)if(!e(t))return false;return true},first(){for(let e of this)return e},last(){let e;for(let t of this)e=t;return e},count(){let e=0;for(let t of this)e++;return e},collect(e){return e(this)}}}function c(o,n,e=1){return a(function*(){if(e>0)for(let t=o;t<n;t+=e)yield t;else if(e<0)for(let t=o;t>n;t+=e)yield t;})}function s(o,n){return a(function*(){let e=0;for(let t of o)yield n(t,e++);})}function y(o,n){return a(function*(){let e=0;for(let t of o)n(t,e++)&&(yield t);})}function T(o,n){return a(function*(){let e=0;for(let t of o){if(e>=n)break;yield t,e++;}})}function d(o,n){return a(function*(){let e=0;for(let t of o)e>=n&&(yield t),e++;})}function m(o,n){return a(function*(){let e=[];for(let t of o)e.push(t),e.length===n&&(yield e,e=[]);e.length>0&&(yield e);})}function I(o){return a(function*(){for(let n of o)yield*n;})}function b(o,n){return a(function*(){let e=o[Symbol.iterator](),t=n[Symbol.iterator]();for(;;){let r=e.next(),i=t.next();if(r.done||i.done)break;yield [r.value,i.value];}})}function p(o){return a(function*(){let n=0;for(let e of o)yield [n++,e];})}function v(o){return a(function*(){let n=[];for(let e of o)n.push(e),yield e;if(n.length!==0)for(;;)for(let e of n)yield e;})}function z(o,n){return a(function*(){if(n===void 0)for(;;)yield o;else for(let e=0;e<n;e++)yield o;})}function u(o){let n=()=>typeof o=="function"?o():o[Symbol.asyncIterator]();return {[Symbol.asyncIterator](){return n()},map(e){let t=this;return u(async function*(){let r=0;for await(let i of t)yield await e(i,r++);})},filter(e){let t=this;return u(async function*(){for await(let r of t)await e(r)&&(yield r);})},take(e){let t=this;return u(async function*(){let r=0;for await(let i of t){if(r>=e)break;yield i,r++;}})},skip(e){let t=this;return u(async function*(){let r=0;for await(let i of t)r>=e&&(yield i),r++;})},async toArray(){let e=[];for await(let t of this)e.push(t);return e},async reduce(e,t){let r=t;for await(let i of this)r=await e(r,i);return r},async forEach(e){let t=0;for await(let r of this)await e(r,t++);},async find(e){for await(let t of this)if(await e(t))return t},async first(){for await(let e of this)return e},async count(){let e=0;for await(let t of this)e++;return e}}}function U(o){return [...o]}function h(o,n,e){let t=e;for(let r of o)t=n(t,r);return t}function x(o,n){let e=0;for(let t of o)n(t,e++);}function L(o,n){for(let e of o)if(n(e))return e}function k(o,n){for(let e of o)if(n(e))return true;return false}function w(o,n){for(let e of o)if(!n(e))return false;return true}export{a,c as b,s as c,y as d,T as e,d as f,m as g,I as h,b as i,p as j,v as k,z as l,u as m,U as n,h as o,x as p,L as q,k as r,w as s,P as t};
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-JZXLCA2E.mjs';var a={};a$1(a,{assert:()=>t,assertDefined:()=>i,fail:()=>f,identity:()=>u,isDefined:()=>r,isNil:()=>o,noop:()=>s,unreachable:()=>d});function r(e){return e!=null}function o(e){return e==null}function t(e,n="Assertion failed"){if(!e)throw new Error(n)}function i(e,n="Value is not defined"){if(e==null)throw new Error(n)}function f(e){throw new Error(e)}function s(){}function u(e){return e}function d(e,n){throw new Error(n??`Unreachable code reached with value: ${JSON.stringify(e)}`)}export{r as a,o as b,t as c,i as d,f as e,s as f,u as g,d as h,a as i};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkWOT6VMZA_js=require('./chunk-WOT6VMZA.js');var S={};chunkWOT6VMZA_js.a(S,{createMemoryStorage:()=>m,createStorage:()=>s,getCookie:()=>l,hasCookie:()=>x,localStorageTyped:()=>g,removeCookie:()=>d,sessionStorageTyped:()=>p,setCookie:()=>u,withExpiry:()=>c});function s(e,r){let{storage:t,defaultValue:i,serializer:o=JSON}=r;return {get(){try{let n=t.getItem(e);return n===null?i??null:o.parse(n)}catch{return i??null}},set(n){try{let a=o.stringify(n);t.setItem(e,a);}catch(a){console.error(`Failed to set storage key "${e}":`,a);}},remove(){t.removeItem(e);},clear(){t.clear();},has(){return t.getItem(e)!==null}}}function g(e,r){return s(e,{storage:localStorage,defaultValue:r})}function p(e,r){return s(e,{storage:sessionStorage,defaultValue:r})}function c(e,r){let{storage:t,ttl:i}=r;return {get(){try{let o=t.getItem(e);if(o===null)return null;let n=JSON.parse(o);return Date.now()>n.expiry?(t.removeItem(e),null):n.value}catch{return null}},set(o){try{let n={value:o,expiry:Date.now()+i};t.setItem(e,JSON.stringify(n));}catch(n){console.error(`Failed to set expiry storage key "${e}":`,n);}},remove(){t.removeItem(e);},isExpired(){try{let o=t.getItem(e);if(o===null)return !0;let n=JSON.parse(o);return Date.now()>n.expiry}catch{return true}},getExpiry(){try{let o=t.getItem(e);return o===null?null:JSON.parse(o).expiry}catch{return null}}}}function m(){let e=new Map;return {get length(){return e.size},getItem(r){return e.get(r)??null},setItem(r,t){e.set(r,t);},removeItem(r){e.delete(r);},clear(){e.clear();},key(r){return Array.from(e.keys())[r]??null}}}function l(e){if(typeof document>"u")return null;let t=`; ${document.cookie}`.split(`; ${e}=`);return t.length===2?t.pop()?.split(";").shift()??null:null}function u(e,r,t={}){if(typeof document>"u")return;let i=`${encodeURIComponent(e)}=${encodeURIComponent(r)}`;if(t.expires){let o=typeof t.expires=="number"?new Date(Date.now()+t.expires*864e5):t.expires;i+=`; expires=${o.toUTCString()}`;}t.path&&(i+=`; path=${t.path}`),t.domain&&(i+=`; domain=${t.domain}`),t.secure&&(i+="; secure"),t.sameSite&&(i+=`; samesite=${t.sameSite}`),document.cookie=i;}function d(e,r={}){u(e,"",{...r,expires:new Date(0)});}function x(e){return l(e)!==null}exports.a=s;exports.b=g;exports.c=p;exports.d=c;exports.e=m;exports.f=l;exports.g=u;exports.h=d;exports.i=x;exports.j=S;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkWOT6VMZA_js=require('./chunk-WOT6VMZA.js');var H={};chunkWOT6VMZA_js.a(H,{at:()=>$,clone:()=>j,cloneDeep:()=>b,deepGet:()=>i,deepGetOr:()=>A,deepHas:()=>D,deepMerge:()=>l,deepPath:()=>G,deepPluck:()=>N,deepSet:()=>S,entriesTyped:()=>P,filterObject:()=>K,findKey:()=>B,findLastKey:()=>E,fromEntriesTyped:()=>g,get:()=>w,has:()=>v,invert:()=>R,invertBy:()=>F,isEqual:()=>c,keysTyped:()=>k,mapObject:()=>h,mergeShallow:()=>m,omit:()=>p,paths:()=>V,pick:()=>T,set:()=>a,transform:()=>U,unset:()=>d,valuesTyped:()=>x});function T(e,t){let r={};for(let n of t)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function p(e,t){let r={...e},n=new Set(t);for(let o of n)delete r[o];return r}function k(e){return Object.keys(e)}function x(e){return Object.values(e)}function P(e){return Object.entries(e)}function g(e){return Object.fromEntries(e)}function h(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function K(e,t){let r={};for(let n of Object.keys(e))t(e[n],n)&&(r[n]=e[n]);return r}function m(e,t){return {...e,...t}}function j(e){return Array.isArray(e)?[...e]:{...e}}function b(e){return structuredClone(e)}function w(e,t){let r=e;for(let n of t){if(r==null||typeof r!="object")return;r=r[n];}return r}function a(e,t,r){if(t.length===0)return r;let[n,...o]=t;if(n===void 0)return e;let s=e[n],f=o.length===0?r:a(typeof s=="object"&&s!==null?s:{},o,r);if(Array.isArray(e)){let u=[...e];return u[n]=f,u}return {...e,[n]:f}}function R(e){let t={};for(let r of Object.keys(e)){let n=e[r];n!==void 0&&(t[String(n)]=r);}return t}function l(e,t){let r={...e};for(let n of Object.keys(t)){let o=t[n],s=e[n];O(o)&&O(s)?r[n]=l(s,o):r[n]=o;}return r}function O(e){if(e===null||typeof e!="object")return false;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function c(e,t){if(e===t)return true;if(e===null||t===null)return e===t;if(typeof e!=typeof t)return false;if(typeof e!="object"||typeof t!="object")return e===t;if(Array.isArray(e)!==Array.isArray(t))return false;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return false;for(let o=0;o<e.length;o++)if(!c(e[o],t[o]))return false;return true}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.toString()===t.toString();let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return false;for(let o of r)if(!n.includes(o)||!c(e[o],t[o]))return false;return true}function v(e,t){if(t.length===0)return true;let r=e;for(let n of t){if(r==null||typeof r!="object"||!(n in r))return false;r=r[n];}return true}function d(e,t){if(t.length===0)return e;let r=t[0],n=t.slice(1);if(n.length===0){let s={...e};return delete s[r],s}let o=e[r];return o==null||typeof o!="object"?e:{...e,[r]:d(o,n)}}function V(e){let t=[];function r(n,o){if(n===null||typeof n!="object"){o.length>0&&t.push(o);return}if(Array.isArray(n)){n.length===0?t.push(o):n.forEach((f,u)=>{r(f,[...o,u]);});return}let s=Object.keys(n);if(s.length===0)t.push(o);else for(let f of s)r(n[f],[...o,f]);}return r(e,[]),t}function U(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function i(e,t){let r=t.split("."),n=e;for(let o of r){if(n==null||typeof n!="object")return;n=n[o];}return n}function A(e,t,r){return i(e,t)??r}function S(e,t,r){let n=t.split("."),o=structuredClone(e),s=o;for(let u=0;u<n.length-1;u++){let y=n[u];(s[y]===void 0||s[y]===null)&&(s[y]={}),s=s[y];}let f=n[n.length-1];return s[f]=r,o}function D(e,t){return i(e,t)!==void 0}function G(){return e=>t=>i(t,e)}function N(e,t){return e.map(r=>i(r,t))}function B(e,t){for(let r of Object.keys(e))if(t(e[r],r,e))return r}function E(e,t){let r=Object.keys(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(t(e[o],o,e))return o}}function $(e,t){return t.map(r=>C(e,r))}function C(e,t){let r=t.split("."),n=e;for(let o of r){if(n==null||typeof n!="object")return;n=n[o];}return n}function F(e,t){let r={};for(let n of Object.keys(e)){let o=e[n],s=t?t(o):String(o);r[s]||(r[s]=[]),r[s].push(n);}return r}exports.A=B;exports.B=E;exports.C=$;exports.D=F;exports.E=H;exports.a=T;exports.b=p;exports.c=k;exports.d=x;exports.e=P;exports.f=g;exports.g=h;exports.h=K;exports.i=m;exports.j=j;exports.k=b;exports.l=w;exports.m=a;exports.n=R;exports.o=l;exports.p=c;exports.q=v;exports.r=d;exports.s=V;exports.t=U;exports.u=i;exports.v=A;exports.w=S;exports.x=D;exports.y=G;exports.z=N;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkWOT6VMZA_js=require('./chunk-WOT6VMZA.js');var rn={};chunkWOT6VMZA_js.a(rn,{allDefined:()=>S,allTrue:()=>R,allTruthy:()=>G,allWhere:()=>W,and:()=>g,andThen:()=>C,anyTrue:()=>B,chain:()=>u,coalesce:()=>v,coalesceLazy:()=>z,cond:()=>x,condBy:()=>w,condLazy:()=>h,defaultTo:()=>L,defaultToIf:()=>j,defaultToIfEmpty:()=>N,defaultToLazy:()=>K,firstDefined:()=>V,firstTruthy:()=>F,firstWhere:()=>E,get:()=>f,getOr:()=>i,getOrLazy:()=>q,getPath:()=>H,getPathOr:()=>M,getTyped:()=>I,ifElse:()=>y,ifElseLazy:()=>s,matchLazy:()=>D,matchType:()=>b,matchValue:()=>m,matchWithDefault:()=>k,not:()=>A,notFn:()=>U,optional:()=>_,optionalChain:()=>nn,optionalOr:()=>$,or:()=>P,orThen:()=>O,safe:()=>Y,tryGet:()=>J,tryGetOr:()=>Q,tryGetResult:()=>X,unless:()=>c,unlessValue:()=>p,unwrap:()=>Z,when:()=>T,whenValue:()=>a});function T(n,e){if(n)return e()}function a(n,e){return n?e:void 0}function c(n,e){if(!n)return e()}function p(n,e){return n?void 0:e}function y(n,e,r){return n?e:r}function s(n,e,r){return n?e():r()}function x(...n){for(let[e,r]of n)if(e)return r}function h(...n){for(let[e,r]of n)if(e)return r()}function w(n,...e){for(let[r,t]of e)if(r(n))return t}function m(n,e){return e[n]}function k(n,e,r){let t=e[n];return t!==void 0?t:r}function D(n,e){return e[n]()}function b(n,e){for(let[r,t]of e)if(r(n))return t(n)}function g(...n){if(n.length===0)return;for(let r=0;r<n.length-1;r++){let t=n[r];if(!t)return t}let e=n[n.length-1];return typeof e=="function"?e():e}function R(...n){return n.every(Boolean)}function C(n,e){return n.every(Boolean)?e():void 0}function P(...n){if(n.length!==0){for(let e of n)if(e)return e;return n[n.length-1]}}function B(...n){return n.some(Boolean)}function O(n,e){return n.some(Boolean)?e():void 0}function A(n){return !n}function U(n){return (...e)=>!n(...e)}function v(...n){for(let e of n)if(e!=null)return e}function z(...n){for(let e of n){let r=e();if(r!=null)return r}}function L(n,e){return n??e}function K(n,e){return n??e()}function j(n,e,r){return e(n)?n:r}function N(n,e){return n==null||n===""||Array.isArray(n)&&n.length===0||typeof n=="object"&&Object.keys(n).length===0?e:n}function F(n){for(let e of n)if(e)return e}function E(n,e){for(let r of n)if(e(r))return r}function V(n){for(let e of n)if(e!=null)return e}function G(n){return n.every(Boolean)}function W(n,e){return n.every(e)}function S(n){return n.every(e=>e!=null)}function f(n,...e){let r=n;for(let t of e){if(r==null)return;r=r[t];}return r}function I(n,e){return f(n,...e)}function H(n,e){let r=e.split(".").map(t=>{let o=Number(t);return Number.isNaN(o)?t:o});return f(n,...r)}function i(n,e,...r){let t=n;for(let o of r){if(t==null)return e;t=t[o];}return t??e}function M(n,e,r){let t=r.split(".").map(o=>{let l=Number(o);return Number.isNaN(l)?o:l});return i(n,e,...t)}function q(n,e,...r){let t=n;for(let o of r){if(t==null)return e();t=t[o];}return t??e()}function J(n){try{return n()}catch{return}}function Q(n,e){try{return n()}catch{return e}}function X(n){try{return {ok:!0,value:n()}}catch(e){return {ok:false,error:e}}}function Y(n){let e={get(r,t){if(r==null)return d();let o=r[t];return o==null?d():typeof o=="object"?new Proxy(o,e):o}};return n==null?d():new Proxy(n,e)}function d(){let n={get(){return d()}};return new Proxy({},n)}function Z(n){if(n!=null&&!(typeof n=="object"&&Object.keys(n).length===0))return n}function u(n){return {map(e){return n==null?u(void 0):u(e(n))},flatMap(e){return n==null?u(void 0):e(n)},filter(e){return n==null?u(void 0):e(n)?u(n):u(void 0)},tap(e){return n!=null&&e(n),u(n)},value(){return n??void 0},valueOr(e){return n??e},valueOrThrow(e){if(n==null)throw new Error(e??"Value is null or undefined");return n}}}function _(n,e){if(n!=null)return e(n)}function $(n,e,r){return n==null?r:e(n)}function nn(n,...e){let r=n;for(let t of e){if(r==null)return;r=t(r);}return r??void 0}exports.A=N;exports.B=F;exports.C=E;exports.D=V;exports.E=G;exports.F=W;exports.G=S;exports.H=f;exports.I=I;exports.J=H;exports.K=i;exports.L=M;exports.M=q;exports.N=J;exports.O=Q;exports.P=X;exports.Q=Y;exports.R=Z;exports.S=u;exports.T=_;exports.U=$;exports.V=nn;exports.W=rn;exports.a=T;exports.b=a;exports.c=c;exports.d=p;exports.e=y;exports.f=s;exports.g=x;exports.h=h;exports.i=w;exports.j=m;exports.k=k;exports.l=D;exports.m=b;exports.n=g;exports.o=R;exports.p=C;exports.q=P;exports.r=B;exports.s=O;exports.t=A;exports.u=U;exports.v=v;exports.w=z;exports.x=L;exports.y=K;exports.z=j;
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-JZXLCA2E.mjs';var q={};a$1(q,{contrast:()=>y,darken:()=>$,desaturate:()=>G,formatHsl:()=>T,formatRgb:()=>R,getContrastColor:()=>C,getDominant:()=>D,getTemperature:()=>W,grayscale:()=>S,hexToRgb:()=>i,hslToRgb:()=>m,invert:()=>w,isDark:()=>L,isLight:()=>x,isSimilar:()=>v,lighten:()=>H,luminance:()=>p,mix:()=>k,opacity:()=>I,parseColor:()=>d,rgbToHex:()=>a,rgbToHsl:()=>c,saturate:()=>B});function i(t){let r=t.replace(/^#/,"");if(r.length===3){let n=parseInt(r[0]+r[0],16),e=parseInt(r[1]+r[1],16),o=parseInt(r[2]+r[2],16);return {r:n,g:e,b:o}}if(r.length===6){let n=parseInt(r.substring(0,2),16),e=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16);return {r:n,g:e,b:o}}return null}function a(t){let r=n=>{let e=Math.round(Math.max(0,Math.min(255,n))).toString(16);return e.length===1?"0"+e:e};return `#${r(t.r)}${r(t.g)}${r(t.b)}`}function c(t){let r=t.r/255,n=t.g/255,e=t.b/255,o=Math.max(r,n,e),s=Math.min(r,n,e),u=o-s,b=0,f=0,h=(o+s)/2;if(u!==0)switch(f=h>.5?u/(2-o-s):u/(o+s),o){case r:b=((n-e)/u+(n<e?6:0))/6;break;case n:b=((e-r)/u+2)/6;break;case e:b=((r-n)/u+4)/6;break}return {h:Math.round(b*360),s:Math.round(f*100),l:Math.round(h*100)}}function m(t){let r=t.h/360,n=t.s/100,e=t.l/100,o,s,u;if(n===0)o=s=u=e;else {let b=(l,M,g)=>(g<0&&(g+=1),g>1&&(g-=1),g<.16666666666666666?l+(M-l)*6*g:g<.5?M:g<.6666666666666666?l+(M-l)*(.6666666666666666-g)*6:l),f=e<.5?e*(1+n):e+n-e*n,h=2*e-f;o=b(h,f,r+1/3),s=b(h,f,r),u=b(h,f,r-1/3);}return {r:Math.round(o*255),g:Math.round(s*255),b:Math.round(u*255)}}function d(t){if(t.startsWith("#"))return i(t);let r=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);return r?{r:parseInt(r[1],10),g:parseInt(r[2],10),b:parseInt(r[3],10)}:null}function R(t){return `rgb(${t.r}, ${t.g}, ${t.b})`}function T(t){return `hsl(${t.h}, ${t.s}%, ${t.l}%)`}function H(t,r){let n=i(t);if(!n)return t;let e=c(n);return e.l=Math.min(100,e.l+r),a(m(e))}function $(t,r){let n=i(t);if(!n)return t;let e=c(n);return e.l=Math.max(0,e.l-r),a(m(e))}function B(t,r){let n=i(t);if(!n)return t;let e=c(n);return e.s=Math.min(100,e.s+r),a(m(e))}function G(t,r){let n=i(t);if(!n)return t;let e=c(n);return e.s=Math.max(0,e.s-r),a(m(e))}function I(t,r){let n=i(t);if(!n)return t;let e=Math.max(0,Math.min(1,r));return `rgba(${n.r}, ${n.g}, ${n.b}, ${e})`}function k(t,r,n=.5){let e=i(t),o=i(r);if(!e||!o)return t;let s=Math.max(0,Math.min(1,n)),u={r:Math.round(e.r*s+o.r*(1-s)),g:Math.round(e.g*s+o.g*(1-s)),b:Math.round(e.b*s+o.b*(1-s))};return a(u)}function w(t){let r=i(t);return r?a({r:255-r.r,g:255-r.g,b:255-r.b}):t}function S(t){let r=i(t);if(!r)return t;let n=Math.round(.299*r.r+.587*r.g+.114*r.b);return a({r:n,g:n,b:n})}function p(t){let r=i(t);if(!r)return 0;let[n,e,o]=[r.r,r.g,r.b].map(s=>{let u=s/255;return u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4)});return .2126*n+.7152*e+.0722*o}function y(t,r){let n=p(t),e=p(r),o=Math.max(n,e),s=Math.min(n,e);return (o+.05)/(s+.05)}function x(t){return p(t)>.5}function L(t){return !x(t)}function C(t){return x(t)?"#000000":"#ffffff"}function v(t,r,n=10){let e=i(t),o=i(r);return !e||!o?false:Math.sqrt(Math.pow(e.r-o.r,2)+Math.pow(e.g-o.g,2)+Math.pow(e.b-o.b,2))<=n}function D(t){let r=i(t);if(!r)return null;let n=Math.max(r.r,r.g,r.b);return r.r===n?"red":r.g===n?"green":"blue"}function W(t){let r=i(t);if(!r)return "neutral";let n=c(r);return n.h>=0&&n.h<=60?"warm":n.h>=180&&n.h<=300?"cool":"neutral"}export{i as a,a as b,c,m as d,d as e,R as f,T as g,H as h,$ as i,B as j,G as k,I as l,k as m,w as n,S as o,p,y as q,x as r,L as s,C as t,v as u,D as v,W as w,q as x};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkWOT6VMZA_js=require('./chunk-WOT6VMZA.js');var j={};chunkWOT6VMZA_js.a(j,{Bind:()=>d,Debounce:()=>y,Deprecated:()=>g,Frozen:()=>b,Lazy:()=>x,Log:()=>T,Measure:()=>h,Memoize:()=>f,Retry:()=>m,Sealed:()=>k,Throttle:()=>w,Validate:()=>D});function f(t){return function(i,u,n){let e=n.value;if(typeof e!="function")throw new Error("@Memoize can only be applied to methods");let r=new Map;return n.value=function(...o){let a=t?t(...o):o[0];if(r.has(a))return r.get(a);let s=e.apply(this,o);return r.set(a,s),s},n}}function y(t){return function(i,u,n){let e=n.value;if(typeof e!="function")throw new Error("@Debounce can only be applied to methods");let r;return n.value=function(...o){r!==void 0&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,o);},t);},n}}function w(t){return function(i,u,n){let e=n.value;if(typeof e!="function")throw new Error("@Throttle can only be applied to methods");let r=0,o;return n.value=function(...a){let s=Date.now(),p=t-(s-r);p<=0?(o!==void 0&&(clearTimeout(o),o=void 0),r=s,e.apply(this,a)):o===void 0&&(o=setTimeout(()=>{r=Date.now(),o=void 0,e.apply(this,a);},p));},n}}function d(){return function(t,i,u){let n=u.value;if(typeof n!="function")throw new Error("@Bind can only be applied to methods");return {configurable:true,enumerable:false,get(){let e=n.bind(this);return Object.defineProperty(this,i,{value:e,configurable:true,writable:true}),e}}}}function T(t){let i=t?.prefix??"";return function(u,n,e){let r=e.value;if(typeof r!="function")throw new Error("@Log can only be applied to methods");return e.value=function(...o){let a=String(n),s=o.map(c=>JSON.stringify(c)).join(", "),p=r.apply(this,o);return p instanceof Promise?p.then(c=>(console.log(`${i}${a}(${s}) => ${JSON.stringify(c)}`),c)):(console.log(`${i}${a}(${s}) => ${JSON.stringify(p)}`),p)},e}}function h(t){return function(i,u,n){let e=n.value;if(typeof e!="function")throw new Error("@Measure can only be applied to methods");let r=t?.label??String(u);return n.value=function(...o){let a=performance.now(),s=e.apply(this,o);if(s instanceof Promise)return s.finally(()=>{let c=performance.now()-a;console.log(`${r} took ${c.toFixed(2)}ms`);});let p=performance.now()-a;return console.log(`${r} took ${p.toFixed(2)}ms`),s},n}}function m(t){let i=t?.attempts??3,u=t?.delay??0,n=t?.onRetry;return function(e,r,o){let a=o.value;if(typeof a!="function")throw new Error("@Retry can only be applied to methods");return o.value=async function(...s){let p;for(let c=1;c<=i;c++)try{let l=a.apply(this,s);return l instanceof Promise?await l:l}catch(l){p=l,c<i&&(n?.(l,c),u>0&&await new Promise(P=>setTimeout(P,u)));}throw p},o}}function g(t){return function(i,u,n){let e=n.value;if(typeof e!="function")throw new Error("@Deprecated can only be applied to methods");let r=String(u),o=t?`${r} is deprecated: ${t}`:`${r} is deprecated`;return n.value=function(...a){return console.warn(o),e.apply(this,a)},n}}function k(){return function(t){return Object.seal(t),Object.seal(t.prototype),t}}function b(){return function(t){return Object.freeze(t),Object.freeze(t.prototype),t}}function D(t,i){return function(u,n,e){let r=e.value;if(typeof r!="function")throw new Error("@Validate can only be applied to methods");let o=String(n);return e.value=function(...a){if(!t(...a))throw new Error(i??`Validation failed for ${o}`);return r.apply(this,a)},e}}function x(){return function(t,i,u){let n=u.get;if(typeof n!="function")throw new Error("@Lazy can only be applied to getters");return u.get=function(){let e=n.call(this);return Object.defineProperty(this,i,{value:e,configurable:false,writable:false}),e},u}}exports.a=f;exports.b=y;exports.c=w;exports.d=d;exports.e=T;exports.f=h;exports.g=m;exports.h=g;exports.i=k;exports.j=b;exports.k=D;exports.l=x;exports.m=j;
@@ -0,0 +1 @@
1
+ var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:true});};export{e as a};
@@ -0,0 +1 @@
1
+ function b(e){return Object.freeze(e)}function K(e){let t={};for(let n of e)t[n]=n;return Object.freeze(t)}function h(...e){return e}function w(e){return new Map(e)}function S(e){return new Set(e)}function v(e){return e}function R(e,t){return t(e)?e:void 0}function x(e={}){return {set(t,n){return x({...e,[t]:n})},build(){return e},current(){return e}}}function E(e){return {config:e,getInitialState:()=>e.initial,transition:(t,n)=>{let r=e.states[t];return r&&"on"in r?r.on[n]??t:t}}}function M(){return new Proxy({},{get:(e,t)=>n=>({type:t,...n})})}function V(){let e=new Map;return {on(t,n){return e.has(t)||e.set(t,new Set),e.get(t).add(n),()=>{e.get(t)?.delete(n);}},emit(t,n){e.get(t)?.forEach(r=>r(n));},off(t,n){e.get(t)?.delete(n);},clear(){e.clear();}}}function _(e,t){return {initialState:e,reduce:(n,r)=>{let o=t[r.type];return o?o(n,r):n}}}var A=Symbol("string"),U=Symbol("number"),O=Symbol("boolean"),I=Symbol("date"),D=Symbol("bigint"),B=Symbol("symbol"),P=Symbol("any"),j=Symbol("unknown"),N=Symbol("null"),C=Symbol("undefined"),q={string:{[A]:true},number:{[U]:true},boolean:{[O]:true},date:{[I]:true},bigint:{[D]:true},symbol:{[B]:true},any:{[P]:true},unknown:{[j]:true},null:{[N]:true},undefined:{[C]:true},array:e=>({__array:e}),optional:e=>({__optional:e}),nullable:e=>({__nullable:e}),literal:e=>({__literal:e}),enum:(...e)=>({__enum:e}),union:(...e)=>({__union:e}),record:e=>({__record:e}),tuple:(...e)=>({__tuple:e}),ref:()=>({__ref:null})};function d(e){return {__schema:null,__definition:e,create(n){return n},partial(n){return n},is(n){if(typeof n!="object"||n===null)return false;for(let r of Object.keys(e))if(!(r in n)){let o=e[r];if(o&&typeof o=="object"&&"__optional"in o)continue;return false}return true},extend(n){return d({...e,...n})},pick(...n){let r={};for(let o of n)r[o]=e[o];return d(r)},omit(...n){let r={...e};for(let o of n)delete r[o];return d(r)},asPartial(){let n={};for(let r of Object.keys(e))n[r]={__optional:e[r]};return d(n)},asRequired(){let n={};for(let r of Object.keys(e)){let o=e[r];o&&typeof o=="object"&&"__optional"in o?n[r]=o.__optional:n[r]=o;}return d(n)}}}function F(e){return d(e)}function W(e,t){return d({...e.__definition,...t.__definition})}function $(e,...t){return e.pick(...t)}function H(e,...t){return e.omit(...t)}function i(e,t){return {parse:e,safeParse(r){try{return {ok:!0,value:e(r)}}catch(o){return {ok:false,error:o instanceof Error?o:new Error(String(o))}}},is(r){if(t)return t(r);try{return e(r),!0}catch{return false}},T:void 0,optional(){return i(r=>r===void 0?void 0:e(r),r=>r===void 0||(t?t(r):true))},nullable(){return i(r=>r===null?null:e(r),r=>r===null||(t?t(r):true))},default(r){return i(o=>o==null?r:e(o))},transform(r){return i(o=>r(e(o)))},refine(r,o="Validation failed"){return i(s=>{let a=e(s);if(!r(a))throw new Error(o);return a})}}}function T(){return i(e=>{if(typeof e!="string")throw new Error(`Expected string, got ${typeof e}`);return e},e=>typeof e=="string")}function L(){return i(e=>{if(typeof e!="number"||Number.isNaN(e))throw new Error(`Expected number, got ${typeof e}`);return e},e=>typeof e=="number"&&!Number.isNaN(e))}function J(){return i(e=>{if(typeof e!="boolean")throw new Error(`Expected boolean, got ${typeof e}`);return e},e=>typeof e=="boolean")}function G(){return i(e=>{if(e instanceof Date)return e;if(typeof e=="string"||typeof e=="number"){let t=new Date(e);if(Number.isNaN(t.getTime()))throw new Error("Invalid date");return t}throw new Error(`Expected date, got ${typeof e}`)},e=>e instanceof Date&&!Number.isNaN(e.getTime()))}function z(e){return i(t=>{if(t!==e)throw new Error(`Expected ${String(e)}, got ${String(t)}`);return e},t=>t===e)}function Y(...e){return i(t=>{if(!e.includes(t))throw new Error(`Expected one of [${e.join(", ")}], got ${String(t)}`);return t},t=>e.includes(t))}function Z(){let e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return T().refine(t=>e.test(t),"Invalid email")}function Q(){return T().refine(e=>{try{return new URL(e),!0}catch{return false}},"Invalid URL")}function X(){let e=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;return T().refine(t=>e.test(t),"Invalid UUID")}function u(e){let n=i(r=>{if(typeof r!="object"||r===null)throw new Error(`Expected object, got ${typeof r}`);let o={},s=e;for(let a of Object.keys(s)){let p=s[a];p&&(o[a]=p.parse(r[a]));}return o},r=>{if(typeof r!="object"||r===null)return false;let o=e;for(let s of Object.keys(o)){let a=o[s];if(a&&!a.is(r[s]))return false}return true});return n.schema=e,n.pick=(...r)=>{let o={};for(let s of r)o[s]=e[s];return u(o)},n.omit=(...r)=>{let o={...e};for(let s of r)delete o[s];return u(o)},n.extend=r=>u({...e,...r}),n.partial=()=>{let r={},o=e;for(let s of Object.keys(o)){let a=o[s];a&&(r[s]=a.optional());}return u(r)},n.merge=r=>u({...e,...r.schema}),n}function ee(e){return i(t=>{if(!Array.isArray(t))throw new Error(`Expected array, got ${typeof t}`);return t.map((n,r)=>{try{return e.parse(n)}catch(o){throw new Error(`[${r}]: ${o instanceof Error?o.message:String(o)}`)}})},t=>Array.isArray(t)&&t.every(n=>e.is(n)))}function te(...e){return i(t=>{if(!Array.isArray(t))throw new Error(`Expected tuple, got ${typeof t}`);if(t.length!==e.length)throw new Error(`Expected ${e.length} elements, got ${t.length}`);return e.map((n,r)=>n.parse(t[r]))},t=>Array.isArray(t)&&t.length===e.length&&e.every((n,r)=>n.is(t[r])))}function ne(e){return i(t=>{if(typeof t!="object"||t===null||Array.isArray(t))throw new Error(`Expected record, got ${typeof t}`);let n={};for(let[r,o]of Object.entries(t))n[r]=e.parse(o);return n},t=>typeof t!="object"||t===null||Array.isArray(t)?false:Object.values(t).every(n=>e.is(n)))}function re(...e){return i(t=>{for(let n of e){let r=n.safeParse(t);if(r.ok)return r.value}throw new Error("Value does not match any union member")},t=>e.some(n=>n.is(t)))}function oe(e,t){return i(n=>{let r=e.parse(n),o=t.parse(n);return {...r,...o}},n=>e.is(n)&&t.is(n))}var se={string:T,number:L,boolean:J,date:G,email:Z,url:Q,uuid:X,literal:z,enum:Y,object:u,array:ee,tuple:te,record:ne,union:re,intersection:oe,any:()=>i(e=>e),unknown:()=>i(e=>e),null:()=>i(e=>{if(e!==null)throw new Error("Expected null");return null}),undefined:()=>i(e=>{if(e!==void 0)throw new Error("Expected undefined")})};var l=class{_items=[];_listeners=new Set;get items(){return this._items}get length(){return this._items.length}notify(){for(let t of this._listeners)t(this._items);}add(t){return this._items.push(t),this.notify(),t}addMany(t){return this._items.push(...t),this.notify(),t}update(t,n){let r=this._items.findIndex(t);if(r!==-1)return this._items[r]={...this._items[r],...n},this.notify(),this._items[r]}updateWhere(t,n,r){return this.update(o=>o[t]===n,r)}remove(t){let n=[];return this._items=this._items.filter(r=>t(r)?(n.push(r),false):true),n.length>0&&this.notify(),n}removeWhere(t,n){return this.remove(o=>o[t]===n)[0]}clear(){this._items=[],this.notify();}findOne(t){return this._items.find(t)}find(t,n){return this._items.find(r=>r[t]===n)}findMany(t){return this._items.filter(t)}where(t){return this.findMany(t)}whereEquals(t,n){return this._items.filter(r=>r[t]===n)}some(t){return this._items.some(t)}every(t){return this._items.every(t)}has(t,n){return this._items.some(r=>r[t]===n)}first(){return this._items[0]}last(){return this._items[this._items.length-1]}at(t){return this._items.at(t)}map(t){return this._items.map(t)}pluck(t){return this._items.map(n=>n[t])}pick(...t){return this._items.map(n=>{let r={};for(let o of t)r[o]=n[o];return r})}omit(...t){return this._items.map(n=>{let r={...n};for(let o of t)delete r[o];return r})}sortBy(t,n="asc"){return [...this._items].sort((r,o)=>{let s=r[t],a=o[t];return s<a?n==="asc"?-1:1:s>a?n==="asc"?1:-1:0})}groupBy(t){let n=new Map;for(let r of this._items){let o=r[t],s=n.get(o)||[];s.push(r),n.set(o,s);}return n}unique(t){return [...new Set(this._items.map(n=>n[t]))]}count(t){return t?this._items.filter(t).length:this._items.length}subscribe(t){return this._listeners.add(t),()=>this._listeners.delete(t)}toArray(){return [...this._items]}toJSON(){return JSON.stringify(this._items)}fromJSON(t){this._items=JSON.parse(t),this.notify();}},c=class extends l{constructor(n){super();this.idKey=n;}byId(n){return this.find(this.idKey,n)}updateById(n,r){return this.updateWhere(this.idKey,n,r)}removeById(n){return this.removeWhere(this.idKey,n)}hasId(n){return this.has(this.idKey,n)}},ie={async get(e){return typeof localStorage>"u"?null:localStorage.getItem(e)},async set(e,t){typeof localStorage>"u"||localStorage.setItem(e,t);},async remove(e){typeof localStorage>"u"||localStorage.removeItem(e);}},f=class extends l{constructor(n,r=ie){super();this.storageKey=n;this.storage=r;}autoSaveEnabled=false;unsubscribe;async save(){await this.storage.set(this.storageKey,this.toJSON());}async load(){let n=await this.storage.get(this.storageKey);n&&this.fromJSON(n);}enableAutoSave(){this.autoSaveEnabled||(this.autoSaveEnabled=true,this.unsubscribe=this.subscribe(()=>{this.save();}));}disableAutoSave(){this.autoSaveEnabled=false,this.unsubscribe?.();}};function ae(e){return new l}function de(e,t){return new c(t)}function ue(e,t,n){return new f(t,n)}function le(e,t){if(t?.persist){let n=new f(t.persist,t.storage);return t.autoSave&&n.enableAutoSave(),n}return t?.idKey?new c(t.idKey):new l}function Te(){return {idle:()=>({status:"idle"}),loading:()=>({status:"loading"}),success:e=>({status:"success",data:e}),error:e=>({status:"error",error:e}),isIdle:e=>e.status==="idle",isLoading:e=>e.status==="loading",isSuccess:e=>e.status==="success",isError:e=>e.status==="error",map:(e,t)=>e.status==="success"?{status:"success",data:t(e.data)}:e,getOrElse:(e,t)=>e.status==="success"?e.data:t}}function ce(e){return {pristine:()=>({status:"pristine",values:e}),dirty:(t,n)=>({status:"dirty",values:t,touched:n}),validating:t=>({status:"validating",values:t}),invalid:(t,n)=>({status:"invalid",values:t,errors:n}),submitting:t=>({status:"submitting",values:t}),submitted:t=>({status:"submitted",values:t}),error:(t,n)=>({status:"error",values:t,error:n}),canSubmit:t=>t.status==="dirty"||t.status==="pristine",isSubmitting:t=>t.status==="submitting",hasErrors:t=>t.status==="invalid"}}function fe(){return {closed:()=>({isOpen:false}),open:e=>({isOpen:true,data:e}),isOpen:e=>e.isOpen}}function ye(e){return {init:()=>({current:e,past:[],future:[],canUndo:false,canRedo:false}),push:(t,n)=>({current:n,past:[...t.past,t.current],future:[],canUndo:true,canRedo:false}),undo:t=>t.past.length===0?t:{current:t.past[t.past.length-1],past:t.past.slice(0,-1),future:[t.current,...t.future],canUndo:t.past.length>1,canRedo:true},redo:t=>t.future.length===0?t:{current:t.future[0],past:[...t.past,t.current],future:t.future.slice(1),canUndo:true,canRedo:t.future.length>1}}}function pe(e,t){return new y(e,t,{})}var y=class e{value;discriminant;handlers;result=void 0;matched=false;constructor(t,n,r){this.value=t,this.discriminant=n,this.handlers=r;}with(t,n){let r={...this.handlers,[t]:n},o=new e(this.value,this.discriminant,r),s=this.value[this.discriminant];return !this.matched&&s===t?(o.result=n(this.value),o.matched=true):(o.result=this.result,o.matched=this.matched),o}exhaustive(){if(this.matched)return this.result;throw new Error(`No handler matched for discriminant value: ${String(this.value[this.discriminant])}`)}otherwise(t){return this.matched?this.result:t(this.value)}run(){return this.exhaustive()}};function xe(e,t){let n=t[e];if(!n)throw new Error(`No handler for value: ${String(e)}`);return n()}function m(e,t,n){let r=e[t],o=n[r];return o(e)}function me(){return e=>(t,n)=>m(t,e,n)}function ge(e){return e}function ke(e){}function be(e){throw new Error(`Unexpected value: ${JSON.stringify(e)}`)}function Ke(e){return e}function he(e){return e}function we(e,t){return {...e,...t}}function Se(...e){return Object.assign({},...e)}function k(e,t){let n={...e};for(let r of Object.keys(t)){let o=t[r],s=e[r];g(o)&&g(s)?n[r]=k(s,o):n[r]=o;}return n}function g(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}function ve(e,t,n){let r={...e,...t};for(let o of Object.keys(n)){let s=n[o];s&&o in e&&o in t&&(r[o]=s(e[o],t[o]));}return r}function Re(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Ee(e,t){let n={...e};for(let r of t)delete n[r];return n}function Me(e,t){let n={};for(let r of Object.keys(e)){let o=t[r];o!==void 0?n[o]=e[r]:n[r]=e[r];}return n}function Ve(e){return Object.fromEntries(e)}function _e(e,t){let n={};for(let r of Object.keys(e))n[r]=t(e[r],r);return n}function Ae(e,t){let n={};for(let r of Object.keys(e)){let o=t(r);n[o]=e[r];}return n}export{ye as A,pe as B,xe as C,m as D,me as E,ge as F,ke as G,be as H,Ke as I,he as J,we as K,Se as L,k as M,ve as N,Re as O,Ee as P,Me as Q,Ve as R,_e as S,Ae as T,b as a,K as b,h as c,w as d,S as e,v as f,R as g,x as h,E as i,M as j,V as k,_ as l,q as m,d as n,F as o,W as p,$ as q,H as r,se as s,ae as t,de as u,ue as v,le as w,Te as x,ce as y,fe as z};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-JZXLCA2E.mjs';var S={};a(S,{createMemoryStorage:()=>m,createStorage:()=>s,getCookie:()=>l,hasCookie:()=>x,localStorageTyped:()=>g,removeCookie:()=>d,sessionStorageTyped:()=>p,setCookie:()=>u,withExpiry:()=>c});function s(e,r){let{storage:t,defaultValue:i,serializer:o=JSON}=r;return {get(){try{let n=t.getItem(e);return n===null?i??null:o.parse(n)}catch{return i??null}},set(n){try{let a=o.stringify(n);t.setItem(e,a);}catch(a){console.error(`Failed to set storage key "${e}":`,a);}},remove(){t.removeItem(e);},clear(){t.clear();},has(){return t.getItem(e)!==null}}}function g(e,r){return s(e,{storage:localStorage,defaultValue:r})}function p(e,r){return s(e,{storage:sessionStorage,defaultValue:r})}function c(e,r){let{storage:t,ttl:i}=r;return {get(){try{let o=t.getItem(e);if(o===null)return null;let n=JSON.parse(o);return Date.now()>n.expiry?(t.removeItem(e),null):n.value}catch{return null}},set(o){try{let n={value:o,expiry:Date.now()+i};t.setItem(e,JSON.stringify(n));}catch(n){console.error(`Failed to set expiry storage key "${e}":`,n);}},remove(){t.removeItem(e);},isExpired(){try{let o=t.getItem(e);if(o===null)return !0;let n=JSON.parse(o);return Date.now()>n.expiry}catch{return true}},getExpiry(){try{let o=t.getItem(e);return o===null?null:JSON.parse(o).expiry}catch{return null}}}}function m(){let e=new Map;return {get length(){return e.size},getItem(r){return e.get(r)??null},setItem(r,t){e.set(r,t);},removeItem(r){e.delete(r);},clear(){e.clear();},key(r){return Array.from(e.keys())[r]??null}}}function l(e){if(typeof document>"u")return null;let t=`; ${document.cookie}`.split(`; ${e}=`);return t.length===2?t.pop()?.split(";").shift()??null:null}function u(e,r,t={}){if(typeof document>"u")return;let i=`${encodeURIComponent(e)}=${encodeURIComponent(r)}`;if(t.expires){let o=typeof t.expires=="number"?new Date(Date.now()+t.expires*864e5):t.expires;i+=`; expires=${o.toUTCString()}`;}t.path&&(i+=`; path=${t.path}`),t.domain&&(i+=`; domain=${t.domain}`),t.secure&&(i+="; secure"),t.sameSite&&(i+=`; samesite=${t.sameSite}`),document.cookie=i;}function d(e,r={}){u(e,"",{...r,expires:new Date(0)});}function x(e){return l(e)!==null}export{s as a,g as b,p as c,c as d,m as e,l as f,u as g,d as h,x as i,S as j};
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-JZXLCA2E.mjs';var rn={};a$1(rn,{allDefined:()=>S,allTrue:()=>R,allTruthy:()=>G,allWhere:()=>W,and:()=>g,andThen:()=>C,anyTrue:()=>B,chain:()=>u,coalesce:()=>v,coalesceLazy:()=>z,cond:()=>x,condBy:()=>w,condLazy:()=>h,defaultTo:()=>L,defaultToIf:()=>j,defaultToIfEmpty:()=>N,defaultToLazy:()=>K,firstDefined:()=>V,firstTruthy:()=>F,firstWhere:()=>E,get:()=>f,getOr:()=>i,getOrLazy:()=>q,getPath:()=>H,getPathOr:()=>M,getTyped:()=>I,ifElse:()=>y,ifElseLazy:()=>s,matchLazy:()=>D,matchType:()=>b,matchValue:()=>m,matchWithDefault:()=>k,not:()=>A,notFn:()=>U,optional:()=>_,optionalChain:()=>nn,optionalOr:()=>$,or:()=>P,orThen:()=>O,safe:()=>Y,tryGet:()=>J,tryGetOr:()=>Q,tryGetResult:()=>X,unless:()=>c,unlessValue:()=>p,unwrap:()=>Z,when:()=>T,whenValue:()=>a});function T(n,e){if(n)return e()}function a(n,e){return n?e:void 0}function c(n,e){if(!n)return e()}function p(n,e){return n?void 0:e}function y(n,e,r){return n?e:r}function s(n,e,r){return n?e():r()}function x(...n){for(let[e,r]of n)if(e)return r}function h(...n){for(let[e,r]of n)if(e)return r()}function w(n,...e){for(let[r,t]of e)if(r(n))return t}function m(n,e){return e[n]}function k(n,e,r){let t=e[n];return t!==void 0?t:r}function D(n,e){return e[n]()}function b(n,e){for(let[r,t]of e)if(r(n))return t(n)}function g(...n){if(n.length===0)return;for(let r=0;r<n.length-1;r++){let t=n[r];if(!t)return t}let e=n[n.length-1];return typeof e=="function"?e():e}function R(...n){return n.every(Boolean)}function C(n,e){return n.every(Boolean)?e():void 0}function P(...n){if(n.length!==0){for(let e of n)if(e)return e;return n[n.length-1]}}function B(...n){return n.some(Boolean)}function O(n,e){return n.some(Boolean)?e():void 0}function A(n){return !n}function U(n){return (...e)=>!n(...e)}function v(...n){for(let e of n)if(e!=null)return e}function z(...n){for(let e of n){let r=e();if(r!=null)return r}}function L(n,e){return n??e}function K(n,e){return n??e()}function j(n,e,r){return e(n)?n:r}function N(n,e){return n==null||n===""||Array.isArray(n)&&n.length===0||typeof n=="object"&&Object.keys(n).length===0?e:n}function F(n){for(let e of n)if(e)return e}function E(n,e){for(let r of n)if(e(r))return r}function V(n){for(let e of n)if(e!=null)return e}function G(n){return n.every(Boolean)}function W(n,e){return n.every(e)}function S(n){return n.every(e=>e!=null)}function f(n,...e){let r=n;for(let t of e){if(r==null)return;r=r[t];}return r}function I(n,e){return f(n,...e)}function H(n,e){let r=e.split(".").map(t=>{let o=Number(t);return Number.isNaN(o)?t:o});return f(n,...r)}function i(n,e,...r){let t=n;for(let o of r){if(t==null)return e;t=t[o];}return t??e}function M(n,e,r){let t=r.split(".").map(o=>{let l=Number(o);return Number.isNaN(l)?o:l});return i(n,e,...t)}function q(n,e,...r){let t=n;for(let o of r){if(t==null)return e();t=t[o];}return t??e()}function J(n){try{return n()}catch{return}}function Q(n,e){try{return n()}catch{return e}}function X(n){try{return {ok:!0,value:n()}}catch(e){return {ok:false,error:e}}}function Y(n){let e={get(r,t){if(r==null)return d();let o=r[t];return o==null?d():typeof o=="object"?new Proxy(o,e):o}};return n==null?d():new Proxy(n,e)}function d(){let n={get(){return d()}};return new Proxy({},n)}function Z(n){if(n!=null&&!(typeof n=="object"&&Object.keys(n).length===0))return n}function u(n){return {map(e){return n==null?u(void 0):u(e(n))},flatMap(e){return n==null?u(void 0):e(n)},filter(e){return n==null?u(void 0):e(n)?u(n):u(void 0)},tap(e){return n!=null&&e(n),u(n)},value(){return n??void 0},valueOr(e){return n??e},valueOrThrow(e){if(n==null)throw new Error(e??"Value is null or undefined");return n}}}function _(n,e){if(n!=null)return e(n)}function $(n,e,r){return n==null?r:e(n)}function nn(n,...e){let r=n;for(let t of e){if(r==null)return;r=t(r);}return r??void 0}export{N as A,F as B,E as C,V as D,G as E,W as F,S as G,f as H,I,H as J,i as K,M as L,q as M,J as N,Q as O,X as P,Y as Q,Z as R,u as S,_ as T,$ as U,nn as V,rn as W,T as a,a as b,c,p as d,y as e,s as f,x as g,h,w as i,m as j,k,D as l,b as m,g as n,R as o,C as p,P as q,B as r,O as s,A as t,U as u,v,z as w,L as x,K as y,j as z};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-JZXLCA2E.mjs';var j={};a(j,{Bind:()=>d,Debounce:()=>y,Deprecated:()=>g,Frozen:()=>b,Lazy:()=>x,Log:()=>T,Measure:()=>h,Memoize:()=>f,Retry:()=>m,Sealed:()=>k,Throttle:()=>w,Validate:()=>D});function f(t){return function(i,u,n){let e=n.value;if(typeof e!="function")throw new Error("@Memoize can only be applied to methods");let r=new Map;return n.value=function(...o){let a=t?t(...o):o[0];if(r.has(a))return r.get(a);let s=e.apply(this,o);return r.set(a,s),s},n}}function y(t){return function(i,u,n){let e=n.value;if(typeof e!="function")throw new Error("@Debounce can only be applied to methods");let r;return n.value=function(...o){r!==void 0&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,o);},t);},n}}function w(t){return function(i,u,n){let e=n.value;if(typeof e!="function")throw new Error("@Throttle can only be applied to methods");let r=0,o;return n.value=function(...a){let s=Date.now(),p=t-(s-r);p<=0?(o!==void 0&&(clearTimeout(o),o=void 0),r=s,e.apply(this,a)):o===void 0&&(o=setTimeout(()=>{r=Date.now(),o=void 0,e.apply(this,a);},p));},n}}function d(){return function(t,i,u){let n=u.value;if(typeof n!="function")throw new Error("@Bind can only be applied to methods");return {configurable:true,enumerable:false,get(){let e=n.bind(this);return Object.defineProperty(this,i,{value:e,configurable:true,writable:true}),e}}}}function T(t){let i=t?.prefix??"";return function(u,n,e){let r=e.value;if(typeof r!="function")throw new Error("@Log can only be applied to methods");return e.value=function(...o){let a=String(n),s=o.map(c=>JSON.stringify(c)).join(", "),p=r.apply(this,o);return p instanceof Promise?p.then(c=>(console.log(`${i}${a}(${s}) => ${JSON.stringify(c)}`),c)):(console.log(`${i}${a}(${s}) => ${JSON.stringify(p)}`),p)},e}}function h(t){return function(i,u,n){let e=n.value;if(typeof e!="function")throw new Error("@Measure can only be applied to methods");let r=t?.label??String(u);return n.value=function(...o){let a=performance.now(),s=e.apply(this,o);if(s instanceof Promise)return s.finally(()=>{let c=performance.now()-a;console.log(`${r} took ${c.toFixed(2)}ms`);});let p=performance.now()-a;return console.log(`${r} took ${p.toFixed(2)}ms`),s},n}}function m(t){let i=t?.attempts??3,u=t?.delay??0,n=t?.onRetry;return function(e,r,o){let a=o.value;if(typeof a!="function")throw new Error("@Retry can only be applied to methods");return o.value=async function(...s){let p;for(let c=1;c<=i;c++)try{let l=a.apply(this,s);return l instanceof Promise?await l:l}catch(l){p=l,c<i&&(n?.(l,c),u>0&&await new Promise(P=>setTimeout(P,u)));}throw p},o}}function g(t){return function(i,u,n){let e=n.value;if(typeof e!="function")throw new Error("@Deprecated can only be applied to methods");let r=String(u),o=t?`${r} is deprecated: ${t}`:`${r} is deprecated`;return n.value=function(...a){return console.warn(o),e.apply(this,a)},n}}function k(){return function(t){return Object.seal(t),Object.seal(t.prototype),t}}function b(){return function(t){return Object.freeze(t),Object.freeze(t.prototype),t}}function D(t,i){return function(u,n,e){let r=e.value;if(typeof r!="function")throw new Error("@Validate can only be applied to methods");let o=String(n);return e.value=function(...a){if(!t(...a))throw new Error(i??`Validation failed for ${o}`);return r.apply(this,a)},e}}function x(){return function(t,i,u){let n=u.get;if(typeof n!="function")throw new Error("@Lazy can only be applied to getters");return u.get=function(){let e=n.call(this);return Object.defineProperty(this,i,{value:e,configurable:false,writable:false}),e},u}}export{f as a,y as b,w as c,d,T as e,h as f,m as g,g as h,k as i,b as j,D as k,x as l,j as m};
@@ -0,0 +1 @@
1
+ import {a as a$2,b as b$1}from'./chunk-5FBZYPQM.mjs';import {a as a$1}from'./chunk-JZXLCA2E.mjs';var S={};a$1(S,{clamp:()=>y,coerceArray:()=>c,coerceString:()=>a,defaults:()=>x,isEmail:()=>b,isIpAddress:()=>R,isUrl:()=>l,isUuid:()=>N,parseBoolean:()=>p,parseDate:()=>m,parseInteger:()=>d,parseNumber:()=>u,parseUrl:()=>w,safeJsonParse:()=>f,safeJsonStringify:()=>s,trimAll:()=>g});function f(r){try{let n=JSON.parse(r);return a$2(n)}catch(n){return b$1(n instanceof Error?n:new Error(String(n)))}}function s(r,n,e){try{let t=JSON.stringify(r,n,e);return a$2(t)}catch(t){return b$1(t instanceof Error?t:new Error(String(t)))}}function u(r){if(r!=null){if(typeof r=="number")return Number.isNaN(r)?void 0:r;if(typeof r=="string"){let n=r.trim();if(n==="")return;let e=Number(n);return Number.isNaN(e)?void 0:e}}}function d(r){if(r!=null){if(typeof r=="number")return Number.isNaN(r)?void 0:Math.trunc(r);if(typeof r=="string"){let n=r.trim();if(n==="")return;let e=parseInt(n,10);return Number.isNaN(e)?void 0:e}}}function p(r){if(r!=null){if(typeof r=="boolean")return r;if(typeof r=="number")return r===1?true:r===0?false:void 0;if(typeof r=="string"){let n=r.toLowerCase().trim();if(["true","1","yes","on"].includes(n))return true;if(["false","0","no","off"].includes(n))return false}}}function m(r){if(r!=null){if(r instanceof Date)return Number.isNaN(r.getTime())?void 0:r;if(typeof r=="number"){let n=new Date(r);return Number.isNaN(n.getTime())?void 0:n}if(typeof r=="string"){let n=r.trim();if(n==="")return;let e=new Date(n);return Number.isNaN(e.getTime())?void 0:e}}}function a(r){return r==null?"":typeof r=="string"?r:String(r)}function c(r){return r==null?[]:Array.isArray(r)?[...r]:[r]}function g(r){let n={...r};for(let e of Object.keys(n)){let t=n[e];typeof t=="string"&&(n[e]=t.trim());}return n}function x(r,n,e={}){let{treatEmptyStringAsNull:t=true}=e;return r==null||t&&r===""?n:r}function y(r,n,e){if(n>e)throw new Error("min must be less than or equal to max");return Math.min(Math.max(r,n),e)}function b(r){return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)}function l(r){try{return new URL(r),!0}catch{return false}}function N(r){return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(r)}function R(r){return A(r)||k(r)}function A(r){return /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(r)}function k(r){return /^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$|^::(?:[0-9a-fA-F]{1,4}:){0,6}[0-9a-fA-F]{1,4}$|^(?:[0-9a-fA-F]{1,4}:){1,7}:$|^(?:[0-9a-fA-F]{1,4}:){0,6}::(?:[0-9a-fA-F]{1,4}:){0,5}[0-9a-fA-F]{1,4}$/.test(r)}function w(r){try{return new URL(r)}catch{return}}export{f as a,s as b,u as c,d,p as e,m as f,a as g,c as h,g as i,x as j,y as k,b as l,l as m,N as n,R as o,w as p,S as q};
@@ -0,0 +1 @@
1
+ 'use strict';function t(r){return {ok:true,value:r}}function o(r){return {ok:false,error:r}}exports.a=t;exports.b=o;