@kosdev-code/kos-ui-sdk 3.0.26 → 3.0.27

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 (339) hide show
  1. package/.kos.json +2 -1
  2. package/common/events/async-event-bus.d.ts +8 -11
  3. package/common/events/async-event-bus.d.ts.map +1 -1
  4. package/common/events/eventBus.d.ts +1 -18
  5. package/common/events/eventBus.d.ts.map +1 -1
  6. package/core/core/companion-instantiator.d.ts +5 -0
  7. package/core/core/companion-instantiator.d.ts.map +1 -1
  8. package/core/core/decorators/index.d.ts +1 -0
  9. package/core/core/decorators/index.d.ts.map +1 -1
  10. package/core/core/decorators/kos-child.d.ts +2 -3
  11. package/core/core/decorators/kos-child.d.ts.map +1 -1
  12. package/core/core/decorators/kos-companion.d.ts +25 -87
  13. package/core/core/decorators/kos-companion.d.ts.map +1 -1
  14. package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts +2 -0
  15. package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts.map +1 -0
  16. package/core/core/decorators/kos-container-aware.d.ts +191 -420
  17. package/core/core/decorators/kos-container-aware.d.ts.map +1 -1
  18. package/core/core/decorators/kos-execute-service-request.d.ts +7 -11
  19. package/core/core/decorators/kos-execute-service-request.d.ts.map +1 -1
  20. package/core/core/decorators/kos-execution-context.d.ts +14 -31
  21. package/core/core/decorators/kos-execution-context.d.ts.map +1 -1
  22. package/core/core/decorators/kos-future-aware.d.ts +21 -74
  23. package/core/core/decorators/kos-future-aware.d.ts.map +1 -1
  24. package/core/core/decorators/kos-http-decorators.d.ts +18 -62
  25. package/core/core/decorators/kos-http-decorators.d.ts.map +1 -1
  26. package/core/core/decorators/kos-logger-aware.d.ts +10 -60
  27. package/core/core/decorators/kos-logger-aware.d.ts.map +1 -1
  28. package/core/core/decorators/kos-mixin.d.ts +67 -0
  29. package/core/core/decorators/kos-mixin.d.ts.map +1 -0
  30. package/core/core/decorators/kos-model-effect.d.ts +10 -9
  31. package/core/core/decorators/kos-model-effect.d.ts.map +1 -1
  32. package/core/core/decorators/kos-multiple-future-aware.d.ts +21 -94
  33. package/core/core/decorators/kos-multiple-future-aware.d.ts.map +1 -1
  34. package/core/core/decorators/kos-reload-aware.d.ts +14 -16
  35. package/core/core/decorators/kos-reload-aware.d.ts.map +1 -1
  36. package/core/core/decorators/kos-service-request.d.ts +80 -238
  37. package/core/core/decorators/kos-service-request.d.ts.map +1 -1
  38. package/core/core/decorators/kos-state-machine.d.ts +35 -275
  39. package/core/core/decorators/kos-state-machine.d.ts.map +1 -1
  40. package/core/core/decorators/kos-topic-handler-flow-control.d.ts +11 -3
  41. package/core/core/decorators/kos-topic-handler-flow-control.d.ts.map +1 -1
  42. package/core/core/decorators/kos-trouble-aware.d.ts +9 -43
  43. package/core/core/decorators/kos-trouble-aware.d.ts.map +1 -1
  44. package/core/core/decorators/kos-view-model.d.ts +20 -100
  45. package/core/core/decorators/kos-view-model.d.ts.map +1 -1
  46. package/core/core/decorators/kosModel.d.ts.map +1 -1
  47. package/core/core/decorators/kosTopicHandler.d.ts +28 -89
  48. package/core/core/decorators/kosTopicHandler.d.ts.map +1 -1
  49. package/core/core/decorators/propKeys.d.ts +1 -0
  50. package/core/core/decorators/propKeys.d.ts.map +1 -1
  51. package/core/core/indexing/index.d.ts +2 -4
  52. package/core/core/indexing/index.d.ts.map +1 -1
  53. package/core/core/indexing/kos-container-index-aware.d.ts +17 -48
  54. package/core/core/indexing/kos-container-index-aware.d.ts.map +1 -1
  55. package/core/core/indexing/kos-index-aware.d.ts +11 -37
  56. package/core/core/indexing/kos-index-aware.d.ts.map +1 -1
  57. package/core/core/kos-container-index.d.ts +11 -0
  58. package/core/core/kos-container-index.d.ts.map +1 -1
  59. package/core/core/kos-container-model.d.ts +11 -32
  60. package/core/core/kos-container-model.d.ts.map +1 -1
  61. package/core/core/kos-data-container.d.ts +6 -6
  62. package/core/core/kos-data-container.d.ts.map +1 -1
  63. package/core/core/kosCore.d.ts +7 -4
  64. package/core/core/kosCore.d.ts.map +1 -1
  65. package/core/core/kosModel.d.ts +16 -8
  66. package/core/core/kosModel.d.ts.map +1 -1
  67. package/core/core/kosModelManager.d.ts +2 -3
  68. package/core/core/kosModelManager.d.ts.map +1 -1
  69. package/core/core/lifecycle/constants.d.ts +6 -2
  70. package/core/core/lifecycle/constants.d.ts.map +1 -1
  71. package/core/core/lifecycle/kosCoreLifecycle.d.ts +11 -1
  72. package/core/core/lifecycle/kosCoreLifecycle.d.ts.map +1 -1
  73. package/core/core/lifecycle/kosModelLifecycle.d.ts +6 -0
  74. package/core/core/lifecycle/kosModelLifecycle.d.ts.map +1 -1
  75. package/core/core/lifecycle/model-machine.d.ts +6 -0
  76. package/core/core/lifecycle/model-machine.d.ts.map +1 -1
  77. package/core/core/model/kos-fsm-manager.d.ts +6 -0
  78. package/core/core/model/kos-fsm-manager.d.ts.map +1 -1
  79. package/core/core/model/kos-offline-queue.d.ts +1 -1
  80. package/core/core/model/kos-subscription-manager.d.ts.map +1 -1
  81. package/core/core/model/service-response-store.d.ts +2 -15
  82. package/core/core/model/service-response-store.d.ts.map +1 -1
  83. package/core/core/reconnect/reconnect-fixture.d.ts +17 -0
  84. package/core/core/reconnect/reconnect-fixture.d.ts.map +1 -0
  85. package/core/core/registration/model-registration.d.ts.map +1 -1
  86. package/core/core/services/app-startup-service.d.ts +5 -13
  87. package/core/core/services/app-startup-service.d.ts.map +1 -1
  88. package/core/core/services/intent-service.d.ts +3 -12
  89. package/core/core/services/intent-service.d.ts.map +1 -1
  90. package/core/core/transport/mock/mock-frames.d.ts +3 -3
  91. package/core/core/transport/transport.d.ts +1 -1
  92. package/core/core/transport/transport.d.ts.map +1 -1
  93. package/core/core/transport/webSocketTransport.d.ts +10 -0
  94. package/core/core/transport/webSocketTransport.d.ts.map +1 -1
  95. package/core/types/model.d.ts +4 -8
  96. package/core/types/model.d.ts.map +1 -1
  97. package/core/types/service-response-store.d.ts +3 -11
  98. package/core/types/service-response-store.d.ts.map +1 -1
  99. package/core/types/utils/kos-fetch.d.ts +25 -37
  100. package/core/types/utils/kos-fetch.d.ts.map +1 -1
  101. package/core/util/abortable-when.d.ts +5 -6
  102. package/core/util/abortable-when.d.ts.map +1 -1
  103. package/core/util/ancestor-path-visitor.d.ts +14 -20
  104. package/core/util/ancestor-path-visitor.d.ts.map +1 -1
  105. package/core/util/container-utils.d.ts +26 -159
  106. package/core/util/container-utils.d.ts.map +1 -1
  107. package/core/util/date-utils.d.ts +9 -58
  108. package/core/util/date-utils.d.ts.map +1 -1
  109. package/core/util/debounce.d.ts +1 -8
  110. package/core/util/debounce.d.ts.map +1 -1
  111. package/core/util/kos-fetch.d.ts +1 -1
  112. package/core/util/kos-fetch.d.ts.map +1 -1
  113. package/core/util/kos-model-utils.d.ts +10 -11
  114. package/core/util/kos-model-utils.d.ts.map +1 -1
  115. package/core/util/model-attribute-utils.d.ts +5 -22
  116. package/core/util/model-attribute-utils.d.ts.map +1 -1
  117. package/core/util/model-type-guards.d.ts.map +1 -1
  118. package/core/util/promise-utils.d.ts +1 -26
  119. package/core/util/promise-utils.d.ts.map +1 -1
  120. package/core/util/service-factory.d.ts +5 -23
  121. package/core/util/service-factory.d.ts.map +1 -1
  122. package/core/util/service-request-error.d.ts +3 -5
  123. package/core/util/service-request-error.d.ts.map +1 -1
  124. package/core/util/service-response.d.ts +12 -67
  125. package/core/util/service-response.d.ts.map +1 -1
  126. package/core/util/transport-not-ready-error.d.ts +11 -13
  127. package/core/util/transport-not-ready-error.d.ts.map +1 -1
  128. package/core/util/when-ready.d.ts +1 -8
  129. package/core/util/when-ready.d.ts.map +1 -1
  130. package/index.cjs +692 -11760
  131. package/index.cjs.map +1 -1
  132. package/index.js +774 -11846
  133. package/index.js.map +1 -1
  134. package/models/decorators/future-service.d.ts +7 -7
  135. package/models/models/browser-router/browser-router-model.d.ts +10 -39
  136. package/models/models/browser-router/browser-router-model.d.ts.map +1 -1
  137. package/models/models/browser-router/browser-router-registration.d.ts +5 -77
  138. package/models/models/browser-router/browser-router-registration.d.ts.map +1 -1
  139. package/models/models/browser-router/types/index.d.ts +2 -16
  140. package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts +5 -77
  141. package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts.map +1 -1
  142. package/models/models/canvas-renderer/canvas-renderer-registration.d.ts +5 -75
  143. package/models/models/canvas-renderer/canvas-renderer-registration.d.ts.map +1 -1
  144. package/models/models/config-bean/config-bean-model-builder.d.ts +4 -11
  145. package/models/models/config-bean/config-bean-model-builder.d.ts.map +1 -1
  146. package/models/models/config-bean/config-bean-model.d.ts +23 -66
  147. package/models/models/config-bean/config-bean-model.d.ts.map +1 -1
  148. package/models/models/config-bean-prop/config-bean-prop-model.d.ts +15 -62
  149. package/models/models/config-bean-prop/config-bean-prop-model.d.ts.map +1 -1
  150. package/models/models/config-bean-prop/types/index.d.ts +34 -215
  151. package/models/models/device/device-model.d.ts +20 -199
  152. package/models/models/device/device-model.d.ts.map +1 -1
  153. package/models/models/device/device-registration.d.ts +7 -87
  154. package/models/models/device/device-registration.d.ts.map +1 -1
  155. package/models/models/device/types/index.d.ts +5 -34
  156. package/models/models/future/future-aware.d.ts +7 -71
  157. package/models/models/future/future-aware.d.ts.map +1 -1
  158. package/models/models/future/future-model-builder.d.ts +2 -2
  159. package/models/models/future/future-model.d.ts +3 -23
  160. package/models/models/future/future-model.d.ts.map +1 -1
  161. package/models/models/future/future-types.d.ts +28 -145
  162. package/models/models/future/future-types.d.ts.map +1 -1
  163. package/models/models/gpio-chip/gpio-chip-builders.d.ts +14 -0
  164. package/models/models/gpio-chip/gpio-chip-builders.d.ts.map +1 -0
  165. package/models/models/gpio-chip/gpio-chip-container-model.d.ts +2 -1
  166. package/models/models/gpio-chip/gpio-chip-container-model.d.ts.map +1 -1
  167. package/models/models/key-value/key-value-model.d.ts +12 -72
  168. package/models/models/key-value/key-value-model.d.ts.map +1 -1
  169. package/models/models/key-value/key-value-registration.d.ts +5 -77
  170. package/models/models/key-value/key-value-registration.d.ts.map +1 -1
  171. package/models/models/key-value/services/key-value-services.d.ts +13 -72
  172. package/models/models/key-value/services/key-value-services.d.ts.map +1 -1
  173. package/models/models/key-value/types/index.d.ts +3 -46
  174. package/models/models/kos-expression-evaluator/expression-parse-cache.d.ts +29 -0
  175. package/models/models/kos-expression-evaluator/expression-parse-cache.d.ts.map +1 -0
  176. package/models/models/kos-expression-evaluator/index.d.ts +1 -0
  177. package/models/models/kos-expression-evaluator/index.d.ts.map +1 -1
  178. package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts +73 -105
  179. package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts.map +1 -1
  180. package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts +2 -12
  181. package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts.map +1 -1
  182. package/models/models/kos-log-manager/kos-log-manager-model.d.ts +7 -46
  183. package/models/models/kos-log-manager/kos-log-manager-model.d.ts.map +1 -1
  184. package/models/models/kos-log-manager/kos-log-manager-registration.d.ts +5 -80
  185. package/models/models/kos-log-manager/kos-log-manager-registration.d.ts.map +1 -1
  186. package/models/models/kos-log-manager/types/index.d.ts +13 -156
  187. package/models/models/kos-time/kos-time-model.d.ts +8 -39
  188. package/models/models/kos-time/kos-time-model.d.ts.map +1 -1
  189. package/models/models/kos-time/kos-time-registration.d.ts +6 -73
  190. package/models/models/kos-time/kos-time-registration.d.ts.map +1 -1
  191. package/models/models/kos-time/types/index.d.ts +3 -58
  192. package/models/models/log-block/log-block-container-model.d.ts +2 -118
  193. package/models/models/log-block/log-block-container-model.d.ts.map +1 -1
  194. package/models/models/log-block/log-block-container-registration.d.ts +5 -75
  195. package/models/models/log-block/log-block-container-registration.d.ts.map +1 -1
  196. package/models/models/log-block/log-block-model.d.ts +5 -168
  197. package/models/models/log-block/log-block-model.d.ts.map +1 -1
  198. package/models/models/log-block/log-block-registration.d.ts +5 -75
  199. package/models/models/log-block/log-block-registration.d.ts.map +1 -1
  200. package/models/models/log-block/types/index.d.ts +14 -81
  201. package/models/models/log-stream/log-stream-container-model.d.ts +8 -35
  202. package/models/models/log-stream/log-stream-container-model.d.ts.map +1 -1
  203. package/models/models/log-stream/log-stream-container-registration.d.ts +5 -75
  204. package/models/models/log-stream/log-stream-container-registration.d.ts.map +1 -1
  205. package/models/models/log-stream/log-stream-model.d.ts +8 -29
  206. package/models/models/log-stream/log-stream-model.d.ts.map +1 -1
  207. package/models/models/log-stream/log-stream-registration.d.ts +5 -75
  208. package/models/models/log-stream/log-stream-registration.d.ts.map +1 -1
  209. package/models/models/log-stream/types/index.d.ts +5 -60
  210. package/models/models/network-interface/network-interface-container-model.d.ts +6 -35
  211. package/models/models/network-interface/network-interface-container-model.d.ts.map +1 -1
  212. package/models/models/network-interface/network-interface-container-registration.d.ts +5 -73
  213. package/models/models/network-interface/network-interface-container-registration.d.ts.map +1 -1
  214. package/models/models/network-interface/network-interface-model.d.ts +5 -43
  215. package/models/models/network-interface/network-interface-model.d.ts.map +1 -1
  216. package/models/models/network-interface/network-interface-registration.d.ts +5 -73
  217. package/models/models/network-interface/network-interface-registration.d.ts.map +1 -1
  218. package/models/models/network-interface/types/index.d.ts +2 -16
  219. package/models/models/ota/ota-model.d.ts +11 -39
  220. package/models/models/ota/ota-model.d.ts.map +1 -1
  221. package/models/models/ota/ota-registration.d.ts +5 -77
  222. package/models/models/ota/ota-registration.d.ts.map +1 -1
  223. package/models/models/ota/types/index.d.ts +2 -141
  224. package/models/models/region-info/types/index.d.ts +19 -99
  225. package/models/models/region-info/types/index.d.ts.map +1 -1
  226. package/models/models/software-info/services/software-info-services.d.ts +2 -14
  227. package/models/models/software-info/services/software-info-services.d.ts.map +1 -1
  228. package/models/models/software-info/software-info-model.d.ts +3 -39
  229. package/models/models/software-info/software-info-model.d.ts.map +1 -1
  230. package/models/models/software-info/software-info-registration.d.ts +6 -73
  231. package/models/models/software-info/software-info-registration.d.ts.map +1 -1
  232. package/models/models/software-info/types/index.d.ts +6 -20
  233. package/models/models/state-bean/state-bean-model.d.ts +10 -41
  234. package/models/models/state-bean/state-bean-model.d.ts.map +1 -1
  235. package/models/models/state-bean/state-bean-registration.d.ts +6 -73
  236. package/models/models/state-bean/state-bean-registration.d.ts.map +1 -1
  237. package/models/models/state-bean/types/index.d.ts +4 -84
  238. package/models/models/state-prop/state-prop-model.d.ts +6 -40
  239. package/models/models/state-prop/state-prop-model.d.ts.map +1 -1
  240. package/models/models/state-prop/state-prop-registration.d.ts +6 -73
  241. package/models/models/state-prop/state-prop-registration.d.ts.map +1 -1
  242. package/models/models/state-prop/types/index.d.ts +5 -37
  243. package/models/models/storage-device/storage-device-container-model.d.ts +7 -273
  244. package/models/models/storage-device/storage-device-container-model.d.ts.map +1 -1
  245. package/models/models/storage-device/storage-device-container-registration.d.ts +5 -75
  246. package/models/models/storage-device/storage-device-container-registration.d.ts.map +1 -1
  247. package/models/models/storage-device/storage-device-model.d.ts +3 -49
  248. package/models/models/storage-device/storage-device-model.d.ts.map +1 -1
  249. package/models/models/storage-device/storage-device-registration.d.ts +5 -75
  250. package/models/models/storage-device/storage-device-registration.d.ts.map +1 -1
  251. package/models/models/storage-device/types/index.d.ts +13 -82
  252. package/models/models/studio-properties/studio-properties-model.d.ts +13 -36
  253. package/models/models/studio-properties/studio-properties-model.d.ts.map +1 -1
  254. package/models/models/studio-properties/studio-properties-registration.d.ts +5 -75
  255. package/models/models/studio-properties/studio-properties-registration.d.ts.map +1 -1
  256. package/models/models/studio-properties/types/index.d.ts +2 -24
  257. package/models/models/translation/descriptor-merge.d.ts +13 -17
  258. package/models/models/translation/descriptor-merge.d.ts.map +1 -1
  259. package/models/models/translation/services/translation-services.d.ts +19 -77
  260. package/models/models/translation/services/translation-services.d.ts.map +1 -1
  261. package/models/models/translation/test-harness.d.ts +6 -8
  262. package/models/models/translation/test-harness.d.ts.map +1 -1
  263. package/models/models/translation/translation-container-model.d.ts +7 -59
  264. package/models/models/translation/translation-container-model.d.ts.map +1 -1
  265. package/models/models/translation/translation-container-registration.d.ts +6 -73
  266. package/models/models/translation/translation-container-registration.d.ts.map +1 -1
  267. package/models/models/translation/translation-model.d.ts +17 -50
  268. package/models/models/translation/translation-model.d.ts.map +1 -1
  269. package/models/models/translation/translation-registration.d.ts +6 -73
  270. package/models/models/translation/translation-registration.d.ts.map +1 -1
  271. package/models/models/translation/types/index.d.ts +51 -276
  272. package/models/models/trouble/trouble-registration.d.ts +6 -73
  273. package/models/models/trouble/trouble-registration.d.ts.map +1 -1
  274. package/models/models/trouble/types/index.d.ts +17 -188
  275. package/models/models/trouble/utils/is-trouble-aware.d.ts +4 -85
  276. package/models/models/trouble/utils/is-trouble-aware.d.ts.map +1 -1
  277. package/models/models/trouble-container/trouble-builders.d.ts +11 -0
  278. package/models/models/trouble-container/trouble-builders.d.ts.map +1 -0
  279. package/models/models/trouble-container/trouble-container-model.d.ts +2 -1
  280. package/models/models/trouble-container/trouble-container-model.d.ts.map +1 -1
  281. package/models/models/usb-update/usb-update-container-registration.d.ts +5 -75
  282. package/models/models/usb-update/usb-update-container-registration.d.ts.map +1 -1
  283. package/models/models/usb-update/usb-update-registration.d.ts +5 -75
  284. package/models/models/usb-update/usb-update-registration.d.ts.map +1 -1
  285. package/models/types/cancellable-promise.d.ts +6 -9
  286. package/models/types/cancellable-promise.d.ts.map +1 -1
  287. package/models/utils/await-future-call.d.ts +9 -21
  288. package/models/utils/await-future-call.d.ts.map +1 -1
  289. package/models/utils/cancellable-future-call.d.ts +8 -19
  290. package/models/utils/cancellable-future-call.d.ts.map +1 -1
  291. package/models/utils/cancellable-service.d.ts +14 -23
  292. package/models/utils/cancellable-service.d.ts.map +1 -1
  293. package/models/utils/conversion-utils.d.ts +8 -48
  294. package/models/utils/conversion-utils.d.ts.map +1 -1
  295. package/models/utils/persistence-store.d.ts +1 -1
  296. package/models/utils/service.d.ts +14 -48
  297. package/models/utils/service.d.ts.map +1 -1
  298. package/models/utils/services/kos/daily/service.d.ts +4 -4
  299. package/models/utils/services/vfs/daily/service.d.ts +4 -4
  300. package/models/utils/timer-manager.d.ts.map +1 -1
  301. package/package.json +2 -2
  302. package/{index-D52vEGXT.cjs → software-info-registration-Le3V0a6v.cjs} +11906 -416
  303. package/software-info-registration-Le3V0a6v.cjs.map +1 -0
  304. package/{index-Csq0zQtb.js → software-info-registration-kSGacOka.js} +12116 -625
  305. package/software-info-registration-kSGacOka.js.map +1 -0
  306. package/testing/index.d.ts +32 -34
  307. package/testing/index.d.ts.map +1 -1
  308. package/testing.cjs +2 -1
  309. package/testing.cjs.map +1 -1
  310. package/testing.js +2 -1
  311. package/testing.js.map +1 -1
  312. package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts +9 -0
  313. package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts.map +1 -0
  314. package/ui/components/connection-dev-button/index.d.ts +36 -0
  315. package/ui/components/connection-dev-button/index.d.ts.map +1 -0
  316. package/ui/components/connection-dev-button/use-connection-dev-state.d.ts +29 -0
  317. package/ui/components/connection-dev-button/use-connection-dev-state.d.ts.map +1 -0
  318. package/ui/components/index.d.ts +1 -0
  319. package/ui/components/index.d.ts.map +1 -1
  320. package/ui/features/canvas/hooks/use-image-renderer.d.ts +5 -4
  321. package/ui/features/canvas/hooks/use-image-renderer.d.ts.map +1 -1
  322. package/ui/hooks/use-function-warmup.d.ts +4 -14
  323. package/ui/hooks/use-function-warmup.d.ts.map +1 -1
  324. package/ui/hooks/use-kos-date-formats.d.ts +15 -29
  325. package/ui/hooks/use-kos-date-formats.d.ts.map +1 -1
  326. package/ui/hooks/use-kos-region-timezones.d.ts +4 -55
  327. package/ui/hooks/use-kos-region-timezones.d.ts.map +1 -1
  328. package/ui/hooks/use-kos-regions.d.ts +11 -23
  329. package/ui/hooks/use-kos-regions.d.ts.map +1 -1
  330. package/ui/hooks/use-kos-time-formats.d.ts +16 -31
  331. package/ui/hooks/use-kos-time-formats.d.ts.map +1 -1
  332. package/ui/hooks/use-kos-unit-systems.d.ts +13 -27
  333. package/ui/hooks/use-kos-unit-systems.d.ts.map +1 -1
  334. package/ui/hooks/view-model/use-view-model.d.ts +6 -31
  335. package/ui/hooks/view-model/use-view-model.d.ts.map +1 -1
  336. package/ui/policies/reload-on-disconnect-policy.d.ts +5 -6
  337. package/ui/policies/reload-on-disconnect-policy.d.ts.map +1 -1
  338. package/index-Csq0zQtb.js.map +0 -1
  339. package/index-D52vEGXT.cjs.map +0 -1
@@ -4,46 +4,21 @@ interface Identifiable {
4
4
  id: string;
5
5
  }
6
6
  /**
7
- * Function that transforms an entity's ID before container synchronization.
7
+ * Transforms an entity's id before container synchronization.
8
8
  *
9
- * The IdMapper pattern enables two critical capabilities:
9
+ * Use it to build compound model ids when backend ids are only unique within
10
+ * their parent (for example `"123"` becomes `"release-version-abc-123"`), and
11
+ * to keep the original backend id on a `rawId` field for server calls.
10
12
  *
11
- * 1. **Compound Model IDs**: Transform simple backend IDs into compound IDs that include
12
- * parent context (e.g., `"123"` → `"release-version-abc-123"`). This ensures unique
13
- * model IDs even when backend IDs are only unique within their parent scope.
13
+ * @template D - Input entity type (data from the backend)
14
+ * @template M - Mapped entity type (defaults to D when no transformation is needed)
14
15
  *
15
- * 2. **Backend ID Preservation**: Add a `rawId` property to preserve the original backend ID
16
- * for server communication while using compound IDs for model identity.
17
- *
18
- * @template D - Input entity type (data from backend)
19
- * @template M - Mapped entity type (data after transformation, defaults to D if no transformation)
20
- *
21
- * @example Simple ID prefix transformation
16
+ * @example
22
17
  * ```typescript
23
18
  * const idMapper: IdMapper<User, User & { rawId: string }> = (user) => ({
24
19
  * ...user,
25
20
  * rawId: user.id,
26
- * id: `user-${user.id}`
27
- * });
28
- * ```
29
- *
30
- * @example Compound ID with parent context
31
- * ```typescript
32
- * type WithRawId<T> = T & { rawId: string };
33
- *
34
- * const idMapper: IdMapper<VersionResponse, WithRawId<VersionResponse>> = (version) => ({
35
- * ...version,
36
- * rawId: version.id,
37
- * id: `release-version-${templateId}-${version.id}`
38
- * });
39
- * ```
40
- *
41
- * @example Multi-level compound ID
42
- * ```typescript
43
- * const idMapper: IdMapper<CandidateResponse, WithRawId<CandidateResponse>> = (candidate) => ({
44
- * ...candidate,
45
- * rawId: candidate.id,
46
- * id: `release-candidate-${templateId}-${versionId}-${candidate.id}`
21
+ * id: `user-${user.id}`,
47
22
  * });
48
23
  * ```
49
24
  *
@@ -72,130 +47,47 @@ interface ResolveParams<T extends Container, D extends Identifiable, M extends I
72
47
  /**
73
48
  * Creates a function that synchronizes a container with a new list of entities.
74
49
  *
75
- * This is the primary utility for delta-based container synchronization. It compares incoming
76
- * data against the current container state and performs minimal operations (add/update/remove)
77
- * to achieve synchronization.
78
- *
79
- * Key features:
80
- * - **Delta resolution**: Only processes actual changes (add/update/remove)
81
- * - **ID transformation**: Optional `idMapper` transforms backend IDs to model IDs
82
- * - **Update-in-place**: `onUpdateItem` can update existing models without recreating
83
- * - **Type safety**: Generic type parameters ensure type consistency through transformation
84
- *
85
- * Workflow:
86
- * 1. Apply `idMapper` to transform entity IDs (if provided)
87
- * 2. Calculate deltas: which IDs are missing from new data (removals)
88
- * 3. Invoke `onRemoveItem` for each ID to remove
89
- * 4. For each entity in new data:
90
- * - If model exists: invoke `onUpdateItem` (if provided) or `onAddItem`
91
- * - If model doesn't exist: invoke `onAddItem`
92
- * 5. Add all new models to container in batch
50
+ * Entity ids are first passed through `idMapper`. Ids in the container that are
51
+ * missing from the new list are passed to `onRemoveItem` and the results are
52
+ * removed. Each incoming entity then goes to `onUpdateItem` when a model with
53
+ * that id already exists (and the callback is provided), otherwise to
54
+ * `onAddItem`. Every non-null return value is added to the container in one
55
+ * batch, so `onUpdateItem` returns `null` after updating a model in place.
93
56
  *
94
57
  * @template T - Container type implementing IKosModelContainer
95
- * @template D - Input entity type (data from backend)
58
+ * @template D - Input entity type (data from the backend)
96
59
  * @template M - Mapped entity type (after idMapper transformation, defaults to D)
97
60
  *
98
61
  * @param params - Configuration for resolving deltas
99
62
  * @param params.container - The container to synchronize
100
63
  * @param params.onAddItem - Callback to create a new model from entity data
101
- * @param params.onUpdateItem - Optional callback to update existing model (return null to skip adding)
102
- * @param params.onRemoveItem - Optional callback invoked with each ID to remove (default: identity function)
103
- * @param params.idMapper - Optional function to transform entity IDs before processing
64
+ * @param params.onUpdateItem - Optional callback to update an existing model (return null to skip adding)
65
+ * @param params.onRemoveItem - Optional callback invoked with each id to remove (default: identity function)
66
+ * @param params.idMapper - Optional function to transform entity ids before processing
104
67
  *
105
68
  * @returns A function that accepts entities and synchronizes the container
106
69
  *
107
70
  * @kosService core.container-utils
108
71
  *
109
- * @example Basic synchronization without ID transformation
72
+ * @example
110
73
  * ```typescript
111
74
  * const syncUsers = resolveContainerDeltas({
112
75
  * container: userContainer,
113
76
  * onAddItem: (user) => User.instance(user.id).options(user).build(),
114
77
  * onUpdateItem: (user, existing) => {
115
78
  * existing.updateModel(user);
116
- * return null; // Don't add, just updated in place
79
+ * return null;
117
80
  * },
118
- * onRemoveItem: (id) => id
119
81
  * });
120
82
  * syncUsers(newUserList);
121
83
  * ```
122
- *
123
- * @example ID transformation with compound IDs and rawId preservation
124
- * ```typescript
125
- * type WithRawId<T> = T & { rawId: string };
126
- *
127
- * const syncVersions = resolveContainerDeltas<
128
- * typeof template.versions,
129
- * VersionResponse,
130
- * WithRawId<VersionResponse>
131
- * >({
132
- * container: template.versions,
133
- * idMapper: (versionData) => ({
134
- * ...versionData,
135
- * rawId: versionData.id, // Preserve backend ID
136
- * id: ReleaseIdFactory.version(templateId, versionData.id) // Compound model ID
137
- * }),
138
- * onAddItem: (data) => {
139
- * const model = ReleaseVersion.instance(data.id)
140
- * .options({
141
- * rawId: data.rawId, // Store backend ID for server communication
142
- * version: data.version,
143
- * // ... other options
144
- * })
145
- * .build();
146
- * // Recursively sync nested containers
147
- * syncCandidates(model, data.candidates || []);
148
- * return model;
149
- * },
150
- * onUpdateItem: (data, existingVersion) => {
151
- * existingVersion.updateModel({
152
- * rawId: data.rawId || existingVersion.rawId,
153
- * version: data.version,
154
- * // ... other updates
155
- * });
156
- * // Recursively sync nested containers
157
- * syncCandidates(existingVersion, data.candidates || []);
158
- * return null; // Don't add, just updated in place
159
- * },
160
- * onRemoveItem: (id) => id
161
- * })(versionsData);
162
- * ```
163
- *
164
- * @example Nested container synchronization
165
- * ```typescript
166
- * // Parent level
167
- * syncTemplates(containerModel, templatesData);
168
- *
169
- * // Within onAddItem and onUpdateItem, sync children
170
- * function syncTemplates(container, templates) {
171
- * resolveContainerDeltas({
172
- * container: container.container,
173
- * idMapper: (template) => ({
174
- * ...template,
175
- * rawId: template.id,
176
- * id: ReleaseIdFactory.template(template.id)
177
- * }),
178
- * onAddItem: (template) => {
179
- * const model = createTemplateModel(template);
180
- * syncQueues(model, template.queues); // Nested sync
181
- * syncVersions(model, template.versions); // Nested sync
182
- * return model;
183
- * },
184
- * onUpdateItem: (template, existing) => {
185
- * existing.updateModel(template);
186
- * syncQueues(existing, template.queues); // Nested sync
187
- * syncVersions(existing, template.versions); // Nested sync
188
- * return null;
189
- * }
190
- * })(templates);
191
- * }
192
- * ```
193
84
  * @kosApiLevel 2
194
85
  */
195
86
  export declare const resolveContainerDeltas: <T extends IKosModelContainer<any>, D extends Identifiable, M extends Identifiable = D>({ container, onAddItem, onUpdateItem, onRemoveItem, idMapper, }: ResolveParams<T, D, M>) => (entities: D[]) => void;
196
87
  /**
197
88
  * Creates a function that synchronizes a container model's list with new entities.
198
- * Simpler alternative to resolveContainerDeltas that directly invokes callbacks for each addition and removal.
89
+ * Unlike {@link resolveContainerDeltas} it does not modify the container: it calls
90
+ * `onRemoveItem` for each id that disappeared and `onAddItem` for every incoming entity.
199
91
  *
200
92
  * @template T - Container model type implementing IKosContainerModel
201
93
  * @template D - Input entity type with an id property
@@ -204,14 +96,6 @@ export declare const resolveContainerDeltas: <T extends IKosModelContainer<any>,
204
96
  * @returns A function that accepts entities and synchronizes by invoking callbacks
205
97
  *
206
98
  * @kosService core.container-utils
207
- *
208
- * @example
209
- * const syncLayers = resolveListDeltas({
210
- * container: layerContainer,
211
- * onAddItem: (layer) => addLayer(layer),
212
- * onRemoveItem: (id) => removeLayer(id)
213
- * });
214
- * syncLayers(newLayerList);
215
99
  * @kosApiLevel 2
216
100
  */
217
101
  export declare const resolveListDeltas: <T extends IKosContainerModel<any, any>, D extends Identifiable, M extends Identifiable = D>({ container, onAddItem, onRemoveItem, idMapper, }: ResolveParams<T, D, M>) => (entities: D[]) => void;
@@ -232,8 +116,9 @@ interface ResolveItemsParams<T extends Identifiable, D extends Identifiable, M e
232
116
  idMapper?: IdMapper<D, M>;
233
117
  }
234
118
  /**
235
- * Creates a function that synchronizes a plain array of items with new entities.
236
- * Does not require a container model - works with any array of identifiable items.
119
+ * Creates a function that synchronizes a plain array of identifiable items with
120
+ * new entities. It calls `onRemoveItem` for each id that disappeared and
121
+ * `onAddItem` for every incoming entity.
237
122
  *
238
123
  * @template T - Current item type with an id property
239
124
  * @template D - Input entity type with an id property
@@ -242,34 +127,16 @@ interface ResolveItemsParams<T extends Identifiable, D extends Identifiable, M e
242
127
  * @returns A function that accepts entities and synchronizes the array
243
128
  *
244
129
  * @kosService core.container-utils
245
- *
246
- * @example
247
- * const currentItems = [{ id: '1', name: 'Item 1' }];
248
- * const syncItems = resolveItemListDeltas({
249
- * items: currentItems,
250
- * onAddItem: (item) => currentItems.push(item),
251
- * onRemoveItem: (id) => {
252
- * const index = currentItems.findIndex(i => i.id === id);
253
- * if (index >= 0) currentItems.splice(index, 1);
254
- * }
255
- * });
256
- * syncItems(newItems);
257
130
  * @kosApiLevel 2
258
131
  */
259
132
  export declare const resolveItemListDeltas: <T extends Identifiable, D extends Identifiable, M extends Identifiable = D>({ items, onAddItem, onRemoveItem, idMapper, }: ResolveItemsParams<T, D, M>) => (entities: D[]) => void;
260
133
  /**
261
- * Removes a prefix from an id string if present.
262
- * Useful for normalizing ids that may have parent or namespace prefixes.
134
+ * Removes a leading prefix from an id when present.
263
135
  *
264
136
  * @param id - The id string to process
265
137
  * @param prefix - The prefix to remove (defaults to "parent-")
266
138
  * @returns The id with the prefix removed, or the original id if prefix not found
267
139
  *
268
- * @example
269
- * processId("parent-123") // returns "123"
270
- * processId("parent-abc", "parent-") // returns "abc"
271
- * processId("child-456", "parent-") // returns "child-456"
272
- *
273
140
  * @kosService core.container-utils
274
141
  * @kosApiLevel 2
275
142
  */
@@ -1 +1 @@
1
- {"version":3,"file":"container-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/container-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;CACZ;AAqBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,MAAM,QAAQ,CAClB,CAAC,SAAS,YAAY,GAAG,YAAY,EACrC,CAAC,SAAS,YAAY,GAAG,CAAC,IACxB,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;AAErB,KAAK,SAAS,GAAG,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAExE;;;;;GAKG;AACH,UAAU,aAAa,CACrB,CAAC,SAAS,SAAS,EACnB,CAAC,SAAS,YAAY,EACtB,CAAC,SAAS,YAAY,GAAG,CAAC;IAE1B,mCAAmC;IACnC,SAAS,EAAE,CAAC,CAAC;IACb,4DAA4D;IAC5D,SAAS,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,GAAG,CAAC;IAC9B,2EAA2E;IAC3E,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,GAAG,CAAC;IACnC,6DAA6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CAAC,EAAE,CAAC,CAAC,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,qBAAqB,GAC/B,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,YAAY,GAAG,CAAC,EAAE,+CAK1E,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAC7B,UAAU,CAAC,EAAE,SAKb,CAAC;AAEJ;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,SAAS,GAAI,IAAI,MAAM,EAAE,eAAkB,WAMvD,CAAC"}
1
+ {"version":3,"file":"container-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/container-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;CACZ;AAqBD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,QAAQ,CAClB,CAAC,SAAS,YAAY,GAAG,YAAY,EACrC,CAAC,SAAS,YAAY,GAAG,CAAC,IACxB,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;AAErB,KAAK,SAAS,GAAG,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAExE;;;;;GAKG;AACH,UAAU,aAAa,CACrB,CAAC,SAAS,SAAS,EACnB,CAAC,SAAS,YAAY,EACtB,CAAC,SAAS,YAAY,GAAG,CAAC;IAE1B,mCAAmC;IACnC,SAAS,EAAE,CAAC,CAAC;IACb,4DAA4D;IAC5D,SAAS,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,GAAG,CAAC;IAC9B,2EAA2E;IAC3E,YAAY,CAAC,EAAE,CA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aG;AACH,eAAO,MAAM,qBAAqB,GAC/B,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,YAAY,GAAG,CAAC,EAAE,+CAK1E,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAC7B,UAAU,CAAC,EAAE,SAKb,CAAC;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GAAI,IAAI,MAAM,EAAE,eAAkB,WAMvD,CAAC"}
@@ -34,20 +34,10 @@ interface FormatTimeOptions {
34
34
  interface FormatDateTimeOptions extends FormatDateOptions, FormatTimeOptions {
35
35
  }
36
36
  /**
37
- * Formats a date according to the specified `dateStyle` and locale.
37
+ * Formats a date with `Intl.DateTimeFormat` according to `dateStyle` and locale.
38
38
  *
39
- * Uses `Intl.DateTimeFormat` internally.
40
- *
41
- * - `"short"` uses a custom format: `dd/mm/yyyy` (e.g., `31/12/2025`)
42
- * - Other styles use built-in `Intl` formatting
43
- *
44
- * ### Example Output
45
- * ```ts
46
- * formatDate(new Date("2025-12-31"), { dateStyle: "short" }); // "31/12/2025"
47
- * formatDate(new Date("2025-12-31"), { dateStyle: "medium" }); // "Dec 31, 2025"
48
- * formatDate(new Date("2025-12-31"), { dateStyle: "long" }); // "December 31, 2025"
49
- * formatDate(new Date("2025-12-31"), { dateStyle: "full" }); // "Wednesday, December 31, 2025"
50
- * ```
39
+ * `"short"` uses a numeric year with two-digit month and day in the locale's
40
+ * order (`12/31/2025` in en-US); the other styles use the built-in `Intl` styles.
51
41
  *
52
42
  * @param date - The date object or timestamp to format.
53
43
  * @param options - Options to customize formatting.
@@ -60,17 +50,9 @@ interface FormatDateTimeOptions extends FormatDateOptions, FormatTimeOptions {
60
50
  */
61
51
  export declare const formatDate: (date?: Date | number, { dateStyle, locales }?: FormatDateOptions) => string;
62
52
  /**
63
- * Formats a time according to the specified `timeStyle` and locale.
64
- *
65
- * Uses `Intl.DateTimeFormat` internally.
66
- *
67
- * ### Example Output
68
- * ```ts
69
- * formatTime(new Date("2025-12-31T23:59:59"), { timeStyle: "short" }); // "11:59 PM"
70
- * formatTime(new Date("2025-12-31T23:59:59"), { timeStyle: "medium" }); // "11:59:59 PM"
71
- * formatTime(new Date("2025-12-31T23:59:59"), { timeStyle: "long" }); // "11:59:59 PM EST"
72
- * formatTime(new Date("2025-12-31T23:59:59"), { timeStyle: "full" }); // "11:59 PM Eastern Standard Time"
73
- * ```
53
+ * Formats a time with `Intl.DateTimeFormat` according to `timeStyle` and
54
+ * locale. All styles use a 12-hour clock; `"medium"` and `"long"` add seconds,
55
+ * and `"long"` and `"full"` add the time zone name.
74
56
  *
75
57
  * @param date - The date object or timestamp to extract the time from.
76
58
  * @param options - Options to customize time formatting.
@@ -83,40 +65,9 @@ export declare const formatDate: (date?: Date | number, { dateStyle, locales }?:
83
65
  */
84
66
  export declare const formatTime: (date?: Date | number, { locales, timeStyle }?: FormatTimeOptions) => string;
85
67
  /**
86
- * Formats a date and/or time using custom formatting logic based on `dateStyle` and `timeStyle`.
87
- *
88
- * Uses explicit `Intl.DateTimeFormat` options for full control over the output format.
89
- *
90
- * - `"short"` date is always `dd/mm/yyyy`
91
- * - `"short"` time is always 12-hour format (e.g., `11:59 PM`)
92
- * - Supports combining both formats into a single string
93
- *
94
- * ### Example Output
95
- * ```ts
96
- * formatDateTime(new Date("2025-12-31T23:59:59"), {
97
- * dateStyle: "short",
98
- * timeStyle: "short"
99
- * }); // "31/12/2025, 11:59 PM"
100
- *
101
- * formatDateTime(new Date("2025-12-31T23:59:59"), {
102
- * dateStyle: "medium",
103
- * timeStyle: "medium"
104
- * }); // "Dec 31, 2025, 11:59:59 PM"
105
- *
106
- * formatDateTime(new Date("2025-12-31T23:59:59"), {
107
- * dateStyle: "long",
108
- * timeStyle: "long"
109
- * }); // "December 31, 2025, 11:59:59 PM EST"
110
- *
111
- * formatDateTime(new Date("2025-12-31T23:59:59"), {
112
- * dateStyle: "full",
113
- * timeStyle: "full"
114
- * }); // "Wednesday, December 31, 2025, 11:59 PM Eastern Standard Time"
115
- *
116
- * formatDateTime(new Date("2025-12-31T23:59:59"), {
117
- * timeStyle: "short"
118
- * }); // "11:59 PM"
119
- * ```
68
+ * Formats a date and time in one string with `Intl.DateTimeFormat`. It takes
69
+ * the same `dateStyle` and `timeStyle` names as {@link formatDate} and
70
+ * {@link formatTime}; both default to `"short"` (`12/31/2025, 11:59 PM` in en-US).
120
71
  *
121
72
  * @param date - The `Date` object or timestamp to format.
122
73
  * @param options - Formatting options.
@@ -1 +1 @@
1
- {"version":3,"file":"date-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/date-utils.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,UAWzC;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,OACgB,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MAG1D,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,EAAE,OAAO,MAAM,SAOxD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,IAAI,EAAE,OAAO,MAAM,SAItD,CAAC;AAIF,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IACjD,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC7B;AAED,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IACjD,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC7B;AAED,UAAU,qBAAsB,SAAQ,iBAAiB,EAAE,iBAAiB;CAAG;AA6D/E;;;;;;;;;;;;;;;;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,EAAE,iBAAiB;CAAG;AA6D/E;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,UAAU,GACrB,OAAO,IAAI,GAAG,MAAM,EACpB,yBAAmD,iBAGlD,WAIF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,UAAU,GACrB,OAAO,IAAI,GAAG,MAAM,EACpB,yBAAmD,iBAGlD,WAIF,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,cAAc,GACzB,OAAO,IAAI,GAAG,MAAM,EACpB,qCAIG,qBAIF,WAOF,CAAC"}
@@ -1,6 +1,5 @@
1
1
  /**
2
- * Debounces a function, ensuring it is called after a specified timeout
3
- * has passed since the last invocation.
2
+ * Debounces a function so it runs once the timeout has passed since the last call.
4
3
  *
5
4
  * @param context - The context (this value) to be used when calling the debounced function.
6
5
  * @param func - The function to debounce.
@@ -8,12 +7,6 @@
8
7
  * Defaults to 300 milliseconds.
9
8
  * @returns A debounced version of the provided function.
10
9
  *
11
- * @example
12
- * ```typescript
13
- * const debouncedFn = debounce(this, myFunction, 500);
14
- * debouncedFn(arg1, arg2);
15
- * ```
16
- *
17
10
  * @kosService core.utils
18
11
  * @kosApiLevel 2
19
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/debounce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,iBAAS,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,SAAM,IAQnD,GAAG,MAAM,GAAG,UAarB;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/debounce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,iBAAS,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,SAAM,IAQnD,GAAG,MAAM,GAAG,UAarB;AAED,eAAe,QAAQ,CAAC"}
@@ -19,7 +19,7 @@ export interface KosServiceResponse<T> {
19
19
  */
20
20
  declare let BASE_URL: string;
21
21
  /**
22
- * KOS fetch function — WebSocket-based fetch implementation for KOS transport.
22
+ * Fetch-like function that sends requests over the KOS transport.
23
23
  *
24
24
  * @kosService core.fetch
25
25
  * @kosApiLevel 2
@@ -1 +1 @@
1
- {"version":3,"file":"kos-fetch.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/kos-fetch.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAoBrE;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,EAAE,MAAM,CAAC;CAChB;AA4XD;;;;;GAKG;AACH,QAAA,IAAI,QAAQ,QAAS,CAAC;AACtB;;;;;GAKG;AACH,QAAA,IAAI,QAAQ,QA9OL,MAAM,YACD,eAAe,KACxB,OAAO,CAAC,QAAQ,CA4OM,CAAC;AAY1B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"kos-fetch.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/kos-fetch.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAoBrE;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,EAAE,MAAM,CAAC;CAChB;AA0XD;;;;;GAKG;AACH,QAAA,IAAI,QAAQ,QAAS,CAAC;AACtB;;;;;GAKG;AACH,QAAA,IAAI,QAAQ,QA9OL,MAAM,YACD,eAAe,KACxB,OAAO,CAAC,QAAQ,CA4OM,CAAC;AAW1B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC"}
@@ -160,34 +160,33 @@ export declare const isKosModelReady: (model: IKosDataModel) => boolean;
160
160
  /**
161
161
  * An observable, read-only view of a model's activation lifecycle.
162
162
  *
163
- * Models that fetch lazily do so in `activate()`, so activation state — not
164
- * `loaded`, which tracks the `load()` lifecycle — is what tells a consumer
165
- * whether that fetch has settled and whether it succeeded. Exposing just this
166
- * lets a view react to activation without taking a dependency on the whole
167
- * {@link IKosModel}.
163
+ * Models that fetch lazily do so in `activate()`, so activation state (rather
164
+ * than `loaded`, which tracks `load()`) tells a consumer whether that fetch has
165
+ * settled and whether it succeeded. A view can react to it without depending
166
+ * on the whole {@link IKosModel}.
168
167
  */
169
168
  export interface KosModelActivationState {
170
169
  /** The model's current activation state. */
171
170
  readonly activeStatus: KosModelState;
172
- /** Activation is in flight — nothing conclusive to render yet. */
171
+ /** Activation is in flight, so there is nothing conclusive to render yet. */
173
172
  readonly isActivating: boolean;
174
173
  /** Activation completed; the model's activate() work is done. */
175
174
  readonly isActive: boolean;
176
- /** Activation threw — the model's data is absent, not empty. */
175
+ /** Activation threw, so the model's data is absent rather than empty. */
177
176
  readonly isFailed: boolean;
178
177
  }
179
178
  /**
180
179
  * Retrieves an observable view of a model's activation state.
181
180
  *
182
- * Every member is a getter, so reads happen at access time and stay tracked —
183
- * call this once and read its properties inside a `kosComponent` (or any MobX
184
- * reaction) to re-render as the model activates, succeeds, or fails.
181
+ * Every member is a getter that reads the reactive model at access time. Read
182
+ * its properties inside a `kosComponent` to re-render as the model activates,
183
+ * succeeds or fails.
185
184
  *
186
185
  * @param model - The KOS data model to observe.
187
186
  * @returns The activation view, or `undefined` when the model has no wrapper
188
187
  * yet (not created, or already destroyed).
189
188
  *
190
- * @example Distinguishing "still loading" from "empty" from "failed"
189
+ * @example
191
190
  * ```tsx
192
191
  * const activation = getKosModelActivationState(container);
193
192
  * if (!activation || activation.isActivating) return <Blank />;
@@ -1 +1 @@
1
- {"version":3,"file":"kos-model-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/kos-model-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAkB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlE;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAAU,OAAO,aAAa,kBAGzD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAU,WAAW,aAAa,kBAa5D,CAAC;AACF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,GAAU,OAAO,aAAa,kBAoBvD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAAU,SAAS,MAAM,gCAQpD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,GAAU,CAAC,SAAS,aAAa,GAAG,aAAa,EACvE,SAAS,MAAM;WAQqB,CAAC;;EACtC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,aAAa,GAAG,aAAa,EACrE,SAAS,MAAM;WAOqB,CAAC;;CACtC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,aAAa,EAChD,WAAW,MAAM,EACjB,WAAW;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,KASZ,CAAC,EACrB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,aAAa,EAC/C,WAAW,MAAM,EACjB,WAAW;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,MACU,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,aAAa,EAC1D,OAA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D,SAAS,MAAM,EACf,UAAU,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,KAC9B,SAAS,GAAG,SAWd,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GACpB,CAAC,SAAS,aAAa,EAAE,MAAM,MAAM,MACrC,OAAO,GAAG,KAAG,KAAK,IAAI,CAC4B,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,aAAa,YAMnD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAuB;IACtC,4CAA4C;IAC5C,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC;IACrC,6EAA6E;IAC7E,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,0BAA0B,GACrC,OAAO,aAAa,GAAG,SAAS,KAC/B,uBAAuB,GAAG,SAuB5B,CAAC"}
@@ -1,34 +1,17 @@
1
1
  import { IKosDataModel } from '../core/kosModel';
2
2
  /**
3
- * Creates a property key string based on a given key from a Kos data model.
3
+ * Creates a property key placeholder (`{PROP_<key>}`) for a data model field.
4
4
  *
5
- * Property keys are used by the KOS model framework to provide property expansion in model data.
6
- *
7
- * When create a model dependency or any model metadata that is derived from the existing model data,
8
- * a property key should be used to reference the data model key.
9
- *
10
- * For kos dependencies, propKeys can be used to resolve any dependency options that are derived from the data model.
11
- *
12
- * For topic handlers, the resolved topic can include propKey to allow for dynamic topic resolution based on the data model.
5
+ * Decorator options that depend on model data, such as a `@kosDependency` id
6
+ * or a `@kosTopicHandler` topic, use a property key; the framework replaces it
7
+ * with the model's current value for that field when it resolves the option.
13
8
  *
14
9
  * @param key - The key from a Kos data model.
15
10
  * @returns A property key string enclosed in curly braces with a "PROP_" prefix.
16
11
  *
17
12
  * @example
18
- * // Create a property key for a data model key "name"
19
- * const propertyKey = createPropKey("name");
20
- * // Result: "{PROP_name}"
21
- *
22
- * @example
23
- * // Create a property key for a data model key "id"
24
- * const propertyKey = createPropKey("id");
25
- * // Result: "{PROP_id}"
26
- *
27
- * @example
28
- * The propKey can be used as part of dependency or topic listener to allow for models to
29
- * dynamically change the dependency or topic listener based on the data model.
30
13
  * ```typescript
31
- * @kosDependency({modelType: Ingredient.type, id: propertyKey})
14
+ * @kosDependency({ modelType: Ingredient.type, id: createPropKey("ingredientId") })
32
15
  * ```
33
16
  *
34
17
  * @kosService core.kos-model
@@ -1 +1 @@
1
- {"version":3,"file":"model-attribute-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/model-attribute-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,aAAa,EAAE,KAAK,MAAM,CAAC,WAC1C,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,MAAM,EAAE,KAAK,MAAM,CAAC,WACrC,CAAC"}
1
+ {"version":3,"file":"model-attribute-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/model-attribute-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,aAAa,EAAE,KAAK,MAAM,CAAC,WAC1C,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,MAAM,EAAE,KAAK,MAAM,CAAC,WACrC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"model-type-guards.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/model-type-guards.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,GAAG,KAAG,KAAK,IAAI;IAAE,MAAM,EAAE,MAAM,MAAM,CAAA;CACpC,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,GAAG,KAAG,KAAK,IAAI,aACd,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO,GAAG,KACT,KAAK,IAAI,kBAAkB,CAAC,GAAG,CACyB,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GACvB,WAAW,GAAG,KACb,aAAa,GAAG,aAAa,EAAE,GAAG,SAepC,CAAC"}
1
+ {"version":3,"file":"model-type-guards.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/model-type-guards.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,GAAG,KAAG,KAAK,IAAI;IAAE,MAAM,EAAE,MAAM,MAAM,CAAA;CACpC,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,GAAG,KAAG,KAAK,IAAI,aACd,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO,GAAG,KACT,KAAK,IAAI,kBAAkB,CAAC,GAAG,CAIP,CAAC;AAE5B;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GACvB,WAAW,GAAG,KACb,aAAa,GAAG,aAAa,EAAE,GAAG,SAepC,CAAC"}
@@ -14,44 +14,19 @@ export declare class ModelError extends Error {
14
14
  * @param model - The model being operated on
15
15
  * @param status - Description of the operation status (e.g., "ACTIVE", "INACTIVE")
16
16
  * @returns Object containing the timeout promise and a cancel function
17
- *
18
- * @example
19
- * ```typescript
20
- * const { promise: timeoutPromise, cancel } = rejectAfterDelay(
21
- * MODEL_PROMISE_TIMEOUT_MS,
22
- * myModel,
23
- * 'ACTIVE'
24
- * );
25
- *
26
- * Promise.race([
27
- * myOperation().then(() => cancel()),
28
- * timeoutPromise
29
- * ]);
30
- * ```
31
17
  */
32
18
  export declare const rejectAfterDelay: (ms: number, model: IKosModel, status: string) => {
33
19
  promise: Promise<void>;
34
20
  cancel: () => void;
35
21
  };
36
22
  /**
37
- * Races a promise against a timeout with automatic cleanup.
38
- * Useful for ensuring operations complete within a time limit.
23
+ * Races a promise against a timeout and cancels the timer once either settles.
39
24
  *
40
25
  * @param promise - The operation promise to race
41
26
  * @param timeoutMs - Timeout duration in milliseconds (defaults to MODEL_PROMISE_TIMEOUT_MS)
42
27
  * @param model - The model being operated on
43
28
  * @param status - Description of the operation
44
29
  * @returns Promise that resolves/rejects based on whichever completes first
45
- *
46
- * @example
47
- * ```typescript
48
- * await raceWithTimeout(
49
- * model.transitionToActive(),
50
- * MODEL_PROMISE_TIMEOUT_MS,
51
- * model,
52
- * 'ACTIVE'
53
- * );
54
- * ```
55
30
  */
56
31
  export declare const raceWithTimeout: <T>(promise: Promise<T>, timeoutMs: number | undefined, model: IKosModel, status: string) => Promise<T>;
57
32
  //# sourceMappingURL=promise-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"promise-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/promise-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;GAEG;AACH,qBAAa,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,CAAC,CAeX,CAAC"}
@@ -104,29 +104,11 @@ export declare const ServiceFactory: {
104
104
  * @returns An object with service methods for interacting with the server.
105
105
  *
106
106
  * @example
107
- * // Create a Kos service instance for managing entities.
108
- * const entityService = ServiceFactory.build({
109
- * basePath: "/api/entities",
110
- * getAllPath: "/list",
111
- * getOnePath: "/get",
112
- * deleteModelPath: "/delete",
113
- * addModelPath: "/add",
114
- * modifyModelPath: "/modify",
115
- * });
116
- *
117
- * // Fetch a list of entities.
118
- * const entities = await entityService.getAll({ ordered: true });
119
- *
120
- * // Get details of a specific entity by ID.
121
- * const entityDetails = await entityService.getModelById({ id: "entity123" });
122
- *
123
- * // Add a new entity to the server.
124
- * const newEntity = { name: "New Entity" };
125
- * await entityService.addModel({ model: newEntity });
126
- *
127
- * // Modify an existing entity.
128
- * const updatedEntity = { id: "entity123", name: "Updated Entity" };
129
- * await entityService.modifyModel({ model: updatedEntity });
107
+ * ```typescript
108
+ * const entityService = ServiceFactory.build({ basePath: "/api/entities" });
109
+ * const entities = await entityService.getAll({});
110
+ * await entityService.modifyModel({ id: "entity123", model: { name: "Updated" } });
111
+ * ```
130
112
  */
131
113
  build: ({ destinationAddress, basePath, getAllPath, getOnePath, deleteModelPath, addModelPath, modifyModelPath, mock, }: ServiceFactoryParams) => {
132
114
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"service-factory.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/service-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAOH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAItD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,MAAM;;;CAIlD,CAAC;AAWF;;GAEG;AACH,UAAU,iBAAkB,SAAQ,YAAY;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAA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AC,OAAO,CAAC;QAiLzB;;;;;WAKG;mBAlMA,OAAO,8HAYX,iBAAiB,CAAC,OAAO,CAAC;QA8LzB;;;;;WAKG;oBA5RA,OAAO,mIAWX,cAAc,CAAC,OAAO,CAAC;;CAqR3B,CAAC"}
1
+ {"version":3,"file":"service-factory.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/util/service-factory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAItD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,MAAM;;;CAIlD,CAAC;AAWF;;GAEG;AACH,UAAU,iBAAkB,SAAQ,YAAY;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAyED;;GAEG;AACH,KAAK,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,GACpC,OAAO,CAAC,aAAa,CAAC,GACtB,OAAO,CAAC,UAAU,CAAC,GACnB,OAAO,CAAC,eAAe,CAAC,GACxB,OAAO,CAAC,YAAY,CAAC,GACrB,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAE5B;;GAEG;AACH,UAAU,YAAa,SAAQ,YAAY;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,UAAU,kBAAmB,SAAQ,YAAY;IAC/C,EAAE,EAAE,MAAM,CAAC;CACZ;AAgQD,UAAU,SAAS;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,gBAAgB;IACxB,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,UAAU,UAAU;IAClB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;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